fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / avmedia / source / gstreamer / gstmanager.cxx
blob374f68a496252a621328095dee784633e508198c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <cppuhelper/supportsservice.hxx>
22 #include "gstmanager.hxx"
23 #include "gstplayer.hxx"
25 #include <tools/urlobj.hxx>
27 #define AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer"
28 #define AVMEDIA_GST_MANAGER_SERVICENAME "com.sun.star.media.Manager"
30 #if !defined DBG
31 #if OSL_DEBUG_LEVEL > 2
32 #define DBG OSL_TRACE
33 #else
34 #define DBG(...)
35 #endif
36 #endif
38 using namespace ::com::sun::star;
40 namespace avmedia { namespace gstreamer {
42 // - Manager -
45 Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
46 mxMgr( rxMgr )
48 DBG( "avmediagst: Manager::Manager" );
53 Manager::~Manager()
59 uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString& rURL )
60 throw (uno::RuntimeException, std::exception)
62 Player* pPlayer( new Player( mxMgr ) );
63 uno::Reference< media::XPlayer > xRet( pPlayer );
64 const INetURLObject aURL( rURL );
66 DBG( "avmediagst: Manager::createPlayer" );
68 if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
69 xRet = uno::Reference< media::XPlayer >();
71 return xRet;
76 OUString SAL_CALL Manager::getImplementationName( )
77 throw (uno::RuntimeException, std::exception)
79 return OUString( AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME );
84 sal_Bool SAL_CALL Manager::supportsService( const OUString& ServiceName )
85 throw (uno::RuntimeException, std::exception)
87 return cppu::supportsService(this, ServiceName);
92 uno::Sequence< OUString > SAL_CALL Manager::getSupportedServiceNames( )
93 throw (uno::RuntimeException, std::exception)
95 uno::Sequence< OUString > aRet(1);
96 aRet[0] = AVMEDIA_GST_MANAGER_SERVICENAME ;
98 return aRet;
101 } // namespace gstreamer
102 } // namespace avmedia
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */