qtdemux: create correct pad names in encrypted streams

Refer to "original-media-type" when setting stream's subtype
for encrypted streams in mss mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/628>
This commit is contained in:
Hosang Lee 2020-06-16 17:23:44 +09:00 committed by GStreamer Merge Bot
parent 18aeb5bac1
commit f8e686078d

View file

@ -1925,6 +1925,16 @@ gst_qtdemux_setcaps (GstQTDemux * demux, GstCaps * caps)
&CUR_STREAM (stream)->n_channels);
gst_structure_get_int (structure, "rate", &rate);
CUR_STREAM (stream)->rate = rate;
} else if (gst_structure_has_name (structure, "application/x-cenc")) {
if (gst_structure_has_field (structure, "original-media-type")) {
const gchar *media_type =
gst_structure_get_string (structure, "original-media-type");
if (g_str_has_prefix (media_type, "video")) {
stream->subtype = FOURCC_vide;
} else if (g_str_has_prefix (media_type, "audio")) {
stream->subtype = FOURCC_soun;
}
}
}
}
gst_caps_replace (&demux->media_caps, (GstCaps *) mediacaps);