contrib: dav1d: use the official 0.1.0
authorSteve Lhomme <robux4@ycbcr.xyz>
Thu, 13 Dec 2018 09:34:23 +0000 (10:34 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Sun, 16 Dec 2018 12:38:08 +0000 (13:38 +0100)
update the ffmpeg hash to use the latest API changes of dav1d

contrib/src/dav1d/0001-add-an-option-to-disable-the-.rc-compilation.patch [deleted file]
contrib/src/dav1d/rules.mak
contrib/src/ffmpeg/rules.mak
modules/codec/dav1d.c

diff --git a/contrib/src/dav1d/0001-add-an-option-to-disable-the-.rc-compilation.patch b/contrib/src/dav1d/0001-add-an-option-to-disable-the-.rc-compilation.patch
deleted file mode 100644 (file)
index 1cfcb79..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From f459feb6b0b4ad526d794c8c3f3e5a2f09806ecc Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4@videolan.org>
-Date: Fri, 9 Nov 2018 14:01:49 +0100
-Subject: [PATCH] add an option to disable the .rc compilation
-
-This is to avoid issues where Meson doesn't detect the .rc compiler properly
-and there is no way to disable the .rc files compilation for static targets.
----
- meson_options.txt | 6 ++++++
- src/meson.build   | 6 +++++-
- 2 files changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/meson_options.txt b/meson_options.txt
-index 08e75ad..bedbc7a 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -30,3 +30,9 @@ option('fuzzing_engine',
-     choices : ['none', 'libfuzzer', 'oss-fuzz'],
-     value: 'none',
-     description: 'Select the fuzzing engine')
-+
-+# temporary option until it can be done automatically only when 
-+option('win32_ver',
-+    type: 'boolean',
-+    value: true,
-+    description: 'Add a version number to the built library on Windows')
-diff --git a/src/meson.build b/src/meson.build
-index 5515c2e..fefa0b0 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -146,7 +146,11 @@ if host_machine.system() == 'windows'
-         configuration : rc_data
-     )
--    libdav1d_rc_obj = winmod.compile_resources(rc_file)
-+    if get_option('win32_ver')
-+        libdav1d_rc_obj = winmod.compile_resources(rc_file)
-+    else
-+        libdav1d_rc_obj = []
-+    endif
- else
-     libdav1d_rc_obj = []
- endif
--- 
-2.17.0.windows.1
-
index 411a9b1..54c864a 100644 (file)
@@ -1,8 +1,10 @@
 # libdav1d
 
-DAV1D_HASH := 8c95771dfa7a0bdb542eef8924bd0d3009e5efff
-DAV1D_VERSION := git-$(DAV1D_HASH)
-DAV1D_GITURL := https://code.videolan.org/videolan/dav1d.git
+DAV1D_VERSION := 0.1.0
+DAV1D_URL := $(VIDEOLAN)/dav1d/$(DAV1D_VERSION)/dav1d-$(DAV1D_VERSION).tar.xz
+#~ DAV1D_HASH := 8c95771dfa7a0bdb542eef8924bd0d3009e5efff
+#~ DAV1D_VERSION := git-$(DAV1D_HASH)
+#~ DAV1D_GITURL := https://code.videolan.org/videolan/dav1d.git
 
 PKGS += dav1d
 ifeq ($(call need_pkg,"dav1d"),)
@@ -15,15 +17,13 @@ DAV1D_CONF += -D win32_ver=false
 endif
 
 $(TARBALLS)/dav1d-$(DAV1D_VERSION).tar.xz:
-       $(call download_git,$(DAV1D_GITURL),,$(DAV1D_HASH))
+       $(call download_pkg,$(DAV1D_URL),dav1d)
+       #~ $(call download_git,$(DAV1D_URL),,$(DAV1D_HASH))
 
 .sum-dav1d: dav1d-$(DAV1D_VERSION).tar.xz
-       $(call check_githash,$(DAV1D_HASH))
-       touch $@
 
 dav1d: dav1d-$(DAV1D_VERSION).tar.xz .sum-dav1d
        $(UNPACK)
-       $(APPLY) $(SRC)/dav1d/0001-add-an-option-to-disable-the-.rc-compilation.patch
        $(MOVE)
 
 .dav1d: dav1d crossfile.meson
index ca00a2b..88ab153 100644 (file)
@@ -5,7 +5,7 @@
 #USE_FFMPEG ?= 1
 
 ifndef USE_LIBAV
-FFMPEG_HASH=d0e740b8fb30f02914594d00eb311a32442a63f8
+FFMPEG_HASH=0e833f615b59cd7611374d1d77257eaf00635ad7
 FFMPEG_GITURL := http://git.videolan.org/git/ffmpeg.git
 FFMPEG_LAVC_MIN := 57.37.100
 USE_FFMPEG := 1
index 18d7b34..40c5d29 100644 (file)
@@ -123,12 +123,12 @@ static int NewPicture(Dav1dPicture *img, void *cookie)
         v->i_sar_den = 1;
     }
 
-    if(dec->fmt_in.video.primaries == COLOR_PRIMARIES_UNDEF)
+    if(dec->fmt_in.video.primaries == COLOR_PRIMARIES_UNDEF && img->seq_hdr)
     {
-        v->primaries = iso_23001_8_cp_to_vlc_primaries(img->p.pri);
-        v->transfer = iso_23001_8_tc_to_vlc_xfer(img->p.trc);
-        v->space = iso_23001_8_mc_to_vlc_coeffs(img->p.mtrx);
-        v->b_color_range_full = img->p.fullrange;
+        v->primaries = iso_23001_8_cp_to_vlc_primaries(img->seq_hdr->pri);
+        v->transfer = iso_23001_8_tc_to_vlc_xfer(img->seq_hdr->trc);
+        v->space = iso_23001_8_mc_to_vlc_coeffs(img->seq_hdr->mtrx);
+        v->b_color_range_full = img->seq_hdr->color_range;
     }
 
     v->projection_mode = dec->fmt_in.video.projection_mode;
@@ -155,12 +155,11 @@ static int NewPicture(Dav1dPicture *img, void *cookie)
     return -1;
 }
 
-static void FreePicture(uint8_t *data, void *allocator_data, void *cookie)
+static void FreePicture(Dav1dPicture *data, void *cookie)
 {
-    picture_t *pic = allocator_data;
+    picture_t *pic = data->allocator_data;
     decoder_t *dec = cookie;
     VLC_UNUSED(dec);
-    assert( data == pic->p[0].p_pixels );
     picture_Release(pic);
 }
 
@@ -216,8 +215,15 @@ static int Decode(decoder_t *dec, block_t *block)
     timestamp_FifoPut(p_sys->ts_fifo, pts);
     int res;
     do {
-        res = dav1d_decode(p_sys->c, p_data, &img);
+        res = dav1d_send_data(p_sys->c, p_data);
+        if (res < 0 && res != -EAGAIN)
+        {
+            msg_Err(dec, "Decoder feed error %d!", res);
+            i_ret = VLC_EGENERIC;
+            break;
+        }
 
+        res = dav1d_get_picture(p_sys->c, &img);
         if (res == 0)
         {
             picture_t *_pic = img.allocator_data;