1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "manager.hxx"
22 #include <tools/urlobj.hxx>
23 #include <osl/diagnose.h>
25 using namespace ::com::sun::star;
27 namespace avmedia { namespace quicktime {
32 Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
35 OSL_TRACE( "avmediaquicktime: Manager::Manager" );
46 uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL )
47 throw (uno::RuntimeException)
49 Player* pPlayer( new Player( mxMgr ) );
50 uno::Reference< media::XPlayer > xRet( pPlayer );
51 INetURLObject aURL( rURL );
53 OSL_TRACE( "avmediaquicktime: Manager::createPlayer" );
55 if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
56 xRet = uno::Reference< media::XPlayer >();
63 ::rtl::OUString SAL_CALL Manager::getImplementationName( )
64 throw (uno::RuntimeException)
66 return ::rtl::OUString( AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME );
71 sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName )
72 throw (uno::RuntimeException)
74 return ( ServiceName == AVMEDIA_QUICKTIME_MANAGER_SERVICENAME );
79 uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames( )
80 throw (uno::RuntimeException)
82 uno::Sequence< ::rtl::OUString > aRet(1);
83 aRet[0] = AVMEDIA_QUICKTIME_MANAGER_SERVICENAME;
88 } // namespace quicktime
89 } // namespace avmedia
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */