From 05b4576dcddaae734352389866fcbf86ed5d664a Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Sun, 4 Sep 2022 18:13:58 +0200 Subject: [PATCH 01/14] cmake: bump min. version 3.10 (#79) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bfd613..062978d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ # Versioning # -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.10) project(rem VERSION 2.7.0 LANGUAGES C) From bde5772b1af9977dc2d7f30d780d88ff895bb062 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Tue, 6 Sep 2022 11:36:54 +0200 Subject: [PATCH 02/14] auframe: auframe_bytes_to_timestamp use uint64_t The correct type for timestamp is `uint64_t`. --- include/rem_auframe.h | 2 +- src/auframe/auframe.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/rem_auframe.h b/include/rem_auframe.h index cf8a063..c0295a2 100644 --- a/include/rem_auframe.h +++ b/include/rem_auframe.h @@ -44,4 +44,4 @@ static inline void auframe_update(struct auframe *af, void *sampv, size_t auframe_size(const struct auframe *af); void auframe_mute(struct auframe *af); double auframe_level(struct auframe *af); -size_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n); +uint64_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n); diff --git a/src/auframe/auframe.c b/src/auframe/auframe.c index 3b6ae85..5373f44 100644 --- a/src/auframe/auframe.c +++ b/src/auframe/auframe.c @@ -103,9 +103,10 @@ double auframe_level(struct auframe *af) } -size_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n) +uint64_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n) { size_t sample_size = aufmt_sample_size(af->fmt); - return n * AUDIO_TIMEBASE / (af->srate * af->ch * sample_size); + return ((uint64_t) n) * AUDIO_TIMEBASE / + (af->srate * af->ch * sample_size); } From 20f374d210c7af0b565d24ee05cf36104cf85cdc Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Fri, 16 Sep 2022 10:14:56 +0200 Subject: [PATCH 03/14] ci: migrate from make to CMake (#81) --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94a7ce2..4f44d52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: compiler: [gcc, clang] - os: [ubuntu-18.04, ubuntu-20.04, macos-latest] + os: [ubuntu-20.04, macos-latest] exclude: - os: macos-latest compiler: gcc @@ -42,5 +42,5 @@ jobs: run: | cd .. make -C re libre.a - make -C rem EXTRA_CFLAGS=-Werror CCACHE= librem.a - cd retest && make STATIC=1 LIBRE_SO=../re && ./retest -r + cmake -S rem -B rem/build && cmake --build rem/build + cd retest && cmake . && make && ./retest -r From 5eeda8879c6c477f1f4119c0d5bb8c8f6ce0ec79 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Fri, 23 Sep 2022 14:36:34 +0200 Subject: [PATCH 04/14] cmake: install improvements (#83) --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 062978d..0ab1f0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) # # Module Includes # +include(GNUInstallDirs) include(CheckIncludeFile) find_package(RE REQUIRED) @@ -113,22 +114,46 @@ set(HEADERS include/rem_vidmix.h ) -add_library(${PROJECT_NAME} - ${SRCS} - ${HEADERS} -) ############################################################################## # # Main target object # -target_link_libraries(${PROJECT_NAME} ${RE_LIBRARIES} -lpthread -lm) +add_library(${PROJECT_NAME} ${SRCS} ${HEADERS}) +target_link_libraries(${PROJECT_NAME} ${RE_LIBRARIES} Threads::Threads -lm) target_compile_definitions(${PROJECT_NAME} PRIVATE ${RE_DEFINITIONS}) -target_include_directories(${PROJECT_NAME} PRIVATE - include ${RE_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) +target_include_directories(${PROJECT_NAME} + PUBLIC include + PRIVATE ${RE_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} +) set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_SOVERSION}) set_target_properties(rem PROPERTIES PUBLIC_HEADER "${HEADERS}") -install(TARGETS rem LIBRARY) + + +############################################################################## +# +# Install section +# + +install(TARGETS rem + LIBRARY + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT Libraries + NAMELINK_SKIP + ARCHIVE + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT Development + PUBLIC_HEADER + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rem + COMPONENT Development +) + +install(TARGETS rem + LIBRARY + DESTINATION ${CMAKE_INSTALL_LIBDIR} + NAMELINK_ONLY + COMPONENT Development +) From e391274e91ee942d931b5464697ec7c4c8642af2 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Fri, 23 Sep 2022 17:10:15 +0200 Subject: [PATCH 05/14] cmake: add static and shared targets (#84) --- CMakeLists.txt | 57 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ab1f0b..5c37b09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,12 @@ cmake_minimum_required(VERSION 3.10) -project(rem VERSION 2.7.0 LANGUAGES C) +project(rem + VERSION 2.7.0 + LANGUAGES C + HOMEPAGE_URL https://github.com/baresip/rem + DESCRIPTION "Audio and video processing media library" +) set(PROJECT_SOVERSION 3) # bump if ABI breaks @@ -114,31 +119,65 @@ set(HEADERS include/rem_vidmix.h ) +############################################################################## +# +# Linking LIBS +# + +set(LINKLIBS ${RE_LIBRARIES} Threads::Threads -lm) + ############################################################################## # # Main target object # -add_library(${PROJECT_NAME} ${SRCS} ${HEADERS}) -target_link_libraries(${PROJECT_NAME} ${RE_LIBRARIES} Threads::Threads -lm) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${RE_DEFINITIONS}) -target_include_directories(${PROJECT_NAME} +add_library(rem-objs OBJECT ${SRCS} ${HEADERS}) + +set_target_properties(rem-objs PROPERTIES POSITION_INDEPENDENT_CODE ON) + +target_compile_definitions(rem-objs PRIVATE ${RE_DEFINITIONS}) + +target_link_libraries(rem-objs ${LINKLIBS}) +target_include_directories(rem-objs PUBLIC include PRIVATE ${RE_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ) -set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_SOVERSION}) + +############################################################################## +# +# Shared target librem.[so|dll|dylib] +# + +add_library(rem-shared SHARED $) +target_link_libraries(rem-shared PRIVATE ${LINKLIBS}) +set_target_properties(rem-shared PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(rem-shared PROPERTIES SOVERSION ${PROJECT_SOVERSION}) +set_target_properties(rem-shared PROPERTIES OUTPUT_NAME "rem") + + +############################################################################## +# +# Static target librem.a +# + +add_library(rem STATIC $) +target_link_libraries(rem PUBLIC ${LINKLIBS}) +target_include_directories(rem PUBLIC include) set_target_properties(rem PROPERTIES PUBLIC_HEADER "${HEADERS}") +if(MSVC) +set_target_properties(rem PROPERTIES OUTPUT_NAME "rem-static") +endif() + ############################################################################## # # Install section # -install(TARGETS rem +install(TARGETS rem-shared rem LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries @@ -151,7 +190,7 @@ install(TARGETS rem COMPONENT Development ) -install(TARGETS rem +install(TARGETS rem-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_ONLY From d966c3acefd9c8e079b5ed1297e54e520bdeab91 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Fri, 23 Sep 2022 18:08:50 +0200 Subject: [PATCH 06/14] cmake: add win32 linklibs (#85) --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c37b09..f1fb226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,13 @@ set(HEADERS # Linking LIBS # -set(LINKLIBS ${RE_LIBRARIES} Threads::Threads -lm) +set(LINKLIBS ${RE_LIBRARIES} Threads::Threads) + +if(WIN32) + list(APPEND LINKLIBS qwave iphlpapi wsock32 ws2_32) +else() + list(APPEND LINKLIBS -lm) +endif() ############################################################################## From e7e3cb2fe24152152e491f5946abf1bbec1a267b Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Sat, 24 Sep 2022 07:19:02 +0200 Subject: [PATCH 07/14] update copyright/license --- LICENSE | 32 ++++++++++++++++++++++++++++++++ README.md | 2 +- docs/COPYING | 32 -------------------------------- 3 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 LICENSE delete mode 100644 docs/COPYING diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..52faab9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,32 @@ +Copyright (C) 2020 - 2022, Baresip Foundation (https://github.com/baresip) +Copyright (c) 2010 - 2022, Alfred E. Heggestad +Copyright (c) 2010 - 2020, Richard Aas +Copyright (c) 2010 - 2020, Creytiv.com +All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 5f4f426..29dd897 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ librem README librem is a Audio and video processing media library - Copyright (C) 2010 - 2019 Creytiv.com -- Copyright (C) 2020 - 2021 Baresip Foundation (https://github.com/baresip) +- Copyright (C) 2020 - 2022 Baresip Foundation (https://github.com/baresip) [![Build](https://github.com/baresip/rem/actions/workflows/build.yml/badge.svg)](https://github.com/baresip/rem/actions/workflows/build.yml) diff --git a/docs/COPYING b/docs/COPYING deleted file mode 100644 index 1b8c3af..0000000 --- a/docs/COPYING +++ /dev/null @@ -1,32 +0,0 @@ -Copyright (c) 2010 - 2019, Alfred E. Heggestad -Copyright (c) 2010 - 2019, Richard Aas -Copyright (c) 2010 - 2019, Creytiv.com -All rights reserved. - - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the Creytiv.com nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From d162ab687ce8bce3778bdf1b3b5082b7cf03e8ed Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Sat, 24 Sep 2022 07:44:47 +0200 Subject: [PATCH 08/14] debian: use dh-cmake (#86) --- debian/compat | 1 - debian/control | 8 +-- debian/copyright | 35 +++++------ debian/librem-dev.cmake-components | 1 + debian/librem-dev.dirs | 2 - debian/librem-dev.files | 3 - debian/librem.cmake-components | 1 + debian/librem.dirs | 1 - debian/librem.files | 1 - debian/rules | 98 +----------------------------- debian/source/format | 2 +- 11 files changed, 24 insertions(+), 129 deletions(-) delete mode 100644 debian/compat create mode 100644 debian/librem-dev.cmake-components delete mode 100644 debian/librem-dev.dirs delete mode 100644 debian/librem-dev.files create mode 100644 debian/librem.cmake-components delete mode 100644 debian/librem.dirs delete mode 100644 debian/librem.files diff --git a/debian/compat b/debian/compat deleted file mode 100644 index f599e28..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/debian/control b/debian/control index 5fd5943..7b7fe38 100644 --- a/debian/control +++ b/debian/control @@ -2,14 +2,14 @@ Source: librem Section: comm Priority: optional Maintainer: Alfred E. Heggestad -Standards-Version: 3.9.5 -Build-Depends: debhelper (>= 9.20120311), libre-dev (>= 1.1.0) -Homepage: http://www.creytiv.com/ +Standards-Version: 4.1.5 +Build-Depends: cmake, dh-cmake, dh-cmake-compat (= 1), dh-sequence-cmake, debhelper-compat (= 12) +Homepage: https://github.com/baresip/rem Package: librem Architecture: any Section: libs -Depends: libre (>= 1.1.0), ${shlibs:Depends}, ${misc:Depends} +Depends: libre (>= 2.7.0), ${shlibs:Depends}, ${misc:Depends} Description: Audio and video processing media library Audio mixer, resampler, tone generator, G.711 codec Video mixer, pixel converter diff --git a/debian/copyright b/debian/copyright index cd4354b..52faab9 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,7 @@ -This package was debianized by Alfred E. Heggestad - -It was downloaded from http://www.creytiv.com/ - - -Copyright (c) 2010 - 2014, Alfred E. Heggestad -Copyright (c) 2010 - 2014, Richard Aas -Copyright (c) 2010 - 2014, Creytiv.com +Copyright (C) 2020 - 2022, Baresip Foundation (https://github.com/baresip) +Copyright (c) 2010 - 2022, Alfred E. Heggestad +Copyright (c) 2010 - 2020, Richard Aas +Copyright (c) 2010 - 2020, Creytiv.com All rights reserved. @@ -20,18 +16,17 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. Neither the name of the Creytiv.com nor the names of its contributors +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/librem-dev.cmake-components b/debian/librem-dev.cmake-components new file mode 100644 index 0000000..e0eb968 --- /dev/null +++ b/debian/librem-dev.cmake-components @@ -0,0 +1 @@ +Development diff --git a/debian/librem-dev.dirs b/debian/librem-dev.dirs deleted file mode 100644 index da07fdd..0000000 --- a/debian/librem-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/include -usr/lib diff --git a/debian/librem-dev.files b/debian/librem-dev.files deleted file mode 100644 index 8d7ce12..0000000 --- a/debian/librem-dev.files +++ /dev/null @@ -1,3 +0,0 @@ -usr/include -usr/lib/librem.a -usr/lib/pkgconfig/librem.pc diff --git a/debian/librem.cmake-components b/debian/librem.cmake-components new file mode 100644 index 0000000..4e9af8a --- /dev/null +++ b/debian/librem.cmake-components @@ -0,0 +1 @@ +Libraries diff --git a/debian/librem.dirs b/debian/librem.dirs deleted file mode 100644 index 6845771..0000000 --- a/debian/librem.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib diff --git a/debian/librem.files b/debian/librem.files deleted file mode 100644 index 4251858..0000000 --- a/debian/librem.files +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/librem.so* diff --git a/debian/rules b/debian/rules index ae7b2f4..050e29a 100755 --- a/debian/rules +++ b/debian/rules @@ -1,98 +1,4 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -EXTRA_CFLAGS:="$(shell dpkg-buildflags --get CFLAGS | sed -e 's/-O2//')" -EXTRA_LFLAGS:="$(shell dpkg-buildflags --get LDFLAGS)" - - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - - -build: build-stamp -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(MAKE) RELEASE=1 PREFIX=/usr \ - EXTRA_CFLAGS=$(EXTRA_CFLAGS) \ - EXTRA_LFLAGS=$(EXTRA_LFLAGS) - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - $(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - # Add here commands to install the package into debian/tmp - mkdir $(CURDIR)/debian/tmp - $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp - - dh_movefiles - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -build-arch: build - -build-indep: build - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +%: + dh $@ --buildsystem=cmake diff --git a/debian/source/format b/debian/source/format index d3827e7..89ae9db 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -1.0 +3.0 (native) From f1f9a37ca793ce8b166fa862769b6656fc22b21e Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Sat, 24 Sep 2022 08:14:38 +0200 Subject: [PATCH 09/14] debian: release build --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index 050e29a..09879ce 100755 --- a/debian/rules +++ b/debian/rules @@ -2,3 +2,6 @@ %: dh $@ --buildsystem=cmake + +override_dh_auto_configure: + dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release From 71f151925065b3ff799c658f9c3f08cf4f528c2f Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Sat, 24 Sep 2022 14:45:45 +0200 Subject: [PATCH 10/14] vid/frame: fix possbile overflow multiplication (#87) Found by CodeQL: Multiplication result may overflow 'unsigned int' before it is converted to 'size_t'. --- src/vid/frame.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/vid/frame.c b/src/vid/frame.c index 65e6980..1dbd99c 100644 --- a/src/vid/frame.c +++ b/src/vid/frame.c @@ -24,15 +24,15 @@ size_t vidframe_size(enum vidfmt fmt, const struct vidsz *sz) switch (fmt) { - case VID_FMT_YUV420P: return sz->w * sz->h * 3 / 2; - case VID_FMT_YUYV422: return sz->w * sz->h * 2; - case VID_FMT_UYVY422: return sz->w * sz->h * 2; - case VID_FMT_RGB32: return sz->w * sz->h * 4; - case VID_FMT_ARGB: return sz->w * sz->h * 4; - case VID_FMT_RGB565: return sz->w * sz->h * 2; - case VID_FMT_NV12: return sz->w * sz->h * 3 / 2; - case VID_FMT_NV21: return sz->w * sz->h * 3 / 2; - case VID_FMT_YUV444P: return sz->w * sz->h * 3; + case VID_FMT_YUV420P: return (size_t)sz->w * sz->h * 3 / 2; + case VID_FMT_YUYV422: return (size_t)sz->w * sz->h * 2; + case VID_FMT_UYVY422: return (size_t)sz->w * sz->h * 2; + case VID_FMT_RGB32: return (size_t)sz->w * sz->h * 4; + case VID_FMT_ARGB: return (size_t)sz->w * sz->h * 4; + case VID_FMT_RGB565: return (size_t)sz->w * sz->h * 2; + case VID_FMT_NV12: return (size_t)sz->w * sz->h * 3 / 2; + case VID_FMT_NV21: return (size_t)sz->w * sz->h * 3 / 2; + case VID_FMT_YUV444P: return (size_t)sz->w * sz->h * 3; default: return 0; } @@ -186,7 +186,8 @@ int vidframe_alloc(struct vidframe **vfp, enum vidfmt fmt, void vidframe_fill(struct vidframe *vf, uint32_t r, uint32_t g, uint32_t b) { uint8_t *p; - unsigned h, i, x; + size_t h; + unsigned i, x; int u, v; if (!vf) From 34c8f444e51285499fd01287a62c0e46686914c9 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 29 Sep 2022 15:25:25 +0200 Subject: [PATCH 11/14] cmake: add pkgconfig (fixes #90) (#91) --- CMakeLists.txt | 17 +++++++++++++++++ packaging/CMakeLists.txt | 12 ++++++++++++ packaging/librem.pc.in | 11 +++++++++++ 3 files changed, 40 insertions(+) create mode 100644 packaging/CMakeLists.txt create mode 100644 packaging/librem.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index f1fb226..f32cf94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,18 @@ set_target_properties(rem PROPERTIES OUTPUT_NAME "rem-static") endif() +############################################################################## +# +# Packaging section +# + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + add_subdirectory(packaging) +endif() + +configure_file(packaging/librem.pc.in librem.pc @ONLY) + + ############################################################################## # # Install section @@ -202,3 +214,8 @@ install(TARGETS rem-shared NAMELINK_ONLY COMPONENT Development ) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librem.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + COMPONENT Development +) diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt new file mode 100644 index 0000000..b08f3e1 --- /dev/null +++ b/packaging/CMakeLists.txt @@ -0,0 +1,12 @@ +set(CPACK_PACKAGE_NAME librem) +set(CPACK_PACKAGE_VENDOR baresip) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Audio and video processing media library") +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +set(CPACK_VERBATIM_VARIABLES YES) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") + +include(CPack) diff --git a/packaging/librem.pc.in b/packaging/librem.pc.in new file mode 100644 index 0000000..979b0f4 --- /dev/null +++ b/packaging/librem.pc.in @@ -0,0 +1,11 @@ +prefix="@CMAKE_INSTALL_PREFIX@" +exec_prefix=${prefix} +libdir={$prefix}/lib +includedir=${prefix}/include/rem + +Name: @PROJECT_NAME@ +Description: @CMAKE_PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ +URL: @CMAKE_PROJECT_HOMEPAGE_URL@ +Libs: -L${libdir} -lrem -lre +Cflags: -I${includedir} From 683f4554880c8fafd09fc5f58fa05bec7ff7666f Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 29 Sep 2022 15:27:17 +0200 Subject: [PATCH 12/14] cmake/pkgconfig: fix name --- packaging/librem.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/librem.pc.in b/packaging/librem.pc.in index 979b0f4..68284a7 100644 --- a/packaging/librem.pc.in +++ b/packaging/librem.pc.in @@ -3,7 +3,7 @@ exec_prefix=${prefix} libdir={$prefix}/lib includedir=${prefix}/include/rem -Name: @PROJECT_NAME@ +Name: librem Description: @CMAKE_PROJECT_DESCRIPTION@ Version: @PROJECT_VERSION@ URL: @CMAKE_PROJECT_HOMEPAGE_URL@ From 1bfb9bd3e0ef1896881a4ac52eadef322a7e38c0 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 29 Sep 2022 19:47:55 +0200 Subject: [PATCH 13/14] cmake: fix shared API soversion (aligned with make) (#89) --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f32cf94..8d2952d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,8 @@ target_include_directories(rem-objs add_library(rem-shared SHARED $) target_link_libraries(rem-shared PRIVATE ${LINKLIBS}) -set_target_properties(rem-shared PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(rem-shared PROPERTIES VERSION + ${PROJECT_SOVERSION}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) set_target_properties(rem-shared PROPERTIES SOVERSION ${PROJECT_SOVERSION}) set_target_properties(rem-shared PROPERTIES OUTPUT_NAME "rem") From 34c20aaaf882223c4260bdebcdabeb5e2bbcbc76 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Sat, 1 Oct 2022 10:24:59 +0200 Subject: [PATCH 14/14] release v2.8.0 (#92) --- CHANGELOG.md | 17 +++++++++++++++++ CMakeLists.txt | 2 +- Makefile | 4 ++-- debian/changelog | 6 ++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafe157..33bbf60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v2.8.0] - 2022-10-01 + +* cmake: bump min. version 3.10 by @sreimers in https://github.com/baresip/rem/pull/79 +* auframe: auframe\_bytes\_to\_timestamp use uint64\_t by @cspiel1 in https://github.com/baresip/rem/pull/80 +* ci: migrate from make to CMake by @alfredh in https://github.com/baresip/rem/pull/81 +* cmake: install improvements by @sreimers in https://github.com/baresip/rem/pull/83 +* cmake: add static and shared targets by @sreimers in https://github.com/baresip/rem/pull/84 +* cmake: add win32 linklibs by @sreimers in https://github.com/baresip/rem/pull/85 +* debian: use dh-cmake by @sreimers in https://github.com/baresip/rem/pull/86 +* vid/frame: fix possbile overflow multiplication by @sreimers in https://github.com/baresip/rem/pull/87 +* cmake: add pkgconfig (fixes #90) by @robert-scheck in https://github.com/baresip/rem/pull/91 +* cmake: fix shared API soversion (aligned with make) by @robert-scheck in https://github.com/baresip/rem/pull/89 + +**Full Changelog**: https://github.com/baresip/rem/compare/v2.7.0...v2.8.0 + +--- + ## [v2.7.0] - 2022-09-01 * cmake: add FindRE and use re-config.cmake for definitions by @sreimers in https://github.com/baresip/rem/pull/76 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d2952d..a92deff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.10) project(rem - VERSION 2.7.0 + VERSION 2.8.0 LANGUAGES C HOMEPAGE_URL https://github.com/baresip/rem DESCRIPTION "Audio and video processing media library" diff --git a/Makefile b/Makefile index bbc77eb..4b4c175 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # Main version number VER_MAJOR := 2 -VER_MINOR := 7 +VER_MINOR := 8 VER_PATCH := 0 # Development version, comment out on a release @@ -26,7 +26,7 @@ else VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)-$(VER_PRE) endif OPT_SPEED := 1 -LIBRE_MIN := 2.7.0 +LIBRE_MIN := 2.8.0 ifndef LIBRE_MK LIBRE_MK := $(shell [ -f ../re/mk/re.mk ] && \ diff --git a/debian/changelog b/debian/changelog index 4ce3f15..c269c7b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +librem (2.8.0) unstable; urgency=medium + + * version 2.8.0 + + -- Christian Spielberger Sat, 1 Oct 2022 08:00:00 +0200 + librem (2.7.0) unstable; urgency=medium * version 2.7.0