mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Use hasFrameFormatChanged() in DRMRenderer
This commit is contained in:
@@ -166,8 +166,6 @@ DrmRenderer::DrmRenderer(AVHWDeviceType hwDeviceType, IFFmpegRenderer *backendRe
|
|||||||
m_CrtcId(0),
|
m_CrtcId(0),
|
||||||
m_PlaneId(0),
|
m_PlaneId(0),
|
||||||
m_CurrentFbId(0),
|
m_CurrentFbId(0),
|
||||||
m_LastFullRange(false),
|
|
||||||
m_LastColorSpace(-1),
|
|
||||||
m_Plane(nullptr),
|
m_Plane(nullptr),
|
||||||
m_ColorEncodingProp(nullptr),
|
m_ColorEncodingProp(nullptr),
|
||||||
m_ColorRangeProp(nullptr),
|
m_ColorRangeProp(nullptr),
|
||||||
@@ -1251,12 +1249,9 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int colorspace = getFrameColorspace(frame);
|
if (hasFrameFormatChanged(frame)) {
|
||||||
bool fullRange = isFrameFullRange(frame);
|
// Set COLOR_RANGE property for the plane
|
||||||
|
{
|
||||||
// We also update the color range when the colorspace changes in order to handle initialization
|
|
||||||
// where the last color range value may not actual be applied to the plane.
|
|
||||||
if (fullRange != m_LastFullRange || colorspace != m_LastColorSpace) {
|
|
||||||
const char* desiredValue = getDrmColorRangeValue(frame);
|
const char* desiredValue = getDrmColorRangeValue(frame);
|
||||||
|
|
||||||
if (m_ColorRangeProp != nullptr && desiredValue != nullptr) {
|
if (m_ColorRangeProp != nullptr && desiredValue != nullptr) {
|
||||||
@@ -1294,11 +1289,10 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
|||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"COLOR_RANGE property does not exist on output plane. Colors may be inaccurate!");
|
"COLOR_RANGE property does not exist on output plane. Colors may be inaccurate!");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_LastFullRange = fullRange;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colorspace != m_LastColorSpace) {
|
// Set COLOR_ENCODING property for the plane
|
||||||
|
{
|
||||||
const char* desiredValue = getDrmColorEncodingValue(frame);
|
const char* desiredValue = getDrmColorEncodingValue(frame);
|
||||||
|
|
||||||
if (m_ColorEncodingProp != nullptr && desiredValue != nullptr) {
|
if (m_ColorEncodingProp != nullptr && desiredValue != nullptr) {
|
||||||
@@ -1336,8 +1330,7 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
|||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"COLOR_ENCODING property does not exist on output plane. Colors may be inaccurate!");
|
"COLOR_ENCODING property does not exist on output plane. Colors may be inaccurate!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_LastColorSpace = colorspace;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the overlay
|
// Update the overlay
|
||||||
|
|||||||
@@ -95,8 +95,6 @@ private:
|
|||||||
uint32_t m_CrtcId;
|
uint32_t m_CrtcId;
|
||||||
uint32_t m_PlaneId;
|
uint32_t m_PlaneId;
|
||||||
uint32_t m_CurrentFbId;
|
uint32_t m_CurrentFbId;
|
||||||
bool m_LastFullRange;
|
|
||||||
int m_LastColorSpace;
|
|
||||||
drmModePlanePtr m_Plane;
|
drmModePlanePtr m_Plane;
|
||||||
drmModePropertyPtr m_ColorEncodingProp;
|
drmModePropertyPtr m_ColorEncodingProp;
|
||||||
drmModePropertyPtr m_ColorRangeProp;
|
drmModePropertyPtr m_ColorRangeProp;
|
||||||
|
|||||||
Reference in New Issue
Block a user