CVS Root: /cvs/gstreamer
Module: gst-plugins-bad
Changes by: slomo
Date: Sun Nov 30 2008 14:12:18 UTC
Log message:
* gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_create_caps):
* gst/mxf/mxfmpeg.c: (mxf_mpeg_video_create_caps):
Set the correct MPEG video version if possible and add support
for MPEG4 video, including codec_data.
Modified files:
. : ChangeLog
gst/mxf : mxfjpeg2000.c mxfmpeg.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3766&r2=1.3767
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfjpeg2000.c.diff?r1=1.1&r2=1.2
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfmpeg.c.diff?r1=1.5&r2=1.6
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3766
retrieving revision 1.3767
diff -u -d -r1.3766 -r1.3767
--- ChangeLog 29 Nov 2008 20:25:04 -0000 1.3766
+++ ChangeLog 30 Nov 2008 14:12:02 -0000 1.3767
@@ -1,3 +1,10 @@
+2008-11-30 Sebastian Dröge <[email protected]>
+
+ * gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_create_caps):
+ * gst/mxf/mxfmpeg.c: (mxf_mpeg_video_create_caps):
+ Set the correct MPEG video version if possible and add support
+ for MPEG4 video, including codec_data.
2008-11-29 Sebastian Dröge <[email protected]>
* gst/mxf/Makefile.am:
Index: mxfjpeg2000.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfjpeg2000.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mxfjpeg2000.c 29 Nov 2008 20:25:05 -0000 1.1
+++ mxfjpeg2000.c 30 Nov 2008 14:12:04 -0000 1.2
@@ -106,8 +106,8 @@
p = (MXFMetadataGenericPictureEssenceDescriptor *) track->descriptor[i];
f = track->descriptor[i];
break;
- } else if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->
- is_file_descriptor
+ } else if (((MXFMetadataGenericDescriptor *) track->
+ descriptor[i])->is_file_descriptor
&& ((MXFMetadataGenericDescriptor *) track->descriptor[i])->type !=
MXF_METADATA_MULTIPLE_DESCRIPTOR) {
@@ -121,7 +121,8 @@
*handler = mxf_jpeg2000_handle_essence_element;
- caps = gst_caps_new_simple ("image/jp2", NULL);
+ /* TODO: What about other field values? */
+ caps = gst_caps_new_simple ("image/x-j2c", "fields", G_TYPE_INT, 1, NULL);
if (p) {
mxf_metadata_generic_picture_essence_descriptor_set_caps (p, caps);
} else {
Index: mxfmpeg.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfmpeg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mxfmpeg.c 26 Nov 2008 10:37:33 -0000 1.5
+++ mxfmpeg.c 30 Nov 2008 14:12:04 -0000 1.6
@@ -236,6 +236,12 @@
return GST_FLOW_OK;
}
+/* Private uid used by SONY C0023S01.mxf,
+ * taken from the ffmpeg mxf demuxer */
+static const guint8 sony_mpeg4_extradata[] = {
+ 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x06, 0x06, 0x02, 0x02,
+ 0x01, 0x00, 0x00
+};
GstCaps *
mxf_mpeg_video_create_caps (MXFMetadataGenericPackage * package,
@@ -284,10 +290,59 @@
*handler = mxf_mpeg_video_handle_essence_element;
/* SMPTE 381M 7 */
if (f->essence_container.u[13] == 0x04) {
- /* FIXME: get mpeg version somehow */
GST_DEBUG ("Found MPEG ES stream");
- caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 1,
- "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ /* SMPTE RP224 */
+ if (!p || mxf_ul_is_zero (&p->picture_essence_coding)) {
+ GST_WARNING
+ ("No picture essence descriptor or no picture essence coding defined");
+ caps =
+ gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 2,
+ "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ } else if (p->picture_essence_coding.u[0] != 0x06
+ || p->picture_essence_coding.u[1] != 0x0e
+ || p->picture_essence_coding.u[2] != 0x2b
+ || p->picture_essence_coding.u[3] != 0x34
+ || p->picture_essence_coding.u[4] != 0x04
+ || p->picture_essence_coding.u[5] != 0x01
+ || p->picture_essence_coding.u[6] != 0x01
+ || p->picture_essence_coding.u[8] != 0x04
+ || p->picture_essence_coding.u[9] != 0x01
+ || p->picture_essence_coding.u[10] != 0x02
+ || p->picture_essence_coding.u[11] != 0x02
+ || p->picture_essence_coding.u[12] != 0x01) {
+ GST_ERROR ("No MPEG picture essence coding");
+ caps = NULL;
+ } else if (p->picture_essence_coding.u[13] >= 0x01 &&
+ p->picture_essence_coding.u[13] <= 0x08) {
+ caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 2,
+ } else if (p->picture_essence_coding.u[13] == 0x10) {
+ caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 1,
+ } else if (p->picture_essence_coding.u[13] == 0x20) {
+ MXFLocalTag *local_tag =
+ (((MXFMetadataGenericDescriptor *) f)->
+ other_tags) ? g_hash_table_lookup (((MXFMetadataGenericDescriptor *)
+ f)->other_tags, &sony_mpeg4_extradata) : NULL;
+ caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 4,
+ if (local_tag) {
+ GstBuffer *codec_data = NULL;
+ codec_data = gst_buffer_new_and_alloc (local_tag->size);
+ memcpy (GST_BUFFER_DATA (codec_data), local_tag->data, local_tag->size);
+ gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, codec_data,
+ NULL);
+ gst_buffer_unref (codec_data);
+ }
+ } else {
+ GST_ERROR ("Unsupported MPEG picture essence coding 0x%02x",
+ p->picture_essence_coding.u[13]);
+ }
} else if (f->essence_container.u[13] == 0x07) {
GST_ERROR ("MPEG PES streams not supported yet");
return NULL;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.