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 PV_COMMS_IO_NODE_FACTORY_H_INCLUDED 19 #define PV_COMMS_IO_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 PVCommsIONodeUuid PVUuid(0x860c7c50,0xb76a,0x4672,0x97,0x84,0xba,0x4d,0xce,0xc4,0x3a,0x3e) 29 30 /** 31 * PVCommsIONodeFactory Class 32 * 33 * PVCommsIONodeFactory class is a singleton class which instantiates and provides 34 * access to PVCommsIONode node. It returns a PVMFNodeInterface reference, the 35 * interface class of the PVCommsIONode. 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 PVCommsIONodeFactory 41 { 42 public: 43 /** 44 * Creates an instance of a PVCommsIONode from one or more unidirectional 45 * media IO components. If the creation fails, this function will leave. 46 * 47 * @param aMIOInputControl Media input object to be controlled by this node 48 * this parameter can be NULL of the aMIOOutputControl parameter is 49 * non-NULL 50 * @param aMIOOutputControl Media output object to be controlled by this node 51 * this parameter can be NULL of the aMIOInputControl parameter is 52 * non-NULL 53 * @returns A pointer to an author or leaves if instantiation fails 54 */ 55 OSCL_IMPORT_REF static PVMFNodeInterface* Create(PvmiMIOControl* aMIOInputControl, PvmiMIOControl *aMIOOutputControl, bool logBitstreams = false); 56 57 /** 58 * Creates an instance of a PVCommsIONode from a single bidirectional 59 * media IO component. If the creation fails, this function will leave. 60 * 61 * @param aMIOIControl Media input object to be controlled by this node 62 * @returns A pointer to an author or leaves if instantiation fails 63 */ 64 OSCL_IMPORT_REF static PVMFNodeInterface* Create(PvmiMIOControl* aMIOControl, bool logBitstreams = false); 65 66 /** 67 * This function allows the application to delete an instance of a PVCommsIONode 68 * and reclaim all allocated resources. An instance can be deleted only in 69 * the idle state. An attempt to delete in any other state will fail and return false. 70 * 71 * @param aNode The PVCommsIONode to be deleted. 72 */ 73 OSCL_IMPORT_REF static void Delete(PVMFNodeInterface* aNode); 74 75 /** 76 * This function allows the application to retrieve the 77 * media I/O control instance contained within the node. 78 * 79 * @param aNode The PVCommsIONode 80 * @returns Pointer to the media I/O component. 81 */ 82 OSCL_IMPORT_REF static PvmiMIOControl* GetMediaIOControl(PVMFNodeInterface* aNode); 83 }; 84 85 #endif // PV_COMMS_IO_NODE_FACTORY_H_INCLUDED 86