diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-09 09:21:53 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-09 08:11:34 +0000 |
commit | 538f276ae0414ea34ede6090b5f56e8fecd6fc65 (patch) | |
tree | efbfb952f3236a6f56540ddae6a896c8c73774a0 /avmedia/source/gstreamer/gstplayer.cxx | |
parent | f12e483589888f87843026ceff5ae3c1e615ca02 (diff) |
Formatting changes across all modules
+ Removed comment cruft
+ Tab formatting in number of files
+ Some commented out code removed
+ Tab characters replaced with spaces
+ Newline cleanup in quite a few files
+ Tweak header guard #endifs
Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc
Reviewed-on: https://gerrit.libreoffice.org/22221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'avmedia/source/gstreamer/gstplayer.cxx')
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.cxx | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index fef123fd2553..d77944e98dfa 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -83,6 +83,7 @@ private: void execute() override; }; + class MissingPluginInstaller { friend class MissingPluginInstallerThread; @@ -113,12 +114,14 @@ private: bool inCleanUp_; }; + MissingPluginInstaller::~MissingPluginInstaller() { osl::MutexGuard g(mutex_); SAL_WARN_IF(currentThread_.is(), "avmedia.gstreamer", "unjoined thread"); inCleanUp_ = true; } + void MissingPluginInstaller::report( rtl::Reference<Player> const & source, GstMessage * message) { @@ -169,6 +172,7 @@ void MissingPluginInstaller::report( LINK(this, MissingPluginInstaller, launchUi), launch.get()); } + void eraseSource(std::set<rtl::Reference<Player>> & set, Player const * source) { auto i = std::find_if( @@ -181,6 +185,7 @@ void eraseSource(std::set<rtl::Reference<Player>> & set, Player const * source) } } + void MissingPluginInstaller::detach(Player const * source) { rtl::Reference<MissingPluginInstallerThread> join; { @@ -217,6 +222,7 @@ void MissingPluginInstaller::detach(Player const * source) { } } + void MissingPluginInstaller::processQueue() { assert(!queued_.empty()); assert(currentDetails_.empty()); @@ -228,6 +234,7 @@ void MissingPluginInstaller::processQueue() { queued_.clear(); } + IMPL_STATIC_LINK_TYPED(MissingPluginInstaller, launchUi, void *, p, void) { MissingPluginInstallerThread* thread = static_cast<MissingPluginInstallerThread*>(p); @@ -243,10 +250,12 @@ IMPL_STATIC_LINK_TYPED(MissingPluginInstaller, launchUi, void *, p, void) ref->launch(); } + struct TheMissingPluginInstaller: public rtl::Static<MissingPluginInstaller, TheMissingPluginInstaller> {}; + void MissingPluginInstallerThread::execute() { MissingPluginInstaller & inst = TheMissingPluginInstaller::get(); for (;;) { @@ -273,9 +282,7 @@ void MissingPluginInstallerThread::execute() { } } -} - -// - Player - +} // end anonymous namespace Player::Player() : @@ -315,7 +322,6 @@ Player::Player() : } - Player::~Player() { SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::~Player" ); @@ -323,6 +329,7 @@ Player::~Player() disposing(); } + void SAL_CALL Player::disposing() { TheMissingPluginInstaller::get().detach(this); @@ -357,6 +364,7 @@ void SAL_CALL Player::disposing() } } + static gboolean pipeline_bus_callback( GstBus *, GstMessage *message, gpointer data ) { Player* pPlayer = static_cast<Player*>(data); @@ -366,6 +374,7 @@ static gboolean pipeline_bus_callback( GstBus *, GstMessage *message, gpointer d return TRUE; } + static GstBusSyncReply pipeline_bus_sync_handler( GstBus *, GstMessage * message, gpointer data ) { Player* pPlayer = static_cast<Player*>(data); @@ -373,6 +382,7 @@ static GstBusSyncReply pipeline_bus_sync_handler( GstBus *, GstMessage * message return pPlayer->processSyncMessage( message ); } + void Player::processMessage( GstMessage *message ) { switch( GST_MESSAGE_TYPE( message ) ) { @@ -401,6 +411,7 @@ void Player::processMessage( GstMessage *message ) } } + static gboolean wrap_element_query_position (GstElement *element, GstFormat format, gint64 *cur) { #ifdef AVMEDIA_GST_0_10 @@ -411,6 +422,7 @@ static gboolean wrap_element_query_position (GstElement *element, GstFormat form #endif } + static gboolean wrap_element_query_duration (GstElement *element, GstFormat format, gint64 *duration) { #ifdef AVMEDIA_GST_0_10 @@ -421,6 +433,7 @@ static gboolean wrap_element_query_duration (GstElement *element, GstFormat form #endif } + GstBusSyncReply Player::processSyncMessage( GstMessage *message ) { #if OSL_DEBUG_LEVEL > 0 @@ -543,7 +556,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) g_object_unref( pad ); } } -#endif +#endif // AVMEDIA_GST_0_10 } else if (gst_is_missing_plugin_message(message)) { TheMissingPluginInstaller::get().report(this, message); if( mnWidth == 0 ) { @@ -560,6 +573,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) return GST_BUS_PASS; } + void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) { GstBus *pBus; @@ -599,6 +613,7 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) g_object_unref( pBus ); } + bool Player::create( const OUString& rURL ) { bool bRet = false; @@ -627,7 +642,6 @@ bool Player::create( const OUString& rURL ) } - void SAL_CALL Player::start() throw (uno::RuntimeException, std::exception) { @@ -642,7 +656,6 @@ void SAL_CALL Player::start() } - void SAL_CALL Player::stop() throw (uno::RuntimeException, std::exception) { @@ -657,7 +670,6 @@ void SAL_CALL Player::stop() } - sal_Bool SAL_CALL Player::isPlaying() throw (uno::RuntimeException, std::exception) { @@ -677,7 +689,6 @@ sal_Bool SAL_CALL Player::isPlaying() } - double SAL_CALL Player::getDuration() throw (uno::RuntimeException, std::exception) { @@ -694,7 +705,6 @@ double SAL_CALL Player::getDuration() } - void SAL_CALL Player::setMediaTime( double fTime ) throw (uno::RuntimeException, std::exception) { @@ -716,7 +726,6 @@ void SAL_CALL Player::setMediaTime( double fTime ) } - double SAL_CALL Player::getMediaTime() throw (uno::RuntimeException, std::exception) { @@ -734,6 +743,7 @@ double SAL_CALL Player::getMediaTime() return position; } + void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw (uno::RuntimeException, std::exception) { @@ -743,7 +753,6 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) } - sal_Bool SAL_CALL Player::isPlaybackLoop() throw (uno::RuntimeException, std::exception) { @@ -753,7 +762,6 @@ sal_Bool SAL_CALL Player::isPlaybackLoop() } - void SAL_CALL Player::setMute( sal_Bool bSet ) throw (uno::RuntimeException, std::exception) { @@ -777,7 +785,6 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) } - sal_Bool SAL_CALL Player::isMute() throw (uno::RuntimeException, std::exception) { @@ -787,7 +794,6 @@ sal_Bool SAL_CALL Player::isMute() } - void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw (uno::RuntimeException, std::exception) { @@ -805,7 +811,6 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) } - sal_Int16 SAL_CALL Player::getVolumeDB() throw (uno::RuntimeException, std::exception) { @@ -825,7 +830,6 @@ sal_Int16 SAL_CALL Player::getVolumeDB() } - awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() throw (uno::RuntimeException, std::exception) { @@ -854,7 +858,6 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() } - uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments ) throw (uno::RuntimeException, std::exception) { @@ -896,7 +899,6 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co } - uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw (uno::RuntimeException, std::exception) { @@ -912,7 +914,6 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() } - OUString SAL_CALL Player::getImplementationName() throw (uno::RuntimeException, std::exception) { @@ -920,7 +921,6 @@ OUString SAL_CALL Player::getImplementationName() } - sal_Bool SAL_CALL Player::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException, std::exception) { @@ -928,7 +928,6 @@ sal_Bool SAL_CALL Player::supportsService( const OUString& ServiceName ) } - uno::Sequence< OUString > SAL_CALL Player::getSupportedServiceNames() throw (uno::RuntimeException, std::exception) { |