lavc: Mark hw_config pointer arrays as const

They are read-only just like the HWConfig structures they point to.
This commit is contained in:
Mark Thompson 2020-11-08 18:51:15 +00:00
parent 8fbcc546b8
commit cd322794ee
14 changed files with 14 additions and 14 deletions

View File

@ -320,7 +320,7 @@ typedef struct AVCodec {
*
* The user can only access this field via avcodec_get_hw_config().
*/
const struct AVCodecHWConfigInternal **hw_configs;
const struct AVCodecHWConfigInternal *const *hw_configs;
/**
* List of supported codec_tags, terminated by FF_CODEC_TAGS_END.

View File

@ -1100,7 +1100,7 @@ static const AVOption options[] = {
{ NULL }
};
static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {
static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = {
&(const AVCodecHWConfigInternal) {
.public = {
.pix_fmt = AV_PIX_FMT_CUDA,

View File

@ -743,7 +743,7 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
AV_PIX_FMT_NONE
};
const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = {
const AVCodecHWConfigInternal *const ff_h263_hw_config_list[] = {
#if CONFIG_H263_VAAPI_HWACCEL
HWACCEL_VAAPI(h263),
#endif

View File

@ -486,7 +486,7 @@ static void mediacodec_decode_flush(AVCodecContext *avctx)
ff_mediacodec_dec_flush(avctx, s->ctx);
}
static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = {
static const AVCodecHWConfigInternal *const mediacodec_hw_configs[] = {
&(const AVCodecHWConfigInternal) {
.public = {
.pix_fmt = AV_PIX_FMT_MEDIACODEC,

View File

@ -809,7 +809,7 @@ static int ffmmal_decode(AVCodecContext *avctx, void *data, int *got_frame,
return ret;
}
static const AVCodecHWConfigInternal *mmal_hw_configs[] = {
static const AVCodecHWConfigInternal *const mmal_hw_configs[] = {
HW_CONFIG_INTERNAL(MMAL),
NULL
};

View File

@ -59,7 +59,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
AV_PIX_FMT_NONE
};
const AVCodecHWConfigInternal *ff_nvenc_hw_configs[] = {
const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA),
HW_CONFIG_ENCODER_DEVICE(NONE, CUDA),
#if CONFIG_D3D11VA

View File

@ -230,6 +230,6 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt);
void ff_nvenc_encode_flush(AVCodecContext *avctx);
extern const enum AVPixelFormat ff_nvenc_pix_fmts[];
extern const AVCodecHWConfigInternal *ff_nvenc_hw_configs[];
extern const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[];
#endif /* AVCODEC_NVENC_H */

View File

@ -43,7 +43,7 @@
#include "qsv_internal.h"
#include "qsvdec.h"
const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {
const AVCodecHWConfigInternal *const ff_qsv_hw_configs[] = {
&(const AVCodecHWConfigInternal) {
.public = {
.pix_fmt = AV_PIX_FMT_QSV,

View File

@ -74,7 +74,7 @@ typedef struct QSVContext {
int nb_ext_buffers;
} QSVContext;
extern const AVCodecHWConfigInternal *ff_qsv_hw_configs[];
extern const AVCodecHWConfigInternal *const ff_qsv_hw_configs[];
int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
AVFrame *frame, int *got_frame, AVPacket *pkt);

View File

@ -1655,7 +1655,7 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
return 0;
}
const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[] = {
const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[] = {
HW_CONFIG_ENCODER_FRAMES(QSV, QSV),
HW_CONFIG_ENCODER_DEVICE(NV12, QSV),
HW_CONFIG_ENCODER_DEVICE(P010, QSV),

View File

@ -98,7 +98,7 @@
{ "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \
{ "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, VE},\
extern const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[];
extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[];
typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);

View File

@ -548,7 +548,7 @@ static void rkmpp_flush(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret);
}
static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {
static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = {
HW_CONFIG_INTERNAL(DRM_PRIME),
NULL
};

View File

@ -28,7 +28,7 @@
#include "encode.h"
#include "avcodec.h"
const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = {
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[] = {
HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI),
NULL,
};

View File

@ -49,7 +49,7 @@ enum {
MAX_TILE_COLS = 20,
};
extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];
extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[];
enum {
PICTURE_TYPE_IDR = 0,