- attempt to fix build for users with libvlc version older than 1.1.13
This commit is contained in:
parent
68bfe9e455
commit
19573a5f12
|
@ -9,7 +9,7 @@
|
||||||
# LIBVLC_LIBRARY
|
# LIBVLC_LIBRARY
|
||||||
# LIBVLC_VERSION
|
# LIBVLC_VERSION
|
||||||
# LIBVLC_VERSION_PRE_V2
|
# LIBVLC_VERSION_PRE_V2
|
||||||
# LIBVLC_VERSION_PRE_1_1_13
|
# LIBVLC_VERSION_PRE_1_1_0
|
||||||
|
|
||||||
if(NOT LIBVLC_MIN_VERSION)
|
if(NOT LIBVLC_MIN_VERSION)
|
||||||
set(LIBVLC_MIN_VERSION "0.0")
|
set(LIBVLC_MIN_VERSION "0.0")
|
||||||
|
@ -95,8 +95,8 @@ if (LIBVLC_FOUND)
|
||||||
if(LIBVLC_VERSION STRLESS "2.0.0")
|
if(LIBVLC_VERSION STRLESS "2.0.0")
|
||||||
set(LIBVLC_VERSION_PRE_V2 TRUE)
|
set(LIBVLC_VERSION_PRE_V2 TRUE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
if(LIBVLC_VERSION STRLESS "1.1.13")
|
if(LIBVLC_VERSION STRLESS "1.1.0")
|
||||||
set(LIBVLC_VERSION_PRE_1_1_13 TRUE)
|
set(LIBVLC_VERSION_PRE_1_1_0 TRUE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
if (NOT LIBVLC_FIND_QUIETLY)
|
if (NOT LIBVLC_FIND_QUIETLY)
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void display(void *data, void *id) {
|
||||||
if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__);
|
if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAS_LIBVLC) && defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(HAS_LIBVLC) && defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
static void catchError(libvlc_exception_t *ex) {
|
static void catchError(libvlc_exception_t *ex) {
|
||||||
if(libvlc_exception_raised(ex)) {
|
if(libvlc_exception_raised(ex)) {
|
||||||
fprintf(stderr, "exception: %s\n", libvlc_exception_get_message(ex));
|
fprintf(stderr, "exception: %s\n", libvlc_exception_get_message(ex));
|
||||||
|
@ -482,7 +482,7 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
ctxPtr->vlc_argv.push_back(ctxPtr->vlc_argv_str[ctxPtr->vlc_argv_str.size()-1].c_str());
|
ctxPtr->vlc_argv.push_back(ctxPtr->vlc_argv_str[ctxPtr->vlc_argv_str.size()-1].c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
char clock[64], cunlock[64], cdata[64];
|
char clock[64], cunlock[64], cdata[64];
|
||||||
char cwidth[32], cheight[32], cpitch[32];
|
char cwidth[32], cheight[32], cpitch[32];
|
||||||
/*
|
/*
|
||||||
|
@ -558,7 +558,7 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
*/
|
*/
|
||||||
if(verboseEnabled) printf("Trying [%s]\n",getenv("VLC_PLUGIN_PATH"));
|
if(verboseEnabled) printf("Trying [%s]\n",getenv("VLC_PLUGIN_PATH"));
|
||||||
|
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_exception_t ex;
|
libvlc_exception_t ex;
|
||||||
libvlc_exception_init(&ex);
|
libvlc_exception_init(&ex);
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(ctxPtr->libvlc != NULL) {
|
if(ctxPtr->libvlc != NULL) {
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
ctxPtr->m = libvlc_media_new(ctxPtr->libvlc, mediaURL.c_str(), &ex);
|
ctxPtr->m = libvlc_media_new(ctxPtr->libvlc, mediaURL.c_str(), &ex);
|
||||||
if(verboseEnabled) printf("In [%s] Line: %d, m [%p]\n",__FUNCTION__,__LINE__,ctxPtr->m);
|
if(verboseEnabled) printf("In [%s] Line: %d, m [%p]\n",__FUNCTION__,__LINE__,ctxPtr->m);
|
||||||
|
|
||||||
|
@ -880,7 +880,7 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(LIBVLC_VERSION_PRE_2) && !defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if !defined(LIBVLC_VERSION_PRE_2) && !defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_video_set_callbacks(ctxPtr->mp, lock, unlock, display, ctxPtr);
|
libvlc_video_set_callbacks(ctxPtr->mp, lock, unlock, display, ctxPtr);
|
||||||
libvlc_video_set_format(ctxPtr->mp, "RV16", width, height, this->surface->pitch);
|
libvlc_video_set_format(ctxPtr->mp, "RV16", width, height, this->surface->pitch);
|
||||||
|
|
||||||
|
@ -888,7 +888,7 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
|
|
||||||
ctxPtr->isPlaying = true;
|
ctxPtr->isPlaying = true;
|
||||||
|
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
int play_result = libvlc_media_player_play(ctxPtr->mp,&ex);
|
int play_result = libvlc_media_player_play(ctxPtr->mp,&ex);
|
||||||
#else
|
#else
|
||||||
int play_result = 0;
|
int play_result = 0;
|
||||||
|
@ -972,7 +972,7 @@ void VideoPlayer::closePlayer() {
|
||||||
//
|
//
|
||||||
// Stop stream and clean up libVLC
|
// Stop stream and clean up libVLC
|
||||||
//
|
//
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_media_player_stop(ctxPtr->mp,&ex);
|
libvlc_media_player_stop(ctxPtr->mp,&ex);
|
||||||
catchError(&ex);
|
catchError(&ex);
|
||||||
#else
|
#else
|
||||||
|
@ -1032,7 +1032,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
vlc_argv.push_back(fullPluginsParam.c_str());
|
vlc_argv.push_back(fullPluginsParam.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
char clock[64], cunlock[64], cdata[64];
|
char clock[64], cunlock[64], cdata[64];
|
||||||
char cwidth[32], cheight[32], cpitch[32];
|
char cwidth[32], cheight[32], cpitch[32];
|
||||||
//
|
//
|
||||||
|
@ -1102,7 +1102,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
//
|
//
|
||||||
if(verboseEnabled) printf("Trying [%s]\n",getenv("VLC_PLUGIN_PATH"));
|
if(verboseEnabled) printf("Trying [%s]\n",getenv("VLC_PLUGIN_PATH"));
|
||||||
|
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_exception_t ex;
|
libvlc_exception_t ex;
|
||||||
libvlc_exception_init(&ex);
|
libvlc_exception_init(&ex);
|
||||||
|
|
||||||
|
@ -1164,7 +1164,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
//
|
//
|
||||||
|
|
||||||
if(libvlc != NULL) {
|
if(libvlc != NULL) {
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
m = libvlc_media_new(libvlc, filename.c_str(), &ex);
|
m = libvlc_media_new(libvlc, filename.c_str(), &ex);
|
||||||
if(verboseEnabled) printf("In [%s] Line: %d, m [%p]\n",__FUNCTION__,__LINE__,m);
|
if(verboseEnabled) printf("In [%s] Line: %d, m [%p]\n",__FUNCTION__,__LINE__,m);
|
||||||
|
|
||||||
|
@ -1181,7 +1181,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
#endif
|
#endif
|
||||||
libvlc_media_release(m);
|
libvlc_media_release(m);
|
||||||
|
|
||||||
#if !defined(LIBVLC_VERSION_PRE_2) && !defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if !defined(LIBVLC_VERSION_PRE_2) && !defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_video_set_callbacks(mp, lock, unlock, display, ctxPtr);
|
libvlc_video_set_callbacks(mp, lock, unlock, display, ctxPtr);
|
||||||
libvlc_video_set_format(mp, "RV16", width, height, this->surface->pitch);
|
libvlc_video_set_format(mp, "RV16", width, height, this->surface->pitch);
|
||||||
|
|
||||||
|
@ -1201,7 +1201,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ctxPtr->isPlaying = true;
|
ctxPtr->isPlaying = true;
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
int play_result = libvlc_media_player_play(mp,&ex);
|
int play_result = libvlc_media_player_play(mp,&ex);
|
||||||
#else
|
#else
|
||||||
int play_result = libvlc_media_player_play(mp);
|
int play_result = libvlc_media_player_play(mp);
|
||||||
|
@ -1228,7 +1228,7 @@ void VideoPlayer::PlayVideo() {
|
||||||
//
|
//
|
||||||
/ Stop stream and clean up libVLC
|
/ Stop stream and clean up libVLC
|
||||||
//
|
//
|
||||||
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
|
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0)
|
||||||
libvlc_media_player_stop(mp,&ex);
|
libvlc_media_player_stop(mp,&ex);
|
||||||
catchError(&ex);
|
catchError(&ex);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user