mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-04 23:30:05 +00:00
qtdemux: handle another mp4v variation
... including the glbl atom containing codec-data.
This commit is contained in:
parent
d8167e3071
commit
c7a8d672a7
2 changed files with 33 additions and 0 deletions
|
@ -3846,6 +3846,7 @@ qtdemux_parse_node (GstQTDemux * qtdemux, GNode * node, const guint8 * buffer,
|
|||
break;
|
||||
}
|
||||
case FOURCC_mp4v:
|
||||
case FOURCC_MP4V:
|
||||
{
|
||||
const guint8 *buf;
|
||||
guint32 version;
|
||||
|
@ -5325,6 +5326,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
|||
esds = NULL;
|
||||
pasp = NULL;
|
||||
mp4v = qtdemux_tree_get_child_by_type (stsd, FOURCC_mp4v);
|
||||
if (!mp4v)
|
||||
mp4v = qtdemux_tree_get_child_by_type (stsd, FOURCC_MP4V);
|
||||
/* H264 is MPEG-4 after all,
|
||||
* and qt seems to put MPEG-4 stuff in there as well */
|
||||
if (!mp4v)
|
||||
|
@ -5436,6 +5439,33 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
|||
|
||||
break;
|
||||
}
|
||||
case FOURCC_mp4v:
|
||||
case FOURCC_MP4V:
|
||||
{
|
||||
GNode *glbl;
|
||||
|
||||
GST_DEBUG_OBJECT (qtdemux, "found mp4v");
|
||||
|
||||
/* codec data might be in glbl extension atom */
|
||||
glbl = qtdemux_tree_get_child_by_type (mp4v, FOURCC_glbl);
|
||||
if (glbl) {
|
||||
guint8 *data;
|
||||
GstBuffer *buf;
|
||||
gint len;
|
||||
|
||||
GST_DEBUG_OBJECT (qtdemux, "found glbl data in stsd");
|
||||
data = glbl->data;
|
||||
len = QT_UINT32 (data);
|
||||
if (len > 0x8) {
|
||||
len -= 0x8;
|
||||
buf = gst_buffer_new_and_alloc (len);
|
||||
memcpy (GST_BUFFER_DATA (buf), data + 8, len);
|
||||
gst_caps_set_simple (stream->caps,
|
||||
"codec_data", GST_TYPE_BUFFER, buf, NULL);
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
case FOURCC_mjp2:
|
||||
{
|
||||
/* see annex I of the jpeg2000 spec */
|
||||
|
@ -7679,6 +7709,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
|||
caps = gst_caps_new_simple ("video/x-h263", NULL);
|
||||
break;
|
||||
case GST_MAKE_FOURCC ('m', 'p', '4', 'v'):
|
||||
case GST_MAKE_FOURCC ('M', 'P', '4', 'V'):
|
||||
_codec ("MPEG-4 video");
|
||||
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 4,
|
||||
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
||||
|
|
|
@ -74,6 +74,8 @@ G_BEGIN_DECLS
|
|||
#define FOURCC_hint GST_MAKE_FOURCC('h','i','n','t')
|
||||
#define FOURCC_mp4a GST_MAKE_FOURCC('m','p','4','a')
|
||||
#define FOURCC_mp4v GST_MAKE_FOURCC('m','p','4','v')
|
||||
#define FOURCC_MP4V GST_MAKE_FOURCC('M','P','4','V')
|
||||
#define FOURCC_glbl GST_MAKE_FOURCC('g','l','b','l')
|
||||
#define FOURCC_wave GST_MAKE_FOURCC('w','a','v','e')
|
||||
#define FOURCC_appl GST_MAKE_FOURCC('a','p','p','l')
|
||||
#define FOURCC_esds GST_MAKE_FOURCC('e','s','d','s')
|
||||
|
|
Loading…
Reference in a new issue