mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
gst_plugins-cache: add zxing plugin
update documentation Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7887>
This commit is contained in:
parent
bc63d85f19
commit
ab8b2883a1
3 changed files with 272 additions and 9 deletions
|
@ -253314,5 +253314,202 @@
|
||||||
"source": "gst-plugins-bad",
|
"source": "gst-plugins-bad",
|
||||||
"tracers": {},
|
"tracers": {},
|
||||||
"url": "Unknown package origin"
|
"url": "Unknown package origin"
|
||||||
|
},
|
||||||
|
"zxing": {
|
||||||
|
"description": "ZXing bar code detector plugin",
|
||||||
|
"elements": {
|
||||||
|
"zxing": {
|
||||||
|
"author": "Stéphane Cerveau <scerveau@collabora.com>",
|
||||||
|
"description": "Detect bar codes in the video streams with zxing library",
|
||||||
|
"hierarchy": [
|
||||||
|
"GstZXing",
|
||||||
|
"GstVideoFilter",
|
||||||
|
"GstBaseTransform",
|
||||||
|
"GstElement",
|
||||||
|
"GstObject",
|
||||||
|
"GInitiallyUnowned",
|
||||||
|
"GObject"
|
||||||
|
],
|
||||||
|
"klass": "Filter/Analyzer/Video",
|
||||||
|
"pad-templates": {
|
||||||
|
"sink": {
|
||||||
|
"caps": "video/x-raw:\n format: { ARGB, xRGB, Y444, Y42B, I420, Y41B, YUV9, YV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
|
||||||
|
"direction": "sink",
|
||||||
|
"presence": "always"
|
||||||
|
},
|
||||||
|
"src": {
|
||||||
|
"caps": "video/x-raw:\n format: { ARGB, xRGB, Y444, Y42B, I420, Y41B, YUV9, YV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
|
||||||
|
"direction": "src",
|
||||||
|
"presence": "always"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"attach-frame": {
|
||||||
|
"blurb": "Attach a frame dump to each barcode message",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"format": {
|
||||||
|
"blurb": "Barcode image format",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "all (0)",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "GstBarCodeFormat",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"blurb": "Post a barcode message for each detected code",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "true",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"try-faster": {
|
||||||
|
"blurb": "Try faster to analyze the frame",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"try-rotate": {
|
||||||
|
"blurb": "Try to rotate the frame to detect barcode (slower)",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rank": "marginal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"filename": "gstzxing",
|
||||||
|
"license": "LGPL",
|
||||||
|
"other-types": {
|
||||||
|
"GstBarCodeFormat": {
|
||||||
|
"kind": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"desc": "ALL",
|
||||||
|
"name": "all",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "AZTEC",
|
||||||
|
"name": "aztec",
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "CODABAR",
|
||||||
|
"name": "codabar",
|
||||||
|
"value": "2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "CODE_39",
|
||||||
|
"name": "code_39",
|
||||||
|
"value": "3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "CODE_93",
|
||||||
|
"name": "code_93",
|
||||||
|
"value": "4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "CODE_128",
|
||||||
|
"name": "code_128",
|
||||||
|
"value": "5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "PNG",
|
||||||
|
"name": "png",
|
||||||
|
"value": "6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "EAN_8",
|
||||||
|
"name": "ean_8",
|
||||||
|
"value": "7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "EAN_13",
|
||||||
|
"name": "ean_13",
|
||||||
|
"value": "8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "ITF",
|
||||||
|
"name": "itf",
|
||||||
|
"value": "9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "MAXICODE",
|
||||||
|
"name": "maxicode",
|
||||||
|
"value": "10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "PDF_417",
|
||||||
|
"name": "pdf_417",
|
||||||
|
"value": "11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "QR_CODE",
|
||||||
|
"name": "qr_code",
|
||||||
|
"value": "12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "RSS_14",
|
||||||
|
"name": "rss_14",
|
||||||
|
"value": "13"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "RSS_EXPANDED",
|
||||||
|
"name": "rss_expanded",
|
||||||
|
"value": "14"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "UPC_A",
|
||||||
|
"name": "upc_a",
|
||||||
|
"value": "15"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "UPC_E",
|
||||||
|
"name": "upc_e",
|
||||||
|
"value": "16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "UPC_EAN_EXTENSION",
|
||||||
|
"name": "upc_ean_expansion",
|
||||||
|
"value": "17"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"package": "GStreamer Bad Plug-ins",
|
||||||
|
"source": "gst-plugins-bad",
|
||||||
|
"tracers": {},
|
||||||
|
"url": "Unknown package origin"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -37,7 +37,7 @@
|
||||||
* the .#GstZXing:attach-frame property was set to %TRUE (Since 1.18)
|
* the .#GstZXing:attach-frame property was set to %TRUE (Since 1.18)
|
||||||
*
|
*
|
||||||
* This element is based on the c++ implementation of zxing which can found
|
* This element is based on the c++ implementation of zxing which can found
|
||||||
* at https://github.com/nu-book/zxing-cpp.
|
* at https://github.com/zxing-cpp/zxing-cpp.
|
||||||
*
|
*
|
||||||
* ## Example launch lines
|
* ## Example launch lines
|
||||||
* |[
|
* |[
|
||||||
|
@ -47,6 +47,8 @@
|
||||||
* gst-launch-1.0 -m v4l2src ! tee name=t ! queue ! videoconvert ! zxing ! fakesink t. ! queue ! xvimagesink
|
* gst-launch-1.0 -m v4l2src ! tee name=t ! queue ! videoconvert ! zxing ! fakesink t. ! queue ! xvimagesink
|
||||||
* ]| Same as above, but running the filter on a branch to keep the display in color
|
* ]| Same as above, but running the filter on a branch to keep the display in color
|
||||||
*
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -84,7 +86,31 @@ enum
|
||||||
PROP_FORMAT,
|
PROP_FORMAT,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
/**
|
||||||
|
* GstBarCodeFormat:
|
||||||
|
*
|
||||||
|
* @BARCODE_FORMAT_ALL all format
|
||||||
|
* @BARCODE_FORMAT_AZTEC aztec format
|
||||||
|
* @BARCODE_FORMAT_CODABAR codabar format
|
||||||
|
* @BARCODE_FORMAT_CODE_39 code39 format
|
||||||
|
* @BARCODE_FORMAT_CODE_93 code 93 format
|
||||||
|
* @BARCODE_FORMAT_CODE_128 code 128 format
|
||||||
|
* @BARCODE_FORMAT_DATA_MATRIX data matrix format
|
||||||
|
* @BARCODE_FORMAT_EAN_8 EAN 8 format
|
||||||
|
* @BARCODE_FORMAT_EAN_13 EAN 13 format
|
||||||
|
* @BARCODE_FORMAT_ITF ITF format
|
||||||
|
* @BARCODE_FORMAT_MAXICODE maxicode format
|
||||||
|
* @BARCODE_FORMAT_PDF_417 pdf 417 format
|
||||||
|
* @BARCODE_FORMAT_QR_CODE QR code format
|
||||||
|
* @BARCODE_FORMAT_RSS_14 RSS 14 format
|
||||||
|
* @BARCODE_FORMAT_RSS_EXPANDED RSS expanded format
|
||||||
|
* @BARCODE_FORMAT_UPC_A UPC_A format
|
||||||
|
* @BARCODE_FORMAT_UPC_E UPC_E format
|
||||||
|
* @BARCODE_FORMAT_UPC_EAN_EXTENSION UPC_EAN_EXTENSION format
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
{
|
{
|
||||||
BARCODE_FORMAT_ALL,
|
BARCODE_FORMAT_ALL,
|
||||||
BARCODE_FORMAT_AZTEC,
|
BARCODE_FORMAT_AZTEC,
|
||||||
|
@ -104,7 +130,7 @@ enum
|
||||||
BARCODE_FORMAT_UPC_A,
|
BARCODE_FORMAT_UPC_A,
|
||||||
BARCODE_FORMAT_UPC_E,
|
BARCODE_FORMAT_UPC_E,
|
||||||
BARCODE_FORMAT_UPC_EAN_EXTENSION
|
BARCODE_FORMAT_UPC_EAN_EXTENSION
|
||||||
};
|
} GstBarCodeFormat;
|
||||||
|
|
||||||
static const GEnumValue barcode_formats[] = {
|
static const GEnumValue barcode_formats[] = {
|
||||||
{BARCODE_FORMAT_ALL, "ALL", "all"},
|
{BARCODE_FORMAT_ALL, "ALL", "all"},
|
||||||
|
@ -175,7 +201,7 @@ struct _GstZXing
|
||||||
gboolean rotate;
|
gboolean rotate;
|
||||||
gboolean faster;
|
gboolean faster;
|
||||||
ImageFormat image_format;
|
ImageFormat image_format;
|
||||||
guint barcode_format;
|
GstBarCodeFormat barcode_format;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_zxing_set_property (GObject * object, guint prop_id,
|
static void gst_zxing_set_property (GObject * object, guint prop_id,
|
||||||
|
@ -208,27 +234,60 @@ gst_zxing_class_init (GstZXingClass * g_class)
|
||||||
gobject_class->set_property = gst_zxing_set_property;
|
gobject_class->set_property = gst_zxing_set_property;
|
||||||
gobject_class->get_property = gst_zxing_get_property;
|
gobject_class->get_property = gst_zxing_get_property;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstZXing::message:
|
||||||
|
*
|
||||||
|
* Post a barcode message for each detected code.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_MESSAGE,
|
g_object_class_install_property (gobject_class, PROP_MESSAGE,
|
||||||
g_param_spec_boolean ("message",
|
g_param_spec_boolean ("message",
|
||||||
"message", "Post a barcode message for each detected code",
|
"message", "Post a barcode message for each detected code",
|
||||||
DEFAULT_MESSAGE,
|
DEFAULT_MESSAGE,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
/**
|
||||||
|
* GstZXing::attach-frame:
|
||||||
|
*
|
||||||
|
* Attach a frame dump to each barcode message
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_ATTACH_FRAME,
|
g_object_class_install_property (gobject_class, PROP_ATTACH_FRAME,
|
||||||
g_param_spec_boolean ("attach-frame", "Attach frame",
|
g_param_spec_boolean ("attach-frame", "Attach frame",
|
||||||
"Attach a frame dump to each barcode message",
|
"Attach a frame dump to each barcode message",
|
||||||
DEFAULT_ATTACH_FRAME,
|
DEFAULT_ATTACH_FRAME,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
/**
|
||||||
|
* GstZXing::try-rotate:
|
||||||
|
*
|
||||||
|
* Try to rotate the frame to detect barcode (slower)
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_TRY_ROTATE,
|
g_object_class_install_property (gobject_class, PROP_TRY_ROTATE,
|
||||||
g_param_spec_boolean ("try-rotate", "Try rotate",
|
g_param_spec_boolean ("try-rotate", "Try rotate",
|
||||||
"Try to rotate the frame to detect barcode (slower)",
|
"Try to rotate the frame to detect barcode (slower)",
|
||||||
DEFAULT_TRY_ROTATE,
|
DEFAULT_TRY_ROTATE,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
/**
|
||||||
|
* GstZXing::try-faster:
|
||||||
|
*
|
||||||
|
* Try faster to analyze the frame
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_TRY_FASTER,
|
g_object_class_install_property (gobject_class, PROP_TRY_FASTER,
|
||||||
g_param_spec_boolean ("try-faster", "Try faster",
|
g_param_spec_boolean ("try-faster", "Try faster",
|
||||||
"Try faster to analyze the frame", DEFAULT_TRY_FASTER,
|
"Try faster to analyze the frame", DEFAULT_TRY_FASTER,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
/**
|
||||||
|
* GstZXing::format:
|
||||||
|
*
|
||||||
|
* Barcode image format
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_FORMAT,
|
g_object_class_install_property (gobject_class, PROP_FORMAT,
|
||||||
g_param_spec_enum ("format", "barcode format", "Barcode image format",
|
g_param_spec_enum ("format", "barcode format", "Barcode image format",
|
||||||
GST_TYPE_BARCODE_FORMAT, BARCODE_FORMAT_ALL,
|
GST_TYPE_BARCODE_FORMAT, BARCODE_FORMAT_ALL,
|
||||||
|
@ -248,6 +307,8 @@ gst_zxing_class_init (GstZXingClass * g_class)
|
||||||
GST_DEBUG_FUNCPTR (gst_zxing_transform_frame_ip);
|
GST_DEBUG_FUNCPTR (gst_zxing_transform_frame_ip);
|
||||||
vfilter_class->set_info =
|
vfilter_class->set_info =
|
||||||
GST_DEBUG_FUNCPTR (gst_zxing_set_info);
|
GST_DEBUG_FUNCPTR (gst_zxing_set_info);
|
||||||
|
|
||||||
|
gst_type_mark_as_plugin_api (GST_TYPE_BARCODE_FORMAT, (GstPluginAPIFlags)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -284,7 +345,7 @@ gst_zxing_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
zxing->faster = g_value_get_boolean (value);
|
zxing->faster = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
case PROP_FORMAT:
|
case PROP_FORMAT:
|
||||||
zxing->barcode_format = g_value_get_enum (value);
|
zxing->barcode_format = (GstBarCodeFormat)g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
|
|
@ -18,8 +18,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* ZXing GStreamer plugin
|
* SECTION:plugin-zxing
|
||||||
|
*
|
||||||
|
* Plugin for [ZXing](https://github.com/zxing-cpp/zxing-cpp), a bar code detector.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|
Loading…
Reference in a new issue