1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Antonio Rojas <arojas@archlinux.org>
3 Date: Sat, 7 Jan 2023 16:18:03 +0100
4 Subject: [PATCH] Support zxing-c++ 2.0
6 format is a C++ string in 2.0
8 subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp | 9 +++++++++
9 1 file changed, 9 insertions(+)
11 diff --git a/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp b/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp
12 index 7836dbbcf18e..a8a0f7b49aa4 100644
13 --- a/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp
14 +++ b/subprojects/gst-plugins-bad/ext/zxing/gstzxing.cpp
17 #include "ReadBarcode.h"
18 #include "TextUtfEncoding.h"
19 +#include "ZXVersion.h"
21 using namespace ZXing;
23 @@ -369,32 +370,40 @@ gst_zxing_transform_frame_ip (GstVideoFilter * vfilter, GstVideoFrame * frame)
24 if (result.isValid ()) {
25 GST_DEBUG_OBJECT (zxing, "Symbol found. Text: %s Format: %s",
26 result.text ().c_str (),
27 +#if ZXING_VERSION_MAJOR >= 2
28 + ToString (result.format ()).c_str ());
30 ToString (result.format ()));
42 GstClockTime timestamp, running_time, stream_time;
44 timestamp = GST_BUFFER_TIMESTAMP (frame->buffer);
46 gst_segment_to_running_time (&GST_BASE_TRANSFORM (zxing)->segment,
47 GST_FORMAT_TIME, timestamp);
49 gst_segment_to_stream_time (&GST_BASE_TRANSFORM (zxing)->segment,
50 GST_FORMAT_TIME, timestamp);
52 s = gst_structure_new ("barcode",
53 "timestamp", G_TYPE_UINT64, timestamp,
54 "stream-time", G_TYPE_UINT64, stream_time,
55 "running-time", G_TYPE_UINT64, running_time,
56 +#if ZXING_VERSION_MAJOR >= 2
57 + "type", G_TYPE_STRING, ToString (result.format ()).c_str (),
59 "type", G_TYPE_STRING, ToString (result.format ()),
61 "symbol", G_TYPE_STRING,
62 result.text ().c_str (), NULL);