LINUX.ORG.RU

Вбил поддержку libdav1d в MPlayer


0

1
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf     (revision 38140)
+++ etc/codecs.conf     (working copy)
@@ -8,6 +8,14 @@
 ;=============================================================================
 ;                   VIDEO CODECS
 ;=============================================================================
+videocodec av1
+  info "AV1"
+  status working
+  driver ffmpeg
+  dll libdav1d
+  format 0x31305641
+  format 0x31307661
+  out YV12

 videocodec ffiff
   info "FFmpeg IFF ANIM/ILBM/PBM/RGB8/RGBN"

Index: configure
===================================================================
--- configure   (revision 38140)
+++ configure   (working copy)
@@ -797,6 +797,7 @@
 _joystick=no
 crystalhd=auto
 _xvid=auto
+_libdav1d=yes
 _xvid_lavc=auto
 _x264=auto
 _x264_lavc=auto
@@ -7405,6 +7406,28 @@
 fi
 echores "$_xvid"

+echocheck "libdav1d"
+if test "$_libdav1d" = auto ; then
+  _xvid=no
+  for ld_tmp in "-ldav1d"  "-ldav1d $ld_pthread" ; do
+    statement_check dav1d.h 'xvid_plugin_ssim_t xs; xvid_global(0, 0, 0, 0)' $ld_tmp &&
+      extra_ldflags="$extra_ldflags $ld_tmp" && _xvid=yes && break
+  done
+fi
+
+if test "$_libdav1d" = yes ; then
+  def_libdav1d='#define CONFIG_LIBDAV1D 1'
+  libavdecoders="$libavdecoders LIBDAV1D_DECODER"
+  extra_ldflags="$extra_ldflags -ldav1d"
+else
+  def_libdav1d='#undef CONFIG_LIBDAV1D'
+  #nocodecmodules="libdav1d $nocodecmodules"
+fi
+echores "$_libdav1d"
+
+
+
+
 echocheck "Xvid two pass plugin"
 if test "$_mencoder" = yes && test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
   statement_check xvid.h 'xvid_plugin_2pass2_t s; s.vbv_size = 0' && _xvid_lavc=yes
@@ -9419,6 +9442,7 @@
 #define CONFIG_WMA_FREQS 1
 #define CONFIG_WMV2DSP 1

+
 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
 #ifndef MP_DEBUG
 #define HAVE_EBP_AVAILABLE 1
@@ -9426,7 +9450,7 @@
 #define HAVE_EBP_AVAILABLE 0
 #endif

-#define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
+#define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc --enable-libdav1d"
 #define FFMPEG_LICENSE "GPL version 2 or later"

 #define LIBAV_CONFIGURATION FFMPEG_CONFIGURATION

Как можно заметить, автодетект я неосилил пока, его надо из ffmpeg-овского configure тащить ....

Вроде даже и работает, хоть и ругается:
[libdav1d @ 0x57678b00]The deprecated avcodec_decode_* API cannot return all the frames for this decoder. Some frames will be dropped. Update your code to the new decoding API

Или даже так:

Index: configure
===================================================================
--- configure   (revision 38140)
+++ configure   (working copy)
@@ -797,6 +797,7 @@
 _joystick=no
 crystalhd=auto
 _xvid=auto
+_libdav1d=auto
 _xvid_lavc=auto
 _x264=auto
 _x264_lavc=auto
@@ -1249,6 +1250,8 @@
   --disable-xvid)       _xvid=no        ;;
   --enable-xvid-lavc)   _xvid_lavc=yes  ;;
   --disable-xvid-lavc)  _xvid_lavc=no   ;;
+  --enable-libdav1d)   _libdav1d=yes  ;;
+  --disable-libdav1d)  _libdav1d=no   ;;
   --enable-x264)        _x264=yes       ;;
   --disable-x264)       _x264=no        ;;
   --enable-x264-lavc)   _x264_lavc=yes  ;;
@@ -7405,6 +7408,25 @@
 fi
 echores "$_xvid"

+echocheck "libdav1d"
+if test "$_libdav1d" = auto && test "$ffmpeg_a" = yes ; then
+  _libdav1d=no
+  header_check dav1d/dav1d.h -ldav1d $ld_dl $ld_pthread && _libdav1d=yes
+fi
+
+if test "$_libdav1d" = yes && test "$ffmpeg_a" = yes; then
+  def_libdav1d='#define CONFIG_LIBDAV1D 1'
+  libavdecoders="$libavdecoders LIBDAV1D_DECODER"
+  extra_ldflags="$extra_ldflags -ldav1d"
+else
+  def_libdav1d='#undef CONFIG_LIBDAV1D'
+  #nocodecmodules="libdav1d $nocodecmodules"
+fi
+echores "$_libdav1d"
+
+
+
+
 echocheck "Xvid two pass plugin"
 if test "$_mencoder" = yes && test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
   statement_check xvid.h 'xvid_plugin_2pass2_t s; s.vbv_size = 0' && _xvid_lavc=yes
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf     (revision 38140)
+++ etc/codecs.conf     (working copy)
@@ -8,6 +8,14 @@
 ;=============================================================================
 ;                   VIDEO CODECS
 ;=============================================================================
+videocodec av1
+  info "AV1"
+  status working
+  driver ffmpeg
+  dll libdav1d
+  format 0x31305641
+  format 0x31307661
+  out YV12

 videocodec ffiff
   info "FFmpeg IFF ANIM/ILBM/PBM/RGB8/RGBN"

Andrew-R ★★ ()