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 #ifndef PVMF_MEDIA_INPUT_NODE_FACTORY_H_INCLUDED 19 #define PVMF_MEDIA_INPUT_NODE_FACTORY_H_INCLUDED 20 21 // Forward declaration 22 class PVMFNodeInterface; 23 class PvmiMIOControl; 24 class PVMFNodeCmdStatusObserver; 25 class PVMFNodeInfoEventObserver; 26 class PVMFNodeErrorEventObserver; 27 28 #define PvmfMediaInputNodeUuid PVUuid(0x860c7c50,0xb76a,0x4672,0x97,0x84,0xba,0x4d,0xce,0xc4,0x3a,0x3e) 29 30 /** 31 * PvmfMediaInputNodeFactory Class 32 * 33 * PvmfMediaInputNodeFactory class is a singleton class which instantiates and provides 34 * access to PvmfMediaInputNode node. It returns a PVMFNodeInterface reference, the 35 * interface class of the PvmfMediaInputNode. 36 * 37 * The client is expected to contain and maintain a pointer to the instance created 38 * while the node is active. 39 */ 40 class PvmfMediaInputNodeFactory 41 { 42 public: 43 /** 44 * Creates an instance of a PvmfMediaInputNode. If the creation fails, this function will leave. 45 * 46 * @param aMIOControl Media input object to be controlled by this node 47 * @returns A pointer to an author or leaves if instantiation fails 48 */ 49 OSCL_IMPORT_REF static PVMFNodeInterface* Create(PvmiMIOControl* aMIOControl); 50 51 /** 52 * This function allows the application to delete an instance of a PvmfMediaInputNode 53 * and reclaim all allocated resources. An instance can be deleted only in 54 * the idle state. An attempt to delete in any other state will fail and return false. 55 * 56 * @param aNode The PvmfMediaInputNode to be deleted. 57 */ 58 OSCL_IMPORT_REF static void Delete(PVMFNodeInterface* aNode); 59 60 /** 61 * This function allows the application to retrieve the 62 * media I/O control instance contained within the node. 63 * 64 * @param aNode The PvmfMediaInputNode 65 * @returns Pointer to the media I/O component. 66 */ 67 OSCL_IMPORT_REF static PvmiMIOControl* GetMediaIOControl(PVMFNodeInterface* aNode); 68 }; 69 70 #endif // PVMF_MEDIA_INPUT_NODE_FACTORY_H_INCLUDED 71