From 9488ef376435486d8e9bcaceb3046cb302396b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 22 Dec 2008 20:56:10 +0000 Subject: [PATCH] gst/mxf/mxfmpeg.c: Add initial support for h.264 video (SMPTE RP2008). Original commit message from CVS: * gst/mxf/mxfmpeg.c: (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps): Add initial support for h.264 video (SMPTE RP2008). --- ChangeLog | 6 ++++++ gst/mxf/mxfmpeg.c | 43 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecb07844ea..02b5133d63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-22 Sebastian Dröge + + * gst/mxf/mxfmpeg.c: (mxf_mpeg_es_create_caps), + (mxf_mpeg_create_caps): + Add initial support for h.264 video (SMPTE RP2008). + 2008-12-22 Sebastian Dröge * gst/mxf/mxfmetadata.c: (mxf_metadata_base_resolve): diff --git a/gst/mxf/mxfmpeg.c b/gst/mxf/mxfmpeg.c index c8ac23ca5d..a836d7d09c 100644 --- a/gst/mxf/mxfmpeg.c +++ b/gst/mxf/mxfmpeg.c @@ -386,6 +386,12 @@ mxf_mpeg_es_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags, gst_buffer_unref (codec_data); } codec_name = "MPEG-4 Video"; + } else if ((p->picture_essence_coding.u[13] >> 4) == 0x03) { + /* RP 2008 */ + + /* TODO: What about codec_data for AVC1 streams? */ + caps = gst_caps_new_simple ("video/x-h264", NULL); + codec_name = "h.264 Video"; } else { GST_ERROR ("Unsupported MPEG picture essence coding 0x%02x", p->picture_essence_coding.u[13]); @@ -472,17 +478,17 @@ mxf_mpeg_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags, if (!track->parent.descriptor[i]) continue; - if (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (track->parent. - descriptor[i])) { + if (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (track-> + parent.descriptor[i])) { f = track->parent.descriptor[i]; - p = (MXFMetadataGenericPictureEssenceDescriptor *) track-> - parent.descriptor[i]; + p = (MXFMetadataGenericPictureEssenceDescriptor *) track->parent. + descriptor[i]; break; - } else if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track->parent. - descriptor[i])) { + } else if (MXF_IS_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (track-> + parent.descriptor[i])) { f = track->parent.descriptor[i]; - s = (MXFMetadataGenericSoundEssenceDescriptor *) track-> - parent.descriptor[i]; + s = (MXFMetadataGenericSoundEssenceDescriptor *) track->parent. + descriptor[i]; break; } } @@ -518,9 +524,28 @@ mxf_mpeg_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags, *tags = gst_tag_list_new (); gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, "MPEG TS", NULL); + } else if (f->essence_container.u[13] == 0x0f) { + GST_DEBUG ("Found h264 NAL unit stream"); + /* RP 2008 */ + /* TODO: What about codec_data? */ + caps = gst_caps_new_simple ("video/x-h264", NULL); + + if (!*tags) + *tags = gst_tag_list_new (); + gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, + "h.264 Video", NULL); + } else if (f->essence_container.u[13] == 0x10) { + GST_DEBUG ("Found h264 byte stream stream"); + /* RP 2008 */ + caps = gst_caps_new_simple ("video/x-h264", NULL); + + if (!*tags) + *tags = gst_tag_list_new (); + gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, + "h.264 Video", NULL); } - if (p) + if (p && caps) mxf_metadata_generic_picture_essence_descriptor_set_caps (p, caps); return caps;