CVideoPlayerUtility2 Class Reference

class CVideoPlayerUtility2 : public CVideoPlayerUtility

Extension class from CVideoPlayerUtility to allow graphics surface support.

Inherits from

Public Member Functions
~CVideoPlayerUtility2 ()
IMPORT_C void AddDisplayL ( RWsSession &, TInt , MMMFSurfaceEventHandler &)
IMPORT_C void AddDisplayWindowL ( RWsSession &, CWsScreenDevice &, RWindow &, const TRect &, const TRect &)
IMPORT_C void AddDisplayWindowL ( RWsSession &, CWsScreenDevice &, RWindow &)
IMPORT_C void GetScaleFactorL (const RWindow &, TReal32 &, TReal32 &)
IMPORT_C CVideoPlayerUtility2 * NewL ( MVideoPlayerUtilityObserver &, TInt , TInt )
IMPORT_C void RemoveDisplay ( TInt )
IMPORT_C void RemoveDisplayWindow ( RWindow &)
IMPORT_C TVideoRotation RotationL (const RWindow &)
IMPORT_C void SetAutoScaleL (const RWindow &, TAutoScaleType )
IMPORT_C void SetAutoScaleL (const RWindow &, TAutoScaleType , TInt , TInt )
IMPORT_C void SetExternalDisplaySwitchingL ( TInt , TBool )
IMPORT_C void SetRotationL (const RWindow &, TVideoRotation )
IMPORT_C void SetScaleFactorL (const RWindow &, TReal32 , TReal32 )
IMPORT_C void SetVideoExtentL (const RWindow &, const TRect &)
IMPORT_C void SetWindowClipRectL (const RWindow &, const TRect &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CVideoPlayerUtility::AudioBitRateL()const
CVideoPlayerUtility::AudioEnabledL()const
CVideoPlayerUtility::AudioTypeL()const
CVideoPlayerUtility::Balance()const
CVideoPlayerUtility::CancelRegisterAudioResourceNotification(TUid)
CVideoPlayerUtility::Close()
CVideoPlayerUtility::ControllerImplementationInformationL()
CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)
CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)
CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &)
CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &)
CVideoPlayerUtility::DurationL()const
CVideoPlayerUtility::GetCropRegionL(TRect &)const
CVideoPlayerUtility::GetDRMCustomCommand()
CVideoPlayerUtility::GetFrameL(TDisplayMode)
CVideoPlayerUtility::GetFrameL(TDisplayMode,ContentAccess::TIntent)
CVideoPlayerUtility::GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities &)const
CVideoPlayerUtility::GetScaleFactorL(TReal32 &,TReal32 &,TBool &)const
CVideoPlayerUtility::GetVideoLoadingProgressL(TInt &)
CVideoPlayerUtility::MaxVolume()const
CVideoPlayerUtility::MetaDataEntryL(TInt)const
CVideoPlayerUtility::NewL(MVideoPlayerUtilityObserver &,TInt,TInt,RWsSession &,CWsScreenDevice &,RWindowBase &,const TRect &,const TRect &)
CVideoPlayerUtility::NumberOfMetaDataEntriesL()const
CVideoPlayerUtility::OpenDesL(const TDesC8 &,TUid)
CVideoPlayerUtility::OpenFileL(const RFile &,TUid)
CVideoPlayerUtility::OpenFileL(const TDesC &,TUid)
CVideoPlayerUtility::OpenFileL(const TMMSource &,TUid)
CVideoPlayerUtility::OpenUrlL(const TDesC &,TInt,const TDesC8 &,TUid)
CVideoPlayerUtility::PauseL()
CVideoPlayerUtility::Play()
CVideoPlayerUtility::Play(const TTimeIntervalMicroSeconds &,const TTimeIntervalMicroSeconds &)
CVideoPlayerUtility::PlayVelocityL()const
CVideoPlayerUtility::PositionL()const
CVideoPlayerUtility::Prepare()
CVideoPlayerUtility::PriorityL(TInt &,TMdaPriorityPreference &)const
CVideoPlayerUtility::RefreshFrameL()
CVideoPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &,TUid,const TDesC8 &)
CVideoPlayerUtility::RegisterForVideoLoadingNotification(MVideoLoadingObserver &)
CVideoPlayerUtility::RotationL()const
CVideoPlayerUtility::SetAudioEnabledL(TBool)
CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType)
CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType,TInt,TInt)
CVideoPlayerUtility::SetBalanceL(TInt)
CVideoPlayerUtility::SetCropRegionL(const TRect &)
CVideoPlayerUtility::SetDisplayWindowL(RWsSession &,CWsScreenDevice &,RWindowBase &,const TRect &,const TRect &)
CVideoPlayerUtility::SetInitScreenNumber(TInt)
CVideoPlayerUtility::SetPlayVelocityL(TInt)
CVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds &)
CVideoPlayerUtility::SetPriorityL(TInt,TInt)
CVideoPlayerUtility::SetRotationL(TVideoRotation)
CVideoPlayerUtility::SetScaleFactorL(TReal32,TReal32,TBool)
CVideoPlayerUtility::SetVideoEnabledL(TBool)
CVideoPlayerUtility::SetVideoFrameRateL(TReal32)
CVideoPlayerUtility::SetVolumeL(TInt)
CVideoPlayerUtility::StartDirectScreenAccessL()
CVideoPlayerUtility::StepFrameL(TInt)
CVideoPlayerUtility::Stop()
CVideoPlayerUtility::StopDirectScreenAccessL()
CVideoPlayerUtility::VideoBitRateL()const
CVideoPlayerUtility::VideoEnabledL()const
CVideoPlayerUtility::VideoFormatMimeType()const
CVideoPlayerUtility::VideoFrameRateL()const
CVideoPlayerUtility::VideoFrameSizeL(TSize &)const
CVideoPlayerUtility::Volume()const
CVideoPlayerUtility::WillResumePlay()
CVideoPlayerUtility::~CVideoPlayerUtility()

Constructor & Destructor Documentation

~CVideoPlayerUtility2()

~CVideoPlayerUtility2 ( )

Destructor. Closes any open video clips and frees any resources held by the Video Player.

Member Functions Documentation

AddDisplayL(RWsSession &, TInt, MMMFSurfaceEventHandler &)

IMPORT_C void AddDisplayL ( RWsSession & aWs,
TInt aDisplay,
MMMFSurfaceEventHandler & aEventHandler
)

Adds the specified display to the list of surface rendering targets. This API can be used in conjunction with AddDisplayWindowL calls. The caller is responsible for handling surface events generated for the specific display. A single graphics surface is created and shared between all windows and displays. Surface registration and de-registration is managed by the MMF framework.

AddDisplayWindowL
leave
Any of the system wide error codes.
leave
KErrNotReady if the source file, URL or descriptor has not been opened.
leave
KErrInUse if the display has already been added by a previous AddDisplayL call.

Parameters

RWsSession & aWs Window server session.
TInt aDisplay Display to create graphics surface on.
MMMFSurfaceEventHandler & aEventHandler Call-back interface for receiving surface specific events.

AddDisplayWindowL(RWsSession &, CWsScreenDevice &, RWindow &, const TRect &, const TRect &)

IMPORT_C void AddDisplayWindowL ( RWsSession & aWs,
CWsScreenDevice & aScreenDevice,
RWindow & aWindow,
const TRect & aVideoExtent,
const TRect & aWindowClipRect
)

Adds a new window for displaying the video picture. Client applications must use this method instead of SetDisplayWindowL() when using CVideoPlayerUtility2 .

This method can only be called after opening the source is complete and the client has received an MvpuoOpenComplete() callback.

leave
The method will leave if an error occurs. Typical error codes used: KErrNotReady if the source file, URL, or descriptor has not been opened.

Parameters

RWsSession & aWs The window server session for this window.
CWsScreenDevice & aScreenDevice The screen device for the screen that the window is displayed on.
RWindow & aWindow The display window.
const TRect & aVideoExtent Video extent on the screen, relative to the window. Video picture position within the extent depends on the scaled picture and content alignment or offset. The video extent can be partially or completely outside the window.
const TRect & aWindowClipRect Window clipping rectangle, relative to the window. The clipping rectangle specifies the part of the window used for video display. The rectangle must be contained completely within the window.

AddDisplayWindowL(RWsSession &, CWsScreenDevice &, RWindow &)

IMPORT_C void AddDisplayWindowL ( RWsSession & aWs,
CWsScreenDevice & aScreenDevice,
RWindow & aWindow
)

A simplified variant of AddDisplayWindowL() . When this variant is used, the video extent and window clipping rectangle default to the whole window.

This method can only be called after opening the source is complete and the client has received an MvpuoOpenComplete() callback.

leave
The method will leave if an error occurs. Typical error codes used: KErrNotReady if the source file, URL, or descriptor has not been opened.

Parameters

RWsSession & aWs The window server session for this window.
CWsScreenDevice & aScreenDevice The screen device for the screen that the window is displayed on.
RWindow & aWindow The display window.

GetScaleFactorL(const RWindow &, TReal32 &, TReal32 &)

IMPORT_C void GetScaleFactorL ( const RWindow & aWindow,
TReal32 & aWidthPercentage,
TReal32 & aHeightPercentage
)

Retrieves the scale factor currently set for a window. This is the preferred method to use with CVideoPlayerUtility2 .

leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.

Parameters

const RWindow & aWindow Window to retrieve scale factor for.
TReal32 & aWidthPercentage On function return, contains the current scaling percentage applied to the width of the video image (100 = original size).
TReal32 & aHeightPercentage On function return, contains the current scaling percentage applied to the height of the video image (100 = original size).

NewL(MVideoPlayerUtilityObserver &, TInt, TInt)

IMPORT_C CVideoPlayerUtility2 * NewL ( MVideoPlayerUtilityObserver & aObserver,
TInt aPriority,
TInt aPref
) [static]

Creates a new instance of the video player utility. Unlike CVideoPlayerUtility::NewL() , the CVideoPlayerUtility2 factory does not require window handles and other video display information as its arguments. The client can set up rendering later with AddDisplayWindowL() , or optionally use the utility without a window, for example, for metadata query purposes.

leave
The method will leave if an error occurs. Typical error codes used: KErrNoMemory if out of memory.
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.

Parameters

MVideoPlayerUtilityObserver & aObserver A client class to receive notifications from the video player.
TInt aPriority The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
TInt aPref The Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.

RemoveDisplay(TInt)

IMPORT_C void RemoveDisplay ( TInt aDisplay )

Removes the specified display from the list of surface rendering targets.

Parameters

TInt aDisplay Display id of display to remove

RemoveDisplayWindow(RWindow &)

IMPORT_C void RemoveDisplayWindow ( RWindow & aWindow )

Removes a window that is currently being used to display the video picture. The window must have previously been added with AddDisplayWindowL() .

This method cannot fail. If the window has not been added with AddDisplayWindowL() , the method call will be ignored.

Parameters

RWindow & aWindow The display window.

RotationL(const RWindow &)

IMPORT_C TVideoRotation RotationL ( const RWindow & aWindow )

Retrieves the video rotation set for a window. This is the preferred method to use with CVideoPlayerUtility2 .

leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.
TVideoRotation CVideoPlayerUtility2::AddDisplayWindowL

Parameters

const RWindow & aWindow Window to retrieve rotation for.

SetAutoScaleL(const RWindow &, TAutoScaleType)

IMPORT_C void SetAutoScaleL ( const RWindow & aWindow,
TAutoScaleType aScaleType
)

Set video automatic scaling. When automatic scaling is active, the video picture is scaled automatically to match the video extent, based on the scaling type. This variant of SetAutoScaleL() will always center the picture in the extent.

This is the preferred method to use with CVideoPlayerUtility2 .

Calling SetAutoScaleL() will override any scaling factors set with SetScaleFactorL() . Calling SetScaleFactorL() will disable automatic scaling.

TAutoScaleType , THorizontalAlign , TVerticalAlign
Pre-condition
The video clip has been opened by the client
leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.

Parameters

const RWindow & aWindow Window to set auto scaling options for.
TAutoScaleType aScaleType Automatic scaling type

SetAutoScaleL(const RWindow &, TAutoScaleType, TInt, TInt)

IMPORT_C void SetAutoScaleL ( const RWindow & aWindow,
TAutoScaleType aScaleType,
TInt aHorizPos,
TInt aVertPos
)

Set video automatic scaling. When automatic scaling is active, the video picture is scaled automatically to match the video extent, based on the scaling type, and positioned according to the parameters.

This is the preferred method to use with CVideoPlayerUtility2 .

Calling SetAutoScaleL() will override any scaling factors set with SetScaleFactorL() . Calling SetScaleFactorL() will disable automatic scaling.

TAutoScaleType , THorizontalAlign , TVerticalAlign
Pre-condition
The video clip has been opened by the client.
leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.

Parameters

const RWindow & aWindow Window to set auto scaling options for.
TAutoScaleType aScaleType Automatic scaling type
TInt aHorizPos Video picture horizontal position, relative to the video window. The value can be either a pixel offset (positive or negative) from the top left corner of the window to the top left corner of the picture, or an alignment constant from enum THorizontalAlign.
TInt aVertPos Video picture vertical position, relative to the video window. The value can be either a pixel offset (positive or negative) from the top left corner of the window to the top left corner of the picture, or an alignment constant from enum TVerticalAlign.

SetExternalDisplaySwitchingL(TInt, TBool)

IMPORT_C void SetExternalDisplaySwitchingL ( TInt aDisplay,
TBool aControl
)

When enabled sets automatic switching of surface to/from external display when it is connected/disconnected from the device.

Automatic switching is enabled by default, but only if the client thread that created this utility has an Active Scheduler installed and the device supports external display switching.

To use this function the client thread must have an Active Scheduler installed otherwise it will leave with KErrNotReady.

leave
KErrNotSupported Device does not support external displays
leave
KErrNotReady CActiveScheduler is not installed

Parameters

TInt aDisplay Display id of display to enable external switching for.
TBool aControl ETrue to enable. EFalse to disable.

SetRotationL(const RWindow &, TVideoRotation)

IMPORT_C void SetRotationL ( const RWindow & aWindow,
TVideoRotation aRotation
)

Rotates the video image within the window. This is the preferred method to use with CVideoPlayerUtility2 .

The rotation will replace any rotation set with CVideoPlayerUtility::SetRotationL . Likewise with setting the rotation with CVideoPlayerUtility::SetRotationL after a call to CVideoPlayerUtility2::SetRotationL has been made, then the rotation specified will replace any rotation set with CVideoPlayerUtility2::SetRotationL .

leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.
CVideoPlayerUtility::SetRotationL TVideoRotation

Parameters

const RWindow & aWindow Window to set rotation for.
TVideoRotation aRotation The video rotation to use for aWindow.

SetScaleFactorL(const RWindow &, TReal32, TReal32)

IMPORT_C void SetScaleFactorL ( const RWindow & aWindow,
TReal32 aWidthPercentage,
TReal32 aHeightPercentage
)

Scales the video image to a specified percentage of its original size within the window. This is the preferred method to use with CVideoPlayerUtility2 . Setting scale factor will set auto scale to EAutoScaleNone for the window.

The scale factor will replace any scale factor set with CVideoPlayerUtility::SetScaleFactorL . Likewise with setting the scale factor with CVideoPlayerUtility::SetScaleFactorL after a call to CVideoPlayerUtility2::SetScaleFactorL has been made, then the scale factor specified will replace any scale factor set with CVideoPlayerUtility2::SetScaleFactorL .

leave
KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
leave
KErrNotReady if controller hasn't been opened.
CVideoPlayerUtility::SetScaleFactorL

Parameters

const RWindow & aWindow Window to set scale factor for.
TReal32 aWidthPercentage The percentage (100 = original size) to be used to scale the width of the video image
TReal32 aHeightPercentage The percentage (100 = original size) to be used to scale the height of the video image. If this is not equal to aWidthPercentage then the image may be distorted.

SetVideoExtentL(const RWindow &, const TRect &)

IMPORT_C void SetVideoExtentL ( const RWindow & aWindow,
const TRect & aVideoExtent
)

Sets the video extent on the screen, relative to the window. The extent specifies the area of screen in which the video picture is placed, and may be partially or completely outside of the video window. Video picture position within the extent depends on the picture size and content alignment or offset.

This method can only be called after opening the source is complete and the client has received an MvpuoOpenComplete() callback.

leave
The method will leave if an error occurs. Typical error codes used: KErrNotReady if the source file, URL, or descriptor has not been opened.

Parameters

const RWindow & aWindow Window to set video extent for.
const TRect & aVideoExtent The new video extent, relative to the video window.

SetWindowClipRectL(const RWindow &, const TRect &)

IMPORT_C void SetWindowClipRectL ( const RWindow & aWindow,
const TRect & aWindowClipRect
)

Sets the window clipping rectangle, relative to the window. The clipping rectangle specifies the part of the window used to display the video picture and must be fully contained within the window.

This method can only be called after opening the source is complete and the client has received an MvpuoOpenComplete() callback.

leave
The method will leave if an error occurs. Typical error codes used: KErrArgument if the rectangle is not contained within the window. KErrNotReady if the source file, URL, or descriptor has not been opened.

Parameters

const RWindow & aWindow Window to set clipping rectangle for.
const TRect & aWindowClipRect The clipping rectangle to use for this window.