1 --- /dev/null 2006-08-13 17:52:05.000000000 +0200
2 +++ avmedia/source/gstreamer/gstuno.cxx 2006-08-22 11:38:56.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"
41 +using namespace ::com::sun::star;
43 +// -------------------
44 +// - factory methods -
45 +// -------------------
47 +static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
49 + return uno::Reference< uno::XInterface >( *new ::avmedia::gstreamer::Manager( rxFact ) );
52 +// ------------------------------------------
53 +// - component_getImplementationEnvironment -
54 +// ------------------------------------------
56 +extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
58 + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
61 +// -----------------------
62 +// - component_writeInfo -
63 +// -----------------------
65 +extern "C" sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
67 + sal_Bool bRet = sal_False;
73 + uno::Reference< registry::XRegistryKey > xNewKey1(
74 + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
75 + ::rtl::OUString::createFromAscii( "/com.sun.star.comp.media.Manager_GStreamer/UNO/SERVICES/com.sun.star.media.Manager_GStreamer" ) ) );
79 + catch( registry::InvalidRegistryException& )
81 + OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
88 +// ------------------------
89 +// - component_getFactory -
90 +// ------------------------
92 +extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
94 + uno::Reference< lang::XSingleServiceFactory > xFactory;
97 + if( rtl_str_compare( pImplName, "com.sun.star.comp.media.Manager_GStreamer" ) == 0 )
99 + const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( "com.sun.star.media.Manager_GStreamer" ) );
101 + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
102 + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
103 + ::rtl::OUString::createFromAscii( "com.sun.star.comp.media.Manager_GStreamer" ),
104 + create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
107 + if( xFactory.is() )
109 + xFactory->acquire();
110 + pRet = xFactory.get();