Kaydet (Commit) 8697284d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: Ib3f24439ffda42d217300dcc0ca979964ade360a
üst cb0fb3ed
...@@ -200,7 +200,7 @@ MediaControl::~MediaControl() ...@@ -200,7 +200,7 @@ MediaControl::~MediaControl()
void MediaControl::dispose() void MediaControl::dispose()
{ {
maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL ); maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, nullptr );
mpZoomListBox.disposeAndClear(); mpZoomListBox.disposeAndClear();
maTimeEdit.disposeAndClear(); maTimeEdit.disposeAndClear();
maZoomToolBox.disposeAndClear(); maZoomToolBox.disposeAndClear();
...@@ -485,7 +485,7 @@ IMPL_LINK_TYPED( MediaControl, implSelectHdl, ToolBox*, p, void ) ...@@ -485,7 +485,7 @@ IMPL_LINK_TYPED( MediaControl, implSelectHdl, ToolBox*, p, void )
OUString aURL; OUString aURL;
if (::avmedia::MediaWindow::executeMediaURLDialog( if (::avmedia::MediaWindow::executeMediaURLDialog(
GetParent(), aURL, 0)) GetParent(), aURL, nullptr))
{ {
if( !::avmedia::MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true ) ) if( !::avmedia::MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true ) )
::avmedia::MediaWindow::executeFormatErrorBox( this ); ::avmedia::MediaWindow::executeFormatErrorBox( this );
......
...@@ -28,7 +28,7 @@ namespace avmedia { ...@@ -28,7 +28,7 @@ namespace avmedia {
ResMgr* GetResMgr() ResMgr* GetResMgr()
{ {
static ResMgr* pResMgr = NULL; static ResMgr* pResMgr = nullptr;
if( !pResMgr ) if( !pResMgr )
{ {
......
...@@ -80,7 +80,7 @@ MediaFloater::~MediaFloater() ...@@ -80,7 +80,7 @@ MediaFloater::~MediaFloater()
void MediaFloater::dispose() void MediaFloater::dispose()
{ {
delete mpMediaWindow; delete mpMediaWindow;
mpMediaWindow = NULL; mpMediaWindow = nullptr;
SfxDockingWindow::dispose(); SfxDockingWindow::dispose();
} }
...@@ -103,7 +103,7 @@ void MediaFloater::ToggleFloatingMode() ...@@ -103,7 +103,7 @@ void MediaFloater::ToggleFloatingMode()
if (mpMediaWindow) if (mpMediaWindow)
mpMediaWindow->updateMediaItem( aRestoreItem ); mpMediaWindow->updateMediaItem( aRestoreItem );
delete mpMediaWindow; delete mpMediaWindow;
mpMediaWindow = NULL; mpMediaWindow = nullptr;
SfxDockingWindow::ToggleFloatingMode(); SfxDockingWindow::ToggleFloatingMode();
...@@ -145,7 +145,7 @@ void MediaFloater::dispatchCurrentURL() ...@@ -145,7 +145,7 @@ void MediaFloater::dispatchCurrentURL()
if( pDispatcher ) if( pDispatcher )
{ {
OUString url; OUString url;
if (mpMediaWindow != 0) { if (mpMediaWindow != nullptr) {
url = mpMediaWindow->getURL(); url = mpMediaWindow->getURL();
} }
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, url ); const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, url );
......
...@@ -140,7 +140,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed: ...@@ -140,7 +140,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
// Create a temp file with which json parser can work. // Create a temp file with which json parser can work.
OUString sTempFileURL; OUString sTempFileURL;
const ::osl::FileBase::RC aErr = const ::osl::FileBase::RC aErr =
::osl::FileBase::createTempFile(0, 0, &sTempFileURL); ::osl::FileBase::createTempFile(nullptr, nullptr, &sTempFileURL);
if (::osl::FileBase::E_None != aErr) if (::osl::FileBase::E_None != aErr)
{ {
SAL_WARN("avmedia.opengl", "Cannot create temp file"); SAL_WARN("avmedia.opengl", "Cannot create temp file");
......
...@@ -82,13 +82,13 @@ css::uno::Sequence< css::uno::Type > SAL_CALL SoundHandler::getTypes() throw( cs ...@@ -82,13 +82,13 @@ css::uno::Sequence< css::uno::Type > SAL_CALL SoundHandler::getTypes() throw( cs
/* And we don't must use a mutex at every call! */ /* And we don't must use a mutex at every call! */
/* For the first call; pTypeCollection is NULL - */ /* For the first call; pTypeCollection is NULL - */
/* for the second call pTypeCollection is different from NULL! */ /* for the second call pTypeCollection is different from NULL! */
static ::cppu::OTypeCollection* pTypeCollection = NULL ; static ::cppu::OTypeCollection* pTypeCollection = nullptr ;
if ( pTypeCollection == NULL ) if ( pTypeCollection == nullptr )
{ {
/* Ready for multithreading; get global mutex for first call of this method only! see before */ /* Ready for multithreading; get global mutex for first call of this method only! see before */
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
/* Control these pointer again ... it can be, that another instance will be faster then these! */ /* Control these pointer again ... it can be, that another instance will be faster then these! */
if ( pTypeCollection == NULL ) if ( pTypeCollection == nullptr )
{ {
/* Create a static typecollection ... */ /* Create a static typecollection ... */
static ::cppu::OTypeCollection aTypeCollection static ::cppu::OTypeCollection aTypeCollection
......
...@@ -45,11 +45,11 @@ namespace avmedia { namespace gstreamer { ...@@ -45,11 +45,11 @@ namespace avmedia { namespace gstreamer {
void FrameGrabber::disposePipeline() void FrameGrabber::disposePipeline()
{ {
if( mpPipeline != NULL ) if( mpPipeline != nullptr )
{ {
gst_element_set_state( mpPipeline, GST_STATE_NULL ); gst_element_set_state( mpPipeline, GST_STATE_NULL );
g_object_unref( G_OBJECT( mpPipeline ) ); g_object_unref( G_OBJECT( mpPipeline ) );
mpPipeline = NULL; mpPipeline = nullptr;
} }
} }
...@@ -69,9 +69,9 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) : ...@@ -69,9 +69,9 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) :
#endif #endif
OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() ); OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() );
GError *pError = NULL; GError *pError = nullptr;
mpPipeline = gst_parse_launch( pPipelineStr, &pError ); 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_warning( "Failed to construct frame-grabber pipeline '%s'\n", pError->message );
g_error_free( pError ); g_error_free( pError );
disposePipeline(); disposePipeline();
...@@ -90,7 +90,7 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) : ...@@ -90,7 +90,7 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) :
} }
} }
if( mpPipeline && 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(); disposePipeline();
} }
...@@ -122,8 +122,8 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe ...@@ -122,8 +122,8 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
if( !pSink ) if( !pSink )
return xRet; return xRet;
GstBuffer *pBuf = NULL; GstBuffer *pBuf = nullptr;
GstCaps *pCaps = NULL; GstCaps *pCaps = nullptr;
// synchronously fetch the frame // synchronously fetch the frame
#ifdef AVMEDIA_GST_0_10 #ifdef AVMEDIA_GST_0_10
...@@ -131,7 +131,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe ...@@ -131,7 +131,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
if( pBuf ) if( pBuf )
pCaps = GST_BUFFER_CAPS( pBuf ); pCaps = GST_BUFFER_CAPS( pBuf );
#else #else
GstSample *pSample = NULL; GstSample *pSample = nullptr;
g_signal_emit_by_name( pSink, "pull-preroll", &pSample, NULL ); g_signal_emit_by_name( pSink, "pull-preroll", &pSample, NULL );
if( pSample ) if( pSample )
...@@ -164,7 +164,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe ...@@ -164,7 +164,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
#endif #endif
) )
{ {
sal_uInt8 *pData = NULL; sal_uInt8 *pData = nullptr;
#ifdef AVMEDIA_GST_0_10 #ifdef AVMEDIA_GST_0_10
pData = GST_BUFFER_DATA( pBuf ); pData = GST_BUFFER_DATA( pBuf );
#else #else
......
...@@ -288,7 +288,7 @@ void MissingPluginInstallerThread::execute() { ...@@ -288,7 +288,7 @@ void MissingPluginInstallerThread::execute() {
Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
GstPlayer_BASE( m_aMutex ), GstPlayer_BASE( m_aMutex ),
mxMgr( rxMgr ), mxMgr( rxMgr ),
mpPlaybin( NULL ), mpPlaybin( nullptr ),
mbFakeVideo (false ), mbFakeVideo (false ),
mnUnmutedVolume( 0 ), mnUnmutedVolume( 0 ),
mbPlayPending ( false ), mbPlayPending ( false ),
...@@ -296,7 +296,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : ...@@ -296,7 +296,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mbLooping( false ), mbLooping( false ),
mbInitialized( false ), mbInitialized( false ),
mnWindowID( 0 ), mnWindowID( 0 ),
mpXOverlay( NULL ), mpXOverlay( nullptr ),
mnDuration( 0 ), mnDuration( 0 ),
mnWidth( 0 ), mnWidth( 0 ),
mnHeight( 0 ), mnHeight( 0 ),
...@@ -308,13 +308,13 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : ...@@ -308,13 +308,13 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
char name[] = "libreoffice"; char name[] = "libreoffice";
char *arguments[] = { name }; char *arguments[] = { name };
char** argv = arguments; char** argv = arguments;
GError* pError = NULL; GError* pError = nullptr;
mbInitialized = gst_init_check( &argc, &argv, &pError ); mbInitialized = gst_init_check( &argc, &argv, &pError );
DBG( "%p Player::Player", this ); DBG( "%p Player::Player", this );
if (pError != NULL) if (pError != nullptr)
{ {
// TODO: throw an exception? // TODO: throw an exception?
DBG( "%p Player::Player error '%s'", this, pError->message ); DBG( "%p Player::Player error '%s'", this, pError->message );
...@@ -349,12 +349,12 @@ void SAL_CALL Player::disposing() ...@@ -349,12 +349,12 @@ void SAL_CALL Player::disposing()
gst_element_set_state( mpPlaybin, GST_STATE_NULL ); gst_element_set_state( mpPlaybin, GST_STATE_NULL );
g_object_unref( G_OBJECT( mpPlaybin ) ); g_object_unref( G_OBJECT( mpPlaybin ) );
mpPlaybin = NULL; mpPlaybin = nullptr;
} }
if( mpXOverlay ) { if( mpXOverlay ) {
g_object_unref( G_OBJECT ( mpXOverlay ) ); g_object_unref( G_OBJECT ( mpXOverlay ) );
mpXOverlay = NULL; mpXOverlay = nullptr;
} }
} }
...@@ -394,7 +394,7 @@ void Player::processMessage( GstMessage *message ) ...@@ -394,7 +394,7 @@ void Player::processMessage( GstMessage *message )
if( message->src == GST_OBJECT( mpPlaybin ) ) { if( message->src == GST_OBJECT( mpPlaybin ) ) {
GstState newstate, pendingstate; 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 && if( newstate == GST_STATE_PAUSED &&
pendingstate == GST_STATE_VOID_PENDING && pendingstate == GST_STATE_VOID_PENDING &&
...@@ -471,7 +471,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) ...@@ -471,7 +471,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
if( message->src == GST_OBJECT( mpPlaybin ) ) { if( message->src == GST_OBJECT( mpPlaybin ) ) {
GstState newstate, pendingstate; 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, DBG( "%p state change received, new state %d pending %d", this,
(int)newstate, (int)pendingstate ); (int)newstate, (int)pendingstate );
...@@ -487,11 +487,11 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) ...@@ -487,11 +487,11 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
} }
if( mnWidth == 0 ) { if( mnWidth == 0 ) {
GList *pStreamInfo = NULL; GList *pStreamInfo = nullptr;
g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, NULL ); 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 ); GObject *pInfo = G_OBJECT( pStreamInfo->data );
if( !pInfo ) if( !pInfo )
...@@ -530,7 +530,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) ...@@ -530,7 +530,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
mnDuration = gst_duration; mnDuration = gst_duration;
} }
if( mnWidth == 0 ) { if( mnWidth == 0 ) {
GstPad *pad = NULL; GstPad *pad = nullptr;
g_signal_emit_by_name( mpPlaybin, "get-video-pad", 0, &pad ); g_signal_emit_by_name( mpPlaybin, "get-video-pad", 0, &pad );
...@@ -576,14 +576,14 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) ...@@ -576,14 +576,14 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink )
{ {
GstBus *pBus; GstBus *pBus;
if( mpPlaybin != NULL ) { if( mpPlaybin != nullptr ) {
gst_element_set_state( mpPlaybin, GST_STATE_NULL ); gst_element_set_state( mpPlaybin, GST_STATE_NULL );
mbPlayPending = false; mbPlayPending = false;
g_object_unref( mpPlaybin ); g_object_unref( mpPlaybin );
} }
mpPlaybin = gst_element_factory_make( "playbin", NULL ); mpPlaybin = gst_element_factory_make( "playbin", nullptr );
if( pSink != NULL ) // used for getting preferred size etc. if( pSink != nullptr ) // used for getting preferred size etc.
{ {
g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL ); g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL );
mbFakeVideo = true; mbFakeVideo = true;
...@@ -606,7 +606,7 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) ...@@ -606,7 +606,7 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink )
#ifdef AVMEDIA_GST_0_10 #ifdef AVMEDIA_GST_0_10
gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this );
#else #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 #endif
g_object_unref( pBus ); g_object_unref( pBus );
} }
...@@ -622,7 +622,7 @@ bool Player::create( const OUString& rURL ) ...@@ -622,7 +622,7 @@ bool Player::create( const OUString& rURL )
if( mbInitialized && !rURL.isEmpty() ) if( mbInitialized && !rURL.isEmpty() )
{ {
// fakesink for pre-roll & sizing ... // 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 ); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
mbPlayPending = false; mbPlayPending = false;
...@@ -646,7 +646,7 @@ void SAL_CALL Player::start() ...@@ -646,7 +646,7 @@ void SAL_CALL Player::start()
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
// set the pipeline state to READY and run the loop // 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 ); gst_element_set_state( mpPlaybin, GST_STATE_PLAYING );
mbPlayPending = true; mbPlayPending = true;
...@@ -879,7 +879,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co ...@@ -879,7 +879,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
awt::Size aSize( getPreferredPlayerWindowSize() ); awt::Size aSize( getPreferredPlayerWindowSize() );
if( mbFakeVideo ) if( mbFakeVideo )
preparePlaybin( maURL, NULL ); preparePlaybin( maURL, nullptr );
DBG( "Player::createPlayerWindow %d %d length: %d", aSize.Width, aSize.Height, rArguments.getLength() ); 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 ...@@ -894,14 +894,14 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
sal_IntPtr pIntPtr = 0; sal_IntPtr pIntPtr = 0;
rArguments[ 2 ] >>= pIntPtr; rArguments[ 2 ] >>= pIntPtr;
SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr ); SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : NULL; const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : nullptr;
OSL_ASSERT(pEnvData); OSL_ASSERT(pEnvData);
if (pEnvData) if (pEnvData)
{ {
mnWindowID = pEnvData->aWindow; mnWindowID = pEnvData->aWindow;
DBG( "set window id to %d XOverlay %p\n", (int)mnWindowID, mpXOverlay); DBG( "set window id to %d XOverlay %p\n", (int)mnWindowID, mpXOverlay);
gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
if ( mpXOverlay != NULL ) if ( mpXOverlay != nullptr )
gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
} }
} }
...@@ -916,7 +916,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() ...@@ -916,7 +916,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber()
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
FrameGrabber* pFrameGrabber = NULL; FrameGrabber* pFrameGrabber = nullptr;
const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); const awt::Size aPrefSize( getPreferredPlayerWindowSize() );
if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) ) if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) )
......
...@@ -42,7 +42,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno: ...@@ -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*/ ) extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediagst_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
{ {
uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0; void* pRet = nullptr;
if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 ) if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
{ {
......
...@@ -33,13 +33,13 @@ namespace avmedia { namespace gstreamer { ...@@ -33,13 +33,13 @@ namespace avmedia { namespace gstreamer {
static ::osl::Mutex& ImplGetOwnStaticMutex() 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() ); ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( pMutex == NULL ) if( pMutex == nullptr )
{ {
static ::osl::Mutex aMutex; static ::osl::Mutex aMutex;
pMutex = &aMutex; pMutex = &aMutex;
......
...@@ -27,9 +27,9 @@ namespace avmedia { namespace ogl { ...@@ -27,9 +27,9 @@ namespace avmedia { namespace ogl {
OGLPlayer::OGLPlayer() OGLPlayer::OGLPlayer()
: Player_BASE(m_aMutex) : Player_BASE(m_aMutex)
, m_pHandle(NULL) , m_pHandle(nullptr)
, m_xContext(OpenGLContext::Create()) , m_xContext(OpenGLContext::Create())
, m_pOGLWindow(NULL) , m_pOGLWindow(nullptr)
, m_bIsRendering(false) , m_bIsRendering(false)
{ {
} }
...@@ -97,7 +97,7 @@ bool OGLPlayer::create( const OUString& rURL ) ...@@ -97,7 +97,7 @@ bool OGLPlayer::create( const OUString& rURL )
Graphic aGraphic; Graphic aGraphic;
if( aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL)) != GRFILTER_OK ) if( aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL)) != GRFILTER_OK )
{ {
rFile.buffer = 0; rFile.buffer = nullptr;
rFile.imagewidth = 0; rFile.imagewidth = 0;
rFile.imageheight = 0; rFile.imageheight = 0;
SAL_WARN("avmedia.opengl", "Can't load texture file: " + sFilesURL); SAL_WARN("avmedia.opengl", "Can't load texture file: " + sFilesURL);
...@@ -113,7 +113,7 @@ bool OGLPlayer::create( const OUString& rURL ) ...@@ -113,7 +113,7 @@ bool OGLPlayer::create( const OUString& rURL )
{ {
if( !lcl_LoadFile(&rFile, sFilesURL) ) if( !lcl_LoadFile(&rFile, sFilesURL) )
{ {
rFile.buffer = 0; rFile.buffer = nullptr;
rFile.size = 0; rFile.size = 0;
SAL_WARN("avmedia.opengl", "Can't load glTF file: " + sFilesURL); SAL_WARN("avmedia.opengl", "Can't load glTF file: " + sFilesURL);
return false; return false;
...@@ -135,7 +135,7 @@ void OGLPlayer::releaseInputFiles() ...@@ -135,7 +135,7 @@ void OGLPlayer::releaseInputFiles()
for (size_t i = 0; i < m_vInputFiles.size() && m_vInputFiles[i].buffer; ++i) for (size_t i = 0; i < m_vInputFiles.size() && m_vInputFiles[i].buffer; ++i)
{ {
delete [] m_vInputFiles[i].buffer; delete [] m_vInputFiles[i].buffer;
m_vInputFiles[i].buffer = 0; m_vInputFiles[i].buffer = nullptr;
} }
m_vInputFiles.clear(); m_vInputFiles.clear();
} }
......
...@@ -23,7 +23,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno: ...@@ -23,7 +23,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno:
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediaogl_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* ) extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediaogl_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* )
{ {
uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0; void* pRet = nullptr;
if( rtl_str_compare( pImplName, "com.sun.star.comp.avmedia.Manager_OpenGL" ) == 0 ) if( rtl_str_compare( pImplName, "com.sun.star.comp.avmedia.Manager_OpenGL" ) == 0 )
{ {
......
...@@ -46,7 +46,7 @@ MediaEventListenersImpl::~MediaEventListenersImpl() ...@@ -46,7 +46,7 @@ MediaEventListenersImpl::~MediaEventListenersImpl()
void MediaEventListenersImpl::cleanUp() void MediaEventListenersImpl::cleanUp()
{ {
Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ) ); Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ) );
mpNotifyWindow = NULL; mpNotifyWindow = nullptr;
} }
......
...@@ -170,12 +170,12 @@ void MediaWindowImpl::dispose() ...@@ -170,12 +170,12 @@ void MediaWindowImpl::dispose()
mxPlayer.clear(); mxPlayer.clear();
mpMediaWindow = NULL; mpMediaWindow = nullptr;
delete mpEmptyBmpEx; delete mpEmptyBmpEx;
mpEmptyBmpEx = NULL; mpEmptyBmpEx = nullptr;
delete mpAudioBmpEx; delete mpAudioBmpEx;
mpAudioBmpEx = NULL; mpAudioBmpEx = nullptr;
mpMediaWindowControl.disposeAndClear(); mpMediaWindowControl.disposeAndClear();
mpChildWindow.disposeAndClear(); mpChildWindow.disposeAndClear();
...@@ -639,7 +639,7 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& ...@@ -639,7 +639,7 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&
if (mxPlayerWindow.is()) if (mxPlayerWindow.is())
mxPlayerWindow->update(); mxPlayerWindow->update();
BitmapEx* pLogo = NULL; BitmapEx* pLogo = nullptr;
if (!mxPlayer.is()) if (!mxPlayer.is())
{ {
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
virtual void dispose() override; virtual void dispose() override;
static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = 0); static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = nullptr);
void setURL(const OUString& rURL, OUString const& rTempURL, OUString const& rReferer); void setURL(const OUString& rURL, OUString const& rTempURL, OUString const& rReferer);
......
...@@ -86,7 +86,7 @@ uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const rtl::OUSt ...@@ -86,7 +86,7 @@ uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const rtl::OUSt
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
if ( !m_is_vlc_found ) if ( !m_is_vlc_found )
throw uno::RuntimeException("VLC not found", 0); throw uno::RuntimeException("VLC not found", nullptr);
if ( !rURL.isEmpty() ) if ( !rURL.isEmpty() )
{ {
......
...@@ -184,9 +184,9 @@ namespace ...@@ -184,9 +184,9 @@ namespace
SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr ); SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : NULL; const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : nullptr;
if (pEnvData == NULL) if (pEnvData == nullptr)
return -1; return -1;
#if defined MACOSX #if defined MACOSX
......
...@@ -36,7 +36,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno: ...@@ -36,7 +36,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno:
// Experimental for now - code is neither elegant nor well tested. // Experimental for now - code is neither elegant nor well tested.
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
return NULL; return nullptr;
static uno::Reference< uno::XInterface > manager( *new ::avmedia::vlc::Manager( rxFact ) ); static uno::Reference< uno::XInterface > manager( *new ::avmedia::vlc::Manager( rxFact ) );
return manager; return manager;
...@@ -45,12 +45,12 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno: ...@@ -45,12 +45,12 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno:
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediavlc_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediavlc_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
{ {
uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0; void* pRet = nullptr;
// Experimental for now - code is neither elegant nor well tested. // Experimental for now - code is neither elegant nor well tested.
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
return NULL; return nullptr;
SAL_INFO("avmedia", "Create VLC Media component: '" << pImplName << "'\n"); SAL_INFO("avmedia", "Create VLC Media component: '" << pImplName << "'\n");
if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 ) if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
......
...@@ -42,7 +42,7 @@ const char* Common::Version() ...@@ -42,7 +42,7 @@ const char* Common::Version()
const char* Common::LastErrorMessage() const char* Common::LastErrorMessage()
{ {
const char *errorMsg = libvlc_errmsg(); const char *errorMsg = libvlc_errmsg();
return errorMsg == NULL ? AVMEDIA_NO_ERROR : errorMsg; return errorMsg == nullptr ? AVMEDIA_NO_ERROR : errorMsg;
} }
} }
} }
......
...@@ -38,7 +38,7 @@ namespace wrapper ...@@ -38,7 +38,7 @@ namespace wrapper
Instance::Instance( int argc, const char * const argv[] ) Instance::Instance( int argc, const char * const argv[] )
: mInstance( libvlc_new( argc, argv ) ) : mInstance( libvlc_new( argc, argv ) )
{ {
if ( mInstance == NULL) if ( mInstance == nullptr)
{ {
//TODO: error //TODO: error
} }
......
...@@ -63,7 +63,7 @@ bool Media::LoadSymbols() ...@@ -63,7 +63,7 @@ bool Media::LoadSymbols()
Media::Media( const rtl::OUString& url, Instance& instance ) Media::Media( const rtl::OUString& url, Instance& instance )
: mMedia( InitMedia( url, instance ) ) : mMedia( InitMedia( url, instance ) )
{ {
if (mMedia == NULL) if (mMedia == nullptr)
{ {
// TODO: Error // TODO: Error
} }
......
...@@ -136,7 +136,7 @@ namespace wrapper ...@@ -136,7 +136,7 @@ namespace wrapper
{ {
const libvlc_track_description_t *description = libvlc_video_get_track_description( mPlayer ); const libvlc_track_description_t *description = libvlc_video_get_track_description( mPlayer );
for ( ; description->p_next != NULL; description = description->p_next ); for ( ; description->p_next != nullptr; description = description->p_next );
libvlc_video_set_track( mPlayer, description->i_id ); libvlc_video_set_track( mPlayer, description->i_id );
} }
...@@ -145,7 +145,7 @@ namespace wrapper ...@@ -145,7 +145,7 @@ namespace wrapper
{ {
const libvlc_track_description_t *description = libvlc_audio_get_track_description( mPlayer ); const libvlc_track_description_t *description = libvlc_audio_get_track_description( mPlayer );
for ( ; description->p_next != NULL; description = description->p_next ); for ( ; description->p_next != nullptr; description = description->p_next );
libvlc_audio_set_track( mPlayer, description->i_id ); libvlc_audio_set_track( mPlayer, description->i_id );
} }
......
...@@ -104,7 +104,7 @@ namespace ...@@ -104,7 +104,7 @@ namespace
SAL_LOADMODULE_DEFAULT ); SAL_LOADMODULE_DEFAULT );
if( aModule == NULL) if( aModule == nullptr)
{ {
SAL_WARN("avmedia", "Cannot load libvlc"); SAL_WARN("avmedia", "Cannot load libvlc");
return false; return false;
......
...@@ -72,7 +72,7 @@ public: ...@@ -72,7 +72,7 @@ public:
virtual ~MediaItem(); virtual ~MediaItem();
virtual bool operator==( const SfxPoolItem& ) const override; virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const override; virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
virtual bool GetPresentation( SfxItemPresentation ePres, virtual bool GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreUnit, SfxMapUnit eCoreUnit,
SfxMapUnit ePresUnit, SfxMapUnit ePresUnit,
......
...@@ -61,14 +61,14 @@ private: ...@@ -61,14 +61,14 @@ private:
inline MediaFloater * getMediaFloater() { inline MediaFloater * getMediaFloater() {
SfxViewFrame * cur = SfxViewFrame::Current(); SfxViewFrame * cur = SfxViewFrame::Current();
if (cur != 0) { if (cur != nullptr) {
SfxChildWindow * win = cur->GetChildWindow( SfxChildWindow * win = cur->GetChildWindow(
MediaPlayer::GetChildWindowId()); MediaPlayer::GetChildWindowId());
if (win != 0) { if (win != nullptr) {
return static_cast<MediaFloater *>(win->GetWindow()); return static_cast<MediaFloater *>(win->GetWindow());
} }
} }
return 0; return nullptr;
} }
} }
......
...@@ -101,9 +101,9 @@ namespace avmedia ...@@ -101,9 +101,9 @@ namespace avmedia
static bool executeMediaURLDialog( vcl::Window* pParent, static bool executeMediaURLDialog( vcl::Window* pParent,
OUString& rURL, bool *const o_pbLink ); OUString& rURL, bool *const o_pbLink );
static void executeFormatErrorBox( vcl::Window* pParent ); static void executeFormatErrorBox( vcl::Window* pParent );
static bool isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep = false, Size* pPreferredSizePixel = NULL ); static bool isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep = false, Size* pPreferredSizePixel = nullptr );
static css::uno::Reference< css::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = 0 ); static css::uno::Reference< css::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = nullptr );
static css::uno::Reference< css::graphic::XGraphic > grabFrame( const OUString& rURL, const OUString& rReferer, static css::uno::Reference< css::graphic::XGraphic > grabFrame( const OUString& rURL, const OUString& rReferer,
const OUString& sMimeType, double fMediaTime = AVMEDIA_FRAMEGRABBER_DEFAULTFRAME ); const OUString& sMimeType, double fMediaTime = AVMEDIA_FRAMEGRABBER_DEFAULTFRAME );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment