* [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0
@ 2018-08-12 20:32 Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 2/6] package/freeswitch: " Bernd Kuhls
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/aubio/0001-ffmpeg4.patch | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 package/aubio/0001-ffmpeg4.patch
diff --git a/package/aubio/0001-ffmpeg4.patch b/package/aubio/0001-ffmpeg4.patch
new file mode 100644
index 0000000000..bdaac55a3d
--- /dev/null
+++ b/package/aubio/0001-ffmpeg4.patch
@@ -0,0 +1,32 @@
+From 5690daf759b473b9d13b4547ef37adc2695cf524 Mon Sep 17 00:00:00 2001
+From: James Cowgill <jcowgill@jcowgill.uk>
+Date: Sun, 25 Feb 2018 14:23:25 +0000
+Subject: [PATCH] Fix build with FFmpeg 4.0
+
+Downloaded from upstream commit
+https://git.aubio.org/?p=aubio.git;a=commitdiff;h=5690daf759b473b9d13b4547ef37adc2695cf524
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/io/source_avcodec.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c
+index ccdce807..8197445c 100644
+--- a/src/io/source_avcodec.c
++++ b/src/io/source_avcodec.c
+@@ -58,7 +58,11 @@
+ #include "fmat.h"
+ #include "source_avcodec.h"
+
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56, 56, 0)
+ #define AUBIO_AVCODEC_MAX_BUFFER_SIZE FF_MIN_BUFFER_SIZE
++#else
++#define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
++#endif
+
+ struct _aubio_source_avcodec_t {
+ uint_t hop_size;
+--
+2.11.0
+
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 2/6] package/freeswitch: Fix build with FFmpeg 4.0
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
@ 2018-08-12 20:32 ` Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: " Bernd Kuhls
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/freeswitch/0002-ffmpeg4.patch | 70 +++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 package/freeswitch/0002-ffmpeg4.patch
diff --git a/package/freeswitch/0002-ffmpeg4.patch b/package/freeswitch/0002-ffmpeg4.patch
new file mode 100644
index 0000000000..6c323e097e
--- /dev/null
+++ b/package/freeswitch/0002-ffmpeg4.patch
@@ -0,0 +1,70 @@
+Fix build with ffmpeg4
+
+avcodec.c:194:40: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
+static uint8_t ff_input_buffer_padding[FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
+ ^
+avformat.c:471:14: error: use of undeclared identifier 'CODEC_FLAG_LOOP_FILTER'
+ c->flags|=CODEC_FLAG_LOOP_FILTER; // flags=+loop
+ ^
+avformat.c:477:47: error: use of undeclared identifier 'ME_HEX'
+ av_opt_set_int(c->priv_data, "motion_est", ME_HEX, 0);
+ ^
+avformat.c:553:15: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
+ c->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ ^
+avformat.c:638:31: error: use of undeclared identifier 'CODEC_CAP_VARIABLE_FRAME_SIZE'
+ if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) {
+ ^
+
+Downloaded from
+https://svnweb.freebsd.org/ports/head/net/freeswitch/files/patch-ffmpeg4?view=markup
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+--- a/src/mod/applications/mod_av/avcodec.c.orig 2017-07-13 12:07:30 UTC
++++ b/src/mod/applications/mod_av/avcodec.c
+@@ -191,7 +191,7 @@ typedef struct h264_codec_context_s {
+ int hw_encoder;
+ } h264_codec_context_t;
+
+-static uint8_t ff_input_buffer_padding[FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
++static uint8_t ff_input_buffer_padding[AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
+
+ static switch_status_t buffer_h264_nalu(h264_codec_context_t *context, switch_frame_t *frame)
+ {
+--- a/src/mod/applications/mod_av/avformat.c.orig 2017-07-13 12:07:30 UTC
++++ b/src/mod/applications/mod_av/avformat.c
+@@ -468,13 +468,13 @@ GCC_DIAG_ON(deprecated-declarations)
+ c->ticks_per_frame = 2;
+
+
+- c->flags|=CODEC_FLAG_LOOP_FILTER; // flags=+loop
++ c->flags|=AV_CODEC_FLAG_LOOP_FILTER; // flags=+loop
+ c->me_cmp|= 1; // cmp=+chroma, where CHROMA = 1
+ c->me_range = 16; // me_range=16
+ c->max_b_frames = 3; // bf=3
+
+ av_opt_set_int(c->priv_data, "b_strategy", 1, 0);
+- av_opt_set_int(c->priv_data, "motion_est", ME_HEX, 0);
++ av_opt_set(c->priv_data, "motion_est", "hex", 0);
+ av_opt_set_int(c->priv_data, "coder", 1, 0);
+
+ switch (mm->vprofile) {
+@@ -550,7 +550,7 @@ GCC_DIAG_ON(deprecated-declarations)
+
+ /* Some formats want stream headers to be separate. */
+ if (fc->oformat->flags & AVFMT_GLOBALHEADER) {
+- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+@@ -635,7 +635,7 @@ GCC_DIAG_ON(deprecated-declarations)
+ mst->frame->format = AV_SAMPLE_FMT_S16;
+ mst->frame->channel_layout = c->channel_layout;
+
+- if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) {
++ if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) {
+ mst->frame->nb_samples = 10000;
+ } else {
+ mst->frame->nb_samples = c->frame_size;
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: Fix build with FFmpeg 4.0
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 2/6] package/freeswitch: " Bernd Kuhls
@ 2018-08-12 20:32 ` Bernd Kuhls
2018-08-12 20:47 ` Peter Seiderer
2018-08-12 20:32 ` [Buildroot] [PATCH/next 4/6] package/mediastreamer: " Bernd Kuhls
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
.../gstreamer1/gst1-libav/0001-ffmpeg40.patch | 657 ++++++++++++++++++
1 file changed, 657 insertions(+)
create mode 100644 package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
diff --git a/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch b/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
new file mode 100644
index 0000000000..864988ef30
--- /dev/null
+++ b/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
@@ -0,0 +1,657 @@
+Fix build with ffmpeg 4.0
+
+Instead of using the ffmpeg copy included by this package we use a patch
+from the Gentoo bug tracker to fix the build with ffmpeg 4.0.
+
+Upstream included support for ffmpeg 4.0 in the upcoming 2.16.x release
+of gstreamer:
+https://bugzilla.gnome.org/show_bug.cgi?id=792900
+
+NEWS mentions that the fixes "won?t be backported to the 1.14 branch as
+it is rather intrusive":
+https://github.com/GStreamer/gst-libav/commit/8886a016fce625e1c25a4902be4021196a6784a2#diff-ff4e2dc4962dc25a1512353299992c8dR1400
+
+Downloaded from https://bugs.gentoo.org/654628#c11
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+diff --git a/ext/libav/gstav.c b/ext/libav/gstav.c
+index 0b9da42..10d8423 100644
+--- a/ext/libav/gstav.c
++++ b/ext/libav/gstav.c
+@@ -30,7 +30,7 @@
+
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+-#include <libavfilter/avfiltergraph.h>
++//#include <libavfilter/avfiltergraph.h>
+
+ #include "gstav.h"
+ #include "gstavutils.h"
+@@ -158,7 +158,7 @@ plugin_init (GstPlugin * plugin)
+ gst_ffmpeg_init_pix_fmt_info ();
+
+ av_register_all ();
+- avfilter_register_all ();
++ //avfilter_register_all ();
+
+ gst_ffmpegaudenc_register (plugin);
+ gst_ffmpegvidenc_register (plugin);
+diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c
+index 9aa45e3..fd25efd 100644
+--- a/ext/libav/gstavauddec.c
++++ b/ext/libav/gstavauddec.c
+@@ -283,7 +283,7 @@ gst_ffmpegauddec_propose_allocation (GstAudioDecoder * decoder,
+ gst_allocation_params_init (¶ms);
+ params.flags = GST_MEMORY_FLAG_ZERO_PADDED;
+ params.align = 15;
+- params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
++ params.padding = AV_INPUT_BUFFER_PADDING_SIZE;
+ /* we would like to have some padding so that we don't have to
+ * memcpy. We don't suggest an allocator. */
+ gst_query_add_allocation_param (query, NULL, ¶ms);
+@@ -665,7 +665,7 @@ gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec)
+
+ oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+
+- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
+ gint have_data, len;
+
+ GST_LOG_OBJECT (ffmpegdec,
+@@ -744,10 +744,10 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
+ bsize = map.size;
+
+ if (bsize > 0 && (!GST_MEMORY_IS_ZERO_PADDED (map.memory)
+- || (map.maxsize - map.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
++ || (map.maxsize - map.size) < AV_INPUT_BUFFER_PADDING_SIZE)) {
+ /* add padding */
+- if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
+- ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
++ if (ffmpegdec->padded_size < bsize + AV_INPUT_BUFFER_PADDING_SIZE) {
++ ffmpegdec->padded_size = bsize + AV_INPUT_BUFFER_PADDING_SIZE;
+ ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
+ GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
+ ffmpegdec->padded_size);
+@@ -755,7 +755,7 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
+ GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
+ "Copy input to add padding");
+ memcpy (ffmpegdec->padded, bdata, bsize);
+- memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++ memset (ffmpegdec->padded + bsize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
+ bdata = ffmpegdec->padded;
+ do_padding = TRUE;
+@@ -764,7 +764,7 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
+ }
+
+ do {
+- guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
++ guint8 tmp_padding[AV_INPUT_BUFFER_PADDING_SIZE];
+
+ data = bdata;
+ size = bsize;
+@@ -773,15 +773,15 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
+ /* add temporary padding */
+ GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
+ "Add temporary input padding");
+- memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
+- memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++ memcpy (tmp_padding, data + size, AV_INPUT_BUFFER_PADDING_SIZE);
++ memset (data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+
+ /* decode a frame of audio now */
+ len = gst_ffmpegauddec_frame (ffmpegdec, data, size, &have_data, &ret);
+
+ if (do_padding) {
+- memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
++ memcpy (data + size, tmp_padding, AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+
+ if (ret != GST_FLOW_OK) {
+diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c
+index 6ffbc3e..2a82273 100644
+--- a/ext/libav/gstavaudenc.c
++++ b/ext/libav/gstavaudenc.c
+@@ -283,7 +283,6 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
+ }
+
+ /* some other defaults */
+- ffmpegaudenc->context->rc_strategy = 2;
+ ffmpegaudenc->context->b_frame_strategy = 0;
+ ffmpegaudenc->context->coder_type = 0;
+ ffmpegaudenc->context->context_model = 0;
+@@ -330,7 +329,7 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
+ oclass->in_plugin) < 0)
+ GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
+
+- if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
++ if ((oclass->in_plugin->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
+ ffmpegaudenc->compliance != GST_FFMPEG_EXPERIMENTAL) {
+ GST_ELEMENT_ERROR (ffmpegaudenc, LIBRARY, SETTINGS,
+ ("Codec is experimental, but settings don't allow encoders to "
+@@ -602,7 +601,7 @@ gst_ffmpegaudenc_encode_audio (GstFFMpegAudEnc * ffmpegaudenc,
+ pkt->size, 0, pkt->size, pkt, gst_ffmpegaudenc_free_avpacket);
+
+ codec = ffmpegaudenc->context->codec;
+- if ((codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
++ if ((codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
+ /* FIXME: Not really correct, as -1 means "all the samples we got
+ given so far", which may not be true depending on the codec,
+ but we have no way to know AFAICT */
+@@ -626,7 +625,7 @@ gst_ffmpegaudenc_drain (GstFFMpegAudEnc * ffmpegaudenc)
+
+ oclass = (GstFFMpegAudEncClass *) (G_OBJECT_GET_CLASS (ffmpegaudenc));
+
+- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
+ gint have_data, try = 0;
+
+ GST_LOG_OBJECT (ffmpegaudenc,
+diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
+index a1863fd..408e08e 100644
+--- a/ext/libav/gstavcfg.c
++++ b/ext/libav/gstavcfg.c
+@@ -42,9 +42,9 @@ gst_ffmpeg_pass_get_type (void)
+ if (!ffmpeg_pass_type) {
+ static const GEnumValue ffmpeg_passes[] = {
+ {0, "Constant Bitrate Encoding", "cbr"},
+- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
+- {CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
+- {CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
++ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
++ {AV_CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
++ {AV_CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
+ {0, NULL, NULL},
+ };
+
+@@ -66,7 +66,7 @@ gst_ffmpeg_lim_pass_get_type (void)
+ if (!ffmpeg_lim_pass_type) {
+ static const GEnumValue ffmpeg_lim_passes[] = {
+ {0, "Constant Bitrate Encoding", "cbr"},
+- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
++ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
+ {0, NULL, NULL},
+ };
+
+@@ -121,9 +121,9 @@ gst_ffmpeg_mb_cmp_get_type (void)
+ {FF_CMP_VSSE, "VSSE", "vsse"},
+ #if 0
+ /* economize a bit for now */
+- {FF_CMP_NSSE, "NSSE", "nsse"},
+- {FF_CMP_W53, "W53", "w53"},
+- {FF_CMP_W97, "W97", "w97"},
++ {AV_CMP_NSSE, "NSSE", "nsse"},
++ {AV_CMP_W53, "W53", "w53"},
++ {AV_CMP_W97, "W97", "w97"},
+ #endif
+ {0, NULL, NULL},
+ };
+@@ -260,21 +260,22 @@ gst_ffmpeg_flags_get_type (void)
+ /* FIXME: This needs some serious resyncing with avcodec.h */
+ if (!ffmpeg_flags_type) {
+ static const GFlagsValue ffmpeg_flags[] = {
+- {CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
+- {CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
+- {CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
+- {CODEC_FLAG_GMC, "GMC", "gmc"},
+- {CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
+- {CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
+- {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
+- {CODEC_FLAG_NORMALIZE_AQP,
+- "Normalize Adaptive Quantization (masking, etc)", "aqp"},
+- {CODEC_FLAG_GLOBAL_HEADER,
++ {AV_CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
++ {AV_CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
++ {AV_CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
++ //{AV_CODEC_FLAG_GMC, "GMC", "gmc"},
++ //{AV_CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
++ {AV_CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
++ {AV_CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
++ //{AV_CODEC_FLAG_NORMALIZE_AQP,
++ // "Normalize Adaptive Quantization (masking, etc)", "aqp"},
++ {AV_CODEC_FLAG_GLOBAL_HEADER,
+ "Global headers in extradata instead of every keyframe",
+ "global-headers"},
+- {CODEC_FLAG_AC_PRED, "H263 Advanced Intra Coding / MPEG4 AC prediction",
++ {AV_CODEC_FLAG_AC_PRED,
++ "H263 Advanced Intra Coding / MPEG4 AC prediction",
+ "aic"},
+- {CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
++ {AV_CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
+ {0, NULL, NULL},
+ };
+
+@@ -487,31 +488,39 @@ gst_ffmpeg_cfg_init (void)
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.qblur, FALSE, mpeg, NULL);
+
++#if 0
+ pspec = g_param_spec_float ("rc-qsquish", "Ratecontrol Limiting Method",
+ "0 means limit by clipping, otherwise use nice continuous function",
+ 0, 99.0f, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_qsquish, FALSE, mpeg, NULL);
++#endif
+
++#if 0
+ pspec = g_param_spec_float ("rc-qmod-amp", "Ratecontrol Mod",
+ "Ratecontrol Mod", 0, 99.0f, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_qmod_amp, FALSE, mpeg, NULL);
++#endif
+
++#if 0
+ pspec = g_param_spec_int ("rc-qmod-freq", "Ratecontrol Freq",
+ "Ratecontrol Freq", 0, 0, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_qmod_freq, FALSE, mpeg, NULL);
++#endif
+
+ pspec = g_param_spec_int ("rc-buffer-size", "Ratecontrol Buffer Size",
+ "Decoder bitstream buffer size", 0, G_MAXINT, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_buffer_size, FALSE, mpeg, NULL);
+
++#if 0
+ pspec =
+ g_param_spec_float ("rc-buffer-aggressivity",
+ "Ratecontrol Buffer Aggressivity", "Ratecontrol Buffer Aggressivity", 0,
+ 99.0f, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_buffer_aggressivity, FALSE, mpeg,
+ NULL);
++#endif
+
+ #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0)
+ pspec = g_param_spec_int ("rc-max-rate", "Ratecontrol Maximum Bitrate",
+@@ -529,17 +538,21 @@ gst_ffmpeg_cfg_init (void)
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL);
+
++#if 0
+ pspec =
+ g_param_spec_float ("rc-initial-cplx",
+ "Initial Complexity for Pass 1 Ratecontrol",
+ "Initial Complexity for Pass 1 Ratecontrol", 0, 9999999.0f, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_initial_cplx, FALSE, mpeg, NULL);
++#endif
+
++#if 0
+ pspec = g_param_spec_string ("rc-eq", "Ratecontrol Equation",
+ "Ratecontrol Equation", "tex^qComp",
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.rc_eq, FALSE, mpeg, NULL);
++#endif
+
+ pspec = g_param_spec_float ("b-quant-factor", "B-Quantizer Factor",
+ "Factor in B-Frame Quantizer Computation",
+@@ -630,19 +643,23 @@ gst_ffmpeg_cfg_init (void)
+ 0, 16000, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.me_range, FALSE, mpeg, NULL);
+
++#if 0
+ pspec = g_param_spec_int ("intra-quant-bias",
+ "Intra Quantizer Bias",
+ "Intra Quantizer Bias",
+- -1000000, 1000000, FF_DEFAULT_QUANT_BIAS,
++ -1000000, 1000000, AV_DEFAULT_QUANT_BIAS,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.intra_quant_bias, FALSE, mpeg, NULL);
++#endif
+
++#if 0
+ pspec = g_param_spec_int ("inter-quant-bias",
+ "Inter Quantizer Bias",
+ "Inter Quantizer Bias",
+- -1000000, 1000000, FF_DEFAULT_QUANT_BIAS,
++ -1000000, 1000000, AV_DEFAULT_QUANT_BIAS,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ gst_ffmpeg_add_pspec (pspec, config.inter_quant_bias, FALSE, mpeg, NULL);
++#endif
+
+ pspec = g_param_spec_int ("noise-reduction",
+ "Noise Reduction",
+diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
+index 9a72033..6b66bb9 100644
+--- a/ext/libav/gstavcodecmap.c
++++ b/ext/libav/gstavcodecmap.c
+@@ -825,10 +825,10 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
+ if (encode && context) {
+
+ gst_caps_set_simple (caps,
+- "annex-f", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_4MV,
+- "annex-j", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_LOOP_FILTER,
+- "annex-i", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
+- "annex-t", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
++ "annex-f", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_4MV,
++ "annex-j", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_LOOP_FILTER,
++ "annex-i", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
++ "annex-t", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
+ NULL);
+ }
+ break;
+@@ -3181,7 +3181,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
+ * as is, as that is what most players do. */
+ context->extradata =
+ av_mallocz (GST_ROUND_UP_16 (size * 2 +
+- FF_INPUT_BUFFER_PADDING_SIZE));
++ AV_INPUT_BUFFER_PADDING_SIZE));
+ copy_config (context->extradata, data, size, &extrasize);
+ GST_DEBUG ("escaped size: %d", extrasize);
+ context->extradata_size = extrasize;
+@@ -3192,7 +3192,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
+ GST_DEBUG ("copy codec_data");
+ context->extradata =
+ av_mallocz (GST_ROUND_UP_16 (map.size +
+- FF_INPUT_BUFFER_PADDING_SIZE));
++ AV_INPUT_BUFFER_PADDING_SIZE));
+ memcpy (context->extradata, map.data, map.size);
+ context->extradata_size = map.size;
+ }
+@@ -3216,7 +3216,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
+ {
+ const gchar *mime = gst_structure_get_name (str);
+
+- context->flags |= CODEC_FLAG_4MV;
++ context->flags |= AV_CODEC_FLAG_4MV;
+
+ if (!strcmp (mime, "video/x-divx"))
+ context->codec_tag = GST_MAKE_FOURCC ('D', 'I', 'V', 'X');
+@@ -3228,7 +3228,8 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
+ profile = gst_structure_get_string (str, "profile");
+ if (profile) {
+ if (g_strcmp0 (profile, "advanced-simple") == 0)
+- context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
++ context->flags |= AV_CODEC_FLAG_QPEL;
++ /* FIXME use the "gmc" private option of the libxvid encoder */
+ }
+ }
+ break;
+@@ -3334,18 +3335,18 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
+ gboolean val;
+
+ if (!gst_structure_get_boolean (str, "annex-f", &val) || val)
+- context->flags |= CODEC_FLAG_4MV;
++ context->flags |= AV_CODEC_FLAG_4MV;
+ else
+- context->flags &= ~CODEC_FLAG_4MV;
++ context->flags &= ~AV_CODEC_FLAG_4MV;
+ if ((!gst_structure_get_boolean (str, "annex-i", &val) || val) &&
+ (!gst_structure_get_boolean (str, "annex-t", &val) || val))
+- context->flags |= CODEC_FLAG_AC_PRED;
++ context->flags |= AV_CODEC_FLAG_AC_PRED;
+ else
+- context->flags &= ~CODEC_FLAG_AC_PRED;
++ context->flags &= ~AV_CODEC_FLAG_AC_PRED;
+ if (!gst_structure_get_boolean (str, "annex-j", &val) || val)
+- context->flags |= CODEC_FLAG_LOOP_FILTER;
++ context->flags |= AV_CODEC_FLAG_LOOP_FILTER;
+ else
+- context->flags &= ~CODEC_FLAG_LOOP_FILTER;
++ context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER;
+ break;
+ }
+ case AV_CODEC_ID_ADPCM_G726:
+diff --git a/ext/libav/gstavcodecmap.h b/ext/libav/gstavcodecmap.h
+index 9575e77..14cdfce 100644
+--- a/ext/libav/gstavcodecmap.h
++++ b/ext/libav/gstavcodecmap.h
+@@ -155,7 +155,7 @@ gst_ffmpeg_formatid_to_caps (const gchar *format_name);
+
+ /*
+ * _formatid_get_codecids () can be used to get the codecIDs
+- * (CODEC_ID_NONE-terminated list) that fit that specific
++ * (AV_CODEC_ID_NONE-terminated list) that fit that specific
+ * output format.
+ */
+
+diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
+index f9c6096..0ed4b23 100644
+--- a/ext/libav/gstavviddec.c
++++ b/ext/libav/gstavviddec.c
+@@ -237,7 +237,7 @@ gst_ffmpegviddec_class_init (GstFFMpegVidDecClass * klass)
+ DEFAULT_OUTPUT_CORRUPT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ caps = klass->in_plugin->capabilities;
+- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
++ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
+ g_param_spec_int ("max-threads", "Maximum decode threads",
+ "Maximum number of worker threads to spawn. (0 = auto)",
+@@ -365,7 +365,7 @@ gst_ffmpegviddec_open (GstFFMpegVidDec * ffmpegdec)
+ oclass->in_plugin->name, oclass->in_plugin->id);
+
+ gst_ffmpegviddec_context_set_flags (ffmpegdec->context,
+- CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
++ AV_CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
+
+ return TRUE;
+
+@@ -495,7 +495,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
+ gboolean is_live;
+
+ if (ffmpegdec->max_threads == 0) {
+- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
++ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
+ ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
+ else
+ ffmpegdec->context->thread_count = 0;
+@@ -624,10 +624,7 @@ gst_ffmpegvideodec_prepare_dr_pool (GstFFMpegVidDec * ffmpegdec,
+ avcodec_align_dimensions2 (ffmpegdec->context, &width, &height,
+ linesize_align);
+
+- if (ffmpegdec->context->flags & CODEC_FLAG_EMU_EDGE)
+- edge = 0;
+- else
+- edge = avcodec_get_edge_width ();
++ edge = 0;
+
+ /* increase the size for the padding */
+ width += edge << 1;
+@@ -732,7 +729,7 @@ gst_ffmpegviddec_can_direct_render (GstFFMpegVidDec * ffmpegdec)
+ return FALSE;
+
+ oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+- return ((oclass->in_plugin->capabilities & CODEC_CAP_DR1) == CODEC_CAP_DR1);
++ return ((oclass->in_plugin->capabilities & AV_CODEC_CAP_DR1) == AV_CODEC_CAP_DR1);
+ }
+
+ /* called when ffmpeg wants us to allocate a buffer to write the decoded frame
+@@ -1769,7 +1766,7 @@ gst_ffmpegviddec_drain (GstVideoDecoder * decoder)
+
+ oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+
+- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
+ gint have_data, len;
+ GstFlowReturn ret;
+
+@@ -1815,10 +1812,10 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
+ bsize = minfo.size;
+
+ if (bsize > 0 && (!GST_MEMORY_IS_ZERO_PADDED (minfo.memory)
+- || (minfo.maxsize - minfo.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
++ || (minfo.maxsize - minfo.size) < AV_INPUT_BUFFER_PADDING_SIZE)) {
+ /* add padding */
+- if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
+- ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
++ if (ffmpegdec->padded_size < bsize + AV_INPUT_BUFFER_PADDING_SIZE) {
++ ffmpegdec->padded_size = bsize + AV_INPUT_BUFFER_PADDING_SIZE;
+ ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
+ GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
+ ffmpegdec->padded_size);
+@@ -1826,7 +1823,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
+ GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
+ "Copy input to add padding");
+ memcpy (ffmpegdec->padded, bdata, bsize);
+- memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++ memset (ffmpegdec->padded + bsize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
+ bdata = ffmpegdec->padded;
+ do_padding = TRUE;
+@@ -1835,7 +1832,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
+ }
+
+ do {
+- guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
++ guint8 tmp_padding[AV_INPUT_BUFFER_PADDING_SIZE];
+
+ /* parse, if at all possible */
+ data = bdata;
+@@ -1845,8 +1842,8 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
+ /* add temporary padding */
+ GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
+ "Add temporary input padding");
+- memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
+- memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++ memcpy (tmp_padding, data + size, AV_INPUT_BUFFER_PADDING_SIZE);
++ memset (data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+
+ /* decode a frame of audio/video now */
+@@ -1862,7 +1859,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
+ }
+
+ if (do_padding) {
+- memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
++ memcpy (data + size, tmp_padding, AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+
+ if (len == 0 && have_data == 0) {
+@@ -2143,7 +2140,7 @@ gst_ffmpegviddec_propose_allocation (GstVideoDecoder * decoder,
+ gst_allocation_params_init (¶ms);
+ params.flags = GST_MEMORY_FLAG_ZERO_PADDED;
+ params.align = DEFAULT_STRIDE_ALIGN;
+- params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
++ params.padding = AV_INPUT_BUFFER_PADDING_SIZE;
+ /* we would like to have some padding so that we don't have to
+ * memcpy. We don't suggest an allocator. */
+ gst_query_add_allocation_param (query, NULL, ¶ms);
+diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c
+index 36143f5..22e5cae 100644
+--- a/ext/libav/gstavvidenc.c
++++ b/ext/libav/gstavvidenc.c
+@@ -68,18 +68,19 @@ enum
+ PROP_CFG_BASE,
+ };
+
++#if 0
+ #define GST_TYPE_ME_METHOD (gst_ffmpegvidenc_me_method_get_type())
+ static GType
+ gst_ffmpegvidenc_me_method_get_type (void)
+ {
+ static GType ffmpegenc_me_method_type = 0;
+ static GEnumValue ffmpegenc_me_methods[] = {
+- {ME_ZERO, "None (Very low quality)", "zero"},
+- {ME_FULL, "Full (Slow, unmaintained)", "full"},
+- {ME_LOG, "Logarithmic (Low quality, unmaintained)", "logarithmic"},
+- {ME_PHODS, "phods (Low quality, unmaintained)", "phods"},
+- {ME_EPZS, "EPZS (Best quality, Fast)", "epzs"},
+- {ME_X1, "X1 (Experimental)", "x1"},
++ {FF_CMP_ZERO, "None (Very low quality)", "zero"},
++ {FF_CMP_FULL, "Full (Slow, unmaintained)", "full"},
++ {FF_CMP_LOG, "Logarithmic (Low quality, unmaintained)", "logarithmic"},
++ {FF_CMP_PHODS, "phods (Low quality, unmaintained)", "phods"},
++ {FF_CMP_EPZS, "EPZS (Best quality, Fast)", "epzs"},
++ {FF_CMP_X1, "X1 (Experimental)", "x1"},
+ {0, NULL, NULL},
+ };
+ if (!ffmpegenc_me_method_type) {
+@@ -88,6 +89,7 @@ gst_ffmpegvidenc_me_method_get_type (void)
+ }
+ return ffmpegenc_me_method_type;
+ }
++#endif
+
+ /* A number of function prototypes are given so we can refer to them later. */
+ static void gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass);
+@@ -201,10 +203,12 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass)
+ g_param_spec_int ("gop-size", "GOP Size",
+ "Number of frames within one GOP", 0, G_MAXINT,
+ DEFAULT_VIDEO_GOP_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++#if 0
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ME_METHOD,
+ g_param_spec_enum ("me-method", "ME Method", "Motion Estimation Method",
+- GST_TYPE_ME_METHOD, ME_EPZS,
++ GST_TYPE_ME_METHOD, FF_CMP_EPZS,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++#endif
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFSIZE,
+ g_param_spec_int ("buffer-size", "Buffer Size",
+@@ -216,7 +220,7 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass)
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ caps = klass->in_plugin->capabilities;
+- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
++ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
+ g_param_spec_int ("max-threads", "Maximum encode threads",
+ "Maximum number of worker threads to spawn. (0 = auto)",
+@@ -259,7 +263,7 @@ gst_ffmpegvidenc_init (GstFFMpegVidEnc * ffmpegenc)
+ ffmpegenc->file = NULL;
+
+ ffmpegenc->bitrate = DEFAULT_VIDEO_BITRATE;
+- ffmpegenc->me_method = ME_EPZS;
++ //ffmpegenc->me_method = FF_CMP_EPZS;
+ ffmpegenc->buffer_size = 512 * 1024;
+ ffmpegenc->gop_size = DEFAULT_VIDEO_GOP_SIZE;
+ ffmpegenc->rtp_payload_size = 0;
+@@ -321,12 +325,12 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
+ ffmpegenc->context->bit_rate = ffmpegenc->bitrate;
+ ffmpegenc->context->bit_rate_tolerance = ffmpegenc->bitrate;
+ ffmpegenc->context->gop_size = ffmpegenc->gop_size;
+- ffmpegenc->context->me_method = ffmpegenc->me_method;
++ //ffmpegenc->context->me_method = ffmpegenc->me_method;
+ GST_DEBUG_OBJECT (ffmpegenc, "Setting avcontext to bitrate %d, gop_size %d",
+ ffmpegenc->bitrate, ffmpegenc->gop_size);
+
+ if (ffmpegenc->max_threads == 0) {
+- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
++ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
+ ffmpegenc->context->thread_count = gst_ffmpeg_auto_max_threads ();
+ else
+ ffmpegenc->context->thread_count = 0;
+@@ -343,16 +347,16 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
+ gst_ffmpeg_cfg_fill_context (ffmpegenc, ffmpegenc->context);
+
+ /* then handle some special cases */
+- ffmpegenc->context->lmin = (ffmpegenc->lmin * FF_QP2LAMBDA + 0.5);
+- ffmpegenc->context->lmax = (ffmpegenc->lmax * FF_QP2LAMBDA + 0.5);
++ ffmpegenc->context->qmin = (ffmpegenc->lmin * FF_QP2LAMBDA + 0.5);
++ ffmpegenc->context->qmax = (ffmpegenc->lmax * FF_QP2LAMBDA + 0.5);
+
+ if (ffmpegenc->interlaced) {
+ ffmpegenc->context->flags |=
+- CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME;
++ AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME;
+ }
+
+ /* some other defaults */
+- ffmpegenc->context->rc_strategy = 2;
++ //ffmpegenc->context->rc_strategy = 2;
+ ffmpegenc->context->b_frame_strategy = 0;
+ ffmpegenc->context->coder_type = 0;
+ ffmpegenc->context->context_model = 0;
+@@ -362,18 +366,18 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
+ ffmpegenc->context->flags |= ffmpegenc->pass;
+ switch (ffmpegenc->pass) {
+ /* some additional action depends on type of pass */
+- case CODEC_FLAG_QSCALE:
++ case AV_CODEC_FLAG_QSCALE:
+ ffmpegenc->context->global_quality
+ = ffmpegenc->picture->quality = FF_QP2LAMBDA * ffmpegenc->quantizer;
+ break;
+- case CODEC_FLAG_PASS1: /* need to prepare a stats file */
++ case AV_CODEC_FLAG_PASS1: /* need to prepare a stats file */
+ /* we don't close when changing caps, fingers crossed */
+ if (!ffmpegenc->file)
+ ffmpegenc->file = g_fopen (ffmpegenc->filename, "w");
+ if (!ffmpegenc->file)
+ goto open_file_err;
+ break;
+- case CODEC_FLAG_PASS2:
++ case AV_CODEC_FLAG_PASS2:
+ { /* need to read the whole stats file ! */
+ gsize size;
+
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 4/6] package/mediastreamer: Fix build with FFmpeg 4.0
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 2/6] package/freeswitch: " Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: " Bernd Kuhls
@ 2018-08-12 20:32 ` Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 5/6] package/motion: " Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 6/6] package/squeezelite: " Bernd Kuhls
4 siblings, 0 replies; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/mediastreamer/0002-ffmpeg4.patch | 30 ++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 package/mediastreamer/0002-ffmpeg4.patch
diff --git a/package/mediastreamer/0002-ffmpeg4.patch b/package/mediastreamer/0002-ffmpeg4.patch
new file mode 100644
index 0000000000..e0424e09b6
--- /dev/null
+++ b/package/mediastreamer/0002-ffmpeg4.patch
@@ -0,0 +1,30 @@
+Fix build with ffmpeg4
+
+videofilters/nowebcam.c:251:49: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
+ jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ^
+Downloaded from
+https://svnweb.freebsd.org/ports/head/net/mediastreamer/files/patch-src_videofilters_nowebcam.c?view=markup
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+--- a/src/videofilters/nowebcam.c.orig 2016-08-18 14:17:37 UTC
++++ b/src/videofilters/nowebcam.c
+@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ #ifndef NO_FFMPEG
+ #include "ffmpeg-priv.h"
+ #else
+-#define FF_INPUT_BUFFER_PADDING_SIZE 32
++#define AV_INPUT_BUFFER_PADDING_SIZE 32
+ #endif
+
+ #if TARGET_OS_IPHONE
+@@ -248,7 +248,7 @@ static mblk_t *_ms_load_jpeg_as_yuv(const char *jpgpat
+ ms_error("Cannot load %s",jpgpath);
+ return NULL;
+ }
+- jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size + FF_INPUT_BUFFER_PADDING_SIZE);
++ jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (jpgbuf==NULL)
+ {
+ close(fd);
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 5/6] package/motion: Fix build with FFmpeg 4.0
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
` (2 preceding siblings ...)
2018-08-12 20:32 ` [Buildroot] [PATCH/next 4/6] package/mediastreamer: " Bernd Kuhls
@ 2018-08-12 20:32 ` Bernd Kuhls
2018-08-12 21:51 ` Thomas Petazzoni
2018-08-12 20:32 ` [Buildroot] [PATCH/next 6/6] package/squeezelite: " Bernd Kuhls
4 siblings, 1 reply; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/motion/0001-ffmpeg40.patch | 57 ++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 package/motion/0001-ffmpeg40.patch
diff --git a/package/motion/0001-ffmpeg40.patch b/package/motion/0001-ffmpeg40.patch
new file mode 100644
index 0000000000..f3cdfa93b4
--- /dev/null
+++ b/package/motion/0001-ffmpeg40.patch
@@ -0,0 +1,57 @@
+From ff99988d57f4bcb0a7b381374f8106896bda2b15 Mon Sep 17 00:00:00 2001
+From: James Cowgill <jcowgill@jcowgill.uk>
+Date: Fri, 23 Feb 2018 23:04:33 +0000
+Subject: [PATCH] Fix build errors with FFmpeg 4.0
+
+Downloaded from
+https://sources.debian.org/src/motion/4.1.1-1.1/debian/patches/ffmpeg4.0.patch/
+
+Instead of backporting
+https://github.com/Motion-Project/motion/commit/9b93a417e37e1f0fef58d1582a7e98e4c05d3b42
+from upstream master branch we use the patch from Debian.
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ ffmpeg.c | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+--- a/ffmpeg.c
++++ b/ffmpeg.c
+@@ -68,6 +68,19 @@
+ #endif
+
+ /*********************************************/
++#if (LIBAVCODEC_VERSION_MAJOR >= 57)
++
++#define MY_CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
++#define MY_CODEC_FLAG_QSCALE AV_CODEC_FLAG_QSCALE
++
++#else
++
++#define MY_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
++#define MY_CODEC_FLAG_QSCALE CODEC_FLAG_QSCALE
++
++#endif
++
++/*********************************************/
+ AVFrame *my_frame_alloc(void){
+ AVFrame *pic;
+ #if (LIBAVFORMAT_VERSION_MAJOR >= 55)
+@@ -538,7 +551,7 @@
+ /* The selection of 8000 in the else is a subjective number based upon viewing output files */
+ if (ffmpeg->vbr > 0){
+ ffmpeg->vbr =(int)(((100-ffmpeg->vbr)*(100-ffmpeg->vbr)*(100-ffmpeg->vbr) * 8000) / 1000000) + 1;
+- ffmpeg->ctx_codec->flags |= CODEC_FLAG_QSCALE;
++ ffmpeg->ctx_codec->flags |= MY_CODEC_FLAG_QSCALE;
+ ffmpeg->ctx_codec->global_quality=ffmpeg->vbr;
+ }
+ }
+@@ -663,7 +676,7 @@
+ ffmpeg->ctx_codec->strict_std_compliance = -2;
+ ffmpeg->ctx_codec->level = 3;
+ }
+- ffmpeg->ctx_codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ ffmpeg->ctx_codec->flags |= MY_CODEC_FLAG_GLOBAL_HEADER;
+
+ retcd = ffmpeg_set_quality(ffmpeg);
+ if (retcd < 0){
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 6/6] package/squeezelite: Fix build with FFmpeg 4.0
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
` (3 preceding siblings ...)
2018-08-12 20:32 ` [Buildroot] [PATCH/next 5/6] package/motion: " Bernd Kuhls
@ 2018-08-12 20:32 ` Bernd Kuhls
4 siblings, 0 replies; 8+ messages in thread
From: Bernd Kuhls @ 2018-08-12 20:32 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/squeezelite/0004-ffmpeg4.0.patch | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 package/squeezelite/0004-ffmpeg4.0.patch
diff --git a/package/squeezelite/0004-ffmpeg4.0.patch b/package/squeezelite/0004-ffmpeg4.0.patch
new file mode 100644
index 0000000000..55f194f10a
--- /dev/null
+++ b/package/squeezelite/0004-ffmpeg4.0.patch
@@ -0,0 +1,21 @@
+Description: Fix FTBFS with FFmpeg 4.0
+Author: James Cowgill <jcowgill@debian.org>
+Bug-Debian: https://bugs.debian.org/888335
+
+Downloaded from Debian:
+https://sources.debian.org/src/squeezelite/1.8-4.1/debian/patches/ffmpeg4.0.patch/
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/ffmpeg.c
++++ b/ffmpeg.c
+@@ -264,7 +264,7 @@ static decode_state ff_decode(void) {
+ ff->mmsh_bytes_left = ff->mmsh_bytes_pad = ff->mmsh_packet_len = 0;
+
+ if (!ff->readbuf) {
+- ff->readbuf = AV(ff, malloc, READ_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
++ ff->readbuf = AV(ff, malloc, READ_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+
+ avio = AVIO(ff, alloc_context, ff->readbuf, READ_SIZE, 0, NULL, _read_data, NULL, NULL);
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: Fix build with FFmpeg 4.0
2018-08-12 20:32 ` [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: " Bernd Kuhls
@ 2018-08-12 20:47 ` Peter Seiderer
0 siblings, 0 replies; 8+ messages in thread
From: Peter Seiderer @ 2018-08-12 20:47 UTC (permalink / raw)
To: buildroot
Hello Bernd,
On Sun, 12 Aug 2018 22:32:02 +0200, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
> .../gstreamer1/gst1-libav/0001-ffmpeg40.patch | 657 ++++++++++++++++++
> 1 file changed, 657 insertions(+)
> create mode 100644 package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
>
> diff --git a/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch b/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
> new file mode 100644
> index 0000000000..864988ef30
> --- /dev/null
> +++ b/package/gstreamer1/gst1-libav/0001-ffmpeg40.patch
> @@ -0,0 +1,657 @@
> +Fix build with ffmpeg 4.0
> +
> +Instead of using the ffmpeg copy included by this package we use a patch
> +from the Gentoo bug tracker to fix the build with ffmpeg 4.0.
> +
> +Upstream included support for ffmpeg 4.0 in the upcoming 2.16.x release
> +of gstreamer:
Minor nit, should be upcoming 1.16.x release of gstreamer?
Regards,
Peter
> +https://bugzilla.gnome.org/show_bug.cgi?id=792900
> +
> +NEWS mentions that the fixes "won?t be backported to the 1.14 branch as
> +it is rather intrusive":
> +https://github.com/GStreamer/gst-libav/commit/8886a016fce625e1c25a4902be4021196a6784a2#diff-ff4e2dc4962dc25a1512353299992c8dR1400
> +
> +Downloaded from https://bugs.gentoo.org/654628#c11
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> +
> +diff --git a/ext/libav/gstav.c b/ext/libav/gstav.c
> +index 0b9da42..10d8423 100644
> +--- a/ext/libav/gstav.c
> ++++ b/ext/libav/gstav.c
> +@@ -30,7 +30,7 @@
> +
> + #include <libavcodec/avcodec.h>
> + #include <libavformat/avformat.h>
> +-#include <libavfilter/avfiltergraph.h>
> ++//#include <libavfilter/avfiltergraph.h>
> +
> + #include "gstav.h"
> + #include "gstavutils.h"
> +@@ -158,7 +158,7 @@ plugin_init (GstPlugin * plugin)
> + gst_ffmpeg_init_pix_fmt_info ();
> +
> + av_register_all ();
> +- avfilter_register_all ();
> ++ //avfilter_register_all ();
> +
> + gst_ffmpegaudenc_register (plugin);
> + gst_ffmpegvidenc_register (plugin);
> +diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c
> +index 9aa45e3..fd25efd 100644
> +--- a/ext/libav/gstavauddec.c
> ++++ b/ext/libav/gstavauddec.c
> +@@ -283,7 +283,7 @@ gst_ffmpegauddec_propose_allocation (GstAudioDecoder * decoder,
> + gst_allocation_params_init (¶ms);
> + params.flags = GST_MEMORY_FLAG_ZERO_PADDED;
> + params.align = 15;
> +- params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
> ++ params.padding = AV_INPUT_BUFFER_PADDING_SIZE;
> + /* we would like to have some padding so that we don't have to
> + * memcpy. We don't suggest an allocator. */
> + gst_query_add_allocation_param (query, NULL, ¶ms);
> +@@ -665,7 +665,7 @@ gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec)
> +
> + oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
> +
> +- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
> ++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
> + gint have_data, len;
> +
> + GST_LOG_OBJECT (ffmpegdec,
> +@@ -744,10 +744,10 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
> + bsize = map.size;
> +
> + if (bsize > 0 && (!GST_MEMORY_IS_ZERO_PADDED (map.memory)
> +- || (map.maxsize - map.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
> ++ || (map.maxsize - map.size) < AV_INPUT_BUFFER_PADDING_SIZE)) {
> + /* add padding */
> +- if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
> +- ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
> ++ if (ffmpegdec->padded_size < bsize + AV_INPUT_BUFFER_PADDING_SIZE) {
> ++ ffmpegdec->padded_size = bsize + AV_INPUT_BUFFER_PADDING_SIZE;
> + ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
> + GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
> + ffmpegdec->padded_size);
> +@@ -755,7 +755,7 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
> + GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
> + "Copy input to add padding");
> + memcpy (ffmpegdec->padded, bdata, bsize);
> +- memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memset (ffmpegdec->padded + bsize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
> +
> + bdata = ffmpegdec->padded;
> + do_padding = TRUE;
> +@@ -764,7 +764,7 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
> + }
> +
> + do {
> +- guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
> ++ guint8 tmp_padding[AV_INPUT_BUFFER_PADDING_SIZE];
> +
> + data = bdata;
> + size = bsize;
> +@@ -773,15 +773,15 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
> + /* add temporary padding */
> + GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
> + "Add temporary input padding");
> +- memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
> +- memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memcpy (tmp_padding, data + size, AV_INPUT_BUFFER_PADDING_SIZE);
> ++ memset (data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
> + }
> +
> + /* decode a frame of audio now */
> + len = gst_ffmpegauddec_frame (ffmpegdec, data, size, &have_data, &ret);
> +
> + if (do_padding) {
> +- memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memcpy (data + size, tmp_padding, AV_INPUT_BUFFER_PADDING_SIZE);
> + }
> +
> + if (ret != GST_FLOW_OK) {
> +diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c
> +index 6ffbc3e..2a82273 100644
> +--- a/ext/libav/gstavaudenc.c
> ++++ b/ext/libav/gstavaudenc.c
> +@@ -283,7 +283,6 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
> + }
> +
> + /* some other defaults */
> +- ffmpegaudenc->context->rc_strategy = 2;
> + ffmpegaudenc->context->b_frame_strategy = 0;
> + ffmpegaudenc->context->coder_type = 0;
> + ffmpegaudenc->context->context_model = 0;
> +@@ -330,7 +329,7 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
> + oclass->in_plugin) < 0)
> + GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
> +
> +- if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
> ++ if ((oclass->in_plugin->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
> + ffmpegaudenc->compliance != GST_FFMPEG_EXPERIMENTAL) {
> + GST_ELEMENT_ERROR (ffmpegaudenc, LIBRARY, SETTINGS,
> + ("Codec is experimental, but settings don't allow encoders to "
> +@@ -602,7 +601,7 @@ gst_ffmpegaudenc_encode_audio (GstFFMpegAudEnc * ffmpegaudenc,
> + pkt->size, 0, pkt->size, pkt, gst_ffmpegaudenc_free_avpacket);
> +
> + codec = ffmpegaudenc->context->codec;
> +- if ((codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
> ++ if ((codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
> + /* FIXME: Not really correct, as -1 means "all the samples we got
> + given so far", which may not be true depending on the codec,
> + but we have no way to know AFAICT */
> +@@ -626,7 +625,7 @@ gst_ffmpegaudenc_drain (GstFFMpegAudEnc * ffmpegaudenc)
> +
> + oclass = (GstFFMpegAudEncClass *) (G_OBJECT_GET_CLASS (ffmpegaudenc));
> +
> +- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
> ++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
> + gint have_data, try = 0;
> +
> + GST_LOG_OBJECT (ffmpegaudenc,
> +diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
> +index a1863fd..408e08e 100644
> +--- a/ext/libav/gstavcfg.c
> ++++ b/ext/libav/gstavcfg.c
> +@@ -42,9 +42,9 @@ gst_ffmpeg_pass_get_type (void)
> + if (!ffmpeg_pass_type) {
> + static const GEnumValue ffmpeg_passes[] = {
> + {0, "Constant Bitrate Encoding", "cbr"},
> +- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
> +- {CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
> +- {CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
> ++ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
> ++ {AV_CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
> ++ {AV_CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
> + {0, NULL, NULL},
> + };
> +
> +@@ -66,7 +66,7 @@ gst_ffmpeg_lim_pass_get_type (void)
> + if (!ffmpeg_lim_pass_type) {
> + static const GEnumValue ffmpeg_lim_passes[] = {
> + {0, "Constant Bitrate Encoding", "cbr"},
> +- {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
> ++ {AV_CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
> + {0, NULL, NULL},
> + };
> +
> +@@ -121,9 +121,9 @@ gst_ffmpeg_mb_cmp_get_type (void)
> + {FF_CMP_VSSE, "VSSE", "vsse"},
> + #if 0
> + /* economize a bit for now */
> +- {FF_CMP_NSSE, "NSSE", "nsse"},
> +- {FF_CMP_W53, "W53", "w53"},
> +- {FF_CMP_W97, "W97", "w97"},
> ++ {AV_CMP_NSSE, "NSSE", "nsse"},
> ++ {AV_CMP_W53, "W53", "w53"},
> ++ {AV_CMP_W97, "W97", "w97"},
> + #endif
> + {0, NULL, NULL},
> + };
> +@@ -260,21 +260,22 @@ gst_ffmpeg_flags_get_type (void)
> + /* FIXME: This needs some serious resyncing with avcodec.h */
> + if (!ffmpeg_flags_type) {
> + static const GFlagsValue ffmpeg_flags[] = {
> +- {CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
> +- {CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
> +- {CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
> +- {CODEC_FLAG_GMC, "GMC", "gmc"},
> +- {CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
> +- {CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
> +- {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
> +- {CODEC_FLAG_NORMALIZE_AQP,
> +- "Normalize Adaptive Quantization (masking, etc)", "aqp"},
> +- {CODEC_FLAG_GLOBAL_HEADER,
> ++ {AV_CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
> ++ {AV_CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
> ++ {AV_CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
> ++ //{AV_CODEC_FLAG_GMC, "GMC", "gmc"},
> ++ //{AV_CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
> ++ {AV_CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
> ++ {AV_CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
> ++ //{AV_CODEC_FLAG_NORMALIZE_AQP,
> ++ // "Normalize Adaptive Quantization (masking, etc)", "aqp"},
> ++ {AV_CODEC_FLAG_GLOBAL_HEADER,
> + "Global headers in extradata instead of every keyframe",
> + "global-headers"},
> +- {CODEC_FLAG_AC_PRED, "H263 Advanced Intra Coding / MPEG4 AC prediction",
> ++ {AV_CODEC_FLAG_AC_PRED,
> ++ "H263 Advanced Intra Coding / MPEG4 AC prediction",
> + "aic"},
> +- {CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
> ++ {AV_CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
> + {0, NULL, NULL},
> + };
> +
> +@@ -487,31 +488,39 @@ gst_ffmpeg_cfg_init (void)
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.qblur, FALSE, mpeg, NULL);
> +
> ++#if 0
> + pspec = g_param_spec_float ("rc-qsquish", "Ratecontrol Limiting Method",
> + "0 means limit by clipping, otherwise use nice continuous function",
> + 0, 99.0f, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_qsquish, FALSE, mpeg, NULL);
> ++#endif
> +
> ++#if 0
> + pspec = g_param_spec_float ("rc-qmod-amp", "Ratecontrol Mod",
> + "Ratecontrol Mod", 0, 99.0f, 0,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_qmod_amp, FALSE, mpeg, NULL);
> ++#endif
> +
> ++#if 0
> + pspec = g_param_spec_int ("rc-qmod-freq", "Ratecontrol Freq",
> + "Ratecontrol Freq", 0, 0, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_qmod_freq, FALSE, mpeg, NULL);
> ++#endif
> +
> + pspec = g_param_spec_int ("rc-buffer-size", "Ratecontrol Buffer Size",
> + "Decoder bitstream buffer size", 0, G_MAXINT, 0,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_buffer_size, FALSE, mpeg, NULL);
> +
> ++#if 0
> + pspec =
> + g_param_spec_float ("rc-buffer-aggressivity",
> + "Ratecontrol Buffer Aggressivity", "Ratecontrol Buffer Aggressivity", 0,
> + 99.0f, 1.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_buffer_aggressivity, FALSE, mpeg,
> + NULL);
> ++#endif
> +
> + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0)
> + pspec = g_param_spec_int ("rc-max-rate", "Ratecontrol Maximum Bitrate",
> +@@ -529,17 +538,21 @@ gst_ffmpeg_cfg_init (void)
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL);
> +
> ++#if 0
> + pspec =
> + g_param_spec_float ("rc-initial-cplx",
> + "Initial Complexity for Pass 1 Ratecontrol",
> + "Initial Complexity for Pass 1 Ratecontrol", 0, 9999999.0f, 0,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_initial_cplx, FALSE, mpeg, NULL);
> ++#endif
> +
> ++#if 0
> + pspec = g_param_spec_string ("rc-eq", "Ratecontrol Equation",
> + "Ratecontrol Equation", "tex^qComp",
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.rc_eq, FALSE, mpeg, NULL);
> ++#endif
> +
> + pspec = g_param_spec_float ("b-quant-factor", "B-Quantizer Factor",
> + "Factor in B-Frame Quantizer Computation",
> +@@ -630,19 +643,23 @@ gst_ffmpeg_cfg_init (void)
> + 0, 16000, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.me_range, FALSE, mpeg, NULL);
> +
> ++#if 0
> + pspec = g_param_spec_int ("intra-quant-bias",
> + "Intra Quantizer Bias",
> + "Intra Quantizer Bias",
> +- -1000000, 1000000, FF_DEFAULT_QUANT_BIAS,
> ++ -1000000, 1000000, AV_DEFAULT_QUANT_BIAS,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.intra_quant_bias, FALSE, mpeg, NULL);
> ++#endif
> +
> ++#if 0
> + pspec = g_param_spec_int ("inter-quant-bias",
> + "Inter Quantizer Bias",
> + "Inter Quantizer Bias",
> +- -1000000, 1000000, FF_DEFAULT_QUANT_BIAS,
> ++ -1000000, 1000000, AV_DEFAULT_QUANT_BIAS,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
> + gst_ffmpeg_add_pspec (pspec, config.inter_quant_bias, FALSE, mpeg, NULL);
> ++#endif
> +
> + pspec = g_param_spec_int ("noise-reduction",
> + "Noise Reduction",
> +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
> +index 9a72033..6b66bb9 100644
> +--- a/ext/libav/gstavcodecmap.c
> ++++ b/ext/libav/gstavcodecmap.c
> +@@ -825,10 +825,10 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
> + if (encode && context) {
> +
> + gst_caps_set_simple (caps,
> +- "annex-f", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_4MV,
> +- "annex-j", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_LOOP_FILTER,
> +- "annex-i", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
> +- "annex-t", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_AC_PRED,
> ++ "annex-f", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_4MV,
> ++ "annex-j", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_LOOP_FILTER,
> ++ "annex-i", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
> ++ "annex-t", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
> + NULL);
> + }
> + break;
> +@@ -3181,7 +3181,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
> + * as is, as that is what most players do. */
> + context->extradata =
> + av_mallocz (GST_ROUND_UP_16 (size * 2 +
> +- FF_INPUT_BUFFER_PADDING_SIZE));
> ++ AV_INPUT_BUFFER_PADDING_SIZE));
> + copy_config (context->extradata, data, size, &extrasize);
> + GST_DEBUG ("escaped size: %d", extrasize);
> + context->extradata_size = extrasize;
> +@@ -3192,7 +3192,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
> + GST_DEBUG ("copy codec_data");
> + context->extradata =
> + av_mallocz (GST_ROUND_UP_16 (map.size +
> +- FF_INPUT_BUFFER_PADDING_SIZE));
> ++ AV_INPUT_BUFFER_PADDING_SIZE));
> + memcpy (context->extradata, map.data, map.size);
> + context->extradata_size = map.size;
> + }
> +@@ -3216,7 +3216,7 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
> + {
> + const gchar *mime = gst_structure_get_name (str);
> +
> +- context->flags |= CODEC_FLAG_4MV;
> ++ context->flags |= AV_CODEC_FLAG_4MV;
> +
> + if (!strcmp (mime, "video/x-divx"))
> + context->codec_tag = GST_MAKE_FOURCC ('D', 'I', 'V', 'X');
> +@@ -3228,7 +3228,8 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
> + profile = gst_structure_get_string (str, "profile");
> + if (profile) {
> + if (g_strcmp0 (profile, "advanced-simple") == 0)
> +- context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
> ++ context->flags |= AV_CODEC_FLAG_QPEL;
> ++ /* FIXME use the "gmc" private option of the libxvid encoder */
> + }
> + }
> + break;
> +@@ -3334,18 +3335,18 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
> + gboolean val;
> +
> + if (!gst_structure_get_boolean (str, "annex-f", &val) || val)
> +- context->flags |= CODEC_FLAG_4MV;
> ++ context->flags |= AV_CODEC_FLAG_4MV;
> + else
> +- context->flags &= ~CODEC_FLAG_4MV;
> ++ context->flags &= ~AV_CODEC_FLAG_4MV;
> + if ((!gst_structure_get_boolean (str, "annex-i", &val) || val) &&
> + (!gst_structure_get_boolean (str, "annex-t", &val) || val))
> +- context->flags |= CODEC_FLAG_AC_PRED;
> ++ context->flags |= AV_CODEC_FLAG_AC_PRED;
> + else
> +- context->flags &= ~CODEC_FLAG_AC_PRED;
> ++ context->flags &= ~AV_CODEC_FLAG_AC_PRED;
> + if (!gst_structure_get_boolean (str, "annex-j", &val) || val)
> +- context->flags |= CODEC_FLAG_LOOP_FILTER;
> ++ context->flags |= AV_CODEC_FLAG_LOOP_FILTER;
> + else
> +- context->flags &= ~CODEC_FLAG_LOOP_FILTER;
> ++ context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER;
> + break;
> + }
> + case AV_CODEC_ID_ADPCM_G726:
> +diff --git a/ext/libav/gstavcodecmap.h b/ext/libav/gstavcodecmap.h
> +index 9575e77..14cdfce 100644
> +--- a/ext/libav/gstavcodecmap.h
> ++++ b/ext/libav/gstavcodecmap.h
> +@@ -155,7 +155,7 @@ gst_ffmpeg_formatid_to_caps (const gchar *format_name);
> +
> + /*
> + * _formatid_get_codecids () can be used to get the codecIDs
> +- * (CODEC_ID_NONE-terminated list) that fit that specific
> ++ * (AV_CODEC_ID_NONE-terminated list) that fit that specific
> + * output format.
> + */
> +
> +diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
> +index f9c6096..0ed4b23 100644
> +--- a/ext/libav/gstavviddec.c
> ++++ b/ext/libav/gstavviddec.c
> +@@ -237,7 +237,7 @@ gst_ffmpegviddec_class_init (GstFFMpegVidDecClass * klass)
> + DEFAULT_OUTPUT_CORRUPT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
> +
> + caps = klass->in_plugin->capabilities;
> +- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
> ++ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
> + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
> + g_param_spec_int ("max-threads", "Maximum decode threads",
> + "Maximum number of worker threads to spawn. (0 = auto)",
> +@@ -365,7 +365,7 @@ gst_ffmpegviddec_open (GstFFMpegVidDec * ffmpegdec)
> + oclass->in_plugin->name, oclass->in_plugin->id);
> +
> + gst_ffmpegviddec_context_set_flags (ffmpegdec->context,
> +- CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
> ++ AV_CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
> +
> + return TRUE;
> +
> +@@ -495,7 +495,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
> + gboolean is_live;
> +
> + if (ffmpegdec->max_threads == 0) {
> +- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
> ++ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
> + ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
> + else
> + ffmpegdec->context->thread_count = 0;
> +@@ -624,10 +624,7 @@ gst_ffmpegvideodec_prepare_dr_pool (GstFFMpegVidDec * ffmpegdec,
> + avcodec_align_dimensions2 (ffmpegdec->context, &width, &height,
> + linesize_align);
> +
> +- if (ffmpegdec->context->flags & CODEC_FLAG_EMU_EDGE)
> +- edge = 0;
> +- else
> +- edge = avcodec_get_edge_width ();
> ++ edge = 0;
> +
> + /* increase the size for the padding */
> + width += edge << 1;
> +@@ -732,7 +729,7 @@ gst_ffmpegviddec_can_direct_render (GstFFMpegVidDec * ffmpegdec)
> + return FALSE;
> +
> + oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
> +- return ((oclass->in_plugin->capabilities & CODEC_CAP_DR1) == CODEC_CAP_DR1);
> ++ return ((oclass->in_plugin->capabilities & AV_CODEC_CAP_DR1) == AV_CODEC_CAP_DR1);
> + }
> +
> + /* called when ffmpeg wants us to allocate a buffer to write the decoded frame
> +@@ -1769,7 +1766,7 @@ gst_ffmpegviddec_drain (GstVideoDecoder * decoder)
> +
> + oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
> +
> +- if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
> ++ if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
> + gint have_data, len;
> + GstFlowReturn ret;
> +
> +@@ -1815,10 +1812,10 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
> + bsize = minfo.size;
> +
> + if (bsize > 0 && (!GST_MEMORY_IS_ZERO_PADDED (minfo.memory)
> +- || (minfo.maxsize - minfo.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
> ++ || (minfo.maxsize - minfo.size) < AV_INPUT_BUFFER_PADDING_SIZE)) {
> + /* add padding */
> +- if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
> +- ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
> ++ if (ffmpegdec->padded_size < bsize + AV_INPUT_BUFFER_PADDING_SIZE) {
> ++ ffmpegdec->padded_size = bsize + AV_INPUT_BUFFER_PADDING_SIZE;
> + ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
> + GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
> + ffmpegdec->padded_size);
> +@@ -1826,7 +1823,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
> + GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
> + "Copy input to add padding");
> + memcpy (ffmpegdec->padded, bdata, bsize);
> +- memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memset (ffmpegdec->padded + bsize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
> +
> + bdata = ffmpegdec->padded;
> + do_padding = TRUE;
> +@@ -1835,7 +1832,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
> + }
> +
> + do {
> +- guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
> ++ guint8 tmp_padding[AV_INPUT_BUFFER_PADDING_SIZE];
> +
> + /* parse, if at all possible */
> + data = bdata;
> +@@ -1845,8 +1842,8 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
> + /* add temporary padding */
> + GST_CAT_TRACE_OBJECT (CAT_PERFORMANCE, ffmpegdec,
> + "Add temporary input padding");
> +- memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
> +- memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memcpy (tmp_padding, data + size, AV_INPUT_BUFFER_PADDING_SIZE);
> ++ memset (data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
> + }
> +
> + /* decode a frame of audio/video now */
> +@@ -1862,7 +1859,7 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
> + }
> +
> + if (do_padding) {
> +- memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
> ++ memcpy (data + size, tmp_padding, AV_INPUT_BUFFER_PADDING_SIZE);
> + }
> +
> + if (len == 0 && have_data == 0) {
> +@@ -2143,7 +2140,7 @@ gst_ffmpegviddec_propose_allocation (GstVideoDecoder * decoder,
> + gst_allocation_params_init (¶ms);
> + params.flags = GST_MEMORY_FLAG_ZERO_PADDED;
> + params.align = DEFAULT_STRIDE_ALIGN;
> +- params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
> ++ params.padding = AV_INPUT_BUFFER_PADDING_SIZE;
> + /* we would like to have some padding so that we don't have to
> + * memcpy. We don't suggest an allocator. */
> + gst_query_add_allocation_param (query, NULL, ¶ms);
> +diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c
> +index 36143f5..22e5cae 100644
> +--- a/ext/libav/gstavvidenc.c
> ++++ b/ext/libav/gstavvidenc.c
> +@@ -68,18 +68,19 @@ enum
> + PROP_CFG_BASE,
> + };
> +
> ++#if 0
> + #define GST_TYPE_ME_METHOD (gst_ffmpegvidenc_me_method_get_type())
> + static GType
> + gst_ffmpegvidenc_me_method_get_type (void)
> + {
> + static GType ffmpegenc_me_method_type = 0;
> + static GEnumValue ffmpegenc_me_methods[] = {
> +- {ME_ZERO, "None (Very low quality)", "zero"},
> +- {ME_FULL, "Full (Slow, unmaintained)", "full"},
> +- {ME_LOG, "Logarithmic (Low quality, unmaintained)", "logarithmic"},
> +- {ME_PHODS, "phods (Low quality, unmaintained)", "phods"},
> +- {ME_EPZS, "EPZS (Best quality, Fast)", "epzs"},
> +- {ME_X1, "X1 (Experimental)", "x1"},
> ++ {FF_CMP_ZERO, "None (Very low quality)", "zero"},
> ++ {FF_CMP_FULL, "Full (Slow, unmaintained)", "full"},
> ++ {FF_CMP_LOG, "Logarithmic (Low quality, unmaintained)", "logarithmic"},
> ++ {FF_CMP_PHODS, "phods (Low quality, unmaintained)", "phods"},
> ++ {FF_CMP_EPZS, "EPZS (Best quality, Fast)", "epzs"},
> ++ {FF_CMP_X1, "X1 (Experimental)", "x1"},
> + {0, NULL, NULL},
> + };
> + if (!ffmpegenc_me_method_type) {
> +@@ -88,6 +89,7 @@ gst_ffmpegvidenc_me_method_get_type (void)
> + }
> + return ffmpegenc_me_method_type;
> + }
> ++#endif
> +
> + /* A number of function prototypes are given so we can refer to them later. */
> + static void gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass);
> +@@ -201,10 +203,12 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass)
> + g_param_spec_int ("gop-size", "GOP Size",
> + "Number of frames within one GOP", 0, G_MAXINT,
> + DEFAULT_VIDEO_GOP_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
> ++#if 0
> + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ME_METHOD,
> + g_param_spec_enum ("me-method", "ME Method", "Motion Estimation Method",
> +- GST_TYPE_ME_METHOD, ME_EPZS,
> ++ GST_TYPE_ME_METHOD, FF_CMP_EPZS,
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
> ++#endif
> +
> + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFSIZE,
> + g_param_spec_int ("buffer-size", "Buffer Size",
> +@@ -216,7 +220,7 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass)
> + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
> +
> + caps = klass->in_plugin->capabilities;
> +- if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
> ++ if (caps & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS)) {
> + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_THREADS,
> + g_param_spec_int ("max-threads", "Maximum encode threads",
> + "Maximum number of worker threads to spawn. (0 = auto)",
> +@@ -259,7 +263,7 @@ gst_ffmpegvidenc_init (GstFFMpegVidEnc * ffmpegenc)
> + ffmpegenc->file = NULL;
> +
> + ffmpegenc->bitrate = DEFAULT_VIDEO_BITRATE;
> +- ffmpegenc->me_method = ME_EPZS;
> ++ //ffmpegenc->me_method = FF_CMP_EPZS;
> + ffmpegenc->buffer_size = 512 * 1024;
> + ffmpegenc->gop_size = DEFAULT_VIDEO_GOP_SIZE;
> + ffmpegenc->rtp_payload_size = 0;
> +@@ -321,12 +325,12 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
> + ffmpegenc->context->bit_rate = ffmpegenc->bitrate;
> + ffmpegenc->context->bit_rate_tolerance = ffmpegenc->bitrate;
> + ffmpegenc->context->gop_size = ffmpegenc->gop_size;
> +- ffmpegenc->context->me_method = ffmpegenc->me_method;
> ++ //ffmpegenc->context->me_method = ffmpegenc->me_method;
> + GST_DEBUG_OBJECT (ffmpegenc, "Setting avcontext to bitrate %d, gop_size %d",
> + ffmpegenc->bitrate, ffmpegenc->gop_size);
> +
> + if (ffmpegenc->max_threads == 0) {
> +- if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
> ++ if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
> + ffmpegenc->context->thread_count = gst_ffmpeg_auto_max_threads ();
> + else
> + ffmpegenc->context->thread_count = 0;
> +@@ -343,16 +347,16 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
> + gst_ffmpeg_cfg_fill_context (ffmpegenc, ffmpegenc->context);
> +
> + /* then handle some special cases */
> +- ffmpegenc->context->lmin = (ffmpegenc->lmin * FF_QP2LAMBDA + 0.5);
> +- ffmpegenc->context->lmax = (ffmpegenc->lmax * FF_QP2LAMBDA + 0.5);
> ++ ffmpegenc->context->qmin = (ffmpegenc->lmin * FF_QP2LAMBDA + 0.5);
> ++ ffmpegenc->context->qmax = (ffmpegenc->lmax * FF_QP2LAMBDA + 0.5);
> +
> + if (ffmpegenc->interlaced) {
> + ffmpegenc->context->flags |=
> +- CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME;
> ++ AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME;
> + }
> +
> + /* some other defaults */
> +- ffmpegenc->context->rc_strategy = 2;
> ++ //ffmpegenc->context->rc_strategy = 2;
> + ffmpegenc->context->b_frame_strategy = 0;
> + ffmpegenc->context->coder_type = 0;
> + ffmpegenc->context->context_model = 0;
> +@@ -362,18 +366,18 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
> + ffmpegenc->context->flags |= ffmpegenc->pass;
> + switch (ffmpegenc->pass) {
> + /* some additional action depends on type of pass */
> +- case CODEC_FLAG_QSCALE:
> ++ case AV_CODEC_FLAG_QSCALE:
> + ffmpegenc->context->global_quality
> + = ffmpegenc->picture->quality = FF_QP2LAMBDA * ffmpegenc->quantizer;
> + break;
> +- case CODEC_FLAG_PASS1: /* need to prepare a stats file */
> ++ case AV_CODEC_FLAG_PASS1: /* need to prepare a stats file */
> + /* we don't close when changing caps, fingers crossed */
> + if (!ffmpegenc->file)
> + ffmpegenc->file = g_fopen (ffmpegenc->filename, "w");
> + if (!ffmpegenc->file)
> + goto open_file_err;
> + break;
> +- case CODEC_FLAG_PASS2:
> ++ case AV_CODEC_FLAG_PASS2:
> + { /* need to read the whole stats file ! */
> + gsize size;
> +
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH/next 5/6] package/motion: Fix build with FFmpeg 4.0
2018-08-12 20:32 ` [Buildroot] [PATCH/next 5/6] package/motion: " Bernd Kuhls
@ 2018-08-12 21:51 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2018-08-12 21:51 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 12 Aug 2018 22:32:04 +0200, Bernd Kuhls wrote:
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
> package/motion/0001-ffmpeg40.patch | 57 ++++++++++++++++++++++++++++++
> 1 file changed, 57 insertions(+)
> create mode 100644 package/motion/0001-ffmpeg40.patch
>
> diff --git a/package/motion/0001-ffmpeg40.patch b/package/motion/0001-ffmpeg40.patch
> new file mode 100644
> index 0000000000..f3cdfa93b4
> --- /dev/null
> +++ b/package/motion/0001-ffmpeg40.patch
> @@ -0,0 +1,57 @@
> +From ff99988d57f4bcb0a7b381374f8106896bda2b15 Mon Sep 17 00:00:00 2001
> +From: James Cowgill <jcowgill@jcowgill.uk>
> +Date: Fri, 23 Feb 2018 23:04:33 +0000
> +Subject: [PATCH] Fix build errors with FFmpeg 4.0
> +
> +Downloaded from
> +https://sources.debian.org/src/motion/4.1.1-1.1/debian/patches/ffmpeg4.0.patch/
> +
> +Instead of backporting
> +https://github.com/Motion-Project/motion/commit/9b93a417e37e1f0fef58d1582a7e98e4c05d3b42
> +from upstream master branch we use the patch from Debian.
Why ? Backporting from upstream looks like the normal/natural thing to
do. So if we don't do that and chose the Debian patch, there should be
some kind of justification for it.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-08-12 21:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-12 20:32 [Buildroot] [PATCH/next 1/6] package/aubio: Fix build with FFmpeg 4.0 Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 2/6] package/freeswitch: " Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 3/6] package/gstreamer1/gst1-libav: " Bernd Kuhls
2018-08-12 20:47 ` Peter Seiderer
2018-08-12 20:32 ` [Buildroot] [PATCH/next 4/6] package/mediastreamer: " Bernd Kuhls
2018-08-12 20:32 ` [Buildroot] [PATCH/next 5/6] package/motion: " Bernd Kuhls
2018-08-12 21:51 ` Thomas Petazzoni
2018-08-12 20:32 ` [Buildroot] [PATCH/next 6/6] package/squeezelite: " Bernd Kuhls
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox