diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-01 15:48:13 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-01 15:48:13 +0000 |
commit | 426b2db2cba849ab4f64a6ba91047380ff338837 (patch) | |
tree | 8370b79b7a092787567f1f86633820bcf795ab6a /ext/jp2k/gstjasperdec.c | |
parent | 65009ed81b1434e17c94928da2ca57f164e429aa (diff) | |
download | gst-plugins-bad-426b2db2cba849ab4f64a6ba91047380ff338837.tar.gz gst-plugins-bad-426b2db2cba849ab4f64a6ba91047380ff338837.tar.bz2 gst-plugins-bad-426b2db2cba849ab4f64a6ba91047380ff338837.zip |
ext/jp2k/: Add image/x-jpc caps name for real, raw JPEG2000 codestream data.
Original commit message from CVS:
* ext/jp2k/gstjasperdec.c: (gst_jasper_dec_sink_setcaps):
* ext/jp2k/gstjasperenc.c: (gst_jasper_enc_reset),
(gst_jasper_enc_set_src_caps), (gst_jasper_enc_init_encoder),
(gst_jasper_enc_sink_setcaps), (gst_jasper_enc_get_data):
* ext/jp2k/gstjasperenc.h:
Add image/x-jpc caps name for real, raw JPEG2000 codestream data.
In 0.11 we should merge image/x-j2c and image/x-jpc and simply drop
the non-standard boxing in the jasper elements and handle it in
qtmux/qtdemux.
image/x-jpc will be used by mxfdemux later.
Also add support for JP2 output in jp2kenc.
Diffstat (limited to 'ext/jp2k/gstjasperdec.c')
-rw-r--r-- | ext/jp2k/gstjasperdec.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/jp2k/gstjasperdec.c b/ext/jp2k/gstjasperdec.c index fb0b10a0..9b334ded 100644 --- a/ext/jp2k/gstjasperdec.c +++ b/ext/jp2k/gstjasperdec.c @@ -48,12 +48,19 @@ enum ARG_0, }; +/* FIXME 0.11: Use a single caps name for jpeg2000 codestreams + * and drop the "boxed" variant + */ + static GstStaticPadTemplate gst_jasper_dec_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("image/x-j2c, " "framerate = " GST_VIDEO_FPS_RANGE ", " + "fields = (int) 1; " + "image/x-jpc, " + "framerate = " GST_VIDEO_FPS_RANGE ", " "fields = (int) 1; " "image/jp2") ); @@ -181,7 +188,7 @@ gst_jasper_dec_sink_setcaps (GstPad * pad, GstCaps * caps) dec->codec_data = NULL; } - if (!strcmp (mimetype, "image/x-j2c")) { + if (!strcmp (mimetype, "image/x-j2c") || !strcmp (mimetype, "image/x-jpc")) { const GValue *codec_data; gint fields; @@ -207,7 +214,11 @@ gst_jasper_dec_sink_setcaps (GstPad * pad, GstCaps * caps) dec->fmt = jas_image_strtofmt ("jpc"); /* strip the j2c box stuff it is embedded in */ - dec->strip = 8; + if (!strcmp (mimetype, "image/x-jpc")) + dec->strip = 0; + else + dec->strip = 8; + codec_data = gst_structure_get_value (s, "codec_data"); if (codec_data) { dec->codec_data = gst_value_get_buffer (codec_data); |