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.
#include <player/YiVideoSurface.h>
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) |
CYIClosedCaptionsDispatcher * | GetClosedCaptionsDispatcher () 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 |
|
strong |
|
virtual |
|
protected |
Capabilities CYIVideoSurface::GetCapabilities | ( | ) | const |
Returns the capabilities supported by the video surface.
CYIClosedCaptionsDispatcher* CYIVideoSurface::GetClosedCaptionsDispatcher | ( | ) | const |
Returns the closed captions dispatcher object owned by the associated video player.
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.
|
virtual |
Initializes the video surface, must be called before using the surface.
Reimplemented in CYIVideoSurfacePlatform, and CYIVideoSurfaceTexture.
|
protectedvirtual |
Called when the CYIVideoSurface has been attached to a CYIVideoSurfaceView.
Reimplemented in CYIVideoSurfacePlatform.
|
protectedvirtual |
Called when the CYIVideoSurface has been detached from a CYIVideoSurfaceView.
Reimplemented in CYIVideoSurfacePlatform.
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.
void CYIVideoSurface::SetSize | ( | const glm::ivec2 & | videoSize | ) |
Sets the size of the video surface view.
|
friend |
CYISignal<const glm::ivec2 &> CYIVideoSurface::SizeChanged |
Emitted when the size of the surface changes.