diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:09:59 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:15 +0100 |
commit | 8697284d248f47dd4798f7ef49791fc7686f646d (patch) | |
tree | 3cc7278e7160aa96242b03dcc683f0ff5f235aa7 /avmedia/source/gstreamer | |
parent | cb0fb3edd43194311a76ad6c0d3adad7f6dfe53d (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ib3f24439ffda42d217300dcc0ca979964ade360a
Diffstat (limited to 'avmedia/source/gstreamer')
-rw-r--r-- | avmedia/source/gstreamer/gstframegrabber.cxx | 18 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.cxx | 42 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstuno.cxx | 2 | ||||
-rw-r--r-- | avmedia/source/gstreamer/gstwindow.cxx | 6 |
4 files changed, 34 insertions, 34 deletions
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index f240530edafc..17ca6b43f90a 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -45,11 +45,11 @@ namespace avmedia { namespace gstreamer { void FrameGrabber::disposePipeline() { - if( mpPipeline != NULL ) + if( mpPipeline != nullptr ) { gst_element_set_state( mpPipeline, GST_STATE_NULL ); g_object_unref( G_OBJECT( mpPipeline ) ); - mpPipeline = NULL; + mpPipeline = nullptr; } } @@ -69,9 +69,9 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) : #endif OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() ); - GError *pError = NULL; + GError *pError = nullptr; mpPipeline = gst_parse_launch( pPipelineStr, &pError ); - if( pError != NULL) { + if( pError != nullptr) { g_warning( "Failed to construct frame-grabber pipeline '%s'\n", pError->message ); g_error_free( pError ); disposePipeline(); @@ -90,7 +90,7 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) : } } if( mpPipeline && - gst_element_get_state( mpPipeline, NULL, NULL, 5 * GST_SECOND ) == GST_STATE_CHANGE_FAILURE ) + gst_element_get_state( mpPipeline, nullptr, nullptr, 5 * GST_SECOND ) == GST_STATE_CHANGE_FAILURE ) disposePipeline(); } @@ -122,8 +122,8 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe if( !pSink ) return xRet; - GstBuffer *pBuf = NULL; - GstCaps *pCaps = NULL; + GstBuffer *pBuf = nullptr; + GstCaps *pCaps = nullptr; // synchronously fetch the frame #ifdef AVMEDIA_GST_0_10 @@ -131,7 +131,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe if( pBuf ) pCaps = GST_BUFFER_CAPS( pBuf ); #else - GstSample *pSample = NULL; + GstSample *pSample = nullptr; g_signal_emit_by_name( pSink, "pull-preroll", &pSample, NULL ); if( pSample ) @@ -164,7 +164,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe #endif ) { - sal_uInt8 *pData = NULL; + sal_uInt8 *pData = nullptr; #ifdef AVMEDIA_GST_0_10 pData = GST_BUFFER_DATA( pBuf ); #else diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index e458c1590c9e..ffac2987cb2e 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -288,7 +288,7 @@ void MissingPluginInstallerThread::execute() { Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : GstPlayer_BASE( m_aMutex ), mxMgr( rxMgr ), - mpPlaybin( NULL ), + mpPlaybin( nullptr ), mbFakeVideo (false ), mnUnmutedVolume( 0 ), mbPlayPending ( false ), @@ -296,7 +296,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : mbLooping( false ), mbInitialized( false ), mnWindowID( 0 ), - mpXOverlay( NULL ), + mpXOverlay( nullptr ), mnDuration( 0 ), mnWidth( 0 ), mnHeight( 0 ), @@ -308,13 +308,13 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : char name[] = "libreoffice"; char *arguments[] = { name }; char** argv = arguments; - GError* pError = NULL; + GError* pError = nullptr; mbInitialized = gst_init_check( &argc, &argv, &pError ); DBG( "%p Player::Player", this ); - if (pError != NULL) + if (pError != nullptr) { // TODO: throw an exception? DBG( "%p Player::Player error '%s'", this, pError->message ); @@ -349,12 +349,12 @@ void SAL_CALL Player::disposing() gst_element_set_state( mpPlaybin, GST_STATE_NULL ); g_object_unref( G_OBJECT( mpPlaybin ) ); - mpPlaybin = NULL; + mpPlaybin = nullptr; } if( mpXOverlay ) { g_object_unref( G_OBJECT ( mpXOverlay ) ); - mpXOverlay = NULL; + mpXOverlay = nullptr; } } @@ -394,7 +394,7 @@ void Player::processMessage( GstMessage *message ) if( message->src == GST_OBJECT( mpPlaybin ) ) { GstState newstate, pendingstate; - gst_message_parse_state_changed (message, NULL, &newstate, &pendingstate); + gst_message_parse_state_changed (message, nullptr, &newstate, &pendingstate); if( newstate == GST_STATE_PAUSED && pendingstate == GST_STATE_VOID_PENDING && @@ -471,7 +471,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) if( message->src == GST_OBJECT( mpPlaybin ) ) { GstState newstate, pendingstate; - gst_message_parse_state_changed (message, NULL, &newstate, &pendingstate); + gst_message_parse_state_changed (message, nullptr, &newstate, &pendingstate); DBG( "%p state change received, new state %d pending %d", this, (int)newstate, (int)pendingstate ); @@ -487,11 +487,11 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) } if( mnWidth == 0 ) { - GList *pStreamInfo = NULL; + GList *pStreamInfo = nullptr; g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, NULL ); - for ( ; pStreamInfo != NULL; pStreamInfo = pStreamInfo->next) { + for ( ; pStreamInfo != nullptr; pStreamInfo = pStreamInfo->next) { GObject *pInfo = G_OBJECT( pStreamInfo->data ); if( !pInfo ) @@ -530,7 +530,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) mnDuration = gst_duration; } if( mnWidth == 0 ) { - GstPad *pad = NULL; + GstPad *pad = nullptr; g_signal_emit_by_name( mpPlaybin, "get-video-pad", 0, &pad ); @@ -576,14 +576,14 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) { GstBus *pBus; - if( mpPlaybin != NULL ) { + if( mpPlaybin != nullptr ) { gst_element_set_state( mpPlaybin, GST_STATE_NULL ); mbPlayPending = false; g_object_unref( mpPlaybin ); } - mpPlaybin = gst_element_factory_make( "playbin", NULL ); - if( pSink != NULL ) // used for getting preferred size etc. + mpPlaybin = gst_element_factory_make( "playbin", nullptr ); + if( pSink != nullptr ) // used for getting preferred size etc. { g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL ); mbFakeVideo = true; @@ -606,7 +606,7 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) #ifdef AVMEDIA_GST_0_10 gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); #else - gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, NULL ); + gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, nullptr ); #endif g_object_unref( pBus ); } @@ -622,7 +622,7 @@ bool Player::create( const OUString& rURL ) if( mbInitialized && !rURL.isEmpty() ) { // fakesink for pre-roll & sizing ... - preparePlaybin( rURL, gst_element_factory_make( "fakesink", NULL ) ); + preparePlaybin( rURL, gst_element_factory_make( "fakesink", nullptr ) ); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); mbPlayPending = false; @@ -646,7 +646,7 @@ void SAL_CALL Player::start() ::osl::MutexGuard aGuard(m_aMutex); // set the pipeline state to READY and run the loop - if( mbInitialized && NULL != mpPlaybin ) + if( mbInitialized && nullptr != mpPlaybin ) { gst_element_set_state( mpPlaybin, GST_STATE_PLAYING ); mbPlayPending = true; @@ -879,7 +879,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co awt::Size aSize( getPreferredPlayerWindowSize() ); if( mbFakeVideo ) - preparePlaybin( maURL, NULL ); + preparePlaybin( maURL, nullptr ); DBG( "Player::createPlayerWindow %d %d length: %d", aSize.Width, aSize.Height, rArguments.getLength() ); @@ -894,14 +894,14 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co sal_IntPtr pIntPtr = 0; rArguments[ 2 ] >>= pIntPtr; SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr ); - const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : NULL; + const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : nullptr; OSL_ASSERT(pEnvData); if (pEnvData) { mnWindowID = pEnvData->aWindow; DBG( "set window id to %d XOverlay %p\n", (int)mnWindowID, mpXOverlay); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); - if ( mpXOverlay != NULL ) + if ( mpXOverlay != nullptr ) gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); } } @@ -916,7 +916,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw (uno::RuntimeException, std::exception) { ::osl::MutexGuard aGuard(m_aMutex); - FrameGrabber* pFrameGrabber = NULL; + FrameGrabber* pFrameGrabber = nullptr; const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) ) diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx index b72a355d5a4d..ba3ecc8d3f3b 100644 --- a/avmedia/source/gstreamer/gstuno.cxx +++ b/avmedia/source/gstreamer/gstuno.cxx @@ -42,7 +42,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno: extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediagst_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) { uno::Reference< lang::XSingleServiceFactory > xFactory; - void* pRet = 0; + void* pRet = nullptr; if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 ) { diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx index e3c5cc96f980..bee5f0a7ff0c 100644 --- a/avmedia/source/gstreamer/gstwindow.cxx +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -33,13 +33,13 @@ namespace avmedia { namespace gstreamer { static ::osl::Mutex& ImplGetOwnStaticMutex() { - static ::osl::Mutex* pMutex = NULL; + static ::osl::Mutex* pMutex = nullptr; - if( pMutex == NULL ) + if( pMutex == nullptr ) { ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( pMutex == NULL ) + if( pMutex == nullptr ) { static ::osl::Mutex aMutex; pMutex = &aMutex; |