Ticket #3953: libquicktime.patch

File libquicktime.patch, 4.1 KB (added by Igor Živković, 11 years ago)
  • plugins/ffmpeg/audio.c

    diff -Naur a/plugins/ffmpeg/audio.c b/plugins/ffmpeg/audio.c
    a b  
    4545#define ENCODE_AUDIO 1
    4646#endif
    4747
     48#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
     49/* from libavcodec/avcodec.h dated Dec 23 2012 */
     50#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
     51#endif
     52
    4853/* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
    4954
    5055/* MPEG Audio header parsing code */
  • plugins/ffmpeg/ffmpeg.h

    diff -Naur a/plugins/ffmpeg/ffmpeg.h b/plugins/ffmpeg/ffmpeg.h
    a b  
    2727
    2828#include <quicktime/qtprivate.h>
    2929#include AVCODEC_HEADER
     30#include <libavutil/mem.h>
    3031
    3132void quicktime_init_video_codec_ffmpeg(quicktime_codec_t * codec,
    3233                                       quicktime_video_map_t *vtrack,
  • plugins/ffmpeg/params.c

    diff -Naur a/plugins/ffmpeg/params.c b/plugins/ffmpeg/params.c
    a b  
    101101    }                                           \
    102102  }
    103103
     104#define PARAM_DICT_INT(name, dict_name)             \
     105  {                                                 \
     106  if(!strcasecmp(name, key))                        \
     107    {                                               \
     108    char buf[128];                                  \
     109    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
     110    av_dict_set(options, dict_name, buf, 0);        \
     111    found = 1;                                      \
     112    }                                               \
     113  }
     114
    104115#define PARAM_DICT_FLAG(name, dict_name)        \
    105116  {                                             \
    106117  if(!strcasecmp(name, key))                    \
     
    202213  PARAM_INT("ff_max_b_frames",max_b_frames);
    203214  PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
    204215  PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
     216
     217#if LIBAVCODEC_VERSION_MAJOR >= 55
     218  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
     219  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
     220#else
    205221  PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
    206222  PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
     223#endif
     224
    207225  PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
    208226  PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
    209227  PARAM_INT("ff_rc_min_rate",rc_min_rate);
     
    241259  PARAM_QP2LAMBDA("ff_lmax", lmax);
    242260  PARAM_INT("ff_noise_reduction",noise_reduction);
    243261  PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
     262
     263#if LIBAVCODEC_VERSION_MAJOR >= 55
     264  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
     265  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
     266#else
    244267  PARAM_INT("ff_inter_threshold",inter_threshold);
    245268  PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
     269#endif
     270
    246271  PARAM_INT("ff_thread_count",thread_count);
    247272  PARAM_INT("ff_me_threshold",me_threshold);
    248273  PARAM_INT("ff_mb_threshold",mb_threshold);
     
    272297  PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
    273298  PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
    274299  //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
     300
     301#if LIBAVCODEC_VERSION_MAJOR >= 55
     302  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
     303  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
     304  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
     305#else
    275306  PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
    276307  PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
     308  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
     309#endif
    277310
    278311#if LIBAVCODEC_VERSION_MAJOR >= 54
    279312  PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
     
    288321  PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
    289322  PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
    290323  PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
    291   PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
    292324  PARAM_ENUM("ff_coder_type",coder_type,coder_type);
    293325 
    294326  }