They are read-only just like the HWConfig structures they point to.tags/n4.4
| @@ -320,7 +320,7 @@ typedef struct AVCodec { | |||||
| * | * | ||||
| * The user can only access this field via avcodec_get_hw_config(). | * 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. | * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. | ||||
| @@ -1100,7 +1100,7 @@ static const AVOption options[] = { | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| static const AVCodecHWConfigInternal *cuvid_hw_configs[] = { | |||||
| static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = { | |||||
| &(const AVCodecHWConfigInternal) { | &(const AVCodecHWConfigInternal) { | ||||
| .public = { | .public = { | ||||
| .pix_fmt = AV_PIX_FMT_CUDA, | .pix_fmt = AV_PIX_FMT_CUDA, | ||||
| @@ -743,7 +743,7 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = { | |||||
| AV_PIX_FMT_NONE | AV_PIX_FMT_NONE | ||||
| }; | }; | ||||
| const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = { | |||||
| const AVCodecHWConfigInternal *const ff_h263_hw_config_list[] = { | |||||
| #if CONFIG_H263_VAAPI_HWACCEL | #if CONFIG_H263_VAAPI_HWACCEL | ||||
| HWACCEL_VAAPI(h263), | HWACCEL_VAAPI(h263), | ||||
| #endif | #endif | ||||
| @@ -486,7 +486,7 @@ static void mediacodec_decode_flush(AVCodecContext *avctx) | |||||
| ff_mediacodec_dec_flush(avctx, s->ctx); | ff_mediacodec_dec_flush(avctx, s->ctx); | ||||
| } | } | ||||
| static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = { | |||||
| static const AVCodecHWConfigInternal *const mediacodec_hw_configs[] = { | |||||
| &(const AVCodecHWConfigInternal) { | &(const AVCodecHWConfigInternal) { | ||||
| .public = { | .public = { | ||||
| .pix_fmt = AV_PIX_FMT_MEDIACODEC, | .pix_fmt = AV_PIX_FMT_MEDIACODEC, | ||||
| @@ -809,7 +809,7 @@ static int ffmmal_decode(AVCodecContext *avctx, void *data, int *got_frame, | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| static const AVCodecHWConfigInternal *mmal_hw_configs[] = { | |||||
| static const AVCodecHWConfigInternal *const mmal_hw_configs[] = { | |||||
| HW_CONFIG_INTERNAL(MMAL), | HW_CONFIG_INTERNAL(MMAL), | ||||
| NULL | NULL | ||||
| }; | }; | ||||
| @@ -59,7 +59,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = { | |||||
| AV_PIX_FMT_NONE | 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_FRAMES(CUDA, CUDA), | ||||
| HW_CONFIG_ENCODER_DEVICE(NONE, CUDA), | HW_CONFIG_ENCODER_DEVICE(NONE, CUDA), | ||||
| #if CONFIG_D3D11VA | #if CONFIG_D3D11VA | ||||
| @@ -230,6 +230,6 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt); | |||||
| void ff_nvenc_encode_flush(AVCodecContext *avctx); | void ff_nvenc_encode_flush(AVCodecContext *avctx); | ||||
| extern const enum AVPixelFormat ff_nvenc_pix_fmts[]; | 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 */ | #endif /* AVCODEC_NVENC_H */ | ||||
| @@ -43,7 +43,7 @@ | |||||
| #include "qsv_internal.h" | #include "qsv_internal.h" | ||||
| #include "qsvdec.h" | #include "qsvdec.h" | ||||
| const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = { | |||||
| const AVCodecHWConfigInternal *const ff_qsv_hw_configs[] = { | |||||
| &(const AVCodecHWConfigInternal) { | &(const AVCodecHWConfigInternal) { | ||||
| .public = { | .public = { | ||||
| .pix_fmt = AV_PIX_FMT_QSV, | .pix_fmt = AV_PIX_FMT_QSV, | ||||
| @@ -74,7 +74,7 @@ typedef struct QSVContext { | |||||
| int nb_ext_buffers; | int nb_ext_buffers; | ||||
| } QSVContext; | } 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, | int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q, | ||||
| AVFrame *frame, int *got_frame, AVPacket *pkt); | AVFrame *frame, int *got_frame, AVPacket *pkt); | ||||
| @@ -1655,7 +1655,7 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) | |||||
| return 0; | 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_FRAMES(QSV, QSV), | ||||
| HW_CONFIG_ENCODER_DEVICE(NV12, QSV), | HW_CONFIG_ENCODER_DEVICE(NV12, QSV), | ||||
| HW_CONFIG_ENCODER_DEVICE(P010, QSV), | HW_CONFIG_ENCODER_DEVICE(P010, QSV), | ||||
| @@ -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 }, \ | { "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},\ | { "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, | typedef int SetEncodeCtrlCB (AVCodecContext *avctx, | ||||
| const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); | const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); | ||||
| @@ -548,7 +548,7 @@ static void rkmpp_flush(AVCodecContext *avctx) | |||||
| av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret); | 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), | HW_CONFIG_INTERNAL(DRM_PRIME), | ||||
| NULL | NULL | ||||
| }; | }; | ||||
| @@ -28,7 +28,7 @@ | |||||
| #include "encode.h" | #include "encode.h" | ||||
| #include "avcodec.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), | HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI), | ||||
| NULL, | NULL, | ||||
| }; | }; | ||||
| @@ -49,7 +49,7 @@ enum { | |||||
| MAX_TILE_COLS = 20, | MAX_TILE_COLS = 20, | ||||
| }; | }; | ||||
| extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[]; | |||||
| extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; | |||||
| enum { | enum { | ||||
| PICTURE_TYPE_IDR = 0, | PICTURE_TYPE_IDR = 0, | ||||