Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2010 Novell, Inc.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "mediamisc.hxx"
30 : : #include "gstmanager.hxx"
31 : :
32 : : using namespace ::com::sun::star;
33 : :
34 : : // -------------------
35 : : // - factory methods -
36 : : // -------------------
37 : :
38 : : #ifdef AVMEDIA_GST_0_10
39 : : # define IMPL_NAME "com.sun.star.comp.media.Manager_GStreamer_0_10"
40 : : # define SERVICE_NAME AVMEDIA_MANAGER_SERVICE_NAME_OLD // "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
41 : : #else
42 : : # define IMPL_NAME "com.sun.star.comp.media.Manager_GStreamer"
43 : : # define SERVICE_NAME AVMEDIA_MANAGER_SERVICE_NAME // "com.sun.star.comp.avmedia.Manager_GStreamer"
44 : : #endif
45 : :
46 : 0 : static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
47 : : {
48 : 0 : return uno::Reference< uno::XInterface >( *new ::avmedia::gstreamer::Manager( rxFact ) );
49 : : }
50 : :
51 : 0 : extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
52 : : {
53 : 0 : uno::Reference< lang::XSingleServiceFactory > xFactory;
54 : 0 : void* pRet = 0;
55 : :
56 : 0 : if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
57 : : {
58 : 0 : const ::rtl::OUString aServiceName( SERVICE_NAME );
59 : : xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
60 : : reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
61 : 0 : IMPL_NAME, create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
62 : : }
63 : :
64 : 0 : if( xFactory.is() )
65 : : {
66 : 0 : xFactory->acquire();
67 : 0 : pRet = xFactory.get();
68 : : }
69 : :
70 : 0 : return pRet;
71 : : }
72 : :
73 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|