[SCM] gmerlin-encoders/master: Made it compile with libav/ffmpeg found in debian

zmoelnig-guest at users.alioth.debian.org zmoelnig-guest at users.alioth.debian.org
Mon Jun 11 15:39:47 UTC 2012


The following commit has been merged in the master branch:
commit f3a84c33b3f50e002a503d3ed8b3f17807681281
Author: IOhannes m zmölnig <zmoelnig at iem.at>
Date:   Mon Jun 11 17:33:25 2012 +0200

    Made it compile with libav/ffmpeg found in debian

diff --git a/debian/patches/libav.patch b/debian/patches/libav.patch
new file mode 100644
index 0000000..417e96e
--- /dev/null
+++ b/debian/patches/libav.patch
@@ -0,0 +1,165 @@
+Author: IOhannes m zmölnig
+Description: more fine-grained version-checks for ffmpeg-features.
+
+--- gmerlin-encoders.orig/plugins/ffmpeg/codecs.c
++++ gmerlin-encoders/plugins/ffmpeg/codecs.c
+@@ -870,7 +870,8 @@
+     found = 1;                                      \
+     }
+ 
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
++
+ #define PARAM_DICT_STRING(n, ffmpeg_key) \
+   if(!strcmp(n, name)) \
+     { \
+@@ -901,7 +902,7 @@
+ 
+ void
+ bg_ffmpeg_set_codec_parameter(AVCodecContext * ctx,
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+                               AVDictionary ** options,
+ #endif
+ 
+@@ -1009,7 +1010,7 @@
+   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
+   PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
+ 
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+   PARAM_DICT_STRING("libx264_preset", "preset");
+   PARAM_DICT_STRING("libx264_tune",   "tune");
+   PARAM_DICT_FLOAT("libx264_crf", "crf");
+--- gmerlin-encoders.orig/plugins/ffmpeg/ffmpeg_common.c
++++ gmerlin-encoders/plugins/ffmpeg/ffmpeg_common.c
+@@ -537,7 +537,7 @@
+     }
+   else
+     bg_ffmpeg_set_codec_parameter(st->stream->codec,
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+                                   &st->options,
+ #endif
+                                   name, v);
+@@ -585,7 +585,7 @@
+     }
+   else
+     bg_ffmpeg_set_codec_parameter(st->stream->codec,
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+                                   &st->options,
+ #endif
+                                   name, v);
+@@ -635,7 +635,7 @@
+   if(priv->ctx->oformat->flags & AVFMT_GLOBALHEADER)
+     st->stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+   
+-#if LIBAVCODEC_VERSION_MAJOR < 54
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53,7,1)
+   if(avcodec_open(st->stream->codec, codec) < 0)
+     {
+     bg_log(BG_LOG_ERROR, LOG_DOMAIN, "avcodec_open failed for audio");
+@@ -760,7 +760,7 @@
+   if(priv->ctx->oformat->flags & AVFMT_GLOBALHEADER)
+     st->stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+   
+-#if LIBAVCODEC_VERSION_MAJOR < 54
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53,7,1)
+   if(avcodec_open(st->stream->codec, codec) < 0)
+     {
+     bg_log(BG_LOG_ERROR, LOG_DOMAIN, "avcodec_open failed for video");
+@@ -789,7 +789,7 @@
+   int i;
+   priv = data;
+   
+-#if LIBAVFORMAT_VERSION_MAJOR < 54
++#if LIBAVFORMAT_VERSION_MAJOR < 52
+   /* set the output parameters (must be done even if no
+      parameters). */
+   if(av_set_parameters(priv->ctx, NULL) < 0)
+@@ -820,7 +820,7 @@
+     return 0;
+ #endif
+   
+-#if LIBAVFORMAT_VERSION_MAJOR < 54
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,2,0)
+   if(av_write_header(priv->ctx))
+     {
+     bg_log(BG_LOG_ERROR, LOG_DOMAIN, "av_write_header failed");
+@@ -1042,7 +1042,7 @@
+                                        st->buffer, st->buffer_alloc,
+                                        frame);
+   if(bytes_encoded < 0)
+-    return;
++    return -1;
+   else if(bytes_encoded > 0)
+     got_packet = 1;
+ #endif
+@@ -1134,7 +1134,7 @@
+ 
+   av_init_packet(&pkt);
+ 
+-  fprintf(stderr, "Write subtitle 1 %ld -> %ld\n", start, start + duration);
++  fprintf(stderr, "Write subtitle 1 %ld -> %ld\n", (long int)start, (long int)(start + duration));
+   fprintf(stderr, "%s\n", text);
+   
+   pkt.data     = (uint8_t*)bg_strdup(NULL, text);
+@@ -1147,8 +1147,8 @@
+                              st->stream->codec->time_base,
+                              st->stream->time_base) + st->pts_offset;
+ 
+-  fprintf(stderr, "Write subtitle 2 %ld -> %ld\n", pkt.pts,
+-          pkt.pts + pkt.duration);
++  fprintf(stderr, "Write subtitle 2 %ld -> %ld\n", (long int)pkt.pts,
++          (long int)(pkt.pts + pkt.duration));
+ 
+   pkt.convergence_duration = pkt.duration;
+   pkt.dts = pkt.pts;
+--- gmerlin-encoders.orig/plugins/ffmpeg/ffmpeg_common.h
++++ gmerlin-encoders/plugins/ffmpeg/ffmpeg_common.h
+@@ -52,6 +52,12 @@
+ #define ENCODE_AUDIO 1
+ #endif
+ 
++#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(43<<8)+0)
++#if LIBAVUTIL_VERSION_INT >= ((51<<16)+(8<<8)+0)
++# define USE_AV_DICTIONARY
++#endif
++#endif
++
+ 
+ typedef struct
+   {
+@@ -95,7 +101,7 @@
+ 
+ void
+ bg_ffmpeg_set_codec_parameter(AVCodecContext * ctx,
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+                               AVDictionary ** options,
+ #endif
+                               const char * name,
+@@ -119,11 +125,11 @@
+ 
+   int initialized;
+ 
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+   AVDictionary * options;
+ #endif
+ 
+-#if ENCODE_VIDEO2
++#if ENCODE_AUDIO2
+   int64_t samples_written;
+ #endif
+   
+@@ -151,7 +157,7 @@
+   
+   int64_t frames_written;
+ 
+-#if LIBAVCODEC_VERSION_MAJOR >= 54
++#ifdef USE_AV_DICTIONARY
+   AVDictionary * options;
+ #endif
+   const gavl_compression_info_t * ci;
diff --git a/debian/patches/series b/debian/patches/series
index 48dc2d5..f192529 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+libav.patch
 fix_typos.patch

-- 
gmerlin-encoders packaging



More information about the pkg-multimedia-commits mailing list