You.i Engine
YiVideoSurfaceView.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_VIDEO_SURFACE_VIEW_H_
3 #define _YI_VIDEO_SURFACE_VIEW_H_
4 
5 #include "utility/YiColor.h"
6 #include "view/YiSceneView.h"
7 
8 class CYIAssetTexture;
9 class CYIClosedCaptionsSceneNode;
11 class CYISceneNode;
12 class CYIVideoSurface;
14 
32 {
33 public:
37  enum FIT_MODE
38  {
40  };
41 
44 
45  virtual bool Init() override;
46 
61  void SetVideoSurface(CYIVideoSurface *pVideoSurface);
62 
63 protected:
67  static bool ApplyVideoToNode(CYISceneNode *pVideoNode, CYIVideoSurfaceTexture *pVideoSurface);
68 
72  float GetViewWorldAspectRatio() const;
73 
77  float GetVideoAspectRatio() const;
78 
79  virtual void UpdateBegin() override;
80  virtual void UpdateEnd() override;
81 
82 private:
83  void SurfaceSizeChanged(const glm::ivec2 &surfaceSize);
84 
90  void LetterboxVideo(float fVideoAspectRatio, float fViewAspectRatio);
91 
92  void ResizePlatformSurface();
93 
94  CYIVideoSurface *m_pVideoSurface;
95  CYIClosedCaptionsSceneNode *m_pClosedCaptionsNode;
96  CYISceneNode *m_pVideoNode;
97  bool m_bRenderingToTexture;
98 
99  FIT_MODE m_eFitMode;
100 
102 };
103 
104 #endif // _YI_VIDEO_SURFACE_VIEW_H_
FIT_MODE
Specifies how the video frame will be made to fit the view when the video aspect ratio is different f...
Definition: YiVideoSurfaceView.h:37
Definition: YiVideoSurfaceView.h:39
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:47
A texture asset representing an image which will be loaded into the GPU.
Definition: YiAssetTexture.h:23
static bool ApplyVideoToNode(CYISceneNode *pVideoNode, CYIVideoSurfaceTexture *pVideoSurface)
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
void SetVideoSurface(CYIVideoSurface *pVideoSurface)
float GetViewWorldAspectRatio() const
float GetVideoAspectRatio() const
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:114
virtual void UpdateBegin() override
virtual bool Init() override
Definition: YiPerspectiveCameraSceneNode.h:39
virtual void UpdateEnd() override
Representation of a CYIAbstractVideoPlayer's video surface, if the player is rendering to a texture...
Definition: YiVideoSurfaceTexture.h:17
Representation of a CYIAbstractVideoPlayer's video surface.
Definition: YiVideoSurface.h:34
View representation of a CYIAbstractVideoPlayer's CYIVideoSurface.
Definition: YiVideoSurfaceView.h:31