diff options
21 files changed, 204 insertions, 122 deletions
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx index e71d03be9320..8b348f456f31 100644 --- a/avmedia/source/vlc/vlcframegrabber.cxx +++ b/avmedia/source/vlc/vlcframegrabber.cxx @@ -35,7 +35,7 @@ namespace }; } -VLCFrameGrabber::VLCFrameGrabber( VLC::EventHandler& eh, const rtl::OUString& url ) +VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString& url ) : FrameGrabber_BASE() , mInstance( sizeof( VLC_ARGS ) / sizeof( VLC_ARGS[0] ), VLC_ARGS ) , mMedia( url, mInstance ) @@ -51,7 +51,7 @@ VLCFrameGrabber::VLCFrameGrabber( VLC::EventHandler& eh, const rtl::OUString& ur const rtl::OUString& fileName = utl::TempFile::CreateTempName(); { - VLC::EventManager manager( mPlayer, mEventHandler ); + wrapper::EventManager manager( mPlayer, mEventHandler ); manager.onPaused(boost::bind(&osl::Condition::set, &condition)); if ( !mPlayer.play() ) diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx index c6a1a11d193e..51ba6191b225 100644 --- a/avmedia/source/vlc/vlcframegrabber.hxx +++ b/avmedia/source/vlc/vlcframegrabber.hxx @@ -26,11 +26,6 @@ #include "vlccommon.hxx" #include "wrapper/Wrapper.hxx" -namespace VLC -{ - class EventHandler; -} - namespace avmedia { namespace vlc { @@ -39,18 +34,22 @@ typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber, class VLCFrameGrabber : public FrameGrabber_BASE { - VLC::Instance mInstance; - VLC::Media mMedia; - VLC::Player mPlayer; - VLC::EventHandler& mEventHandler; + wrapper::Instance mInstance; + wrapper::Media mMedia; + wrapper::Player mPlayer; + wrapper::EventHandler& mEventHandler; public: - VLCFrameGrabber( VLC::EventHandler& eh, const rtl::OUString& url ); + VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString& url ); - ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw ( ::com::sun::star::uno::RuntimeException ); + ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) + throw ( ::com::sun::star::uno::RuntimeException ); - ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException ); - ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& serviceName ) throw ( ::com::sun::star::uno::RuntimeException ); - ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( ::com::sun::star::uno::RuntimeException ); + ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& serviceName ) + throw ( ::com::sun::star::uno::RuntimeException ); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw ( ::com::sun::star::uno::RuntimeException ); }; } diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx index c09609359f32..e99416df8f5d 100644 --- a/avmedia/source/vlc/vlcmanager.cxx +++ b/avmedia/source/vlc/vlcmanager.cxx @@ -37,7 +37,7 @@ Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : mEventHandler() , mxMgr( rxMgr ) { - using namespace VLC; + using namespace wrapper; static bool success = Instance::LoadSymbols() && EventManager::LoadSymbols() && Media::LoadSymbols() && Player::LoadSymbols() && Common::LoadSymbols(); diff --git a/avmedia/source/vlc/vlcmanager.hxx b/avmedia/source/vlc/vlcmanager.hxx index b8cb15cfea4f..30274d8bef14 100644 --- a/avmedia/source/vlc/vlcmanager.hxx +++ b/avmedia/source/vlc/vlcmanager.hxx @@ -30,8 +30,8 @@ namespace vlc { class Manager : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XManager, ::com::sun::star::lang::XServiceInfo > { - boost::scoped_ptr<VLC::Instance> mInstance; - VLC::EventHandler mEventHandler; + boost::scoped_ptr<wrapper::Instance> mInstance; + wrapper::EventHandler mEventHandler; public: Manager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); ~Manager(); diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx index 0974d1245059..77678c06ab9c 100644 --- a/avmedia/source/vlc/vlcplayer.cxx +++ b/avmedia/source/vlc/vlcplayer.cxx @@ -22,8 +22,8 @@ namespace } VLCPlayer::VLCPlayer( const rtl::OUString& url, - VLC::Instance& instance, - VLC::EventHandler& eh ) + wrapper::Instance& instance, + wrapper::EventHandler& eh ) : VLC_Base( m_aMutex ) , mInstance( instance ) , mEventHandler( eh ) diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx index 3da58c6e8b98..be50c4c8dc1f 100644 --- a/avmedia/source/vlc/vlcplayer.hxx +++ b/avmedia/source/vlc/vlcplayer.hxx @@ -42,19 +42,19 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, class VLCPlayer : public ::cppu::BaseMutex, public VLC_Base { - VLC::Instance& mInstance; - VLC::EventHandler& mEventHandler; + wrapper::Instance& mInstance; + wrapper::EventHandler& mEventHandler; - VLC::Media mMedia; - VLC::Player mPlayer; - VLC::EventManager mEventManager; + wrapper::Media mMedia; + wrapper::Player mPlayer; + wrapper::EventManager mEventManager; const rtl::OUString mUrl; bool mPlaybackLoop; ::com::sun::star::uno::Reference< css::media::XFrameGrabber > mrFrameGrabber; public: VLCPlayer( const rtl::OUString& url, - VLC::Instance& instance, - VLC::EventHandler& eh ); + wrapper::Instance& instance, + wrapper::EventHandler& eh ); void SAL_CALL start() throw ( ::com::sun::star::uno::RuntimeException ); void SAL_CALL stop() throw ( ::com::sun::star::uno::RuntimeException ); diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx index 6bdaa67c3284..70320a96d184 100644 --- a/avmedia/source/vlc/vlcwindow.cxx +++ b/avmedia/source/vlc/vlcwindow.cxx @@ -6,8 +6,11 @@ using namespace ::com::sun::star; namespace avmedia { namespace vlc { -const ::rtl::OUString AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Window_VLC"; -const ::rtl::OUString AVMEDIA_VLC_WINDOW_SERVICENAME = "com.sun.star.media.Window_VLC"; +namespace +{ + const ::rtl::OUString AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Window_VLC"; + const ::rtl::OUString AVMEDIA_VLC_WINDOW_SERVICENAME = "com.sun.star.media.Window_VLC"; +} VLCWindow::VLCWindow() { diff --git a/avmedia/source/vlc/wrapper/Common.cxx b/avmedia/source/vlc/wrapper/Common.cxx index 456ff3c078da..a85103845ae9 100644 --- a/avmedia/source/vlc/wrapper/Common.cxx +++ b/avmedia/source/vlc/wrapper/Common.cxx @@ -9,13 +9,17 @@ #include "Common.hxx" #include "SymbolLoader.hxx" -namespace VLC -{ namespace { - const char* (*libvlc_get_version)(void); + const char* ( *libvlc_get_version ) (void); } +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ bool Common::LoadSymbols() { ApiMap VLC_COMMON_API[] = @@ -30,4 +34,6 @@ const char* Common::Version() { return libvlc_get_version(); } +} +} }
\ No newline at end of file diff --git a/avmedia/source/vlc/wrapper/Common.hxx b/avmedia/source/vlc/wrapper/Common.hxx index 7a7ea8442e44..edfb3386b46b 100644 --- a/avmedia/source/vlc/wrapper/Common.hxx +++ b/avmedia/source/vlc/wrapper/Common.hxx @@ -10,7 +10,11 @@ #ifndef _WRAPPER_COMMON_HXX #define _WRAPPER_COMMON_HXX -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { class Common { @@ -19,6 +23,8 @@ namespace VLC static const char* Version(); }; } +} +} #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/avmedia/source/vlc/wrapper/EventHandler.cxx b/avmedia/source/vlc/wrapper/EventHandler.cxx index 188ccbc698c0..666ac94208d9 100644 --- a/avmedia/source/vlc/wrapper/EventHandler.cxx +++ b/avmedia/source/vlc/wrapper/EventHandler.cxx @@ -9,7 +9,11 @@ #include "EventHandler.hxx" -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { EventHandler::EventHandler() : ::osl::Thread() @@ -35,7 +39,8 @@ void EventHandler::run() callback(); } while ( true ); } - +} +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/avmedia/source/vlc/wrapper/EventHandler.hxx b/avmedia/source/vlc/wrapper/EventHandler.hxx index 31bc0048f3cf..cef2fdbca21f 100644 --- a/avmedia/source/vlc/wrapper/EventHandler.hxx +++ b/avmedia/source/vlc/wrapper/EventHandler.hxx @@ -10,12 +10,17 @@ #ifndef _WRAPPER_EVENT_HANDLER_HXX #define _WRAPPER_EVENT_HANDLER_HXX #include <boost/function.hpp> +#include <boost/noncopyable.hpp> #include <salhelper/thread.hxx> #include "ThreadsafeQueue.hxx" -namespace VLC +namespace avmedia { - class EventHandler : public ::osl::Thread +namespace vlc +{ +namespace wrapper +{ + class EventHandler : public ::osl::Thread, boost::noncopyable { public: EventHandler(); @@ -26,9 +31,11 @@ namespace VLC public: typedef boost::function< void() > TCallback; - avmedia::vlc::ThreadsafeQueue< TCallback > mCallbackQueue; + ThreadsafeQueue< TCallback > mCallbackQueue; }; } +} +} #endif // _WRAPPER_EVENT_HANDLER_HXX diff --git a/avmedia/source/vlc/wrapper/EventManager.cxx b/avmedia/source/vlc/wrapper/EventManager.cxx index 0aac04151aec..db18765b2e32 100644 --- a/avmedia/source/vlc/wrapper/EventManager.cxx +++ b/avmedia/source/vlc/wrapper/EventManager.cxx @@ -12,25 +12,28 @@ #include "EventHandler.hxx" #include "Types.hxx" -namespace VLC +namespace { - namespace - { - libvlc_event_manager_t* ( *libvlc_media_player_event_manager ) ( libvlc_media_player_t *p_mi ); - int ( *libvlc_event_attach ) ( libvlc_event_manager_t *p_event_manager, - libvlc_event_type_t i_event_type, - libvlc_callback_t f_callback, - void *user_data ); - void ( *libvlc_event_detach ) ( libvlc_event_manager_t *p_event_manager, - libvlc_event_type_t i_event_type, - libvlc_callback_t f_callback, - void *p_user_data ); - } + libvlc_event_manager_t* ( *libvlc_media_player_event_manager ) ( libvlc_media_player_t *p_mi ); + int ( *libvlc_event_attach ) ( libvlc_event_manager_t *p_event_manager, + libvlc_event_type_t i_event_type, + libvlc_callback_t f_callback, + void *user_data ); + void ( *libvlc_event_detach ) ( libvlc_event_manager_t *p_event_manager, + libvlc_event_type_t i_event_type, + libvlc_callback_t f_callback, + void *p_user_data ); +} +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ void EventManager::Handler( const libvlc_event_t *event, void *pData ) { EventManager *instance = static_cast<EventManager*>( pData ); - std::cout << "HANDLER" << std::endl; switch ( event->type ) { case libvlc_MediaPlayerPaused: @@ -54,7 +57,7 @@ bool EventManager::LoadSymbols() return InitApiMap( VLC_EVENT_MANAGER_API ); } -EventManager::EventManager( VLC::Player& player, VLC::EventHandler& eh ) +EventManager::EventManager( Player& player, EventHandler& eh ) : mEventHandler( eh ) , mManager( libvlc_media_player_event_manager( player ) ) { @@ -80,7 +83,8 @@ void EventManager::onEndReached( const Callback& callback ) mOnEndReached = callback; registerSignal( libvlc_MediaPlayerEndReached, callback ); } - +} +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/EventManager.hxx b/avmedia/source/vlc/wrapper/EventManager.hxx index 5efdc07a29e6..b29aea360273 100644 --- a/avmedia/source/vlc/wrapper/EventManager.hxx +++ b/avmedia/source/vlc/wrapper/EventManager.hxx @@ -11,30 +11,33 @@ #define _WRAPPER_EVENT_MANAGER_HXX #include <boost/function.hpp> -#include <boost/shared_ptr.hpp> - +#include <boost/noncopyable.hpp> #include "Player.hxx" struct libvlc_event_manager_t; struct libvlc_event_t; -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { class EventHandler; - class EventManager + class EventManager : boost::noncopyable { public: static bool LoadSymbols(); typedef boost::function<void()> Callback; - EventManager( VLC::Player& player, VLC::EventHandler& eh ); + EventManager( Player& player, EventHandler& eh ); void onPaused( const Callback& callback = Callback() ); void onEndReached( const Callback& callback = Callback() ); private: - VLC::EventHandler& mEventHandler; + EventHandler& mEventHandler; typedef boost::function< void() > TCallback; libvlc_event_manager_t *mManager; TCallback mOnPaused; @@ -45,6 +48,8 @@ namespace VLC static void Handler( const libvlc_event_t *event, void *pData ); }; } +} +} #endif diff --git a/avmedia/source/vlc/wrapper/Instance.cxx b/avmedia/source/vlc/wrapper/Instance.cxx index 8ec473275ede..4d117d68c6c0 100644 --- a/avmedia/source/vlc/wrapper/Instance.cxx +++ b/avmedia/source/vlc/wrapper/Instance.cxx @@ -10,15 +10,19 @@ #include "Instance.hxx" #include "SymbolLoader.hxx" -namespace VLC +namespace { - namespace - { - libvlc_instance_t* ( *libvlc_new ) ( int argc, const char * const *argv ); - void ( *libvlc_release ) ( libvlc_instance_t *p_instance ); - void ( *libvlc_retain ) ( libvlc_instance_t *p_instance ); - } + libvlc_instance_t* ( *libvlc_new ) ( int argc, const char * const *argv ); + void ( *libvlc_release ) ( libvlc_instance_t *p_instance ); + void ( *libvlc_retain ) ( libvlc_instance_t *p_instance ); +} +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ bool Instance::LoadSymbols() { ApiMap VLC_INSTANCE_API[] = @@ -38,7 +42,7 @@ namespace VLC Instance::Instance( const Instance& other ) { - operator=(other); + operator=( other ); } const Instance& Instance::operator=( const Instance& other ) @@ -53,7 +57,8 @@ namespace VLC { libvlc_release( mInstance ); } - +} +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/Instance.hxx b/avmedia/source/vlc/wrapper/Instance.hxx index 9e6577ea2cc2..0f8c6f987989 100644 --- a/avmedia/source/vlc/wrapper/Instance.hxx +++ b/avmedia/source/vlc/wrapper/Instance.hxx @@ -12,7 +12,11 @@ struct libvlc_instance_t; -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { class Instance { @@ -32,6 +36,8 @@ namespace VLC libvlc_instance_t *mInstance; }; } +} +} #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/Media.cxx b/avmedia/source/vlc/wrapper/Media.cxx index 0df5cbf6d747..d0538df1a860 100644 --- a/avmedia/source/vlc/wrapper/Media.cxx +++ b/avmedia/source/vlc/wrapper/Media.cxx @@ -14,23 +14,28 @@ #include "Types.hxx" struct libvlc_instance_t; -namespace VLC + +namespace avmedia { - namespace - { - libvlc_media_t* ( *libvlc_media_new_path ) ( libvlc_instance_t *p_instance, const char *path ); - void ( *libvlc_media_release ) ( libvlc_media_t *p_md ); - void ( *libvlc_media_retain ) ( libvlc_media_t *p_md ); - libvlc_time_t ( *libvlc_media_get_duration ) ( libvlc_media_t *p_md ); +namespace vlc +{ +namespace wrapper +{ +namespace +{ + libvlc_media_t* ( *libvlc_media_new_path ) ( libvlc_instance_t *p_instance, const char *path ); + void ( *libvlc_media_release ) ( libvlc_media_t *p_md ); + void ( *libvlc_media_retain ) ( libvlc_media_t *p_md ); + libvlc_time_t ( *libvlc_media_get_duration ) ( libvlc_media_t *p_md ); - libvlc_media_t* InitMedia( const rtl::OUString& url, VLC::Instance& instance ) - { - rtl::OString dest; - url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0); + libvlc_media_t* InitMedia( const rtl::OUString& url, Instance& instance ) + { + rtl::OString dest; + url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0); - return libvlc_media_new_path(instance, dest.getStr()); - } + return libvlc_media_new_path(instance, dest.getStr()); } +} bool Media::LoadSymbols() { @@ -52,7 +57,7 @@ Media::Media( const rtl::OUString& url, Instance& instance ) Media::Media( const Media& other ) { - operator=(other); + operator=( other ); } const Media& Media::operator=( const Media& other ) @@ -77,7 +82,8 @@ Media::~Media() { libvlc_media_release( mMedia ); } - +} +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/Media.hxx b/avmedia/source/vlc/wrapper/Media.hxx index a79edb321ccb..26627eb90eb2 100644 --- a/avmedia/source/vlc/wrapper/Media.hxx +++ b/avmedia/source/vlc/wrapper/Media.hxx @@ -14,7 +14,11 @@ struct libvlc_media_t; namespace rtl { class OUString; } -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { class Instance; class Media @@ -38,6 +42,8 @@ namespace VLC libvlc_media_t *mMedia; }; } +} +} #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/Player.cxx b/avmedia/source/vlc/wrapper/Player.cxx index 657dd23c07da..e5d4f64d7bec 100644 --- a/avmedia/source/vlc/wrapper/Player.cxx +++ b/avmedia/source/vlc/wrapper/Player.cxx @@ -14,40 +14,47 @@ #include "SymbolLoader.hxx" struct libvlc_media_t; -namespace VLC + +namespace { - namespace - { - void ( *libvlc_media_player_retain ) ( libvlc_media_player_t *p_mi ); - libvlc_media_player_t * ( *libvlc_media_player_new_from_media ) ( libvlc_media_t *p_md ); - void ( *libvlc_media_player_release ) ( libvlc_media_player_t *p_mi ); - int ( *libvlc_media_player_play ) ( libvlc_media_player_t *p_mi ); - void ( *libvlc_media_player_pause ) ( libvlc_media_player_t *p_mi ); - int ( *libvlc_media_player_is_playing ) ( libvlc_media_player_t *p_mi ); - void ( *libvlc_media_player_stop ) ( libvlc_media_player_t *p_mi ); - void ( *libvlc_media_player_set_time ) ( libvlc_media_player_t *p_mi, libvlc_time_t i_time ); - libvlc_time_t ( *libvlc_media_player_get_time ) ( libvlc_media_player_t *p_mi ); - float ( *libvlc_media_player_get_rate )( libvlc_media_player_t *p_mi ); - int ( *libvlc_audio_set_volume ) ( libvlc_media_player_t *p_mi, int i_volume ); - int ( *libvlc_audio_get_volume ) ( libvlc_media_player_t *p_mi ); - int ( *libvlc_audio_get_mute ) ( libvlc_media_player_t *p_mi ); - void ( *libvlc_audio_set_mute ) ( libvlc_media_player_t *p_mi, int status ); - int ( *libvlc_video_take_snapshot ) ( libvlc_media_player_t *p_mi, unsigned num, - const char *psz_filepath, unsigned int i_width, - unsigned int i_height ); + void ( *libvlc_media_player_retain ) ( libvlc_media_player_t *p_mi ); + libvlc_media_player_t * ( *libvlc_media_player_new_from_media ) ( libvlc_media_t *p_md ); + void ( *libvlc_media_player_release ) ( libvlc_media_player_t *p_mi ); + int ( *libvlc_media_player_play ) ( libvlc_media_player_t *p_mi ); + void ( *libvlc_media_player_pause ) ( libvlc_media_player_t *p_mi ); + int ( *libvlc_media_player_is_playing ) ( libvlc_media_player_t *p_mi ); + void ( *libvlc_media_player_stop ) ( libvlc_media_player_t *p_mi ); + void ( *libvlc_media_player_set_time ) ( libvlc_media_player_t *p_mi, libvlc_time_t i_time ); + libvlc_time_t ( *libvlc_media_player_get_time ) ( libvlc_media_player_t *p_mi ); + float ( *libvlc_media_player_get_rate )( libvlc_media_player_t *p_mi ); + int ( *libvlc_audio_set_volume ) ( libvlc_media_player_t *p_mi, int i_volume ); + int ( *libvlc_audio_get_volume ) ( libvlc_media_player_t *p_mi ); + int ( *libvlc_audio_get_mute ) ( libvlc_media_player_t *p_mi ); + void ( *libvlc_audio_set_mute ) ( libvlc_media_player_t *p_mi, int status ); + int ( *libvlc_video_take_snapshot ) ( libvlc_media_player_t *p_mi, + unsigned num, + const char *psz_filepath, + unsigned int i_width, + unsigned int i_height ); #if defined UNX - void ( *libvlc_media_player_set_xwindow ) ( libvlc_media_player_t *p_mi, uint32_t drawable ); + void ( *libvlc_media_player_set_xwindow ) ( libvlc_media_player_t *p_mi, uint32_t drawable ); #elif defined MACOSX - void ( *libvlc_media_player_set_nsobject ) ( libvlc_media_player_t *p_mi, void *drawable ); + void ( *libvlc_media_player_set_nsobject ) ( libvlc_media_player_t *p_mi, void *drawable ); #elif defined WNT - void ( *libvlc_media_player_set_hwnd ) ( libvlc_media_player_t *p_mi, void *drawable ); + void ( *libvlc_media_player_set_hwnd ) ( libvlc_media_player_t *p_mi, void *drawable ); #else #error unknown OS #endif - unsigned ( *libvlc_media_player_has_vout ) ( libvlc_media_player_t *p_mi ); - void ( *libvlc_video_set_mouse_input ) ( libvlc_media_player_t *p_mi, unsigned on); - } + unsigned ( *libvlc_media_player_has_vout ) ( libvlc_media_player_t *p_mi ); + void ( *libvlc_video_set_mouse_input ) ( libvlc_media_player_t *p_mi, unsigned on); +} +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ bool Player::LoadSymbols() { ApiMap VLC_PLAYER_API[] = @@ -190,5 +197,7 @@ namespace VLC return libvlc_media_player_has_vout( mPlayer ); } } +} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/vlc/wrapper/Player.hxx b/avmedia/source/vlc/wrapper/Player.hxx index ba38026d873b..fa387cbc1e83 100644 --- a/avmedia/source/vlc/wrapper/Player.hxx +++ b/avmedia/source/vlc/wrapper/Player.hxx @@ -20,7 +20,11 @@ namespace rtl class OUString; } -namespace VLC +namespace avmedia +{ +namespace vlc +{ +namespace wrapper { class Media; class Player @@ -63,6 +67,8 @@ namespace VLC libvlc_media_player_t *mPlayer; }; } +} +} #endif diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx index a49e4bf6b6f2..b463e75051d9 100644 --- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx +++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx @@ -19,6 +19,12 @@ #define SYM_MAP(a) { #a, (SymbolFunc *)&a } +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ typedef void (*SymbolFunc) (void); struct ApiMap @@ -70,7 +76,7 @@ namespace ( aModule, OUString::createFromAscii( pMap[ i ].symName ).pData ); if ( !aMethod ) { - std::cerr << "Cannot load method " << pMap[ i ].symName << std::endl; + SAL_WARN("avmedia", "Cannot load method " << pMap[ i ].symName); *pMap[ i ].refValue = NULL; return false; } @@ -82,8 +88,6 @@ namespace } } -namespace VLC -{ template<size_t N> bool InitApiMap( const ApiMap ( &pMap )[N] ) { @@ -98,7 +102,7 @@ namespace VLC if( aModule == NULL) { - std::cerr << "Cannot load libvlc" << std::endl; + SAL_WARN("avmedia", "Cannot load libvlc"); return false; } @@ -112,6 +116,8 @@ namespace VLC return false; } } +} +} #endif diff --git a/avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx b/avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx index 52360d4bfe02..f2868a388294 100644 --- a/avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx +++ b/avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx @@ -24,9 +24,12 @@ #include <osl/conditn.hxx> #include <boost/noncopyable.hpp> -namespace avmedia { -namespace vlc { - +namespace avmedia +{ +namespace vlc +{ +namespace wrapper +{ template<class T> class ThreadsafeQueue : boost::noncopyable { @@ -70,7 +73,7 @@ void ThreadsafeQueue<T>::pop( T& data ) data = mQueue.front(); mQueue.pop(); } - +} } } |