static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-matroska")
+ GST_STATIC_CAPS ("video/x-matroska; video/x-matroska-3d; audio/x-matroska")
);
#define COMMON_VIDEO_CAPS \
GST_MATROSKA_ID_TAGS,
0
};
+ const gchar *media_type;
+ gboolean audio_only;
guint64 master, child;
GSList *collected;
int i;
gst_query_unref (query);
}
+ audio_only = mux->num_v_streams == 0 && mux->num_a_streams > 0;
if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
- ebml->caps = gst_caps_new_empty_simple ("video/webm");
+ media_type = (audio_only) ? "audio/webm" : "video/webm";
} else {
- ebml->caps = gst_caps_new_empty_simple ("video/x-matroska");
+ media_type = (audio_only) ? "audio/x-matroska" : "video/x-matroska";
}
+ ebml->caps = gst_caps_new_empty_simple (media_type);
gst_pad_set_caps (mux->srcpad, ebml->caps);
/* we start with a EBML header */
doctype = mux->doctype;
cur = cur->next;
}
- gst_toc_entry_get_start_stop (((GstTocEntry *) toc_entry->
- subentries->data), &start, NULL);
+ gst_toc_entry_get_start_stop (((GstTocEntry *) toc_entry->subentries->
+ data), &start, NULL);
toc_entry->subentries = g_list_reverse (toc_entry->subentries);
- gst_toc_entry_get_start_stop (((GstTocEntry *) toc_entry->
- subentries->data), NULL, &stop);
+ gst_toc_entry_get_start_stop (((GstTocEntry *) toc_entry->subentries->
+ data), NULL, &stop);
gst_toc_entry_set_start_stop (toc_entry, start, stop);
to_write = g_list_append (to_write, toc_entry);
GstEbmlWrite *ebml = mux->ebml_write;
streamheader_buffer = gst_ebml_stop_streamheader (ebml);
- if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
- caps = gst_caps_new_empty_simple ("video/webm");
- } else {
- caps = gst_caps_new_empty_simple ("video/x-matroska");
- }
+ caps = gst_caps_copy (mux->ebml_write->caps);
s = gst_caps_get_structure (caps, 0);
g_value_init (&streamheader, GST_TYPE_ARRAY);
g_value_init (&bufval, GST_TYPE_BUFFER);
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-matroska; video/webm")
+ GST_STATIC_CAPS ("audio/x-matroska; video/x-matroska; "
+ "video/x-matroska-3d; audio/webm; video/webm")
);
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-matroska; video/webm")
+ GST_STATIC_CAPS ("audio/x-matroska; video/x-matroska; "
+ "video/x-matroska-3d; audio/webm; video/webm")
);
static GstFlowReturn gst_matroska_parse_parse_id (GstMatroskaParse * parse,
GValue bufval = { 0 };
GstBuffer *buf;
- caps = gst_caps_new_empty_simple ("video/x-matroska");
+ caps = gst_pad_get_current_caps (parse->common.sinkpad);
+ /* FIXME: could run typefinding over header and pick better default */
+ if (caps == NULL)
+ caps = gst_caps_new_empty_simple ("video/x-matroska");
+ else
+ caps = gst_caps_make_writable (caps);
+
s = gst_caps_get_structure (caps, 0);
g_value_init (&streamheader, GST_TYPE_ARRAY);
g_value_init (&bufval, GST_TYPE_BUFFER);