[Libreoffice-commits] core.git: avmedia/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Fri Feb 26 06:36:56 UTC 2021
avmedia/source/framework/mediatoolbox.cxx | 2 +-
avmedia/source/gstreamer/gstframegrabber.cxx | 2 +-
avmedia/source/gstreamer/gstframegrabber.hxx | 3 ++-
avmedia/source/gstreamer/gstplayer.cxx | 4 ++--
4 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 19ddd197a4246b8ab62932d63670b3d281e7b626
Author: Noel <noel.grandin at collabora.co.uk>
AuthorDate: Thu Feb 25 14:49:13 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Feb 26 07:36:12 2021 +0100
loplugin:refcounting in avmedia
Change-Id: I0cd6d6a4a45d77b25f04c3b49327f1cf9279c6a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111540
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index a109113a78fe..5cdde7399afe 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -65,7 +65,7 @@ void MediaToolBoxControl_Impl::execute( const MediaItem& rItem )
}
-SFX_IMPL_TOOLBOX_CONTROL( ::avmedia::MediaToolBoxControl, ::avmedia::MediaItem );
+SFX_IMPL_TOOLBOX_CONTROL( MediaToolBoxControl, ::avmedia::MediaItem );
MediaToolBoxControl::MediaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx
index c1341d8d6ad4..7f86852c5609 100644
--- a/avmedia/source/gstreamer/gstframegrabber.cxx
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -87,7 +87,7 @@ FrameGrabber::~FrameGrabber()
disposePipeline();
}
-FrameGrabber* FrameGrabber::create( std::u16string_view rURL )
+rtl::Reference<FrameGrabber> FrameGrabber::create( std::u16string_view rURL )
{
return new FrameGrabber( rURL );
}
diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx
index b99401526506..c706192efd7d 100644
--- a/avmedia/source/gstreamer/gstframegrabber.hxx
+++ b/avmedia/source/gstreamer/gstframegrabber.hxx
@@ -26,6 +26,7 @@
#include "gstplayer.hxx"
#include <com/sun/star/media/XFrameGrabber.hpp>
#include <cppuhelper/implbase.hxx>
+#include <rtl/ref.hxx>
namespace avmedia::gstreamer {
@@ -43,7 +44,7 @@ public:
const FrameGrabber& operator=(const FrameGrabber&) =delete;
// static create method instead of public Ctor
- static FrameGrabber* create( std::u16string_view rURL );
+ static rtl::Reference<FrameGrabber> create( std::u16string_view rURL );
virtual ~FrameGrabber() override;
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index cab9f4649b6a..2e723ce6efbc 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -897,12 +897,12 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber()
{
::osl::MutexGuard aGuard(m_aMutex);
- FrameGrabber* pFrameGrabber = nullptr;
+ rtl::Reference<FrameGrabber> pFrameGrabber;
const awt::Size aPrefSize( getPreferredPlayerWindowSize() );
if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) )
pFrameGrabber = FrameGrabber::create( maURL );
- SAL_INFO( "avmedia.gstreamer", AVVERSION "created FrameGrabber " << pFrameGrabber );
+ SAL_INFO( "avmedia.gstreamer", AVVERSION "created FrameGrabber " << pFrameGrabber.get() );
return pFrameGrabber;
}
More information about the Libreoffice-commits
mailing list