From 05b1ad1b56ab567596f8162391c55a09c3cb3b58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 15 Apr 2012 22:39:36 +0100 Subject: [PATCH] ogg: update for media type typefinding changes --- ext/ogg/gstoggdemux.c | 4 +++- ext/ogg/gstoggmux.c | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index bc715ae..cc09cf3 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1915,7 +1915,9 @@ static GstStaticPadTemplate ogg_demux_sink_template_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("application/ogg; application/x-annodex") + GST_STATIC_CAPS ("application/ogg; audio/ogg; video/ogg; " + "application/annodex; audio/annodex; video/annodex; " + "application/kate") ); static void gst_ogg_demux_finalize (GObject * object); diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 29060b8..74090b3 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -97,7 +97,7 @@ enum static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("application/ogg") + GST_STATIC_CAPS ("application/ogg; audio/ogg; video/ogg") ); static GstStaticPadTemplate video_sink_factory = @@ -1521,11 +1521,18 @@ gst_ogg_mux_send_headers (GstOggMux * mux) /* hbufs holds all buffers for the headers now */ /* create caps with the buffers */ - caps = gst_pad_query_caps (mux->srcpad, NULL); + /* FIXME: should prefer media type audio/ogg, video/ogg, etc. depending on + * what we create, if acceptable downstream (instead of defaulting to + * application/ogg because that's the first in the template caps) */ + caps = gst_pad_get_allowed_caps (mux->srcpad); if (caps) { - caps = gst_ogg_mux_set_header_on_caps (caps, hbufs); - gst_pad_set_caps (mux->srcpad, caps); - gst_caps_unref (caps); + if (!gst_caps_is_fixed (caps)) + caps = gst_caps_fixate (caps); + if (caps) { + caps = gst_ogg_mux_set_header_on_caps (caps, hbufs); + gst_pad_set_caps (mux->srcpad, caps); + gst_caps_unref (caps); + } } /* and send the buffers */ while (hbufs != NULL) { -- 2.7.4