Symbian3/PDK/Source/GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 02 Jul 2010 12:51:36 +0100
changeset 11 5072524fcc79
parent 5 f345bda72bc4
child 14 578be2adaf3e
permissions -rw-r--r--
Fixing terminology

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6"><title>Setting up a 3GP Composer</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to set up a 3GP Composer. </p> <section><title>Purpose</title> <p>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. </p> <p><b>Required background</b> </p> <p>The <xref href="GUID-EF71F4BF-2206-5489-BDB9-2F85ED74D6E2.dita">3GP Library Overview</xref> introduces the 3GP Composer. </p> <p><b>Introduction</b> </p> <p>The <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose</apiname></xref> 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. </p> </section> <section><title>Using a 3GP Composer </title> <p>The following tasks are covered in this tutorial: </p> <ol id="GUID-6622F1F0-77B0-5EB9-BE8D-CB2A7D5B8E83"><li id="GUID-B9ACDA8C-B9DD-5C45-90EB-45F181DEEC44"><p><xref href="GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6.dita#GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6/GUID-F3D2FF74-D138-56CE-A76B-95CF60F9D708">Creating an instance of a 3GP Composer</xref>  </p> </li> <li id="GUID-4C7DBA07-897B-536B-B33E-155346669212"><p><xref href="GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6.dita#GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6/GUID-F8FDE6BB-4E67-53B5-BE5E-41660B3E0793"> Initialising a 3GP Composer for reading 3GP, 3G2 or MP4 data</xref>. </p> </li> </ol> <p id="GUID-F3D2FF74-D138-56CE-A76B-95CF60F9D708"><b>Creating an instance of a 3GP Composer</b> </p> <p>Create an instance of a 3GP Composer by calling one of the overloads of <codeph>C3GPCompose::NewL()</codeph>: </p> <ul><li id="GUID-8E832DE8-8CC6-55A9-9FB6-FCFAC1954410"><p>To use the default buffer size and buffer count, call <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::NewL()</apiname></xref>: </p> <codeblock id="GUID-2EAAD407-6DCD-5808-BA89-5A3010050DF3" xml:space="preserve">static IMPORT_C C3GPCompose *NewL();</codeblock> </li> <li id="GUID-D1EB29E0-0327-5F53-8E5F-22B02B22113C"><p>To set the size of the buffer and the maximum buffer count, call <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::NewL(TInt, TInt)</apiname></xref> and set <codeph>aMediaWriteBufferSize</codeph> to be the write buffer size and <codeph>aWriteBufferMaxCount</codeph> to be the maximum buffer count: </p> <codeblock id="GUID-DA35163A-39FB-58BC-8C58-F6C0DEC31DE9" xml:space="preserve">static IMPORT_C C3GPCompose *NewL(TInt aMediaWriteBufferSize, TInt aWriteBufferMaxCount);</codeblock> </li> </ul> <p id="GUID-F8FDE6BB-4E67-53B5-BE5E-41660B3E0793"><b>Initialising a 3GP Composer for writing 3GP, 3G2 or MP4 data</b> </p> <p>Initialise the 3GP Composer for writing data by calling one of the overloads of <codeph>C3GPCompose::Open()</codeph>: </p> <ul><li id="GUID-7C9EE711-94E4-5F6C-B127-2D11321CE401"><p>To initialise the 3GP Composer to use a file path to write 3GP, 3G2 or MP4 data into a file, call <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::Open(T3GPFileFormatType, const T3GPVideoPropertiesBase,
                  const T3GPAudioPropertiesBase, const TDesC, TUint)</apiname></xref>: </p> <codeblock id="GUID-3C7BEC34-6D6E-5ACC-8046-B63B0E369864" xml:space="preserve">IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase *aVideo, const T3GPAudioPropertiesBase *aAudio, const TDesC &amp;aFilename, TUint aFlags=E3GPNoFlag);</codeblock> </li> <li id="GUID-4D1EEA7B-524E-5D59-8BDF-7156F4CCB39C"><p>To initialise the 3GP Composer to use a file handle to write 3GP, 3G2 or MP4 data into a file, call <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::Open(T3GPFileFormatType, const T3GPVideoPropertiesBase,
                  const T3GPAudioPropertiesBase, RFile, TUint)</apiname></xref>: </p> <codeblock id="GUID-29DC8702-EEC4-52F9-9BEF-FBF55875714E" xml:space="preserve">IMPORT_C TInt Open(T3GPFileFormatType aFileFormat, const T3GPVideoPropertiesBase *aVideo, const T3GPAudioPropertiesBase *aAudio, RFile &amp;aFile, TUint aFlags=E3GPNoFlag);</codeblock> </li> </ul> <p> <b>Note</b>: You can use any combination of one video type and one audio type to compose your 3GP, 3G2 and MP4 files. </p> </section> <section><title>Example</title> <p>The following example shows you how to compose a 3GP file with H263 video and AMR NB audio: </p> <codeblock id="GUID-A0C41E83-1F4B-593D-A8A0-0ECDBB8A42BC" xml:space="preserve">CMyApp::WriteFileL(const TDesC&amp; 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-&gt;Open(E3GP3GP, &amp;video, &amp;audio, aFile));    
    ...
    }
</codeblock> </section> <section><title>See also</title> <p><xref href="GUID-32B58425-81AC-59D6-A17F-21BD06ACB658.dita">Adding Data to a 3GP Composer</xref>  </p> <p><xref href="GUID-460089B6-CA35-5DB7-ABC0-A688D6EE77D5.dita">Completing Composition</xref>  </p> </section> </conbody></concept>