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 "pvmfrtspnodereg.h" 21 22 #include "pvmf_sm_node_factory.h" 23 24 // Need osclconfig.h for the HAS_OSCL_LIB_SUPPORT macro for now 25 #include "osclconfig.h" 26 27 class StreamingNodesInterface: public OsclSharedLibraryInterface, 28 public NodeSharedLibraryInterface 29 { 30 public: StreamingNodesInterface()31 StreamingNodesInterface() {}; 32 33 // From NodeSharedLibraryInterface QueryNodeInterface(const PVUuid & aNodeUuid,const OsclUuid & aInterfaceId)34 OsclAny* QueryNodeInterface(const PVUuid& aNodeUuid, const OsclUuid& aInterfaceId) 35 { 36 if (KPVMFRTSPStreamingModuleUuid == aNodeUuid) 37 { 38 if (PV_CREATE_NODE_INTERFACE == aInterfaceId) 39 { 40 return ((OsclAny*)(PVMFStreamingManagerNodeFactory::CreateStreamingManagerNode)); 41 } 42 else if (PV_RELEASE_NODE_INTERFACE == aInterfaceId) 43 { 44 return ((OsclAny*)(PVMFStreamingManagerNodeFactory::DeleteStreamingManagerNode)); 45 } 46 } 47 48 return NULL; 49 }; 50 51 // From OsclSharedLibraryInterface SharedLibraryLookup(const OsclUuid & aInterfaceId)52 OsclAny* SharedLibraryLookup(const OsclUuid& aInterfaceId) 53 { 54 if (aInterfaceId == PV_NODE_INTERFACE) 55 { 56 return OSCL_STATIC_CAST(NodeSharedLibraryInterface*, this); 57 } 58 return NULL; 59 }; 60 }; 61 62 63 extern "C" 64 { PVGetInterface(void)65 OSCL_EXPORT_REF OsclSharedLibraryInterface* PVGetInterface(void) 66 { 67 return OSCL_NEW(StreamingNodesInterface, ()); 68 } PVReleaseInterface(OsclSharedLibraryInterface * aInstance)69 OSCL_EXPORT_REF void PVReleaseInterface(OsclSharedLibraryInterface* aInstance) 70 { 71 OSCL_DELETE(aInstance); 72 } 73 } 74 75