Symbian3/PDK/Source/GUID-460089B6-CA35-5DB7-ABC0-A688D6EE77D5.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
child 14 578be2adaf3e
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?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-460089B6-CA35-5DB7-ABC0-A688D6EE77D5"><title>Completing Composition</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to complete the composing of a 3GP, 3G2 or MP4 file. </p> <section><title>Purpose</title> <p>To make sure all data added into the 3GP Composer is committed into the output, you need to complete composition. The purpose of this tutorial is to show you how to complete composition. </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>You must use the <codeph>C3GPCompose::Complete()</codeph> function to commit data to the output file. The output is only guaranteed to be valid, after you call <codeph>C3GPCompose::Complete()</codeph>. </p> <p>If you want to use the 3GP Composer again, you can re-initialise it by calling one of the <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::Open()</apiname></xref> functions. If you do not require the 3GP Composer again, you should destroy the <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose</apiname></xref> instance after you call <codeph>C3GPCompose::Complete()</codeph>. </p> </section> <section><title>Using Complete() </title> <p>The following tasks are covered in this tutorial: </p> <ul><li id="GUID-B18BF8EA-5C8D-5240-914A-96D14096F36D"><p><xref href="GUID-460089B6-CA35-5DB7-ABC0-A688D6EE77D5.dita#GUID-460089B6-CA35-5DB7-ABC0-A688D6EE77D5/GUID-077C67CD-4323-5D14-A485-C357EB2EBCDB"> Completing composition</xref>  </p> </li> </ul> <p id="GUID-077C67CD-4323-5D14-A485-C357EB2EBCDB"><b>Completing composition</b> </p> <p>To complete the composing process: </p> <ul><li id="GUID-85A48EFC-50D1-5157-A21A-9740ABEF1D91"><p>Call <xref href="GUID-C463561F-4BDA-3CBE-9588-AFDB5FD889A2.dita"><apiname>C3GPCompose::Complete()</apiname></xref>: </p> <codeblock id="GUID-84DFE149-8EA8-5EC5-A78B-8A87CDE9198F" xml:space="preserve">IMPORT_C TInt Complete();</codeblock> <p>If an error occurs when the data is committed into the output file, an error code is returned by the <codeph>C3GPCompose::Complete()</codeph> function. Regardless of the result, the 3GP Composer closes the output file before <codeph>C3GPCompose::Complete()</codeph> returns. </p> </li> </ul> </section> <section><title>Example</title> <p>The following example shows you how to complete the composing process: </p> <codeblock id="GUID-DF36A0C5-D3FD-54C5-85CC-6D87329A821F" xml:space="preserve">CMyApp::WriteFileL(const TDesC&amp; aFile)
    {
    ...
    // set up composer as shown in Setting up a 3GP Composer and Adding Data to a 3GP Composer. 
    ...
    User::LeaveIfError(composer-&gt;Complete());
    ...
    }</codeblock> </section> <section><title>See also</title> <p><xref href="GUID-28DF11D8-F895-5D4B-8C6D-AEAB3172F3B6.dita">Setting up a 3GP Composer</xref>  </p> <p><xref href="GUID-32B58425-81AC-59D6-A17F-21BD06ACB658.dita">Adding Data to a 3GP Composer</xref>  </p> </section> </conbody></concept>