mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
videodecoder: Forward upstream HDR information to downstream
The HDR related information is not part of GstVideoInfo but should be passed to downstream.
This commit is contained in:
parent
630d3c3d12
commit
3e460766e8
1 changed files with 27 additions and 0 deletions
|
@ -3792,6 +3792,7 @@ gst_video_decoder_negotiate_default (GstVideoDecoder * decoder)
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GstVideoCodecFrame *frame;
|
GstVideoCodecFrame *frame;
|
||||||
GstCaps *prevcaps;
|
GstCaps *prevcaps;
|
||||||
|
GstCaps *incaps;
|
||||||
|
|
||||||
if (!state) {
|
if (!state) {
|
||||||
GST_DEBUG_OBJECT (decoder,
|
GST_DEBUG_OBJECT (decoder,
|
||||||
|
@ -3819,6 +3820,32 @@ gst_video_decoder_negotiate_default (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
if (state->caps == NULL)
|
if (state->caps == NULL)
|
||||||
state->caps = gst_video_info_to_caps (&state->info);
|
state->caps = gst_video_info_to_caps (&state->info);
|
||||||
|
|
||||||
|
incaps = gst_pad_get_current_caps (GST_VIDEO_DECODER_SINK_PAD (decoder));
|
||||||
|
if (incaps) {
|
||||||
|
GstStructure *in_struct;
|
||||||
|
|
||||||
|
in_struct = gst_caps_get_structure (incaps, 0);
|
||||||
|
if (gst_structure_has_field (in_struct, "mastering-display-info") ||
|
||||||
|
gst_structure_has_field (in_struct, "content-light-level")) {
|
||||||
|
const gchar *s;
|
||||||
|
|
||||||
|
/* prefer upstream information */
|
||||||
|
state->caps = gst_caps_make_writable (state->caps);
|
||||||
|
if ((s = gst_structure_get_string (in_struct, "mastering-display-info"))) {
|
||||||
|
gst_caps_set_simple (state->caps,
|
||||||
|
"mastering-display-info", G_TYPE_STRING, s, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((s = gst_structure_get_string (in_struct, "content-light-level"))) {
|
||||||
|
gst_caps_set_simple (state->caps,
|
||||||
|
"content-light-level", G_TYPE_STRING, s, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_caps_unref (incaps);
|
||||||
|
}
|
||||||
|
|
||||||
if (state->allocation_caps == NULL)
|
if (state->allocation_caps == NULL)
|
||||||
state->allocation_caps = gst_caps_ref (state->caps);
|
state->allocation_caps = gst_caps_ref (state->caps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue