Update API usage to deal with current vs new FFmpeg API.
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/games/alephone/alephone/Makefile,v
retrieving revision 1.28
diff -u -p -u -p -r1.28 Makefile
--- Makefile 13 Dec 2018 19:53:23 -0000 1.28
+++ Makefile 17 Feb 2019 23:02:32 -0000
@@ -6,7 +6,7 @@ COMMENT = open source game engine based
DATE = 20150620
DISTNAME = AlephOne-${DATE}
PKGNAME = alephone-1.2.1
-REVISION = 5
+REVISION = 6
EXTRACT_SUFX = .tar.bz2
CATEGORIES = games x11
Index: patches/patch-Source_Files_FFmpeg_Movie_cpp
===================================================================
RCS file: patches/patch-Source_Files_FFmpeg_Movie_cpp
diff -N patches/patch-Source_Files_FFmpeg_Movie_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_Files_FFmpeg_Movie_cpp 17 Feb 2019 23:11:40 -0000
@@ -0,0 +1,58 @@
+$OpenBSD$
+
+Update for newer FFmpeg API.
+
+Index: Source_Files/FFmpeg/Movie.cpp
+--- Source_Files/FFmpeg/Movie.cpp.orig
++++ Source_Files/FFmpeg/Movie.cpp
+@@ -420,12 +420,12 @@ bool Movie::Setup()
+ video_stream->codec->width = view_rect.w;
+ video_stream->codec->height = view_rect.h;
+ video_stream->codec->time_base = (AVRational){1, TICKS_PER_SECOND};
+- video_stream->codec->pix_fmt = PIX_FMT_YUV420P;
+- video_stream->codec->flags |= CODEC_FLAG_CLOSED_GOP;
++ video_stream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
++ video_stream->codec->flags |= AV_CODEC_FLAG_CLOSED_GOP;
+ video_stream->codec->thread_count = get_cpu_count();
+
+ if (av->fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
+- video_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ video_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ av->video_stream_idx = video_stream->index;
+
+@@ -494,14 +494,14 @@ bool Movie::Setup()
+ audio_stream->codec->channels = 2;
+
+ if (av->fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
+- audio_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ audio_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ av->audio_stream_idx = audio_stream->index;
+
+ // tuning options
+ int aq = graphics_preferences->movie_export_audio_quality;
+ audio_stream->codec->global_quality = FF_QP2LAMBDA * (aq / 10);
+- audio_stream->codec->flags |= CODEC_FLAG_QSCALE;
++ audio_stream->codec->flags |= AV_CODEC_FLAG_QSCALE;
+
+ audio_stream->codec->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ success = (0 <= avcodec_open2(audio_stream->codec, audio_codec,
NULL));
+@@ -539,7 +539,7 @@ bool Movie::Setup()
+ // initialize conversion context
+ if (success)
+ {
+- av->sws_ctx = sws_getContext(temp_surface->w, temp_surface->h,
PIX_FMT_RGB32,
++ av->sws_ctx = sws_getContext(temp_surface->w, temp_surface->h,
AV_PIX_FMT_RGB32,
+ video_stream->codec->width,
+ video_stream->codec->height,
+ video_stream->codec->pix_fmt,
+@@ -670,7 +670,7 @@ void Movie::EncodeAudio(bool last)
+ if (read_samples < acodec->frame_size)
+ {
+ // shrink or pad audio frame
+- if (acodec->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME)
++ if (acodec->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)
+ acodec->frame_size = write_samples;
+ else
+ write_samples = acodec->frame_size;
Index: patches/patch-Source_Files_FFmpeg_SDL_ffmpeg_c
===================================================================
RCS file: patches/patch-Source_Files_FFmpeg_SDL_ffmpeg_c
diff -N patches/patch-Source_Files_FFmpeg_SDL_ffmpeg_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_Files_FFmpeg_SDL_ffmpeg_c 17 Feb 2019 23:11:57
-0000
@@ -0,0 +1,70 @@
+$OpenBSD$
+
+Update for newer FFmpeg API.
+
+Index: Source_Files/FFmpeg/SDL_ffmpeg.c
+--- Source_Files/FFmpeg/SDL_ffmpeg.c.orig
++++ Source_Files/FFmpeg/SDL_ffmpeg.c
+@@ -86,7 +86,7 @@ extern int convert_audio(int in_samples, int in_channe
+ * Provide a fast way to get the correct context.
+ * \returns The context matching the input values.
+ */
+-struct SwsContext* getContext( SDL_ffmpegConversionContext **context, int
inWidth, int inHeight, enum PixelFormat inFormat, int outWidth, int outHeight,
enum PixelFormat outFormat )
++struct SwsContext* getContext( SDL_ffmpegConversionContext **context, int
inWidth, int inHeight, enum AVPixelFormat inFormat, int outWidth, int
outHeight, enum AVPixelFormat outFormat )
+ {
+ SDL_ffmpegConversionContext *ctx = *context;
+
+@@ -621,7 +621,7 @@ int SDL_ffmpegAddVideoFrame( SDL_ffmpegFile *file, SDL
+ {
+ case 24:
+ sws_scale( getContext( &file->videoStream->conversionContext,
+- frame->w, frame->h, PIX_FMT_RGB24,
++ frame->w, frame->h, AV_PIX_FMT_RGB24,
+ file->videoStream->_ffmpeg->codec->width,
+ file->videoStream->_ffmpeg->codec->height,
+ file->videoStream->_ffmpeg->codec->pix_fmt
),
+@@ -634,7 +634,7 @@ int SDL_ffmpegAddVideoFrame( SDL_ffmpegFile *file, SDL
+ break;
+ case 32:
+ sws_scale( getContext( &file->videoStream->conversionContext,
+- frame->w, frame->h, PIX_FMT_BGR32,
++ frame->w, frame->h, AV_PIX_FMT_BGR32,
+ file->videoStream->_ffmpeg->codec->width,
+ file->videoStream->_ffmpeg->codec->height,
+ file->videoStream->_ffmpeg->codec->pix_fmt
),
+@@ -1605,7 +1605,7 @@ SDL_ffmpegStream* SDL_ffmpegAddVideoStream( SDL_ffmpeg
+ stream->codec->gop_size = 12;
+
+ /* set pixel format */
+- stream->codec->pix_fmt = PIX_FMT_YUV420P;
++ stream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
+
+ /* set mpeg2 codec parameters */
+ if ( stream->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO )
+@@ -2223,7 +2223,7 @@ int SDL_ffmpegDecodeVideoFrame( SDL_ffmpegFile* file,
+ file->videoStream->_ffmpeg->codec->height,
+ file->videoStream->_ffmpeg->codec->pix_fmt,
+ frame->overlay->w, frame->overlay->h,
+- PIX_FMT_YUYV422 ),
++ AV_PIX_FMT_YUYV422 ),
+ ( const uint8_t* const*
)file->videoStream->decodeFrame->data,
+ file->videoStream->decodeFrame->linesize,
+ 0,
+@@ -2245,7 +2245,7 @@ int SDL_ffmpegDecodeVideoFrame( SDL_ffmpegFile* file,
+
file->videoStream->_ffmpeg->codec->height,
+
file->videoStream->_ffmpeg->codec->pix_fmt,
+ frame->surface->w,
frame->surface->h,
+- PIX_FMT_RGB32 ),
++ AV_PIX_FMT_RGB32 ),
+ ( const uint8_t* const*
)file->videoStream->decodeFrame->data,
+ file->videoStream->decodeFrame->linesize,
+ 0,
+@@ -2259,7 +2259,7 @@ int SDL_ffmpegDecodeVideoFrame( SDL_ffmpegFile* file,
+
file->videoStream->_ffmpeg->codec->height,
+
file->videoStream->_ffmpeg->codec->pix_fmt,
+ frame->surface->w,
frame->surface->h,
+- PIX_FMT_RGB24 ),
++ AV_PIX_FMT_RGB24 ),
+ ( const uint8_t* const*
)file->videoStream->decodeFrame->data,
+ file->videoStream->decodeFrame->linesize,
+ 0,