They are read-only just like the HWConfig structures they point to.
Unified · Split
| @@ -320,7 +320,7 @@ typedef struct AVCodec { · 319 unmodified lines | |||
| 320 | * | 320 | * |
| 321 | * The user can only access this field via avcodec_get_hw_config(). | 321 | * The user can only access this field via avcodec_get_hw_config(). |
| 322 | */ | 322 | */ |
| 323 | const struct AVCodecHWConfigInternal **hw_configs; | 323 | const struct AVCodecHWConfigInternal *const *hw_configs; |
| 324 | 324 | ||
| 325 | /** | 325 | /** |
| 326 | * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. | 326 | * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. |
| @@ -1100,7 +1100,7 @@ static const AVOption options[] = { · 1099 unmodified lines | |||
| 1100 | { NULL } | 1100 | { NULL } |
| 1101 | }; | 1101 | }; |
| 1102 | 1102 | ||
| 1103 | static const AVCodecHWConfigInternal *cuvid_hw_configs[] = { | 1103 | static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = { |
| 1104 | &(const AVCodecHWConfigInternal) { | 1104 | &(const AVCodecHWConfigInternal) { |
| 1105 | .public = { | 1105 | .public = { |
| 1106 | .pix_fmt = AV_PIX_FMT_CUDA, | 1106 | .pix_fmt = AV_PIX_FMT_CUDA, |
| @@ -743,7 +743,7 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = { · 742 unmodified lines | |||
| 743 | AV_PIX_FMT_NONE | 743 | AV_PIX_FMT_NONE |
| 744 | }; | 744 | }; |
| 745 | 745 | ||
| 746 | const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = { | 746 | const AVCodecHWConfigInternal *const ff_h263_hw_config_list[] = { |
| 747 | #if CONFIG_H263_VAAPI_HWACCEL | 747 | #if CONFIG_H263_VAAPI_HWACCEL |
| 748 | HWACCEL_VAAPI(h263), | 748 | HWACCEL_VAAPI(h263), |
| 749 | #endif | 749 | #endif |
| @@ -486,7 +486,7 @@ static void mediacodec_decode_flush(AVCodecContext *avctx) · 485 unmodified lines | |||
| 486 | ff_mediacodec_dec_flush(avctx, s->ctx); | 486 | ff_mediacodec_dec_flush(avctx, s->ctx); |
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = { | 489 | static const AVCodecHWConfigInternal *const mediacodec_hw_configs[] = { |
| 490 | &(const AVCodecHWConfigInternal) { | 490 | &(const AVCodecHWConfigInternal) { |
| 491 | .public = { | 491 | .public = { |
| 492 | .pix_fmt = AV_PIX_FMT_MEDIACODEC, | 492 | .pix_fmt = AV_PIX_FMT_MEDIACODEC, |
| @@ -809,7 +809,7 @@ static int ffmmal_decode(AVCodecContext *avctx, void *data, int *got_frame, · 808 unmodified lines | |||
| 809 | return ret; | 809 | return ret; |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | static const AVCodecHWConfigInternal *mmal_hw_configs[] = { | 812 | static const AVCodecHWConfigInternal *const mmal_hw_configs[] = { |
| 813 | HW_CONFIG_INTERNAL(MMAL), | 813 | HW_CONFIG_INTERNAL(MMAL), |
| 814 | NULL | 814 | NULL |
| 815 | }; | 815 | }; |
| @@ -59,7 +59,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = { · 58 unmodified lines | |||
| 59 | AV_PIX_FMT_NONE | 59 | AV_PIX_FMT_NONE |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | const AVCodecHWConfigInternal *ff_nvenc_hw_configs[] = { | 62 | const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = { |
| 63 | HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA), | 63 | HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA), |
| 64 | HW_CONFIG_ENCODER_DEVICE(NONE, CUDA), | 64 | HW_CONFIG_ENCODER_DEVICE(NONE, CUDA), |
| 65 | #if CONFIG_D3D11VA | 65 | #if CONFIG_D3D11VA |
| @@ -230,6 +230,6 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt); · 229 unmodified lines | |||
| 230 | void ff_nvenc_encode_flush(AVCodecContext *avctx); | 230 | void ff_nvenc_encode_flush(AVCodecContext *avctx); |
| 231 | 231 | ||
| 232 | extern const enum AVPixelFormat ff_nvenc_pix_fmts[]; | 232 | extern const enum AVPixelFormat ff_nvenc_pix_fmts[]; |
| 233 | extern const AVCodecHWConfigInternal *ff_nvenc_hw_configs[]; | 233 | extern const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[]; |
| 234 | 234 | ||
| 235 | #endif /* AVCODEC_NVENC_H */ | 235 | #endif /* AVCODEC_NVENC_H */ |
| @@ -43,7 +43,7 @@ · 42 unmodified lines | |||
| 43 | #include "qsv_internal.h" | 43 | #include "qsv_internal.h" |
| 44 | #include "qsvdec.h" | 44 | #include "qsvdec.h" |
| 45 | 45 | ||
| 46 | const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = { | 46 | const AVCodecHWConfigInternal *const ff_qsv_hw_configs[] = { |
| 47 | &(const AVCodecHWConfigInternal) { | 47 | &(const AVCodecHWConfigInternal) { |
| 48 | .public = { | 48 | .public = { |
| 49 | .pix_fmt = AV_PIX_FMT_QSV, | 49 | .pix_fmt = AV_PIX_FMT_QSV, |
| @@ -74,7 +74,7 @@ typedef struct QSVContext { · 73 unmodified lines | |||
| 74 | int nb_ext_buffers; | 74 | int nb_ext_buffers; |
| 75 | } QSVContext; | 75 | } QSVContext; |
| 76 | 76 | ||
| 77 | extern const AVCodecHWConfigInternal *ff_qsv_hw_configs[]; | 77 | extern const AVCodecHWConfigInternal *const ff_qsv_hw_configs[]; |
| 78 | 78 | ||
| 79 | int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q, | 79 | int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q, |
| 80 | AVFrame *frame, int *got_frame, AVPacket *pkt); | 80 | AVFrame *frame, int *got_frame, AVPacket *pkt); |
| @@ -1655,7 +1655,7 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) · 1654 unmodified lines | |||
| 1655 | return 0; | 1655 | return 0; |
| 1656 | } | 1656 | } |
| 1657 | 1657 | ||
| 1658 | const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[] = { | 1658 | const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[] = { |
| 1659 | HW_CONFIG_ENCODER_FRAMES(QSV, QSV), | 1659 | HW_CONFIG_ENCODER_FRAMES(QSV, QSV), |
| 1660 | HW_CONFIG_ENCODER_DEVICE(NV12, QSV), | 1660 | HW_CONFIG_ENCODER_DEVICE(NV12, QSV), |
| 1661 | HW_CONFIG_ENCODER_DEVICE(P010, QSV), | 1661 | HW_CONFIG_ENCODER_DEVICE(P010, QSV), |
| @@ -98,7 +98,7 @@ · 97 unmodified lines | |||
| 98 | { "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \ | 98 | { "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \ |
| 99 | { "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},\ | 99 | { "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},\ |
| 100 | 100 | ||
| 101 | extern const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[]; | 101 | extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[]; |
| 102 | 102 | ||
| 103 | typedef int SetEncodeCtrlCB (AVCodecContext *avctx, | 103 | typedef int SetEncodeCtrlCB (AVCodecContext *avctx, |
| 104 | const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); | 104 | const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); |
| @@ -548,7 +548,7 @@ static void rkmpp_flush(AVCodecContext *avctx) · 547 unmodified lines | |||
| 548 | av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret); | 548 | av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret); |
| 549 | } | 549 | } |
| 550 | 550 | ||
| 551 | static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = { | 551 | static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = { |
| 552 | HW_CONFIG_INTERNAL(DRM_PRIME), | 552 | HW_CONFIG_INTERNAL(DRM_PRIME), |
| 553 | NULL | 553 | NULL |
| 554 | }; | 554 | }; |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include "encode.h" | 28 | #include "encode.h" |
| 29 | #include "avcodec.h" | 29 | #include "avcodec.h" |
| 30 | 30 | ||
| 31 | const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = { | 31 | const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[] = { |
| 32 | HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI), | 32 | HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI), |
| 33 | NULL, | 33 | NULL, |
| 34 | }; | 34 | }; |
| @@ -49,7 +49,7 @@ enum { · 48 unmodified lines | |||
| 49 | MAX_TILE_COLS = 20, | 49 | MAX_TILE_COLS = 20, |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[]; | 52 | extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; |
| 53 | 53 | ||
| 54 | enum { | 54 | enum { |
| 55 | PICTURE_TYPE_IDR = 0, | 55 | PICTURE_TYPE_IDR = 0, |