Package: asterisk / 1:13.14.1~dfsg-2+deb9u4

ffmpeg-detection.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: Modernize autotools FFmpeg linking
 FFmpeg is a _family_ of libraries sharing an optional base subdir. That
 is not properly reflected in the autoconf detection logic, and makes it
 impossible to handle alternate location - e.g. when using Libav.
 .
 This patch queries pkg-config, used with recent FFmpeg, for files
 "libavcodec" and "libswscale", the family members currently used.
Author: Jonas Smedegaard <dr@jones.dk>
Bug-Debian: http://bugs.debian.org/531728
Last-Update: 2016-04-02

--- a/configure.ac
+++ b/configure.ac
@@ -419,7 +419,7 @@
 AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_SRTP], [OpenSSL SRTP Extension Support], [CRYPTO], [crypto])
 AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_EC], [OpenSSL Elliptic Curve Support], [CRYPTO], [crypto])
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
-AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec])
+AST_EXT_LIB_SETUP([FFMPEG], [FFmpeg (avcodec and swscale)], [ffmpeg])
 AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise])
 AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise])
 AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2])
@@ -2550,7 +2550,18 @@
 
 AST_EXT_TOOL_CHECK([SDL], [sdl-config])
 AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}])
-AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [${PTHREAD_LIBS} -lz -lm], [${PTHREAD_CFLAGS}])
+
+PBX_FFMPEG=0
+AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
+if test ! "x${PKGCONFIG}" = xNo; then
+   FFMPEG_INCLUDE=$(${PKGCONFIG} libavcodec libswscale --cflags 2>/dev/null)
+   FFMPEG_LIB=$(${PKGCONFIG} libavcodec libswscale --libs)
+   PBX_FFMPEG=1
+   AC_DEFINE([HAVE_FFMPEG], 1, [Define if your system has the FFmpeg libraries.])
+fi
+AC_SUBST(PBX_FFMPEG)
+AC_SUBST(FFMPEG_INCLUDE)
+AC_SUBST(FFMPEG_LIB)
 
 # possible places for video4linux version 1
 AC_CHECK_HEADER([linux/videodev.h],