[MPlayer-dev-eng] build is broken after latest FFmpeg major bumps

Alexander Strasser eclipse7 at gmx.net
Sun Oct 22 23:41:31 EEST 2017


On 2017-10-22 11:29 +0200, Alexander Strasser wrote:
> as you might have already noticed the build is broken since yesterday.
> 
> We already got bug report about that today: trac #2334
> 
> 
> I am working on this since yesterday evening. I have fixed
> the build locally, but for some changes getting them right
> will not be trivial.
> 
> I will commit the trivial stuff soonish.

Committed a few hours ago.

> For the remaining issues I will post a patch here. I am
> hoping for your ideas and support.

Two patches attached to this email:

 1. The first one should be OK to commit.
 2. The 2nd one is unacceptable, but it might help as a
    starting point for fixing, that avoids build errors.
    Anyways it at least shows the remaining problems.

If someone starts working on this, please email me here or
in private. Would be nice to avoid duplicated work.


  Alexander
-------------- next part --------------
>From b489bc8e8e302745c24792705d5f844656c5483b Mon Sep 17 00:00:00 2001
From: Alexander Strasser <eclipse7 at gmx.net>
Date: Sun, 22 Oct 2017 10:30:20 +0200
Subject: [PATCH 1/2] ve_lavc: Explicitly use 16 as upper limit for
 vmax_b_frames

The FF_MAX_B_FRAMES #define was removed from FFmpeg's API.

It was removed because there is no global limit to the number of
b frames. While this is the most conservative change to address
the removal of the #define, it is still wrong because we do not
allow for more than 16 b frames.
---
 libmpcodecs/ve_lavc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index 398383568..64775c6f3 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -202,7 +202,7 @@ const m_option_t lavcopts_conf[]={
 	{"vqcomp", &lavc_param_vqcompress, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
 	{"vqblur", &lavc_param_vqblur, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
 	{"vb_qfactor", &lavc_param_vb_qfactor, CONF_TYPE_FLOAT, CONF_RANGE, -31.0, 31.0, NULL},
-	{"vmax_b_frames", &lavc_param_vmax_b_frames, CONF_TYPE_INT, CONF_RANGE, 0, FF_MAX_B_FRAMES, NULL},
+	{"vmax_b_frames", &lavc_param_vmax_b_frames, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL}, // The global constant limit was removed from FFmpeg. We still use it here, so we probably limit ourselves in some cases.
 	{"vpass", &lavc_param_vpass, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
 	{"vrc_strategy", &lavc_param_vrc_strategy, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
 	{"vb_strategy", &lavc_param_vb_strategy, CONF_TYPE_INT, CONF_RANGE, 0, 10, NULL},
-- 
2.13.3

-------------- next part --------------
>From ebb88533e5dcccb74d23bbb81c3cf2a7bc407fda Mon Sep 17 00:00:00 2001
From: Alexander Strasser <eclipse7 at gmx.net>
Date: Sun, 22 Oct 2017 10:36:21 +0200
Subject: [PATCH 2/2] WIP: Ugly and wrong changes to compensate for removals in
 FFmpeg's API

THIS IS NOT MEANT TO BE COMMITTED TO MPLAYER'S UPSTREAM REPO.

THIS IS JUST TO SHOW WHAT STILL NEEDS TO BE RESOLVED TO ENABLE MCDEINT
AND THE LAVC ENCODERS AGAIN.
---
 Makefile                 |  5 ++++-
 libmpcodecs/ve_lavc.c    | 36 ++++++++++++++++++------------------
 libmpcodecs/vf_mcdeint.c |  2 +-
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index afc8eb183..f59f6358e 100644
--- a/Makefile
+++ b/Makefile
@@ -68,6 +68,7 @@ SRCS_COMMON-$(CONFIG_VF_LAVFI)      +=  libmpcodecs/vf_lavfi.c
 
 # These filters use private headers and do not work with shared FFmpeg.
 SRCS_COMMON-$(FFMPEG_A)              += libmpcodecs/vf_fspp.c           \
+                                        libmpcodecs/vf_mcdeint.c        \
                                         libmpcodecs/vf_qp.c             \
                                         libmpcodecs/vf_spp.c            \
                                         libmpcodecs/vf_uspp.c           \
@@ -615,7 +616,9 @@ SRCS_MPLAYER = command.c                \
 
 #MEncoder
 SRCS_MENCODER-$(FAAC)             += libmpcodecs/ae_faac.c
-SRCS_MENCODER-$(FFMPEG)           += libmpdemux/muxer_lavf.c
+SRCS_MENCODER-$(FFMPEG)           += libmpcodecs/ae_lavc.c              \
+                                     libmpcodecs/ve_lavc.c              \
+                                     libmpdemux/muxer_lavf.c
 SRCS_MENCODER-$(LIBDV)            += libmpcodecs/ve_libdv.c
 SRCS_MENCODER-$(LIBLZO)           += libmpcodecs/ve_nuv.c               \
                                      libmpcodecs/native/rtjpegn.c
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index 64775c6f3..02bd6e9aa 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -138,8 +138,8 @@ static int lavc_param_last_pred= 0;
 static int lavc_param_pre_me= 1;
 static int lavc_param_me_subpel_quality= 8;
 static int lavc_param_me_range= 0;
-static int lavc_param_ibias= FF_DEFAULT_QUANT_BIAS;
-static int lavc_param_pbias= FF_DEFAULT_QUANT_BIAS;
+static int lavc_param_ibias= 0; //FIXME: FF_DEFAULT_QUANT_BIAS;
+static int lavc_param_pbias= 0; //FIXME: FF_DEFAULT_QUANT_BIAS;
 static int lavc_param_coder= 0;
 static int lavc_param_context= 0;
 static char *lavc_param_intra_matrix = NULL;
@@ -280,7 +280,7 @@ const m_option_t lavcopts_conf[]={
 	{"alt", &lavc_param_alt, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"ilme", &lavc_param_ilme, CONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME, NULL},
 	{"cgop", &lavc_param_closed_gop, CONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP, NULL},
-	{"gmc", &lavc_param_gmc, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC, NULL},
+	{"gmc", &lavc_param_gmc, CONF_TYPE_FLAG, 0, 0, 0 /* FIXME: CODEC_FLAG_GMC */, NULL},
 	{"dc", &lavc_param_dc_precision, CONF_TYPE_INT, CONF_RANGE, 8, 11, NULL},
 	{"border_mask", &lavc_param_border_masking, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
 	{"inter_threshold", "inter_threshold has no effect, please remove it.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
@@ -353,8 +353,8 @@ static int config(struct vf_instance *vf,
     lavc_venc_context->time_base= (AVRational){mux_v->h.dwScale, mux_v->h.dwRate};
     lavc_venc_context->qmin= lavc_param_vqmin;
     lavc_venc_context->qmax= lavc_param_vqmax;
-    lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
-    lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
+    //FIXME: lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
+    //FIXME: lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
     lavc_venc_context->mb_lmin= (int)(FF_QP2LAMBDA * lavc_param_mb_lmin + 0.5);
     lavc_venc_context->mb_lmax= (int)(FF_QP2LAMBDA * lavc_param_mb_lmax + 0.5);
     lavc_venc_context->max_qdiff= lavc_param_vqdiff;
@@ -362,17 +362,17 @@ static int config(struct vf_instance *vf,
     lavc_venc_context->qblur= lavc_param_vqblur;
     lavc_venc_context->max_b_frames= lavc_param_vmax_b_frames;
     lavc_venc_context->b_quant_factor= lavc_param_vb_qfactor;
-    lavc_venc_context->rc_strategy= lavc_param_vrc_strategy;
+    //FIXME: lavc_venc_context->rc_strategy= lavc_param_vrc_strategy;
     lavc_venc_context->b_frame_strategy= lavc_param_vb_strategy;
     lavc_venc_context->b_quant_offset= (int)(FF_QP2LAMBDA * lavc_param_vb_qoffset + 0.5);
     lavc_venc_context->rtp_payload_size= lavc_param_packet_size;
     lavc_venc_context->strict_std_compliance= lavc_param_strict;
     lavc_venc_context->i_quant_factor= lavc_param_vi_qfactor;
     lavc_venc_context->i_quant_offset= (int)(FF_QP2LAMBDA * lavc_param_vi_qoffset + 0.5);
-    lavc_venc_context->rc_qsquish= lavc_param_rc_qsquish;
-    lavc_venc_context->rc_qmod_amp= lavc_param_rc_qmod_amp;
-    lavc_venc_context->rc_qmod_freq= lavc_param_rc_qmod_freq;
-    lavc_venc_context->rc_eq= av_strdup(lavc_param_rc_eq);
+    //FIXME: lavc_venc_context->rc_qsquish= lavc_param_rc_qsquish;
+    //FIXME: lavc_venc_context->rc_qmod_amp= lavc_param_rc_qmod_amp;
+    //FIXME: lavc_venc_context->rc_qmod_freq= lavc_param_rc_qmod_freq;
+    //FIXME: lavc_venc_context->rc_eq= av_strdup(lavc_param_rc_eq);
 
     mux_v->max_rate=
     lavc_venc_context->rc_max_rate= lavc_param_rc_max_rate*1000;
@@ -384,8 +384,8 @@ static int config(struct vf_instance *vf,
     lavc_venc_context->rc_initial_buffer_occupancy=
             lavc_venc_context->rc_buffer_size *
             lavc_param_rc_initial_buffer_occupancy;
-    lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
-    lavc_venc_context->rc_initial_cplx= lavc_param_rc_initial_cplx;
+    //FIXME: lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
+    //FIXME: lavc_venc_context->rc_initial_cplx= lavc_param_rc_initial_cplx;
     lavc_venc_context->debug= lavc_param_debug;
     lavc_venc_context->last_predictor_count= lavc_param_last_pred;
     lavc_venc_context->pre_me= lavc_param_pre_me;
@@ -393,8 +393,8 @@ static int config(struct vf_instance *vf,
     lavc_venc_context->pre_dia_size= lavc_param_pre_dia_size;
     lavc_venc_context->me_subpel_quality= lavc_param_me_subpel_quality;
     lavc_venc_context->me_range= lavc_param_me_range;
-    lavc_venc_context->intra_quant_bias= lavc_param_ibias;
-    lavc_venc_context->inter_quant_bias= lavc_param_pbias;
+    //FIXME: lavc_venc_context->intra_quant_bias= lavc_param_ibias;
+    //FIXME: lavc_venc_context->inter_quant_bias= lavc_param_pbias;
     lavc_venc_context->coder_type= lavc_param_coder;
     lavc_venc_context->context_model= lavc_param_context;
     lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
@@ -481,7 +481,7 @@ static int config(struct vf_instance *vf,
     lavc_venc_context->spatial_cplx_masking= lavc_param_spatial_cplx_masking;
     lavc_venc_context->p_masking= lavc_param_p_masking;
     lavc_venc_context->dark_masking= lavc_param_dark_masking;
-        lavc_venc_context->border_masking = lavc_param_border_masking;
+        //FIXME: lavc_venc_context->border_masking = lavc_param_border_masking;
 
     if (lavc_param_aspect != NULL)
     {
@@ -560,14 +560,14 @@ static int config(struct vf_instance *vf,
 #endif
     lavc_venc_context->flags|= lavc_param_gray;
 
-    if(lavc_param_normalize_aqp) lavc_venc_context->flags|= CODEC_FLAG_NORMALIZE_AQP;
+    //FIXME: if(lavc_param_normalize_aqp) lavc_venc_context->flags|= CODEC_FLAG_NORMALIZE_AQP;
     if(lavc_param_interlaced_dct) lavc_venc_context->flags|= AV_CODEC_FLAG_INTERLACED_DCT;
     lavc_venc_context->flags|= lavc_param_psnr;
     lavc_venc_context->intra_dc_precision = lavc_param_dc_precision - 8;
     lavc_venc_context->prediction_method= lavc_param_prediction_method;
     lavc_venc_context->brd_scale = lavc_param_brd_scale;
     lavc_venc_context->bidir_refine = lavc_param_bidir_refine;
-    lavc_venc_context->scenechange_factor = lavc_param_sc_factor;
+    //FIXME: lavc_venc_context->scenechange_factor = lavc_param_sc_factor;
     if((lavc_param_video_global_header&1)
        /*|| (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))*/){
         lavc_venc_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
@@ -655,7 +655,7 @@ static int config(struct vf_instance *vf,
     }
     }
 
-    lavc_venc_context->me_method = ME_ZERO+lavc_param_vme;
+    //FIXME: lavc_venc_context->me_method = ME_ZERO+lavc_param_vme;
 
     /* fixed qscale :p */
     if (lavc_param_vqscale >= 0.0)
diff --git a/libmpcodecs/vf_mcdeint.c b/libmpcodecs/vf_mcdeint.c
index d7c91e1d0..69a1d62a1 100644
--- a/libmpcodecs/vf_mcdeint.c
+++ b/libmpcodecs/vf_mcdeint.c
@@ -243,7 +243,7 @@ static int config(struct vf_instance *vf,
             case 3:
                 avctx_enc->refs= 3;
             case 2:
-                avctx_enc->me_method= ME_ITER;
+                //FIXME: avctx_enc->me_method= ME_ITER;
             case 1:
                 avctx_enc->flags |= AV_CODEC_FLAG_4MV;
                 avctx_enc->dia_size=2;
-- 
2.13.3



More information about the MPlayer-dev-eng mailing list