PKGBUILDs/community/guvcview/ffmpeg5.patch
2022-02-17 19:39:04 +00:00

113 lines
4.2 KiB
Diff

diff --git a/gview_encoder/audio_codecs.c b/gview_encoder/audio_codecs.c
index 9050ac9..12f5850 100644
--- a/gview_encoder/audio_codecs.c
+++ b/gview_encoder/audio_codecs.c
@@ -409,7 +409,7 @@ int encoder_set_valid_audio_codec_list ()
int num_codecs = 0;
for ( ind = 0; ind < encoder_get_audio_codec_list_size(); ++ind)
{
- AVCodec *codec = avcodec_find_encoder(listSupCodecs[ind].codec_id);
+ const AVCodec *codec = avcodec_find_encoder(listSupCodecs[ind].codec_id);
if (!codec)
{
printf("ENCODER: no audio codec detected for %s\n", listSupCodecs[ind].description);
diff --git a/gview_encoder/encoder.c b/gview_encoder/encoder.c
index 8179bf0..fa10a89 100644
--- a/gview_encoder/encoder.c
+++ b/gview_encoder/encoder.c
@@ -223,7 +223,7 @@ void __attribute__ ((destructor)) gviewencoder_fini()
*
* returns: 1 - sample format is supported; 0 - is not supported
*/
-static int encoder_check_audio_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt)
+static int encoder_check_audio_sample_fmt(const AVCodec *codec, enum AVSampleFormat sample_fmt)
{
const enum AVSampleFormat *p = codec->sample_fmts;
@@ -446,10 +446,6 @@ static encoder_video_context_t *encoder_video_init(encoder_context_t *encoder_ct
video_codec_data->codec_context = avcodec_alloc_context3(video_codec_data->codec);
- avcodec_get_context_defaults3 (
- video_codec_data->codec_context,
- video_codec_data->codec);
-
if(video_codec_data->codec_context == NULL)
{
fprintf(stderr, "ENCODER: FATAL memory allocation failure (encoder_video_init): %s\n", strerror(errno));
@@ -712,7 +708,6 @@ static encoder_audio_context_t *encoder_audio_init(encoder_context_t *encoder_ct
}
audio_codec_data->codec_context = avcodec_alloc_context3(audio_codec_data->codec);
- avcodec_get_context_defaults3 (audio_codec_data->codec_context, audio_codec_data->codec);
if(audio_codec_data->codec_context == NULL)
{
diff --git a/gview_encoder/encoder.h b/gview_encoder/encoder.h
index 11c9522..a5697c1 100644
--- a/gview_encoder/encoder.h
+++ b/gview_encoder/encoder.h
@@ -130,7 +130,7 @@
*/
typedef struct _encoder_codec_data_t
{
- AVCodec *codec;
+ const AVCodec *codec;
AVDictionary *private_options;
AVCodecContext *codec_context;
AVFrame *frame;
diff --git a/gview_encoder/video_codecs.c b/gview_encoder/video_codecs.c
index ae86c3f..30e757b 100644
--- a/gview_encoder/video_codecs.c
+++ b/gview_encoder/video_codecs.c
@@ -974,7 +974,7 @@ int encoder_set_valid_video_codec_list ()
int num_codecs = 1; /*raw codec (no encoding) is always valid*/
for ( ind = 1; ind < encoder_get_video_codec_list_size(); ++ind)
{
- AVCodec *codec = avcodec_find_encoder(listSupCodecs[ind].codec_id);
+ const AVCodec *codec = avcodec_find_encoder(listSupCodecs[ind].codec_id);
if (!codec)
{
printf("ENCODER: no video codec detected for %s\n", listSupCodecs[ind].description);
diff --git a/gview_v4l2core/jpeg_decoder.c b/gview_v4l2core/jpeg_decoder.c
index 8e9cf6b..82ff633 100644
--- a/gview_v4l2core/jpeg_decoder.c
+++ b/gview_v4l2core/jpeg_decoder.c
@@ -1350,7 +1350,7 @@ void jpeg_close_decoder()
typedef struct _codec_data_t
{
- AVCodec *codec;
+ const AVCodec *codec;
AVCodecContext *context;
AVFrame *picture;
} codec_data_t;
@@ -1409,7 +1409,6 @@ int jpeg_init_decoder(int width, int height)
#if LIBAVCODEC_VER_AT_LEAST(53,6)
codec_data->context = avcodec_alloc_context3(codec_data->codec);
- avcodec_get_context_defaults3 (codec_data->context, codec_data->codec);
#else
codec_data->context = avcodec_alloc_context();
avcodec_get_context_defaults(codec_data->context);
diff --git a/gview_v4l2core/uvc_h264.c b/gview_v4l2core/uvc_h264.c
index f526b1e..e3ff5f1 100644
--- a/gview_v4l2core/uvc_h264.c
+++ b/gview_v4l2core/uvc_h264.c
@@ -47,7 +47,7 @@ extern int verbosity;
typedef struct _h264_decoder_context_t
{
- AVCodec *codec;
+ const AVCodec *codec;
AVCodecContext *context;
AVFrame *picture;
@@ -1004,7 +1004,6 @@ int h264_init_decoder(int width, int height)
#if LIBAVCODEC_VER_AT_LEAST(53,6)
h264_ctx->context = avcodec_alloc_context3(h264_ctx->codec);
- avcodec_get_context_defaults3 (h264_ctx->context, h264_ctx->codec);
#else
h264_ctx->context = avcodec_alloc_context();
avcodec_get_context_defaults(h264_ctx->context);