You.i Engine
YiVideoSurface.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_VIDEO_SURFACE_H_
3 #define _YI_VIDEO_SURFACE_H_
4 
5 #include "signal/YiSignal.h"
7 
8 #include <glm/vec2.hpp>
9 
10 class CYIAssetTexture;
12 class CYIMaterial;
13 class CYISceneNodeProxy;
15 
35 {
36  friend class CYIVideoSurfaceView; //For attach/detach callbacks
37 
38 public:
39  enum class Capabilities
40  {
41  None = 0x00,
42  RenderToTexture = 0x01,
43  MultipleViews = 0x02,
44  Translate = 0x04,
45  Scale = 0x08,
46  FreeTransform = 0x10,
47  Opacity = 0x20
48  };
49 
50  virtual ~CYIVideoSurface();
51 
59  virtual void Init();
60 
67 
72 
77 
81  const glm::ivec2 &GetSize() const;
82 
88  void SetSize(const glm::ivec2 &videoSize);
89 
94 
95 protected:
96  CYIVideoSurface(Capabilities capabilities);
97 
103  virtual void OnAttached(CYIVideoSurfaceView *pVideoSurfaceView);
104 
110  virtual void OnDetached(CYIVideoSurfaceView *pVideoSurfaceView);
111 
112 private:
113  CYIVideoSurface();
114  void DetachFromSurfaceView();
115 
116  Capabilities m_capabilities;
117  glm::ivec2 m_videoSize;
119  CYIClosedCaptionsDispatcher *m_pClosedCaptionsDispatcher;
120  std::shared_ptr<CYISceneNodeProxy> m_pAttachedSurfaceView;
121 };
122 
127 template<>
129 {
130  static const bool enable = true;
131 };
132 
133 #endif
Capabilities
Definition: YiVideoSurface.h:39
If this capability is reported the video data will be rendered into the m_pVideoTexture member variab...
CYISignal< const glm::ivec2 & > SizeChanged
Definition: YiVideoSurface.h:93
A texture asset representing an image which will be loaded into the GPU.
Definition: YiAssetTexture.h:21
const glm::ivec2 & GetSize() const
CYIMaterial is a place holder for all the drawing parameters required by the renderer to draw a mesh/...
Definition: YiMaterial.h:29
virtual void OnAttached(CYIVideoSurfaceView *pVideoSurfaceView)
A struct used to enable bitmask operators for an enum class type.
Definition: YiEnumBitmaskOperators.h:26
A class used to proxy access to a CYISceneNode.
Definition: YiSceneNodeProxy.h:26
virtual void OnDetached(CYIVideoSurfaceView *pVideoSurfaceView)
Capabilities GetCapabilities() const
If this capability is reported the video surface may be scaled freely.
If this capability is reported the video surface is capable of being translated around on the screen...
void SetClosedCaptionsDispatcher(CYIClosedCaptionsDispatcher *pDispatcher)
Dispatches closed captioning cues to registered captions renderers.
Definition: YiClosedCaptionsDispatcher.h:27
If this capability is reported the video surface can be blended with the rest of the scene...
virtual ~CYIVideoSurface()
CYIClosedCaptionsDispatcher * GetClosedCaptionsDispatcher() const
virtual void Init()
If this capability is reported the video surface may be freely transformed in 3-dimensions like any o...
Signals and slots are a thread-safe and flexible communication framework that will allow various obje...
Definition: YiSignal.h:169
void SetSize(const glm::ivec2 &videoSize)
If this capability is reported the surface can be displayed in multiple CYIVideoSurfaceViews.
No capabilities. This can be used to initialize variables.
Representation of a CYIAbstractVideoPlayer&#39;s video surface.
Definition: YiVideoSurface.h:34
View representation of a CYIAbstractVideoPlayer&#39;s CYIVideoSurface.
Definition: YiVideoSurfaceView.h:32