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_FILEOUTPUT_FACTORY_H_INCLUDED 19 #define PVMF_FILEOUTPUT_FACTORY_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 25 #ifndef OSCL_SCHEDULER_AO_H_INCLUDED 26 #include "oscl_scheduler_ao.h" 27 #endif 28 29 // Forward declaration 30 class PVMFNodeInterface; 31 32 //Port tags for this node. 33 typedef enum 34 { 35 PVMF_FILE_OUTPUT_NODE_PORT_TYPE_SINK 36 } PVMFFileOutputNodePortTag; 37 38 #define KPVFileOutputNodeUuid PVUuid(0xa9fb43bb,0xfed4,0x4914,0xa4,0xbf,0x7d,0x04,0x3f,0x45,0x0c,0x24) 39 40 /** 41 * PVFileOutputNodeFactory Class 42 * 43 * PVFileOutputNodeFactory class is a singleton class which instantiates and provides 44 * access to PV FileOutput node. It returns a PVMFNodeInterface 45 * reference, the interface class of the PVMFFileOutputNode. 46 * 47 * The client is expected to contain and maintain a pointer to the instance created 48 * while the node is active. 49 */ 50 class PVFileOutputNodeFactory 51 { 52 public: 53 /** 54 * Creates an instance of a FileOutput. If the creation fails, this function will leave. 55 * 56 * @param aPriority The active object priority for the node. Default is standard priority if not specified 57 * @returns A pointer to an author or leaves if instantiation fails 58 **/ 59 OSCL_IMPORT_REF static PVMFNodeInterface* CreateFileOutput(int32 aPriority = OsclActiveObject::EPriorityNominal); 60 61 /** 62 * Creates an instance of a FileOutput. If the creation fails, this function will leave. 63 * 64 * @param aFileName pathname of file to write to. 65 * @param aFormat media format for file. 66 * @param aPriority The active object priority for the node. Default is standard priority if not specified 67 * @returns A pointer to an author or leaves if instantiation fails 68 **/ 69 OSCL_IMPORT_REF static PVMFNodeInterface* CreateFileOutput(OSCL_wString &aFileName, PVMFFormatType aFormat, int32 aPriority = OsclActiveObject::EPriorityNominal); 70 71 /** 72 * This function allows the application to delete an instance of a PVMFFileOutputNode 73 * and reclaim all allocated resources. An instance can be deleted only in 74 * the idle state. An attempt to delete in any other state will fail and return false. 75 * 76 * @param aComposer The file format composer to be deleted. 77 * @returns A status code indicating success or failure. 78 **/ 79 OSCL_IMPORT_REF static bool DeleteFileOutput(PVMFNodeInterface* aNode); 80 }; 81 82 #endif // PVMF_FILEOUTPUT_FACTORY_H_INCLUDED 83