Symbian3/PDK/Source/GUID-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?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-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE"><title>Getting Audio and Video Stream Metadata</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to get audio and video stream metadata. </p> <section><title>Purpose</title> <p>The purpose of this tutorial is to show you how to get metadata from audio and video streams. This tutorial looks at two of the 3GP Parser metadata functions: <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>GetVideoProperties()</apiname></xref> and <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>GetAudioProperties()</apiname></xref>. </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 Parser. </p> <p><b>Introduction</b> </p> <p>You can use the 3GP Parser to get the following metadata: </p> <ul><li id="GUID-539EFD0E-0A07-502D-AA33-99175C28B145"><p>Video properties (video type, length of video, frame rate, bit rate, width/height of image, and timescale) </p> </li> <li id="GUID-ADBFD31D-6AB2-5115-9EC7-588E2A199830"><p>Audio properties (audio type, length of audio, frames per sample, average bit rate, and timescale) </p> </li> <li id="GUID-35357E2A-E4C5-5AED-8A1B-DCBEEF6AF7F1"><p>Stream properties (stream size, stream average bit rate) </p> </li> <li id="GUID-6679D24E-AB69-597A-94D2-D51E8F1AEA9D"><p>Video decoder specific information </p> </li> <li id="GUID-A6729B87-EDC1-5791-9816-042D9CE318AD"><p>Audio decoder specific information </p> </li> <li id="GUID-1DE3A641-6DFD-5A8F-A11D-AA53F318E44B"><p>User data atom </p> </li> <li id="GUID-7C0CB6B4-95BB-5A6A-9017-6F9AA10E353D"><p>QCELP (Qualcomm CELP Codec) storage mode </p> </li> <li id="GUID-2F0FBC1E-CD71-541D-AD2D-C1F939AD53EE"><p>Video clip properties. </p> </li> </ul> </section> <section><title>Using GetVideoProperties() and GetAudioProperties()</title> <p>The following tasks are covered in this tutorial: </p> <ul><li id="GUID-92BBF778-801A-558D-BF55-EB5632564C27"><p><xref href="GUID-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE.dita#GUID-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE/GUID-3E26BB43-4120-557B-ADFE-4FBAFBC6BED8"> Getting video stream properties</xref>  </p> </li> <li id="GUID-5ABA9179-6EB4-5E61-940D-676E7661D663"><p><xref href="GUID-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE.dita#GUID-CC4BA8E7-BCAB-58F7-AC5D-BA75A82D04AE/GUID-58DECA94-B0EA-57A3-BEDA-BBC1B674A3A0">Getting audio stream properties</xref>  </p> </li> </ul> <p id="GUID-3E26BB43-4120-557B-ADFE-4FBAFBC6BED8"><b>Getting video stream properties</b> </p> <p>To return the properties that describe a video stream: </p> <ul><li id="GUID-A4F7FCD0-44BC-5649-88FC-9B9EC13DD243"><p>Call <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>C3GPParse::GetVideoProperties(T3GPVideoType&amp;,
                  TUint&amp;, TReal&amp;, TUint&amp;, TSize&amp;, TUint&amp;)</apiname></xref>: </p> <codeblock id="GUID-A1EC3749-8693-5C32-9663-DFF8C61301CD" xml:space="preserve">TInt GetVideoProperties(T3GPVideoType&amp; aType, TUint&amp; aLength, TReal&amp; aFrameRate, TUint&amp; aAvgBitRate, TSize&amp; aSize, TUint&amp; aTimeScale) const;</codeblock> <p>This function returns video type, length of video, frame rate, bit rate, width/height of image, and timescale. </p> <p> <b>Notes</b>: </p> <ul><li id="GUID-0E2606EA-8052-5C00-B138-15D040E098C7"><p>In buffer mode, make sure there is enough data supplied to the 3GP Parser before you call <codeph>C3GPParse::GetVideoProperties()</codeph>. For more information, see <xref href="GUID-12C74671-1988-55E7-8320-FE77024A523C.dita">Supplying Data to a 3GP Parser</xref>. </p> </li> <li id="GUID-872B0007-D54E-5767-AC9E-7077999E5484"><p>Getting metadata does not change the position of the video data cursor. For optimisation purposes, metadata values are cached in the 3GP Parser until <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>C3GPParse::Complete()</apiname></xref> is called. </p> </li> </ul> </li> </ul> <p id="GUID-58DECA94-B0EA-57A3-BEDA-BBC1B674A3A0"><b> Getting audio stream properties</b> </p> <p>To return the properties that describe an audio stream: </p> <ul><li id="GUID-3CF730AC-8B78-5D29-A82A-5857FB4215F3"><p>Call <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>C3GPParse::GetAudioProperties(T3GPAudioType&amp;,
                  TUint&amp;, TInt&amp;, TUint&amp;, TUint&amp;)</apiname></xref>: </p> <codeblock id="GUID-8E67C839-99FC-5089-90D4-5BA325813518" xml:space="preserve">TInt GetAudioProperties(T3GPAudioType&amp; aType, TUint&amp; aLength, TInt&amp; aFramesPerSample, TUint&amp; aAvgBitRate, TUint&amp; aTimeScale) const;</codeblock> <p>This function returns audio type, length of audio, frames per sample, average bit rate, and timescale. </p> <p> <b>Notes</b>: </p> <ul><li id="GUID-EBDF6598-0822-5300-B08A-3FDBFC2820DD"><p>In buffer mode, make sure there is enough data supplied to the 3GP Parser before you call <codeph>C3GPParse::GetAudioProperties()</codeph>. For more information, see <xref href="GUID-12C74671-1988-55E7-8320-FE77024A523C.dita">Supplying Data to a 3GP Parser</xref>. </p> </li> <li id="GUID-28215E0F-8DB1-5646-95CE-6E2DFF9BCDDF"><p>Getting metadata does not change the position of the audio data cursor. For optimisation purposes, metadata values are cached in the 3GP Parser until <xref href="GUID-BF3A60C9-0F4C-3712-90E3-ACBD73BE4EB6.dita"><apiname>C3GPParse::Complete()</apiname></xref> is called. </p> </li> </ul> </li> </ul> </section> <section><title>Example</title> <p>The following example shows you how to get audio and video property metadata: </p> <codeblock id="GUID-10EF667E-28FF-521F-96CC-6B6ECFD85E24" xml:space="preserve">CMyApp::ReadFileL(const RFile&amp; aFile)
{
...
// see example setup code in Setting up a 3GP Parser. 
...
// retrieve video properties of the content
User::LeaveIfError(parser-&gt;GetVideoProperties(...));

// retrieve audio properties of the content
User::LeaveIfError(parser-&gt;GetAudioProperties(...));
...
}</codeblock> </section> <section><title>See also</title> <p><xref href="GUID-4D4A2853-B573-5B16-B9E3-0E4853C90BCD.dita">Setting up a 3GP Parser</xref>  </p> <p><xref href="GUID-12C74671-1988-55E7-8320-FE77024A523C.dita"> Supplying Data to a 3GP Parser</xref>  </p> <p><xref href="GUID-EFD05CAF-A8CF-5C2E-B7C9-51023D2438DF.dita">Reading Video and Audio Content</xref>  </p> </section> </conbody></concept>