diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-08 13:02:48 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-08 13:02:48 +0100 |
commit | 55cf933020ad39a3b691c400ff3df855e2c0c67f (patch) | |
tree | b1f9a1b4dfe4622b6cdc2b060c25b760edf1fa6e /avmedia | |
parent | ad875044d10a74e092aa3b89989fd94f343da844 (diff) |
impress210: some unix fixes
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/gstreamer/gstframegrabber.cxx | 8 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstframegrabber.hxx | 6 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.cxx | 34 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.hxx | 4 |
4 files changed, 29 insertions, 23 deletions
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index bd55e11f8afe..432054e95ae9 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -42,12 +42,18 @@ const gulong GRAB_TIMEOUT = 10000000; // ---------------- FrameGrabber::FrameGrabber( GString* pURI ) : - Player( pURI ), mpFrameMutex( g_mutex_new() ), mpFrameCond( g_cond_new() ), mpLastPixbuf( NULL ), mbIsInGrabMode( false ) { + if( pURI ) + { + OSL_TRACE( ">>> --------------------------------" ); + OSL_TRACE( ">>> Creating Player object with URL: %s", pURI->str ); + + mpThread = g_thread_create( Player::implThreadFunc, this, true, NULL ); + } } // ------------------------------------------------------------------------------ diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx index 9a7ec1b74102..fac2e298fb2c 100644 --- a/avmedia/source/gstreamer/gstframegrabber.hxx +++ b/avmedia/source/gstreamer/gstframegrabber.hxx @@ -34,6 +34,7 @@ #ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_ #include "com/sun/star/media/XFrameGrabber.hdl" #endif +#include <cppuhelper/implbase1.hxx> namespace avmedia { namespace gst { @@ -41,9 +42,8 @@ namespace avmedia { namespace gst { // - FrameGrabber - // ---------------- -class FrameGrabber : public Player, - public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XFrameGrabber, - ::com::sun::star::lang::XServiceInfo > +class FrameGrabber : + public ::cppu::ImplInheritanceHelper1 < Player,::com::sun::star::media::XFrameGrabber > { public: diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 06ca9bef2ca2..0e5ffcac0f01 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -189,7 +189,7 @@ Player* Player::create( const ::rtl::OUString& rURL ) void SAL_CALL Player::start() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && !isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PLAYING ); @@ -200,7 +200,7 @@ void SAL_CALL Player::start() void SAL_CALL Player::stop() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); @@ -212,7 +212,7 @@ sal_Bool SAL_CALL Player::isPlaying() throw( uno::RuntimeException ) { GstState aState = GST_STATE_NULL; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( mpPlayer ) { gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ); @@ -225,7 +225,7 @@ sal_Bool SAL_CALL Player::isPlaying() double SAL_CALL Player::getDuration() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); gint64 nDuration = 0; if( implInitPlayer() ) @@ -247,7 +247,7 @@ double SAL_CALL Player::getDuration() void SAL_CALL Player::setMediaTime( double fTime ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { fTime = ::std::min( ::std::max( fTime, 0.0 ), getDuration() ); @@ -263,7 +263,7 @@ double SAL_CALL Player::getMediaTime() throw( uno::RuntimeException ) { double fRet = 0.0; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { GstFormat aFormat = GST_FORMAT_TIME; @@ -303,7 +303,7 @@ double SAL_CALL Player::getStopTime() Currently no need for implementation since higher levels of code don't set a stop time ATM !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time */ - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( getDuration() ); } @@ -334,7 +334,7 @@ double SAL_CALL Player::getRate() void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( bSet && !isPlaybackLoop() ) g_atomic_int_inc( &mnLooping ); else if( !bSet && isPlaybackLoop() ) @@ -345,7 +345,7 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) sal_Bool SAL_CALL Player::isPlaybackLoop() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( g_atomic_int_get( &mnLooping ) > 0 ); } @@ -353,7 +353,7 @@ sal_Bool SAL_CALL Player::isPlaybackLoop() void SAL_CALL Player::setMute( sal_Bool bSet ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( bSet != isMute() ) ) { if( bSet ) @@ -372,7 +372,7 @@ sal_Bool SAL_CALL Player::isMute() throw( uno::RuntimeException ) { gdouble fGstVolume = 1.0; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { @@ -386,7 +386,7 @@ sal_Bool SAL_CALL Player::isMute() void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { g_mutex_lock( mpMutex ); @@ -405,7 +405,7 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) sal_Int16 SAL_CALL Player::getVolumeDB() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( static_cast< sal_Int16 >( g_atomic_int_get( &mnVolumeDB ) ) ); } @@ -414,7 +414,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() throw( uno::RuntimeException ) { awt::Size aSize( 0, 0 ); - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( g_atomic_int_get( &mnIsVideoSource ) > 0 ) ) { @@ -439,7 +439,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); uno::Reference< ::media::XPlayerWindow > xRet; awt::Size aSize( getPreferredPlayerWindowSize() ); @@ -483,7 +483,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw( ::com::sun::star::uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); FrameGrabber* pFrameGrabber = NULL; const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); @@ -498,7 +498,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() // ------------------------------------------------------------------------------ void SAL_CALL Player::disposing() { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( mpPlayer ) { stop(); diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index 8388f00b9f15..7d40728840a6 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -70,7 +70,7 @@ public: static Player* create( const ::rtl::OUString& rURL ); ~Player(); -protected: +//protected: // XPlayer virtual void SAL_CALL start() throw( ::com::sun::star::uno::RuntimeException ); @@ -166,6 +166,7 @@ protected: return( g_atomic_int_get( &mnInitialized ) > 0 ); } + static gpointer implThreadFunc( gpointer pData ); private: @@ -186,7 +187,6 @@ private: static gboolean implIdleFunc( gpointer pData ); - static gpointer implThreadFunc( gpointer pData ); static GstBusSyncReply implHandleCreateWindowFunc( GstBus* pBus, GstMessage* pMsg, |