13 #include "system_gl.h" 15 #include "FrameBufferObject.h" 16 #include "cores/VideoSettings.h" 17 #include "RenderInfo.h" 18 #include "BaseRenderer.h" 19 #include "ColorManager.h" 20 #include "utils/Geometry.h" 23 #include <libavutil/mastering_display_metadata.h> 34 class BaseYUV2RGBGLSLShader;
35 class BaseVideoFilterShader;
63 static bool Register();
66 bool Configure(
const VideoPicture &picture,
float fps,
unsigned int orientation)
override;
67 bool IsConfigured()
override {
return m_bConfigured; }
68 void AddVideoPicture(
const VideoPicture &picture,
int index)
override;
69 void UnInit()
override;
70 bool Flush(
bool saveBuffers)
override;
71 void SetBufferSize(
int numBuffers)
override { m_NumYV12Buffers = numBuffers; }
72 void ReleaseBuffer(
int idx)
override;
73 void RenderUpdate(
int index,
int index2,
bool clear,
unsigned int flags,
unsigned int alpha)
override;
74 void Update()
override;
77 bool ConfigChanged(
const VideoPicture &picture)
override;
80 bool SupportsMultiPassRendering()
override;
81 bool Supports(ERENDERFEATURE feature)
const override;
82 bool Supports(ESCALINGMETHOD method)
const override;
88 bool Render(
unsigned int flags,
int renderBuffer);
89 void ClearBackBuffer();
92 bool ValidateRenderer();
93 virtual bool ValidateRenderTarget();
94 virtual void LoadShaders(
int field=FIELD_FULL);
95 void SetTextureFilter(GLenum method);
96 void UpdateVideoFilter();
97 void CheckVideoParameters(
int index);
98 AVColorPrimaries GetSrcPrimaries(AVColorPrimaries srcPrimaries,
unsigned int width,
unsigned int height);
101 virtual bool UploadTexture(
int index);
102 virtual void DeleteTexture(
int index);
103 virtual bool CreateTexture(
int index);
105 bool UploadYV12Texture(
int index);
106 void DeleteYV12Texture(
int index);
107 bool CreateYV12Texture(
int index);
109 bool UploadNV12Texture(
int index);
110 void DeleteNV12Texture(
int index);
111 bool CreateNV12Texture(
int index);
113 bool UploadYUV422PackedTexture(
int index);
114 void DeleteYUV422PackedTexture(
int index);
115 bool CreateYUV422PackedTexture(
int index);
117 void CalculateTextureSourceRects(
int source,
int num_planes);
120 void RenderToFBO(
int renderBuffer,
int field,
bool weave =
false);
121 void RenderFromFBO();
122 void RenderSinglePass(
int renderBuffer,
int field);
123 void RenderRGB(
int renderBuffer,
int field);
124 void RenderProgressiveWeave(
int renderBuffer,
int field);
131 void LoadPlane(
CYuvPlane& plane,
int type,
132 unsigned width,
unsigned height,
133 int stride,
int bpp,
void* data);
134 void GetPlaneTextureSize(
CYuvPlane& plane);
135 GLint GetInternalFormat(GLint format,
int bpp);
138 virtual bool LoadShadersHook() {
return false; }
139 virtual bool RenderHook(
int idx) {
return false; }
140 virtual void AfterRenderHook(
int idx) {}
141 virtual bool CanSaveBuffers() {
return true; }
149 int m_iYV12RenderBuffer = 0;
150 int m_NumYV12Buffers = 0;
152 bool m_bConfigured =
false;
153 bool m_bValidated =
false;
154 GLenum m_textureTarget = GL_TEXTURE_2D;
155 int m_renderMethod = RENDER_GLSL;
156 RenderQuality m_renderQuality = RQ_SINGLEPASS;
160 int m_currentField = FIELD_FULL;
161 int m_reloadShaders = 0;
173 unsigned pixpertex_x;
174 unsigned pixpertex_y;
182 CYuvPlane fields[MAX_FIELDS][YuvImage::MAX_PLANES];
189 AVColorPrimaries m_srcPrimaries;
190 AVColorSpace m_srcColSpace;
192 int m_srcTextureBits = 8;
195 bool hasDisplayMetadata =
false;
196 AVMasteringDisplayMetadata displayMetadata;
197 bool hasLightMetadata =
false;
198 AVContentLightMetadata lightMetadata;
207 ESCALINGMETHOD m_scalingMethod = VS_SCALINGMETHOD_LINEAR;
208 ESCALINGMETHOD m_scalingMethodGui = VS_SCALINGMETHOD_MAX;
210 unsigned int m_ditherDepth;
212 AVColorPrimaries m_srcPrimaries;
213 bool m_toneMap =
false;
214 ETONEMAPMETHOD m_toneMapMethod = VS_TONEMAPMETHOD_OFF;
215 float m_clearColour = 0.0f;
216 bool m_pboSupported =
true;
217 bool m_pboUsed =
false;
218 bool m_nonLinStretch =
false;
219 bool m_nonLinStretchGui =
false;
220 float m_pixelRatio = 0.0f;
224 std::unique_ptr<CColorManager> m_ColorManager;
Definition: VideoBuffer.h:85
Definition: RenderSystemGL.h:64
Definition: RenderCapture.h:23
Definition: RenderInfo.h:19
Definition: VideoBuffer.h:24
Definition: LinuxRendererGL.h:30
Definition: LinuxRendererGL.h:56
Definition: YUV2RGBShaderGL.h:31
Base texture class, subclasses of which depend on the render spec (DX, GL etc.)
Definition: Texture.h:34
Definition: VideoFilterShaderGL.h:22
Definition: DVDVideoCodec.h:36
Definition: LinuxRendererGL.h:163
Definition: BaseRenderer.h:48
Definition: FrameBufferObject.h:32
Definition: LinuxRendererGL.h:177