Backout d8dc2724d189 as DSO loading causes issue with VLC of different API levels.
parent
87f61ede8b
commit
9fbcb54631
|
|
@ -14,14 +14,14 @@ endif (USESYSTEMLIBS)
|
|||
|
||||
if (WINDOWS)
|
||||
set(VLC_PLUGIN_LIBRARIES
|
||||
# libvlc.lib
|
||||
# libvlccore.lib
|
||||
libvlc.lib
|
||||
libvlccore.lib
|
||||
)
|
||||
elseif (DARWIN)
|
||||
elseif (LINUX)
|
||||
# Specify a full path to make sure we get a static link
|
||||
set(VLC_PLUGIN_LIBRARIES
|
||||
# ${LIBS_PREBUILT_DIR}/lib/libvlc.a
|
||||
# ${LIBS_PREBUILT_DIR}/lib/libvlccore.a
|
||||
${LIBS_PREBUILT_DIR}/lib/libvlc.a
|
||||
${LIBS_PREBUILT_DIR}/lib/libvlccore.a
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ if (DARWIN)
|
|||
endif (DARWIN)
|
||||
|
||||
if (WINDOWS)
|
||||
if( WORD_SIZE EQUAL 32 )
|
||||
add_subdirectory(quicktime)
|
||||
endif()
|
||||
|
||||
add_subdirectory(cef)
|
||||
add_subdirectory(winmmshim)
|
||||
add_subdirectory(libvlc)
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@
|
|||
#include "vlc/vlc.h"
|
||||
#include "vlc/libvlc_version.h"
|
||||
|
||||
namespace ll_vlc { // <FS:ND/> Put everything into it's own namespace to hide the gstreamer functions in the global namespace with out own overloads
|
||||
#include "vlc_syms.cpp"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class MediaPluginLibVLC :
|
||||
|
|
@ -115,8 +112,6 @@ MediaPluginBase(host_send_func, host_user_data)
|
|||
mURL = std::string();
|
||||
|
||||
setStatus(STATUS_NONE);
|
||||
|
||||
resolveVLCSymbols( );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -608,9 +603,6 @@ bool MediaPluginLibVLC::init()
|
|||
return true;
|
||||
};
|
||||
|
||||
}
|
||||
using namespace ll_vlc; // </FS:ND> End of namespace, add using so we do not have to prefix MediaPluginLibVLC below
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func,
|
||||
|
|
|
|||
|
|
@ -1,141 +0,0 @@
|
|||
|
||||
#define VLC_SYM( FUNC, RETURN, ...) RETURN (*FUNC)(__VA_ARGS__) = NULL;
|
||||
#include "vlc_syms.h"
|
||||
#undef VLC_SYM
|
||||
|
||||
struct Symloader
|
||||
{
|
||||
char const *mName;
|
||||
apr_dso_handle_sym_t *mPPFunc;
|
||||
};
|
||||
|
||||
#define VLC_SYM( FUNC, RETURN, ...) { #FUNC , (apr_dso_handle_sym_t*)&FUNC},
|
||||
Symloader sSyms[] = {
|
||||
#include "vlc_syms.h"
|
||||
{ 0, 0 } };
|
||||
#undef LL_GST_SYM
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
|
||||
#define VLC_REG_KEY "Software\\VideoLAN\\VLC"
|
||||
|
||||
bool openRegKey( HKEY &aKey )
|
||||
{
|
||||
if( ERROR_SUCCESS == ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, VLC_REG_KEY, 0, KEY_QUERY_VALUE, &aKey ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string getVLCDir()
|
||||
{
|
||||
std::string ret;
|
||||
HKEY hKey;
|
||||
|
||||
if( openRegKey( hKey ) )
|
||||
{
|
||||
DWORD dwLen(0);
|
||||
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, nullptr, &dwLen );
|
||||
|
||||
if( dwLen > 0 )
|
||||
{
|
||||
std::vector< char > vctBuffer;
|
||||
vctBuffer.resize( dwLen );
|
||||
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, reinterpret_cast< LPBYTE>(&vctBuffer[ 0 ]), &dwLen );
|
||||
ret = &vctBuffer[0];
|
||||
|
||||
if( ret[ dwLen-1 ] != '\\' )
|
||||
ret += "\\";
|
||||
|
||||
SetDllDirectoryA( ret.c_str() );
|
||||
}
|
||||
::RegCloseKey( hKey );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
std::string getVLCDir() { return ""; }
|
||||
#endif
|
||||
|
||||
static bool sSymsGrabbed = false;
|
||||
static apr_pool_t *sSymGSTDSOMemoryPool = NULL;
|
||||
static std::vector< apr_dso_handle_t* > sLoadedLibraries;
|
||||
|
||||
bool resolveVLCSymbols( std::vector< std::string > const &aDSONames )
|
||||
{
|
||||
if( sSymsGrabbed )
|
||||
return true;
|
||||
|
||||
ll_init_apr();
|
||||
//attempt to load the shared libraries
|
||||
apr_pool_create(&sSymGSTDSOMemoryPool, NULL);
|
||||
|
||||
apr_dso_handle_t *pDSO(NULL);
|
||||
|
||||
for( std::vector< std::string >::const_iterator itr = aDSONames.begin(); itr != aDSONames.end(); ++itr )
|
||||
{
|
||||
apr_dso_handle_t *pDSO( NULL );
|
||||
std::string strDSO = getVLCDir() + *itr;
|
||||
if( APR_SUCCESS == apr_dso_load( &pDSO, strDSO.c_str(), sSymGSTDSOMemoryPool ) )
|
||||
{
|
||||
sLoadedLibraries.push_back( pDSO );
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
OutputDebugStringA( "Cannot load " );
|
||||
OutputDebugStringA( strDSO.c_str() );
|
||||
OutputDebugStringA( "\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
{
|
||||
if( !*sSyms[ i ].mPPFunc )
|
||||
{
|
||||
apr_dso_sym( sSyms[ i ].mPPFunc, pDSO, sSyms[ i ].mName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
{
|
||||
if( !*sSyms[ i ].mPPFunc )
|
||||
{
|
||||
apr_dso_sym( sSyms[ i ].mPPFunc, pDSO, sSyms[ i ].mName );
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream strm;
|
||||
bool sym_error = false;
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
{
|
||||
if( ! *sSyms[ i ].mPPFunc )
|
||||
{
|
||||
sym_error = true;
|
||||
strm << sSyms[ i ].mName << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
#if LL_WINDOWS
|
||||
OutputDebugStringA( strm.str().c_str() );
|
||||
#endif
|
||||
|
||||
sSymsGrabbed = !sym_error;
|
||||
return sSymsGrabbed;
|
||||
}
|
||||
|
||||
|
||||
bool resolveVLCSymbols( )
|
||||
{
|
||||
std::vector< std::string > vDSO;
|
||||
#ifdef LL_WINDOWS
|
||||
vDSO.push_back( "libvlccore.dll" );
|
||||
vDSO.push_back( "libvlc.dll" );
|
||||
#elif LL_LINUX
|
||||
vDSO.push_back( "libvlccore.so" );
|
||||
vDSO.push_back( "libvlc.so" );
|
||||
#endif
|
||||
|
||||
return resolveVLCSymbols( vDSO );
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
VLC_SYM( libvlc_audio_set_volume, int, libvlc_media_player_t *, int )
|
||||
VLC_SYM( libvlc_event_attach, int, libvlc_event_manager_t *, libvlc_event_type_t, libvlc_callback_t, void * )
|
||||
VLC_SYM( libvlc_event_detach, void, libvlc_event_manager_t *, libvlc_event_type_t, libvlc_callback_t, void * )
|
||||
VLC_SYM( libvlc_media_add_option, void, libvlc_media_t *, const char * )
|
||||
VLC_SYM( libvlc_media_get_duration, libvlc_time_t, libvlc_media_t* )
|
||||
VLC_SYM( libvlc_media_get_meta, char*, libvlc_media_t *, libvlc_meta_t )
|
||||
VLC_SYM( libvlc_media_new_location, libvlc_media_t*, libvlc_instance_t *, const char * )
|
||||
VLC_SYM( libvlc_media_player_event_manager, libvlc_event_manager_t*, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_player_get_time, libvlc_time_t, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_player_new_from_media, libvlc_media_player_t*, libvlc_media_t* )
|
||||
VLC_SYM( libvlc_media_player_pause, void, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_player_play, int, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_player_release, void, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_player_set_position, void, libvlc_media_player_t*, float )
|
||||
VLC_SYM( libvlc_media_player_stop, void, libvlc_media_player_t* )
|
||||
VLC_SYM( libvlc_media_release, void, libvlc_media_t* )
|
||||
VLC_SYM( libvlc_new, libvlc_instance_t*, int, const char *const * )
|
||||
VLC_SYM( libvlc_release, void, libvlc_instance_t* )
|
||||
VLC_SYM( libvlc_video_set_callbacks, void, libvlc_media_player_t *, libvlc_video_lock_cb, libvlc_video_unlock_cb, libvlc_video_display_cb, void * )
|
||||
VLC_SYM( libvlc_video_set_format, void, libvlc_media_player_t *, const char *, unsigned, unsigned height, unsigned )
|
||||
|
|
@ -655,11 +655,11 @@ class Windows_i686_Manifest(ViewerManifest):
|
|||
self.path("zh-TW.pak")
|
||||
self.end_prefix()
|
||||
|
||||
# if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"):
|
||||
# self.path("libvlc.dll")
|
||||
# self.path("libvlccore.dll")
|
||||
# self.path("plugins/")
|
||||
# self.end_prefix()
|
||||
if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"):
|
||||
self.path("libvlc.dll")
|
||||
self.path("libvlccore.dll")
|
||||
self.path("plugins/")
|
||||
self.end_prefix()
|
||||
|
||||
# pull in the crash logger and updater from other projects
|
||||
# tag:"crash-logger" here as a cue to the exporter
|
||||
|
|
@ -1342,14 +1342,14 @@ class LinuxManifest(ViewerManifest):
|
|||
self.path("../media_plugins/gstreamer10/libmedia_plugin_gstreamer10.so", "libmedia_plugin_gstreamer10.so")
|
||||
self.end_prefix("bin/llplugin")
|
||||
|
||||
# if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
|
||||
# self.path( "plugins.dat" )
|
||||
# self.path( "*/*.so" )
|
||||
# self.end_prefix()
|
||||
#
|
||||
# if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib' ), dst="lib"):
|
||||
# self.path( "libvlc*.so*" )
|
||||
# self.end_prefix()
|
||||
if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
|
||||
self.path( "plugins.dat" )
|
||||
self.path( "*/*.so" )
|
||||
self.end_prefix()
|
||||
|
||||
if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib' ), dst="lib"):
|
||||
self.path( "libvlc*.so*" )
|
||||
self.end_prefix()
|
||||
|
||||
# CEF files
|
||||
if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'), dst="lib"):
|
||||
|
|
|
|||
Loading…
Reference in New Issue