1f39251c4SAndrew Rist /**************************************************************
2f39251c4SAndrew Rist  *
3f39251c4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f39251c4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f39251c4SAndrew Rist  * distributed with this work for additional information
6f39251c4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f39251c4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f39251c4SAndrew Rist  * "License"); you may not use this file except in compliance
9f39251c4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f39251c4SAndrew Rist  *
11f39251c4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f39251c4SAndrew Rist  *
13f39251c4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f39251c4SAndrew Rist  * software distributed under the License is distributed on an
15f39251c4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f39251c4SAndrew Rist  * KIND, either express or implied.  See the License for the
17f39251c4SAndrew Rist  * specific language governing permissions and limitations
18f39251c4SAndrew Rist  * under the License.
19f39251c4SAndrew Rist  *
20f39251c4SAndrew Rist  *************************************************************/
21f39251c4SAndrew Rist 
22f39251c4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "gstcommon.hxx"
25cdf0e10cSrcweir #include "gstmanager.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir using namespace ::com::sun::star;
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // -------------------
30cdf0e10cSrcweir // - factory methods -
31cdf0e10cSrcweir // -------------------
32cdf0e10cSrcweir 
create_MediaPlayer(const uno::Reference<lang::XMultiServiceFactory> & rxFact)33cdf0e10cSrcweir static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	return uno::Reference< uno::XInterface >( *new ::avmedia::gst::Manager( rxFact ) );
36cdf0e10cSrcweir }
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // ------------------------------------------
39cdf0e10cSrcweir // - component_getImplementationEnvironment -
40cdf0e10cSrcweir // ------------------------------------------
41cdf0e10cSrcweir 
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)42*deb7b1c2Sdamjan extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // ------------------------
48cdf0e10cSrcweir // - component_getFactory -
49cdf0e10cSrcweir // ------------------------
50cdf0e10cSrcweir 
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void *)51*deb7b1c2Sdamjan extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir 	uno::Reference< lang::XSingleServiceFactory > xFactory;
54cdf0e10cSrcweir 	void*									pRet = 0;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	if( rtl_str_compare( pImplName, AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ) == 0 )
57cdf0e10cSrcweir 	{
58cdf0e10cSrcweir 		const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 		xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
61cdf0e10cSrcweir 						reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
62cdf0e10cSrcweir 						::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ),
63cdf0e10cSrcweir 						create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
64cdf0e10cSrcweir 	}
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	if( xFactory.is() )
67cdf0e10cSrcweir 	{
68cdf0e10cSrcweir 		xFactory->acquire();
69cdf0e10cSrcweir 		pRet = xFactory.get();
70cdf0e10cSrcweir 	}
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	return pRet;
73cdf0e10cSrcweir }
74