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
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.
libavcodec/cuviddec.c+1−1
@@ -1100,7 +1100,7 @@ static const AVOption options[] = { · 1099 unmodified lines
1100 { NULL }1100 { NULL }
1101};1101};
1102 1102
1103static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {1103static 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,
libavcodec/h263dec.c+1−1
@@ -743,7 +743,7 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = { · 742 unmodified lines
743 AV_PIX_FMT_NONE743 AV_PIX_FMT_NONE
744};744};
745 745
746const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = {746const AVCodecHWConfigInternal *const ff_h263_hw_config_list[] = {
747#if CONFIG_H263_VAAPI_HWACCEL747#if CONFIG_H263_VAAPI_HWACCEL
748 HWACCEL_VAAPI(h263),748 HWACCEL_VAAPI(h263),
749#endif749#endif
libavcodec/mediacodecdec.c+1−1
@@ -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
489static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = {489static 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,
libavcodec/mmaldec.c+1−1
@@ -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
812static const AVCodecHWConfigInternal *mmal_hw_configs[] = {812static const AVCodecHWConfigInternal *const mmal_hw_configs[] = {
813 HW_CONFIG_INTERNAL(MMAL),813 HW_CONFIG_INTERNAL(MMAL),
814 NULL814 NULL
815};815};
libavcodec/nvenc.c+1−1
@@ -59,7 +59,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = { · 58 unmodified lines
59 AV_PIX_FMT_NONE59 AV_PIX_FMT_NONE
60};60};
61 61
62const AVCodecHWConfigInternal *ff_nvenc_hw_configs[] = {62const 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_D3D11VA65#if CONFIG_D3D11VA
libavcodec/nvenc.h+1−1
@@ -230,6 +230,6 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt); · 229 unmodified lines
230void ff_nvenc_encode_flush(AVCodecContext *avctx);230void ff_nvenc_encode_flush(AVCodecContext *avctx);
231 231
232extern const enum AVPixelFormat ff_nvenc_pix_fmts[];232extern const enum AVPixelFormat ff_nvenc_pix_fmts[];
233extern const AVCodecHWConfigInternal *ff_nvenc_hw_configs[];233extern const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[];
234 234
235#endif /* AVCODEC_NVENC_H */235#endif /* AVCODEC_NVENC_H */
libavcodec/qsvdec.c+1−1
@@ -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
46const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {46const 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,
libavcodec/qsvdec.h+1−1
@@ -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
77extern const AVCodecHWConfigInternal *ff_qsv_hw_configs[];77extern const AVCodecHWConfigInternal *const ff_qsv_hw_configs[];
78 78
79int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,79int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
80 AVFrame *frame, int *got_frame, AVPacket *pkt);80 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
1655 return 0;1655 return 0;
1656}1656}
1657 1657
1658const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[] = {1658const 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),
libavcodec/qsvenc.h+1−1
@@ -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
101extern const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[];101extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[];
102 102
103typedef int SetEncodeCtrlCB (AVCodecContext *avctx,103typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
104 const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);104 const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
libavcodec/rkmppdec.c+1−1
@@ -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
551static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {551static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = {
552 HW_CONFIG_INTERNAL(DRM_PRIME),552 HW_CONFIG_INTERNAL(DRM_PRIME),
553 NULL553 NULL
554};554};
libavcodec/vaapi_encode.c+1−1
@@ -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
31const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = {31const 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};
libavcodec/vaapi_encode.h+1−1
@@ -49,7 +49,7 @@ enum { · 48 unmodified lines
49 MAX_TILE_COLS = 20,49 MAX_TILE_COLS = 20,
50};50};
51 51
52extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];52extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[];
53 53
54enum {54enum {
55 PICTURE_TYPE_IDR = 0,55 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