summaryrefslogtreecommitdiff
path: root/gst/mxf/mxfmpeg.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-12-01 15:24:37 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-12-01 15:24:37 +0000
commit65009ed81b1434e17c94928da2ca57f164e429aa (patch)
tree82e649e04c43220640a2edc4161f5dd5368a3473 /gst/mxf/mxfmpeg.c
parentcffc0f920726841aa7c41bd418402adae5812488 (diff)
downloadgstreamer-plugins-bad-65009ed81b1434e17c94928da2ca57f164e429aa.tar.gz
gst/mxf/: Add the codec name, and if possible the avg bitrate, to the pad's taglist.
Original commit message from CVS: * gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps): * gst/mxf/mxfalaw.c: (mxf_alaw_create_caps): * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_generic_container_essence_element): * gst/mxf/mxfdv-dif.c: (mxf_dv_dif_create_caps): * gst/mxf/mxfjpeg2000.c: (mxf_jpeg2000_create_caps): * gst/mxf/mxfmpeg.c: (mxf_mpeg_es_create_caps), (mxf_mpeg_create_caps): Add the codec name, and if possible the avg bitrate, to the pad's taglist.
Diffstat (limited to 'gst/mxf/mxfmpeg.c')
-rw-r--r--gst/mxf/mxfmpeg.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/gst/mxf/mxfmpeg.c b/gst/mxf/mxfmpeg.c
index 10d0373f7..1e6d03695 100644
--- a/gst/mxf/mxfmpeg.c
+++ b/gst/mxf/mxfmpeg.c
@@ -254,6 +254,7 @@ mxf_mpeg_es_create_caps (MXFMetadataGenericPackage * package,
MXFMetadataMPEGVideoDescriptor * d)
{
GstCaps *caps = NULL;
+ const gchar *codec_name = NULL;
/* SMPTE RP224 */
if (!p || mxf_ul_is_zero (&p->picture_essence_coding)) {
@@ -262,6 +263,7 @@ mxf_mpeg_es_create_caps (MXFMetadataGenericPackage * package,
caps =
gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 2,
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ codec_name = "MPEG-2 Video";
} else if (p->picture_essence_coding.u[0] != 0x06
|| p->picture_essence_coding.u[1] != 0x0e
|| p->picture_essence_coding.u[2] != 0x2b
@@ -280,9 +282,11 @@ mxf_mpeg_es_create_caps (MXFMetadataGenericPackage * package,
p->picture_essence_coding.u[13] <= 0x08) {
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 2,
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ codec_name = "MPEG-2 Video";
} else if (p->picture_essence_coding.u[13] == 0x10) {
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 1,
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ codec_name = "MPEG-1 Video";
} else if (p->picture_essence_coding.u[13] == 0x20) {
MXFLocalTag *local_tag =
(((MXFMetadataGenericDescriptor *) f)->other_tags) ?
@@ -300,15 +304,21 @@ mxf_mpeg_es_create_caps (MXFMetadataGenericPackage * package,
NULL);
gst_buffer_unref (codec_data);
}
-
+ codec_name = "MPEG-4 Video";
} else {
GST_ERROR ("Unsupported MPEG picture essence coding 0x%02x",
p->picture_essence_coding.u[13]);
caps = NULL;
}
- if (caps)
+ if (caps) {
*handler = mxf_mpeg_video_handle_essence_element;
+ if (!*tags)
+ *tags = gst_tag_list_new ();
+ if (codec_name)
+ gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
+ codec_name, NULL);
+ }
return caps;
}
@@ -378,9 +388,19 @@ mxf_mpeg_create_caps (MXFMetadataGenericPackage * package,
GST_DEBUG ("Found MPEG PS stream");
caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 1,
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
+
+ if (!*tags)
+ *tags = gst_tag_list_new ();
+ gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
+ "MPEG PS", NULL);
} else if (f->essence_container.u[13] == 0x09) {
GST_DEBUG ("Found MPEG TS stream");
caps = gst_caps_new_simple ("video/mpegts", NULL);
+
+ if (!*tags)
+ *tags = gst_tag_list_new ();
+ gst_tag_list_add (*tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
+ "MPEG TS", NULL);
}
if (p)