mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
qtdemux: add support for 'generic' samples
Add support for stuffing a complete stream into 1 sample. See https://bugzilla.gnome.org/show_bug.cgi?id=686550
This commit is contained in:
parent
ff33d8d263
commit
199aaa4021
2 changed files with 47 additions and 1 deletions
|
@ -431,6 +431,10 @@ static GstCaps *qtdemux_audio_caps (GstQTDemux * qtdemux,
|
|||
static GstCaps *qtdemux_sub_caps (GstQTDemux * qtdemux,
|
||||
QtDemuxStream * stream, guint32 fourcc, const guint8 * data,
|
||||
gchar ** codec_name);
|
||||
static GstCaps *qtdemux_generic_caps (GstQTDemux * qtdemux,
|
||||
QtDemuxStream * stream, guint32 fourcc, const guint8 * stsd_data,
|
||||
gchar ** codec_name);
|
||||
|
||||
static gboolean qtdemux_parse_samples (GstQTDemux * qtdemux,
|
||||
QtDemuxStream * stream, guint32 n);
|
||||
static GstFlowReturn qtdemux_expose_streams (GstQTDemux * qtdemux);
|
||||
|
@ -5214,6 +5218,13 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
|
|||
gst_pad_new_from_static_template (&gst_qtdemux_subsrc_template, name);
|
||||
g_free (name);
|
||||
qtdemux->n_sub_streams++;
|
||||
} else if (stream->caps) {
|
||||
gchar *name = g_strdup_printf ("video_%u", qtdemux->n_video_streams);
|
||||
|
||||
stream->pad =
|
||||
gst_pad_new_from_static_template (&gst_qtdemux_videosrc_template, name);
|
||||
g_free (name);
|
||||
qtdemux->n_video_streams++;
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (qtdemux, "unknown stream type");
|
||||
goto done;
|
||||
|
@ -7506,7 +7517,22 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
goto unknown_stream;
|
||||
/* everything in 1 sample */
|
||||
stream->sampled = TRUE;
|
||||
|
||||
stream->caps =
|
||||
qtdemux_generic_caps (qtdemux, stream, fourcc, stsd_data, &codec);
|
||||
|
||||
if (stream->caps == NULL)
|
||||
goto unknown_stream;
|
||||
|
||||
if (codec) {
|
||||
list = gst_tag_list_new_empty ();
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_SUBTITLE_CODEC, codec, NULL);
|
||||
g_free (codec);
|
||||
codec = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* promote to sampled format */
|
||||
|
@ -9855,3 +9881,22 @@ qtdemux_sub_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
|||
}
|
||||
return caps;
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
qtdemux_generic_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||
guint32 fourcc, const guint8 * stsd_data, gchar ** codec_name)
|
||||
{
|
||||
GstCaps *caps;
|
||||
|
||||
switch (fourcc) {
|
||||
case GST_MAKE_FOURCC ('m', '1', 'v', ' '):
|
||||
_codec ("MPEG 1 video");
|
||||
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 1,
|
||||
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
||||
break;
|
||||
default:
|
||||
caps = NULL;
|
||||
break;
|
||||
}
|
||||
return caps;
|
||||
}
|
||||
|
|
|
@ -174,6 +174,7 @@ G_BEGIN_DECLS
|
|||
#define FOURCC_mp4s GST_MAKE_FOURCC('m','p','4','s')
|
||||
#define FOURCC_gama GST_MAKE_FOURCC('g','a','m','a')
|
||||
#define FOURCC_apcs GST_MAKE_FOURCC('a','p','c','s')
|
||||
#define FOURCC_m1v GST_MAKE_FOURCC('m','1','v',' ')
|
||||
|
||||
/* SVQ3 fourcc */
|
||||
#define FOURCC_SEQH GST_MAKE_FOURCC('S','E','Q','H')
|
||||
|
|
Loading…
Reference in a new issue