Symbian3/PDK/Source/GUID-F690DAC8-688B-5BD7-88DF-0CB3D4ACDCFF.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept xml:lang="en" id="GUID-F690DAC8-688B-5BD7-88DF-0CB3D4ACDCFF"><title> Capturing Video</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to capture video using the Ecam API. </p> <section><title>Purpose</title> <p>This purpose of this tutorial is to show you how to capture video using the Ecam API. </p> <p><b>Required Background</b> </p> <p>The <xref href="GUID-80EC80E2-E197-50F7-B1FD-720A00AC3B4D.dita">Onboard Camera Overview</xref> introduces the camera utilities. </p> <p><b>Introduction</b> </p> <p>The Video Capture Control allows the client to capture videos. The client can create histogram, snapshot and image processing object specific to video capture. It can start, stop, pause, resume and stop the video capture operations. </p> <p><b>Setup and Configuration Requirements</b> </p> <p>The following are the setup and configuration requirements you need to follow before video capture implementation: </p> <ul><li id="GUID-19C583A4-413F-519A-B2B2-2800F0E454E3"><p>Make sure that you provide a concrete implementation for the <xref href="GUID-2818623D-A8AF-3670-AF7F-5194185D7382.dita"><apiname>McameraVideoCaptureControl</apiname></xref> interface class, which provides the video capture functionality. </p> </li> <li id="GUID-E8DAF0D4-7440-5CC0-83CD-55ECF57C34DD"><p>Client needs to implement the <xref href="GUID-AD4944AA-1C8D-3332-A5BC-4439A0E030C1.dita"><apiname>McaptureVideoObserver</apiname></xref> observer class. The observer methods are called by the implementation when the video capture operations are ready to be notified accordingly. </p> </li> </ul> </section> <section><title>Using Video Capture </title> <p>The following tasks will be covered during video capture implementation: </p> <ul><li id="GUID-55ABCB13-5C9B-5D2F-9D33-B8969B41BAE6"><p>Create a class pointer using a <xref href="GUID-ADBCEC33-BD3C-330C-902C-1BF1AF896D2C.dita#GUID-ADBCEC33-BD3C-330C-902C-1BF1AF896D2C/GUID-6155BC91-5331-3667-A25D-863020C84233"><apiname>CcameraVideoCaptureControl::NewL()</apiname></xref> factory method. </p> <p>This class maps the exported call to an internal object of class <xref href="GUID-2818623D-A8AF-3670-AF7F-5194185D7382.dita"><apiname>McameraVideoCaptureControl</apiname></xref>. </p> </li> <li id="GUID-051037F8-A45A-5682-9445-E81FECE6D29E"><p>Pass a pointer to <xref href="GUID-2818623D-A8AF-3670-AF7F-5194185D7382.dita"><apiname>McameraVideoCaptureControl</apiname></xref> object to the <xref href="GUID-ADBCEC33-BD3C-330C-902C-1BF1AF896D2C.dita"><apiname>CcameraVideoCaptureControl</apiname></xref> object by the active camera during the construction phase. </p> </li> <li id="GUID-396899E9-0BED-5B69-B1E8-B745DADB571B"><p>Get this pointer using a call to <xref href="GUID-4E8A5141-5E4A-322A-9892-8DC49D04986E.dita#GUID-4E8A5141-5E4A-322A-9892-8DC49D04986E/GUID-1F537D7D-5451-3834-869D-3092A4773B83"><apiname>Ccamera::CustomInterface()</apiname></xref> with UID value <xref href="GUID-9C8C3F85-A459-3C07-BF5F-D583726F2FF7.dita"><apiname>KECamMCameraVideoCaptureControlUid</apiname></xref>. </p> </li> <li id="GUID-0C4E4577-8D1C-5A02-8070-1381502F6038"><p>Use <xref href="GUID-7FAEB878-52B1-3A54-9607-69AE09AB8AEB.dita"><apiname>MCaptureVideoObserver</apiname></xref> class methods, when the video capture operations are ready to be notified accordingly. </p> </li> <li id="GUID-E92F4F3B-AC92-5B34-851D-B518E64AA620"><p>Use <xref href="GUID-5FD7C489-DB00-360E-B0D1-41CB44F2E294.dita#GUID-5FD7C489-DB00-360E-B0D1-41CB44F2E294/GUID-31034113-5053-332B-A8FA-34EC0C2DD334"><apiname>CCamVideoCaptureControl::PrepareVideoCapture</apiname></xref> API to initialize the settings for video capture. If video is not supported, then the method will exit with the <codeph>KerrNotSupported</codeph> error message. </p> </li> <li id="GUID-8BF47E42-A140-541F-8680-BEF227F444CA"><p>Prepare for video capture using <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-A6F5FDF5-7C7D-35DF-8F00-740CEF430BEC"><apiname>CCamera::CCameraVideoCaptureControl::PrepareVideoCapture</apiname></xref> asynchronous method. This performs setup and allocation of memory prior to calling <xref href="GUID-86AECED6-39D8-370F-813A-2C777B786C70.dita"><apiname>StartVideoCapture</apiname></xref> method to keep the latency of that method to a minimum. </p> </li> <li id="GUID-F608EAD3-D2B4-5D18-8AB9-909F116B4E1B"><p>Notify the client about completing the preparation for video capture using <xref href="GUID-203BEBE6-F7B8-30EA-824B-AA45B88304E1.dita"><apiname>KUidECamEventVideoCaptureControlPrepareComplete</apiname></xref> event. </p> </li> <li id="GUID-A57E28A4-2CCD-5621-B2D5-9D286196869F"><p>Start video capture using <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-301E3CE4-3869-36DB-B572-E46B7C18BCE0"><apiname>CCamera::CCameraVideoCaptureControl::StartVideoCaptureL</apiname></xref> method. </p> </li> <li id="GUID-53E8D5A1-053E-5A33-A4F8-131CBE2A68F3"><p>Check if camera supports embedded still capture feature using <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-F8482663-5325-3065-8F24-61476453A151"><apiname>CCamera::CCameraVideoCaptureControl::GetEmbeddedStillCaptureSupportInfoL</apiname></xref> method. Capturing still image while video is being captured is referred as embedded still capture. </p> </li> <li id="GUID-4E3C5C41-80F9-5AAC-806E-33EDBDE62AC1"><p>Sets the state to check if embedded still image capture state is enabled using <xref href="GUID-007358AE-9795-33EB-A3BE-4788D309135D.dita#GUID-007358AE-9795-33EB-A3BE-4788D309135D/GUID-51BFB3F9-DC90-3819-A5C3-2C3FD8EFFF97"><apiname>CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters::SetEmbeddedStillCaptureState</apiname></xref> method. </p> </li> <li id="GUID-66610441-E054-5704-999A-097BCB23568D"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-A1799994-FBD8-3AEC-9CBA-E593D2D6B036"><apiname>CCamera::CCameraVideoCaptureControl::PauseVideoCapture</apiname></xref> call to pause the ongoing video capture. </p> </li> <li id="GUID-C426DA42-D8ED-5702-A13D-6786B0B45849"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-E6FFBDA2-B38E-3703-B606-7DF313BDFAA8"><apiname>CCamera::CCameraVideoCaptureControl::ResumeVideoCaptureL</apiname></xref> to resume the ongoing video capture. </p> </li> <li id="GUID-BDE3DD51-7778-5021-BC72-26644B5BE651"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-07FA4DF6-4531-3734-ABEA-FAF0DD324B5F"><apiname>CCamera::CCameraVideoCaptureControl::StopVideoCapture</apiname></xref> to stop video capture. </p> </li> <li id="GUID-BFCA4131-01D8-539F-A0E6-5C363BFC2F62"><p>Release the video resource that was allocated during <xref href="GUID-ECB7D755-0767-3346-9268-65900661CC64.dita"><apiname>PrepareVideoCapture</apiname></xref> using <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-D02BE8BF-F0D4-3703-AFA0-AE53BFCFBBC6"><apiname>CCamera::CCameraVideoCaptureControl::ReleaseVideoResource</apiname></xref> method. </p> </li> </ul> <p> <b>Note</b>: </p> <ul><li id="GUID-820BCF11-C839-5EDF-9353-3D00129A39DB"><p> <xref href="GUID-BAFF01BC-405C-37B2-8AC3-F96CF756C300.dita#GUID-BAFF01BC-405C-37B2-8AC3-F96CF756C300/GUID-CFBDB434-0198-3171-9DEC-97A8B7CCAE9B"><apiname>McameraObserver2::VideoBufferReady</apiname></xref> will not be used with the class <xref href="GUID-ADBCEC33-BD3C-330C-902C-1BF1AF896D2C.dita"><apiname>CcameraVideoCaptureControl</apiname></xref>. </p> </li> </ul> <p>The following example code snippets illustrate the <b>video capture control </b> implementation. </p> <codeblock id="GUID-09A6BD59-5FD6-552F-B83F-A9B6BBED3E74" xml:space="preserve">CCamVideoCaptureControl* CCamVideoCaptureControl::NewL(CCamUnitTestPlugin&amp; aOwner);
    12 <concept id="GUID-F690DAC8-688B-5BD7-88DF-0CB3D4ACDCFF" xml:lang="en"><title> Capturing
    13 
    13 Video</title><prolog><metadata><keywords/></metadata></prolog><conbody>
    14 CCamVideoCaptureControl* self = new(ELeave) CCamVideoCaptureControl(aOwner);
    14 <p>This tutorial describes how to capture video using the Ecam API. </p>
    15 
    15 <section id="GUID-01CB3845-42E0-45C6-A784-6A3991A81C83"><title>Purpose</title> <p>The
    16 static_cast&lt;MCameraVideoCaptureControl*&gt;(CCamVideoCaptureControl::NewL(static_cast&lt;CCamUnitTestPlugin&amp;&gt;(*this)));
    16 purpose of this tutorial is to show you how to capture video using the Ecam
    17 
    17 API. </p> <p><b>Required
    18 TAny* advSettingObject;
    18 Background</b> </p> <p>For background information, see the <xref href="GUID-80EC80E2-E197-50F7-B1FD-720A00AC3B4D.dita">Onboard
    19 advSettingObject = CCamera::CustomInterface(aInterfaceUid);
    19 Camera Overview</xref>. </p> <p><b>Introduction</b> </p> <p>The video capture control allows the client to start, pause,
    20 
    20 resume and stop video capture. </p> </section>
    21 CCamVideoCaptureControl::PrepareVideoCapture(CCamera::EFormatFbsBitmapColor16M,setFrameSizeIndex,setFrameRateIndex,KNumberOfBuffersToUse,KNumberOfFramesPerBuffer);
    21 <section id="GUID-84B26023-5014-4689-B989-5F76A2CA9629"><title>Using Video
    22 
    22 Capture </title> <ul>
    23 MCaptureVideoObserver* iCaptureVideoObserver;
    23 <li id="GUID-55ABCB13-5C9B-5D2F-9D33-B8969B41BAE6"><p>Create a class pointer
    24 iCaptureVideoObserver-&gt;VideoBufferReady(NULL, KErrNotSupported);</codeblock> </section> </conbody><related-links><link href="GUID-9DE1CE5D-F148-5A7E-908A-DDD57A32C629.dita"><linktext>Camera API</linktext> </link> <link href="GUID-9014ED9B-B0A0-5C95-9C5B-7D2F658C757F.dita"><linktext>Accessing and Power Control of
    24 using the <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-61883C60-E883-3D33-A5B2-484451310591"><apiname>CCamera::CCameraVideoCaptureControl::NewL()</apiname></xref> factory
    25                 Camera</linktext> </link> <link href="GUID-FAB548CF-24EB-52D1-A7A1-9446BA67C7A5.dita"><linktext>Camera Preset Support</linktext> </link> <link href="GUID-DA26D246-D74A-529F-9F81-11B45669103F.dita"><linktext>Capturing Image</linktext> </link> </related-links></concept>
    25 method. </p> <p> </p> </li>
       
    26 <li id="GUID-E92F4F3B-AC92-5B34-851D-B518E64AA620"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-F717B6C4-913A-3F28-9AD1-E7FBFB85427F"><apiname>CCamera::CCameraVideoCaptureControl::PrepareVideoCapture()</apiname></xref> to
       
    27 initialize the settings for video capture. </p> </li>
       
    28 <li id="GUID-A57E28A4-2CCD-5621-B2D5-9D286196869F"><p>Start video capture
       
    29 using <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-774897D4-271E-3D7D-AAA6-033D34A39D74"><apiname>CCamera::CCameraVideoCaptureControl::StartVideoCaptureL()</apiname></xref>. </p> </li>
       
    30 <li id="GUID-66610441-E054-5704-999A-097BCB23568D"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-5EB82FE6-4025-3F78-9DAD-6851086A46C6"><apiname>CCamera::CCameraVideoCaptureControl::PauseVideoCapture()</apiname></xref> call
       
    31 to pause the video capture. </p> </li>
       
    32 <li id="GUID-C426DA42-D8ED-5702-A13D-6786B0B45849"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-D9BECEAD-8695-3B8B-A537-9F7B96EF1A2A"><apiname>CCamera::CCameraVideoCaptureControl::ResumeVideoCaptureL()</apiname></xref> to
       
    33 resume the video capture. </p> </li>
       
    34 <li id="GUID-BDE3DD51-7778-5021-BC72-26644B5BE651"><p>Use <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-017E7D68-9971-3966-B863-95471AC8636F"><apiname>CCamera::CCameraVideoCaptureControl::StopVideoCapture()</apiname></xref> to
       
    35 stop video capture. </p> </li>
       
    36 <li id="GUID-BFCA4131-01D8-539F-A0E6-5C363BFC2F62"><p>Release the resource
       
    37 that was allocated during <xref href="GUID-E8B6B8ED-B023-367A-B760-06D4000AAB8D.dita"><apiname>PrepareVideoCapture()</apiname></xref> using the <xref href="GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460.dita#GUID-D74635DE-C5D8-3A9A-ABDD-8324D8EFF460/GUID-6379550B-578F-3A91-8328-AD7429CF2AA4"><apiname>CCamera::CCameraVideoCaptureControl::ReleaseVideoResource()</apiname></xref> method. </p> </li>
       
    38 </ul> </section>
       
    39 </conbody><related-links>
       
    40 <link href="GUID-9DE1CE5D-F148-5A7E-908A-DDD57A32C629.dita"><linktext>Camera API</linktext>
       
    41 </link>
       
    42 <link href="GUID-9014ED9B-B0A0-5C95-9C5B-7D2F658C757F.dita"><linktext>Accessing
       
    43 and Power Control of  Camera</linktext></link>
       
    44 <link href="GUID-FAB548CF-24EB-52D1-A7A1-9446BA67C7A5.dita"><linktext>Camera Preset
       
    45 Support</linktext></link>
       
    46 <link href="GUID-DA26D246-D74A-529F-9F81-11B45669103F.dita"><linktext>Capturing
       
    47 Image</linktext></link>
       
    48 </related-links></concept>