1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 ************************************************************************/
36 #include "gstmanager.hxx"
38 using namespace ::com::sun::star
;
40 // -------------------
41 // - factory methods -
42 // -------------------
44 static uno::Reference
< uno::XInterface
> SAL_CALL
create_MediaPlayer( const uno::Reference
< lang::XMultiServiceFactory
>& rxFact
)
46 return uno::Reference
< uno::XInterface
>( *new ::avmedia::gstreamer::Manager( rxFact
) );
49 // ------------------------------------------
50 // - component_getImplementationEnvironment -
51 // ------------------------------------------
53 extern "C" void SAL_CALL
component_getImplementationEnvironment( const sal_Char
** ppEnvTypeName
, uno_Environment
** ppEnv
)
55 *ppEnvTypeName
= CPPU_CURRENT_LANGUAGE_BINDING_NAME
;
58 // -----------------------
59 // - component_writeInfo -
60 // -----------------------
62 extern "C" sal_Bool SAL_CALL
component_writeInfo( void* pServiceManager
, void* pRegistryKey
)
64 sal_Bool bRet
= sal_False
;
70 uno::Reference
< registry::XRegistryKey
> xNewKey1(
71 static_cast< registry::XRegistryKey
* >( pRegistryKey
)->createKey(
72 ::rtl::OUString::createFromAscii( "/com.sun.star.comp.media.Manager_GStreamer/UNO/SERVICES/com.sun.star.media.Manager_GStreamer" ) ) );
76 catch( registry::InvalidRegistryException
& )
78 OSL_ENSURE( sal_False
, "### InvalidRegistryException!" );
85 // ------------------------
86 // - component_getFactory -
87 // ------------------------
89 extern "C" void* SAL_CALL
component_getFactory( const sal_Char
* pImplName
, void* pServiceManager
, void* pRegistryKey
)
91 uno::Reference
< lang::XSingleServiceFactory
> xFactory
;
94 if( rtl_str_compare( pImplName
, "com.sun.star.comp.media.Manager_GStreamer" ) == 0 )
96 const ::rtl::OUString
aServiceName( ::rtl::OUString::createFromAscii( "com.sun.star.media.Manager_GStreamer" ) );
98 xFactory
= uno::Reference
< lang::XSingleServiceFactory
>( ::cppu::createSingleFactory(
99 reinterpret_cast< lang::XMultiServiceFactory
* >( pServiceManager
),
100 ::rtl::OUString::createFromAscii( "com.sun.star.comp.media.Manager_GStreamer" ),
101 create_MediaPlayer
, uno::Sequence
< ::rtl::OUString
>( &aServiceName
, 1 ) ) );
107 pRet
= xFactory
.get();