merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0383-avmedia-source-gstreamer-gstmanager.cxx.diff
blob8793850a6285c6eba5db4d9e00e53c52c8dd94f5
1 --- /dev/null 2006-09-07 16:53:33.000000000 +0200
2 +++ avmedia/source/gstreamer/gstmanager.cxx 2006-09-22 14:57:17.000000000 +0200
3 @@ -0,0 +1,114 @@
4 +/*************************************************************************
5 + *
6 + * OpenOffice.org - a multi-platform office productivity suite
7 + *
8 + * $RCSfile$
9 + *
10 + * $Revision$
11 + *
12 + * last change: $Author$ $Date$
13 + *
14 + * The Contents of this file are made available subject to
15 + * the terms of GNU Lesser General Public License Version 2.1.
16 + *
17 + *
18 + * GNU Lesser General Public License Version 2.1
19 + * =============================================
20 + * Copyright 2005 by Sun Microsystems, Inc.
21 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22 + *
23 + * This library is free software; you can redistribute it and/or
24 + * modify it under the terms of the GNU Lesser General Public
25 + * License version 2.1, as published by the Free Software Foundation.
26 + *
27 + * This library is distributed in the hope that it will be useful,
28 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 + * Lesser General Public License for more details.
31 + *
32 + * You should have received a copy of the GNU Lesser General Public
33 + * License along with this library; if not, write to the Free Software
34 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
35 + * MA 02111-1307 USA
36 + *
37 + ************************************************************************/
39 +#include "gstmanager.hxx"
40 +#include "gstplayer.hxx"
42 +#include <tools/urlobj.hxx>
44 +#define AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer"
45 +#define AVMEDIA_GST_MANAGER_SERVICENAME "com.sun.star.media.Manager"
47 +#if DEBUG
48 +#define DBG OSL_TRACE
49 +#else
50 +#define DBG(...)
51 +#endif
53 +using namespace ::com::sun::star;
55 +namespace avmedia { namespace gstreamer {
56 +// ----------------
57 +// - Manager -
58 +// ----------------
60 +Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
61 + mxMgr( rxMgr )
63 + DBG( "avmediagst: Manager::Manager" );
66 +// ------------------------------------------------------------------------------
68 +Manager::~Manager()
72 +// ------------------------------------------------------------------------------
74 +uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL )
75 + throw (uno::RuntimeException)
77 + Player* pPlayer( new Player( mxMgr ) );
78 + uno::Reference< media::XPlayer > xRet( pPlayer );
79 + const INetURLObject aURL( rURL );
81 + DBG( "avmediagst: Manager::createPlayer" );
83 + if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
84 + xRet = uno::Reference< media::XPlayer >();
86 + return xRet;
89 +// ------------------------------------------------------------------------------
91 +::rtl::OUString SAL_CALL Manager::getImplementationName( )
92 + throw (uno::RuntimeException)
94 + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME ) );
97 +// ------------------------------------------------------------------------------
99 +sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName )
100 + throw (uno::RuntimeException)
102 + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GST_MANAGER_SERVICENAME ) );
105 +// ------------------------------------------------------------------------------
107 +uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames( )
108 + throw (uno::RuntimeException)
110 + uno::Sequence< ::rtl::OUString > aRet(1);
111 + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GST_MANAGER_SERVICENAME ) );
113 + return aRet;
116 +} // namespace gstreamer
117 +} // namespace avmedia