libquicktime-1.2.4-ffmpeg2.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Extracted from upstream CVS.
  2. https://bugs.gentoo.org/show_bug.cgi?id=476498
  3. Index: libquicktime-1.2.4/plugins/ffmpeg/audio.c
  4. ===================================================================
  5. --- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c
  6. +++ libquicktime-1.2.4/plugins/ffmpeg/audio.c
  7. @@ -45,6 +45,11 @@
  8. #define ENCODE_AUDIO 1
  9. #endif
  10. +#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
  11. +/* from libavcodec/avcodec.h dated Dec 23 2012 */
  12. +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
  13. +#endif
  14. +
  15. /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
  16. /* MPEG Audio header parsing code */
  17. Index: libquicktime-1.2.4/plugins/ffmpeg/params.c
  18. ===================================================================
  19. --- libquicktime-1.2.4.orig/plugins/ffmpeg/params.c
  20. +++ libquicktime-1.2.4/plugins/ffmpeg/params.c
  21. @@ -101,6 +101,17 @@ typedef struct
  22. } \
  23. }
  24. +#define PARAM_DICT_INT(name, dict_name) \
  25. + { \
  26. + if(!strcasecmp(name, key)) \
  27. + { \
  28. + char buf[128]; \
  29. + snprintf(buf, sizeof(buf), "%d", *(int*)value); \
  30. + av_dict_set(options, dict_name, buf, 0); \
  31. + found = 1; \
  32. + } \
  33. + }
  34. +
  35. #define PARAM_DICT_FLAG(name, dict_name) \
  36. { \
  37. if(!strcasecmp(name, key)) \
  38. @@ -202,8 +213,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
  39. PARAM_INT("ff_max_b_frames",max_b_frames);
  40. PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
  41. PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
  42. +
  43. +#if LIBAVCODEC_VERSION_MAJOR >= 55
  44. + PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
  45. + PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
  46. +#else
  47. PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
  48. PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
  49. +#endif
  50. +
  51. PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
  52. PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
  53. PARAM_INT("ff_rc_min_rate",rc_min_rate);
  54. @@ -241,8 +259,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
  55. PARAM_QP2LAMBDA("ff_lmax", lmax);
  56. PARAM_INT("ff_noise_reduction",noise_reduction);
  57. PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
  58. +
  59. +#if LIBAVCODEC_VERSION_MAJOR >= 55
  60. + PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
  61. + PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
  62. +#else
  63. PARAM_INT("ff_inter_threshold",inter_threshold);
  64. PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
  65. +#endif
  66. +
  67. PARAM_INT("ff_thread_count",thread_count);
  68. PARAM_INT("ff_me_threshold",me_threshold);
  69. PARAM_INT("ff_mb_threshold",mb_threshold);
  70. @@ -272,8 +297,16 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
  71. PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
  72. PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
  73. // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
  74. +
  75. +#if LIBAVCODEC_VERSION_MAJOR >= 55
  76. + PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
  77. + PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
  78. + PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
  79. +#else
  80. PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
  81. PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
  82. + PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  83. +#endif
  84. #if LIBAVCODEC_VERSION_MAJOR >= 54
  85. PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
  86. @@ -288,7 +321,6 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
  87. PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
  88. PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
  89. PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
  90. - PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  91. PARAM_ENUM("ff_coder_type",coder_type,coder_type);
  92. }