recording: fix ffmpeg5 compat

Include avcodec.h and change AVCodec* and AVOutputFormat* to const.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Zach Bacon 2022-03-18 14:56:57 -04:00 committed by Rafael Kitover
parent 9a325f086e
commit 1e0eea3c08
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ extern "C" {
#define UINT64_C(c) (c ## ULL)
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avassert.h>
#include <libavutil/channel_layout.h>
@ -90,7 +91,7 @@ class MediaRecorder
bool isRecording;
int sampleRate;
AVFormatContext *oc;
AVOutputFormat *fmt;
const AVOutputFormat *fmt;
// pic info
AVPixelFormat pixfmt;
int pixsize, linesize;
@ -98,7 +99,7 @@ class MediaRecorder
struct SwsContext *sws;
// stream info
AVStream *st;
AVCodec *vcodec;
const AVCodec *vcodec;
AVCodecContext *enc;
int64_t npts; // for video frame pts
AVFrame *frameIn;
@ -106,7 +107,7 @@ class MediaRecorder
// audio
bool audioOnlyRecording;
struct SwrContext *swr;
AVCodec *acodec;
const AVCodec *acodec;
AVStream *ast;
AVCodecContext *aenc;
int samplesCount; // for audio frame pts generation