History

lavc: Mark hw_config pointer arrays as const

They are read-only just like the HWConfig structures they point to.

Mark Thompson committed 6 years ago

Commit cd322791 parent 8fbcc5414 files · +14 −14Browse files

Unified · Split

14 files
  1. libavcodec/codec.h +1 −1
  2. libavcodec/cuviddec.c +1 −1
  3. libavcodec/h263dec.c +1 −1
  4. libavcodec/mediacodecdec.c +1 −1
  5. libavcodec/mmaldec.c +1 −1
  6. libavcodec/nvenc.c +1 −1
  7. libavcodec/nvenc.h +1 −1
  8. libavcodec/qsvdec.c +1 −1
  9. libavcodec/qsvdec.h +1 −1
  10. libavcodec/qsvenc.c +1 −1
  11. libavcodec/qsvenc.h +1 −1
  12. libavcodec/rkmppdec.c +1 −1
  13. libavcodec/vaapi_encode.c +1 −1
  14. libavcodec/vaapi_encode.h +1 −1
libavcodec/codec.h+1−1
@@ -320,7 +320,7 @@ typedef struct AVCodec { · 319 unmodified lines
320320 *
321321 * The user can only access this field via avcodec_get_hw_config().
322322 */
323− const struct AVCodecHWConfigInternal **hw_configs;
323+ const struct AVCodecHWConfigInternal *const *hw_configs;
324324
325325 /**
326326 * List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
libavcodec/cuviddec.c+1−1
@@ -1100,7 +1100,7 @@ static const AVOption options[] = { · 1099 unmodified lines
11001100 { NULL }
11011101 };
11021102
1103−static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {
1103+static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = {
11041104 &(const AVCodecHWConfigInternal) {
11051105 .public = {
11061106 .pix_fmt = AV_PIX_FMT_CUDA,
libavcodec/h263dec.c+1−1
@@ -743,7 +743,7 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = { · 742 unmodified lines
743743 AV_PIX_FMT_NONE
744744 };
745745
746−const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = {
746+const AVCodecHWConfigInternal *const ff_h263_hw_config_list[] = {
747747 #if CONFIG_H263_VAAPI_HWACCEL
748748 HWACCEL_VAAPI(h263),
749749 #endif
libavcodec/mediacodecdec.c+1−1
@@ -486,7 +486,7 @@ static void mediacodec_decode_flush(AVCodecContext *avctx) · 485 unmodified lines
486486 ff_mediacodec_dec_flush(avctx, s->ctx);
487487 }
488488
489−static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = {
489+static const AVCodecHWConfigInternal *const mediacodec_hw_configs[] = {
490490 &(const AVCodecHWConfigInternal) {
491491 .public = {
492492 .pix_fmt = AV_PIX_FMT_MEDIACODEC,
libavcodec/mmaldec.c+1−1
@@ -809,7 +809,7 @@ static int ffmmal_decode(AVCodecContext *avctx, void *data, int *got_frame, · 808 unmodified lines
809809 return ret;
810810 }
811811
812−static const AVCodecHWConfigInternal *mmal_hw_configs[] = {
812+static const AVCodecHWConfigInternal *const mmal_hw_configs[] = {
813813 HW_CONFIG_INTERNAL(MMAL),
814814 NULL
815815 };
libavcodec/nvenc.c+1−1
@@ -59,7 +59,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = { · 58 unmodified lines
5959 AV_PIX_FMT_NONE
6060 };
6161
62−const AVCodecHWConfigInternal *ff_nvenc_hw_configs[] = {
62+const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
6363 HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA),
6464 HW_CONFIG_ENCODER_DEVICE(NONE, CUDA),
6565 #if CONFIG_D3D11VA
libavcodec/nvenc.h+1−1
@@ -230,6 +230,6 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt); · 229 unmodified lines
230230 void ff_nvenc_encode_flush(AVCodecContext *avctx);
231231
232232 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[];
234234
235235 #endif /* AVCODEC_NVENC_H */
libavcodec/qsvdec.c+1−1
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 #include "qsv_internal.h"
4444 #include "qsvdec.h"
4545
46−const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {
46+const AVCodecHWConfigInternal *const ff_qsv_hw_configs[] = {
4747 &(const AVCodecHWConfigInternal) {
4848 .public = {
4949 .pix_fmt = AV_PIX_FMT_QSV,
libavcodec/qsvdec.h+1−1
@@ -74,7 +74,7 @@ typedef struct QSVContext { · 73 unmodified lines
7474 int nb_ext_buffers;
7575 } QSVContext;
7676
77−extern const AVCodecHWConfigInternal *ff_qsv_hw_configs[];
77+extern const AVCodecHWConfigInternal *const ff_qsv_hw_configs[];
7878
7979 int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
8080 AVFrame *frame, int *got_frame, AVPacket *pkt);
libavcodec/qsvenc.c+1−1
@@ -1655,7 +1655,7 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) · 1654 unmodified lines
16551655 return 0;
16561656 }
16571657
1658−const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[] = {
1658+const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[] = {
16591659 HW_CONFIG_ENCODER_FRAMES(QSV, QSV),
16601660 HW_CONFIG_ENCODER_DEVICE(NV12, QSV),
16611661 HW_CONFIG_ENCODER_DEVICE(P010, QSV),
libavcodec/qsvenc.h+1−1
@@ -98,7 +98,7 @@ · 97 unmodified lines
9898 { "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \
9999 { "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},\
100100
101−extern const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[];
101+extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[];
102102
103103 typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
104104 const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
libavcodec/rkmppdec.c+1−1
@@ -548,7 +548,7 @@ static void rkmpp_flush(AVCodecContext *avctx) · 547 unmodified lines
548548 av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret);
549549 }
550550
551−static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {
551+static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = {
552552 HW_CONFIG_INTERNAL(DRM_PRIME),
553553 NULL
554554 };
libavcodec/vaapi_encode.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include "encode.h"
2929 #include "avcodec.h"
3030
31−const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = {
31+const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[] = {
3232 HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI),
3333 NULL,
3434 };
libavcodec/vaapi_encode.h+1−1
@@ -49,7 +49,7 @@ enum { · 48 unmodified lines
4949 MAX_TILE_COLS = 20,
5050 };
5151
52−extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];
52+extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[];
5353
5454 enum {
5555 PICTURE_TYPE_IDR = 0,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t