Media Client Video Display Tutorial
This tutorial introduces how to use the Media Client Video Display library for different functions.
The CMediaClientVideoDisplay class is used to provide video display functionality for the video client APIs. The CMediaClientVideoDisplay class allows you to use as a standalone video display APIs from the client utilities.
Displaying video data To display new video data on a window, call CMediaClientVideoDisplay::NewL(TInt) to initialize a new instance of the video client data. If you have already created the graphics surface with TSurfaceId, you must call CMediaClientVideoDisplay::NewL(TInt,const TSurfaceId &,const
TRect &,TVideoAspectRatio) to intialize a new instance of the video client data.
Assigning values to the video surface parameters Call CMediaClientVideoDisplay::SurfaceCreated(const
TSurfaceId &,const TRect &,TVideoAspectRatio,const TRect
&) to assign values to the following video surface parameters:
Surface ID (Identity)
Dimensions of the crop rectangle for the video image
Pixel aspect ratio that is defined by the TVideoAspectRatio function.
Dimensions of the crop region for the video image
If the video surface parameter changes, you can call CMediaClientVideoDisplay::SurfaceParametersChanged(const TSurfaceId
&,const TRect &,TVideoAspectRatio) to assign the changed values.
Removing the graphics surface Call CMediaClientVideoDisplay::RemoveSurface() to remove the graphics surface that is not needed for the video display.
Adding a new window Call CMediaClientVideoDisplay::AddDisplayWindowL(const
RWindowBase *,const TRect &,const TRect &,const TRect
&,TReal32,TReal32,TVideoRotation,TAutoScaleType,TInt,TInt,RWindow
*) to add a new window for displaying the video picture.
Redrawing the window Call CMediaClientVideoDisplay::RedrawWindows(const TRect
&) to redraw all the windows with new crop region.
Setting the video data for automatic scaling To set the video data for automatic scaling:
If the new window is displayed, you can then call the CMediaClientVideoDisplay::SetAutoScaleL(const RWindowBase
&,TAutoScaleType,TInt,TInt,const TRect &) function. When automatic video scaling is active, the video image is scaled automatically to match the video window, based on the scaling type, and positioned according to the video data parameters. Note: All video controller do not support automatic scaling.
When the video data is already opened, you can call the CMediaClientVideoDisplay::SetAutoScaleL(TAutoScaleType,TInt,TInt,const
TRect &) function. This function related to the function CVideoPlayerUtility2::SetAutoScaleL(const RWindow
&,TAutoScaleType) in CVideoPlayerUtility2.
Setting the video data for specified scaling To scale the video image for a specified dimension from its original size within the window:
If you open a new window, you can then call the CMediaClientVideoDisplay::SetScaleFactorL(const RWindowBase
&,TReal32,TReal32,const TRect &) function.
When the video clip is already opened, you can then call the CMediaClientVideoDisplay::SetScaleFactorL(TReal32,TReal32,TBool) function.
Retrieving the scale feature Call CMediaClientVideoDisplay::GetScaleFactorL(const
RWindowBase &,TReal32 &,TReal32 &) to retrieve the scale feature currently set for a window. This function is preferred to use with CVideoPlayerUtility2.
Rotating the video image To rotate the video image within the window:
If the new window is displayed, you can then call the CMediaClientVideoDisplay::SetRotationL(const RWindowBase
&,TVideoRotation,const TRect &) function.
When the video data is already opened, you can call the CMediaClientVideoDisplay::SetRotationL(TVideoRotation,const TRect
&) function.
Both the rotation functions can replace the function CVideoPlayerUtility2::SetRotationL(const RWindow
&,TVideoRotation) in CVideoPlayerUtility2 and the function CVideoPlayerUtility::SetRotationL(TVideoRotation) in CVideoPlayerUtility.
Retrieving the rotation feature Call CMediaClientVideoDisplay::RotationL(const
RWindowBase &) to retrieve the video rotation set for a window. This function is preferred to use with CVideoPlayerUtility2.
Clipping the window Call CMediaClientVideoDisplay::SetWindowClipRectL(const
RWindowBase &,const TRect &,const TRect &) to set the window clipping rectangle that is relative to the window.
Setting the video extension Call CMediaClientVideoDisplay::SetVideoExtentL(const
RWindowBase &,const TRect &,const TRect &) to set the video extension on the screen that is relative to the window.
Removing the window Call CMediaClientVideoDisplay::RemoveDisplayWindow(const
RWindowBase &) to removes a window that is currently being used to display the video picture.
Closing the video data Call CMediaClientVideoDisplay::~CMediaClientVideoDisplay() to close the video data instance before you leave the CMediaClientVideoDisplay function.