sl@0
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@publishedPartner
|
sl@0
|
21 |
@deprecated
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifndef _MP4LIB_H
|
sl@0
|
25 |
#define _MP4LIB_H
|
sl@0
|
26 |
|
sl@0
|
27 |
#define MP4Handle mp4_i32*
|
sl@0
|
28 |
|
sl@0
|
29 |
#include <f32file.h>
|
sl@0
|
30 |
#include <caf/caf.h>
|
sl@0
|
31 |
#include <3gplibrary/mp4config.h>
|
sl@0
|
32 |
|
sl@0
|
33 |
/**
|
sl@0
|
34 |
Provides async parse read observer.
|
sl@0
|
35 |
*/
|
sl@0
|
36 |
class M3GPMP4LibAsyncObserver
|
sl@0
|
37 |
{
|
sl@0
|
38 |
public:
|
sl@0
|
39 |
|
sl@0
|
40 |
/**
|
sl@0
|
41 |
Informs the client about asyncronous parse audio frames operation completion.
|
sl@0
|
42 |
|
sl@0
|
43 |
@param aError Error code.
|
sl@0
|
44 |
@param aAudioSize Size of the returned audio frames (in bytes).
|
sl@0
|
45 |
@param aTimeStamp Audio frame presentation time in milliseconds from the
|
sl@0
|
46 |
beginning of the audio sequence.
|
sl@0
|
47 |
@param aReturnedFrames Number of frames returned, or 0 if not known.
|
sl@0
|
48 |
@param aTimestamp2 Audio frame presentation time in timescale from the
|
sl@0
|
49 |
beginning of the audio sequence
|
sl@0
|
50 |
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
virtual void M3GPMP4LibAudioFramesAvailable(MP4Err aError,
|
sl@0
|
53 |
mp4_u32 aAudioSize,
|
sl@0
|
54 |
mp4_u32 aTimeStamp,
|
sl@0
|
55 |
mp4_u32 aReturnedFrames,
|
sl@0
|
56 |
mp4_u32 aTimestamp2) = 0;
|
sl@0
|
57 |
|
sl@0
|
58 |
/**
|
sl@0
|
59 |
Informs the client about asyncronous parse video frame operation completion.
|
sl@0
|
60 |
|
sl@0
|
61 |
@param aError Error code.
|
sl@0
|
62 |
@param aFrameSize Size of the returned frame (in bytes).
|
sl@0
|
63 |
@param aTimeStamp Video frame presentation time in milliseconds from the
|
sl@0
|
64 |
beginning of the video sequence
|
sl@0
|
65 |
@param aKeyFrame Returns MP4TRUE if the current frame is a key frame (intra),
|
sl@0
|
66 |
otherwise the value is MP4FALSE
|
sl@0
|
67 |
@param aTimestamp2 Video frame presentation time in timescale from the beginning
|
sl@0
|
68 |
of the video sequence
|
sl@0
|
69 |
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
virtual void M3GPMP4LibVideoFrameAvailable(MP4Err aError,
|
sl@0
|
72 |
mp4_u32 aFrameSize,
|
sl@0
|
73 |
mp4_u32 aTimeStamp,
|
sl@0
|
74 |
mp4_bool aKeyFrame,
|
sl@0
|
75 |
mp4_u32 aTimestamp2) = 0;
|
sl@0
|
76 |
};
|
sl@0
|
77 |
|
sl@0
|
78 |
/**
|
sl@0
|
79 |
This class provides async temporary file deleting observer.
|
sl@0
|
80 |
*/
|
sl@0
|
81 |
class M3GPMP4LibAsyncTempFileRemoverObserver
|
sl@0
|
82 |
{
|
sl@0
|
83 |
public:
|
sl@0
|
84 |
|
sl@0
|
85 |
/**
|
sl@0
|
86 |
Informs the client about unused temporary file that can be deleted.
|
sl@0
|
87 |
@param tempFileName Name of the temporary file that can be deleted.
|
sl@0
|
88 |
Ownership of the file name memory buffer is transferred.
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
virtual void M3GPMP4LibDeleteTempFileName( MP4FileName tempFileName ) = 0;
|
sl@0
|
91 |
|
sl@0
|
92 |
};
|
sl@0
|
93 |
#ifdef __cplusplus
|
sl@0
|
94 |
extern "C" {
|
sl@0
|
95 |
#endif
|
sl@0
|
96 |
|
sl@0
|
97 |
|
sl@0
|
98 |
/**
|
sl@0
|
99 |
Error codes returned by the library
|
sl@0
|
100 |
*/
|
sl@0
|
101 |
enum
|
sl@0
|
102 |
{
|
sl@0
|
103 |
/** Success */
|
sl@0
|
104 |
MP4_OK,
|
sl@0
|
105 |
/** Generic error */
|
sl@0
|
106 |
MP4_ERROR,
|
sl@0
|
107 |
/** Library can't allocate memory */
|
sl@0
|
108 |
MP4_OUT_OF_MEMORY,
|
sl@0
|
109 |
/** MP4 library needs more data before the
|
sl@0
|
110 |
requested information can be returned */
|
sl@0
|
111 |
MP4_NOT_AVAILABLE,
|
sl@0
|
112 |
/** The library has been opened with the input in a file */
|
sl@0
|
113 |
MP4_FILE_MODE,
|
sl@0
|
114 |
/** The input is not streamable */
|
sl@0
|
115 |
MP4_NOT_STREAMABLE,
|
sl@0
|
116 |
/** Frame of requested type is not available */
|
sl@0
|
117 |
MP4_NO_REQUESTED_FRAME,
|
sl@0
|
118 |
/** Requested frame doesn't fit into the given buffer */
|
sl@0
|
119 |
MP4_BUFFER_TOO_SMALL,
|
sl@0
|
120 |
/** No more video frames left */
|
sl@0
|
121 |
MP4_END_OF_VIDEO,
|
sl@0
|
122 |
/** Can't seek to requested position */
|
sl@0
|
123 |
MP4_CANT_SEEK,
|
sl@0
|
124 |
/** Error in file handling */
|
sl@0
|
125 |
MP4_FILE_ERROR,
|
sl@0
|
126 |
/** Input stream is invalid */
|
sl@0
|
127 |
MP4_INVALID_INPUT_STREAM,
|
sl@0
|
128 |
/** Frame doesn't exist (previous frame was last) */
|
sl@0
|
129 |
MP4_NO_FRAME,
|
sl@0
|
130 |
/** Illegal type */
|
sl@0
|
131 |
MP4_INVALID_TYPE,
|
sl@0
|
132 |
/** Timescale has not been set */
|
sl@0
|
133 |
MP4_TIMESCALE_NOT_SET,
|
sl@0
|
134 |
/** Error writing metadata */
|
sl@0
|
135 |
MP4_METADATA_ERROR,
|
sl@0
|
136 |
/** No video in input stream */
|
sl@0
|
137 |
MP4_NO_VIDEO,
|
sl@0
|
138 |
/** No audio in input stream */
|
sl@0
|
139 |
MP4_NO_AUDIO,
|
sl@0
|
140 |
/** Output buffer has not been initialized for buffer writing */
|
sl@0
|
141 |
MP4_NO_OUTPUT_BUFFER,
|
sl@0
|
142 |
/** Not enough space in output buffer to write to */
|
sl@0
|
143 |
MP4_OUTPUT_BUFFER_TOO_SMALL,
|
sl@0
|
144 |
/** No UDTA data found */
|
sl@0
|
145 |
MP4_UDTA_NOT_FOUND
|
sl@0
|
146 |
};
|
sl@0
|
147 |
|
sl@0
|
148 |
|
sl@0
|
149 |
/**
|
sl@0
|
150 |
Possible data source types
|
sl@0
|
151 |
*/
|
sl@0
|
152 |
enum
|
sl@0
|
153 |
{
|
sl@0
|
154 |
/** Data is read from an RFile64 handle */
|
sl@0
|
155 |
MP4_SOURCE_RFILE,
|
sl@0
|
156 |
/** Data is read via the CAF */
|
sl@0
|
157 |
MP4_SOURCE_CAF,
|
sl@0
|
158 |
};
|
sl@0
|
159 |
|
sl@0
|
160 |
/**
|
sl@0
|
161 |
Possible input/output values for audio/video type
|
sl@0
|
162 |
*/
|
sl@0
|
163 |
|
sl@0
|
164 |
/** No audio or video */
|
sl@0
|
165 |
#define MP4_TYPE_NONE 0x0000
|
sl@0
|
166 |
/** Video Type. MPEG-4 video (MPEG-4 Part 2) - Simple and Advance Simple Profiles */
|
sl@0
|
167 |
#define MP4_TYPE_MPEG4_VIDEO 0x0001
|
sl@0
|
168 |
/** Audio Type. MPEG-4 audio (MPEG-4 Part 3) */
|
sl@0
|
169 |
#define MP4_TYPE_MPEG4_AUDIO 0x0002
|
sl@0
|
170 |
/** Video Type. H263 Profile 0 */
|
sl@0
|
171 |
#define MP4_TYPE_H263_PROFILE_0 0x0004
|
sl@0
|
172 |
/** Video Type. H263 Profile 3 */
|
sl@0
|
173 |
#define MP4_TYPE_H263_PROFILE_3 0x0008
|
sl@0
|
174 |
/** Audio Type. AMR NB */
|
sl@0
|
175 |
#define MP4_TYPE_AMR_NB 0x0010
|
sl@0
|
176 |
/** Audio Type. AMR WB */
|
sl@0
|
177 |
#define MP4_TYPE_AMR_WB 0x0020
|
sl@0
|
178 |
/** Type not supported */
|
sl@0
|
179 |
#define MP4_TYPE_UNSUPPORTED 0x0040
|
sl@0
|
180 |
/** AVC baseline (MPEG-4 Part 10) */
|
sl@0
|
181 |
#define MP4_TYPE_AVC_PROFILE_BASELINE 0x0080
|
sl@0
|
182 |
/** AVC main (MPEG-4 Part 10) */
|
sl@0
|
183 |
#define MP4_TYPE_AVC_PROFILE_MAIN 0x0100
|
sl@0
|
184 |
/** AVC extended (MPEG-4 Part 10) */
|
sl@0
|
185 |
#define MP4_TYPE_AVC_PROFILE_EXTENDED 0x0200
|
sl@0
|
186 |
/** QCELP 13K additions */
|
sl@0
|
187 |
#define MP4_TYPE_QCELP_13K 0x0400
|
sl@0
|
188 |
/** AVC high (MPEG-4 Part 10) */
|
sl@0
|
189 |
#define MP4_TYPE_AVC_PROFILE_HIGH 0x0800
|
sl@0
|
190 |
|
sl@0
|
191 |
/**
|
sl@0
|
192 |
Flags used by composer
|
sl@0
|
193 |
*/
|
sl@0
|
194 |
/** No special setup */
|
sl@0
|
195 |
#define MP4_FLAG_NONE 0x0000
|
sl@0
|
196 |
/** Meta data is placed at end of file */
|
sl@0
|
197 |
#define MP4_FLAG_METADATALAST 0x0001
|
sl@0
|
198 |
/** Collect metadata in files instead of storing it in memory */
|
sl@0
|
199 |
#define MP4_FLAG_LONGCLIP 0x0002
|
sl@0
|
200 |
/** Generate a 3G2 File instead of a 3GP File */
|
sl@0
|
201 |
#define MP4_FLAG_GENERATE_3G2 0x0004
|
sl@0
|
202 |
/** Generate a MP4 File instead of a 3GP File */
|
sl@0
|
203 |
#define MP4_FLAG_GENERATE_MP4 0x0008
|
sl@0
|
204 |
/** Use large output buffers for writing */
|
sl@0
|
205 |
#define MP4_FLAG_LARGEFILEBUFFER 0x0010
|
sl@0
|
206 |
|
sl@0
|
207 |
|
sl@0
|
208 |
/** Size of buf in MP4HandleStruct must be at least 128 bytes */
|
sl@0
|
209 |
#define TMPBUFSIZE 128
|
sl@0
|
210 |
/** Duration of one AMR frame is 20 ms */
|
sl@0
|
211 |
#define AUDIO_FRAME_DURATION 20
|
sl@0
|
212 |
|
sl@0
|
213 |
#define MP4FALSE (mp4_bool)0
|
sl@0
|
214 |
#define MP4TRUE (mp4_bool)1
|
sl@0
|
215 |
|
sl@0
|
216 |
/**
|
sl@0
|
217 |
Possible locations for user data atom (UDTA)
|
sl@0
|
218 |
*/
|
sl@0
|
219 |
/** No user data */
|
sl@0
|
220 |
#define MP4_UDTA_NONE 0x0000
|
sl@0
|
221 |
/** User data resides within the Movie Box */
|
sl@0
|
222 |
#define MP4_UDTA_MOOV 0x0001
|
sl@0
|
223 |
/** User data resides within the Track Box for video */
|
sl@0
|
224 |
#define MP4_UDTA_VIDEOTRAK 0x0002
|
sl@0
|
225 |
/** User data resides within the Track Box for audio */
|
sl@0
|
226 |
#define MP4_UDTA_AUDIOTRAK 0x0004
|
sl@0
|
227 |
|
sl@0
|
228 |
/**
|
sl@0
|
229 |
Initializes the MP4 composing operation. The instance handle of the library is
|
sl@0
|
230 |
set by the function.
|
sl@0
|
231 |
|
sl@0
|
232 |
The possible values of type parameter are
|
sl@0
|
233 |
|
sl@0
|
234 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
235 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
236 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
237 |
MP4_TYPE_AMR_NB
|
sl@0
|
238 |
MP4_TYPE_AMR_WB
|
sl@0
|
239 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
240 |
MP4_TYPE_NONE
|
sl@0
|
241 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
242 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
243 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
244 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
245 |
MP4_TYPE_QCELP_13K
|
sl@0
|
246 |
|
sl@0
|
247 |
In addition, any combination of one video and one audio type are
|
sl@0
|
248 |
possible. For example
|
sl@0
|
249 |
|
sl@0
|
250 |
MP4_TYPE_H263_PROFILE_0 | MP4_TYPE_AMR_NB
|
sl@0
|
251 |
|
sl@0
|
252 |
The output file is placed in the current working directory if no path is
|
sl@0
|
253 |
specified. The type of filename is dependent on the architecture. When
|
sl@0
|
254 |
compiling in Symbian OS, this is a unicode string.
|
sl@0
|
255 |
|
sl@0
|
256 |
|
sl@0
|
257 |
@param handle MP4 library handle
|
sl@0
|
258 |
@param filename Name of the output MP4 file
|
sl@0
|
259 |
@param type Type of the output file
|
sl@0
|
260 |
|
sl@0
|
261 |
@return MP4_OK Success
|
sl@0
|
262 |
MP4_ERROR Generic error
|
sl@0
|
263 |
MP4_FILE_ERROR Error opening file
|
sl@0
|
264 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
265 |
*/
|
sl@0
|
266 |
extern IMPORT_C MP4Err MP4ComposeOpen(MP4Handle *handle, MP4FileName filename, mp4_u32 type);
|
sl@0
|
267 |
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
This function initializes the MP4 composing operation. The instance
|
sl@0
|
270 |
handle of the library is set by the function.
|
sl@0
|
271 |
|
sl@0
|
272 |
The possible values of type parameter are
|
sl@0
|
273 |
|
sl@0
|
274 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
275 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
276 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
277 |
MP4_TYPE_AMR_NB
|
sl@0
|
278 |
MP4_TYPE_AMR_WB
|
sl@0
|
279 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
280 |
MP4_TYPE_NONE
|
sl@0
|
281 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
282 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
283 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
284 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
285 |
MP4_TYPE_QCELP_13K
|
sl@0
|
286 |
|
sl@0
|
287 |
In addition, any combination of one video and one audio type are possible. For example
|
sl@0
|
288 |
|
sl@0
|
289 |
MP4_TYPE_H263_PROFILE_0 | MP4_TYPE_AMR_NB
|
sl@0
|
290 |
|
sl@0
|
291 |
The output is placed in the buffer given as argument.
|
sl@0
|
292 |
Size of composed data is in composedSize variable.
|
sl@0
|
293 |
|
sl@0
|
294 |
@param handle MP4 library handle
|
sl@0
|
295 |
@param type Type of the output file
|
sl@0
|
296 |
@param composeBuffer Buffer to write to.
|
sl@0
|
297 |
@param composedSize Size of composed data.
|
sl@0
|
298 |
|
sl@0
|
299 |
@return
|
sl@0
|
300 |
MP4_OK Success
|
sl@0
|
301 |
MP4_ERROR Generic error
|
sl@0
|
302 |
MP4_FILE_ERROR Error opening file
|
sl@0
|
303 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
304 |
MP4_NO_OUTPUT_BUFFER No composed buffer
|
sl@0
|
305 |
*/
|
sl@0
|
306 |
extern IMPORT_C MP4Err MP4ComposeOpenToBuffer(MP4Handle *handle, mp4_u32 type, mp4_u8* composeBuffer, mp4_u32 *composedSize);
|
sl@0
|
307 |
|
sl@0
|
308 |
/**
|
sl@0
|
309 |
This function initializes the MP4 composing operation to existing file handle. The instance
|
sl@0
|
310 |
handle of the library is set by the function.
|
sl@0
|
311 |
|
sl@0
|
312 |
NOTE: MP4_FLAG_METADATALAST must be defined in MP4ComposeSetFlags if MP4ComposeOpenFileHandle is used!
|
sl@0
|
313 |
|
sl@0
|
314 |
The possible values of type parameter are
|
sl@0
|
315 |
|
sl@0
|
316 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
317 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
318 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
319 |
MP4_TYPE_AMR_NB
|
sl@0
|
320 |
MP4_TYPE_AMR_WB
|
sl@0
|
321 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
322 |
MP4_TYPE_NONE
|
sl@0
|
323 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
324 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
325 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
326 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
327 |
MP4_TYPE_QCELP_13K
|
sl@0
|
328 |
|
sl@0
|
329 |
In addition, any combination of one video and one audio type are possible. For example
|
sl@0
|
330 |
|
sl@0
|
331 |
MP4_TYPE_H263_PROFILE_0 | MP4_TYPE_AMR_NB
|
sl@0
|
332 |
|
sl@0
|
333 |
The output file is placed in the current working directory if no path is
|
sl@0
|
334 |
specified. The type of filename is dependent on the architecture. When
|
sl@0
|
335 |
compiling in Symbian OS, this is a unicode string.
|
sl@0
|
336 |
|
sl@0
|
337 |
@param handle MP4 library handle
|
sl@0
|
338 |
@param composedfile File handle to output file
|
sl@0
|
339 |
@param metadataTempDrive If MP4ComposeSetFlags() is configured to use temporary files for metadata
|
sl@0
|
340 |
(MP4_FLAG_LONGCLIP) this is way to tell library which drive to use for
|
sl@0
|
341 |
temporary files.
|
sl@0
|
342 |
@param type Type of the output file
|
sl@0
|
343 |
|
sl@0
|
344 |
@return MP4_OK Success
|
sl@0
|
345 |
MP4_ERROR Generic error
|
sl@0
|
346 |
MP4_FILE_ERROR Error opening file
|
sl@0
|
347 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
348 |
*/
|
sl@0
|
349 |
extern IMPORT_C MP4Err MP4ComposeOpenFileHandle(MP4Handle *handle, RFile *composedfile, TDriveNumber metadataTempDrive, mp4_u32 type);
|
sl@0
|
350 |
|
sl@0
|
351 |
/**
|
sl@0
|
352 |
This function initializes the MP4 composing operation to existing file handle. The instance
|
sl@0
|
353 |
handle of the library is set by the function.
|
sl@0
|
354 |
|
sl@0
|
355 |
NOTE: MP4_FLAG_METADATALAST must be defined in MP4ComposeSetFlags if MP4ComposeOpenFileHandle is used!
|
sl@0
|
356 |
|
sl@0
|
357 |
The possible values of type parameter are
|
sl@0
|
358 |
|
sl@0
|
359 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
360 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
361 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
362 |
MP4_TYPE_AMR_NB
|
sl@0
|
363 |
MP4_TYPE_AMR_WB
|
sl@0
|
364 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
365 |
MP4_TYPE_NONE
|
sl@0
|
366 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
367 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
368 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
369 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
370 |
MP4_TYPE_QCELP_13K
|
sl@0
|
371 |
|
sl@0
|
372 |
In addition, any combination of one video and one audio type are possible. For example
|
sl@0
|
373 |
|
sl@0
|
374 |
MP4_TYPE_H263_PROFILE_0 | MP4_TYPE_AMR_NB
|
sl@0
|
375 |
|
sl@0
|
376 |
The output file is placed in the current working directory if no path is
|
sl@0
|
377 |
specified. The type of filename is dependent on the architecture. When
|
sl@0
|
378 |
compiling in Symbian OS, this is a unicode string.
|
sl@0
|
379 |
|
sl@0
|
380 |
@param handle MP4 library handle
|
sl@0
|
381 |
@param composedfile File handle to output file
|
sl@0
|
382 |
@param metadataTempDrive If MP4ComposeSetFlags() is configured to use temporary files for metadata
|
sl@0
|
383 |
(MP4_FLAG_LONGCLIP) this is way to tell library which drive to use for
|
sl@0
|
384 |
temporary files.
|
sl@0
|
385 |
@param type Type of the output file
|
sl@0
|
386 |
|
sl@0
|
387 |
@return MP4_OK Success
|
sl@0
|
388 |
MP4_ERROR Generic error
|
sl@0
|
389 |
MP4_FILE_ERROR Error opening file
|
sl@0
|
390 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
391 |
*/
|
sl@0
|
392 |
extern IMPORT_C MP4Err MP4ComposeOpenFileHandle64(MP4Handle *handle, RFile64 *composedfile, TDriveNumber metadataTempDrive, mp4_u32 type);
|
sl@0
|
393 |
|
sl@0
|
394 |
/**
|
sl@0
|
395 |
This function closes the MP4 composing operation. It frees the memory
|
sl@0
|
396 |
allocated by the library instance and closes the output MP4 file.
|
sl@0
|
397 |
|
sl@0
|
398 |
It is necessary to call this function before the output file is
|
sl@0
|
399 |
guaranteed to be a valid MP4 file even though the file may exist prior to
|
sl@0
|
400 |
the call.
|
sl@0
|
401 |
|
sl@0
|
402 |
The library handle is not valid after this call.
|
sl@0
|
403 |
|
sl@0
|
404 |
@param handle MP4 library handle
|
sl@0
|
405 |
|
sl@0
|
406 |
@return MP4_OK Success
|
sl@0
|
407 |
MP4_ERROR Generic error
|
sl@0
|
408 |
MP4_METADATA_ERROR Metadata could not be written
|
sl@0
|
409 |
*/
|
sl@0
|
410 |
extern IMPORT_C MP4Err MP4ComposeClose(MP4Handle handle);
|
sl@0
|
411 |
|
sl@0
|
412 |
/**
|
sl@0
|
413 |
This function is used to inform the MP4 library about the video data. The
|
sl@0
|
414 |
data given to the library is inserted into the MP4 file headers.
|
sl@0
|
415 |
|
sl@0
|
416 |
The parameter timescale indicates the timescale of the video data
|
sl@0
|
417 |
to be inserted. Timescale tells how many units of time pass in one second.
|
sl@0
|
418 |
|
sl@0
|
419 |
Note: Timescale should be chosen so that the duration of each sample is
|
sl@0
|
420 |
an integer. Timescale should also be chosen so that the duration
|
sl@0
|
421 |
of the presentation fits into 32 bits.
|
sl@0
|
422 |
|
sl@0
|
423 |
@param handle MP4 library handle
|
sl@0
|
424 |
@param timescale Timescale of video
|
sl@0
|
425 |
@param width Video width
|
sl@0
|
426 |
@param height Video height
|
sl@0
|
427 |
@param maxbitrate Maximum bitrate of video
|
sl@0
|
428 |
@param avgbitrate Average bitrate of video
|
sl@0
|
429 |
|
sl@0
|
430 |
@return MP4_OK Success
|
sl@0
|
431 |
MP4_ERROR Generic error
|
sl@0
|
432 |
*/
|
sl@0
|
433 |
extern IMPORT_C MP4Err MP4ComposeAddVideoDescription(MP4Handle handle, mp4_u32 timescale, mp4_u16 width, mp4_u16 height, mp4_u32 maxbitrate, mp4_u32 avgbitrate);
|
sl@0
|
434 |
|
sl@0
|
435 |
/**
|
sl@0
|
436 |
This function is used to inform the MP4 library about the audio data. The
|
sl@0
|
437 |
data given to the library is inserted into the MP4 file headers.
|
sl@0
|
438 |
|
sl@0
|
439 |
The parameter timescale indicates the timescale of the audio data
|
sl@0
|
440 |
to be inserted. Timescale tells how many units of time pass in one second.
|
sl@0
|
441 |
|
sl@0
|
442 |
Note: timescale must be smaller than 65536.
|
sl@0
|
443 |
|
sl@0
|
444 |
Note: audioFramesPerSample and modeSet are needed only for AMR audio.
|
sl@0
|
445 |
|
sl@0
|
446 |
@param handle MP4 library handle
|
sl@0
|
447 |
@param timescale Timescale of audio
|
sl@0
|
448 |
@param audioFramesPerSample AMR frames per sample
|
sl@0
|
449 |
@param modeSet AMR mode set
|
sl@0
|
450 |
|
sl@0
|
451 |
@return MP4_OK Success
|
sl@0
|
452 |
MP4_ERROR Generic error
|
sl@0
|
453 |
*/
|
sl@0
|
454 |
extern IMPORT_C MP4Err MP4ComposeAddAudioDescription(MP4Handle handle, mp4_u32 timescale, mp4_u8 audioFramesPerSample, mp4_u16 modeSet);
|
sl@0
|
455 |
|
sl@0
|
456 |
/**
|
sl@0
|
457 |
This function writes one video frame to the MP4 composer library.
|
sl@0
|
458 |
|
sl@0
|
459 |
The frames must be inserted in causal order. Because the library doesn't
|
sl@0
|
460 |
analyze the video bitstream, the frames can't be retrieved from the
|
sl@0
|
461 |
resulting MP4 file correctly if they are not in proper order.
|
sl@0
|
462 |
|
sl@0
|
463 |
The data is available in the MP4 output file only after calling
|
sl@0
|
464 |
MP4ComposeClose. MP4ComposeClose is called exactly once when all audio
|
sl@0
|
465 |
and video data has been inserted into the library.
|
sl@0
|
466 |
|
sl@0
|
467 |
@param handle MP4 library handle
|
sl@0
|
468 |
@param buffer Video frame data
|
sl@0
|
469 |
@param framesize Size of the video frame in bytes
|
sl@0
|
470 |
@param duration Duration of video frame (in timescale,
|
sl@0
|
471 |
see MP4ComposeAddVideoDescription)
|
sl@0
|
472 |
@param keyframe Flag to indicate whether this frame is a keyframe
|
sl@0
|
473 |
|
sl@0
|
474 |
@return MP4_OK Success
|
sl@0
|
475 |
MP4_ERROR Generic error
|
sl@0
|
476 |
MP4_TIMESCALE_NOT_SET Timescale has not been set
|
sl@0
|
477 |
*/
|
sl@0
|
478 |
extern IMPORT_C MP4Err MP4ComposeWriteVideoFrame(MP4Handle handle, mp4_u8 *buffer, mp4_u32 framesize, mp4_u32 duration, mp4_bool keyframe);
|
sl@0
|
479 |
|
sl@0
|
480 |
/**
|
sl@0
|
481 |
This function writes audio frames to the MP4 composer library. The data is
|
sl@0
|
482 |
available in the MP4 output file only after calling
|
sl@0
|
483 |
MP4ComposeClose. MP4ComposeClose is called exactly once when all audio
|
sl@0
|
484 |
and video data has been insrted into the library.
|
sl@0
|
485 |
|
sl@0
|
486 |
For MPEG audio:
|
sl@0
|
487 |
|
sl@0
|
488 |
This function writes one MPEG audio frame to the MP4 composer library.
|
sl@0
|
489 |
|
sl@0
|
490 |
Note: numberofframes is meaningless with MPEG audio since only one frame
|
sl@0
|
491 |
can be added with one call.
|
sl@0
|
492 |
|
sl@0
|
493 |
For other audio types:
|
sl@0
|
494 |
|
sl@0
|
495 |
This function writes a number of audio frames to the MP4 composer library.
|
sl@0
|
496 |
All audio frames inserted with one function call will be placed inside
|
sl@0
|
497 |
one audio sample in the resulting file.
|
sl@0
|
498 |
|
sl@0
|
499 |
Note: Once this function is called with a certain numberofframes
|
sl@0
|
500 |
parameter, it can't be changed. This is a limitation of the MP4 file
|
sl@0
|
501 |
format. Only the last call can have a different number of frames if
|
sl@0
|
502 |
their number is less than numberofframes.
|
sl@0
|
503 |
|
sl@0
|
504 |
@param handle MP4 library handle
|
sl@0
|
505 |
@param buffer Audio data
|
sl@0
|
506 |
@param bytestowrite Number of bytes of audio data in buffer
|
sl@0
|
507 |
@param numberofframes Number of frames to write
|
sl@0
|
508 |
@param duration Duration of audio frames (in timescale,
|
sl@0
|
509 |
see MP4ComposeAddAudioDescription)
|
sl@0
|
510 |
|
sl@0
|
511 |
@return MP4_OK Success
|
sl@0
|
512 |
MP4_ERROR Generic error
|
sl@0
|
513 |
MP4_TIMESCALE_NOT_SET Timescale has not been set
|
sl@0
|
514 |
*/
|
sl@0
|
515 |
extern IMPORT_C MP4Err MP4ComposeWriteAudioFrames(MP4Handle handle, mp4_u8 *buffer, mp4_u32 bytestowrite, mp4_u32 numberofframes, mp4_u32 duration);
|
sl@0
|
516 |
|
sl@0
|
517 |
/**
|
sl@0
|
518 |
This function writes MPEG-4 or AVC video DecoderSpecificInfo data into the appropriate atom.
|
sl@0
|
519 |
|
sl@0
|
520 |
If the video type is MPEG-4 the DecoderSpecificInfo will be written into the esds atom. If the
|
sl@0
|
521 |
video type is AVC (any profile) the DecoderSpecificInfo will be written into the avcC atom.
|
sl@0
|
522 |
|
sl@0
|
523 |
Note: This function needs to be called only when MPEG-4 or AVC video is used.
|
sl@0
|
524 |
|
sl@0
|
525 |
@param handle MP4 library handle
|
sl@0
|
526 |
@param info Buffer containing DecoderSpecificInfo
|
sl@0
|
527 |
@param infosize Size of info in bytes
|
sl@0
|
528 |
|
sl@0
|
529 |
@return MP4_OK Success
|
sl@0
|
530 |
MP4_ERROR Generic error
|
sl@0
|
531 |
*/
|
sl@0
|
532 |
extern IMPORT_C MP4Err MP4ComposeWriteVideoDecoderSpecificInfo(MP4Handle handle, mp4_u8 *info, mp4_u32 infosize);
|
sl@0
|
533 |
|
sl@0
|
534 |
/**
|
sl@0
|
535 |
This function writes MPEG audio DecoderSpecificInfo data into esds atom.
|
sl@0
|
536 |
|
sl@0
|
537 |
Note: This function needs to be called only when MPEG audio is used.
|
sl@0
|
538 |
|
sl@0
|
539 |
@param handle MP4 library handle
|
sl@0
|
540 |
@param info Buffer containing DecoderSpecificInfo
|
sl@0
|
541 |
@param infosize Size of info in bytes
|
sl@0
|
542 |
|
sl@0
|
543 |
@return MP4_OK Success
|
sl@0
|
544 |
MP4_ERROR Generic error
|
sl@0
|
545 |
*/
|
sl@0
|
546 |
extern IMPORT_C MP4Err MP4ComposeWriteAudioDecoderSpecificInfo(MP4Handle handle, mp4_u8 *info, mp4_u32 infosize);
|
sl@0
|
547 |
|
sl@0
|
548 |
/**
|
sl@0
|
549 |
This function allows settings flags that modify the behaviour
|
sl@0
|
550 |
of the library. Use binary OR to specify several flags.
|
sl@0
|
551 |
|
sl@0
|
552 |
The following flags can be used:
|
sl@0
|
553 |
|
sl@0
|
554 |
MP4_FLAG_NONE No special setup.
|
sl@0
|
555 |
|
sl@0
|
556 |
MP4_FLAG_METADATALAST Write metadata last in the file without tmpfile.
|
sl@0
|
557 |
Default is to write the metadata in the
|
sl@0
|
558 |
beginning of the file.
|
sl@0
|
559 |
|
sl@0
|
560 |
MP4_FLAG_LONGCLIP Collect metadata in files instead of collecting
|
sl@0
|
561 |
it in memory if the amount is large. Only usable
|
sl@0
|
562 |
in Symbian OS.
|
sl@0
|
563 |
|
sl@0
|
564 |
MP4_FLAG_GENERATE_3G2 Generate a 3G2 File instead of a 3GP File.
|
sl@0
|
565 |
If not set, then 3GP file is generated.
|
sl@0
|
566 |
Generation of 3G2 file may be automatically set
|
sl@0
|
567 |
during composition, based on the selection
|
sl@0
|
568 |
of 3GPP2 specific codecs.
|
sl@0
|
569 |
|
sl@0
|
570 |
MP4_FLAG_GENERATE_MP4 Generate a MP4 File instead of a 3GP File.
|
sl@0
|
571 |
If not set, then 3GP file is generated.
|
sl@0
|
572 |
Generation may be automatically set to 3GP
|
sl@0
|
573 |
if codecs selected do not support MP4.
|
sl@0
|
574 |
|
sl@0
|
575 |
MP4_FLAG_LARGEFILEBUFFER Use larger output buffers in file writing.
|
sl@0
|
576 |
Non MP4_ARCH_WIN32 compilations only.
|
sl@0
|
577 |
|
sl@0
|
578 |
Note: This function should be called after MP4ComposeOpen before
|
sl@0
|
579 |
any other MP4Compose functions.
|
sl@0
|
580 |
|
sl@0
|
581 |
Note: If MP4ComposeOpenFileHandle is used instead of MP4ComposeOpen the MP4_FLAG_METADATALAST must be defined.
|
sl@0
|
582 |
|
sl@0
|
583 |
@param handle MP4 library handle
|
sl@0
|
584 |
@param flags Flags to enable
|
sl@0
|
585 |
|
sl@0
|
586 |
@return MP4_OK Success
|
sl@0
|
587 |
MP4_ERROR Generic error
|
sl@0
|
588 |
MP4_OUT_OF_MEMORY Out of Memory
|
sl@0
|
589 |
*/
|
sl@0
|
590 |
extern IMPORT_C MP4Err MP4ComposeSetFlags(MP4Handle handle, mp4_u32 flags);
|
sl@0
|
591 |
|
sl@0
|
592 |
/**
|
sl@0
|
593 |
This function initializes the MP4 parsing operation. The instance handle
|
sl@0
|
594 |
of the library is set by the function.
|
sl@0
|
595 |
|
sl@0
|
596 |
The filename parameter is used to specify the type of the input. If the
|
sl@0
|
597 |
parameter is non-NULL, it is assumed to be the filename of the input MP4
|
sl@0
|
598 |
file. If the parameter is NULL, the library expects the input MP4 data to
|
sl@0
|
599 |
be inserted by subsequent calls of MP4ParseWriteData.
|
sl@0
|
600 |
|
sl@0
|
601 |
@param handle MP4 library handle
|
sl@0
|
602 |
@param filename Name of the input MP4 file or NULL if the data is coming from
|
sl@0
|
603 |
stream
|
sl@0
|
604 |
|
sl@0
|
605 |
@return MP4_OK Success
|
sl@0
|
606 |
MP4_ERROR Generic error
|
sl@0
|
607 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
608 |
MP4_FILE_ERROR Error opening file
|
sl@0
|
609 |
*/
|
sl@0
|
610 |
extern IMPORT_C MP4Err MP4ParseOpen(MP4Handle *handle, MP4FileName filename);
|
sl@0
|
611 |
|
sl@0
|
612 |
/**
|
sl@0
|
613 |
This function initializes the MP4 parsing operation. The instance handle
|
sl@0
|
614 |
of the library is set by the function.
|
sl@0
|
615 |
|
sl@0
|
616 |
The RFile *inputfile parameter is pointer to valid file handle.
|
sl@0
|
617 |
Library expects that file has been opened and will be closed outside of library.
|
sl@0
|
618 |
|
sl@0
|
619 |
@param handle MP4 library handle
|
sl@0
|
620 |
@param inputfile File handle to be parsed.
|
sl@0
|
621 |
|
sl@0
|
622 |
@return MP4_OK Success
|
sl@0
|
623 |
MP4_ERROR Generic error
|
sl@0
|
624 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
625 |
MP4_FILE_ERROR; Error accessing file
|
sl@0
|
626 |
*/
|
sl@0
|
627 |
extern IMPORT_C MP4Err MP4ParseOpenFileHandle(MP4Handle *handle, RFile *inputfile );
|
sl@0
|
628 |
|
sl@0
|
629 |
/**
|
sl@0
|
630 |
This function initializes the MP4 parsing operation. The instance handle
|
sl@0
|
631 |
of the library is set by the function.
|
sl@0
|
632 |
|
sl@0
|
633 |
The RFile64 *inputfile parameter is pointer to valid file handle.
|
sl@0
|
634 |
Library expects that file has been opened and will be closed outside of library.
|
sl@0
|
635 |
|
sl@0
|
636 |
@param handle MP4 library handle
|
sl@0
|
637 |
@param inputfile File handle to be parsed.
|
sl@0
|
638 |
|
sl@0
|
639 |
@return MP4_OK Success
|
sl@0
|
640 |
MP4_ERROR Generic error
|
sl@0
|
641 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
642 |
MP4_FILE_ERROR; Error accessing file
|
sl@0
|
643 |
*/
|
sl@0
|
644 |
extern IMPORT_C MP4Err MP4ParseOpenFileHandle64(MP4Handle *handle, RFile64 *inputfile );
|
sl@0
|
645 |
|
sl@0
|
646 |
/**
|
sl@0
|
647 |
This function initializes the MP4 parsing operation. The instance handle
|
sl@0
|
648 |
of the library is set by the function.
|
sl@0
|
649 |
|
sl@0
|
650 |
The ContentAccess::CData *inputfile parameter is pointer to valid CAF object.
|
sl@0
|
651 |
Library expects that file has been opened and will be closed outside of library.
|
sl@0
|
652 |
|
sl@0
|
653 |
@param handle MP4 library handle
|
sl@0
|
654 |
@param inputfile CAF data source handle to be parsed.
|
sl@0
|
655 |
|
sl@0
|
656 |
@return MP4_OK Success
|
sl@0
|
657 |
MP4_ERROR Generic error
|
sl@0
|
658 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
659 |
MP4_FILE_ERROR; Error accessing file
|
sl@0
|
660 |
*/
|
sl@0
|
661 |
extern IMPORT_C MP4Err MP4ParseOpenCAF(MP4Handle *handle, ContentAccess::CData *inputfile );
|
sl@0
|
662 |
|
sl@0
|
663 |
/**
|
sl@0
|
664 |
This function closes the MP4 parsing operation. It frees the resources
|
sl@0
|
665 |
allocated by the library instance.
|
sl@0
|
666 |
|
sl@0
|
667 |
The library handle is not valid after this call.
|
sl@0
|
668 |
|
sl@0
|
669 |
@param handle MP4 library handle
|
sl@0
|
670 |
|
sl@0
|
671 |
@return MP4_OK Success
|
sl@0
|
672 |
MP4_ERROR Generic error
|
sl@0
|
673 |
*/
|
sl@0
|
674 |
extern IMPORT_C MP4Err MP4ParseClose(MP4Handle handle);
|
sl@0
|
675 |
|
sl@0
|
676 |
/**
|
sl@0
|
677 |
This function returns parameters describing the video stream. It can be
|
sl@0
|
678 |
called after enough data has been inserted into the library so that MP4
|
sl@0
|
679 |
headers containing the information can be read. If there is not enough
|
sl@0
|
680 |
data, those functions return MP4_NOT_AVAILABLE and more data needs to be
|
sl@0
|
681 |
inserted into the library by MP4ParseWriteData.
|
sl@0
|
682 |
|
sl@0
|
683 |
The framerate parameter refers to the frame rate of the original video
|
sl@0
|
684 |
material.
|
sl@0
|
685 |
|
sl@0
|
686 |
The videotype parameter can be one of the following:
|
sl@0
|
687 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
688 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
689 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
690 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
691 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
692 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
693 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
694 |
|
sl@0
|
695 |
Note: For timescale parameter, NULL can be specified if the caller
|
sl@0
|
696 |
doesn't need the value.
|
sl@0
|
697 |
|
sl@0
|
698 |
@param handle MP4 library handle
|
sl@0
|
699 |
@param videolength Duration of video in milliseconds
|
sl@0
|
700 |
@param framerate Frame rate of video (in Hz)
|
sl@0
|
701 |
@param videotype Type of video stream
|
sl@0
|
702 |
@param videowidth Width of video image measured in pixels
|
sl@0
|
703 |
@param videoheight Height of video image measured in pixels
|
sl@0
|
704 |
@param timescale Timescale of video track
|
sl@0
|
705 |
|
sl@0
|
706 |
@return MP4_OK Success
|
sl@0
|
707 |
MP4_ERROR Generic error
|
sl@0
|
708 |
MP4_NOT_AVAILABLE MP4 library needs more data before the
|
sl@0
|
709 |
requested information can be returned
|
sl@0
|
710 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
711 |
MP4_NO_VIDEO Input doesn't contain video track
|
sl@0
|
712 |
*/
|
sl@0
|
713 |
extern IMPORT_C MP4Err MP4ParseRequestVideoDescription(MP4Handle handle, mp4_u32 *videolength, mp4_double *framerate, mp4_u32 *videotype, mp4_u32 *videowidth, mp4_u32 *videoheight, mp4_u32 *timescale);
|
sl@0
|
714 |
|
sl@0
|
715 |
/**
|
sl@0
|
716 |
This function returns parameters describing the audio stream. It can be
|
sl@0
|
717 |
called after enough data has been inserted into the library so that MP4
|
sl@0
|
718 |
headers containing the information can be read.
|
sl@0
|
719 |
|
sl@0
|
720 |
Note: framespersample parameter is set only when AMR type audio is used.
|
sl@0
|
721 |
|
sl@0
|
722 |
Note: For timescale parameter, NULL can be specified if the caller
|
sl@0
|
723 |
doesn't need the value.
|
sl@0
|
724 |
|
sl@0
|
725 |
@param handle MP4 library handle
|
sl@0
|
726 |
@param audiolength Duration of audio in milliseconds
|
sl@0
|
727 |
@param audiotype Type of audio
|
sl@0
|
728 |
@param framespersample Number of audio frames in each sample
|
sl@0
|
729 |
@param timescale Timescale of audio track
|
sl@0
|
730 |
@param averagebitrate Average bitrate of audio
|
sl@0
|
731 |
|
sl@0
|
732 |
@return MP4_OK Success
|
sl@0
|
733 |
MP4_ERROR Generic error
|
sl@0
|
734 |
MP4_NOT_AVAILABLE MP4 library needs more data before the
|
sl@0
|
735 |
requested information can be returned
|
sl@0
|
736 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
737 |
MP4_NO_AUDIO Input doesn't contain audio track
|
sl@0
|
738 |
*/
|
sl@0
|
739 |
extern IMPORT_C MP4Err MP4ParseRequestAudioDescription(MP4Handle handle, mp4_u32 *audiolength, mp4_u32 *audiotype, mp4_u8 *framespersample, mp4_u32 *timescale, mp4_u32 *averagebitrate);
|
sl@0
|
740 |
|
sl@0
|
741 |
/**
|
sl@0
|
742 |
This function returns parameters describing the contents of the MP4
|
sl@0
|
743 |
file. It can be called after enough data has been inserted into the
|
sl@0
|
744 |
library so that MP4 headers containing the information can be read.
|
sl@0
|
745 |
|
sl@0
|
746 |
@param handle MP4 library handle
|
sl@0
|
747 |
@param streamsize Length of the stream in bytes
|
sl@0
|
748 |
@param streamaveragebitrate Average bitrate of the stream in bps
|
sl@0
|
749 |
|
sl@0
|
750 |
@return MP4_OK Success
|
sl@0
|
751 |
MP4_ERROR Generic error
|
sl@0
|
752 |
MP4_NOT_AVAILABLE MP4 library needs more data before the
|
sl@0
|
753 |
requested information can be returned
|
sl@0
|
754 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
755 |
*/
|
sl@0
|
756 |
extern IMPORT_C MP4Err MP4ParseRequestStreamDescription(MP4Handle handle, mp4_u32 *streamsize, mp4_u32 *streamaveragebitrate);
|
sl@0
|
757 |
|
sl@0
|
758 |
/**
|
sl@0
|
759 |
This function inserts MP4 data to the MP4 library.
|
sl@0
|
760 |
|
sl@0
|
761 |
It is necessary to call this function only if the input filename has not
|
sl@0
|
762 |
been given with MP4ParseOpen. Several functions can return
|
sl@0
|
763 |
MP4_NOT_AVAILABLE if the library doesn't have enough data to return the
|
sl@0
|
764 |
information that the caller requests. In that case, more data needs to be
|
sl@0
|
765 |
inserted to the library before calling those functions again.
|
sl@0
|
766 |
|
sl@0
|
767 |
This function makes a copy of the data inserted into the library so the
|
sl@0
|
768 |
caller can use buffer for other purposes. If the function returns
|
sl@0
|
769 |
MP4_OUT_OF_MEMORY, the buffer contents have not been copied into the
|
sl@0
|
770 |
library and the caller needs to reduce the buffer size before calling
|
sl@0
|
771 |
again.
|
sl@0
|
772 |
|
sl@0
|
773 |
If bytestowrite argument is zero, it indicates that there would be no more
|
sl@0
|
774 |
data to feed via this function. Such a function call MUST be done if a
|
sl@0
|
775 |
complete 3GP/MP4 file is to be written to the library's internal memory. The
|
sl@0
|
776 |
buffer argument may be inputted as NULL in such a case.
|
sl@0
|
777 |
|
sl@0
|
778 |
@param handle MP4 library handle
|
sl@0
|
779 |
@param buffer Data to be written
|
sl@0
|
780 |
@param bytestowrite Size of buffer in bytes
|
sl@0
|
781 |
|
sl@0
|
782 |
@return MP4_OK Success
|
sl@0
|
783 |
MP4_ERROR Generic error
|
sl@0
|
784 |
MP4_OUT_OF_MEMORY Library can't allocate enough memory for the data
|
sl@0
|
785 |
*/
|
sl@0
|
786 |
extern IMPORT_C MP4Err MP4ParseWriteData(MP4Handle handle, mp4_u8 *buffer, mp4_u32 bytestowrite);
|
sl@0
|
787 |
|
sl@0
|
788 |
/**
|
sl@0
|
789 |
This function returns the number of bytes that the library instance has
|
sl@0
|
790 |
in its allocated buffers.
|
sl@0
|
791 |
|
sl@0
|
792 |
The function is only valid when the filename is not provided when opening
|
sl@0
|
793 |
the library. Zero is returned in bytes when in file mode.
|
sl@0
|
794 |
|
sl@0
|
795 |
@see MP4ParseWriteData.
|
sl@0
|
796 |
|
sl@0
|
797 |
@param handle MP4 library handle
|
sl@0
|
798 |
@param bytes Number of allocated bytes in the library
|
sl@0
|
799 |
|
sl@0
|
800 |
@return MP4_OK Success
|
sl@0
|
801 |
MP4_ERROR Generic error
|
sl@0
|
802 |
MP4_FILE_MODE The library has been opened with the input in a file
|
sl@0
|
803 |
*/
|
sl@0
|
804 |
extern IMPORT_C MP4Err MP4ParseGetBufferedBytes(MP4Handle handle, mp4_u32 *bytes);
|
sl@0
|
805 |
|
sl@0
|
806 |
/**
|
sl@0
|
807 |
This function returns the type of the next audio/video frame in the
|
sl@0
|
808 |
stream. The type can be one of the following:
|
sl@0
|
809 |
|
sl@0
|
810 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
811 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
812 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
813 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
814 |
MP4_TYPE_AMR_NB
|
sl@0
|
815 |
MP4_TYPE_AMR_WB
|
sl@0
|
816 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
817 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
818 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
819 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
820 |
MP4_TYPE_QCELP_13K
|
sl@0
|
821 |
|
sl@0
|
822 |
The function is only valid when the input is streamable.
|
sl@0
|
823 |
|
sl@0
|
824 |
When reading audio/video from an MP4 container in streaming mode, the
|
sl@0
|
825 |
samples must be read from the container in the same order as they were
|
sl@0
|
826 |
inserted in it. This function determines the type of the next sample and
|
sl@0
|
827 |
based on this information the user can call either MP4ParseReadVideoFrame
|
sl@0
|
828 |
or MP4ParseReadAudioFrames to fetch more data.
|
sl@0
|
829 |
|
sl@0
|
830 |
@param handle MP4 library handle
|
sl@0
|
831 |
@param type Type of the next frame
|
sl@0
|
832 |
|
sl@0
|
833 |
@return MP4_OK Success
|
sl@0
|
834 |
MP4_ERROR Generic error
|
sl@0
|
835 |
MP4_NOT_STREAMABLE The input is not streamable
|
sl@0
|
836 |
MP4_NOT_AVAILABLE MP4 library needs more data before the
|
sl@0
|
837 |
requested information can be returned
|
sl@0
|
838 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
839 |
MP4_NO_FRAME Frame doesn't exist (previous frame was last)
|
sl@0
|
840 |
*/
|
sl@0
|
841 |
extern IMPORT_C MP4Err MP4ParseNextFrameType(MP4Handle handle, mp4_u32 *type);
|
sl@0
|
842 |
|
sl@0
|
843 |
/**
|
sl@0
|
844 |
This function returns the size of the next frame of type type in bytes.
|
sl@0
|
845 |
The frame type can be one of the following:
|
sl@0
|
846 |
|
sl@0
|
847 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
848 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
849 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
850 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
851 |
MP4_TYPE_AMR_NB
|
sl@0
|
852 |
MP4_TYPE_AMR_WB
|
sl@0
|
853 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
854 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
855 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
856 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
857 |
MP4_TYPE_QCELP_13K
|
sl@0
|
858 |
|
sl@0
|
859 |
@param handle MP4 library handle
|
sl@0
|
860 |
@param type Type of the frame
|
sl@0
|
861 |
@param framesize Size of the requested frame in bytes
|
sl@0
|
862 |
|
sl@0
|
863 |
@return MP4_OK Success
|
sl@0
|
864 |
MP4_ERROR Generic error
|
sl@0
|
865 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
866 |
frames can be returned
|
sl@0
|
867 |
MP4_NO_REQUESTED_FRAME Frame of requested type is not available
|
sl@0
|
868 |
MP4_INVALID_TYPE Illegal type
|
sl@0
|
869 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
870 |
|
sl@0
|
871 |
*/
|
sl@0
|
872 |
extern IMPORT_C MP4Err MP4ParseNextFrameSize(MP4Handle handle, mp4_u32 type, mp4_u32 *framesize);
|
sl@0
|
873 |
|
sl@0
|
874 |
/**
|
sl@0
|
875 |
This function reads the next video frame from the MP4 file/stream and
|
sl@0
|
876 |
returns it to the caller.
|
sl@0
|
877 |
|
sl@0
|
878 |
Note: Next frame depends on the position in the input MP4 file.
|
sl@0
|
879 |
MP4ParseSeek can be used to change the current position in the MP4 file.
|
sl@0
|
880 |
|
sl@0
|
881 |
If the function returns MP4_NOT_AVAILABLE, the caller needs to call
|
sl@0
|
882 |
MP4ParseWriteData to insert more data before calling again.
|
sl@0
|
883 |
|
sl@0
|
884 |
framesize is returned even if buffer was too small to contain the data.
|
sl@0
|
885 |
|
sl@0
|
886 |
Note: Specify NULL as timestamp2 if not interested in this parameter.
|
sl@0
|
887 |
|
sl@0
|
888 |
@param handle MP4 library handle
|
sl@0
|
889 |
@param buffer Video frame is returned here
|
sl@0
|
890 |
@param buffersize Size of the user allocated buffer (in bytes)
|
sl@0
|
891 |
@param framesize Size of the frame that was returned (in bytes)
|
sl@0
|
892 |
@param timestamp Video frame presentation time in milliseconds from the
|
sl@0
|
893 |
beginning of the video sequence
|
sl@0
|
894 |
@param keyframe Has a value of MP4TRUE if current frame is a keyframe
|
sl@0
|
895 |
(intra) or MP4FALSE otherwise
|
sl@0
|
896 |
@param timestamp2 Video frame presentation time in timescale from the
|
sl@0
|
897 |
beginning of the video sequence
|
sl@0
|
898 |
|
sl@0
|
899 |
@return MP4_OK Success
|
sl@0
|
900 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
901 |
frame can be returned
|
sl@0
|
902 |
MP4_BUFFER_TOO_SMALL Requested frame doesn't fit into the given buffer
|
sl@0
|
903 |
MP4_NO_FRAME Frame doesn't exist (previous frame was last)
|
sl@0
|
904 |
MP4_ERROR Generic error
|
sl@0
|
905 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
906 |
*/
|
sl@0
|
907 |
extern IMPORT_C MP4Err MP4ParseReadVideoFrame(MP4Handle handle, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *framesize, mp4_u32 *timestamp, mp4_bool *keyframe, mp4_u32 *timestamp2);
|
sl@0
|
908 |
|
sl@0
|
909 |
/**
|
sl@0
|
910 |
This function reads DecoderSpecificInfo data from MPEG-4 or AVC metadata and
|
sl@0
|
911 |
returns it to the caller.
|
sl@0
|
912 |
|
sl@0
|
913 |
If the video type is MPEG-4 the DecoderSpecificInfo from the esds atom will be
|
sl@0
|
914 |
returned. If the video type is AVC (any profile) the DecoderSpecificInfo from the
|
sl@0
|
915 |
avcC atom will be returned.
|
sl@0
|
916 |
|
sl@0
|
917 |
decspecinfosize is set even if buffer is too small to contain the data.
|
sl@0
|
918 |
The function can be called with buffersize 0 to query the size of
|
sl@0
|
919 |
DecoderSpecificInfo.
|
sl@0
|
920 |
|
sl@0
|
921 |
Note: DecoderSpecificInfo is specific to MPEG-4 and AVC video. Therefore,
|
sl@0
|
922 |
only MPEG-4 or AVC video streams contain this information.
|
sl@0
|
923 |
|
sl@0
|
924 |
@param handle MP4 library handle
|
sl@0
|
925 |
@param buffer DecoderSpecificInfo is returned here
|
sl@0
|
926 |
@param buffersize Size of the user allocated buffer (in bytes)
|
sl@0
|
927 |
@param decspecinfosize Size of DecoderSpecificInfo is returned here
|
sl@0
|
928 |
|
sl@0
|
929 |
@return MP4_OK Success
|
sl@0
|
930 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
931 |
frames can be returned
|
sl@0
|
932 |
MP4_BUFFER_TOO_SMALL Requested data doesn't fit into the given buffer
|
sl@0
|
933 |
MP4_ERROR Generic error
|
sl@0
|
934 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
935 |
*/
|
sl@0
|
936 |
extern IMPORT_C MP4Err MP4ParseReadVideoDecoderSpecificInfo(MP4Handle handle, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *decspecinfosize);
|
sl@0
|
937 |
|
sl@0
|
938 |
/**
|
sl@0
|
939 |
This function reads the audio frames that are stored in the current
|
sl@0
|
940 |
audio sample from the MP4 file/stream and returns them to the caller.
|
sl@0
|
941 |
|
sl@0
|
942 |
Note: Next frame depends on the position in the input MP4 file.
|
sl@0
|
943 |
MP4ParseSeek can be used to change the current position in the
|
sl@0
|
944 |
MP4 file.
|
sl@0
|
945 |
|
sl@0
|
946 |
If the function returns MP4_NOT_AVAILABLE, the caller needs to call
|
sl@0
|
947 |
MP4ParseWriteData to insert more data before calling again.
|
sl@0
|
948 |
|
sl@0
|
949 |
audiosize is returned even if buffer was too small to contain the data.
|
sl@0
|
950 |
|
sl@0
|
951 |
Note: returnedframes may differ from the correct value when accessing
|
sl@0
|
952 |
the last audio sample.
|
sl@0
|
953 |
|
sl@0
|
954 |
Note: Specify NULL as timestamp2 if not interested in this parameter.
|
sl@0
|
955 |
|
sl@0
|
956 |
@param handle MP4 library handle
|
sl@0
|
957 |
@param buffer Audio frames are returned here
|
sl@0
|
958 |
@param buffersize Size of the user allocated buffer (in bytes)
|
sl@0
|
959 |
@param audiosize Size of the returned audio frames (in bytes)
|
sl@0
|
960 |
@param timestamp Audio frame presentation time in milliseconds from the
|
sl@0
|
961 |
beginning of the audio sequence
|
sl@0
|
962 |
@param returnedframes Number of frames returned, or 0 if not known
|
sl@0
|
963 |
@param timestamp2 Audio frame presentation time in timescale from the
|
sl@0
|
964 |
beginning of the audio sequence
|
sl@0
|
965 |
|
sl@0
|
966 |
@return MP4_OK Success
|
sl@0
|
967 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
968 |
frames can be returned
|
sl@0
|
969 |
MP4_BUFFER_TOO_SMALL Requested frames don't fit into the given buffer
|
sl@0
|
970 |
MP4_ERROR Generic error
|
sl@0
|
971 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
972 |
MP4_NO_FRAME No more frames available
|
sl@0
|
973 |
*/
|
sl@0
|
974 |
extern IMPORT_C MP4Err MP4ParseReadAudioFrames(MP4Handle handle, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *audiosize, mp4_u32 *timestamp, mp4_u32 *returnedframes, mp4_u32 *timestamp2);
|
sl@0
|
975 |
|
sl@0
|
976 |
/**
|
sl@0
|
977 |
This function reads DecoderSpecificInfo data from MP4 metadata and
|
sl@0
|
978 |
returns it to the caller.
|
sl@0
|
979 |
|
sl@0
|
980 |
decspecinfosize is set even if buffer is too small to contain the data.
|
sl@0
|
981 |
The function can be called with buffersize 0 to query the size of
|
sl@0
|
982 |
DecoderSpecificInfo.
|
sl@0
|
983 |
|
sl@0
|
984 |
Note: This function can be used for both MPEG-4 audio and AMR.
|
sl@0
|
985 |
|
sl@0
|
986 |
@param handle MP4 library handle
|
sl@0
|
987 |
@param buffer DecoderSpecificInfo is returned here
|
sl@0
|
988 |
@param buffersize Size of the user allocated buffer (in bytes)
|
sl@0
|
989 |
@param decspecinfosize Size of DecoderSpecificInfo is returned here
|
sl@0
|
990 |
|
sl@0
|
991 |
@return MP4_OK Success
|
sl@0
|
992 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
993 |
frames can be returned
|
sl@0
|
994 |
MP4_BUFFER_TOO_SMALL Requested data doesn't fit into the given buffer
|
sl@0
|
995 |
MP4_ERROR Generic error
|
sl@0
|
996 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
997 |
*/
|
sl@0
|
998 |
extern IMPORT_C MP4Err MP4ParseReadAudioDecoderSpecificInfo(MP4Handle handle, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *decspecinfosize);
|
sl@0
|
999 |
|
sl@0
|
1000 |
/**
|
sl@0
|
1001 |
Return the timestamp of the next video frame. This only works if the
|
sl@0
|
1002 |
input MP4 data is in a file.
|
sl@0
|
1003 |
|
sl@0
|
1004 |
The function can be used to find out which frames have been coded to
|
sl@0
|
1005 |
optimize the input frame selection if video frame rate needs to be
|
sl@0
|
1006 |
modified.
|
sl@0
|
1007 |
|
sl@0
|
1008 |
When this function call returns MP4_END_OF_VIDEO, there are no more video
|
sl@0
|
1009 |
frames left in the MP4 file and the timestamp returned with the previous
|
sl@0
|
1010 |
call was the timestamp of the last video frame.
|
sl@0
|
1011 |
|
sl@0
|
1012 |
Note: User must call MP4ParseSeek() to seek to the correct position
|
sl@0
|
1013 |
after calls of this function. Otherwise the current position is
|
sl@0
|
1014 |
undetermined.
|
sl@0
|
1015 |
|
sl@0
|
1016 |
Note: Specify NULL as timestamp2 if this value is not needed.
|
sl@0
|
1017 |
|
sl@0
|
1018 |
@param handle MP4 library handle
|
sl@0
|
1019 |
@param timestamp Timestamp in milliseconds is returned here
|
sl@0
|
1020 |
@param timestamp2 Timestamp in timescale is returned here
|
sl@0
|
1021 |
|
sl@0
|
1022 |
@return MP4_OK Success
|
sl@0
|
1023 |
MP4_END_OF_VIDEO No more video frames left
|
sl@0
|
1024 |
MP4_ERROR Generic error
|
sl@0
|
1025 |
MP4_NOT_AVAILABLE MP4 library needs more data before the
|
sl@0
|
1026 |
requested information can be returned
|
sl@0
|
1027 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1028 |
*/
|
sl@0
|
1029 |
extern IMPORT_C MP4Err MP4ParseGetNextVideoTimestamp(MP4Handle handle, mp4_u32 *timestamp, mp4_u32 *timestamp2);
|
sl@0
|
1030 |
|
sl@0
|
1031 |
/**
|
sl@0
|
1032 |
This function determines whether the input MP4 stream is streamable,
|
sl@0
|
1033 |
i.e. the media data is arranged in such a manner that playback can be
|
sl@0
|
1034 |
started without downloading the entire stream.
|
sl@0
|
1035 |
|
sl@0
|
1036 |
@param handle MP4 library handle
|
sl@0
|
1037 |
|
sl@0
|
1038 |
@return MP4_OK The file is streamable
|
sl@0
|
1039 |
MP4_NOT_STREAMABLE The file is not streamable
|
sl@0
|
1040 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
1041 |
information can be returned
|
sl@0
|
1042 |
MP4_ERROR Generic error
|
sl@0
|
1043 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1044 |
*/
|
sl@0
|
1045 |
extern IMPORT_C MP4Err MP4ParseIsStreamable(MP4Handle handle);
|
sl@0
|
1046 |
|
sl@0
|
1047 |
/**
|
sl@0
|
1048 |
This function seeks to the position specified by position parameter in
|
sl@0
|
1049 |
the input MP4 file. The function can be called only if the input MP4 data
|
sl@0
|
1050 |
is in a file and the file name has been specified with MP4ParseOpen
|
sl@0
|
1051 |
function call.
|
sl@0
|
1052 |
|
sl@0
|
1053 |
The position is considered to be from the start of the presentation time
|
sl@0
|
1054 |
line in the MP4 file. Thus audio and video positions can't be given
|
sl@0
|
1055 |
separately.
|
sl@0
|
1056 |
|
sl@0
|
1057 |
The function will set current audio and video positions in the following
|
sl@0
|
1058 |
manner:
|
sl@0
|
1059 |
|
sl@0
|
1060 |
If there is only audio in the file, the current position will be set to
|
sl@0
|
1061 |
the audio frame at or just before the given position.
|
sl@0
|
1062 |
|
sl@0
|
1063 |
If there is only video in the file and keyframe is MP4FALSE, the current
|
sl@0
|
1064 |
position will be set to the video frame at or just before the given
|
sl@0
|
1065 |
position. If keyframe is set to MP4TRUE, the current position will be set
|
sl@0
|
1066 |
to the first keyframe at or before current position.
|
sl@0
|
1067 |
|
sl@0
|
1068 |
If there are both audio and video in the file, video is first positioned
|
sl@0
|
1069 |
as explained above and then audio is seeked to the closest position in
|
sl@0
|
1070 |
relation to video.
|
sl@0
|
1071 |
|
sl@0
|
1072 |
@param handle MP4 library handle
|
sl@0
|
1073 |
@param position Position to seek to in milliseconds in the MP4
|
sl@0
|
1074 |
presentation time line
|
sl@0
|
1075 |
@param audioPosition Position of audio after seek (in milliseconds)
|
sl@0
|
1076 |
@param videoPosition Position of video after seek (in milliseconds)
|
sl@0
|
1077 |
@param keyframe If set to MP4TRUE, the 1st video keyframe before given
|
sl@0
|
1078 |
point will be seeked to. If set to MP4FALSE, the first
|
sl@0
|
1079 |
video frame before given point will be seeked to.
|
sl@0
|
1080 |
|
sl@0
|
1081 |
@return MP4_OK Success
|
sl@0
|
1082 |
MP4_ERROR Generic error
|
sl@0
|
1083 |
MP4_CANT_SEEK Can't seek to requested position
|
sl@0
|
1084 |
|
sl@0
|
1085 |
*/
|
sl@0
|
1086 |
extern IMPORT_C MP4Err MP4ParseSeek(MP4Handle handle, mp4_u32 position, mp4_u32 *audioPosition, mp4_u32 *videoPosition, mp4_bool keyframe);
|
sl@0
|
1087 |
|
sl@0
|
1088 |
/**
|
sl@0
|
1089 |
This function determines whether the next frame of type type is
|
sl@0
|
1090 |
available.
|
sl@0
|
1091 |
|
sl@0
|
1092 |
The frame type can be one of the following:
|
sl@0
|
1093 |
|
sl@0
|
1094 |
MP4_TYPE_MPEG4_VIDEO
|
sl@0
|
1095 |
MP4_TYPE_MPEG4_AUDIO
|
sl@0
|
1096 |
MP4_TYPE_H263_PROFILE_0
|
sl@0
|
1097 |
MP4_TYPE_H263_PROFILE_3
|
sl@0
|
1098 |
MP4_TYPE_AMR_NB
|
sl@0
|
1099 |
MP4_TYPE_AMR_WB
|
sl@0
|
1100 |
MP4_TYPE_AVC_PROFILE_BASELINE
|
sl@0
|
1101 |
MP4_TYPE_AVC_PROFILE_MAIN
|
sl@0
|
1102 |
MP4_TYPE_AVC_PROFILE_EXTENDED
|
sl@0
|
1103 |
MP4_TYPE_AVC_PROFILE_HIGH
|
sl@0
|
1104 |
MP4_TYPE_QCELP_13K
|
sl@0
|
1105 |
|
sl@0
|
1106 |
@param handle MP4 library handle
|
sl@0
|
1107 |
@param type Type of the frame
|
sl@0
|
1108 |
|
sl@0
|
1109 |
@return MP4_OK Frame is available
|
sl@0
|
1110 |
MP4_ERROR Generic error
|
sl@0
|
1111 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
1112 |
frames can be returned
|
sl@0
|
1113 |
MP4_NO_REQUESTED_FRAME Frame of requested type is not available
|
sl@0
|
1114 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1115 |
*/
|
sl@0
|
1116 |
extern IMPORT_C MP4Err MP4ParseIsFrameAvailable(MP4Handle handle, mp4_u32 type);
|
sl@0
|
1117 |
|
sl@0
|
1118 |
/**
|
sl@0
|
1119 |
Return the largest position in a file that has been accessed or the latest accessed
|
sl@0
|
1120 |
absolute byte location of the stream.
|
sl@0
|
1121 |
|
sl@0
|
1122 |
Note: The function returns a valid position after one audio or video
|
sl@0
|
1123 |
sample has been read.
|
sl@0
|
1124 |
|
sl@0
|
1125 |
@param handle MP4 library handle
|
sl@0
|
1126 |
@param position Result is returned here
|
sl@0
|
1127 |
|
sl@0
|
1128 |
@return MP4_OK Success
|
sl@0
|
1129 |
*/
|
sl@0
|
1130 |
extern IMPORT_C MP4Err MP4ParseGetLastPosition(MP4Handle handle, mp4_u32 *position);
|
sl@0
|
1131 |
|
sl@0
|
1132 |
/**
|
sl@0
|
1133 |
Return the largest position in a file that has been accessed or the latest accessed
|
sl@0
|
1134 |
absolute byte location of the stream.
|
sl@0
|
1135 |
|
sl@0
|
1136 |
Note: The function returns a valid position after one audio or video
|
sl@0
|
1137 |
sample has been read.
|
sl@0
|
1138 |
|
sl@0
|
1139 |
@param handle MP4 library handle
|
sl@0
|
1140 |
@param position Result is returned here
|
sl@0
|
1141 |
|
sl@0
|
1142 |
@return MP4_OK Success
|
sl@0
|
1143 |
*/
|
sl@0
|
1144 |
extern IMPORT_C MP4Err MP4ParseGetLastPosition64(MP4Handle handle, mp4_u64 *position);
|
sl@0
|
1145 |
|
sl@0
|
1146 |
/**
|
sl@0
|
1147 |
Return the number of video frames.
|
sl@0
|
1148 |
|
sl@0
|
1149 |
@param handle MP4 library handle
|
sl@0
|
1150 |
@param numberOfFrames Result is returned here
|
sl@0
|
1151 |
|
sl@0
|
1152 |
@return MP4_OK Success
|
sl@0
|
1153 |
MP4_ERROR Generic error
|
sl@0
|
1154 |
*/
|
sl@0
|
1155 |
extern IMPORT_C MP4Err MP4ParseGetNumberOfVideoFrames(MP4Handle handle, mp4_u32 *numberOfFrames);
|
sl@0
|
1156 |
|
sl@0
|
1157 |
/**
|
sl@0
|
1158 |
Return video frame size.
|
sl@0
|
1159 |
|
sl@0
|
1160 |
@param handle MP4 library handle
|
sl@0
|
1161 |
@param index Index of video frame
|
sl@0
|
1162 |
@param frameSize Result is returned here
|
sl@0
|
1163 |
|
sl@0
|
1164 |
@return MP4_OK Success
|
sl@0
|
1165 |
MP4_ERROR Generic error
|
sl@0
|
1166 |
*/
|
sl@0
|
1167 |
extern IMPORT_C MP4Err MP4ParseGetVideoFrameSize(MP4Handle handle, mp4_u32 index, mp4_u32 *frameSize);
|
sl@0
|
1168 |
|
sl@0
|
1169 |
/**
|
sl@0
|
1170 |
Return video frame start time.
|
sl@0
|
1171 |
|
sl@0
|
1172 |
@param handle MP4 library handle
|
sl@0
|
1173 |
@param index Index of video frame
|
sl@0
|
1174 |
@param timestamp Result is returned here
|
sl@0
|
1175 |
@param timestampms Result in milliseconds
|
sl@0
|
1176 |
|
sl@0
|
1177 |
@return MP4_OK Success
|
sl@0
|
1178 |
MP4_ERROR Generic error
|
sl@0
|
1179 |
*/
|
sl@0
|
1180 |
extern IMPORT_C MP4Err MP4ParseGetVideoFrameStartTime(MP4Handle handle, mp4_u32 index, mp4_u32 *timestamp, mp4_u32 *timestampms);
|
sl@0
|
1181 |
|
sl@0
|
1182 |
/**
|
sl@0
|
1183 |
Return video frame type.
|
sl@0
|
1184 |
|
sl@0
|
1185 |
@param handle MP4 library handle
|
sl@0
|
1186 |
@param index Index of video frame
|
sl@0
|
1187 |
@param frametype Result is returned here
|
sl@0
|
1188 |
|
sl@0
|
1189 |
@return MP4_OK Success
|
sl@0
|
1190 |
MP4_ERROR Generic error
|
sl@0
|
1191 |
*/
|
sl@0
|
1192 |
extern IMPORT_C MP4Err MP4ParseGetVideoFrameType(MP4Handle handle, mp4_u32 index, mp4_bool *frametype);
|
sl@0
|
1193 |
|
sl@0
|
1194 |
/**
|
sl@0
|
1195 |
Return the video sample entry index of the next video frame to be read.
|
sl@0
|
1196 |
|
sl@0
|
1197 |
The smallest index value is 1.
|
sl@0
|
1198 |
|
sl@0
|
1199 |
@param handle MP4 library handle
|
sl@0
|
1200 |
@param videosampleentryindex Visual SampleEntry index of the next video frame to be read.
|
sl@0
|
1201 |
|
sl@0
|
1202 |
@return MP4_OK Success
|
sl@0
|
1203 |
MP4_ERROR Generic error
|
sl@0
|
1204 |
*/
|
sl@0
|
1205 |
extern IMPORT_C MP4Err MP4ParseGetVideoSampleEntryIndex(MP4Handle handle, mp4_u32 *videosampleentryindex);
|
sl@0
|
1206 |
|
sl@0
|
1207 |
/**
|
sl@0
|
1208 |
Return the audio sample entry index of the next audio frame to be read.
|
sl@0
|
1209 |
|
sl@0
|
1210 |
The smallest index value is 1.
|
sl@0
|
1211 |
|
sl@0
|
1212 |
@param handle MP4 library handle
|
sl@0
|
1213 |
@param audiosampleentryindex Visual SampleEntry index of the next audio frame to be read.
|
sl@0
|
1214 |
|
sl@0
|
1215 |
@return MP4_OK Success
|
sl@0
|
1216 |
MP4_ERROR Generic error
|
sl@0
|
1217 |
*/
|
sl@0
|
1218 |
extern IMPORT_C MP4Err MP4ParseGetAudioSampleEntryIndex(MP4Handle handle, mp4_u32 *audiosampleentryindex);
|
sl@0
|
1219 |
|
sl@0
|
1220 |
/**
|
sl@0
|
1221 |
This function sets the storage mode of QCELP 13K
|
sl@0
|
1222 |
qcelpStorageMode = 0 ...QCELP will be registered using QCELPSampleEntry Box (Default)
|
sl@0
|
1223 |
qcelpStorageMode = 1 ...QCELP will be registered using MP4AudioDescription Box
|
sl@0
|
1224 |
|
sl@0
|
1225 |
Note: This function needs to be called only when QCLEP 13K is used and when it is going to
|
sl@0
|
1226 |
be stored registered using the MP4AudioDescription Box.
|
sl@0
|
1227 |
|
sl@0
|
1228 |
@param handle MP4 library handle
|
sl@0
|
1229 |
@param qcelpStorageMode Decoder configuration registration mode of QCELP 13K Codec
|
sl@0
|
1230 |
|
sl@0
|
1231 |
@return MP4_OK Success
|
sl@0
|
1232 |
MP4_ERROR Generic error
|
sl@0
|
1233 |
*/
|
sl@0
|
1234 |
extern IMPORT_C MP4Err MP4ComposeSetQCELPStorageMode(MP4Handle handle, mp4_u8 qcelpStorageMode);
|
sl@0
|
1235 |
|
sl@0
|
1236 |
/**
|
sl@0
|
1237 |
Return the decoder configuration registration mode of QCELP 13K Codec.
|
sl@0
|
1238 |
|
sl@0
|
1239 |
qcelpStorageMode = 0 QCELP is registered using QCELPSampleEntry Box (Default)
|
sl@0
|
1240 |
qcelpStorageMode = 1 QCELP is registered using MP4AudioDescription Box
|
sl@0
|
1241 |
|
sl@0
|
1242 |
@param handle MP4 library handle
|
sl@0
|
1243 |
@param qcelpStorageMode Decoder configuration registration mode of QCELP 13K Codec
|
sl@0
|
1244 |
|
sl@0
|
1245 |
@return MP4_OK Success
|
sl@0
|
1246 |
MP4_ERROR Generic error
|
sl@0
|
1247 |
*/
|
sl@0
|
1248 |
extern IMPORT_C MP4Err MP4ParseGetQCELPStorageMode(MP4Handle handle, mp4_u8 *qcelpStorageMode);
|
sl@0
|
1249 |
|
sl@0
|
1250 |
/**
|
sl@0
|
1251 |
This function gets the frame infoparameters from star index to number of elements in array from that index,
|
sl@0
|
1252 |
properties obtained are startTime, frameType and frameSize.
|
sl@0
|
1253 |
|
sl@0
|
1254 |
Important Note:--- The number of elements allocated in the array should be equal to the sizeofarray
|
sl@0
|
1255 |
|
sl@0
|
1256 |
|
sl@0
|
1257 |
@param apihandle MP4 library handle
|
sl@0
|
1258 |
@param startindex Index from where to start getting information for the array
|
sl@0
|
1259 |
@param sizeofarray number of elements that exist in the allocated frame array
|
sl@0
|
1260 |
@param aFrameInfoArray Array of Structures of frame parameters
|
sl@0
|
1261 |
|
sl@0
|
1262 |
|
sl@0
|
1263 |
@return MP4_OK Success
|
sl@0
|
1264 |
MP4_ERROR Generic error
|
sl@0
|
1265 |
MP4_NO_OUTPUT_BUFFER Output buffer pointer uninitialized
|
sl@0
|
1266 |
*/
|
sl@0
|
1267 |
extern IMPORT_C MP4Err MP4GetVideoFrameProperties(MP4Handle apihandle,mp4_u32 startindex,mp4_u32 sizeofarray,TFrameInfoParameters* aFrameInfoArray);
|
sl@0
|
1268 |
|
sl@0
|
1269 |
/**
|
sl@0
|
1270 |
This function sets properties of composed video clip.
|
sl@0
|
1271 |
|
sl@0
|
1272 |
Setup details in TVideoClipProperties struct:
|
sl@0
|
1273 |
|
sl@0
|
1274 |
mp4_u32 iH263Level level of H.263
|
sl@0
|
1275 |
|
sl@0
|
1276 |
@param apihandle MP4 library handle
|
sl@0
|
1277 |
@param aVideoClipProperties Setup info struct.
|
sl@0
|
1278 |
|
sl@0
|
1279 |
@return MP4_OK Success
|
sl@0
|
1280 |
MP4_ERROR Generic error
|
sl@0
|
1281 |
*/
|
sl@0
|
1282 |
extern IMPORT_C MP4Err MP4ComposeSetVideoClipProperties(MP4Handle apihandle, const TVideoClipProperties& aVideoClipProperties);
|
sl@0
|
1283 |
|
sl@0
|
1284 |
/**
|
sl@0
|
1285 |
This function gets properties of parsed video clip.
|
sl@0
|
1286 |
|
sl@0
|
1287 |
Returned details in TVideoClipProperties struct:
|
sl@0
|
1288 |
|
sl@0
|
1289 |
mp4_u32 iH263Level level of H.263
|
sl@0
|
1290 |
|
sl@0
|
1291 |
@param apihandle MP4 library handle
|
sl@0
|
1292 |
@param aVideoClipProperties Filled info struct.
|
sl@0
|
1293 |
|
sl@0
|
1294 |
@return MP4_OK Success
|
sl@0
|
1295 |
MP4_ERROR Generic error
|
sl@0
|
1296 |
*/
|
sl@0
|
1297 |
extern IMPORT_C MP4Err MP4ParseGetVideoClipProperties(MP4Handle apihandle, TVideoClipProperties& aVideoClipProperties);
|
sl@0
|
1298 |
|
sl@0
|
1299 |
/**
|
sl@0
|
1300 |
Retrieve an atom of given type from user data atom (UDTA) to the given buffer.
|
sl@0
|
1301 |
|
sl@0
|
1302 |
Note: on return parameters contain following information:
|
sl@0
|
1303 |
udtaLocation Hash of all locations in file that contain UDTA atom.
|
sl@0
|
1304 |
MP4_UDTA_NONE | MP4_UDTA_MOOV | MP4_UDTA_VIDEOTRAK | MP4_UDTA_AUDIOTRAK
|
sl@0
|
1305 |
buffer Buffer containing asked atom.
|
sl@0
|
1306 |
bufferSize Size of atom written in buffer. If buffer is too small for atom variable contains needed size.
|
sl@0
|
1307 |
atomIndex Count of same subatom type in this UDTA. Starts from 0 (zero) index.
|
sl@0
|
1308 |
|
sl@0
|
1309 |
@param handle MP4 library handle
|
sl@0
|
1310 |
@param udtaLocation Location of UDTA atom inside file.
|
sl@0
|
1311 |
@param udtaAtomType Type of atom to be read from UDTA.
|
sl@0
|
1312 |
Hex value of 4 chars representing atom type defined in standard.
|
sl@0
|
1313 |
For example: 0x7469746c //'titl' - title for the media atom
|
sl@0
|
1314 |
0x61757468 //'auth' - author of the media atom
|
sl@0
|
1315 |
0x676e7265 //'gnre' - genre (category and style) of the media atom
|
sl@0
|
1316 |
@param buffer Buffer to write atom to.
|
sl@0
|
1317 |
@param bufferSize Size of given buffer.
|
sl@0
|
1318 |
@param atomIndex Index of atom if UDTA contains multiple subatoms of same asked udtaAtomType.
|
sl@0
|
1319 |
|
sl@0
|
1320 |
@return MP4_OK Success
|
sl@0
|
1321 |
MP4_ERROR Generic error
|
sl@0
|
1322 |
MP4_OUTPUT_BUFFER_TOO_SMALL Buffer to write atom to is too small, required size in buffersize argument.
|
sl@0
|
1323 |
MP4_INVALID_TYPE Asked udtaLocation is invalid.
|
sl@0
|
1324 |
MP4_NOT_AVAILABLE UDTA or wanted subatom is not available in asked location.
|
sl@0
|
1325 |
MP4_CANT_SEEK Can't seek to UDTA atom location.
|
sl@0
|
1326 |
*/
|
sl@0
|
1327 |
extern IMPORT_C MP4Err MP4ParseGetUserDataAtom(MP4Handle handle,
|
sl@0
|
1328 |
mp4_u8& udtaLocation,
|
sl@0
|
1329 |
mp4_u32 udtaAtomType,
|
sl@0
|
1330 |
mp4_u8* buffer,
|
sl@0
|
1331 |
mp4_u32& bufferSize,
|
sl@0
|
1332 |
mp4_u32& atomIndex );
|
sl@0
|
1333 |
|
sl@0
|
1334 |
/**
|
sl@0
|
1335 |
Writes a buffer containing whole atom to inside of user data atom (UDTA) defined in udtaLocation.
|
sl@0
|
1336 |
|
sl@0
|
1337 |
@param apihandle MP4 library handle
|
sl@0
|
1338 |
@param udtaLocation Location of UDTA atom inside file.
|
sl@0
|
1339 |
MP4_UDTA_MOOV | MP4_UDTA_VIDEOTRAK | MP4_UDTA_AUDIOTRAK
|
sl@0
|
1340 |
@param buffer Buffer to write atom from.
|
sl@0
|
1341 |
@param bufferSize Size of buffer.
|
sl@0
|
1342 |
|
sl@0
|
1343 |
@return MP4_OK Success
|
sl@0
|
1344 |
MP4_ERROR Generic error
|
sl@0
|
1345 |
MP4_OUT_OF_MEMORY Out of memory
|
sl@0
|
1346 |
MP4_INVALID_TYPE Asked udtaLocation is invalid.
|
sl@0
|
1347 |
*/
|
sl@0
|
1348 |
extern IMPORT_C MP4Err MP4ComposeSetUserDataAtom(MP4Handle apihandle,
|
sl@0
|
1349 |
mp4_u8& udtaLocation,
|
sl@0
|
1350 |
mp4_u8* buffer,
|
sl@0
|
1351 |
mp4_u32& bufferSize );
|
sl@0
|
1352 |
|
sl@0
|
1353 |
/**
|
sl@0
|
1354 |
Sets internal buffer sizes to 3GPMP4Lib. Usage optional.
|
sl@0
|
1355 |
Must be used after MP4ComposeSetFlags when composing.
|
sl@0
|
1356 |
|
sl@0
|
1357 |
Defaults for composing (with MP4_FLAG_LARGEFILEBUFFER):
|
sl@0
|
1358 |
|
sl@0
|
1359 |
mediaWriteBufferSize: 2048, (2*65536)
|
sl@0
|
1360 |
writeBufferMaxCount: 15
|
sl@0
|
1361 |
|
sl@0
|
1362 |
Default for parsing:
|
sl@0
|
1363 |
readBufferSize: 8k
|
sl@0
|
1364 |
|
sl@0
|
1365 |
@param apihandle MP4 library handle
|
sl@0
|
1366 |
@param mediaWriteBufferSize Size of media data file output buffers (bytes).
|
sl@0
|
1367 |
0 to use default internal value.
|
sl@0
|
1368 |
@param writeBufferMaxCount Max amount of buffers (both media and meta) before file output changes
|
sl@0
|
1369 |
to synchronous (by default file writing is asynchronous operation).
|
sl@0
|
1370 |
0 to use default internal value.
|
sl@0
|
1371 |
Min value 6.
|
sl@0
|
1372 |
@param readBufferSize Size of file read buffer. 0 to use default internal value.
|
sl@0
|
1373 |
|
sl@0
|
1374 |
@return MP4_OK Success
|
sl@0
|
1375 |
MP4_ERROR Generic error
|
sl@0
|
1376 |
MP4_OUT_OF_MEMORY Out of Memory error
|
sl@0
|
1377 |
*/
|
sl@0
|
1378 |
extern IMPORT_C MP4Err MP4SetCustomFileBufferSizes( MP4Handle apihandle,
|
sl@0
|
1379 |
mp4_u32 mediaWriteBufferSize,
|
sl@0
|
1380 |
mp4_u32 writeBufferMaxCount,
|
sl@0
|
1381 |
mp4_u32 readBufferSize );
|
sl@0
|
1382 |
|
sl@0
|
1383 |
/**
|
sl@0
|
1384 |
This function gets the next frame's dependency information from SDTP box.
|
sl@0
|
1385 |
|
sl@0
|
1386 |
Return values of each parameter can be the following:
|
sl@0
|
1387 |
aDependsOn:
|
sl@0
|
1388 |
0: the dependency of this sample is unknown;
|
sl@0
|
1389 |
1: this sample does depend on others (not an I picture);
|
sl@0
|
1390 |
2: this sample does not depend on others (I picture);
|
sl@0
|
1391 |
|
sl@0
|
1392 |
aIsDependedOn:
|
sl@0
|
1393 |
0: the dependency of other samples on this sample is unknown;
|
sl@0
|
1394 |
1: other samples depend on this one (not disposable);
|
sl@0
|
1395 |
2: no other sample depends on this one (disposable);
|
sl@0
|
1396 |
|
sl@0
|
1397 |
aHasRedundancy:
|
sl@0
|
1398 |
0: it is unknown whether there is redundant coding in this sample;
|
sl@0
|
1399 |
1: there is redundant coding in this sample;
|
sl@0
|
1400 |
2: there is no redundant coding in this sample;
|
sl@0
|
1401 |
|
sl@0
|
1402 |
@param apihandle MP4 library handle
|
sl@0
|
1403 |
@param aDependsOn Defines whether current frame is I-frame (2), isn't I-frame (1) or if it only
|
sl@0
|
1404 |
can be found out by using MP4ParseReadVideoFrame()-method (0).
|
sl@0
|
1405 |
@param aIsDependentOn Defined the dependency of other frames on this one
|
sl@0
|
1406 |
@param aHasRedundancy Defined the existence of redundant coding in this frame
|
sl@0
|
1407 |
|
sl@0
|
1408 |
@return MP4_OK Success
|
sl@0
|
1409 |
MP4_ERROR Generic error
|
sl@0
|
1410 |
MP4_NOT_AVAILABLE Metadata not available
|
sl@0
|
1411 |
MP4_INVALID_INPUT_STREAM Error in reading metadata
|
sl@0
|
1412 |
MP4_NO_OUTPUT_BUFFER Output buffer uninitialized
|
sl@0
|
1413 |
*/
|
sl@0
|
1414 |
extern IMPORT_C MP4Err MP4ParseNextVideoFrameDependencies(MP4Handle apihandle, mp4_u8* aDependsOn, mp4_u8* aIsDependentOn, mp4_u8* aHasRedundancy);
|
sl@0
|
1415 |
|
sl@0
|
1416 |
/**
|
sl@0
|
1417 |
This function sets the next frame's dependency information to SDTP box.
|
sl@0
|
1418 |
|
sl@0
|
1419 |
NOTE: This function should be called before MP4ComposeWriteVideoFrame for each frame. Otherwise
|
sl@0
|
1420 |
default values are inserted for the missing frames (0 = unknown).
|
sl@0
|
1421 |
|
sl@0
|
1422 |
Possible values for each parameter are the following:
|
sl@0
|
1423 |
aDependsOn:
|
sl@0
|
1424 |
0: the dependency of this sample is unknown;
|
sl@0
|
1425 |
1: this sample does depend on others (not an I picture);
|
sl@0
|
1426 |
2: this sample does not depend on others (I picture);
|
sl@0
|
1427 |
3: reserved, DO NOT USE
|
sl@0
|
1428 |
|
sl@0
|
1429 |
aIsDependedOn:
|
sl@0
|
1430 |
0: the dependency of other samples on this sample is unknown;
|
sl@0
|
1431 |
1: other samples depend on this one (not disposable);
|
sl@0
|
1432 |
2: no other sample depends on this one (disposable);
|
sl@0
|
1433 |
3: reserved, DO NOT USE
|
sl@0
|
1434 |
|
sl@0
|
1435 |
aHasRedundancy:
|
sl@0
|
1436 |
0: it is unknown whether there is redundant coding in this sample;
|
sl@0
|
1437 |
1: there is redundant coding in this sample;
|
sl@0
|
1438 |
2: there is no redundant coding in this sample;
|
sl@0
|
1439 |
3: reserved, DO NOT USE
|
sl@0
|
1440 |
|
sl@0
|
1441 |
@param apihandle MP4 library handle
|
sl@0
|
1442 |
@param aDependsOn Defines whether current frame is I-frame (2), isn't I-frame (1) or if it only
|
sl@0
|
1443 |
can be found out by using MP4ParseReadVideoFrame()-method (0).
|
sl@0
|
1444 |
@param aIsDependentOn Defines the dependency of other frames on this one
|
sl@0
|
1445 |
@param aHasRedundancy Defines the existence of redundant coding in this frame
|
sl@0
|
1446 |
|
sl@0
|
1447 |
@return MP4_OK Success
|
sl@0
|
1448 |
MP4_ERROR Generic error
|
sl@0
|
1449 |
*/
|
sl@0
|
1450 |
extern IMPORT_C MP4Err MP4ComposeWriteNextVideoFrameDependencies(MP4Handle apihandle, mp4_u8 aDependsOn, mp4_u8 aIsDependentOn, mp4_u8 aHasRedundancy);
|
sl@0
|
1451 |
|
sl@0
|
1452 |
/**
|
sl@0
|
1453 |
This function reads the audio frames asynchronously that are stored in the current
|
sl@0
|
1454 |
audio sample from the MP4 file and returns them to the caller.
|
sl@0
|
1455 |
|
sl@0
|
1456 |
Note: Only one async parse audio or video frame(s) operation can be ongoing at any given time.
|
sl@0
|
1457 |
|
sl@0
|
1458 |
Note: Observer notification only comes if called function returns MP4_OK.
|
sl@0
|
1459 |
If given buffer is too small MP4_BUFFER_TOO_SMALL is returned and buffersize contains needed
|
sl@0
|
1460 |
size for audio frame.
|
sl@0
|
1461 |
|
sl@0
|
1462 |
When feeding in parsed clip as memory buffers if the function returns MP4_NOT_AVAILABLE,
|
sl@0
|
1463 |
the client needs to call MP4ParseWriteData to insert more data before calling this method again.
|
sl@0
|
1464 |
|
sl@0
|
1465 |
@param handle MP4 library handle
|
sl@0
|
1466 |
@param aObserver Observer designed to receive notification of Asynchronous event completion
|
sl@0
|
1467 |
@param buffer Buffer that audio frames are written to.
|
sl@0
|
1468 |
@param buffersize Size of the user allocated buffer (in bytes). In MP4_BUFFER_TOO_SMALL error case contains
|
sl@0
|
1469 |
needed size for memory buffer.
|
sl@0
|
1470 |
|
sl@0
|
1471 |
@return MP4_OK Success
|
sl@0
|
1472 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
1473 |
frames can be returned
|
sl@0
|
1474 |
MP4_BUFFER_TOO_SMALL Requested frames don't fit into the given buffer
|
sl@0
|
1475 |
MP4_ERROR Generic error
|
sl@0
|
1476 |
MP4_FILE_ERROR Async operation is not for buffer mode
|
sl@0
|
1477 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1478 |
MP4_NO_FRAME No more frames available
|
sl@0
|
1479 |
MP4_OUT_OF_MEMORY Out of Memory.
|
sl@0
|
1480 |
*/
|
sl@0
|
1481 |
extern IMPORT_C MP4Err MP4ParseReadAudioFramesAsync(MP4Handle handle, M3GPMP4LibAsyncObserver* aObserver, mp4_u8 *buffer, mp4_u32* buffersize );
|
sl@0
|
1482 |
|
sl@0
|
1483 |
/**
|
sl@0
|
1484 |
This function reads the next video frame from the MP4 file and returns it to the caller.
|
sl@0
|
1485 |
|
sl@0
|
1486 |
Note: Only one async parse audio or video frame(s) operation can be ongoing at any given time.
|
sl@0
|
1487 |
|
sl@0
|
1488 |
Note: Observer notification only comes if called function returns MP4_OK.
|
sl@0
|
1489 |
If given buffer is too small MP4_BUFFER_TOO_SMALL is returned and buffersize contains needed
|
sl@0
|
1490 |
size for video frame.
|
sl@0
|
1491 |
|
sl@0
|
1492 |
When feeding in parsed clip as memory buffers if the function returns MP4_NOT_AVAILABLE,
|
sl@0
|
1493 |
the client needs to call MP4ParseWriteData to insert more data before calling this method again.
|
sl@0
|
1494 |
|
sl@0
|
1495 |
@param handle MP4 library handle
|
sl@0
|
1496 |
@param aObserver Observer designed to receive notification of Asynchronous event completion
|
sl@0
|
1497 |
@param buffer Video frame is returned here
|
sl@0
|
1498 |
@param buffersize Size of the user allocated buffer (in bytes). In MP4_BUFFER_TOO_SMALL error case contains
|
sl@0
|
1499 |
needed size for memory buffer.
|
sl@0
|
1500 |
|
sl@0
|
1501 |
@return MP4_OK Success
|
sl@0
|
1502 |
MP4_NOT_AVAILABLE MP4 library needs more data before the requested
|
sl@0
|
1503 |
frame can be returned
|
sl@0
|
1504 |
MP4_BUFFER_TOO_SMALL Requested frame doesn't fit into the given buffer
|
sl@0
|
1505 |
MP4_NO_FRAME Frame doesn't exist (previous frame was last)
|
sl@0
|
1506 |
MP4_ERROR Generic error
|
sl@0
|
1507 |
MP4_OUT_OF_MEMORY Out of Memory
|
sl@0
|
1508 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1509 |
MP4_FILE_ERROR Async operation is not for buffer mode
|
sl@0
|
1510 |
*/
|
sl@0
|
1511 |
extern IMPORT_C MP4Err MP4ParseReadVideoFrameAsync(MP4Handle handle, M3GPMP4LibAsyncObserver* aObserver, mp4_u8* buffer, mp4_u32* buffersize );
|
sl@0
|
1512 |
|
sl@0
|
1513 |
/**
|
sl@0
|
1514 |
This function sets async temporary file deleting observer. Meta data temporary file removing can be done
|
sl@0
|
1515 |
on background to improve video recording stopping.
|
sl@0
|
1516 |
|
sl@0
|
1517 |
@param handle MP4 library handle
|
sl@0
|
1518 |
@param aObserver Temorary file deleting observer
|
sl@0
|
1519 |
|
sl@0
|
1520 |
@return MP4_OK Success
|
sl@0
|
1521 |
MP4_ERROR Generic error
|
sl@0
|
1522 |
*/
|
sl@0
|
1523 |
|
sl@0
|
1524 |
extern IMPORT_C MP4Err MP4ComposeSetTempFileRemoverObserver(MP4Handle *handle, M3GPMP4LibAsyncTempFileRemoverObserver *aObserver);
|
sl@0
|
1525 |
|
sl@0
|
1526 |
/**
|
sl@0
|
1527 |
This function cancels the outstanding asynchronous read audio/video frame request.
|
sl@0
|
1528 |
|
sl@0
|
1529 |
No callback function will be called.
|
sl@0
|
1530 |
|
sl@0
|
1531 |
Note: As only one asynchronous parse audio or video frame(s) operation can be ongoing at any given time,
|
sl@0
|
1532 |
this function can be used to cancel audio or video read request. If this is called without any outstanding
|
sl@0
|
1533 |
request, nothing happens.
|
sl@0
|
1534 |
|
sl@0
|
1535 |
@param handle MP4 library handle
|
sl@0
|
1536 |
|
sl@0
|
1537 |
@see MP4ParseReadVideoFrameAsync
|
sl@0
|
1538 |
@see MP4ParseReadAudioFramesAsync
|
sl@0
|
1539 |
*/
|
sl@0
|
1540 |
extern IMPORT_C void MP4CancelReadFrame(MP4Handle handle);
|
sl@0
|
1541 |
|
sl@0
|
1542 |
/**
|
sl@0
|
1543 |
Fetches ID32 data location.
|
sl@0
|
1544 |
*
|
sl@0
|
1545 |
* Parameters:
|
sl@0
|
1546 |
*
|
sl@0
|
1547 |
@param handle MP4 library handle
|
sl@0
|
1548 |
@param location Returns ID32 data location
|
sl@0
|
1549 |
|
sl@0
|
1550 |
@return MP4_OK Success
|
sl@0
|
1551 |
MP4_ERROR Generic error
|
sl@0
|
1552 |
MP4_INVALID_INPUT_STREAM MP4 stream is invalid
|
sl@0
|
1553 |
MP4_NOT_AVAILABLE Metadata, META atom or ID32 atom is not available
|
sl@0
|
1554 |
*/
|
sl@0
|
1555 |
extern IMPORT_C MP4Err MP4ParseGetID32Location(MP4Handle apihandle, mp4_u32& location);
|
sl@0
|
1556 |
|
sl@0
|
1557 |
#ifdef __cplusplus
|
sl@0
|
1558 |
}
|
sl@0
|
1559 |
#endif
|
sl@0
|
1560 |
|
sl@0
|
1561 |
|
sl@0
|
1562 |
#endif
|
sl@0
|
1563 |
// End of File
|