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 voidCancelReadFrame()
IMPORT_C TIntComplete()
IMPORT_C TIntGetAudioDecoderSpecificInfo(TDes8 &)
IMPORT_C TIntGetAudioDecoderSpecificInfoSize(TInt &)
IMPORT_C TIntGetAudioFramesSize(TUint &)
IMPORT_C TIntGetAudioProperties(T3GPAudioType &, TUint &, TInt &, TUint &, TUint &)
IMPORT_C TIntGetAudioSampleEntryIndex(TUint &)
IMPORT_C TIntGetContainerProperties(TUint &, TUint &)
IMPORT_C TIntGetFrameAvailability(T3GPFrameType, TBool &)
IMPORT_C TIntGetFrameType(T3GPFrameType &)
IMPORT_C TIntGetH263VideoLevel(TInt &)
IMPORT_C TIntGetNumBufferedBytes(TInt &)
IMPORT_C TIntGetNumberOfVideoFrames(TUint &)
IMPORT_C TIntGetQcelpStorageMode(T3GPQcelpStorageMode &)
IMPORT_C TIntGetStreamable(TBool &)
IMPORT_C TIntGetUserDataAtom(TUint32, T3GPUdtaLocation, TDes8 &, TUint &)
IMPORT_C TIntGetUserDataAtomSize(TUint32, T3GPUdtaLocation, TUint &, TInt &)
IMPORT_C TIntGetVideoDecoderSpecificInfo(TDes8 &)
IMPORT_C TIntGetVideoDecoderSpecificInfoSize(TInt &)
IMPORT_C TIntGetVideoFrameDependencies(T3GPFrameDependencies &)
IMPORT_C TIntGetVideoFrameKeyType(TUint, TBool &)
IMPORT_C TIntGetVideoFrameProperties(TUint, TUint, RArray< T3GPFrameInfoParameters > &)
IMPORT_C TIntGetVideoFrameSize(TUint &)
IMPORT_C TIntGetVideoFrameSize(TUint, TUint &)
IMPORT_C TIntGetVideoFrameStartTime(TUint, TUint &, TUint &)
IMPORT_C TIntGetVideoProperties(T3GPVideoType &, TUint &, TReal &, TUint &, TSize &, TUint &)
IMPORT_C TIntGetVideoSampleEntryIndex(TUint &)
IMPORT_C TIntGetVideoTimestamp(TUint &, TUint &)
IMPORT_C TIntInsertData(const TDesC8 &)
IMPORT_C C3GPParse *NewL()
IMPORT_C C3GPParse *NewL(TInt)
IMPORT_C TIntOpen()
IMPORT_C TIntOpen(const TDesC &)
IMPORT_C TIntOpen(const RFile &)
IMPORT_C TIntOpen(const RFile64 &)
IMPORT_C TIntOpen(const ContentAccess::CData &)
IMPORT_C TIntReadAudioFrames(TDes8 &, TInt &, TUint &, TUint &)
IMPORT_C voidReadAudioFrames(M3GPParseCallback &, TDes8 &)
IMPORT_C TIntReadVideoFrame(TDes8 &, TBool &, TUint &, TUint &)
IMPORT_C voidReadVideoFrame(M3GPParseCallback &, TDes8 &)
IMPORT_C TIntSeek(TUint, TBool, TUint &, TUint &)
Private Member Functions
C3GPParse(TInt)
TInt DoGetAudioProperties()
TInt DoGetStreamProperties()
TInt DoGetVideoProperties()
voidM3GPMP4LibAudioFramesAvailable(MP4Err, mp4_u32, mp4_u32, mp4_u32, mp4_u32)
voidM3GPMP4LibVideoFrameAvailable(MP4Err, mp4_u32, mp4_u32, mp4_bool, mp4_u32)
voidPanic(TInt)
voidReset()
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
MP4HandleiHandler
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(TIntaReadBufferSize = 0)[private]

Parameters

TInt aReadBufferSize = 0

~C3GPParse()

IMPORT_C~C3GPParse()

Destructor. Deletes all objects.

Member Functions Documentation

CancelReadFrame()

IMPORT_C voidCancelReadFrame()

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 TIntComplete()

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 TIntGetAudioDecoderSpecificInfo(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 & aBufferDecoderSpecificInfo is returned here.

GetAudioDecoderSpecificInfoSize(TInt &)

IMPORT_C TIntGetAudioDecoderSpecificInfoSize(TInt &aSize)const

Returns size of audio DecoderSpecificInfo data from 3GP metadata.

Parameters

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

GetAudioFramesSize(TUint &)

IMPORT_C TIntGetAudioFramesSize(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 & aSizeSize of the next audio sample in bytes.

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

IMPORT_C TIntGetAudioProperties(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 & aTypeThe type of audio stream. Refer to T3GPFrameType for supported audio type values.
TUint & aLengthDuration of audio in milliseconds.
TInt & aFramesPerSampleNumber of audio frames in each sample.
TUint & aAvgBitRateAverage bit rate of audio.
TUint & aTimeScaleTimescale of audio track.

GetAudioSampleEntryIndex(TUint &)

IMPORT_C TIntGetAudioSampleEntryIndex(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 & aIndexReturns the Audio Sample Entry index of the next video frame to be read.

GetContainerProperties(TUint &, TUint &)

IMPORT_C TIntGetContainerProperties(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 & aSizeLength of the stream in bytes.
TUint & aAvgBitRateAverage bit rate of the stream in bps.

GetFrameAvailability(T3GPFrameType, TBool &)

IMPORT_C TIntGetFrameAvailability(T3GPFrameTypeaType,
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 aTypeThe type of frame to check for. Refer to T3GPFrameType for supported types.
TBool & aAvailableReturn ETrue if the type of frame specified by aType is available.

GetFrameType(T3GPFrameType &)

IMPORT_C TIntGetFrameType(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 & aTypeType of the next frame. Refer to the definition of T3GPFrameType for all possible values.

GetH263VideoLevel(TInt &)

IMPORT_C TIntGetH263VideoLevel(TInt &aLevel)const

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

Parameters

TInt & aLevelReturns the H263 video level.

GetNumBufferedBytes(TInt &)

IMPORT_C TIntGetNumBufferedBytes(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 & aNumNumber of allocated bytes in the library.

GetNumberOfVideoFrames(TUint &)

IMPORT_C TIntGetNumberOfVideoFrames(TUint &aNum)const

Returns the number of video frames.

Parameters

TUint & aNumNumber of video frames.

GetQcelpStorageMode(T3GPQcelpStorageMode &)

IMPORT_C TIntGetQcelpStorageMode(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 & aModeReturns the QCELP storage mode. See T3GPQcelpStorageMode.

GetStreamable(TBool &)

IMPORT_C TIntGetStreamable(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 & aStreamableReturns ETrue if the file is streamable. Otherwise, returns EFalse.

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

IMPORT_C TIntGetUserDataAtom(TUint32aType,
T3GPUdtaLocationaLocation,
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 aTypeType 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 aLocationSpecifies the location of user information to be retrieved. Refer to T3GPUdtaLocation for supported values.
TDes8 & aBufferThe descriptor to store the requested user data atom.
TUint & aAtomIndexSpecifies 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 TIntGetUserDataAtomSize(TUint32aType,
T3GPUdtaLocationaLocation,
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 aTypeType 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 aLocationSpecifies the location of user information to be retrieved. Refer to T3GPUdtaLocation for supported values.
TUint & aAtomIndexSpecifies 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 & aSizeThis contains the needed size for memory buffer.

GetVideoDecoderSpecificInfo(TDes8 &)

IMPORT_C TIntGetVideoDecoderSpecificInfo(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 & aInfoThe descriptor to store the video decoder information.

GetVideoDecoderSpecificInfoSize(TInt &)

IMPORT_C TIntGetVideoDecoderSpecificInfoSize(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 & aSizeSize of video DecoderSpecificInfo.

GetVideoFrameDependencies(T3GPFrameDependencies &)

IMPORT_C TIntGetVideoFrameDependencies(T3GPFrameDependencies &aDependencies)const

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

Parameters

T3GPFrameDependencies & aDependenciesReturns the next frame's dependency information. See T3GPFrameDependencies.

GetVideoFrameKeyType(TUint, TBool &)

IMPORT_C TIntGetVideoFrameKeyType(TUintaIndex,
TBool &aKeyFrame
)const

Checks if a video frame of with index aIndex exists.

Parameters

TUint aIndexIndex of video frame.
TBool & aKeyFrameReturn ETrue if the video frame is a key frame.

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

IMPORT_C TIntGetVideoFrameProperties(TUintaStartIndex,
TUintaNumberOfFrames,
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 aStartIndexIndex to start getting info for the array.
TUint aNumberOfFramesNumber of frames to retrieve frame info.
RArray< T3GPFrameInfoParameters > & aArrayAn 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 TIntGetVideoFrameSize(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 & aSizeSize of the next video frame in bytes.

GetVideoFrameSize(TUint, TUint &)

IMPORT_C TIntGetVideoFrameSize(TUintaIndex,
TUint &aSize
)const

Returns video frame size.

Parameters

TUint aIndexIndex of video frame.
TUint & aSizeReturn the size of the video frame.

GetVideoFrameStartTime(TUint, TUint &, TUint &)

IMPORT_C TIntGetVideoFrameStartTime(TUintaIndex,
TUint &aTimeStampInMs,
TUint &aTimeStampInTimescale
)const

Returns video frame start time.

Parameters

TUint aIndexIndex of video frame.
TUint & aTimeStampInMsResult in milliseconds.
TUint & aTimeStampInTimescaleResult is returned here.

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

IMPORT_C TIntGetVideoProperties(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 & aTypeThe type of video stream. Refer to T3GPVideoType for supported video type.
TUint & aLengthDuration of video in milliseconds.
TReal & aFrameRateAverage frame rate of video (in Hz).
TUint & aAvgBitRateAverage bit rate of video.
TSize & aSizeWidth and height of video image measured in pixels.
TUint & aTimeScaleTimescale of video track.

GetVideoSampleEntryIndex(TUint &)

IMPORT_C TIntGetVideoSampleEntryIndex(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 & aIndexReturns the Visual Sample Entry index of the next video frame to be read.

GetVideoTimestamp(TUint &, TUint &)

IMPORT_C TIntGetVideoTimestamp(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 & aTimeStampInMsTimestamp in milliseconds is returned here.
TUint & aTimeStampInTimescaleTimestamp in timescale is returned here.

InsertData(const TDesC8 &)

IMPORT_C TIntInsertData(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 & aBufferThe descriptor containing the data to be inserted.

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

voidM3GPMP4LibAudioFramesAvailable(MP4ErraError,
mp4_u32aAudioSize,
mp4_u32aTimeStamp,
mp4_u32aReturnedFrames,
mp4_u32aTimestamp2
)[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)

voidM3GPMP4LibVideoFrameAvailable(MP4ErraError,
mp4_u32aFrameSize,
mp4_u32aTimeStamp,
mp4_boolaKeyFrame,
mp4_u32aTimestamp2
)[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(TIntaReadBufferSize)[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 aReadBufferSizeSize of file read buffer.

Open()

IMPORT_C TIntOpen()

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 TIntOpen(const TDesC &aFilename)

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

Parameters

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

Open(const RFile &)

IMPORT_C TIntOpen(const RFile &aFile)

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

Parameters

const RFile & aFileFile 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 TIntOpen(const RFile64 &aFile)

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

Parameters

const RFile64 & aFileFile 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 TIntOpen(const ContentAccess::CData &aData)

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

Parameters

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

Panic(TInt)

voidPanic(TIntaPanic)[private, static]

Parameters

TInt aPanic

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

IMPORT_C TIntReadAudioFrames(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 & aBufferAudio frames are returned here.
TInt & aReturnedFramesNumber of the returned frames or 0 if not known.
TUint & aTimeStampInMsAudio frame presentation time in milliseconds from the beginning of the audio sequence.
TUint & aTimeStampInTimescaleAudio frame presentation time in timescale from the beginning of the audio sequence.

ReadAudioFrames(M3GPParseCallback &, TDes8 &)

IMPORT_C voidReadAudioFrames(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 & aCallbackReference to class derived from M3GPAsyncObserver designed to receive notification of asynchronous event completion.
TDes8 & aBufferThe descriptor to store the audio frames.

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

IMPORT_C TIntReadVideoFrame(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 & aBufferVideo frame is returned here.
TBool & aKeyFrameReturns ETrue if the current frame is a key frame (intra), otherwise the value is EFalse.
TUint & aTimeStampInMsVideo frame presentation time in milliseconds from the beginning of the video sequence.
TUint & aTimeStampInTimescaleVideo frame presentation time in timescale from the beginning of the video sequence.

ReadVideoFrame(M3GPParseCallback &, TDes8 &)

IMPORT_C voidReadVideoFrame(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 & aCallbackReference to class derived from M3GPAsyncObserver designed to receive notification of asynchronous event completion.
TDes8 & aBufferThe descriptor to store the video frames.

Reset()

voidReset()[private]

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

IMPORT_C TIntSeek(TUintaPosition,
TBoolaKeyFrame,
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 aPositionPosition to seek in milliseconds in the 3GP presentation time line.
TBool aKeyFrameIf 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 & aAudioPositionPosition of audio after seeking (in milliseconds).
TUint & aVideoPositionPosition of video after seeking (in milliseconds).

SymbianOSError(MP4Err)

TInt SymbianOSError(MP4ErraError)const [private]

Parameters

MP4Err aError

UdtaLocation(T3GPUdtaLocation)

mp4_u8 UdtaLocation(T3GPUdtaLocationaLocation)const [private]

Parameters

T3GPUdtaLocation aLocation

WrapperAudioType(TUint)

T3GPAudioType WrapperAudioType(TUintaType)const [private]

Parameters

TUint aType

WrapperVideoType(TUint)

T3GPVideoType WrapperVideoType(TUintaType)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

MP4HandleiHandler[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]