1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 #include "pvmf_node_shared_lib_interface.h" 19 20 #include "pvmf_mp4ffparser_factory.h" 21 22 #include "osclconfig.h" 23 24 class Mp4NodesInterface: public OsclSharedLibraryInterface, 25 public NodeSharedLibraryInterface 26 { 27 public: 28 Mp4NodesInterface() {}; 29 30 // From NodeSharedLibraryInterface 31 OsclAny* QueryNodeInterface(const PVUuid& aNodeUuid, const OsclUuid& aInterfaceId) 32 { 33 if (KPVMFMP4FFParserNodeUuid == aNodeUuid) 34 { 35 if (PV_CREATE_NODE_INTERFACE == aInterfaceId) 36 { 37 return ((OsclAny*)(PVMFMP4FFParserNodeFactory::CreatePVMFMP4FFParserNode)); 38 } 39 else if (PV_RELEASE_NODE_INTERFACE == aInterfaceId) 40 { 41 return ((OsclAny*)(PVMFMP4FFParserNodeFactory::DeletePVMFMP4FFParserNode)); 42 } 43 } 44 45 return NULL; 46 }; 47 48 // From OsclSharedLibraryInterface 49 OsclAny* SharedLibraryLookup(const OsclUuid& aInterfaceId) 50 { 51 if (aInterfaceId == PV_NODE_INTERFACE) 52 { 53 return OSCL_STATIC_CAST(NodeSharedLibraryInterface*, this); 54 } 55 56 return NULL; 57 }; 58 }; 59 60 61 extern "C" 62 { 63 OSCL_EXPORT_REF OsclSharedLibraryInterface *PVGetInterface(void) 64 { 65 return OSCL_NEW(Mp4NodesInterface, ()); 66 } 67 OSCL_EXPORT_REF void PVReleaseInterface(OsclSharedLibraryInterface* aInstance) 68 { 69 OSCL_DELETE(aInstance); 70 } 71 } 72 73