| 1 |
Description: Modernize autotools FFmpeg linking |
| 2 |
FFmpeg is a _family_ of libraries sharing an optional base subdir. |
| 3 |
That is not properly reflected in the autoconf detection logic, |
| 4 |
and makes it impossible to handle alternate location - |
| 5 |
e.g. when using Libav. |
| 6 |
. |
| 7 |
This patch queries pkg-config, used with recent FFmpeg, |
| 8 |
for files "libavcodec" and "libswscale", |
| 9 |
the family members currently used. |
| 10 |
Author: Jonas Smedegaard <[email protected]> |
| 11 |
Bug-Debian: https://bugs.debian.org/531728 |
| 12 |
Last-Update: 2022-01-22 |
| 13 |
--- |
| 14 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 15 |
--- a/configure.ac |
| 16 |
+++ b/configure.ac |
| 17 |
@@ -561,7 +561,7 @@ |
| 18 |
AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg]) |
| 19 |
AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt]) |
| 20 |
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi]) |
| 21 |
|
| 22 |
+AST_EXT_LIB_SETUP([FFMPEG], [FFmpeg (avcodec and swscale)], [ffmpeg]) |
| 23 |
AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise]) |
| 24 |
AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise]) |
| 25 |
AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2]) |
| 26 |
@@ -2830,7 +2830,18 @@ |
| 27 |
|
| 28 |
AST_EXT_TOOL_CHECK([SDL], [sdl-config]) |
| 29 |
AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}]) |
| 30 |
|
| 31 |
+ |
| 32 |
+PBX_FFMPEG=0 |
| 33 |
+AC_CHECK_TOOL(PKGCONFIG, pkg-config, No) |
| 34 |
+if test ! "x${PKGCONFIG}" = xNo; then |
| 35 |
+ FFMPEG_INCLUDE=$(${PKGCONFIG} libavcodec libswscale --cflags 2>/dev/null) |
| 36 |
+ FFMPEG_LIB=$(${PKGCONFIG} libavcodec libswscale --libs) |
| 37 |
+ PBX_FFMPEG=1 |
| 38 |
+ AC_DEFINE([HAVE_FFMPEG], 1, [Define if your system has the FFmpeg libraries.]) |
| 39 |
+fi |
| 40 |
+AC_SUBST(PBX_FFMPEG) |
| 41 |
+AC_SUBST(FFMPEG_INCLUDE) |
| 42 |
+AC_SUBST(FFMPEG_LIB) |
| 43 |
|
| 44 |
# possible places for video4linux version 1 |
| 45 |
AC_CHECK_HEADER([linux/videodev.h], |