diff options
author | Philippe Normand <philn@igalia.com> | 2021-07-12 12:08:20 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-07-15 13:05:54 +0000 |
commit | bc09d8cc6669a6d3403139fae38c5b34a094773b (patch) | |
tree | 49c8fef23b78e24b6a5f660980e3208e035bcf0b /ext | |
parent | ff0e42eb30a5b9ebc31b57f06b1c78cd6a419002 (diff) | |
download | gstreamer-plugins-bad-bc09d8cc6669a6d3403139fae38c5b34a094773b.tar.gz |
dash: Store entire ContentProtection node in protection event data
Some manifests use the ContentProtection node to store additional information
such as the license server url. Our MPD parser used to process the
ContentProtection node, extracting Playready PSSH boxes. However for other DRM
systems, only the `value` attribute was passed down to the protection event, so
for example, Widevine data was not parsed at all and "Widevine" was passed to
the event, which is not very useful for decryptors that require a PSSH init
data.
Parsing should now be done by decryptors which will receive the entire
ContentProtection XML node as a string. This gives more "freedom" to the
decryptor which can then detect and parse custom nodes as well.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2400>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dash/gstmpdparser.c | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 8cd285871..f88bb6c80 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -503,35 +503,14 @@ error: static void gst_mpdparser_parse_content_protection_node (GList ** list, xmlNode * a_node) { - gchar *value = NULL; - if (gst_xml_helper_get_prop_string (a_node, "value", &value)) { - if (!g_strcmp0 (value, "MSPR 2.0")) { - xmlNode *cur_node; - for (cur_node = a_node->children; cur_node; cur_node = cur_node->next) { - if (cur_node->type == XML_ELEMENT_NODE) { - if (xmlStrcmp (cur_node->name, (xmlChar *) "pro") == 0) { - GstMPDDescriptorTypeNode *new_descriptor; - new_descriptor = gst_mpd_descriptor_type_node_new ((const gchar *) - cur_node->name); - *list = g_list_append (*list, new_descriptor); - - gst_xml_helper_get_prop_string_stripped (a_node, "schemeIdUri", - &new_descriptor->schemeIdUri); - - gst_xml_helper_get_node_content (cur_node, &new_descriptor->value); - goto beach; - } - } - } - } else { - gst_mpdparser_parse_descriptor_type (list, a_node); - } - } else { - gst_mpdparser_parse_descriptor_type (list, a_node); - } -beach: - if (value) - g_free (value); + GstMPDDescriptorTypeNode *new_descriptor; + new_descriptor = gst_mpd_descriptor_type_node_new ((const gchar *) + a_node->name); + *list = g_list_append (*list, new_descriptor); + + gst_xml_helper_get_prop_string_stripped (a_node, "schemeIdUri", + &new_descriptor->schemeIdUri); + gst_xml_helper_get_node_as_string (a_node, &new_descriptor->value); } static void |