From dbaca4418dc1cc3a389af8320fda2c0a28d3dd0e Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sat, 7 Jan 2023 16:18:03 +0100 Subject: [PATCH] zxing: add support for zxing-c++ 2.0 format is a C++ string in 2.0 Part-of: --- subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp b/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp index 7836dbb..a8a0f7b 100644 --- a/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp +++ b/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp @@ -62,6 +62,7 @@ #include "ReadBarcode.h" #include "TextUtfEncoding.h" +#include "ZXVersion.h" using namespace ZXing; @@ -369,7 +370,11 @@ gst_zxing_transform_frame_ip (GstVideoFilter * vfilter, GstVideoFrame * frame) if (result.isValid ()) { GST_DEBUG_OBJECT (zxing, "Symbol found. Text: %s Format: %s", result.text ().c_str (), +#if ZXING_VERSION_MAJOR >= 2 + ToString (result.format ()).c_str ()); +#else ToString (result.format ())); +#endif } else { goto out; } @@ -394,7 +399,11 @@ gst_zxing_transform_frame_ip (GstVideoFilter * vfilter, GstVideoFrame * frame) "timestamp", G_TYPE_UINT64, timestamp, "stream-time", G_TYPE_UINT64, stream_time, "running-time", G_TYPE_UINT64, running_time, +#if ZXING_VERSION_MAJOR >= 2 + "type", G_TYPE_STRING, ToString (result.format ()).c_str (), +#else "type", G_TYPE_STRING, ToString (result.format ()), +#endif "symbol", G_TYPE_STRING, result.text ().c_str (), NULL); -- 2.7.4