[PATCH 1/2] configure: Detect libdav1d and enable the lavc libdav1d decoder

Alexander Strasser <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <7935ea93f04aac99a3dcd350e97b96579a2db34a.1578381156.git.eclipse7@gmx.net>
The codecs.conf entry was already added in SVN r38155 .

This change allows to autodetect/enable the libdav1d decoder for
internal FFmpeg.

Signed-off-by: Alexander Strasser <[email protected]>
---
 configure | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/configure b/configure
index 41c054686..bd24b0649 100755
--- a/configure
+++ b/configure
@@ -412,6 +412,7 @@ Codecs:
   --disable-x264            disable x264 [autodetect]
   --disable-x264-lavc       disable x264 in libavcodec [autodetect]
   --disable-libvpx-lavc     disable libvpx in libavcodec [autodetect]
+  --disable-libdav1d-lavc   disable libdav1d in libavcodec [autodetect]
   --disable-libnut          disable libnut [autodetect]
   --disable-ffmpeg_a        disable static FFmpeg [autodetect]
   --disable-ffmpeg_so       disable shared FFmpeg [autodetect]
@@ -806,6 +807,7 @@ _xvid_lavc=auto
 _x264=auto
 _x264_lavc=auto
 _libvpx_lavc=auto
+_libdav1d_lavc=auto
 _libnut=auto
 _lirc=auto
 _lircc=auto
@@ -7493,6 +7495,36 @@ else
 fi
 echores "$_libvpx_lavc"

+
+echocheck "libdav1d"
+if test "$_libdav1d_lavc" = auto; then
+  _libdav1d_lavc=no
+  if test "$ffmpeg_a" != yes; then
+    res_comment="dynamic linking to libdav1d is irrelevant when using dynamic FFmpeg"
+  else
+    cat > $TMPC << EOF
+#include <dav1d/dav1d.h>
+int main(void) {
+    const char *version_lib = dav1d_version();
+    return version_lib[0];
+}
+EOF
+    for ld_tmp in "-ldav1d" "-ldav1d $ld_pthread" ; do
+      cc_check $ld_tmp && _libdav1d_lavc=yes && extra_ldflags="$extra_ldflags $ld_tmp" && break
+    done
+  fi
+fi
+if test "$_libdav1d_lavc" = yes ; then
+  def_libdav1d_lavc='#define CONFIG_LIBDAV1D 1'
+  libavdecoders="$libavdecoders LIBDAV1D_DECODER"
+  codecmodules="libdav1d $codecmodules"
+else
+  def_libdav1d_lavc='#define CONFIG_LIBDAV1D 0'
+  nocodecmodules="libdav1d $nocodecmodules"
+fi
+echores "$_libdav1d_lavc"
+
+
 echocheck "libnut"
 if test "$_libnut" = auto ; then
   _libnut=no
@@ -9238,6 +9270,7 @@ $def_emmintrin_h
 /* external libraries */
 $def_bzlib
 $def_crystalhd
+$def_libdav1d_lavc
 $def_libgsm
 $def_libopencore_amrnb
 $def_libopencore_amrwb
--
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.