You.i Engine
CYIVideoSurface Class Reference

Detailed Description

Representation of a CYIAbstractVideoPlayer's video surface.

The CYIVideoSurface represents visual information associated with a CYIAbstractVideoPlayer. It contains information about the video's size and location, and if applicable it also contains the video buffer's data in a texture for display by the user. This class also contains a reference to a CYIClosedCaptionsDispatcher instance if the player requires the CYIVideoSurfaceView to render closed captions.

The Capabilities describe the features supported by the underlying video player and platform. Application developers should query and respect the capabilities of the surface in their code.

In order to display the video in your user interface you must assign the CYIVideoSurface to a CYIVideoSurfaceView. This CYIVideoSurfaceView may have design limitations imposed on it by the Capabilities and these must be taken into consideration during the design of the interface, for more information see CYIVideoSurfaceView.

See also
CYIVideoSurfaceView
CYIAbstractVideoPlayer

#include <player/YiVideoSurface.h>

Inheritance diagram for CYIVideoSurface:

Public Types

enum  Capabilities {
  Capabilities::None = 0x00,
  Capabilities::RenderToTexture = 0x01,
  Capabilities::MultipleViews = 0x02,
  Capabilities::Translate = 0x04,
  Capabilities::Scale = 0x08,
  Capabilities::FreeTransform = 0x10,
  Capabilities::Opacity = 0x20
}
 

Public Member Functions

virtual ~CYIVideoSurface ()
 
virtual void Init ()
 
Capabilities GetCapabilities () const
 
void SetClosedCaptionsDispatcher (CYIClosedCaptionsDispatcher *pDispatcher)
 
CYIClosedCaptionsDispatcherGetClosedCaptionsDispatcher () const
 
const glm::ivec2 & GetSize () const
 
void SetSize (const glm::ivec2 &videoSize)
 

Public Attributes

CYISignal< const glm::ivec2 & > SizeChanged
 

Protected Member Functions

 CYIVideoSurface (Capabilities capabilities)
 
virtual void OnAttached (CYIVideoSurfaceView *pVideoSurfaceView)
 
virtual void OnDetached (CYIVideoSurfaceView *pVideoSurfaceView)
 

Friends

class CYIVideoSurfaceView
 

Member Enumeration Documentation

◆ Capabilities

Enumerator
None 

No capabilities. This can be used to initialize variables.

RenderToTexture 

If this capability is reported the video data will be rendered into the m_pVideoTexture member variable. Otherwise, the actual video data is being rendered outside of You.i Engine.

MultipleViews 

If this capability is reported the surface can be displayed in multiple CYIVideoSurfaceViews.

Translate 

If this capability is reported the video surface is capable of being translated around on the screen.

Scale 

If this capability is reported the video surface may be scaled freely.

FreeTransform 

If this capability is reported the video surface may be freely transformed in 3-dimensions like any other view.

Opacity 

If this capability is reported the video surface can be blended with the rest of the scene.

Constructor & Destructor Documentation

◆ ~CYIVideoSurface()

virtual CYIVideoSurface::~CYIVideoSurface ( )
virtual

◆ CYIVideoSurface()

CYIVideoSurface::CYIVideoSurface ( Capabilities  capabilities)
protected

Member Function Documentation

◆ GetCapabilities()

Capabilities CYIVideoSurface::GetCapabilities ( ) const

Returns the capabilities supported by the video surface.

See also
Capabilities

◆ GetClosedCaptionsDispatcher()

CYIClosedCaptionsDispatcher* CYIVideoSurface::GetClosedCaptionsDispatcher ( ) const

Returns the closed captions dispatcher object owned by the associated video player.

◆ GetSize()

const glm::ivec2& CYIVideoSurface::GetSize ( ) const

Returns the size of the video buffer contents. This is the native resolution of the video being rendered, and may vary from the size of the view in which this surface is displayed.

◆ Init()

virtual void CYIVideoSurface::Init ( )
virtual

On

See also
CYIVideoSurfaceTexture types, the material and texture will be initialized here.

Reimplemented in CYIVideoSurfaceTexture.

◆ OnAttached()

virtual void CYIVideoSurface::OnAttached ( CYIVideoSurfaceView pVideoSurfaceView)
protectedvirtual

Called when the CYIVideoSurface has been attached to a CYIVideoSurfaceView.

Note
Subclasses must call the parent OnAttached function.

Reimplemented in CYIVideoSurfacePlatform.

◆ OnDetached()

virtual void CYIVideoSurface::OnDetached ( CYIVideoSurfaceView pVideoSurfaceView)
protectedvirtual

Called when the CYIVideoSurface has been detached from a CYIVideoSurfaceView.

Note
Subclasses must call the parent OnDetached function.

Reimplemented in CYIVideoSurfacePlatform.

◆ SetClosedCaptionsDispatcher()

void CYIVideoSurface::SetClosedCaptionsDispatcher ( CYIClosedCaptionsDispatcher pDispatcher)

Sets the closed captions dispatcher used by this object to pDispatcher. Video players that make use of in-engine closed captions rendering must call this function.

◆ SetSize()

void CYIVideoSurface::SetSize ( const glm::ivec2 &  videoSize)

Sets the size of the video surface view.

Note
Should only be called by CYIAbstractVideoPlayer or custom player implementations. The size of the video surface should represent the native resolution of the video asset. This can change as new assets are loaded into the player.

Friends And Related Function Documentation

◆ CYIVideoSurfaceView

friend class CYIVideoSurfaceView
friend

Member Data Documentation

◆ SizeChanged

CYISignal<const glm::ivec2 &> CYIVideoSurface::SizeChanged

Emitted when the size of the surface changes.


The documentation for this class was generated from the following file: