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
4 +/*************************************************************************
6 + * OpenOffice.org - a multi-platform office productivity suite
12 + * last change: $Author$ $Date$
14 + * The Contents of this file are made available subject to
15 + * the terms of GNU Lesser General Public License Version 2.1.
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
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.
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.
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,
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"
48 +#define DBG OSL_TRACE
53 +using namespace ::com::sun::star;
55 +namespace avmedia { namespace gstreamer {
60 +Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
63 + DBG( "avmediagst: Manager::Manager" );
66 +// ------------------------------------------------------------------------------
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 >();
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 ) );
116 +} // namespace gstreamer
117 +} // namespace avmedia