1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
18 #ifndef PVMI_MIO_FILEINPUT_FACTORY_H_INCLUDED
19 #define PVMI_MIO_FILEINPUT_FACTORY_H_INCLUDED
21 #ifndef OSCL_BASE_H_INCLUDED
22 #include "oscl_base.h"
24 #ifndef OSCL_MEM_H_INCLUDED
27 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED
28 #include "oscl_string_containers.h"
30 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED
31 #include "pvmf_format_type.h"
34 // Forward declarations
36 class OsclMemAllocator;
39 * Structure containing configuration info for this node
41 class PvmiMIOFileInputSettings
44 PvmiMIOFileInputSettings()
46 iMediaFormat = PVMF_MIME_FORMAT_UNKNOWN;
47 iLoopInputFile = true;
48 iSamplingFrequency = 8000;
50 iNum20msFramesPerChunk = 1;
59 PvmiMIOFileInputSettings(const PvmiMIOFileInputSettings& aSettings)
61 iMediaFormat = aSettings.iMediaFormat;
62 iLoopInputFile = aSettings.iLoopInputFile;
63 iSamplingFrequency = aSettings.iSamplingFrequency;
64 iNumChannels = aSettings.iNumChannels;
65 iNum20msFramesPerChunk = aSettings.iNum20msFramesPerChunk;
66 iTimescale = aSettings.iTimescale;
67 iFrameHeight = aSettings.iFrameHeight;
68 iFrameWidth = aSettings.iFrameWidth;
69 iFrameRate = aSettings.iFrameRate;
70 iFileName = aSettings.iFileName;
71 iLogFileName = aSettings.iLogFileName;
72 iTextFileName = aSettings.iTextFileName;
73 iAudioLogFileName = aSettings.iAudioLogFileName;
74 iVideoLogFileName = aSettings.iVideoLogFileName;
75 iTotalSamples = aSettings.iTotalSamples;
76 iAverageBitRate = aSettings.iAverageBitRate;
79 ~PvmiMIOFileInputSettings()
81 iMediaFormat = PVMF_MIME_FORMAT_UNKNOWN;
82 iLoopInputFile = true;
83 iSamplingFrequency = 8000;
85 iNum20msFramesPerChunk = 1;
95 PVMFFormatType iMediaFormat;
97 OSCL_wStackString<512> iFileName;
98 OSCL_wStackString<512> iLogFileName;
99 OSCL_wStackString<512> iTextFileName;
100 OSCL_wStackString<512> iAudioLogFileName;
101 OSCL_wStackString<512> iVideoLogFileName;
102 // Settings for audio files
103 uint32 iSamplingFrequency;
105 uint32 iNum20msFramesPerChunk;
106 // Settings for video files
110 OsclFloat iFrameRate;
111 uint32 iTotalSamples;
112 uint32 iAverageBitRate;
117 * Factory class for PvmiMIOFileInput
119 class PvmiMIOFileInputFactory
123 * Creates an instance of PvmiMIOFileInput. If the creation fails,
124 * this function will leave.
126 * @param aSettings Settings for PvmiMIOFileInput
127 * @returns A pointer to an PvmiMIOControl for the file input media input module
128 * @throw Leaves with OsclErrNoMemory if memory allocation failed.
130 OSCL_IMPORT_REF static PvmiMIOControl* Create(const PvmiMIOFileInputSettings& aSettings);
133 * This function allows the application to delete an instance of file input MIO module
134 * and reclaim all allocated resources. An instance can be deleted only in
135 * the idle state. An attempt to delete in any other state will fail and return false.
137 * @param aNode The file input MIO module to be deleted.
138 * @returns A status code indicating success or failure.
140 OSCL_IMPORT_REF static bool Delete(PvmiMIOControl* aMio);
143 #endif // PVMI_MIO_FILEINPUT_FACTORY_H_INCLUDED