summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-09 15:50:03 +0200
committerNoel Grandin <noel@peralex.com>2013-01-28 08:22:59 +0200
commit09cf6fe83a9d895dc6d5b3db91fd54aeaf4d0ea7 (patch)
tree1ae17998207ee793ab06240c4bda1eaeacc0952d /avmedia
parent49cf14a3ca8dceed39baead918b1ddaaab5f4ab3 (diff)
fd0#46808, convert some getProcessServiceFactory
... to getProcessComponentContext Change-Id: I8d5c2be0186db963ba8aac31e1b527145b8bca2b
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.cxx58
1 files changed, 26 insertions, 32 deletions
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index 74dc1d3f8304..cc54a180c9cb 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -46,7 +46,6 @@ MediaWindowBaseImpl::MediaWindowBaseImpl( MediaWindow* pMediaWindow )
MediaWindowBaseImpl::~MediaWindowBaseImpl()
{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
}
// -------------------------------------------------------------------------
@@ -54,42 +53,37 @@ MediaWindowBaseImpl::~MediaWindowBaseImpl()
uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl::OUString& rURL )
{
uno::Reference< media::XPlayer > xPlayer;
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
- if( xFactory.is() )
- {
- static const char * aServiceManagers[] = {
- AVMEDIA_MANAGER_SERVICE_NAME,
+ static const char * aServiceManagers[] = {
+ AVMEDIA_MANAGER_SERVICE_NAME,
// a fallback path just for gstreamer which has
// two significant versions deployed at once ...
#ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD
- AVMEDIA_MANAGER_SERVICE_NAME_OLD
+ AVMEDIA_MANAGER_SERVICE_NAME_OLD
#endif
- };
+ };
- for( sal_uInt32 i = 0; !xPlayer.is() && i < SAL_N_ELEMENTS( aServiceManagers ); ++i )
- {
- const rtl::OUString aServiceName( aServiceManagers[ i ],
- strlen( aServiceManagers[ i ] ),
- RTL_TEXTENCODING_ASCII_US );
-
- uno::Reference< ::com::sun::star::media::XManager > xManager;
-
- try {
- xManager = uno::Reference< ::com::sun::star::media::XManager >(
- xFactory->createInstance( aServiceName ), uno::UNO_QUERY );
- if( xManager.is() )
- xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ),
- uno::UNO_QUERY );
- else
- SAL_WARN( "avmedia",
- "failed to create media player service " << aServiceName );
- } catch ( const uno::Exception &e ) {
- SAL_WARN(
- "avmedia",
- "couldn't create media player " AVMEDIA_MANAGER_SERVICE_NAME
- ", exception '" << e.Message << '\'');
- }
+ for( sal_uInt32 i = 0; !xPlayer.is() && i < SAL_N_ELEMENTS( aServiceManagers ); ++i )
+ {
+ const rtl::OUString aServiceName( aServiceManagers[ i ],
+ strlen( aServiceManagers[ i ] ),
+ RTL_TEXTENCODING_ASCII_US );
+
+ try {
+ uno::Reference< media::XManager > xManager (
+ xContext->getServiceManager()->createInstanceWithContext(aServiceName, xContext),
+ uno::UNO_QUERY );
+ if( xManager.is() )
+ xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ),
+ uno::UNO_QUERY );
+ else
+ SAL_WARN( "avmedia",
+ "failed to create media player service " << aServiceName );
+ } catch ( const uno::Exception &e ) {
+ SAL_WARN( "avmedia",
+ "couldn't create media player " AVMEDIA_MANAGER_SERVICE_NAME
+ ", exception '" << e.Message << '\'');
}
}
@@ -233,7 +227,7 @@ bool MediaWindowBaseImpl::setZoom( ::com::sun::star::media::ZoomLevel eLevel )
::com::sun::star::media::ZoomLevel MediaWindowBaseImpl::getZoom() const
{
- return( mxPlayerWindow.is() ? mxPlayerWindow->getZoomLevel() : ::com::sun::star::media::ZoomLevel_NOT_AVAILABLE );
+ return( mxPlayerWindow.is() ? mxPlayerWindow->getZoomLevel() : media::ZoomLevel_NOT_AVAILABLE );
}
// ---------------------------------------------------------------------