Accepting request 923438 from hardware:sdr

OBS-URL: https://build.opensuse.org/request/show/923438
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/codec2?expand=0&rev=7
This commit is contained in:
2021-10-11 13:30:46 +00:00
committed by Git OBS Bridge
3 changed files with 61 additions and 19 deletions

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Oct 5 12:55:41 UTC 2021 - Wojciech Kazubski <wk@ire.pw.edu.pl>
- Added a patch moved-freedv_callback_rx_sym-into-internal-header.patch
to fix building gnuradio (patch taken from upstream)
-------------------------------------------------------------------
Sat Oct 2 15:58:11 UTC 2021 - Martin Hauke <mardnh@gmx.de>
- Drop handcrafted generation of the pkgconfig file
- Remove "-Wno-dev"
-------------------------------------------------------------------
Mon Sep 27 16:41:28 UTC 2021 - Wojciech Kazubski <wk@ire.pw.edu.pl>

View File

@@ -1,7 +1,7 @@
#
# spec file for package codec2
#
# Copyright (c) 2020-2021 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -30,6 +30,7 @@ Source: https://github.com/drowe67/codec2/archive/v%{version}.tar.gz#/%{
Source1: %{name}-rpmlintrc
Source2: baselibs.conf
Patch0: codec2-no_return_random.patch
Patch1: moved-freedv_callback_rx_sym-into-internal-header.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: pkgconfig
@@ -76,29 +77,12 @@ Example code for Codec 2, including test voices and matlab/octave files.
%build
%cmake \
-DINSTALL_EXAMPLES=TRUE \
-DUNITTEST=TRUE \
-Wno-dev
-DUNITTEST=TRUE
%cmake_build
%install
%cmake_install
# Create and install pkgconfig file
mkdir -p %{buildroot}%{_libdir}/pkgconfig
cat > %{buildroot}%{_libdir}/pkgconfig/codec2.pc << EOF
prefix=%{_prefix}
exec_prefix=\${prefix}
includedir=\${prefix}/include/%{name}
libdir=\${exec_prefix}/%{_lib}
Name: codec2
Version: %{version}
License: GPL-2.0 and LGPL-2.1
Description: Low bit rate speech codec for two-way radio
Cflags: -I\${includedir}
Libs: -L\${libdir} -l%{name}
EOF
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

View File

@@ -0,0 +1,46 @@
From 7a554bad2f28a4cf19cddf43c619fe5921ddaea3 Mon Sep 17 00:00:00 2001
From: drowe67 <david@rowetel.com>
Date: Sat, 2 Oct 2021 15:48:09 +0930
Subject: [PATCH] moved freedv_callback_rx_sym typedef and function into
freedv_api_internal.h
---
src/freedv_api.h | 2 --
src/freedv_api_internal.h | 4 ++++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/freedv_api.h b/src/freedv_api.h
index 23c5fef8..9393bd80 100644
--- a/src/freedv_api.h
+++ b/src/freedv_api.h
@@ -145,7 +145,6 @@ struct freedv_advanced {
// Called when text message char is decoded
typedef void (*freedv_callback_rx)(void *, char);
-typedef void (*freedv_callback_rx_sym)(void *, _Complex float, float);
// Called when new text message char is needed
typedef char (*freedv_callback_tx)(void *);
typedef void (*freedv_calback_error_pattern)
@@ -212,7 +211,6 @@ int freedv_check_crc16_unpacked(unsigned char *unpacked_bits, int nbits);
// Set parameters ------------------------------------------------------------
void freedv_set_callback_txt (struct freedv *freedv, freedv_callback_rx rx, freedv_callback_tx tx, void *callback_state);
-void freedv_set_callback_txt_sym (struct freedv *freedv, freedv_callback_rx_sym rx, void *callback_state);
void freedv_set_callback_protocol (struct freedv *freedv, freedv_callback_protorx rx, freedv_callback_prototx tx, void *callback_state);
void freedv_set_callback_data (struct freedv *freedv, freedv_callback_datarx datarx, freedv_callback_datatx datatx, void *callback_state);
void freedv_set_test_frames (struct freedv *freedv, int test_frames);
diff --git a/src/freedv_api_internal.h b/src/freedv_api_internal.h
index 0197e184..e7a9526c 100644
--- a/src/freedv_api_internal.h
+++ b/src/freedv_api_internal.h
@@ -230,6 +230,10 @@ int freedv_rx_fsk_ldpc_data(struct freedv *f, COMP demod_in[]);
int freedv_bits_to_speech(struct freedv *f, short speech_out[], short demod_in[], int rx_status);
+// for the reliable text protocol we need to pass symbols back rather than text
+typedef void (*freedv_callback_rx_sym)(void *, _Complex float, float);
+void freedv_set_callback_txt_sym (struct freedv *freedv, freedv_callback_rx_sym rx, void *callback_state);
+
#ifdef __cplusplus
}
#endif