build with ffmpeg version > 59.0.100

This commit is contained in:
Jacek Jendrzej
2021-08-28 15:16:33 +02:00
parent 10274e4606
commit 4eb8165387
6 changed files with 30 additions and 5 deletions

View File

@@ -242,7 +242,11 @@ void write_frame(AVFrame *in_frame, int fd)
return;
static const unsigned char pes_header[] = {0x0, 0x0, 0x1, 0xe0, 0x00, 0x00, 0x80, 0x80, 0x5, 0x21, 0x0, 0x1, 0x0, 0x1};
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100)
AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
#else
const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
#endif
if (codec)
{
AVCodecContext *codec_context = avcodec_alloc_context3(codec);
@@ -354,7 +358,11 @@ int decode_frame(AVCodecContext *codecContext, AVPacket &packet, int fd)
AVCodecContext *open_codec(AVMediaType mediaType, AVFormatContext *formatContext)
{
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100)
AVCodec *codec = NULL;
#else
const AVCodec *codec = NULL;
#endif
AVCodecContext *codecContext = NULL;
int stream_index;
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57,25,101)
@@ -1475,4 +1483,4 @@ int cVideo::GetAudioDestination()
void cVideo::SetAudioDestination(int audio_dest)
{
hdmi_cec::getInstance()->SetAudioDestination(audio_dest);
}
}