summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaco Kroon <jaco@uls.co.za>2023-07-09 21:18:49 +0200
committerJoonas Niilola <juippis@gentoo.org>2023-07-27 09:48:10 +0300
commit45426048c79dff064f62206e01827d63798e39be (patch)
treea89ac331c7e2a4fc2710e792fc8b49ca8c96f37a /net-libs/pjproject
parentmedia-gfx/tuxpaint: Keyword 0.9.29 x86, #908286 (diff)
downloadgentoo-45426048c79dff064f62206e01827d63798e39be.tar.gz
gentoo-45426048c79dff064f62206e01827d63798e39be.tar.bz2
gentoo-45426048c79dff064f62206e01827d63798e39be.zip
net-libs/pjproject: add 2.13.1
Signed-off-by: Jaco Kroon <jaco@uls.co.za> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-libs/pjproject')
-rw-r--r--net-libs/pjproject/Manifest1
-rw-r--r--net-libs/pjproject/files/pjproject-2.13.1-fix-ptimesized-wav-input.patch30
-rw-r--r--net-libs/pjproject/pjproject-2.13.1.ebuild143
3 files changed, 174 insertions, 0 deletions
diff --git a/net-libs/pjproject/Manifest b/net-libs/pjproject/Manifest
index c081c0e1aeb2..0082f1020d94 100644
--- a/net-libs/pjproject/Manifest
+++ b/net-libs/pjproject/Manifest
@@ -1 +1,2 @@
+DIST pjproject-2.13.1.tar.gz 9746437 BLAKE2B a50278be52df755c5cec08da0c1a604a8c0ad6911853a424596ce05bc423a829818d2e7425b55bdc00fa24a91b9a3e891c54aa2add5cdbf8698173ac44ae2975 SHA512 1cdfaedafa2f42b306eef38174530163db19952c6842d5c96324c7439e2437a17cd96670ac58ae04da221b06d7eb91d612f4347cd421e036be62b27cb9501cda
DIST pjproject-2.13.tar.gz 9744716 BLAKE2B 947fe076089b3cd0826a554db3cda9939e228b9e7bb5ed2d01242e44e5e5b0d9d2ddc52b378f141efb89fcbfbd628fcdff341e54bc3615280e23f30ea58daf56 SHA512 df184511d554e5f77ca1a551bdf6b22c4c8ae2b6ad61be0e7e459e2d7db50f496af66c37e080f178019a509ea25847e70a342ac48c820a6b9302b4cbf174c520
diff --git a/net-libs/pjproject/files/pjproject-2.13.1-fix-ptimesized-wav-input.patch b/net-libs/pjproject/files/pjproject-2.13.1-fix-ptimesized-wav-input.patch
new file mode 100644
index 000000000000..9f1459f68d63
--- /dev/null
+++ b/net-libs/pjproject/files/pjproject-2.13.1-fix-ptimesized-wav-input.patch
@@ -0,0 +1,30 @@
+From dc4d4587cb8abe07513b9ae24cf62eaeeb6e8907 Mon Sep 17 00:00:00 2001
+From: Jaco Kroon <jaco@uls.co.za>
+Date: Wed, 14 Jun 2023 16:39:41 +0200
+Subject: [PATCH] Fix wave port creation if the input wave file contains
+ exactly one frame.
+
+If for example we try to load a file with ptime=10 and there is exactly
+10 ms worth of PCM data in the wave file (160 bytes of PCM data) then
+the buff_size will be adjusted down to be of a size that matches exactly
+one frame, resulting in the check that the buffer size can hold at least
+one frame failing due to comparing >= instead of >.
+
+Signed-off-by: Jaco Kroon <jaco@uls.co.za>
+---
+ pjmedia/src/pjmedia/wav_player.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pjmedia/src/pjmedia/wav_player.c b/pjmedia/src/pjmedia/wav_player.c
+index 84ba53d50..410cf2627 100644
+--- a/pjmedia/src/pjmedia/wav_player.c
++++ b/pjmedia/src/pjmedia/wav_player.c
+@@ -428,7 +428,7 @@ PJ_DEF(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool,
+ /* samples_per_frame must be smaller than bufsize (because get_frame()
+ * doesn't handle this case).
+ */
+- if (samples_per_frame * fport->bytes_per_sample >= fport->bufsize) {
++ if (samples_per_frame * fport->bytes_per_sample > fport->bufsize) {
+ pj_file_close(fport->fd);
+ return PJ_EINVAL;
+ }
diff --git a/net-libs/pjproject/pjproject-2.13.1.ebuild b/net-libs/pjproject/pjproject-2.13.1.ebuild
new file mode 100644
index 000000000000..3620c5411601
--- /dev/null
+++ b/net-libs/pjproject/pjproject-2.13.1.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+# TODO: Figure out a way to disable SRTP from pjproject entirely.
+EAPI=8
+
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="Open source SIP, Media, and NAT Traversal Library"
+HOMEPAGE="https://github.com/pjsip/pjproject https://www.pjsip.org/"
+SRC_URI="https://github.com/pjsip/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+
+# g729 not included due to special bcg729 handling.
+CODEC_FLAGS="g711 g722 g7221 gsm ilbc speex l16"
+VIDEO_FLAGS="sdl ffmpeg v4l2 openh264 libyuv vpx"
+SOUND_FLAGS="alsa portaudio"
+IUSE="amr debug epoll examples opus resample silk ssl static-libs webrtc
+ ${CODEC_FLAGS} g729
+ ${VIDEO_FLAGS}
+ ${SOUND_FLAGS}"
+
+RDEPEND=">=net-libs/libsrtp-2.3.0:=
+ alsa? ( media-libs/alsa-lib )
+ amr? ( media-libs/opencore-amr )
+ ffmpeg? ( media-video/ffmpeg:= )
+ g729? ( media-libs/bcg729 )
+ gsm? ( media-sound/gsm )
+ ilbc? ( media-libs/libilbc )
+ openh264? ( media-libs/openh264 )
+ opus? ( media-libs/opus )
+ portaudio? ( media-libs/portaudio )
+ resample? ( media-libs/libsamplerate )
+ sdl? ( media-libs/libsdl2 )
+ speex? (
+ media-libs/speex
+ media-libs/speexdsp
+ )
+ ssl? (
+ dev-libs/openssl:0=
+ )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/pjproject-2.13-r1-Make-sure-that-NOTIFY-tdata-is-set-before-sending-it_new.patch"
+ "${FILESDIR}/pjproject-2.13.1-fix-ptimesized-wav-input.patch"
+)
+
+src_prepare() {
+ default
+ rm configure || die "Unable to remove unwanted wrapper"
+ mv aconfigure.ac configure.ac || die "Unable to rename configure script source"
+ eautoreconf
+
+ cp "${FILESDIR}/pjproject-2.12.1-config_site.h" "${S}/pjlib/include/pj/config_site.h" \
+ || die "Unable to create config_site.h"
+}
+
+_pj_enable() {
+ usex "$1" '' "--disable-${2:-$1}"
+}
+
+_pj_get_define() {
+ local r="$(sed -nre "s/^#define[[:space:]]+$1[[:space:]]+//p" "${S}/pjlib/include/pj/config_site.h")"
+ [[ -z "${r}" ]] && die "Unable to fine #define $1 in config_site.h"
+ echo "$r"
+}
+
+_pj_set_define() {
+ local c=$(_pj_get_define "$1")
+ [[ "$c" = "$2" ]] && return 0
+ sed -re "s/^#define[[:space:]]+$1[[:space:]].*/#define $1 $2/" -i "${S}/pjlib/include/pj/config_site.h" \
+ || die "sed failed updating $1 to $2."
+ [[ "$(_pj_get_define "$1")" != "$2" ]] && die "sed failed to perform update for $1 to $2."
+}
+
+_pj_use_set_define() {
+ _pj_set_define "$2" $(usex "$1" 1 0)
+}
+
+src_configure() {
+ local myconf=()
+ local videnable="--disable-video"
+ local t
+
+ use debug || append-cflags -DNDEBUG=1
+
+ for t in ${CODEC_FLAGS}; do
+ myconf+=( $(_pj_enable ${t} ${t}-codec) )
+ done
+ myconf+=( $(_pj_enable g729 bcg729) )
+
+ for t in ${VIDEO_FLAGS}; do
+ myconf+=( $(_pj_enable ${t}) )
+ use "${t}" && videnable="--enable-video"
+ done
+
+ [ "${videnable}" = "--enable-video" ] && _pj_set_define PJMEDIA_HAS_VIDEO 1 || _pj_set_define PJMEDIA_HAS_VIDEO 0
+
+ LD="$(tc-getCC)" econf \
+ --enable-shared \
+ --with-external-srtp \
+ ${videnable} \
+ $(_pj_enable alsa sound) \
+ $(_pj_enable amr opencore-amr) \
+ $(_pj_enable epoll) \
+ $(_pj_enable opus) \
+ $(_pj_enable portaudio ext-sound) \
+ $(_pj_enable resample libsamplerate) \
+ $(_pj_enable resample resample-dll) \
+ $(_pj_enable resample) \
+ $(_pj_enable silk) \
+ $(_pj_enable speex speex-aec) \
+ $(_pj_enable ssl) \
+ $(_pj_enable webrtc libwebrtc) \
+ $(use_with gsm external-gsm) \
+ $(use_with portaudio external-pa) \
+ $(use_with speex external-speex) \
+ "${myconf[@]}"
+}
+
+src_compile() {
+ emake dep LD="$(tc-getCC)"
+ emake LD="$(tc-getCC)"
+}
+
+src_install() {
+ default
+
+ newbin pjsip-apps/bin/pjsua-${CHOST} pjsua
+ newbin pjsip-apps/bin/pjsystest-${CHOST} pjsystest
+
+ if use examples; then
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r pjsip-apps/src/samples
+ fi
+
+ use static-libs || rm "${ED}/usr/$(get_libdir)"/*.a || die "Error removing static archives"
+}