From f8e686078dc6bfaf48c269e0dda11894653dc6a7 Mon Sep 17 00:00:00 2001 From: Hosang Lee Date: Tue, 16 Jun 2020 17:23:44 +0900 Subject: [PATCH] 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: --- gst/isomp4/qtdemux.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 93ebef2133..5b79ace9bb 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -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);