sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef C3GPLIBRARY_H sl@0: #define C3GPLIBRARY_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include <3gplibrary/mp4lib.h> sl@0: sl@0: /** sl@0: Error code for C3GPParse API sl@0: sl@0: 3GP Parser requires more data before the requested information can be retrieved sl@0: */ sl@0: const TInt KErr3gpLibMoreDataRequired = (-12300); sl@0: sl@0: class M3GPParseCallback; sl@0: sl@0: /** sl@0: File format to use when composing a file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPFileFormatType sl@0: { sl@0: /** 3GP file format. */ sl@0: E3GP3GP, sl@0: /** MPEG-4 file format. */ sl@0: E3GPMP4, sl@0: /** 3GPP2 file format. */ sl@0: E3GP3G2 sl@0: }; sl@0: sl@0: /** sl@0: Optional flags to be used when composing a file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPComposeFlag sl@0: { sl@0: /** Default value. No special setup. */ sl@0: E3GPNoFlag = 0x0000, sl@0: /** Metadata is placed at end of file. */ sl@0: E3GPMetaDataLast = 0x0001, sl@0: /** Collect metadata in files instead of storing it in memory. */ sl@0: E3GPLongClip = 0x0002, sl@0: }; sl@0: sl@0: /** sl@0: Type of stream contained in the file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPFrameType sl@0: { sl@0: /** Frame contains audio data. */ sl@0: E3GPAudio, sl@0: /** Frame contains video data. */ sl@0: E3GPVideo sl@0: }; sl@0: sl@0: /** sl@0: Type of video stream contained in the file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPVideoType sl@0: { sl@0: /** No Video */ sl@0: E3GPNoVideo, sl@0: /** MPEG-4 video (MPEG-4 Part 2) - Simple and Advance Simple Profiles */ sl@0: E3GPMpeg4Video, sl@0: /** H263 Profile 0 */ sl@0: E3GPH263Profile0, sl@0: /** H263 Profile 3 */ sl@0: E3GPH263Profile3, sl@0: /** AVC (also known as H.264) Baseline Profile */ sl@0: E3GPAvcProfileBaseline, sl@0: /** AVC (also known as H.264) Main Profile */ sl@0: E3GPAvcProfileMain, sl@0: /** AVC (also known as H.264) Extended Profile */ sl@0: E3GPAvcProfileExtended, sl@0: /** AVC (also known as H.264) High Profile */ sl@0: E3GPAvcProfileHigh sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Type of audio stream contained in the file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPAudioType sl@0: { sl@0: /** No audio */ sl@0: E3GPNoAudio, sl@0: /** MPEG-4 audio (MPEG-4 Part 3) */ sl@0: E3GPMpeg4Audio, sl@0: /** AMR NB */ sl@0: E3GPAmrNB, sl@0: /** AMR WB */ sl@0: E3GPAmrWB, sl@0: /** QCELP 13K */ sl@0: E3GPQcelp13K sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Location of the user data in the file. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPUdtaLocation sl@0: { sl@0: /** User data resides within the Movie Box. */ sl@0: E3GPUdtaMoov, sl@0: /** User data resides within the Track Box for video. */ sl@0: E3GPUdtaVideoTrak, sl@0: /** User data resides within the Track Box for audio. */ sl@0: E3GPUdtaAudioTrak sl@0: }; sl@0: sl@0: /** sl@0: Storage method of QCELP audio stream. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPQcelpStorageMode sl@0: { sl@0: /** QCELP Sample Entry ('sqcp') box is used for the storage of QCELP media data. */ sl@0: E3GPQcelpSampleEntryBox, sl@0: /** MP4 Audio Sample Entry ('esds') box is used for the storage of QCELP media data. */ sl@0: E3GPMP4AudioDescriptionBox sl@0: }; sl@0: sl@0: /** sl@0: Define the dependency information between video frames. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPVideoFrameDependency sl@0: { sl@0: /** The dependency of this sample is unknown or the dependency of other sl@0: samples on this sample is unknown. */ sl@0: E3GPDependencyUnknown = 0, sl@0: /** This sample does depend on others or other samples depend on this sample. */ sl@0: E3GPDependencyExists, sl@0: /** This sample does not depend on others or no other sample depends on this sample. */ sl@0: E3GPDependencyNone, sl@0: }; sl@0: sl@0: /** sl@0: Define the existence of redundant coding in a frame. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum T3GPVideoFrameRedundancy sl@0: { sl@0: /** It is unknown whether there is redundant coding in this sample. */ sl@0: E3GPRedundancyUnknown = 0, sl@0: /** There is redundant coding in this sample. */ sl@0: E3GPRedundancyExists, sl@0: /** There is no redundant coding in this sample. */ sl@0: E3GPRedundancyNone, sl@0: }; sl@0: sl@0: /** sl@0: Structure containing a frame's dependency information. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_STRUCT(T3GPFrameDependencies) sl@0: { sl@0: /** Defines the current frame’s dependency. It can be defined as an I-frame sl@0: (E3GPDependencyNone), not an I-frame (E3GPDependencyExists), or dependency sl@0: unknown (E3GPDependencyUnknown). See T3GPVideoFrameDependency. sl@0: */ sl@0: T3GPVideoFrameDependency iDependsOn; sl@0: /** Defines the dependency of other frames on this frame. It can be defined as a disposable sl@0: frame (E3GPDependencyNone), non-disposable (E3GPDependencyExists), or dependency unknown sl@0: (E3GPDependencyUnknown). See T3GPVideoFrameDependency. sl@0: */ sl@0: T3GPVideoFrameDependency iIsDependedOn; sl@0: /** Defines the existence of redundant coding in this frame. See T3GPVideoFrameRedundancy. */ sl@0: T3GPVideoFrameRedundancy iHasRedundancy; sl@0: }; sl@0: sl@0: /** sl@0: Structure containing video frame properties. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_STRUCT(T3GPFrameInfoParameters) sl@0: { sl@0: /** Frame size. */ sl@0: TUint32 iSize; sl@0: /** Frame start time. */ sl@0: TUint32 iStartTime; sl@0: /** ETrue if frame is an intra or random access point. */ sl@0: TBool iIsRandomAccessPoint; sl@0: }; sl@0: sl@0: /** sl@0: This class should not be used directly. It stores common properties amongst all supported sl@0: types of video data. sl@0: sl@0: Note: iTimescale should be chosen so that the duration of each sample is an integer. It should also sl@0: be chosen so that the duration of the presentation fits into 32 bits. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPVideoPropertiesBase) sl@0: { sl@0: protected: sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: T3GPVideoPropertiesBase(T3GPVideoType aType, TUint aTimescale, const TSize& aSize); sl@0: public: sl@0: /** Type of video stream contained in the file. */ sl@0: T3GPVideoType iType; sl@0: /** Timescale of the video data. This is the number of time units that pass in one second. */ sl@0: TUint iTimescale; sl@0: /** Video width and height in pixels */ sl@0: TSize iSize; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and MPEG-4 video specific properties of video data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPVideoPropertiesMpeg4Video) : public T3GPVideoPropertiesBase sl@0: { sl@0: public: sl@0: IMPORT_C T3GPVideoPropertiesMpeg4Video(TUint aTimescale, const TSize& aSize, TUint aMaxBitRate, TUint aAvgBitRate, const TDesC8& aDecoderSpecificInfo); sl@0: public: sl@0: /** Maximum video bit rate */ sl@0: TUint iMaxBitRate; sl@0: /** Average video bit rate */ sl@0: TUint iAvgBitRate; sl@0: /** MPEG-4 video decoder specific info data stored in an ESDS atom */ sl@0: const TDesC8& iDecoderSpecificInfo; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and H.263 specific properties of video data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPVideoPropertiesH263) : public T3GPVideoPropertiesBase sl@0: { sl@0: public: sl@0: enum TProfile { EProfile0, EProfile3 }; sl@0: sl@0: public: sl@0: IMPORT_C T3GPVideoPropertiesH263(TUint aTimescale, const TSize& aSize, TInt aVideoLevel, TProfile aProfile); sl@0: public: sl@0: /** Indicates the H263 video level. */ sl@0: TInt iVideoLevel; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and AVC-specific properties of video data. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPVideoPropertiesAvc) : public T3GPVideoPropertiesBase sl@0: { sl@0: public: sl@0: IMPORT_C T3GPVideoPropertiesAvc(TUint aTimescale, const TSize& aSize, const TDesC8& aDecoderSpecificInfo); sl@0: public: sl@0: /** AVCDecoderConfigurationRecord data that will be stored in the avcC atom. */ sl@0: const TDesC8& iDecoderSpecificInfo; sl@0: }; sl@0: sl@0: /** sl@0: This class should not be used directly. This structure stores common properties amongst all supported types of audio data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPAudioPropertiesBase) sl@0: { sl@0: protected: sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: T3GPAudioPropertiesBase(T3GPAudioType aType, TUint aTimescale, TInt aFramesPerSample); sl@0: public: sl@0: /** Type of audio stream contained in the file */ sl@0: T3GPAudioType iType; sl@0: /** Timescale of the audio data. This is the number of time units that pass in one second. It sl@0: must be smaller than 65536. */ sl@0: TUint iTimescale; sl@0: /** Frames per sample. It must be smaller than 512. MPEG-4 audio has a fixed value of 1. */ sl@0: TInt iFramesPerSample; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and MPEG-4 audio specific properties of audio data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPAudioPropertiesMpeg4Audio) : public T3GPAudioPropertiesBase sl@0: { sl@0: public: sl@0: IMPORT_C T3GPAudioPropertiesMpeg4Audio(TUint aTimescale, const TDesC8& aDecoderSpecificInfo); sl@0: public: sl@0: /** MPEG-4 audio decoder specific info data stored in an ESDS atom */ sl@0: const TDesC8& iDecoderSpecificInfo; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and AMR specific properties of audio data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPAudioPropertiesAmr) : public T3GPAudioPropertiesBase sl@0: { sl@0: public: sl@0: enum TSpeechCodec{ EAmrWB, EAmrNB }; sl@0: sl@0: public: sl@0: IMPORT_C T3GPAudioPropertiesAmr(TUint aTimescale, TInt aFramesPerSample, TInt aModeSet, TSpeechCodec aCodec); sl@0: public: sl@0: /** AMR mode set. */ sl@0: TInt iModeSet; sl@0: }; sl@0: sl@0: /** sl@0: This structure stores the common and Qcelp specific properties of audio data sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(T3GPAudioPropertiesQcelp) : public T3GPAudioPropertiesBase sl@0: { sl@0: public: sl@0: IMPORT_C T3GPAudioPropertiesQcelp(TUint aTimescale, TInt aFramesPerSample, const TDesC8& aDecoderSpecificInfo); sl@0: IMPORT_C T3GPAudioPropertiesQcelp(TUint aTimescale, TInt aFramesPerSample); sl@0: public: sl@0: /** Specifies the mode to store QCELP audio data. sl@0: In 3G2 files, QCELP can be registered to be stored in two ways: sl@0: - Use QCELP Sample Entry (‘sqcp’) Box. This is the default mode. sl@0: - Use MPEG4 Audio Sample Description (‘esds’) Box. If this mode is selected, decoder specific info should be supplied. sl@0: See T3GPQcelpStorageMode. */ sl@0: T3GPQcelpStorageMode iMode; sl@0: /** MPEG-4 audio decoder specific info data stored in an ESDS atom. sl@0: If this is provided as an input parameter, the storage mode is automatically set to MPEG4 Audio sl@0: Sample Description Box mode */ sl@0: const TDesC8& iDecoderSpecificInfo; sl@0: }; sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The 3GP composer accepts H.263 /H.264 / MPEG-4 / AVC video, and AMR / MPEG-4 AAC / QCELP sl@0: audio as input to create a 3GP / 3G2 / MP4 file. sl@0: */ sl@0: NONSHARABLE_CLASS(C3GPCompose) : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static C3GPCompose* NewL(); sl@0: IMPORT_C static C3GPCompose* NewL(TInt aMediaWriteBufferSize, TInt aWriteBufferMaxCount); sl@0: IMPORT_C ~C3GPCompose(); sl@0: sl@0: IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase* aVideo, const T3GPAudioPropertiesBase* aAudio, const TDesC& aFilename, TUint aFlags = E3GPNoFlag); sl@0: IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase* aVideo, const T3GPAudioPropertiesBase* aAudio, RFile& aFile, TUint aFlags = E3GPNoFlag); sl@0: IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase* aVideo, const T3GPAudioPropertiesBase* aAudio, RFile64& aFile, TUint aFlags = E3GPNoFlag); sl@0: IMPORT_C TInt WriteVideoFrame(const TDesC8& aBuffer, TUint aDuration, TBool aKeyFrame); sl@0: IMPORT_C TInt WriteVideoFrame(const TDesC8& aBuffer, TUint aDuration, TBool aKeyFrame, const T3GPFrameDependencies& aDependencies); sl@0: IMPORT_C TInt WriteAudioFrames(const TDesC8& aBuffer, TUint aDuration); sl@0: IMPORT_C TInt SetUserData(T3GPUdtaLocation aLocation, const TDesC8& aBuffer); sl@0: IMPORT_C TInt Complete(); sl@0: private: sl@0: C3GPCompose(TInt aMediaWriteBufferSize = 0, TInt aWriteBufferMaxCount = 0); sl@0: sl@0: TInt SymbianOSError(MP4Err aError); sl@0: mp4_u32 Mp4Type(const T3GPVideoPropertiesBase* aVideo, const T3GPAudioPropertiesBase* aAudio); sl@0: TInt SetComposeProperties(const T3GPVideoPropertiesBase* aVideo, const T3GPAudioPropertiesBase* aAudio, T3GPFileFormatType aFileFormat, TUint aFlag); sl@0: TInt SetMPeg4VideoProperties(const T3GPVideoPropertiesBase* aVideo); sl@0: TInt SetAvcVideoProperties(const T3GPVideoPropertiesBase* aVideo); sl@0: TInt SetH263VideoProperties(const T3GPVideoPropertiesBase* aVideo); sl@0: TInt SetMpeg4AudioProperties(const T3GPAudioPropertiesBase* aAudio); sl@0: TInt SetAmrAudioProperties(const T3GPAudioPropertiesBase* aAudio); sl@0: TInt SetQcelpAudioProperties(const T3GPAudioPropertiesBase* aAudio); sl@0: TInt SetComposeFlag(T3GPFileFormatType aFileFormat, TUint aFlag); sl@0: void Reset(); sl@0: static void Panic(TInt aPanic); sl@0: private: sl@0: MP4Handle iHandler; sl@0: TInt iMediaWriteBufferSize; sl@0: TInt iWriteBufferMaxCount; sl@0: TBool iHasVideo; sl@0: TBool iHasAudio; sl@0: TBool iDuplicateFileHandleCreated; sl@0: RFile64 iFile; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: The Parser provides APIs to parse 3GP, 3G2 and MP4 contents (from a file, a CAF object, or given sl@0: through memory buffer), containing H.263/MPEG-4/H.264 video and AMR/MPEG-4/QCELP audio. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(C3GPParse) : public CBase, public M3GPMP4LibAsyncObserver sl@0: { sl@0: public: sl@0: IMPORT_C static C3GPParse* NewL(); sl@0: IMPORT_C static C3GPParse* NewL(TInt aReadBufferSize); sl@0: IMPORT_C ~C3GPParse(); sl@0: sl@0: IMPORT_C TInt Open(); sl@0: IMPORT_C TInt Open(const TDesC& aFilename); sl@0: IMPORT_C TInt Open(const RFile& aFile); sl@0: IMPORT_C TInt Open(const RFile64& aFile); sl@0: IMPORT_C TInt Open(const ContentAccess::CData& aData); sl@0: IMPORT_C TInt InsertData(const TDesC8& aBuffer); sl@0: IMPORT_C TInt GetVideoProperties(T3GPVideoType& aType, TUint& aLength, TReal& aFrameRate, TUint& aAvgBitRate, TSize& aSize, TUint& aTimeScale) const; sl@0: IMPORT_C TInt GetAudioProperties(T3GPAudioType& aType, TUint& aLength, TInt& aFramesPerSample, TUint& aAvgBitRate, TUint& aTimeScale) const; sl@0: IMPORT_C TInt GetContainerProperties(TUint& aSize, TUint& aAvgBitRate) const; sl@0: IMPORT_C TInt GetNumBufferedBytes(TInt& aNum) const; sl@0: IMPORT_C TInt GetFrameType(T3GPFrameType& aType) const; sl@0: IMPORT_C TInt GetVideoFrameSize(TUint& aSize) const; sl@0: IMPORT_C TInt GetAudioFramesSize(TUint& aSize) const; sl@0: IMPORT_C TInt GetVideoDecoderSpecificInfoSize(TInt& aSize) const; sl@0: IMPORT_C TInt GetVideoDecoderSpecificInfo(TDes8& aInfo) const; sl@0: IMPORT_C TInt GetAudioDecoderSpecificInfoSize(TInt& aSize) const; sl@0: IMPORT_C TInt GetAudioDecoderSpecificInfo(TDes8& aBuffer) const; sl@0: IMPORT_C TInt GetVideoTimestamp(TUint& aTimeStampInMs, TUint& aTimeStampInTimescale) const; sl@0: IMPORT_C TInt GetStreamable(TBool& aStreamable) const; sl@0: IMPORT_C TInt Seek(TUint aPosition, TBool aKeyFrame, TUint& aAudioPosition, TUint& aVideoPosition) const; sl@0: IMPORT_C TInt GetFrameAvailability(T3GPFrameType aType, TBool& aAvailable) const; sl@0: IMPORT_C TInt GetNumberOfVideoFrames(TUint& aNum) const; sl@0: IMPORT_C TInt GetVideoSampleEntryIndex(TUint& aIndex) const; sl@0: IMPORT_C TInt GetVideoFrameSize(TUint aIndex, TUint& aSize) const; sl@0: IMPORT_C TInt GetVideoFrameStartTime(TUint aIndex, TUint& aTimeStampInMs, TUint& aTimeStampInTimescale) const; sl@0: IMPORT_C TInt GetVideoFrameKeyType(TUint aIndex, TBool& aKeyFrame) const; sl@0: IMPORT_C TInt GetAudioSampleEntryIndex(TUint& aIndex) const; sl@0: IMPORT_C TInt GetQcelpStorageMode(T3GPQcelpStorageMode& aMode) const; sl@0: IMPORT_C TInt GetH263VideoLevel(TInt& aLevel) const; sl@0: IMPORT_C TInt GetUserDataAtomSize(TUint32 aType, T3GPUdtaLocation aLocation, TUint& aAtomIndex, TInt& aSize) const; sl@0: IMPORT_C TInt GetUserDataAtom(TUint32 aType, T3GPUdtaLocation aLocation, TDes8& aBuffer, TUint& aAtomIndex) const; sl@0: IMPORT_C TInt GetVideoFrameDependencies(T3GPFrameDependencies& aDependencies) const; sl@0: IMPORT_C TInt GetVideoFrameProperties(TUint aStartIndex, TUint aNumberOfFrames, RArray& aArray) const; sl@0: IMPORT_C TInt ReadVideoFrame(TDes8& aBuffer, TBool& aKeyFrame, TUint& aTimeStampInMs, TUint& aTimeStampInTimescale) const; sl@0: IMPORT_C void ReadVideoFrame(M3GPParseCallback& aCallback, TDes8& aBuffer); sl@0: IMPORT_C TInt ReadAudioFrames(TDes8& aBuffer, TInt& aReturnedFrames, TUint& aTimeStampInMs, TUint& aTimeStampInTimescale) const; sl@0: IMPORT_C void ReadAudioFrames(M3GPParseCallback& aCallback, TDes8& aBuffer); sl@0: IMPORT_C void CancelReadFrame(); sl@0: IMPORT_C TInt Complete(); sl@0: private: sl@0: C3GPParse(TInt aReadBufferSize = 0); sl@0: sl@0: TInt SymbianOSError(MP4Err aError) const; sl@0: TInt DoGetVideoProperties() const; sl@0: TInt DoGetAudioProperties() const; sl@0: TInt DoGetStreamProperties() const; sl@0: T3GPVideoType WrapperVideoType(TUint aType) const; sl@0: T3GPAudioType WrapperAudioType(TUint aType) const; sl@0: mp4_u8 UdtaLocation(T3GPUdtaLocation aLocation) const; sl@0: void Reset(); sl@0: static void Panic(TInt aPanic); sl@0: sl@0: // From M3GPMP4LibAsyncObserver sl@0: void M3GPMP4LibVideoFrameAvailable(MP4Err aError, mp4_u32 aFrameSize, mp4_u32 aTimeStamp, mp4_bool aKeyFrame, mp4_u32 aTimestamp2); sl@0: void M3GPMP4LibAudioFramesAvailable(MP4Err aError, mp4_u32 aAudioSize, mp4_u32 aTimeStamp, mp4_u32 aReturnedFrames, mp4_u32 aTimestamp2); sl@0: sl@0: private: sl@0: MP4Handle iHandler; sl@0: TInt iReadBufferSize; sl@0: sl@0: // Async read sl@0: M3GPParseCallback* iCallback; sl@0: TDes8* iAsyncReadBuffer; sl@0: sl@0: sl@0: TBool iDuplicateFileHandleCreated; sl@0: RFile64 iFile; sl@0: // Video properties sl@0: mutable T3GPVideoType iVideoType; sl@0: mutable TUint iVideoLength; sl@0: mutable TUint iVideoMp4Type; sl@0: mutable TReal iVideoFrameRate; sl@0: mutable TSize iVideoSize; sl@0: mutable TUint iVideoTimeScale; sl@0: mutable TBool iVideoPropertiesSaved; sl@0: mutable TInt iVideoError; sl@0: sl@0: // Audio Properties sl@0: mutable T3GPAudioType iAudioType; sl@0: mutable TUint iAudioLength; sl@0: mutable TUint iAudioMp4Type; sl@0: mutable TReal iAudioFramesPerSample; sl@0: mutable TSize iAudioSize; sl@0: mutable TUint iAudioTimeScale; sl@0: mutable TUint iAudioAvgBitRate; sl@0: mutable TBool iAudioPropertiesSaved; sl@0: mutable TInt iAudioError; sl@0: sl@0: // Stream properties sl@0: mutable TUint iStreamAvgBitRate; sl@0: mutable TUint iStreamSize; sl@0: mutable TBool iStreamPropertiesSaved; sl@0: mutable TInt iStreamError; sl@0: }; sl@0: sl@0: /** sl@0: A mixin class to be implemented by the client in order to use the asynchronous frame retrieval sl@0: APIs provided by the C3GPParse class. The derived class methods are called by C3GPParse when sl@0: the audio/video frames retrieval completes, successful or not. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class M3GPParseCallback sl@0: { sl@0: public: sl@0: /** sl@0: This is called upon the completion of an asynchronous request to retrieve audio sl@0: frames by the API C3GPParse::ReadAudioFramesAsync. sl@0: sl@0: @see C3GPParse::ReadAudioFramesAsync sl@0: sl@0: @param aError Returns KErrNone on success. Returns KErrAccessDenied if the 3GP Parser is in buffer mode. sl@0: Otherwise, returns one of the system wide error codes. See synchronous version of sl@0: C3GPParse::ReadAudioFrames. sl@0: @param aReturnedFrames Number of the returned frames or 0 if not known. sl@0: @param aTimeStampInMs Audio frame presentation time in milliseconds from the beginning of the audio sequence. sl@0: @param aTimeStampInTimescale Audio frame presentation time in timescale from the beginning of the audio sequence. sl@0: */ sl@0: virtual void AudioFramesAvailable(TInt aError, TUint aReturnedFrames, TUint aTimeStampInMs, TUint aTimeStampInTimescale) = 0; sl@0: sl@0: /** sl@0: VideoFrameAvailable is called upon completion of an asynchronous request to retrieve sl@0: video frames by the API C3GPParse::ReadVideoFrameAsync. sl@0: sl@0: @see C3GPParse::ReadVideoFrameAsync sl@0: sl@0: @param aError Returns KErrNone on success. Returns KErrAccessDenied if the 3GP Parser is in buffer mode. sl@0: Otherwise, returns one of the system wide error codes. See synchronous version of sl@0: C3GPParse::ReadVideoFrame. sl@0: @param aKeyFrame Returns ETrue if the current frame is a key frame (intra), otherwise the value is EFalse. sl@0: @param aTimeStampInMs Video frame presentation time in milliseconds from the beginning of the video sequence. sl@0: @param aTimeStampInTimescale Video frame presentation time in timescale from the beginning of the video sequence. sl@0: */ sl@0: virtual void VideoFrameAvailable(TInt aError, TBool aKeyFrame, TUint aTimeStampInMs, TUint aTimeStampInTimescale) = 0; sl@0: }; sl@0: sl@0: #endif // C3GPLIBRARY_H