1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Mark some pointers as const

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-12-27 17:36:59 +01:00
parent 15baa0c1ac
commit 2c6f532e0a
26 changed files with 77 additions and 77 deletions

View File

@ -51,49 +51,49 @@
#define SPECIFIER_OPT_FMT_f "%f"
#define SPECIFIER_OPT_FMT_dbl "%lf"
static const char *opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL};
static const char *opt_name_audio_channels[] = {"ac", NULL};
static const char *opt_name_audio_sample_rate[] = {"ar", NULL};
static const char *opt_name_frame_rates[] = {"r", NULL};
static const char *opt_name_frame_sizes[] = {"s", NULL};
static const char *opt_name_frame_pix_fmts[] = {"pix_fmt", NULL};
static const char *opt_name_ts_scale[] = {"itsscale", NULL};
static const char *opt_name_hwaccels[] = {"hwaccel", NULL};
static const char *opt_name_hwaccel_devices[] = {"hwaccel_device", NULL};
static const char *opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL};
static const char *opt_name_autorotate[] = {"autorotate", NULL};
static const char *opt_name_autoscale[] = {"autoscale", NULL};
static const char *opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL};
static const char *opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL};
static const char *opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL};
static const char *opt_name_sample_fmts[] = {"sample_fmt", NULL};
static const char *opt_name_qscale[] = {"q", "qscale", NULL};
static const char *opt_name_forced_key_frames[] = {"forced_key_frames", NULL};
static const char *opt_name_force_fps[] = {"force_fps", NULL};
static const char *opt_name_frame_aspect_ratios[] = {"aspect", NULL};
static const char *opt_name_rc_overrides[] = {"rc_override", NULL};
static const char *opt_name_intra_matrices[] = {"intra_matrix", NULL};
static const char *opt_name_inter_matrices[] = {"inter_matrix", NULL};
static const char *opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL};
static const char *opt_name_top_field_first[] = {"top", NULL};
static const char *opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL};
static const char *opt_name_copy_initial_nonkeyframes[] = {"copyinkfr", NULL};
static const char *opt_name_copy_prior_start[] = {"copypriorss", NULL};
static const char *opt_name_filters[] = {"filter", "af", "vf", NULL};
static const char *opt_name_filter_scripts[] = {"filter_script", NULL};
static const char *opt_name_reinit_filters[] = {"reinit_filter", NULL};
static const char *opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL};
static const char *opt_name_canvas_sizes[] = {"canvas_size", NULL};
static const char *opt_name_pass[] = {"pass", NULL};
static const char *opt_name_passlogfiles[] = {"passlogfile", NULL};
static const char *opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL};
static const char *opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL};
static const char *opt_name_guess_layout_max[] = {"guess_layout_max", NULL};
static const char *opt_name_apad[] = {"apad", NULL};
static const char *opt_name_discard[] = {"discard", NULL};
static const char *opt_name_disposition[] = {"disposition", NULL};
static const char *opt_name_time_bases[] = {"time_base", NULL};
static const char *opt_name_enc_time_bases[] = {"enc_time_base", NULL};
static const char *const opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL};
static const char *const opt_name_audio_channels[] = {"ac", NULL};
static const char *const opt_name_audio_sample_rate[] = {"ar", NULL};
static const char *const opt_name_frame_rates[] = {"r", NULL};
static const char *const opt_name_frame_sizes[] = {"s", NULL};
static const char *const opt_name_frame_pix_fmts[] = {"pix_fmt", NULL};
static const char *const opt_name_ts_scale[] = {"itsscale", NULL};
static const char *const opt_name_hwaccels[] = {"hwaccel", NULL};
static const char *const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL};
static const char *const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL};
static const char *const opt_name_autorotate[] = {"autorotate", NULL};
static const char *const opt_name_autoscale[] = {"autoscale", NULL};
static const char *const opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL};
static const char *const opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL};
static const char *const opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL};
static const char *const opt_name_sample_fmts[] = {"sample_fmt", NULL};
static const char *const opt_name_qscale[] = {"q", "qscale", NULL};
static const char *const opt_name_forced_key_frames[] = {"forced_key_frames", NULL};
static const char *const opt_name_force_fps[] = {"force_fps", NULL};
static const char *const opt_name_frame_aspect_ratios[] = {"aspect", NULL};
static const char *const opt_name_rc_overrides[] = {"rc_override", NULL};
static const char *const opt_name_intra_matrices[] = {"intra_matrix", NULL};
static const char *const opt_name_inter_matrices[] = {"inter_matrix", NULL};
static const char *const opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL};
static const char *const opt_name_top_field_first[] = {"top", NULL};
static const char *const opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL};
static const char *const opt_name_copy_initial_nonkeyframes[] = {"copyinkfr", NULL};
static const char *const opt_name_copy_prior_start[] = {"copypriorss", NULL};
static const char *const opt_name_filters[] = {"filter", "af", "vf", NULL};
static const char *const opt_name_filter_scripts[] = {"filter_script", NULL};
static const char *const opt_name_reinit_filters[] = {"reinit_filter", NULL};
static const char *const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL};
static const char *const opt_name_canvas_sizes[] = {"canvas_size", NULL};
static const char *const opt_name_pass[] = {"pass", NULL};
static const char *const opt_name_passlogfiles[] = {"passlogfile", NULL};
static const char *const opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL};
static const char *const opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL};
static const char *const opt_name_guess_layout_max[] = {"guess_layout_max", NULL};
static const char *const opt_name_apad[] = {"apad", NULL};
static const char *const opt_name_discard[] = {"discard", NULL};
static const char *const opt_name_disposition[] = {"disposition", NULL};
static const char *const opt_name_time_bases[] = {"time_base", NULL};
static const char *const opt_name_enc_time_bases[] = {"enc_time_base", NULL};
#define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\
{\

View File

@ -88,7 +88,7 @@ static const uint8_t swb_size_1024_8[] = {
32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
};
const uint8_t *ff_aac_swb_size_128[] = {
const uint8_t *const ff_aac_swb_size_128[] = {
swb_size_128_96, swb_size_128_96, swb_size_128_64,
swb_size_128_48, swb_size_128_48, swb_size_128_48,
swb_size_128_24, swb_size_128_24, swb_size_128_16,
@ -96,7 +96,7 @@ const uint8_t *ff_aac_swb_size_128[] = {
swb_size_128_8
};
const uint8_t *ff_aac_swb_size_1024[] = {
const uint8_t *const ff_aac_swb_size_1024[] = {
swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,

View File

@ -38,9 +38,9 @@
#define AAC_MAX_CHANNELS 16
extern const uint8_t *ff_aac_swb_size_1024[];
extern const uint8_t *const ff_aac_swb_size_1024[];
extern const int ff_aac_swb_size_1024_len;
extern const uint8_t *ff_aac_swb_size_128[];
extern const uint8_t *const ff_aac_swb_size_128[];
extern const int ff_aac_swb_size_128_len;
/* Supported layouts without using a PCE */

View File

@ -1110,7 +1110,7 @@ AVCodec ff_av1_decoder = {
FF_CODEC_CAP_SETS_PKT_DTS,
.flush = av1_decode_flush,
.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
.hw_configs = (const AVCodecHWConfigInternal * []) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_AV1_DXVA2_HWACCEL
HWACCEL_DXVA2(av1),
#endif

View File

@ -28,7 +28,7 @@
#include "cbs_internal.h"
static const CodedBitstreamType *cbs_type_table[] = {
static const CodedBitstreamType *const cbs_type_table[] = {
#if CONFIG_CBS_AV1
&ff_cbs_type_av1,
#endif

View File

@ -146,7 +146,7 @@ nsc:
return si;
}
static const char *hevc_nal_type_name[64] = {
static const char *const hevc_nal_type_name[64] = {
"TRAIL_N", // HEVC_NAL_TRAIL_N
"TRAIL_R", // HEVC_NAL_TRAIL_R
"TSA_N", // HEVC_NAL_TSA_N
@ -219,7 +219,7 @@ static const char *hevc_nal_unit_name(int nal_type)
return hevc_nal_type_name[nal_type];
}
static const char *h264_nal_type_name[32] = {
static const char *const h264_nal_type_name[32] = {
"Unspecified 0", //H264_NAL_UNSPECIFIED
"Coded slice of a non-IDR picture", // H264_NAL_SLICE
"Coded slice data partition A", // H264_NAL_DPA

View File

@ -1054,7 +1054,7 @@ AVCodec ff_h264_decoder = {
.capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 |
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
AV_CODEC_CAP_FRAME_THREADS,
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_H264_DXVA2_HWACCEL
HWACCEL_DXVA2(h264),
#endif

View File

@ -3675,7 +3675,7 @@ AVCodec ff_hevc_decoder = {
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING |
FF_CODEC_CAP_ALLOCATE_PROGRESS,
.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_HEVC_DXVA2_HWACCEL
HWACCEL_DXVA2(hevc),
#endif

View File

@ -2990,7 +2990,7 @@ AVCodec ff_mjpeg_decoder = {
.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_SETS_PKT_DTS,
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MJPEG_NVDEC_HWACCEL
HWACCEL_NVDEC(mjpeg),
#endif

View File

@ -2904,7 +2904,7 @@ AVCodec ff_mpeg1video_decoder = {
.flush = flush,
.max_lowres = 3,
.update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context),
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MPEG1_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg1),
#endif
@ -2938,7 +2938,7 @@ AVCodec ff_mpeg2video_decoder = {
.flush = flush,
.max_lowres = 3,
.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MPEG2_DXVA2_HWACCEL
HWACCEL_DXVA2(mpeg2),
#endif

View File

@ -3593,7 +3593,7 @@ AVCodec ff_mpeg4_decoder = {
.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
.update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
.priv_class = &mpeg4_class,
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MPEG4_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg4),
#endif

View File

@ -1132,7 +1132,7 @@ DECLARE_ALIGNED(32, static const float, ff_celt_window_padded)[136] = {
1.00000000f, 1.00000000f, 1.00000000f,
};
const float *ff_celt_window = &ff_celt_window_padded[8];
const float *const ff_celt_window = &ff_celt_window_padded[8];
/* square of the window, used for the postfilter */
const float ff_celt_window2[120] = {

View File

@ -156,7 +156,7 @@ extern const uint16_t ff_celt_qn_exp2[];
extern const float ff_celt_postfilter_taps[3][3];
extern const float ff_celt_window2[120];
extern const float *ff_celt_window;
extern const float *const ff_celt_window;
extern const uint32_t * const ff_celt_pvq_u_row[15];

View File

@ -1217,7 +1217,7 @@ AVCodec ff_vc1_decoder = {
.flush = ff_mpeg_flush,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_VC1_DXVA2_HWACCEL
HWACCEL_DXVA2(vc1),
#endif
@ -1254,7 +1254,7 @@ AVCodec ff_wmv3_decoder = {
.flush = ff_mpeg_flush,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_WMV3_DXVA2_HWACCEL
HWACCEL_DXVA2(wmv3),
#endif

View File

@ -2966,7 +2966,7 @@ AVCodec ff_vp8_decoder = {
AV_CODEC_CAP_SLICE_THREADS,
.flush = vp8_decode_flush,
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_VP8_VAAPI_HWACCEL
HWACCEL_VAAPI(vp8),
#endif

View File

@ -1894,7 +1894,7 @@ AVCodec ff_vp9_decoder = {
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp9_decode_update_thread_context),
.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
.bsfs = "vp9_superframe_split",
.hw_configs = (const AVCodecHWConfigInternal*[]) {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_VP9_DXVA2_HWACCEL
HWACCEL_DXVA2(vp9),
#endif

View File

@ -118,7 +118,7 @@ static double realf(void *priv, double x, double ch) { return getreal(priv, x, c
static double imagf(void *priv, double x, double ch) { return getimag(priv, x, ch); }
static const char *const func2_names[] = { "real", "imag", NULL };
double (*func2[])(void *, double, double) = { realf, imagf, NULL };
static double (*const func2[])(void *, double, double) = { realf, imagf, NULL };
static int config_input(AVFilterLink *inlink)
{

View File

@ -453,7 +453,7 @@ static int read_zp_coefficients(AVFilterContext *ctx, char *item_str, int nb_ite
return 0;
}
static const char *format[] = { "%lf", "%lf %lfi", "%lf %lfr", "%lf %lfd", "%lf %lfi" };
static const char *const format[] = { "%lf", "%lf %lfi", "%lf %lfr", "%lf %lfd", "%lf %lfi" };
static int read_channels(AVFilterContext *ctx, int channels, uint8_t *item_str, int ab)
{

View File

@ -29,7 +29,7 @@
#include "dnn_backend_native_layer_avgpool.h"
#include "dnn_backend_native_layer_dense.h"
LayerFunc layer_funcs[DLT_COUNT] = {
const LayerFunc layer_funcs[DLT_COUNT] = {
{NULL, NULL},
{dnn_execute_layer_conv2d, dnn_load_layer_conv2d},
{dnn_execute_layer_depth2space, dnn_load_layer_depth2space},

View File

@ -33,6 +33,6 @@ typedef struct LayerFunc {
LAYER_LOAD_FUNC pf_load;
}LayerFunc;
extern LayerFunc layer_funcs[DLT_COUNT];
extern const LayerFunc layer_funcs[DLT_COUNT];
#endif

View File

@ -270,7 +270,7 @@ static av_cold int geq_init(AVFilterContext *ctx)
}
for (plane = 0; plane < NB_PLANES; plane++) {
static double (*p[])(void *, double, double) = {
static double (*const p[])(void *, double, double) = {
lum , cb , cr , alpha ,
lumsum, cbsum, crsub, alphasum,
};
@ -283,7 +283,7 @@ static av_cold int geq_init(AVFilterContext *ctx)
"gsum", "bsum", "rsum", "alphasum", "psum",
NULL };
const char *const *func2_names = geq->is_rgb ? func2_rgb_names : func2_yuv_names;
double (*func2[])(void *, double, double) = {
double (*const func2[])(void *, double, double) = {
lum , cb , cr , alpha , p[plane],
lumsum, cbsum, crsub, alphasum, p[plane + 4],
NULL };

View File

@ -55,7 +55,7 @@ static int config_input(AVFilterLink *inlink)
int i;
int ret;
AVExpr *e = NULL;
static const char *var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
if (!s->qp_expr_str)
return 0;
@ -144,7 +144,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVVideoBlockParams *b = av_video_enc_params_block(par_out, block_idx);
int qp = sd_in ? in_qp_global + BLOCK_QP_DELTA(block_idx) : NAN;
double var_values[] = { !!sd_in, qp, x, y, s->qstride, s->h, 0};
static const char *var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
double temp_val;
ret = av_expr_parse_and_eval(&temp_val, s->qp_expr_str,

View File

@ -61,7 +61,7 @@ enum correction_method {
NB_CORRECTION_METHODS,
};
static const char *color_names[NB_RANGES] = {
static const char *const color_names[NB_RANGES] = {
"red", "yellow", "green", "cyan", "blue", "magenta", "white", "neutral", "black"
};

View File

@ -71,12 +71,12 @@ typedef struct TonemapOpenCLContext {
cl_mem util_mem;
} TonemapOpenCLContext;
static const char *linearize_funcs[AVCOL_TRC_NB] = {
static const char *const linearize_funcs[AVCOL_TRC_NB] = {
[AVCOL_TRC_SMPTE2084] = "eotf_st2084",
[AVCOL_TRC_ARIB_STD_B67] = "inverse_oetf_hlg",
};
static const char *delinearize_funcs[AVCOL_TRC_NB] = {
static const char *const delinearize_funcs[AVCOL_TRC_NB] = {
[AVCOL_TRC_BT709] = "inverse_eotf_bt1886",
[AVCOL_TRC_BT2020_10] = "inverse_eotf_bt1886",
};
@ -91,7 +91,7 @@ static const struct WhitepointCoefficients whitepoint_table[AVCOL_PRI_NB] = {
[AVCOL_PRI_BT2020] = { 0.3127, 0.3290 },
};
static const char *tonemap_func[TONEMAP_MAX] = {
static const char *const tonemap_func[TONEMAP_MAX] = {
[TONEMAP_NONE] = "direct",
[TONEMAP_LINEAR] = "linear",
[TONEMAP_GAMMA] = "gamma",

View File

@ -2874,7 +2874,7 @@ skip_duration_calc:
}
/* 1:1 map to AVDurationEstimationMethod */
static const char *duration_name[] = {
static const char *const duration_name[] = {
[AVFMT_DURATION_FROM_PTS] = "pts",
[AVFMT_DURATION_FROM_STREAM] = "stream",
[AVFMT_DURATION_FROM_BITRATE] = "bit rate",

View File

@ -51,7 +51,7 @@ void av_spherical_tile_bounds(const AVSphericalMapping *map,
*bottom = orig_height - height - *top;
}
static const char *spherical_projection_names[] = {
static const char *const spherical_projection_names[] = {
[AV_SPHERICAL_EQUIRECTANGULAR] = "equirectangular",
[AV_SPHERICAL_CUBEMAP] = "cubemap",
[AV_SPHERICAL_EQUIRECTANGULAR_TILE] = "tiled equirectangular",