diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-18 14:06:22 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-18 18:53:21 +0200 |
commit | aee75b57f042159d7a82734595cdce5a7903431b (patch) | |
tree | fc2b4654b7d6c12b789b531539ead4f3c707cd22 /avmedia | |
parent | e43c823599afc02109faf8753be31cc8f496c096 (diff) |
avmediaogl: use a create function for player
Change-Id: I4c2cc6e99f84a5e4fe78b179891a03e50485056c
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/opengl/oglmanager.cxx | 9 | ||||
-rw-r--r-- | avmedia/source/opengl/oglplayer.cxx | 11 | ||||
-rw-r--r-- | avmedia/source/opengl/oglplayer.hxx | 6 |
3 files changed, 17 insertions, 9 deletions
diff --git a/avmedia/source/opengl/oglmanager.cxx b/avmedia/source/opengl/oglmanager.cxx index 71d36d34c68c..96676ab5f19c 100644 --- a/avmedia/source/opengl/oglmanager.cxx +++ b/avmedia/source/opengl/oglmanager.cxx @@ -30,10 +30,11 @@ OGLManager::~OGLManager() uno::Reference< media::XPlayer > SAL_CALL OGLManager::createPlayer( const OUString& rURL ) throw (uno::RuntimeException, std::exception) { - // TODO: Here we need to construct our OpenGL player. - // See com::sun::star::media::XManager - OGLPlayer* pPlayer( new OGLPlayer( rURL ) ); - return uno::Reference< media::XPlayer >(pPlayer); + OGLPlayer* pPlayer( new OGLPlayer() ); + if( pPlayer->create(rURL) ) + return uno::Reference< media::XPlayer >(pPlayer); + else + return uno::Reference< media::XPlayer >(); } OUString SAL_CALL OGLManager::getImplementationName() throw ( uno::RuntimeException, std::exception ) diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 5c681700ed60..a59573521a93 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -17,9 +17,8 @@ using namespace com::sun::star; namespace avmedia { namespace ogl { -OGLPlayer::OGLPlayer( const OUString& rUrl) +OGLPlayer::OGLPlayer() : Player_BASE(m_aMutex) - , m_sUrl(rUrl) { } @@ -27,6 +26,12 @@ OGLPlayer::~OGLPlayer() { } +bool OGLPlayer::create( const OUString& rURL ) +{ + m_sURL = rURL; + return true; +} + void SAL_CALL OGLPlayer::start() throw ( uno::RuntimeException, std::exception ) { osl::MutexGuard aGuard(m_aMutex); @@ -129,7 +134,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL OGLPlayer::createFrameGrabber() throw ( uno::RuntimeException, std::exception ) { osl::MutexGuard aGuard(m_aMutex); - OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_sUrl ); + OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_sURL ); return uno::Reference< media::XFrameGrabber >( pFrameGrabber );; } diff --git a/avmedia/source/opengl/oglplayer.hxx b/avmedia/source/opengl/oglplayer.hxx index 69101a6cc1d6..50a9190b930b 100644 --- a/avmedia/source/opengl/oglplayer.hxx +++ b/avmedia/source/opengl/oglplayer.hxx @@ -25,9 +25,11 @@ class OGLPlayer : public cppu::BaseMutex, { public: - OGLPlayer( const OUString& rURL ); + OGLPlayer(); virtual ~OGLPlayer(); + bool create( const OUString& rURL ); + // XPlayer virtual void SAL_CALL start() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL stop() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -51,7 +53,7 @@ public: virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; private: - OUString m_sUrl; + OUString m_sURL; }; } // namespace ogl |