summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO40
-rw-r--r--G729-API.patch170
-rw-r--r--PKGBUILD65
-rw-r--r--twinkle-1.4.2-ccrtp.patch24
4 files changed, 223 insertions, 76 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ff0fa95e0739..fd09ce4f7e9a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,31 @@
pkgbase = twinkle
pkgdesc = Softphone for voice over IP and IM communication using SIP
- pkgver = 1.4.2
- pkgrel = 19
- url = http://www.twinklephone.com/
+ pkgver = 1.10.2
+ pkgrel = 1
+ url = http://twinkle.dolezel.info/
arch = x86_64
- arch = i686
- license = GPL
- makedepends = pkg-config
- makedepends = boost
- makedepends = gendesk
- depends = file
- depends = speex
- depends = boost-libs
+ license = GPL2
+ makedepends = cmake
+ makedepends = bison
+ makedepends = flex
+ makedepends = qt5-tools
+ depends = ucommon
+ depends = ccrtp
+ depends = libxml2
depends = libsndfile
- depends = qt3
+ depends = imagemagick
+ depends = readline
+ depends = qt5-base
+ depends = qt5-declarative
+ depends = alsa-lib
depends = libzrtpcpp
- depends = commoncpp2
- source = http://www.xs4all.nl/~mfnboer/twinkle/download/twinkle-1.4.2.tar.gz
- source = twinkle-1.4.2-ccrtp.patch
- md5sums = d70c8972f296ffd998c7fb698774705b
- md5sums = 934f59ff60a8ae29a152feb8bf131ae2
+ depends = bcg729
+ depends = speex
+ depends = speexdsp
+ source = https://github.com/LubosD/twinkle/archive/v1.10.2/twinkle-v1.10.2.tar.gz
+ source = G729-API.patch
+ b2sums = 52cfa4f1d31b040db46edadccc43431d04fe71036821a1ef0c5b8803bf7ccf2fcd1d15a8340e583d049c588290a85c8ee07c6738adc599d164f7f606b2f34dc1
+ b2sums = e86166cc48c46697f5b20bdc3fbd169dcb07214aa47d030d554fe7bd10e79748f88ca2a4a1ce359ba879c1edfe63ffed10cbba9c11b04f6171b491e14b67189c
pkgname = twinkle
diff --git a/G729-API.patch b/G729-API.patch
new file mode 100644
index 000000000000..b5e9cd103668
--- /dev/null
+++ b/G729-API.patch
@@ -0,0 +1,170 @@
+Starting with version 1.0.2, bcg729 has changed its API to add support
+for G.729B, thus requiring us to adjust our function calls depending on
+which version is installed.
+
+When dealing with the new API, we merely need to add a few parameters to
+disable all G.729B features, namely:
+
+* On the decoder side: When `SIDFrameFlag` is not set, the decoder will
+ behave just like before, decoding the payload as a standard G.729A
+ voice frame (or concealing an erased frame). The other parameters,
+ `rfc3389PayloadFlag` and `bitStreamLength`, are only of use when
+ dealing with a SID frame sent as per RFC 3389, and are ignored if
+ `SIDFrameFlag` is not set.
+
+* On the encoder side: When `enableVAD` is disabled, the encoder will
+ behave just like before, producing only standard G.729A voice frames.
+ The only API difference is the introduction of `*bitStreamLength`, to
+ return the length of the encoded frame (0, 2 or 10 bytes). In our
+ case, this will always be 10 bytes just like before; an assert() was
+ added to guarantee this.
+
+Closes #104
+---
+ CMakeLists.txt | 4 ++++
+ cmake/FindG729.cmake | 36 ++++++++++++++++++++++++++++++++++++
+ src/audio/audio_decoder.cpp | 8 ++++++++
+ src/audio/audio_encoder.cpp | 10 ++++++++++
+ twinkle_config.h.in | 1 +
+ 5 files changed, 59 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1dafe55..7e3fde0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -116,6 +116,10 @@ if (WITH_G729)
+ if (G729_FOUND)
+ message(STATUS "bcg729 OK")
+ set(HAVE_BCG729 TRUE)
++
++ if (G729_ANNEX_B)
++ set(HAVE_BCG729_ANNEX_B TRUE)
++ endif (G729_ANNEX_B)
+
+ include_directories(${G729_INCLUDE_DIR})
+ else (G729_FOUND)
+diff --git a/cmake/FindG729.cmake b/cmake/FindG729.cmake
+index 4a30ba0..1fbfeeb 100644
+--- a/cmake/FindG729.cmake
++++ b/cmake/FindG729.cmake
+@@ -1,14 +1,50 @@
++INCLUDE(CMakePushCheckState)
++INCLUDE(CheckCSourceCompiles)
++
+ FIND_PATH(G729_INCLUDE_DIR bcg729/decoder.h)
+ FIND_LIBRARY(G729_LIBRARY NAMES bcg729)
+
+ IF(G729_INCLUDE_DIR AND G729_LIBRARY)
+ SET(G729_FOUND TRUE)
++
++ # The bcg729 API was changed in 1.0.2 to add support for G.729 Annex B.
++ # This checks whether we are dealing with the old or new API.
++ CMAKE_PUSH_CHECK_STATE()
++ SET(CMAKE_REQUIRED_INCLUDES "${INCLUDE_DIRECTORIES}" "${G729_INCLUDE_DIR}")
++ SET(CMAKE_REQUIRED_LIBRARIES "${G729_LIBRARY}")
++ SET(CMAKE_REQUIRED_QUIET TRUE)
++ # Try to compile something using the old (pre-1.0.2) API.
++ #
++ # We cannot do it the other way around, as initBcg729EncoderChannel()
++ # did not have a prototype before 1.0.2, thus compilation would not fail
++ # when passing it an extra argument.
++ CHECK_C_SOURCE_COMPILES("
++ #include <bcg729/encoder.h>
++
++ int main() {
++ /* This function requires an argument since 1.0.2 */
++ initBcg729EncoderChannel();
++ return 0;
++ }
++ " G729_OLD_API)
++ CMAKE_POP_CHECK_STATE()
++
++ IF (G729_OLD_API)
++ SET(G729_ANNEX_B FALSE)
++ ELSE (G729_OLD_API)
++ SET(G729_ANNEX_B TRUE)
++ ENDIF (G729_OLD_API)
+ ENDIF(G729_INCLUDE_DIR AND G729_LIBRARY)
+
+ IF(G729_FOUND)
+ IF (NOT G729_FIND_QUIETLY)
+ MESSAGE(STATUS "Found bcg729 includes: ${G729_INCLUDE_DIR}/bcg729/decoder.h")
+ MESSAGE(STATUS "Found bcg729 library: ${G729_LIBRARY}")
++ IF (G729_ANNEX_B)
++ MESSAGE(STATUS "bcg729 supports Annex B; using the new (1.0.2) API")
++ ELSE (G729_ANNEX_B)
++ MESSAGE(STATUS "bcg729 does not support Annex B; using the old (pre-1.0.2) API")
++ ENDIF (G729_ANNEX_B)
+ ENDIF (NOT G729_FIND_QUIETLY)
+ ELSE(G729_FOUND)
+ IF (G729_FIND_REQUIRED)
+diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
+index 65935dd..c661910 100644
+--- a/src/audio/audio_decoder.cpp
++++ b/src/audio/audio_decoder.cpp
+@@ -547,7 +547,11 @@ uint16 t_g729a_audio_decoder::decode(uint8 *payload, uint16 payload_size,
+
+ for (uint16 done = 0; done < payload_size; done += 10)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ bcg729Decoder(_context, &payload[done], 0, false, false, false, &pcm_buf[done * 8]);
++#else
+ bcg729Decoder(_context, &payload[done], false, &pcm_buf[done * 8]);
++#endif
+ }
+
+ return payload_size * 8;
+@@ -562,7 +566,11 @@ uint16 t_g729a_audio_decoder::conceal(int16 *pcm_buf, uint16 pcm_buf_size)
+ {
+ assert(pcm_buf_size >= 80);
+
++#ifdef HAVE_BCG729_ANNEX_B
++ bcg729Decoder(_context, nullptr, 0, true, false, false, pcm_buf);
++#else
+ bcg729Decoder(_context, nullptr, true, pcm_buf);
++#endif
+ return 80;
+ }
+
+diff --git a/src/audio/audio_encoder.cpp b/src/audio/audio_encoder.cpp
+index d6ff356..952b1ee 100644
+--- a/src/audio/audio_encoder.cpp
++++ b/src/audio/audio_encoder.cpp
+@@ -433,7 +433,11 @@ uint16 t_g726_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
+ t_g729a_audio_encoder::t_g729a_audio_encoder(uint16 payload_id, uint16 ptime, t_user *user_config)
+ : t_audio_encoder(payload_id, ptime, user_config)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ _context = initBcg729EncoderChannel(false);
++#else
+ _context = initBcg729EncoderChannel();
++#endif
+ }
+
+ t_g729a_audio_encoder::~t_g729a_audio_encoder()
+@@ -451,7 +455,13 @@ uint16 t_g729a_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
+
+ for (uint16 done = 0; done < nsamples; done += 80)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ uint8 frame_size = 10;
++ bcg729Encoder(_context, &sample_buf[done], &payload[done / 8], &frame_size);
++ assert(frame_size == 10);
++#else
+ bcg729Encoder(_context, &sample_buf[done], &payload[done / 8]);
++#endif
+ }
+
+ return nsamples / 8;
+diff --git a/twinkle_config.h.in b/twinkle_config.h.in
+index a1aa3b4..53a0426 100644
+--- a/twinkle_config.h.in
++++ b/twinkle_config.h.in
+@@ -4,6 +4,7 @@
+ #cmakedefine HAVE_ILBC_CPP
+ #cmakedefine HAVE_ZRTP
+ #cmakedefine HAVE_BCG729
++#cmakedefine HAVE_BCG729_ANNEX_B
+ #cmakedefine HAVE_GSM
+
+ #cmakedefine HAVE_UNISTD_H
diff --git a/PKGBUILD b/PKGBUILD
index 16b631ef994e..ae3d584b4467 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,50 +1,45 @@
-# $Id: PKGBUILD 68598 2012-03-29 08:03:13Z arodseth $
-# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Frederik Schwan <freswa at archlinux dot org>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jeff Mickey <jeff@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
pkgname=twinkle
-pkgver=1.4.2
-pkgrel=19
-pkgdesc="Softphone for voice over IP and IM communication using SIP"
-arch=('x86_64' 'i686')
-url="http://www.twinklephone.com/"
-license=('GPL')
-depends=('file' 'speex' 'boost-libs' 'libsndfile' 'qt3' 'libzrtpcpp' 'commoncpp2')
-makedepends=('pkg-config' 'boost' 'gendesk')
-source=("http://www.xs4all.nl/~mfnboer/$pkgname/download/$pkgname-$pkgver.tar.gz"
- twinkle-1.4.2-ccrtp.patch)
-md5sums=('d70c8972f296ffd998c7fb698774705b'
- '934f59ff60a8ae29a152feb8bf131ae2')
+pkgver=1.10.2
+pkgrel=1
+pkgdesc='Softphone for voice over IP and IM communication using SIP'
+arch=('x86_64')
+url='http://twinkle.dolezel.info/'
+license=('GPL2')
+depends=('ucommon' 'ccrtp' 'libxml2' 'libsndfile' 'imagemagick' 'readline'
+ 'qt5-base' 'qt5-declarative' 'alsa-lib' 'libzrtpcpp'
+ 'bcg729' 'speex' 'speexdsp')
+makedepends=('cmake' 'bison' 'flex' 'qt5-tools')
+source=("https://github.com/LubosD/twinkle/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz"
+ 'G729-API.patch')
+b2sums=('52cfa4f1d31b040db46edadccc43431d04fe71036821a1ef0c5b8803bf7ccf2fcd1d15a8340e583d049c588290a85c8ee07c6738adc599d164f7f606b2f34dc1'
+ 'e86166cc48c46697f5b20bdc3fbd169dcb07214aa47d030d554fe7bd10e79748f88ca2a4a1ce359ba879c1edfe63ffed10cbba9c11b04f6171b491e14b67189c')
prepare() {
-# gendesk
- cd "$pkgname-$pkgver"
- patch -p1 -i "$srcdir"/twinkle-1.4.2-ccrtp.patch
+ cd ${pkgname}-${pkgver}
+ patch -Np1 < "${srcdir}"/G729-API.patch
}
build() {
- cd "$pkgname-$pkgver"
- autoreconf -fi
- export QTDIR=/usr/lib/qt3
- export PATH=$QTDIR/bin:$PATH
- CPPFLAGS="$CPPFLAGS -I/usr/include/qt3 -I/usr/include/libzrtpcpp" \
- ./configure --prefix=/usr \
- --without-kde \
- --with-speex \
- --without-ilbc \
- --mandir=/usr/share/man
- make
+ cd ${pkgname}-${pkgver}
+ cmake -B build -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DWITH_QT5=On \
+ -DWITH_DBUS=On \
+ -DWITH_ALSA=On \
+ -DWITH_ZRTP=On \
+ -DWITH_G729=On \
+ -DWITH_SPEEX=On
+ make -C build
}
package() {
- cd "$pkgname-$pkgver"
-
- make DESTDIR="$pkgdir" install
- install -Dm644 "$pkgdir/usr/share/twinkle/twinkle48.png" \
- "$pkgdir/usr/share/pixmaps/twinkle.png"
- install -Dm644 twinkle.desktop \
- "$pkgdir/usr/share/applications/twinkle.desktop"
+ cd ${pkgname}-${pkgver}
+ make -C build DESTDIR="${pkgdir}" install
}
diff --git a/twinkle-1.4.2-ccrtp.patch b/twinkle-1.4.2-ccrtp.patch
deleted file mode 100644
index fdb5f6260e23..000000000000
--- a/twinkle-1.4.2-ccrtp.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -pruN twinkle-1.4.2-o/configure.in twinkle-1.4.2/configure.in
---- twinkle-1.4.2-o/configure.in 2009-02-24 11:49:20.000000000 -0800
-+++ twinkle-1.4.2/configure.in 2012-05-19 09:20:51.151778516 -0700
-@@ -66,7 +66,7 @@ fi
-
- export PKG_CONFIG_PATH
-
--PKG_CHECK_MODULES(CCRTP, libccrtp1 >= 1.6.0)
-+PKG_CHECK_MODULES(CCRTP, libccrtp >= 2.0.0)
-
- PKG_CHECK_MODULES(XML2, libxml-2.0)
- # AC_CHECK_HEADER(libxml/tree.h, [],
-diff -pruN twinkle-1.4.2-o/src/log.cpp twinkle-1.4.2/src/log.cpp
---- twinkle-1.4.2-o/src/log.cpp 2009-01-18 06:35:28.000000000 -0800
-+++ twinkle-1.4.2/src/log.cpp 2012-05-19 09:21:11.071594114 -0700
-@@ -161,7 +161,7 @@ void t_log::write_header(const string &f
-
- gettimeofday(&t, NULL);
- date = t.tv_sec;
-- localtime_r(&date, &tm);
-+ ::localtime_r(&date, &tm);
-
- *log_stream << "+++ ";
- *log_stream << tm.tm_mday;