C3GPParse Class Reference

class C3GPParse : public CBase

The Parser provides APIs to parse 3GP, 3G2 and MP4 contents (from a file, a CAF object, or given through memory buffer), containing H.263/MPEG-4/H.264 video and AMR/MPEG-4/QCELP audio.

Inherits from

Public Member Functions
~C3GPParse ()
IMPORT_C void CancelReadFrame ()
IMPORT_C TInt Complete ()
IMPORT_C TInt GetAudioDecoderSpecificInfo ( TDes8 &)
IMPORT_C TInt GetAudioDecoderSpecificInfoSize ( TInt &)
IMPORT_C TInt GetAudioFramesSize ( TUint &)
IMPORT_C TInt GetAudioProperties ( T3GPAudioType &, TUint &, TInt &, TUint &, TUint &)
IMPORT_C TInt GetAudioSampleEntryIndex ( TUint &)
IMPORT_C TInt GetContainerProperties ( TUint &, TUint &)
IMPORT_C TInt GetFrameAvailability ( T3GPFrameType , TBool &)
IMPORT_C TInt GetFrameType ( T3GPFrameType &)
IMPORT_C TInt GetH263VideoLevel ( TInt &)
IMPORT_C TInt GetNumBufferedBytes ( TInt &)
IMPORT_C TInt GetNumberOfVideoFrames ( TUint &)
IMPORT_C TInt GetQcelpStorageMode ( T3GPQcelpStorageMode &)
IMPORT_C TInt GetStreamable ( TBool &)
IMPORT_C TInt GetUserDataAtom ( TUint32 , T3GPUdtaLocation , TDes8 &, TUint &)
IMPORT_C TInt GetUserDataAtomSize ( TUint32 , T3GPUdtaLocation , TUint &, TInt &)
IMPORT_C TInt GetVideoDecoderSpecificInfo ( TDes8 &)
IMPORT_C TInt GetVideoDecoderSpecificInfoSize ( TInt &)
IMPORT_C TInt GetVideoFrameDependencies ( T3GPFrameDependencies &)
IMPORT_C TInt GetVideoFrameKeyType ( TUint , TBool &)
IMPORT_C TInt GetVideoFrameProperties ( TUint , TUint , RArray < T3GPFrameInfoParameters > &)
IMPORT_C TInt GetVideoFrameSize ( TUint &)
IMPORT_C TInt GetVideoFrameSize ( TUint , TUint &)
IMPORT_C TInt GetVideoFrameStartTime ( TUint , TUint &, TUint &)
IMPORT_C TInt GetVideoProperties ( T3GPVideoType &, TUint &, TReal &, TUint &, TSize &, TUint &)
IMPORT_C TInt GetVideoSampleEntryIndex ( TUint &)
IMPORT_C TInt GetVideoTimestamp ( TUint &, TUint &)
IMPORT_C TInt InsertData (const TDesC8 &)
IMPORT_C C3GPParse * NewL ()
IMPORT_C C3GPParse * NewL ( TInt )
IMPORT_C TInt Open ()
IMPORT_C TInt Open (const TDesC &)
IMPORT_C TInt Open (const RFile &)
IMPORT_C TInt Open (const RFile64 &)
IMPORT_C TInt Open (const ContentAccess::CData &)
IMPORT_C TInt ReadAudioFrames ( TDes8 &, TInt &, TUint &, TUint &)
IMPORT_C void ReadAudioFrames ( M3GPParseCallback &, TDes8 &)
IMPORT_C TInt ReadVideoFrame ( TDes8 &, TBool &, TUint &, TUint &)
IMPORT_C void ReadVideoFrame ( M3GPParseCallback &, TDes8 &)
IMPORT_C TInt Seek ( TUint , TBool , TUint &, TUint &)
Private Member Functions
C3GPParse ( TInt )
TInt DoGetAudioProperties ()
TInt DoGetStreamProperties ()
TInt DoGetVideoProperties ()
void M3GPMP4LibAudioFramesAvailable ( MP4Err , mp4_u32 , mp4_u32 , mp4_u32 , mp4_u32 )
void M3GPMP4LibVideoFrameAvailable ( MP4Err , mp4_u32 , mp4_u32 , mp4_bool , mp4_u32 )
void Panic ( TInt )
void Reset ()
TInt SymbianOSError ( MP4Err )
mp4_u8 UdtaLocation ( T3GPUdtaLocation )
T3GPAudioType WrapperAudioType ( TUint )
T3GPVideoType WrapperVideoType ( TUint )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TDes8 * iAsyncReadBuffer
TUint iAudioAvgBitRate
TInt iAudioError
TReal iAudioFramesPerSample
TUint iAudioLength
TUint iAudioMp4Type
TBool iAudioPropertiesSaved
TSize iAudioSize
TUint iAudioTimeScale
T3GPAudioType iAudioType
M3GPParseCallback * iCallback
TBool iDuplicateFileHandleCreated
RFile64 iFile
MP4Handle iHandler
TInt iReadBufferSize
TUint iStreamAvgBitRate
TInt iStreamError
TBool iStreamPropertiesSaved
TUint iStreamSize
TInt iVideoError
TReal iVideoFrameRate
TUint iVideoLength
TUint iVideoMp4Type
TBool iVideoPropertiesSaved
TSize iVideoSize
TUint iVideoTimeScale
T3GPVideoType iVideoType

Constructor & Destructor Documentation

C3GPParse(TInt)

C3GPParse ( TInt aReadBufferSize = 0 ) [private]

Parameters

TInt aReadBufferSize = 0

~C3GPParse()

IMPORT_C ~C3GPParse ( )

Destructor. Deletes all objects.

Member Functions Documentation

CancelReadFrame()

IMPORT_C void CancelReadFrame ( )

This function cancels the outstanding asynchronous read audio/video frame request.

No callback function will be called.

Note: As only one asynchronous parse audio or video frame(s) operation can be ongoing at any given time, this function can be used to cancel audio or video read request.

Complete()

IMPORT_C TInt Complete ( )

This function completes the parsing operation.

If C3GPParse::Complete is called before the parse is initialised, it will be ignored and KErrNone is returned.

The parser can be reused again after this call, following another call to C3GPParse::Open to re-initialise the parser.

DoGetAudioProperties()

TInt DoGetAudioProperties ( ) const [private]

DoGetStreamProperties()

TInt DoGetStreamProperties ( ) const [private]

DoGetVideoProperties()

TInt DoGetVideoProperties ( ) const [private]

GetAudioDecoderSpecificInfo(TDes8 &)

IMPORT_C TInt GetAudioDecoderSpecificInfo ( TDes8 & aBuffer ) const

This function reads DecoderSpecificInfo data from 3GP metadata and returns it to the caller.

Note: AMR DecoderSpecificInfo data structure is returned in runtime in an architecture-specific Endian format, that is, no Endian conversion is necessary for the data.

C3GPParse::GetAudioDecoderSpecificInfoSize

Parameters

TDes8 & aBuffer DecoderSpecificInfo is returned here.

GetAudioDecoderSpecificInfoSize(TInt &)

IMPORT_C TInt GetAudioDecoderSpecificInfoSize ( TInt & aSize ) const

Returns size of audio DecoderSpecificInfo data from 3GP metadata.

Parameters

TInt & aSize Size of DecoderSpecificInfo to be returned (in bytes).

GetAudioFramesSize(TUint &)

IMPORT_C TInt GetAudioFramesSize ( TUint & aSize ) const

This function returns the total size of the audio frames in the immediate audio sample based on the current position of the parser.

This function has no effect on the parser s current position.

Parameters

TUint & aSize Size of the next audio sample in bytes.

GetAudioProperties(T3GPAudioType &, TUint &, TInt &, TUint &, TUint &)

IMPORT_C TInt GetAudioProperties ( T3GPAudioType & aType,
TUint & aLength,
TInt & aFramesPerSample,
TUint & aAvgBitRate,
TUint & aTimeScale
) const

This function returns the parameters describing the audio stream.

If no file or CAF object is supplied during parser initialisation, this should be called after enough data has been inserted into the library so that the 3GP headers containing the information can be read.

Parameters

T3GPAudioType & aType The type of audio stream. Refer to T3GPFrameType for supported audio type values.
TUint & aLength Duration of audio in milliseconds.
TInt & aFramesPerSample Number of audio frames in each sample.
TUint & aAvgBitRate Average bit rate of audio.
TUint & aTimeScale Timescale of audio track.

GetAudioSampleEntryIndex(TUint &)

IMPORT_C TInt GetAudioSampleEntryIndex ( TUint & aIndex ) const

This function gives the audio sample entry index of the next audio frame to be read.

The smallest index value is 1.

Parameters

TUint & aIndex Returns the Audio Sample Entry index of the next video frame to be read.

GetContainerProperties(TUint &, TUint &)

IMPORT_C TInt GetContainerProperties ( TUint & aSize,
TUint & aAvgBitRate
) const

This function returns the parameters that describe the contents of the input file or buffer.

If no file or CAF object is supplied during parser initialisation, this should be called after enough data has been inserted into the library so that the headers containing the information can be read.

Parameters

TUint & aSize Length of the stream in bytes.
TUint & aAvgBitRate Average bit rate of the stream in bps.

GetFrameAvailability(T3GPFrameType, TBool &)

IMPORT_C TInt GetFrameAvailability ( T3GPFrameType aType,
TBool & aAvailable
) const

This function determines whether the next frame of the type aType is available.

This function has no effect on the parser s current position.

Parameters

T3GPFrameType aType The type of frame to check for. Refer to T3GPFrameType for supported types.
TBool & aAvailable Return ETrue if the type of frame specified by aType is available.

GetFrameType(T3GPFrameType &)

IMPORT_C TInt GetFrameType ( T3GPFrameType & aType ) const

This function returns the type of the next audio/video frame in the stream.

This function has no effect on the parser s current position.

Parameters

T3GPFrameType & aType Type of the next frame. Refer to the definition of T3GPFrameType for all possible values.

GetH263VideoLevel(TInt &)

IMPORT_C TInt GetH263VideoLevel ( TInt & aLevel ) const

This function provides the video level of the H263 video stream contained in the 3GP data.

Parameters

TInt & aLevel Returns the H263 video level.

GetNumBufferedBytes(TInt &)

IMPORT_C TInt GetNumBufferedBytes ( TInt & aNum ) const

This function returns the number of bytes that the library instance has in its allocated buffers.

The function is only valid when the parser is initialized without any parameters. Zero is returned when in file mode, that is, the parser has been initialized with a valid filename, file handle or a CAF object.

C3GPParse::InsertData .

Parameters

TInt & aNum Number of allocated bytes in the library.

GetNumberOfVideoFrames(TUint &)

IMPORT_C TInt GetNumberOfVideoFrames ( TUint & aNum ) const

Returns the number of video frames.

Parameters

TUint & aNum Number of video frames.

GetQcelpStorageMode(T3GPQcelpStorageMode &)

IMPORT_C TInt GetQcelpStorageMode ( T3GPQcelpStorageMode & aMode ) const

This function provides the storage mode of 13K QCELP in 3G2 file.

In 3G2 files, QCELP can be registered to be stored in two ways: using the QCELP Sample Entry ('sqcp') Box or using the MPEG4 Audio Sample Description ('esds') Box.

Parameters

T3GPQcelpStorageMode & aMode Returns the QCELP storage mode. See T3GPQcelpStorageMode.

GetStreamable(TBool &)

IMPORT_C TInt GetStreamable ( TBool & aStreamable ) const

This function determines whether the input 3GP stream is streamable, that is, whether the media data is arranged in such a manner that playback can be started without downloading the entire stream.

Parameters

TBool & aStreamable Returns ETrue if the file is streamable. Otherwise, returns EFalse.

GetUserDataAtom(TUint32, T3GPUdtaLocation, TDes8 &, TUint &)

IMPORT_C TInt GetUserDataAtom ( TUint32 aType,
T3GPUdtaLocation aLocation,
TDes8 & aBuffer,
TUint & aAtomIndex
) const

Retrieves an atom of given type from user data atom (UDTA) to the given buffer.

The buffer returned stores an atom of structure that conforms to the definition of a "full box" as specified in ISO/IEC 14496-12:2003: "Information technology Coding of audio-visual objects Part 12: ISO base media file format."

For more information on user data atoms, see Section 8 Asset Information of "3GPP TS 26.244 version 6.1.0 3GP file format (Rel 6)."

panic
C3GPParse KErrArgument if the location of user information is not in the range of T3GPUdtaLocation

Parameters

TUint32 aType Type of atom to be read from UDTA. Hex value of 4 chars representing atom type defined in standard. For example, 0x7469746c is 'titl', title for the media atom.
T3GPUdtaLocation aLocation Specifies the location of user information to be retrieved. Refer to T3GPUdtaLocation for supported values.
TDes8 & aBuffer The descriptor to store the requested user data atom.
TUint & aAtomIndex Specifies the index of atom if UDTA contains multiple sub-atoms of the same aUdtaAtomType to retrieve when supplied as input parameter. Returns the highest index of the matching sub-atom found in the specified location as output parameter. Only matching sub-atoms are counted when calculating the highest index.

GetUserDataAtomSize(TUint32, T3GPUdtaLocation, TUint &, TInt &)

IMPORT_C TInt GetUserDataAtomSize ( TUint32 aType,
T3GPUdtaLocation aLocation,
TUint & aAtomIndex,
TInt & aSize
) const

Returns the needed size for memory buffer to store an atom of given type from user data atom (UDTA).

panic
C3GPParse KErrArgument if the location of user information is not in the range of T3GPUdtaLocation

Parameters

TUint32 aType Type of atom to be read from UDTA. Hex value of 4 chars representing atom type defined in standard. For example, 0x7469746c is 'titl', title for the media atom.
T3GPUdtaLocation aLocation Specifies the location of user information to be retrieved. Refer to T3GPUdtaLocation for supported values.
TUint & aAtomIndex Specifies the index of atom if UDTA contains multiple sub-atoms of the same aUdtaAtomType to retrieve when supplied as input parameter. Returns the highest index of the matching sub-atom found in the specified location as output parameter.
TInt & aSize This contains the needed size for memory buffer.

GetVideoDecoderSpecificInfo(TDes8 &)

IMPORT_C TInt GetVideoDecoderSpecificInfo ( TDes8 & aInfo ) const

This function reads DecoderSpecificInfo data from 3GP metadata and returns it to the caller. For files with MPEG-4 video this data is read from the esds atom. For files with AVC video this data is read from the avcC atom.

Note: Only MPEG-4 video and H.264/AVC video streams contain DecoderSpecificInfo.

C3GPParse::GetVideoDecoderSpecificInfoSize

Parameters

TDes8 & aInfo The descriptor to store the video decoder information.

GetVideoDecoderSpecificInfoSize(TInt &)

IMPORT_C TInt GetVideoDecoderSpecificInfoSize ( TInt & aSize ) const

Return size of video DecoderSpecificInfo. For files with MPEG-4 video this data is read from the esds atom. For files with AVC video this data is read from the avcC atom.

Note: Only MPEG-4 video and H.264/AVC video streams contain DecoderSpecificInfo.

Parameters

TInt & aSize Size of video DecoderSpecificInfo.

GetVideoFrameDependencies(T3GPFrameDependencies &)

IMPORT_C TInt GetVideoFrameDependencies ( T3GPFrameDependencies & aDependencies ) const

This function gets the next frame's dependency information from SDTP box.

Parameters

T3GPFrameDependencies & aDependencies Returns the next frame's dependency information. See T3GPFrameDependencies.

GetVideoFrameKeyType(TUint, TBool &)

IMPORT_C TInt GetVideoFrameKeyType ( TUint aIndex,
TBool & aKeyFrame
) const

Checks if a video frame of with index aIndex exists.

Parameters

TUint aIndex Index of video frame.
TBool & aKeyFrame Return ETrue if the video frame is a key frame.

GetVideoFrameProperties(TUint, TUint, RArray< T3GPFrameInfoParameters > &)

IMPORT_C TInt GetVideoFrameProperties ( TUint aStartIndex,
TUint aNumberOfFrames,
RArray < T3GPFrameInfoParameters > & aArray
) const

This function gets frame properties, from aStartIndex for a count of aNumberOfFrames frames.

Properties obtained are start time, frame type, and frame size, stored in the T3GPFrameInfoParameters struct.

Parameters

TUint aStartIndex Index to start getting info for the array.
TUint aNumberOfFrames Number of frames to retrieve frame info.
RArray < T3GPFrameInfoParameters > & aArray An array of T3GPFrameInfoParameters struct to store video frame properties. The input array will be flushed of all existing elements before use.

GetVideoFrameSize(TUint &)

IMPORT_C TInt GetVideoFrameSize ( TUint & aSize ) const

This function returns the size of the immediate next video frame based on the current position of the parser.

Calling this function does not change the current position of the parser.

Parameters

TUint & aSize Size of the next video frame in bytes.

GetVideoFrameSize(TUint, TUint &)

IMPORT_C TInt GetVideoFrameSize ( TUint aIndex,
TUint & aSize
) const

Returns video frame size.

Parameters

TUint aIndex Index of video frame.
TUint & aSize Return the size of the video frame.

GetVideoFrameStartTime(TUint, TUint &, TUint &)

IMPORT_C TInt GetVideoFrameStartTime ( TUint aIndex,
TUint & aTimeStampInMs,
TUint & aTimeStampInTimescale
) const

Returns video frame start time.

Parameters

TUint aIndex Index of video frame.
TUint & aTimeStampInMs Result in milliseconds.
TUint & aTimeStampInTimescale Result is returned here.

GetVideoProperties(T3GPVideoType &, TUint &, TReal &, TUint &, TSize &, TUint &)

IMPORT_C TInt GetVideoProperties ( T3GPVideoType & aType,
TUint & aLength,
TReal & aFrameRate,
TUint & aAvgBitRate,
TSize & aSize,
TUint & aTimeScale
) const

This function returns the parameters describing the video stream.

If no file or CAF object is supplied during parser initialisation, this should be called after enough data has been inserted into the library buffers so that the 3GP headers containing the information can be read.

The aFrameRate parameter refers to the frame rate of the original video material.

Parameters

T3GPVideoType & aType The type of video stream. Refer to T3GPVideoType for supported video type.
TUint & aLength Duration of video in milliseconds.
TReal & aFrameRate Average frame rate of video (in Hz).
TUint & aAvgBitRate Average bit rate of video.
TSize & aSize Width and height of video image measured in pixels.
TUint & aTimeScale Timescale of video track.

GetVideoSampleEntryIndex(TUint &)

IMPORT_C TInt GetVideoSampleEntryIndex ( TUint & aIndex ) const

This function gives the video sample entry index of the next video frame to be read.

The smallest index value is 1.

Parameters

TUint & aIndex Returns the Visual Sample Entry index of the next video frame to be read.

GetVideoTimestamp(TUint &, TUint &)

IMPORT_C TInt GetVideoTimestamp ( TUint & aTimeStampInMs,
TUint & aTimeStampInTimescale
) const

Returns the timestamp of the next video frame. The current position of the video stream will be moved forward.

The function can be used to find out which frames have been coded to optimize the input frame selection if video frame rate needs to be modified.

When this function call returns KErrEof, there are no more video frames left in the 3GP file and the timestamp returned with the previous call was the timestamp of the last video frame.

Note: C3GPParse::Seek can be used to change the current position in the 3GP file.

Parameters

TUint & aTimeStampInMs Timestamp in milliseconds is returned here.
TUint & aTimeStampInTimescale Timestamp in timescale is returned here.

InsertData(const TDesC8 &)

IMPORT_C TInt InsertData ( const TDesC8 & aBuffer )

This function inserts MP4/3GP/3G2 data into the parser.

It is only necessary to call this function if no parameter has been supplied when C3GPParse::Open is called. Several functions can return KErr3gpLibMoreDataRequired if the library does not have enough data to return the information that the caller requests. In this case, more data needs to be inserted to the library before calling those functions again.

This function makes a copy of the data inserted into the library so the caller can use the input buffer for other purposes. If the function returns KErrNoMemory, the buffer contents have not been copied into the library and the caller needs to reduce the buffer content before calling again.

If an empty string is supplied for the argument aBuffer, it indicates that there is be no more data to feed through this function. Such a function call must be done to indicate that all 3GP/MP4/3G2 data has been written to the library's internal memory.

Parameters

const TDesC8 & aBuffer The descriptor containing the data to be inserted.

M3GPMP4LibAudioFramesAvailable(MP4Err, mp4_u32, mp4_u32, mp4_u32, mp4_u32)

void M3GPMP4LibAudioFramesAvailable ( MP4Err aError,
mp4_u32 aAudioSize,
mp4_u32 aTimeStamp,
mp4_u32 aReturnedFrames,
mp4_u32 aTimestamp2
) [private]

Parameters

MP4Err aError
mp4_u32 aAudioSize
mp4_u32 aTimeStamp
mp4_u32 aReturnedFrames
mp4_u32 aTimestamp2

M3GPMP4LibVideoFrameAvailable(MP4Err, mp4_u32, mp4_u32, mp4_bool, mp4_u32)

void M3GPMP4LibVideoFrameAvailable ( MP4Err aError,
mp4_u32 aFrameSize,
mp4_u32 aTimeStamp,
mp4_bool aKeyFrame,
mp4_u32 aTimestamp2
) [private]

Parameters

MP4Err aError
mp4_u32 aFrameSize
mp4_u32 aTimeStamp
mp4_bool aKeyFrame
mp4_u32 aTimestamp2

NewL()

IMPORT_C C3GPParse * NewL ( ) [static]

Creates an instance of a 3GP Parser for reading 3GP/3G2/MP4 data using default buffer size.

The default value for read buffer size is 8k.

leave
KErrNoMemory Out of memory.

NewL(TInt)

IMPORT_C C3GPParse * NewL ( TInt aReadBufferSize ) [static]

Creates an instance of a 3GP Parser for reading 3GP/3G2/MP4 data, and sets the internal file read buffer size.

leave
KErrNoMemory Out of memory.
leave
KErrGeneral General error.
panic
C3GPParse KErrArgument if size of file read buffer is not greater than 0.

Parameters

TInt aReadBufferSize Size of file read buffer.

Open()

IMPORT_C TInt Open ( )

This function initialises the 3GP Parser for reading 3GP/3G2/MP4 data from a buffer and expects data to be inserted through subsequent calls to C3GPParse::InsertData .

C3GPParse::InsertData

Open(const TDesC &)

IMPORT_C TInt Open ( const TDesC & aFilename )

This function initialises the 3GP Parser for reading 3GP/3G2/MP4 data from a file.

Parameters

const TDesC & aFilename A full path name of the file containing the data.

Open(const RFile &)

IMPORT_C TInt Open ( const RFile & aFile )

This function initialises the 3GP Parser for reading 3GP/3G2/MP4 data from a file.

Parameters

const RFile & aFile File handle of the file containing the data. It is expected to be a valid file handle, opened and will be closed outside of the library.

Open(const RFile64 &)

IMPORT_C TInt Open ( const RFile64 & aFile )

This function initialises the 3GP Parser for reading 3GP/3G2/MP4 data from a file.

Parameters

const RFile64 & aFile File handle of the file containing the data. It is expected to be a valid file handle, opened and will be closed outside of the library.

Open(const ContentAccess::CData &)

IMPORT_C TInt Open ( const ContentAccess::CData & aData )

This function initialises the 3GP Parser for reading 3GP/3G2/MP4 data from a CAF object.

Parameters

const ContentAccess::CData & aData A CData object pointing to a CAF object. It is expected to be opened and will be closed outside of the library.

Panic(TInt)

void Panic ( TInt aPanic ) [private, static]

Parameters

TInt aPanic

ReadAudioFrames(TDes8 &, TInt &, TUint &, TUint &)

IMPORT_C TInt ReadAudioFrames ( TDes8 & aBuffer,
TInt & aReturnedFrames,
TUint & aTimeStampInMs,
TUint & aTimeStampInTimescale
) const

This function reads the audio frames that are stored in the current audio sample from the 3GP file/stream and returns them to the caller. The current position of audio stream will be moved forward.

Note: The next frame depends on the position in the input 3GP file. C3GPParse::Seek can be used to change the current position in the 3GP file.

If the function returns KErr3gpLibMoreDataRequired, the caller needs to call C3GPParse::InsertData to insert more data before calling the function again.

Note: aReturnedFrames may differ from the correct value when accessing the last audio sample.

Note: Since there are separate cursors for storing current positions for video and audio streams, calling this function does not change current position of the parser for video stream.

Parameters

TDes8 & aBuffer Audio frames are returned here.
TInt & aReturnedFrames Number of the returned frames or 0 if not known.
TUint & aTimeStampInMs Audio frame presentation time in milliseconds from the beginning of the audio sequence.
TUint & aTimeStampInTimescale Audio frame presentation time in timescale from the beginning of the audio sequence.

ReadAudioFrames(M3GPParseCallback &, TDes8 &)

IMPORT_C void ReadAudioFrames ( M3GPParseCallback & aCallback,
TDes8 & aBuffer
)

This function reads the audio frames that are stored in the current audio sample from the input file and returns them to the caller asynchronously. The current position of audio stream will be moved forward.

This function is not supported when the parser is in buffer mode.

C3GPParse::CancelReadFrame can be used to cancel an outstanding asynchronous frame read request.

Note: Only one asynchronous parse audio or video frame(s) operation can be ongoing at any given time.

Upon completion, successfully or otherwise, the callback function M3GPParseCallback::AudioFramesAvailable is called.

Parameters

M3GPParseCallback & aCallback Reference to class derived from M3GPAsyncObserver designed to receive notification of asynchronous event completion.
TDes8 & aBuffer The descriptor to store the audio frames.

ReadVideoFrame(TDes8 &, TBool &, TUint &, TUint &)

IMPORT_C TInt ReadVideoFrame ( TDes8 & aBuffer,
TBool & aKeyFrame,
TUint & aTimeStampInMs,
TUint & aTimeStampInTimescale
) const

This function reads the next video frame from the 3GP file/stream and returns it to the caller. The current position of video stream will be moved forward.

The next frame depends on the position in the input 3GP file. C3GPParse::Seek can be used to change the current position in the 3GP file.

If the function returns KErr3gpLibMoreDataRequired, the caller needs to call C3GPParse::InsertData to insert more data before calling the function again.

Since there are separate cursors for storing current positions of video and audio streams, calling this function does not affect the position of the next audio stream.

Parameters

TDes8 & aBuffer Video frame is returned here.
TBool & aKeyFrame Returns ETrue if the current frame is a key frame (intra), otherwise the value is EFalse.
TUint & aTimeStampInMs Video frame presentation time in milliseconds from the beginning of the video sequence.
TUint & aTimeStampInTimescale Video frame presentation time in timescale from the beginning of the video sequence.

ReadVideoFrame(M3GPParseCallback &, TDes8 &)

IMPORT_C void ReadVideoFrame ( M3GPParseCallback & aCallback,
TDes8 & aBuffer
)

This function reads the current video frame from an input file and returns it to the caller asynchronously. The current position of video stream will be moved forward.

This function is not supported when the parser is in buffer mode.

C3GPParse::CancelReadFrame can be used to cancel an outstanding asynchronous frame read request.

Note: Only one asynchronous parse audio or video frame(s) operation can be ongoing at any given time.

Upon completion, successfully or otherwise, the callback function M3GPParseCallback::VideoFrameAvailable is called.

Parameters

M3GPParseCallback & aCallback Reference to class derived from M3GPAsyncObserver designed to receive notification of asynchronous event completion.
TDes8 & aBuffer The descriptor to store the video frames.

Reset()

void Reset ( ) [private]

Seek(TUint, TBool, TUint &, TUint &)

IMPORT_C TInt Seek ( TUint aPosition,
TBool aKeyFrame,
TUint & aAudioPosition,
TUint & aVideoPosition
) const

This function seeks the position specified by the aPosition parameter in the input 3GP file/stream.

The position is considered to start from the beginning of the presentation time line in the 3GP file. Thus audio and video positions cannot be given separately.

The function will set the current audio and video positions in the following manner:

If there is only audio data in the file, the current position is set to the audio frame at or just before the given position.

If there is only video in the file and the key frame is EFalse, the current position is set to the video frame at or just before the given position. If the key frame is set to ETrue, the current position is set to the first key frame at or before the current position.

If there are both audio and video in the file, video is first positioned as explained above and then audio is sought to the closest position in relation to video.

If the position to seek is greater than the duration of video or audio, the video or audio position is set to the position of the last video or audio frame as explained above.

If the function returns KErr3gpLibMoreDataRequired, the caller needs to call C3GPParse::InsertData to insert more data before calling the function again.

Parameters

TUint aPosition Position to seek in milliseconds in the 3GP presentation time line.
TBool aKeyFrame If set to ETrue, the first video key frame before a given point is sought. If set to EFalse, the first video frame before a given point is sought.
TUint & aAudioPosition Position of audio after seeking (in milliseconds).
TUint & aVideoPosition Position of video after seeking (in milliseconds).

SymbianOSError(MP4Err)

TInt SymbianOSError ( MP4Err aError ) const [private]

Parameters

MP4Err aError

UdtaLocation(T3GPUdtaLocation)

mp4_u8 UdtaLocation ( T3GPUdtaLocation aLocation ) const [private]

Parameters

T3GPUdtaLocation aLocation

WrapperAudioType(TUint)

T3GPAudioType WrapperAudioType ( TUint aType ) const [private]

Parameters

TUint aType

WrapperVideoType(TUint)

T3GPVideoType WrapperVideoType ( TUint aType ) const [private]

Parameters

TUint aType

Member Data Documentation

TDes8 * iAsyncReadBuffer

TDes8 * iAsyncReadBuffer [private]

TUint iAudioAvgBitRate

TUint iAudioAvgBitRate [private]

TInt iAudioError

TInt iAudioError [private]

TReal iAudioFramesPerSample

TReal iAudioFramesPerSample [private]

TUint iAudioLength

TUint iAudioLength [private]

TUint iAudioMp4Type

TUint iAudioMp4Type [private]

TBool iAudioPropertiesSaved

TBool iAudioPropertiesSaved [private]

TSize iAudioSize

TSize iAudioSize [private]

TUint iAudioTimeScale

TUint iAudioTimeScale [private]

T3GPAudioType iAudioType

T3GPAudioType iAudioType [private]

M3GPParseCallback * iCallback

M3GPParseCallback * iCallback [private]

TBool iDuplicateFileHandleCreated

TBool iDuplicateFileHandleCreated [private]

RFile64 iFile

RFile64 iFile [private]

MP4Handle iHandler

MP4Handle iHandler [private]

TInt iReadBufferSize

TInt iReadBufferSize [private]

TUint iStreamAvgBitRate

TUint iStreamAvgBitRate [private]

TInt iStreamError

TInt iStreamError [private]

TBool iStreamPropertiesSaved

TBool iStreamPropertiesSaved [private]

TUint iStreamSize

TUint iStreamSize [private]

TInt iVideoError

TInt iVideoError [private]

TReal iVideoFrameRate

TReal iVideoFrameRate [private]

TUint iVideoLength

TUint iVideoLength [private]

TUint iVideoMp4Type

TUint iVideoMp4Type [private]

TBool iVideoPropertiesSaved

TBool iVideoPropertiesSaved [private]

TSize iVideoSize

TSize iVideoSize [private]

TUint iVideoTimeScale

TUint iVideoTimeScale [private]

T3GPVideoType iVideoType

T3GPVideoType iVideoType [private]