mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 17:05:52 +00:00
compositor: Warn when inputs are SDR/HDR mixed
Let user know that the result of mixed SDR/HDR is not guaranteed to be a good visual quality. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1486>
This commit is contained in:
parent
56d47f641f
commit
648739012a
1 changed files with 38 additions and 0 deletions
|
@ -1389,6 +1389,10 @@ _negotiated_caps (GstAggregator * agg, GstCaps * caps)
|
||||||
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
||||||
GstVideoInfo v_info;
|
GstVideoInfo v_info;
|
||||||
guint n_threads;
|
guint n_threads;
|
||||||
|
GList *iter;
|
||||||
|
guint n_sdr = 0;
|
||||||
|
guint n_hlg = 0;
|
||||||
|
guint n_pq = 0;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (agg, "Negotiated caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (agg, "Negotiated caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
@ -1400,6 +1404,40 @@ _negotiated_caps (GstAggregator * agg, GstCaps * caps)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (vagg);
|
||||||
|
for (iter = GST_ELEMENT (vagg)->sinkpads; iter; iter = g_list_next (iter)) {
|
||||||
|
GstVideoAggregatorPad *pad = (GstVideoAggregatorPad *) iter->data;
|
||||||
|
|
||||||
|
if (!pad->info.finfo)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
switch (pad->info.colorimetry.transfer) {
|
||||||
|
case GST_VIDEO_TRANSFER_SMPTE2084:
|
||||||
|
n_pq++;
|
||||||
|
break;
|
||||||
|
case GST_VIDEO_TRANSFER_ARIB_STD_B67:
|
||||||
|
n_hlg++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
n_sdr++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GST_OBJECT_UNLOCK (vagg);
|
||||||
|
|
||||||
|
/* TODO: we don't have support for HDR tone-mapping, so mixing HDR/SDR might
|
||||||
|
* result in somewhat visually bad image. Needs enhancement to the
|
||||||
|
* video-convert or somewhere */
|
||||||
|
if (n_sdr > 0) {
|
||||||
|
if (n_hlg > 0 || n_pq > 0) {
|
||||||
|
GST_ELEMENT_WARNING (compositor, STREAM, NOT_IMPLEMENTED,
|
||||||
|
("Mixing SDR and HDR contents would result in color loss"), (NULL));
|
||||||
|
}
|
||||||
|
} else if (n_hlg > 0 && n_pq > 0) {
|
||||||
|
GST_ELEMENT_WARNING (compositor, STREAM, NOT_IMPLEMENTED,
|
||||||
|
("Mixing HDR10 and HLG contents would result in color loss"), (NULL));
|
||||||
|
}
|
||||||
|
|
||||||
if (compositor->max_threads == 0)
|
if (compositor->max_threads == 0)
|
||||||
n_threads = g_get_num_processors ();
|
n_threads = g_get_num_processors ();
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue