Skip to content

Commit

Permalink
GUACAMOLE-1714: Merge backport of const parameters of ffmpeg 5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuehlner authored Mar 11, 2024
2 parents 3ca3e9e + 5a3bded commit 26cf71f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/guacenc/ffmpeg-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int guacenc_avcodec_encode_video(guacenc_video* video, AVFrame* frame) {
#endif
}

AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, const AVCodec* codec,
int bitrate, int width, int height, int gop_size, int qmax, int qmin,
int pix_fmt, AVRational time_base) {

Expand Down Expand Up @@ -250,7 +250,7 @@ AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
}

int guacenc_open_avcodec(AVCodecContext *avcodec_context,
AVCodec *codec, AVDictionary **options,
const AVCodec *codec, AVDictionary **options,
AVStream* stream) {

int ret = avcodec_open2(avcodec_context, codec, options);
Expand Down
4 changes: 2 additions & 2 deletions src/guacenc/ffmpeg-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int guacenc_avcodec_encode_video(guacenc_video* video, AVFrame* frame);
* The pointer to the configured AVCodecContext.
*
*/
AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, const AVCodec* codec,
int bitrate, int width, int height, int gop_size, int qmax, int qmin,
int pix_fmt, AVRational time_base);

Expand Down Expand Up @@ -158,7 +158,7 @@ AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
* Zero on success, a negative value on error.
*/
int guacenc_open_avcodec(AVCodecContext *avcodec_context,
AVCodec *codec, AVDictionary **options,
const AVCodec *codec, AVDictionary **options,
AVStream* stream);

#endif
Expand Down
4 changes: 2 additions & 2 deletions src/guacenc/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
guacenc_video* guacenc_video_alloc(const char* path, const char* codec_name,
int width, int height, int bitrate) {

AVOutputFormat *container_format;
const AVOutputFormat *container_format;
AVFormatContext *container_format_context;
AVStream *video_stream;
int ret;
Expand All @@ -64,7 +64,7 @@ guacenc_video* guacenc_video_alloc(const char* path, const char* codec_name,
container_format = container_format_context->oformat;

/* Pull codec based on name */
AVCodec* codec = avcodec_find_encoder_by_name(codec_name);
const AVCodec* codec = avcodec_find_encoder_by_name(codec_name);
if (codec == NULL) {
guacenc_log(GUAC_LOG_ERROR, "Failed to locate codec \"%s\".",
codec_name);
Expand Down

0 comments on commit 26cf71f

Please sign in to comment.