[SCM] gmerlin-encoders/master: Support libav10 (Closes: #739425), thanks to Anton Khirnov for the patch

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Mon Mar 10 16:58:34 UTC 2014


The following commit has been merged in the master branch:
commit 05c124a22cbeaf1e8a49612f353604f1c17ca469
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Mon Mar 10 17:22:22 2014 +0100

    Support libav10 (Closes: #739425), thanks to Anton Khirnov for the patch

diff --git a/debian/patches/libav10.patch b/debian/patches/libav10.patch
new file mode 100644
index 0000000..e380bbb
--- /dev/null
+++ b/debian/patches/libav10.patch
@@ -0,0 +1,983 @@
+Description: libav10 compatibility
+ package fails to build from source against libav 10 (currently packaged in
+ experimental). This bug will become release-critical at some point when the
+ libav10 transition starts.
+ This patch renames CODEC_* constants to AV_CODEC_*, and CodecID to AVCodecID.
+ It also removes a few codec-controls no longer present in libav10.
+Author: Anton Khirnov
+Origin: https://bugs.debian.org/#739425
+Reviewed-by: IOhannes m zmölnig
+Last-Update: 2014-03-10
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- gmerlin-encoders.orig/plugins/ffmpeg/codecs.c
++++ gmerlin-encoders/plugins/ffmpeg/codecs.c
+@@ -99,7 +99,6 @@
+     PARAM_QSCALE,                      \
+     PARAM_QCOMPRESS,                        \
+     PARAM_QBLUR,                            \
+-    PARAM_QUANTIZER_NOISE_SHAPING,          \
+     PARAM_TRELLIS
+ 
+ #define ENCODE_PARAM_VIDEO_QUANTIZER_IP \
+@@ -121,8 +120,7 @@
+   PARAM_GOP_SIZE,                      \
+   PARAM_SCENE_CHANGE_THRESHOLD,       \
+   PARAM_SCENECHANGE_FACTOR,        \
+-  PARAM_FLAG_CLOSED_GOP,         \
+-  PARAM_FLAG2_STRICT_GOP
++  PARAM_FLAG_CLOSED_GOP         \
+ 
+ #define ENCODE_PARAM_VIDEO_FRAMETYPES_IPB \
+   ENCODE_PARAM_VIDEO_FRAMETYPES_IP,        \
+@@ -195,12 +193,10 @@
+   PARAM_FLAG_AC_PRED_MPEG4,
+   ENCODE_PARAM_VIDEO_RATECONTROL,
+   ENCODE_PARAM_VIDEO_QUANTIZER_IPB,
+-  PARAM_FLAG_CBP_RD,
+   ENCODE_PARAM_VIDEO_ME,
+   PARAM_FLAG_GMC,
+   PARAM_FLAG_4MV,
+   PARAM_FLAG_MV0,
+-  PARAM_FLAG_QP_RD,
+   ENCODE_PARAM_VIDEO_ME_PRE,
+   ENCODE_PARAM_VIDEO_QPEL,
+   ENCODE_PARAM_VIDEO_MASKING,
+@@ -351,61 +347,61 @@
+     {
+       .name      = "pcm_s16be",
+       .long_name = TRS("16 bit PCM"),
+-      .id        = CODEC_ID_PCM_S16BE,
++      .id        = AV_CODEC_ID_PCM_S16BE,
+     },
+     {
+       .name      = "pcm_s16le",
+       .long_name = TRS("16 bit PCM"),
+-      .id        = CODEC_ID_PCM_S16LE,
++      .id        = AV_CODEC_ID_PCM_S16LE,
+     },
+     {
+       .name      = "pcm_s8",
+       .long_name = TRS("8 bit PCM"),
+-      .id        = CODEC_ID_PCM_S8,
++      .id        = AV_CODEC_ID_PCM_S8,
+     },
+     {
+       .name      = "pcm_u8",
+       .long_name = TRS("8 bit PCM"),
+-      .id        = CODEC_ID_PCM_U8,
++      .id        = AV_CODEC_ID_PCM_U8,
+     },
+     {
+       .name      = "pcm_alaw",
+       .long_name = TRS("alaw"),
+-      .id        = CODEC_ID_PCM_ALAW,
++      .id        = AV_CODEC_ID_PCM_ALAW,
+     },
+     {
+       .name      = "pcm_mulaw",
+       .long_name = TRS("mulaw"),
+-      .id        = CODEC_ID_PCM_MULAW,
++      .id        = AV_CODEC_ID_PCM_MULAW,
+     },
+     {
+       .name      = "ac3",
+       .long_name = TRS("AC3"),
+-      .id        = CODEC_ID_AC3,
++      .id        = AV_CODEC_ID_AC3,
+       .parameters = parameters_ac3,
+     },
+     {
+       .name      = "mp2",
+       .long_name = TRS("MPEG audio layer 2"),
+-      .id        = CODEC_ID_MP2,
++      .id        = AV_CODEC_ID_MP2,
+       .parameters = parameters_mp2,
+     },
+     {
+       .name      = "wma1",
+       .long_name = TRS("Windows media Audio 1"),
+-      .id        = CODEC_ID_WMAV1,
++      .id        = AV_CODEC_ID_WMAV1,
+       .parameters = parameters_wma,
+     },
+     {
+       .name      = "wma2",
+       .long_name = TRS("Windows media Audio 2"),
+-      .id        = CODEC_ID_WMAV2,
++      .id        = AV_CODEC_ID_WMAV2,
+       .parameters = parameters_wma,
+     },
+     {
+       .name      = "mp3",
+       .long_name = TRS("MPEG audio layer 3"),
+-      .id        = CODEC_ID_MP3,
++      .id        = AV_CODEC_ID_MP3,
+       .parameters = parameters_mp3,
+     },
+     { /* End of array */ }
+@@ -416,63 +412,63 @@
+     {
+       .name       = "mjpeg",
+       .long_name  = TRS("Motion JPEG"),
+-      .id         = CODEC_ID_MJPEG,
++      .id         = AV_CODEC_ID_MJPEG,
+       .parameters = parameters_mjpeg,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "mpeg4",
+       .long_name  = TRS("MPEG-4"),
+-      .id         = CODEC_ID_MPEG4,
++      .id         = AV_CODEC_ID_MPEG4,
+       .parameters = parameters_mpeg4,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "msmpeg4v3",
+       .long_name  = TRS("Divx 3 compatible"),
+-      .id         = CODEC_ID_MSMPEG4V3,
++      .id         = AV_CODEC_ID_MSMPEG4V3,
+       .parameters = parameters_msmpeg4v3,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "mpeg1video",
+       .long_name  = TRS("MPEG-1 Video"),
+-      .id         = CODEC_ID_MPEG1VIDEO,
++      .id         = AV_CODEC_ID_MPEG1VIDEO,
+       .parameters = parameters_mpeg1,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "mpeg2video",
+       .long_name  = TRS("MPEG-2 Video"),
+-      .id         = CODEC_ID_MPEG2VIDEO,
++      .id         = AV_CODEC_ID_MPEG2VIDEO,
+       .parameters = parameters_mpeg1,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "flv1",
+       .long_name  = TRS("Flash 1"),
+-      .id         = CODEC_ID_FLV1,
++      .id         = AV_CODEC_ID_FLV1,
+       .parameters = parameters_msmpeg4v3,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "wmv1",
+       .long_name  = TRS("WMV 1"),
+-      .id         = CODEC_ID_WMV1,
++      .id         = AV_CODEC_ID_WMV1,
+       .parameters = parameters_msmpeg4v3,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "rv10",
+       .long_name  = TRS("Real Video 1"),
+-      .id         = CODEC_ID_RV10,
++      .id         = AV_CODEC_ID_RV10,
+       .parameters = parameters_msmpeg4v3,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+     {
+       .name       = "libx264",
+       .long_name  = TRS("H.264"),
+-      .id         = CODEC_ID_H264,
++      .id         = AV_CODEC_ID_H264,
+       .parameters = parameters_libx264,
+       .pixelformats = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NB },
+     },
+@@ -480,7 +476,7 @@
+     {
+       .name       = "wmv2",
+       .long_name  = TRS("WMV 2"),
+-      .id         = CODEC_ID_WMV2,
++      .id         = AV_CODEC_ID_WMV2,
+       .parameters = parameters_msmpeg4v3
+     },
+ #endif
+@@ -488,7 +484,7 @@
+   };
+ 
+ static const ffmpeg_codec_info_t **
+-add_codec_info(const ffmpeg_codec_info_t ** info, enum CodecID id, int * num)
++add_codec_info(const ffmpeg_codec_info_t ** info, enum AVCodecID id, int * num)
+   {
+   int i;
+   /* Check if the codec id is already in the array */
+@@ -599,7 +595,7 @@
+       continue;
+       }
+     j = 0;
+-    while(format_info[i].audio_codecs[j] != CODEC_ID_NONE)
++    while(format_info[i].audio_codecs[j] != AV_CODEC_ID_NONE)
+       {
+       infos = add_codec_info(infos, format_info[i].audio_codecs[j],
+                              &num_infos);
+@@ -636,7 +632,7 @@
+       continue;
+       }
+     j = 0;
+-    while(format_info[i].video_codecs[j] != CODEC_ID_NONE)
++    while(format_info[i].video_codecs[j] != AV_CODEC_ID_NONE)
+       {
+       infos = add_codec_info(infos, format_info[i].video_codecs[j],
+                              &num_infos);
+@@ -658,11 +654,11 @@
+   return ret;
+   }
+ 
+-enum CodecID
++enum AVCodecID
+ bg_ffmpeg_find_audio_encoder(const ffmpeg_format_info_t * format, const char * name)
+   {
+   int i = 0, found = 0;
+-  enum CodecID ret = CODEC_ID_NONE;
++  enum AVCodecID ret = AV_CODEC_ID_NONE;
+   
+   while(audio_codecs[i].name)
+     {
+@@ -675,7 +671,7 @@
+     }
+ 
+   i = 0;
+-  while(format->audio_codecs[i] != CODEC_ID_NONE)
++  while(format->audio_codecs[i] != AV_CODEC_ID_NONE)
+     {
+     if(format->audio_codecs[i] == ret)
+       {
+@@ -690,17 +686,17 @@
+     bg_log(BG_LOG_ERROR, LOG_DOMAIN,
+            "Audio codec %s is not supported by %s",
+            name, format->name);
+-    ret = CODEC_ID_NONE;
++    ret = AV_CODEC_ID_NONE;
+     }
+   
+   return ret;
+   }
+ 
+-enum CodecID
++enum AVCodecID
+ bg_ffmpeg_find_video_encoder(const ffmpeg_format_info_t * format, const char * name)
+   {
+   int i = 0, found = 0;
+-  enum CodecID ret = CODEC_ID_NONE;
++  enum AVCodecID ret = AV_CODEC_ID_NONE;
+   
+   while(video_codecs[i].name)
+     {
+@@ -713,7 +709,7 @@
+     }
+ 
+   i = 0;
+-  while(format->video_codecs[i] != CODEC_ID_NONE)
++  while(format->video_codecs[i] != AV_CODEC_ID_NONE)
+     {
+     if(format->video_codecs[i] == ret)
+       {
+@@ -728,7 +724,7 @@
+     bg_log(BG_LOG_ERROR, LOG_DOMAIN,
+            "Video codec %s is not supported by %s",
+            name, format->name);
+-    ret = CODEC_ID_NONE;
++    ret = AV_CODEC_ID_NONE;
+     }
+   
+   return ret;
+@@ -930,8 +926,6 @@
+   PARAM_INT("ff_max_b_frames",max_b_frames);
+   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
+   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
+-  PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
+-  PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
+   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
+   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
+   PARAM_INT("ff_rc_min_rate",rc_min_rate);
+@@ -969,8 +963,6 @@
+   PARAM_QP2LAMBDA("ff_lmax", lmax);
+   PARAM_INT("ff_noise_reduction",noise_reduction);
+   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
+-  PARAM_INT("ff_inter_threshold",inter_threshold);
+-  PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
+   PARAM_INT("ff_me_threshold",me_threshold);
+   PARAM_INT("ff_mb_threshold",mb_threshold);
+   PARAM_INT("ff_nsse_weight",nsse_weight);
+@@ -999,15 +991,12 @@
+   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
+   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
+   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV);
+-  PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
+-  PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
+   //  PARAM_FLAG("ff_flag_h263p_aiv",CODEC_FLAG_H263P_AIV);
+   //  PARAM_FLAG("ffx_flag_obmc",CODEC_FLAG_OBMC);
+   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
+   //  PARAM_FLAG("ff_flag_h263p_slice_struct",CODEC_FLAG_H263P_SLICE_STRUCT);
+   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
+   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
+-  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
+ 
+ #if LIBAVCODEC_VERSION_MAJOR >= 54
+   PARAM_DICT_STRING("libx264_preset", "preset");
+@@ -1018,7 +1007,7 @@
+   
+   }
+ 
+-enum PixelFormat * bg_ffmpeg_get_pixelformats(enum CodecID id)
++enum PixelFormat * bg_ffmpeg_get_pixelformats(enum AVCodecID id)
+   {
+   int i = 0;
+   while(video_codecs[i].name)
+--- gmerlin-encoders.orig/plugins/ffmpeg/e_ffmpeg.c
++++ gmerlin-encoders/plugins/ffmpeg/e_ffmpeg.c
+@@ -33,19 +33,19 @@
+       .extension =  "avi",
+       .max_audio_streams = 1,
+       .max_video_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_PCM_S16LE,
+-                                         CODEC_ID_PCM_U8,
+-                                         CODEC_ID_PCM_ALAW,
+-                                         CODEC_ID_PCM_MULAW,
+-                                         CODEC_ID_MP3,
+-                                         CODEC_ID_MP2,
+-                                         CODEC_ID_AC3,
+-                                         CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_PCM_S16LE,
++                                         AV_CODEC_ID_PCM_U8,
++                                         AV_CODEC_ID_PCM_ALAW,
++                                         AV_CODEC_ID_PCM_MULAW,
++                                         AV_CODEC_ID_MP3,
++                                         AV_CODEC_ID_MP2,
++                                         AV_CODEC_ID_AC3,
++                                         AV_CODEC_ID_NONE },
+ 
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG4,
+-                                       CODEC_ID_MSMPEG4V3,
+-                                       CODEC_ID_MJPEG,
+-                                       CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG4,
++                                       AV_CODEC_ID_MSMPEG4V3,
++                                       AV_CODEC_ID_MJPEG,
++                                       AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+     },
+     {
+@@ -54,12 +54,12 @@
+       .extension =  "mpg",
+       .max_audio_streams = -1,
+       .max_video_streams = -1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP2,
+-                                       CODEC_ID_MP3,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP2,
++                                       AV_CODEC_ID_MP3,
++                                       AV_CODEC_ID_NONE },
+ 
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG1VIDEO,
+-                                       CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG1VIDEO,
++                                       AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+       
+@@ -70,13 +70,13 @@
+       .extension =  "vob",
+       .max_audio_streams = -1,
+       .max_video_streams = -1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP2,
+-                                         CODEC_ID_MP3,
+-                                         CODEC_ID_AC3,
+-                                         CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP2,
++                                         AV_CODEC_ID_MP3,
++                                         AV_CODEC_ID_AC3,
++                                         AV_CODEC_ID_NONE },
+ 
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG2VIDEO,
+-                                         CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG2VIDEO,
++                                         AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+@@ -86,12 +86,12 @@
+       .extension =  "vob",
+       .max_audio_streams = -1,
+       .max_video_streams = -1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP2,
+-                                         CODEC_ID_AC3,
+-                                         CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP2,
++                                         AV_CODEC_ID_AC3,
++                                         AV_CODEC_ID_NONE },
+ 
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG2VIDEO,
+-                                         CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG2VIDEO,
++                                         AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+@@ -101,11 +101,11 @@
+       .extension =  "flv",
+       .max_audio_streams = 1,
+       .max_video_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP3,
+-                                         CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP3,
++                                         AV_CODEC_ID_NONE },
+       
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_FLV1,
+-                                         CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_FLV1,
++                                         AV_CODEC_ID_NONE },
+     },
+     {
+       .name =       "ASF",
+@@ -113,18 +113,18 @@
+       .extension =  "asf",
+       .max_audio_streams = 1,
+       .max_video_streams = 1,
+-      .audio_codecs = (enum CodecID[]){
++      .audio_codecs = (enum AVCodecID[]){
+ #if LIBAVCODEC_BUILD >= ((51<<16)+(32<<8)+0)
+-                                       CODEC_ID_WMAV2,
+-                                       CODEC_ID_WMAV1,
++                                       AV_CODEC_ID_WMAV2,
++                                       AV_CODEC_ID_WMAV1,
+ #endif
+-                                       CODEC_ID_MP3,
+-                                       CODEC_ID_MP2,
+-                                       CODEC_ID_NONE },
+-      
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_WMV1,
+-                                       // CODEC_ID_WMV2, /* Crash */
+-                                       CODEC_ID_NONE },
++                                       AV_CODEC_ID_MP3,
++                                       AV_CODEC_ID_MP2,
++                                       AV_CODEC_ID_NONE },
++      
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_WMV1,
++                                       // AV_CODEC_ID_WMV2, /* Crash */
++                                       AV_CODEC_ID_NONE },
+     },
+     {
+       .name =       "MPEG-2 Transport stream",
+@@ -132,14 +132,14 @@
+       .extension =  "ts",
+       .max_audio_streams = 1,
+       .max_video_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP3,
+-                                       CODEC_ID_MP2,
+-                                       CODEC_ID_AC3,
+-                                       CODEC_ID_NONE },
+-      
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG1VIDEO,
+-                                       CODEC_ID_MPEG2VIDEO,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP3,
++                                       AV_CODEC_ID_MP2,
++                                       AV_CODEC_ID_AC3,
++                                       AV_CODEC_ID_NONE },
++      
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG1VIDEO,
++                                       AV_CODEC_ID_MPEG2VIDEO,
++                                       AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+@@ -149,19 +149,19 @@
+       .extension =  "mkv",
+       .max_audio_streams = -1,
+       .max_video_streams = -1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP3,
+-                                         CODEC_ID_MP2,
+-                                         CODEC_ID_AC3,
+-                                         CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP3,
++                                         AV_CODEC_ID_MP2,
++                                         AV_CODEC_ID_AC3,
++                                         AV_CODEC_ID_NONE },
+       
+-      .video_codecs = (enum CodecID[]){
++      .video_codecs = (enum AVCodecID[]){
+ #if LIBAVCODEC_VERSION_MAJOR >= 54
+-                                         CODEC_ID_H264,
++                                         AV_CODEC_ID_H264,
+ #endif
+-                                         CODEC_ID_MPEG4,
+-                                         CODEC_ID_MPEG1VIDEO,
+-                                         CODEC_ID_MPEG2VIDEO,
+-                                         CODEC_ID_NONE },
++                                         AV_CODEC_ID_MPEG4,
++                                         AV_CODEC_ID_MPEG1VIDEO,
++                                         AV_CODEC_ID_MPEG2VIDEO,
++                                         AV_CODEC_ID_NONE },
+       //      .flags = FLAG_CONSTANT_FRAMERATE,
+       //      .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+@@ -172,11 +172,11 @@
+       .extension =  "rm",
+       .max_audio_streams = 1,
+       .max_video_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_AC3,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_AC3,
++                                       AV_CODEC_ID_NONE },
+       
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_RV10,
+-                                       CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_RV10,
++                                       AV_CODEC_ID_NONE },
+     },
+ #endif
+     { /* End of formats */ }
+--- gmerlin-encoders.orig/plugins/ffmpeg/e_ffmpeg_audio.c
++++ gmerlin-encoders/plugins/ffmpeg/e_ffmpeg_audio.c
+@@ -30,37 +30,37 @@
+       .short_name = "au",
+       .extension =  "au",
+       .max_audio_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_PCM_MULAW,
+-                                       CODEC_ID_PCM_S16BE,
+-                                       CODEC_ID_PCM_ALAW,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_PCM_MULAW,
++                                       AV_CODEC_ID_PCM_S16BE,
++                                       AV_CODEC_ID_PCM_ALAW,
++                                       AV_CODEC_ID_NONE },
+     },
+     {
+       .name = "Raw AC3",
+       .short_name = "ac3",
+       .extension =  "ac3",
+       .max_audio_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_AC3,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_AC3,
++                                       AV_CODEC_ID_NONE },
+     },
+     {
+       .name =       "AIFF",
+       .short_name = "aiff",
+       .extension =  "aif",
+       .max_audio_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_PCM_S16BE,
+-                                       CODEC_ID_PCM_S8,
+-                                       CODEC_ID_PCM_ALAW,
+-                                       CODEC_ID_PCM_MULAW,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_PCM_S16BE,
++                                       AV_CODEC_ID_PCM_S8,
++                                       AV_CODEC_ID_PCM_ALAW,
++                                       AV_CODEC_ID_PCM_MULAW,
++                                       AV_CODEC_ID_NONE },
+     },
+     {
+       .name =       "MP2",
+       .short_name = "mp2",
+       .extension =  "mp2",
+       .max_audio_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_MP2,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MP2,
++                                       AV_CODEC_ID_NONE },
+     },
+ #if LIBAVCODEC_BUILD >= ((51<<16)+(32<<8)+0)
+     {
+@@ -68,9 +68,9 @@
+       .short_name = "asf",
+       .extension =  "wma",
+       .max_audio_streams = 1,
+-      .audio_codecs = (enum CodecID[]){  CODEC_ID_WMAV2,
+-                                       CODEC_ID_WMAV1,
+-                                       CODEC_ID_NONE },
++      .audio_codecs = (enum AVCodecID[]){  AV_CODEC_ID_WMAV2,
++                                       AV_CODEC_ID_WMAV1,
++                                       AV_CODEC_ID_NONE },
+     },
+ #endif
+     { /* End of formats */ }
+--- gmerlin-encoders.orig/plugins/ffmpeg/e_ffmpeg_video.c
++++ gmerlin-encoders/plugins/ffmpeg/e_ffmpeg_video.c
+@@ -32,8 +32,8 @@
+       .short_name = "mpeg1video",
+       .extension =  "m1v",
+       .max_video_streams = 1,
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG1VIDEO,
+-                                       CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG1VIDEO,
++                                       AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+@@ -42,8 +42,8 @@
+       .short_name = "mpeg2video",
+       .extension =  "m2v",
+       .max_video_streams = 1,
+-      .video_codecs = (enum CodecID[]){  CODEC_ID_MPEG2VIDEO,
+-                                       CODEC_ID_NONE },
++      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG2VIDEO,
++                                       AV_CODEC_ID_NONE },
+       .flags = FLAG_CONSTANT_FRAMERATE,
+       .framerates = bg_ffmpeg_mpeg_framerates,
+     },
+--- gmerlin-encoders.orig/plugins/ffmpeg/ffmpeg_common.c
++++ gmerlin-encoders/plugins/ffmpeg/ffmpeg_common.c
+@@ -343,7 +343,7 @@
+   return 1;
+   }
+ 
+-static void set_audio_params(ffmpeg_audio_stream_t * st, enum CodecID id)
++static void set_audio_params(ffmpeg_audio_stream_t * st, enum AVCodecID id)
+   {
+   /* Will be cleared later if we don't write compressed
+      packets */
+@@ -360,7 +360,7 @@
+   st->stream->codec->codec_type  = CODEC_TYPE_AUDIO;
+   }
+ 
+-static void set_video_params(ffmpeg_video_stream_t * st, enum CodecID id)
++static void set_video_params(ffmpeg_video_stream_t * st, enum AVCodecID id)
+   {
+   st->stream->codec->codec_type = CODEC_TYPE_VIDEO;
+   st->stream->codec->codec_id = id;
+@@ -408,7 +408,7 @@
+                              priv->num_text_streams);
+ #endif 
+   
+-  set_audio_params(st, CODEC_ID_NONE);
++  set_audio_params(st, AV_CODEC_ID_NONE);
+   
+   priv->num_audio_streams++;
+   return priv->num_audio_streams-1;
+@@ -442,7 +442,7 @@
+ 
+   /* Will be cleared later if we don't write compressed
+      packets */
+-  set_video_params(st, CODEC_ID_NONE);
++  set_video_params(st, AV_CODEC_ID_NONE);
+   priv->num_video_streams++;
+   return priv->num_video_streams-1;
+   }
+@@ -479,7 +479,7 @@
+ #endif 
+ 
+   st->stream->codec->codec_type = CODEC_TYPE_SUBTITLE;
+-  st->stream->codec->codec_id = CODEC_ID_TEXT;
++  st->stream->codec->codec_id = AV_CODEC_ID_TEXT;
+ 
+   st->stream->codec->time_base.num = 1;
+   st->stream->codec->time_base.den = *timescale;
+@@ -502,14 +502,14 @@
+     /* Set the bitrate for PCM codecs */
+     switch(st->stream->codec->codec_id)
+       {
+-      case CODEC_ID_PCM_S16BE:
+-      case CODEC_ID_PCM_S16LE:
++      case AV_CODEC_ID_PCM_S16BE:
++      case AV_CODEC_ID_PCM_S16LE:
+         st->stream->codec->bit_rate = st->format.samplerate * st->format.num_channels * 16;
+         break;
+-      case CODEC_ID_PCM_S8:
+-      case CODEC_ID_PCM_U8:
+-      case CODEC_ID_PCM_ALAW:
+-      case CODEC_ID_PCM_MULAW:
++      case AV_CODEC_ID_PCM_S8:
++      case AV_CODEC_ID_PCM_U8:
++      case AV_CODEC_ID_PCM_ALAW:
++      case AV_CODEC_ID_PCM_MULAW:
+         st->stream->codec->bit_rate = st->format.samplerate * st->format.num_channels * 8;
+         break;
+       default:
+@@ -522,7 +522,7 @@
+   
+   if(!strcmp(name, "codec"))
+     {
+-    enum CodecID id;
++    enum AVCodecID id;
+ #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,10,0)
+     AVCodec * codec;
+ #endif
+@@ -560,7 +560,7 @@
+   
+   if(!strcmp(name, "codec"))
+     {
+-    enum CodecID id;
++    enum AVCodecID id;
+ #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,10,0)
+     AVCodec * codec;
+ #endif
+@@ -616,7 +616,7 @@
+   if(st->ci)
+     return 1;
+   
+-  if(st->stream->codec->codec_id == CODEC_ID_NONE)
++  if(st->stream->codec->codec_id == AV_CODEC_ID_NONE)
+     return 0;
+   
+   codec = avcodec_find_encoder(st->stream->codec->codec_id);
+@@ -686,7 +686,7 @@
+   int stats_len;
+   AVCodec * codec;
+ 
+-  if(st->stream->codec->codec_id == CODEC_ID_NONE)
++  if(st->stream->codec->codec_id == AV_CODEC_ID_NONE)
+     return 0;
+ 
+   if(st->ci)
+@@ -1417,35 +1417,35 @@
+ static const struct
+   {
+   gavl_codec_id_t gavl;
+-  enum CodecID    ffmpeg;
++  enum AVCodecID    ffmpeg;
+   }
+ codec_ids[] =
+   {
+     /* Audio */
+-    { GAVL_CODEC_ID_ALAW,   CODEC_ID_PCM_ALAW  }, //!< alaw 2:1
+-    { GAVL_CODEC_ID_ULAW,   CODEC_ID_PCM_MULAW }, //!< mu-law 2:1
+-    { GAVL_CODEC_ID_MP2,    CODEC_ID_MP2       }, //!< MPEG-1 audio layer II
+-    { GAVL_CODEC_ID_MP3,    CODEC_ID_MP3       }, //!< MPEG-1/2 audio layer 3 CBR/VBR
+-    { GAVL_CODEC_ID_AC3,    CODEC_ID_AC3       }, //!< AC3
+-    { GAVL_CODEC_ID_AAC,    CODEC_ID_AAC       }, //!< AAC as stored in quicktime/mp4
+-    { GAVL_CODEC_ID_VORBIS, CODEC_ID_VORBIS    }, //!< Vorbis (segmented extradata and packets)
++    { GAVL_CODEC_ID_ALAW,   AV_CODEC_ID_PCM_ALAW  }, //!< alaw 2:1
++    { GAVL_CODEC_ID_ULAW,   AV_CODEC_ID_PCM_MULAW }, //!< mu-law 2:1
++    { GAVL_CODEC_ID_MP2,    AV_CODEC_ID_MP2       }, //!< MPEG-1 audio layer II
++    { GAVL_CODEC_ID_MP3,    AV_CODEC_ID_MP3       }, //!< MPEG-1/2 audio layer 3 CBR/VBR
++    { GAVL_CODEC_ID_AC3,    AV_CODEC_ID_AC3       }, //!< AC3
++    { GAVL_CODEC_ID_AAC,    AV_CODEC_ID_AAC       }, //!< AAC as stored in quicktime/mp4
++    { GAVL_CODEC_ID_VORBIS, AV_CODEC_ID_VORBIS    }, //!< Vorbis (segmented extradata and packets)
+     
+     /* Video */
+-    { GAVL_CODEC_ID_JPEG,      CODEC_ID_MJPEG      }, //!< JPEG image
+-    { GAVL_CODEC_ID_PNG,       CODEC_ID_PNG        }, //!< PNG image
+-    { GAVL_CODEC_ID_TIFF,      CODEC_ID_TIFF       }, //!< TIFF image
+-    { GAVL_CODEC_ID_TGA,       CODEC_ID_TARGA      }, //!< TGA image
+-    { GAVL_CODEC_ID_MPEG1,     CODEC_ID_MPEG1VIDEO }, //!< MPEG-1 video
+-    { GAVL_CODEC_ID_MPEG2,     CODEC_ID_MPEG2VIDEO }, //!< MPEG-2 video
+-    { GAVL_CODEC_ID_MPEG4_ASP, CODEC_ID_MPEG4      }, //!< MPEG-4 ASP (a.k.a. Divx4)
+-    { GAVL_CODEC_ID_H264,      CODEC_ID_H264       }, //!< H.264 (Annex B)
+-    { GAVL_CODEC_ID_THEORA,    CODEC_ID_THEORA     }, //!< Theora (segmented extradata
+-    { GAVL_CODEC_ID_DIRAC,     CODEC_ID_DIRAC      }, //!< Complete DIRAC frames, sequence end code appended to last packet
+-    { GAVL_CODEC_ID_DV,        CODEC_ID_DVVIDEO    }, //!< DV (several variants)
+-    { GAVL_CODEC_ID_NONE,      CODEC_ID_NONE       },
++    { GAVL_CODEC_ID_JPEG,      AV_CODEC_ID_MJPEG      }, //!< JPEG image
++    { GAVL_CODEC_ID_PNG,       AV_CODEC_ID_PNG        }, //!< PNG image
++    { GAVL_CODEC_ID_TIFF,      AV_CODEC_ID_TIFF       }, //!< TIFF image
++    { GAVL_CODEC_ID_TGA,       AV_CODEC_ID_TARGA      }, //!< TGA image
++    { GAVL_CODEC_ID_MPEG1,     AV_CODEC_ID_MPEG1VIDEO }, //!< MPEG-1 video
++    { GAVL_CODEC_ID_MPEG2,     AV_CODEC_ID_MPEG2VIDEO }, //!< MPEG-2 video
++    { GAVL_CODEC_ID_MPEG4_ASP, AV_CODEC_ID_MPEG4      }, //!< MPEG-4 ASP (a.k.a. Divx4)
++    { GAVL_CODEC_ID_H264,      AV_CODEC_ID_H264       }, //!< H.264 (Annex B)
++    { GAVL_CODEC_ID_THEORA,    AV_CODEC_ID_THEORA     }, //!< Theora (segmented extradata
++    { GAVL_CODEC_ID_DIRAC,     AV_CODEC_ID_DIRAC      }, //!< Complete DIRAC frames, sequence end code appended to last packet
++    { GAVL_CODEC_ID_DV,        AV_CODEC_ID_DVVIDEO    }, //!< DV (several variants)
++    { GAVL_CODEC_ID_NONE,      AV_CODEC_ID_NONE       },
+   };
+ 
+-enum CodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl)
++enum AVCodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl)
+   {
+   int i = 0;
+   while(codec_ids[i].gavl != GAVL_CODEC_ID_NONE)
+@@ -1454,7 +1454,7 @@
+       return codec_ids[i].ffmpeg;
+     i++;
+     }
+-  return CODEC_ID_NONE;
++  return AV_CODEC_ID_NONE;
+   }
+ 
+ int bg_ffmpeg_writes_compressed_audio(void * priv,
+@@ -1462,13 +1462,13 @@
+                                       const gavl_compression_info_t * info)
+   {
+   int i;
+-  enum CodecID ffmpeg_id;
++  enum AVCodecID ffmpeg_id;
+   ffmpeg_priv_t * f = priv;
+   
+   ffmpeg_id = bg_codec_id_gavl_2_ffmpeg(info->id);
+   
+   i = 0;
+-  while(f->format->audio_codecs[i] != CODEC_ID_NONE)
++  while(f->format->audio_codecs[i] != AV_CODEC_ID_NONE)
+     {
+     if(f->format->audio_codecs[i] == ffmpeg_id)
+       return 1;
+@@ -1483,13 +1483,13 @@
+                                       const gavl_compression_info_t * info)
+   {
+   int i;
+-  enum CodecID ffmpeg_id;
++  enum AVCodecID ffmpeg_id;
+   ffmpeg_priv_t * f = priv;
+ 
+   ffmpeg_id = bg_codec_id_gavl_2_ffmpeg(info->id);
+ 
+   i = 0;
+-  while(f->format->video_codecs[i] != CODEC_ID_NONE)
++  while(f->format->video_codecs[i] != AV_CODEC_ID_NONE)
+     {
+     if(f->format->video_codecs[i] == ffmpeg_id)
+       return 1;
+--- gmerlin-encoders.orig/plugins/ffmpeg/ffmpeg_common.h
++++ gmerlin-encoders/plugins/ffmpeg/ffmpeg_common.h
+@@ -57,7 +57,7 @@
+   {
+   char * name;
+   char * long_name;
+-  enum CodecID id;
++  enum AVCodecID id;
+   const bg_parameter_info_t * parameters;
+ 
+   /* Terminated with PIX_FMT_NB */
+@@ -74,8 +74,8 @@
+   int max_audio_streams;
+   int max_video_streams;
+   
+-  const enum CodecID * audio_codecs;
+-  const enum CodecID * video_codecs;
++  const enum AVCodecID * audio_codecs;
++  const enum AVCodecID * video_codecs;
+   
+   int flags;
+   const bg_encoder_framerate_t * framerates;
+@@ -101,10 +101,10 @@
+                               const char * name,
+                               const bg_parameter_value_t * val);
+ 
+-enum CodecID
++enum AVCodecID
+ bg_ffmpeg_find_audio_encoder(const ffmpeg_format_info_t * format, const char * name);
+ 
+-enum CodecID
++enum AVCodecID
+ bg_ffmpeg_find_video_encoder(const ffmpeg_format_info_t * format, const char * name);
+ 
+ typedef struct
+@@ -237,7 +237,7 @@
+ void bg_ffmpeg_set_video_parameter(void * data, int stream, const char * name,
+                                   const bg_parameter_value_t * v);
+ 
+-enum PixelFormat * bg_ffmpeg_get_pixelformats(enum CodecID id);
++enum PixelFormat * bg_ffmpeg_get_pixelformats(enum AVCodecID id);
+ 
+ 
+ int bg_ffmpeg_set_video_pass(void * data, int stream, int pass,
+@@ -269,7 +269,7 @@
+ 
+ gavl_sample_format_t bg_sample_format_ffmpeg_2_gavl(enum SampleFormat p);
+ 
+-enum CodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl);
++enum AVCodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl);
+ 
+ 
+ /* Compressed stream support */
+--- gmerlin-encoders.orig/plugins/ffmpeg/params.h
++++ gmerlin-encoders/plugins/ffmpeg/params.h
+@@ -172,32 +172,6 @@
+     .val_default = { .val_i = 0 },                                \
+   }
+ 
+-#define PARAM_LUMA_ELIM_THRESHOLD               \
+-  {                                             \
+-    .name =      "ff_luma_elim_threshold",          \
+-    .long_name = TRS("Luma elimination threshold"),    \
+-    .type =        BG_PARAMETER_SLIDER_INT,             \
+-    .val_default = { .val_i =  0 },                                \
+-    .val_min =     { .val_i = -99 },                                \
+-    .val_max =     { .val_i =  99 },                                \
+-    .help_string = TRS("Single coefficient elimination threshold for " \
+-"luminance. Negative values also consider dc coefficient. -4 is " \
+-"JVT recommendation") \
+-  }
+-    
+-#define PARAM_CHROMA_ELIM_THRESHOLD               \
+-  {                                             \
+-    .name =      "ff_chroma_elim_threshold",          \
+-    .long_name = TRS("Chroma elimination threshold"),    \
+-    .type =        BG_PARAMETER_SLIDER_INT,             \
+-    .val_default = { .val_i =  0 },                                \
+-    .val_min =     { .val_i = -99 },                                \
+-    .val_max =     { .val_i =  99 },                                \
+-    .help_string = TRS("Single coefficient elimination threshold for " \
+-"chrominamce. Negative values also consider dc coefficient. 7 is " \
+-"JVT recommendation") \
+-  }
+-
+ #define PARAM_STRICT_STANDARD_COMPLIANCE \
+   {                                                              \
+     .name = "ff_strict_std_compliance",                              \
+@@ -687,27 +661,7 @@
+ 
+ /* Does nothing */
+ /** Frame types */
+-#define PARAM_INTER_THRESHOLD \
+-  { \
+-    .name = "ff_inter_threshold",   \
+-    .long_name = TRS("Inter threshold"),   \
+-    .type = BG_PARAMETER_INT,                \
+-    .val_default = { .val_i = 0 },            \
+-  }
+-
+ /** Quantizer */
+-#define PARAM_QUANTIZER_NOISE_SHAPING \
+-  { \
+-  .name = "ff_quantizer_noise_shaping", \
+-    .long_name = TRS("Quantizer noise shaping"),\
+-    .type = BG_PARAMETER_SLIDER_INT, \
+-    .val_default = { .val_i = 0 },\
+-    .val_min =     { .val_i = 0 },\
+-    .val_max =     { .val_i = 3 },\
+-    .help_string = TRS("Choose quantization such that noise will be masked by "\
+-"similar-frequency content in the image") \
+-  }
+-
+ /** Motion estimation */
+ #define PARAM_ME_THRESHOLD \
+   { \
+@@ -982,24 +936,6 @@
+     .val_default = { .val_i = 0 },    \
+   }
+ 
+-#define PARAM_FLAG_CBP_RD \
+-  {                       \
+-    .name = "ff_flag_cbp_rd", \
+-    .long_name = TRS("CBP RD"), \
+-    .type =        BG_PARAMETER_CHECKBUTTON, \
+-    .val_default = { .val_i = 0 },    \
+-    .help_string = TRS("Use rate distortion optimization for cbp"),\
+-  }
+-
+-#define PARAM_FLAG_QP_RD \
+-  {                      \
+-    .name = "ff_flag_qp_rd", \
+-    .long_name = TRS("QP RD"), \
+-    .type =        BG_PARAMETER_CHECKBUTTON, \
+-    .val_default = { .val_i = 0 },    \
+-    .help_string = TRS("Use rate distortion optimization for qp selection"),\
+-  }
+-
+ #define PARAM_FLAG_H263P_AIV \
+   {                      \
+     .name = "ff_flag_h263p_aiv", \
+@@ -1051,13 +987,3 @@
+     .val_default = { .val_i = 0 },    \
+     .help_string = TRS("Allow non spec compliant speedup tricks") \
+ }
+-
+-/** Frame types */
+-#define PARAM_FLAG2_STRICT_GOP                     \
+-  { \
+-    .name = "ff_flag2_strict_gop", \
+-    .long_name = TRS("Strictly enforce GOP size"), \
+-    .type =        BG_PARAMETER_CHECKBUTTON, \
+-    .val_default = { .val_i = 0 },    \
+-}
+-
diff --git a/debian/patches/series b/debian/patches/series
index 220dc6e..4b82160 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 libav.patch
 fix_typos.patch
 plugins-ldflags.patch
+#libav10.patch

-- 
gmerlin-encoders packaging



More information about the pkg-multimedia-commits mailing list