mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-19 07:01:02 +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_PlaneId(0),
|
||||
m_CurrentFbId(0),
|
||||
m_LastFullRange(false),
|
||||
m_LastColorSpace(-1),
|
||||
m_Plane(nullptr),
|
||||
m_ColorEncodingProp(nullptr),
|
||||
m_ColorRangeProp(nullptr),
|
||||
@@ -1251,12 +1249,9 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||
return;
|
||||
}
|
||||
|
||||
int colorspace = getFrameColorspace(frame);
|
||||
bool fullRange = isFrameFullRange(frame);
|
||||
|
||||
// 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) {
|
||||
if (hasFrameFormatChanged(frame)) {
|
||||
// Set COLOR_RANGE property for the plane
|
||||
{
|
||||
const char* desiredValue = getDrmColorRangeValue(frame);
|
||||
|
||||
if (m_ColorRangeProp != nullptr && desiredValue != nullptr) {
|
||||
@@ -1294,11 +1289,10 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"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);
|
||||
|
||||
if (m_ColorEncodingProp != nullptr && desiredValue != nullptr) {
|
||||
@@ -1336,8 +1330,7 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"COLOR_ENCODING property does not exist on output plane. Colors may be inaccurate!");
|
||||
}
|
||||
|
||||
m_LastColorSpace = colorspace;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the overlay
|
||||
|
||||
@@ -95,8 +95,6 @@ private:
|
||||
uint32_t m_CrtcId;
|
||||
uint32_t m_PlaneId;
|
||||
uint32_t m_CurrentFbId;
|
||||
bool m_LastFullRange;
|
||||
int m_LastColorSpace;
|
||||
drmModePlanePtr m_Plane;
|
||||
drmModePropertyPtr m_ColorEncodingProp;
|
||||
drmModePropertyPtr m_ColorRangeProp;
|
||||
|
||||
Reference in New Issue
Block a user