wok rev 16653

libquicktime: add ffmpeg patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 13 14:25:38 2014 +0000 (2014-05-13)
parents dabffe4f6ce3
children 06eca9e5596d
files libquicktime/receipt libquicktime/stuff/ffmpeg.u
line diff
     1.1 --- a/libquicktime/receipt	Tue May 13 14:15:55 2014 +0000
     1.2 +++ b/libquicktime/receipt	Tue May 13 14:25:38 2014 +0000
     1.3 @@ -16,7 +16,7 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 -	cd $src
     1.8 +	patch -p0 < $stuff/ffmpeg.u
     1.9  	./configure --prefix=/usr  \
    1.10  		--enable-gpl \
    1.11  		--with-ffmpeg \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/libquicktime/stuff/ffmpeg.u	Tue May 13 14:25:38 2014 +0000
     2.3 @@ -0,0 +1,91 @@
     2.4 +--- plugins/ffmpeg/audio.c
     2.5 ++++ plugins/ffmpeg/audio.c
     2.6 +@@ -45,6 +45,11 @@
     2.7 + #define ENCODE_AUDIO 1
     2.8 + #endif
     2.9 + 
    2.10 ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
    2.11 ++/* from libavcodec/avcodec.h dated Dec 23 2012 */
    2.12 ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
    2.13 ++#endif
    2.14 ++
    2.15 + /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
    2.16 + 
    2.17 + /* MPEG Audio header parsing code */
    2.18 +--- plugins/ffmpeg/params.c
    2.19 ++++ plugins/ffmpeg/params.c
    2.20 +@@ -101,6 +101,17 @@
    2.21 +     }                                           \
    2.22 +   }
    2.23 + 
    2.24 ++#define PARAM_DICT_INT(name, dict_name)             \
    2.25 ++  {                                                 \
    2.26 ++  if(!strcasecmp(name, key))                        \
    2.27 ++    {                                               \
    2.28 ++    char buf[128];                                  \
    2.29 ++    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
    2.30 ++    av_dict_set(options, dict_name, buf, 0);        \
    2.31 ++    found = 1;                                      \
    2.32 ++    }                                               \
    2.33 ++  }
    2.34 ++
    2.35 + #define PARAM_DICT_FLAG(name, dict_name)        \
    2.36 +   {                                             \
    2.37 +   if(!strcasecmp(name, key))                    \
    2.38 +@@ -202,8 +213,15 @@
    2.39 +   PARAM_INT("ff_max_b_frames",max_b_frames);
    2.40 +   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
    2.41 +   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
    2.42 ++
    2.43 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
    2.44 ++  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
    2.45 ++  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
    2.46 ++#else
    2.47 +   PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
    2.48 +   PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
    2.49 ++#endif
    2.50 ++
    2.51 +   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
    2.52 +   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
    2.53 +   PARAM_INT("ff_rc_min_rate",rc_min_rate);
    2.54 +@@ -241,8 +259,15 @@
    2.55 +   PARAM_QP2LAMBDA("ff_lmax", lmax);
    2.56 +   PARAM_INT("ff_noise_reduction",noise_reduction);
    2.57 +   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
    2.58 ++
    2.59 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
    2.60 ++  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
    2.61 ++  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
    2.62 ++#else
    2.63 +   PARAM_INT("ff_inter_threshold",inter_threshold);
    2.64 +   PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
    2.65 ++#endif
    2.66 ++
    2.67 +   PARAM_INT("ff_thread_count",thread_count);
    2.68 +   PARAM_INT("ff_me_threshold",me_threshold);
    2.69 +   PARAM_INT("ff_mb_threshold",mb_threshold);
    2.70 +@@ -272,8 +297,16 @@
    2.71 +   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
    2.72 +   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
    2.73 +   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
    2.74 ++
    2.75 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
    2.76 ++  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
    2.77 ++  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
    2.78 ++  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
    2.79 ++#else
    2.80 +   PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
    2.81 +   PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
    2.82 ++  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
    2.83 ++#endif
    2.84 + 
    2.85 + #if LIBAVCODEC_VERSION_MAJOR >= 54
    2.86 +   PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
    2.87 +@@ -288,7 +321,6 @@
    2.88 +   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
    2.89 +   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
    2.90 +   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
    2.91 +-  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
    2.92 +   PARAM_ENUM("ff_coder_type",coder_type,coder_type);
    2.93 +   
    2.94 +   }