diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-D038D77F-A6B8-5A18-8978-4981AE8D0F35.dita --- a/Symbian3/SDK/Source/GUID-D038D77F-A6B8-5A18-8978-4981AE8D0F35.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-D038D77F-A6B8-5A18-8978-4981AE8D0F35.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,54 +1,148 @@ - - - - - - Using the Encoded H264 Video Frames to Capture VideoThis topic describes how to use the encoded H264 video frames in the Ecam video capture function to capture the video data.

You need to be familiar with the Capturing Video tutorial.

The H264 video encoder provides a new, high quality video data encoding format for Ecam. Ecam allows the device to capture video frames which are encoded in the H264 format. The Ecam video capture function supports the H264 video capture format by default. You can select the H264 video capture format when preparing video capture.

Call the CCameraVideoCaptureControl::NewL() function to create an object that maps the exported call to an internal object of the MCameraVideoCaptureControl function. Pass a handle to the MCameraVideoCaptureControl function. This implementation creates a handle to the CCameraVideoCaptureControl object by the active CCamera during the construction phase. The CCameraVideoCaptureControl object makes an internal call to the CCamera::CustomInterface() function of the active CCamera implementation. The CustomInterface() function passes a UID KECamMCameraVideoCaptureControlUid value for the CCamera implementation. The CCamera implementation creates the concrete implementation of the MCameraVideoCaptureControl function and passes back a handle to the CCameraVideoCaptureControl object. Call the MCaptureVideoObserver function to notify when the video capture operations are ready. Call CCameraVideoCaptureControl::GetVideoCaptureSupportInfoL() to identify which video capture modes are supported by the CCamera implementation. Call the TPrepareVideoParameters::SetVideoCaptureType() function to set the desired video capture mode as the EClientVideoCapture or EDirectVideoCapture mode. Set the value of CCameraVideoCaptureControl::TPrepareVideoParameter::iFormat() to the EFormatEncodedH264 value for the CCamera implementation. This CCamera implementation supports the H264 video encoding data format. Prepare video capture by using the CCameraVideoCaptureControl::PrepareVideoCapture() asynchronous function. The PrepareVideoCapture() function performs setup and allocation of memory before calling the StartVideoCapture() function, in order to keep minimum latency of the PrepareVideoCapture() function. Notify the Ecam client to complete the video capture preparation using the KUidECamEventVideoCaptureControlPrepareComplete event. Call the CCameraVideoCaptureControl::StartVideoCaptureL() function to start video capture. Call the CCamera::CCameraVideoCaptureControl::PauseVideoCapture() function to pause the on-going video capture. Call the CcameraVideoCaptureControl::GetPrepareVideoParameterl() function to retrieve the current prepare video parameters. The current video capture mode is retrieved by the TPrepareVideoParameters::VideoCaptureMode() function. Call the CCamera::CCameraVideoCaptureControl::ResumeVideoCaptureL() function to resume the on-going video capture. Call the CCamera::CCameraVideoCaptureControl::StopVideoCapture() function to stop video capture. Call the CCameraVideoCaptureControl::ReleaseVideoResource() function to release the video resource, which is allocated while performing the PrepareVideoCapture() function. If an error occurs while performing video capture, call the MCaptureVideoObserver::DirectVideoCaptureFailed() function. Any video capture operation is stopped. Example

The following example code snippet illustrates video capture using H264 encoding:

- -CCamera* camera = NULL; -MCameraObserver2* observer2 = NULL; - -CCamera::CCameraVideoCaptureControl* videocapture = NULL; -MCaptureVideoObserver* videoObserver = NULL; - -camera = CCamera::New2L(*observer2, 0, 0); - -videocapture = CCamera::CCameraVideoCaptureControl::NewL(*camera, *videoObserver); - -CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters prepareVideoParameters; - -TInt supportedDVCType = -1; - -// To retrieve the supported video capture mode -videocapture->GetVideoCaptureSupportInfoL(supportedDVCType); - -// To set the video capture mode, if supported by the CCamera implementation -prepareVideoParameters.SetVideoCaptureType(CCamera::CCameraVideoCaptureControl::EDirectVideoCapture); - -// To set encoding for the H264 video data format -prepareVideoParameters.iFormat = CCamera::EFormatEncodedH264; - -// To set aspect ratio for the chosen H264 video format -prepareVideoParameters.iPixelAspectRatio = CCamera::CCameraAdvancedSettings::EEPixelAspect40To33; - -videocapture->PrepareVideoCapture(prepareVideoParameters); - -videocapture->StartVideoCaptureL(); - -videocapture->StopVideoCapture(); - -CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters retrievedVideoParam; -videocapture->GetPrepareVideoParametersL(retrievedVideoParam); - -CCamera::CCameraVideoCaptureControl::TVideoCaptureType retrievedVideoCaptureType; -retrievedVideoCaptureType = retrievedVideoParam.VideoCaptureType(); - - -
Camera API Accessing and Power Control of - Camera Camera Preset Support Capturing Image
\ No newline at end of file + + + + + + Using +the Encoded H264 Video Frames to Capture VideoThis topic describes how to use the encoded H264 video frames in +the Ecam video capture function to capture the video data. +

You need to be familiar +with the Capturing +a Video Clip tutorial.

+

The H264 video +encoder provides a new, high quality video data encoding format for Ecam. +Ecam allows the device to capture video frames which are encoded in the H264 +format. The Ecam video capture function supports the H264 video capture format +by default. You can select the H264 video capture format when preparing video +capture.

+ + +Call the CCamera::CCameraVideoCaptureControl::NewL(CCamera +&,MCaptureVideoObserver &) function to create an object +that maps the exported call to an internal object of the MCameraVideoCaptureControl function. + + +Pass a handle to the MCameraVideoCaptureControl function. +This implementation creates a handle to the CCamera::CCameraVideoCaptureControl object +by the active CCamera during the construction phase. +The CCameraVideoCaptureControl object makes an internal +call to the CCamera::CustomInterface(TUid) function of +the active CCamera implementation. The CustomInterface() function +passes a UID KECamMCameraVideoCaptureControlUid value for +the CCamera implementation. +The CCamera implementation creates the concrete implementation +of the MCameraVideoCaptureControl function and passes back +a handle to the CCameraVideoCaptureControl object. + + +Call the MCaptureVideoObserver function to notify +when the video capture operations are ready. + + +Call CCamera::CCameraVideoCaptureControl::GetVideoCaptureSupportInfoL(TInt +&)const to identify which video capture modes are supported +by the CCamera implementation. + + +Call the CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters::SetVideoCaptureType(CCamera::CCameraVideoCaptureControl::TVideoCaptureType) function to set the desired video capture mode as the EClientVideoCapture or EDirectVideoCapture mode. + + +Set the value of CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters::iFormat to +the EFormatEncodedH264 value for the CCamera implementation. +This CCamera implementation supports the H264 video encoding +data format. + + +Prepare video capture by using the CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const +TPrepareVideoParameters &) asynchronous function. The PrepareVideoCapture() function +performs setup and allocation of memory before calling the StartVideoCapture() function, +in order to keep minimum latency of the PrepareVideoCapture() function. + + +Notify the Ecam client to complete the video capture preparation using +the KUidECamEventVideoCaptureControlPrepareComplete event. + + +Call the CCamera::CCameraVideoCaptureControl::StartVideoCaptureL() function +to start video capture. + + +Call the CCamera::CCameraVideoCaptureControl::PauseVideoCapture() function +to pause the on-going video capture. + + +Call the CCamera::CCameraVideoCaptureControl::GetPrepareVideoParametersL(TPrepareVideoParameters +&)const function to retrieve the current prepare video parameters. +The current video capture type is retrieved by the CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters::VideoCaptureType()const function. + + +Call the CCamera::CCameraVideoCaptureControl::ResumeVideoCaptureL() function +to resume the on-going video capture. + + +Call the CCamera::CCameraVideoCaptureControl::StopVideoCapture() function +to stop video capture. + + +Call the CCamera::CCameraVideoCaptureControl::ReleaseVideoResource()() function +to release the video resource, which is allocated while performing the PrepareVideoCapture() function. + + +If an error occurs while performing video capture, call the MCaptureVideoObserver::DirectVideoCaptureFailed(TInt) function. Any video capture operation is stopped. + + +Example

The following example code snippet illustrates +video capture using H264 encoding:

+ +CCamera* camera = NULL; +MCameraObserver2* observer2 = NULL; + +CCamera::CCameraVideoCaptureControl* videocapture = NULL; +MCaptureVideoObserver* videoObserver = NULL; + +camera = CCamera::New2L(*observer2, 0, 0); + +videocapture = CCamera::CCameraVideoCaptureControl::NewL(*camera, *videoObserver); + +CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters prepareVideoParameters; + +TInt supportedDVCType = -1; + +// To retrieve the supported video capture mode +videocapture->GetVideoCaptureSupportInfoL(supportedDVCType); + +// To set the video capture mode, if supported by the CCamera implementation +prepareVideoParameters.SetVideoCaptureType(CCamera::CCameraVideoCaptureControl::EDirectVideoCapture); + +// To set encoding for the H264 video data format +prepareVideoParameters.iFormat = CCamera::EFormatEncodedH264; + +// To set aspect ratio for the chosen H264 video format +prepareVideoParameters.iPixelAspectRatio = CCamera::CCameraAdvancedSettings::EEPixelAspect40To33; + +videocapture->PrepareVideoCapture(prepareVideoParameters); + +videocapture->StartVideoCaptureL(); + +videocapture->StopVideoCapture(); + +CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters retrievedVideoParam; +videocapture->GetPrepareVideoParametersL(retrievedVideoParam); + +CCamera::CCameraVideoCaptureControl::TVideoCaptureType retrievedVideoCaptureType; +retrievedVideoCaptureType = retrievedVideoParam.VideoCaptureType(); + + +
+
+Camera Preset +Support +Capturing +Still Images +
\ No newline at end of file