diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-11-02 17:46:11 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-11-02 17:46:11 +0000 |
commit | 2363d97da10f985a7ed1f79b52d8043d3ca2bb8d (patch) | |
tree | 87977cacc32a24e61832de6309e9c1b1365dc0c9 /ext/zbar | |
parent | 7ddd7f7809dafde556c7f9a16e53542722564d1c (diff) | |
download | gstreamer-plugins-bad-2363d97da10f985a7ed1f79b52d8043d3ca2bb8d.tar.gz |
zbar: handle more formats that start with an 8-bit Y plane
We can handle most planar YUV layouts too, as long as we don't
tell zbar about the chroma planes.
Diffstat (limited to 'ext/zbar')
-rw-r--r-- | ext/zbar/gstzbar.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/zbar/gstzbar.c b/ext/zbar/gstzbar.c index df5774421..fc770a83d 100644 --- a/ext/zbar/gstzbar.c +++ b/ext/zbar/gstzbar.c @@ -108,18 +108,22 @@ enum #define DEFAULT_CACHE FALSE #define DEFAULT_MESSAGE TRUE +/* FIXME: add YVU9 and YUV9 once we have a GstVideoFormat for that */ +#define ZBAR_YUV_CAPS \ + "{ Y800, I420, YV12, NV12, NV21, Y41B, Y42B }" + static GstStaticPadTemplate gst_zbar_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ Y800 }")) + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (ZBAR_YUV_CAPS)) ); static GstStaticPadTemplate gst_zbar_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ Y800 }")) + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (ZBAR_YUV_CAPS)) ); static void gst_zbar_finalize (GObject * object); @@ -293,6 +297,8 @@ gst_zbar_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) image = zbar_image_create (); + /* all formats we support start with an 8-bit Y plane. zbar doesn't need + * to know about the chroma plane(s) */ zbar_image_set_format (image, GST_MAKE_FOURCC ('Y', '8', '0', '0')); rowstride = gst_video_format_get_row_stride (zbar->format, 0, zbar->width); zbar_image_set_size (image, rowstride, zbar->height); |