Add logging for cases where color range/encoding cannot be set
This commit is contained in:
parent
b45c3e3c7f
commit
99495cff90
1 changed files with 26 additions and 2 deletions
|
|
@ -569,7 +569,9 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||||
const char* desiredValue = getDrmColorRangeValue(frame);
|
const char* desiredValue = getDrmColorRangeValue(frame);
|
||||||
|
|
||||||
if (m_ColorRangeProp != nullptr && desiredValue != nullptr) {
|
if (m_ColorRangeProp != nullptr && desiredValue != nullptr) {
|
||||||
for (int i = 0; i < m_ColorRangeProp->count_enums; i++) {
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < m_ColorRangeProp->count_enums; i++) {
|
||||||
if (!strcmp(desiredValue, m_ColorRangeProp->enums[i].name)) {
|
if (!strcmp(desiredValue, m_ColorRangeProp->enums[i].name)) {
|
||||||
err = drmModeObjectSetProperty(m_DrmFd, m_PlaneId, DRM_MODE_OBJECT_PLANE,
|
err = drmModeObjectSetProperty(m_DrmFd, m_PlaneId, DRM_MODE_OBJECT_PLANE,
|
||||||
m_ColorRangeProp->prop_id, m_ColorRangeProp->enums[i].value);
|
m_ColorRangeProp->prop_id, m_ColorRangeProp->enums[i].value);
|
||||||
|
|
@ -590,6 +592,16 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i == m_ColorRangeProp->count_enums) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Unable to find matching COLOR_RANGE value for '%s'. Colors may be inaccurate!",
|
||||||
|
desiredValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (desiredValue != nullptr) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"COLOR_RANGE property does not exist on output plane. Colors may be inaccurate!");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_LastColorRange = frame->color_range;
|
m_LastColorRange = frame->color_range;
|
||||||
|
|
@ -599,7 +611,9 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||||
const char* desiredValue = getDrmColorEncodingValue(frame);
|
const char* desiredValue = getDrmColorEncodingValue(frame);
|
||||||
|
|
||||||
if (m_ColorEncodingProp != nullptr && desiredValue != nullptr) {
|
if (m_ColorEncodingProp != nullptr && desiredValue != nullptr) {
|
||||||
for (int i = 0; i < m_ColorEncodingProp->count_enums; i++) {
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < m_ColorEncodingProp->count_enums; i++) {
|
||||||
if (!strcmp(desiredValue, m_ColorEncodingProp->enums[i].name)) {
|
if (!strcmp(desiredValue, m_ColorEncodingProp->enums[i].name)) {
|
||||||
err = drmModeObjectSetProperty(m_DrmFd, m_PlaneId, DRM_MODE_OBJECT_PLANE,
|
err = drmModeObjectSetProperty(m_DrmFd, m_PlaneId, DRM_MODE_OBJECT_PLANE,
|
||||||
m_ColorEncodingProp->prop_id, m_ColorEncodingProp->enums[i].value);
|
m_ColorEncodingProp->prop_id, m_ColorEncodingProp->enums[i].value);
|
||||||
|
|
@ -620,6 +634,16 @@ void DrmRenderer::renderFrame(AVFrame* frame)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i == m_ColorEncodingProp->count_enums) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Unable to find matching COLOR_ENCODING value for '%s'. Colors may be inaccurate!",
|
||||||
|
desiredValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (desiredValue != nullptr) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"COLOR_ENCODING property does not exist on output plane. Colors may be inaccurate!");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_LastColorSpace = frame->colorspace;
|
m_LastColorSpace = frame->colorspace;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue