+qtdemux_meta_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
+ QtDemuxStreamStsdEntry * entry, guint32 fourcc,
+ const guint8 * stsd_entry_data, gchar ** codec_name)
+{
+ GstCaps *caps = NULL;
+
+ GST_DEBUG_OBJECT (qtdemux, "resolve fourcc 0x%08x", GUINT32_TO_BE (fourcc));
+
+ switch (fourcc) {
+ case FOURCC_metx:{
+ gsize size = QT_UINT32 (stsd_entry_data);
+ GstByteReader reader = GST_BYTE_READER_INIT (stsd_entry_data, size);
+ const gchar *content_encoding;
+ const gchar *namespaces;
+ const gchar *schema_locations;
+
+ if (!gst_byte_reader_skip (&reader, 8 + 6 + 2)) {
+ GST_WARNING_OBJECT (qtdemux, "Too short metx sample entry");
+ break;
+ }
+
+ if (!gst_byte_reader_get_string (&reader, &content_encoding) ||
+ !gst_byte_reader_get_string (&reader, &namespaces) ||
+ !gst_byte_reader_get_string (&reader, &schema_locations)) {
+ GST_WARNING_OBJECT (qtdemux, "Too short metx sample entry");
+ break;
+ }
+
+ if (strstr (namespaces, "http://www.onvif.org/ver10/schema") != 0) {
+ if (content_encoding == NULL || *content_encoding == '\0'
+ || g_ascii_strcasecmp (content_encoding, "xml") == 0) {
+ _codec ("ONVIF Timed XML MetaData");
+ caps =
+ gst_caps_new_simple ("application/x-onvif-metadata", "parsed",
+ G_TYPE_BOOLEAN, TRUE, NULL);
+ } else {
+ GST_DEBUG_OBJECT (qtdemux, "Unknown content encoding: %s",
+ content_encoding);
+ }
+ } else {
+ GST_DEBUG_OBJECT (qtdemux, "Unknown metadata namespaces: %s",
+ namespaces);
+ }
+
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (!caps)
+ caps = _get_unknown_codec_name ("meta", fourcc);
+
+ return caps;
+}
+
+static GstCaps *