Control: tags -1 patch

Hi,

On Wed, 24 Jan 2018 22:26:50 +0000 jcowg...@debian.org wrote:
> Source: guvcview
> Version: 2.0.5+debian-1
> Severity: important
> User: debian-multime...@lists.debian.org
> Usertags: ffmpeg-3.5-transition
> 
> Hi,
> 
> Your package FTBFS with the upcoming version 3.5 of FFmpeg.

The attached patch should work.

The #ifdefs are not strictly required to build with 3.4 in unstable or
with 4.0, but might be useful if the patch is submitted upstream.

Setting the motion estimation method (me_method) is now done using a
private encoder specific option (av_opt_set*), however I think the
me_methods which were previously set were all either ignored or were the
default settings so I think removing them is OK (unless I've missed
something).

James
Description: Fix FTBFS with FFmpeg 4.0
Author: James Cowgill <jcowg...@debian.org>
Bug-Debian: https://bugs.debian.org/888329
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/gview_v4l2core/uvc_h264.c
+++ b/gview_v4l2core/uvc_h264.c
@@ -61,6 +61,9 @@
 #if !LIBAVCODEC_VER_AT_LEAST(54,25)
 	#define AV_CODEC_ID_H264 CODEC_ID_H264
 #endif
+#ifndef AV_CODEC_FLAG2_FAST
+    #define AV_CODEC_FLAG2_FAST CODEC_FLAG2_FAST
+#endif
 
 #include "uvc_h264.h"
 #include "v4l2_formats.h"
@@ -1039,7 +1042,7 @@ int h264_init_decoder(int width, int hei
 		exit(-1);
 	}
 	
-	h264_ctx->context->flags2 |= CODEC_FLAG2_FAST;
+	h264_ctx->context->flags2 |= AV_CODEC_FLAG2_FAST;
 	h264_ctx->context->pix_fmt = AV_PIX_FMT_YUV420P;
 	h264_ctx->context->width = width;
 	h264_ctx->context->height = height;
--- a/gview_encoder/video_codecs.c
+++ b/gview_encoder/video_codecs.c
@@ -42,6 +42,10 @@ extern int verbosity;
 #define CODEC_FLAG2_INTRA_REFRESH 0
 #endif
 
+#ifndef AV_CODEC_FLAG_4MV
+#define AV_CODEC_FLAG_4MV CODEC_FLAG_4MV
+#endif
+
 
 static bmp_info_header_t mkv_codecPriv =
 {
@@ -97,7 +101,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "none",
 		.mb_decision  = 0,
 		.trellis      = 0,
-		.me_method    = 0,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 0,
@@ -133,7 +136,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "mjpeg",
 		.mb_decision  = 0,
 		.trellis      = 0,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 0,
@@ -169,7 +171,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "mpeg1video",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 1,
@@ -205,11 +206,10 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "flv",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 1,
-		.flags        = CODEC_FLAG_4MV
+		.flags        = AV_CODEC_FLAG_4MV
 	},
 	{
 		.valid        = 1,
@@ -241,7 +241,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "wmv1",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 1,
@@ -277,7 +276,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "mpeg2video",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 1,
@@ -313,7 +311,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "msmpeg4v3",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 0,
 		.max_b_frames = 0,
 		.num_threads  = 1,
@@ -349,7 +346,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "mpeg4",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 1,
-		.me_method    = ME_EPZS,
 		.mpeg_quant   = 1,
 		.max_b_frames = 0,
 		.num_threads  = 1,
@@ -385,7 +381,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "libx264",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 0,
-		.me_method    = X264_ME_HEX,
 		.mpeg_quant   = 1,
 		.max_b_frames = 16,
 		.num_threads  = 4,
@@ -426,7 +421,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "libx265",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 0,
-		.me_method    = ME_HEX,
 		.mpeg_quant   = 1,
 		.max_b_frames = 16,
 		.num_threads  = 4,
@@ -463,7 +457,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "libvpx_vp8",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 0,
-		.me_method    = ME_HEX,
 		.mpeg_quant   = 1,
 		.max_b_frames = 0,
 		.num_threads  = 4,
@@ -500,7 +493,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "libvpx_vp9",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 0,
-		.me_method    = ME_HEX,
 		.mpeg_quant   = 1,
 		.max_b_frames = 16,
 		.num_threads  = 4,
@@ -537,7 +529,6 @@ static video_codec_t listSupCodecs[] =
 		.codec_name   = "libtheora",
 		.mb_decision  = FF_MB_DECISION_RD,
 		.trellis      = 0,
-		.me_method    = ME_HEX,
 		.mpeg_quant   = 1,
 		.max_b_frames = 0,
 		.num_threads  = 4,

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to