This tutorial describes how to set up a 3GP Composer.
The purpose of this tutorial is to show you how to set up a 3GP Composer to write (compose) a 3GP, 3G2 or MP4 file.
Required background
The 3GP Library Overview introduces the 3GP Composer.
Introduction
The C3GPCompose class lets you write 3GP, 3G2 and MP4 files. You can specify the location of the output file by supplying a file path or an opened file handle.
The following tasks are covered in this tutorial:
Creating an instance of a 3GP Composer
Create an instance of a 3GP Composer by calling one of the overloads of C3GPCompose::NewL():
To use the default buffer size and buffer count, call C3GPCompose::NewL():
static IMPORT_C C3GPCompose *NewL();
To set the size of the buffer and the maximum buffer count, call C3GPCompose::NewL(TInt, TInt) and set aMediaWriteBufferSize to be the write buffer size and aWriteBufferMaxCount to be the maximum buffer count:
static IMPORT_C C3GPCompose *NewL(TInt aMediaWriteBufferSize, TInt aWriteBufferMaxCount);
Initialising a 3GP Composer for writing 3GP, 3G2 or MP4 data
Initialise the 3GP Composer for writing data by calling one of the overloads of C3GPCompose::Open():
To initialise the 3GP Composer to use a file path to write 3GP, 3G2 or MP4 data into a file, call C3GPCompose::Open(T3GPFileFormatType, const T3GPVideoPropertiesBase, const T3GPAudioPropertiesBase, const TDesC, TUint):
IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase *aVideo, const T3GPAudioPropertiesBase *aAudio, const TDesC &aFilename, TUint aFlags=E3GPNoFlag);
To initialise the 3GP Composer to use a file handle to write 3GP, 3G2 or MP4 data into a file, call C3GPCompose::Open(T3GPFileFormatType, const T3GPVideoPropertiesBase, const T3GPAudioPropertiesBase, RFile, TUint):
IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase *aVideo, const T3GPAudioPropertiesBase *aAudio, RFile &aFile, TUint aFlags=E3GPNoFlag);
Note: You can use any combination of one video type and one audio type to compose your 3GP, 3G2 and MP4 files.
The following example shows you how to compose a 3GP file with H263 video and AMR NB audio:
CMyApp::WriteFileL(const TDesC& aFile) { ... // create an instance of a 3GP Composer C3GPCompose* composer = C3GPCompose::NewL(); CleanupStack::PushL(composer); // set up a 3GP Composer T3GPVideoPropertiesH263 video(...); T3GPAudioPropertiesAmr audio(...); User::LeaveIfError(composer->Open(E3GP3GP, &video, &audio, aFile)); ... }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.