mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
lavfi: declare arrays that never change as static const
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
165be91c2b
commit
185d1f3bfc
@ -978,7 +978,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
// Planar sample formats are too cumbersome to store in a ring buffer,
|
||||
// therefore planar sample formats are not supported.
|
||||
//
|
||||
enum AVSampleFormat sample_fmts[] = {
|
||||
static const enum AVSampleFormat sample_fmts[] = {
|
||||
AV_SAMPLE_FMT_U8,
|
||||
AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_S32,
|
||||
|
@ -77,7 +77,7 @@ typedef struct {
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
int sample_rates[] = { 44100, -1 };
|
||||
static const int sample_rates[] = { 44100, -1 };
|
||||
|
||||
AVFilterFormats *formats = NULL;
|
||||
AVFilterChannelLayouts *layout = NULL;
|
||||
|
@ -131,7 +131,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
AVFilterFormats *formats = NULL;
|
||||
AVFilterChannelLayouts *layouts = NULL;
|
||||
enum AVSampleFormat sample_fmts[] = {
|
||||
static const enum AVSampleFormat sample_fmts[] = {
|
||||
AV_SAMPLE_FMT_DBL,
|
||||
AV_SAMPLE_FMT_NONE
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ typedef struct {
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVSampleFormat sample_fmts[] = {
|
||||
static const enum AVSampleFormat sample_fmts[] = {
|
||||
AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_S16P,
|
||||
AV_SAMPLE_FMT_NONE
|
||||
|
@ -198,7 +198,7 @@ static int config_props(AVFilterLink *outlink)
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
EvalContext *eval = ctx->priv;
|
||||
enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE };
|
||||
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE };
|
||||
int64_t chlayouts[] = { eval->chlayout, -1 };
|
||||
int sample_rates[] = { eval->sample_rate, -1 };
|
||||
|
||||
|
@ -41,12 +41,12 @@ typedef struct {
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat in_fmts[] = {
|
||||
static const enum AVPixelFormat in_fmts[] = {
|
||||
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
|
||||
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
|
||||
AV_PIX_FMT_NONE
|
||||
};
|
||||
enum AVPixelFormat out_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat out_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
ff_formats_ref(ff_make_format_list(in_fmts), &ctx->inputs[0]->out_formats);
|
||||
ff_formats_ref(ff_make_format_list(out_fmts), &ctx->outputs[0]->in_formats);
|
||||
return 0;
|
||||
|
@ -52,12 +52,12 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat main_fmts[] = {
|
||||
static const enum AVPixelFormat main_fmts[] = {
|
||||
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
|
||||
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
|
||||
AV_PIX_FMT_NONE
|
||||
};
|
||||
enum AVPixelFormat alpha_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat alpha_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
AVFilterFormats *main_formats = ff_make_format_list(main_fmts);
|
||||
AVFilterFormats *alpha_formats = ff_make_format_list(alpha_fmts);
|
||||
ff_formats_ref(main_formats, &ctx->inputs[0]->out_formats);
|
||||
|
@ -124,7 +124,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
|
||||
AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8,
|
||||
|
@ -157,7 +157,7 @@ AVFILTER_DEFINE_CLASS(delogo);
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
|
||||
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
|
||||
|
@ -387,7 +387,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P,
|
||||
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
|
||||
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
|
||||
|
@ -100,7 +100,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
|
||||
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
|
||||
|
@ -157,15 +157,15 @@ static int query_formats(AVFilterContext *ctx)
|
||||
OverlayContext *over = ctx->priv;
|
||||
|
||||
/* overlay formats contains alpha, for avoiding conversion with alpha information loss */
|
||||
const enum AVPixelFormat main_pix_fmts_yuv[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
|
||||
const enum AVPixelFormat overlay_pix_fmts_yuv[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
|
||||
const enum AVPixelFormat main_pix_fmts_rgb[] = {
|
||||
static const enum AVPixelFormat main_pix_fmts_yuv[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat overlay_pix_fmts_yuv[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat main_pix_fmts_rgb[] = {
|
||||
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
|
||||
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
|
||||
AV_PIX_FMT_NONE
|
||||
};
|
||||
const enum AVPixelFormat overlay_pix_fmts_rgb[] = {
|
||||
static const enum AVPixelFormat overlay_pix_fmts_rgb[] = {
|
||||
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
|
||||
AV_PIX_FMT_NONE
|
||||
|
@ -192,7 +192,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize,
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
|
||||
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
|
||||
return 0;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
|
||||
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
|
||||
|
@ -159,7 +159,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P,
|
||||
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
|
||||
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
|
||||
|
Loading…
Reference in New Issue
Block a user