summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2014-01-14 23:25:56 -0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-17 12:24:55 +0100
commitf907f21e7db4fadf488a6bad64ebbdfb21ec4e84 (patch)
tree8f1b2f38aacbaa2fcd738d2a0e9d745830692c5d /avmedia
parentb93ea039ebc20203913b3829a1392e56f07353a9 (diff)
Convert avmedia to cppu::supportsService
Change-Id: Ia34cdbb5a5c80806c8155462d97c60d92a0ec8f4
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx3
-rw-r--r--avmedia/source/vlc/vlcmanager.cxx3
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx3
-rw-r--r--avmedia/source/vlc/vlcwindow.cxx3
-rw-r--r--avmedia/source/win/framegrabber.cxx17
-rw-r--r--avmedia/source/win/manager.cxx13
-rw-r--r--avmedia/source/win/player.cxx55
-rw-r--r--avmedia/source/win/window.cxx3
8 files changed, 17 insertions, 83 deletions
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index a28cf8aa86be..af3fef91e40f 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -9,6 +9,7 @@
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <tools/stream.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "vlcframegrabber.hxx"
#include "vlcplayer.hxx"
@@ -102,7 +103,7 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString
::sal_Bool SAL_CALL VLCFrameGrabber::supportsService( const ::rtl::OUString& serviceName )
throw ( ::com::sun::star::uno::RuntimeException )
{
- return AVMEDIA_VLC_GRABBER_SERVICENAME == serviceName;
+ return cppu::supportsService(this, serviceName);
}
::uno::Sequence< ::rtl::OUString > SAL_CALL VLCFrameGrabber::getSupportedServiceNames()
diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
index 192efdce03dd..8395d0caf994 100644
--- a/avmedia/source/vlc/vlcmanager.cxx
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -10,6 +10,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <com/sun/star/uno/Exception.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "vlcmanager.hxx"
#include "vlcplayer.hxx"
#include "wrapper/Instance.hxx"
@@ -114,7 +115,7 @@ rtl::OUString SAL_CALL Manager::getImplementationName()
sal_Bool SAL_CALL Manager::supportsService( const rtl::OUString& serviceName )
throw (uno::RuntimeException)
{
- return serviceName == VLC_SERVICENAME;
+ return cppu::supportsService(this, serviceName);
}
uno::Sequence< rtl::OUString > SAL_CALL Manager::getSupportedServiceNames()
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 952f38cfaa22..598ed9269dfc 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -1,6 +1,7 @@
#include <boost/bind.hpp>
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "vlcplayer.hxx"
#include "vlcwindow.hxx"
@@ -247,7 +248,7 @@ uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabb
::sal_Bool SAL_CALL VLCPlayer::supportsService( const ::rtl::OUString& serviceName )
throw ( ::com::sun::star::uno::RuntimeException )
{
- return serviceName == AVMEDIA_VLC_PLAYER_SERVICENAME;
+ return cppu::supportsService(this, serviceName);
}
::uno::Sequence< ::rtl::OUString > SAL_CALL VLCPlayer::getSupportedServiceNames()
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 02fa74f46976..65fbf6e323ef 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -1,4 +1,5 @@
#include <iostream>
+#include <cppuhelper/supportsservice.hxx>
#include "vlcwindow.hxx"
#include "vlcplayer.hxx"
@@ -78,7 +79,7 @@ void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 ) throw (css::uno::RuntimeE
::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& serviceName ) throw (css::uno::RuntimeException)
{
- return serviceName == AVMEDIA_VLC_WINDOW_SERVICENAME;
+ return cppu::supportsService(this, serviceName);
}
uno::Sequence< ::rtl::OUString > SAL_CALL VLCWindow::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/avmedia/source/win/framegrabber.cxx b/avmedia/source/win/framegrabber.cxx
index f5789e09e319..2f9e6aa36a46 100644
--- a/avmedia/source/win/framegrabber.cxx
+++ b/avmedia/source/win/framegrabber.cxx
@@ -35,6 +35,7 @@
#include "framegrabber.hxx"
#include "player.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <tools/stream.hxx>
#include <vcl/graph.hxx>
#include <unotools/localfilehelper.hxx>
@@ -57,15 +58,11 @@ FrameGrabber::FrameGrabber( const uno::Reference< lang::XMultiServiceFactory >&
::CoInitialize( NULL );
}
-// ------------------------------------------------------------------------------
-
FrameGrabber::~FrameGrabber()
{
::CoUninitialize();
}
-// ------------------------------------------------------------------------------
-
IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
{
IMediaDet* pDet = NULL;
@@ -87,8 +84,6 @@ IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
return pDet;
}
-// ------------------------------------------------------------------------------
-
bool FrameGrabber::create( const OUString& rURL )
{
// just check if a MediaDet interface can be created with the given URL
@@ -106,8 +101,6 @@ bool FrameGrabber::create( const OUString& rURL )
return( maURL.getLength() > 0 );
}
-// ------------------------------------------------------------------------------
-
uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime )
throw (uno::RuntimeException)
{
@@ -204,24 +197,18 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
return xRet;
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL FrameGrabber::getImplementationName( )
throw (uno::RuntimeException)
{
return OUString( AVMEDIA_WIN_FRAMEGRABBER_IMPLEMENTATIONNAME );
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL FrameGrabber::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- return ServiceName == AVMEDIA_WIN_FRAMEGRABBER_SERVICENAME;
+ return cppu::supportsService(this, ServiceName);
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< OUString > SAL_CALL FrameGrabber::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
diff --git a/avmedia/source/win/manager.cxx b/avmedia/source/win/manager.cxx
index 7935e8fa51c5..19419aee8c23 100644
--- a/avmedia/source/win/manager.cxx
+++ b/avmedia/source/win/manager.cxx
@@ -20,6 +20,7 @@
#include "manager.hxx"
#include "player.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <tools/urlobj.hxx>
#define AVMEDIA_WIN_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_DirectX"
@@ -37,14 +38,10 @@ Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
{
}
-// ------------------------------------------------------------------------------
-
Manager::~Manager()
{
}
-// ------------------------------------------------------------------------------
-
uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString& rURL )
throw (uno::RuntimeException)
{
@@ -58,24 +55,18 @@ uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString&
return xRet;
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL Manager::getImplementationName( )
throw (uno::RuntimeException)
{
return OUString( AVMEDIA_WIN_MANAGER_IMPLEMENTATIONNAME );
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL Manager::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- return ServiceName == AVMEDIA_WIN_MANAGER_SERVICENAME;
+ return cppu::supportsService(this, ServiceName);
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< OUString > SAL_CALL Manager::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx
index f91c906d930b..caab2e46c2b4 100644
--- a/avmedia/source/win/player.cxx
+++ b/avmedia/source/win/player.cxx
@@ -33,6 +33,7 @@
#include "player.hxx"
#include "framegrabber.hxx"
#include "window.hxx"
+#include <cppuhelper/supportsservice.hxx>
#define AVMEDIA_WIN_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_DirectX"
#define AVMEDIA_WIN_PLAYER_SERVICENAME "com.sun.star.media.Player_DirectX"
@@ -101,8 +102,6 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
::CoInitialize( NULL );
}
-// ------------------------------------------------------------------------------
-
Player::~Player()
{
if( mnFrameWnd )
@@ -111,8 +110,6 @@ Player::~Player()
::CoUninitialize();
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::disposing()
{
::osl::MutexGuard aGuard(m_aMutex);
@@ -150,7 +147,7 @@ void SAL_CALL Player::disposing()
if( mpGB )
mpGB->Release();
}
-// ------------------------------------------------------------------------------
+
bool Player::create( const OUString& rURL )
{
HRESULT hR;
@@ -197,15 +194,11 @@ bool Player::create( const OUString& rURL )
return bRet;
}
-// ------------------------------------------------------------------------------
-
const IVideoWindow* Player::getVideoWindow() const
{
return mpVW;
}
-// ------------------------------------------------------------------------------
-
void Player::setNotifyWnd( int nNotifyWnd )
{
mbAddWindow = sal_False;
@@ -213,8 +206,6 @@ void Player::setNotifyWnd( int nNotifyWnd )
mpME->SetNotifyWindow( (OAHWND) nNotifyWnd, WM_GRAPHNOTIFY, reinterpret_cast< LONG_PTR>( this ) );
}
-// ------------------------------------------------------------------------------
-
void Player::setDDrawParams( IDirectDraw* pDDraw, IDirectDrawSurface* pDDrawSurface )
{
if( mpEV && pDDraw && pDDrawSurface )
@@ -224,8 +215,6 @@ void Player::setDDrawParams( IDirectDraw* pDDraw, IDirectDrawSurface* pDDrawSurf
}
}
-// ------------------------------------------------------------------------------
-
long Player::processEvent()
{
long nCode;
@@ -253,8 +242,6 @@ long Player::processEvent()
return 0;
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::start( )
throw (uno::RuntimeException)
{
@@ -298,8 +285,6 @@ void SAL_CALL Player::start( )
}
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::stop( )
throw (uno::RuntimeException)
{
@@ -308,8 +293,6 @@ void SAL_CALL Player::stop( )
mpMC->Stop();
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL Player::isPlaying()
throw (uno::RuntimeException)
{
@@ -324,8 +307,6 @@ sal_Bool SAL_CALL Player::isPlaying()
return bRet;
}
-// ------------------------------------------------------------------------------
-
double SAL_CALL Player::getDuration( )
throw (uno::RuntimeException)
{
@@ -339,8 +320,6 @@ double SAL_CALL Player::getDuration( )
return aRefTime;
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::setMediaTime( double fTime )
throw (uno::RuntimeException)
{
@@ -357,8 +336,6 @@ void SAL_CALL Player::setMediaTime( double fTime )
}
}
-// ------------------------------------------------------------------------------
-
double SAL_CALL Player::getMediaTime( )
throw (uno::RuntimeException)
{
@@ -372,8 +349,6 @@ double SAL_CALL Player::getMediaTime( )
return aRefTime;
}
-// ------------------------------------------------------------------------------
-
double SAL_CALL Player::getRate( )
throw (uno::RuntimeException)
{
@@ -387,8 +362,6 @@ double SAL_CALL Player::getRate( )
return fRet;
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet )
throw (uno::RuntimeException)
{
@@ -397,8 +370,6 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet )
mbLooping = bSet;
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL Player::isPlaybackLoop( )
throw (uno::RuntimeException)
{
@@ -407,8 +378,6 @@ sal_Bool SAL_CALL Player::isPlaybackLoop( )
return mbLooping;
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::setMute( sal_Bool bSet )
throw (uno::RuntimeException)
{
@@ -421,8 +390,6 @@ void SAL_CALL Player::setMute( sal_Bool bSet )
}
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL Player::isMute( )
throw (uno::RuntimeException)
{
@@ -431,8 +398,6 @@ sal_Bool SAL_CALL Player::isMute( )
return mbMuted;
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB )
throw (uno::RuntimeException)
{
@@ -444,8 +409,6 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB )
mpBA->put_Volume( mnUnmutedVolume );
}
-// ------------------------------------------------------------------------------
-
sal_Int16 SAL_CALL Player::getVolumeDB( )
throw (uno::RuntimeException)
{
@@ -454,8 +417,6 @@ sal_Int16 SAL_CALL Player::getVolumeDB( )
return( static_cast< sal_Int16 >( mnUnmutedVolume / 100 ) );
}
-// ------------------------------------------------------------------------------
-
awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( )
throw (uno::RuntimeException)
{
@@ -475,8 +436,6 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( )
return aSize;
}
-// ------------------------------------------------------------------------------
-
uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
throw (uno::RuntimeException)
{
@@ -498,8 +457,6 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
return xRet;
}
-// ------------------------------------------------------------------------------
-
uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
throw (uno::RuntimeException)
{
@@ -518,24 +475,18 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
return xRet;
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL Player::getImplementationName( )
throw (uno::RuntimeException)
{
return OUString( AVMEDIA_WIN_PLAYER_IMPLEMENTATIONNAME );
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL Player::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- return ServiceName == AVMEDIA_WIN_PLAYER_SERVICENAME;
+ return cppu::supportsService(this, ServiceName);
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< OUString > SAL_CALL Player::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx
index 0956cc1a5003..3d5a7cc3e9a8 100644
--- a/avmedia/source/win/window.cxx
+++ b/avmedia/source/win/window.cxx
@@ -30,6 +30,7 @@
#pragma warning(pop)
#endif
#include <com/sun/star/awt/SystemPointer.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "window.hxx"
#include "player.hxx"
@@ -601,7 +602,7 @@ OUString SAL_CALL Window::getImplementationName( )
sal_Bool SAL_CALL Window::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- return ServiceName == AVMEDIA_WIN_WINDOW_SERVICENAME;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL Window::getSupportedServiceNames( )