diff --git a/app/src/decoder.c b/app/src/decoder.c index b206ebe0..8fa218f4 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -39,7 +39,7 @@ decoder_init(struct decoder *decoder, struct video_buffer *vb) { } bool -decoder_open(struct decoder *decoder, AVCodec *codec) { +decoder_open(struct decoder *decoder, const AVCodec *codec) { decoder->codec_ctx = avcodec_alloc_context3(codec); if (!decoder->codec_ctx) { LOGC("Could not allocate decoder context"); @@ -62,7 +62,7 @@ decoder_close(struct decoder *decoder) { } bool -decoder_push(struct decoder *decoder, AVPacket *packet) { +decoder_push(struct decoder *decoder, const AVPacket *packet) { // the new decoding/encoding API has been introduced by: // #ifdef SCRCPY_LAVF_HAS_NEW_ENCODING_DECODING_API diff --git a/app/src/decoder.h b/app/src/decoder.h index c6349281..76fee80e 100644 --- a/app/src/decoder.h +++ b/app/src/decoder.h @@ -15,13 +15,13 @@ void decoder_init(struct decoder *decoder, struct video_buffer *vb); bool -decoder_open(struct decoder *decoder, AVCodec *codec); +decoder_open(struct decoder *decoder, const AVCodec *codec); void decoder_close(struct decoder *decoder); bool -decoder_push(struct decoder *decoder, AVPacket *packet); +decoder_push(struct decoder *decoder, const AVPacket *packet); void decoder_interrupt(struct decoder *decoder); diff --git a/app/src/recorder.c b/app/src/recorder.c index 2f33702d..321a17ee 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -59,7 +59,7 @@ recorder_get_format_name(enum recorder_format format) { } bool -recorder_open(struct recorder *recorder, AVCodec *input_codec) { +recorder_open(struct recorder *recorder, const AVCodec *input_codec) { const char *format_name = recorder_get_format_name(recorder->format); SDL_assert(format_name); const AVOutputFormat *format = find_muxer(format_name); @@ -128,7 +128,7 @@ recorder_close(struct recorder *recorder) { } static bool -recorder_write_header(struct recorder *recorder, AVPacket *packet) { +recorder_write_header(struct recorder *recorder, const AVPacket *packet) { AVStream *ostream = recorder->ctx->streams[0]; uint8_t *extradata = av_malloc(packet->size * sizeof(uint8_t)); diff --git a/app/src/recorder.h b/app/src/recorder.h index c126b29b..26c4a3c3 100644 --- a/app/src/recorder.h +++ b/app/src/recorder.h @@ -27,7 +27,7 @@ void recorder_destroy(struct recorder *recorder); bool -recorder_open(struct recorder *recorder, AVCodec *input_codec); +recorder_open(struct recorder *recorder, const AVCodec *input_codec); void recorder_close(struct recorder *recorder);