Fix build with ffmpeg 5.0

Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
This commit is contained in:
Bernhard Rosenkränzer 2022-01-16 01:45:36 +01:00
parent 25a4135935
commit 77876dc411
6 changed files with 9 additions and 6 deletions

View file

@ -16,7 +16,7 @@ struct decoder {
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
unsigned sink_count;
AVCodecContext *codec_ctx;
struct AVCodecContext *codec_ctx;
AVFrame *frame;
};

View file

@ -91,7 +91,7 @@ decode_image(const char *path) {
goto close_input;
}
AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);
struct AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);
if (!codec_ctx) {
LOG_OOM();
goto close_input;

View file

@ -2,6 +2,7 @@
#include <assert.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/time.h>
#include <unistd.h>
@ -192,7 +193,7 @@ static int
run_stream(void *data) {
struct stream *stream = data;
AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264);
const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264);
if (!codec) {
LOGE("H.264 decoder not found");
goto end;

View file

@ -20,8 +20,8 @@ struct stream {
struct sc_packet_sink *sinks[STREAM_MAX_SINKS];
unsigned sink_count;
AVCodecContext *codec_ctx;
AVCodecParserContext *parser;
struct AVCodecContext *codec_ctx;
struct AVCodecParserContext *parser;
// successive packets may need to be concatenated, until a non-config
// packet is available
AVPacket *pending;

View file

@ -5,6 +5,8 @@
#include "util/log.h"
#include "util/str.h"
#include <libavcodec/avcodec.h>
/** Downcast frame_sink to sc_v4l2_sink */
#define DOWNCAST(SINK) container_of(SINK, struct sc_v4l2_sink, frame_sink)

View file

@ -15,7 +15,7 @@ struct sc_v4l2_sink {
struct sc_video_buffer vb;
AVFormatContext *format_ctx;
AVCodecContext *encoder_ctx;
struct AVCodecContext *encoder_ctx;
char *device_name;
struct sc_size frame_size;