File: 1007_ffmpeg_detect.patch

package info (click to toggle)
asterisk 1%3A22.7.0~dfsg%2B~cs6.15.60671435-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,036 kB
  • sloc: ansic: 1,007,320; cpp: 81,075; cs: 21,705; python: 16,883; xml: 15,422; sh: 14,675; makefile: 5,579; objc: 3,912; perl: 3,046; javascript: 3,018; java: 2,522; sql: 2,227; yacc: 2,160; tcl: 113; php: 62; asm: 56
file content (45 lines) | stat: -rw-r--r-- 1,991 bytes parent folder | 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
43
44
45
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: https://bugs.debian.org/531728
Last-Update: 2022-01-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/configure.ac
+++ b/configure.ac
@@ -561,7 +561,7 @@
 AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
 AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
 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])
@@ -2832,7 +2832,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],