You.i Engine
YiVideoSurface.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. 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 
55  virtual void Init();
56 
63 
68 
73 
77  const glm::ivec2 &GetSize() const;
78 
84  void SetSize(const glm::ivec2 &videoSize);
85 
90 
91 protected:
92  CYIVideoSurface(Capabilities capabilities);
93 
99  virtual void OnAttached(CYIVideoSurfaceView *pVideoSurfaceView);
100 
106  virtual void OnDetached(CYIVideoSurfaceView *pVideoSurfaceView);
107 
108 private:
109  CYIVideoSurface();
110  void DetachFromSurfaceView();
111 
112  Capabilities m_capabilities;
113  glm::ivec2 m_videoSize;
115  CYIClosedCaptionsDispatcher *m_pClosedCaptionsDispatcher;
116  std::shared_ptr<CYISceneNodeProxy> m_pAttachedSurfaceView;
117 };
118 
123 template<>
125 {
126  static const bool enable = true;
127 };
128 
129 #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:89
A texture asset representing an image which will be loaded into the GPU.
Definition: YiAssetTexture.h:22
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:26
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:168
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