libavfilter/vsrc_cellauto.c File Reference

cellular automaton video source, based on Stephen Wolfram "experimentus crucis" More...

#include "libavutil/file.h"
#include "libavutil/lfg.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"

Go to the source code of this file.

Data Structures

struct  CellAutoContext

Defines

#define OFFSET(x)   offsetof(CellAutoContext, x)

Functions

static const char * cellauto_get_name (void *ctx)
static int init_pattern_from_string (AVFilterContext *ctx)
static int init_pattern_from_file (AVFilterContext *ctx)
static int init (AVFilterContext *ctx, const char *args, void *opaque)
static av_cold void uninit (AVFilterContext *ctx)
static int config_props (AVFilterLink *outlink)
static void evolve (AVFilterContext *ctx)
static void fill_picture (AVFilterContext *ctx, AVFilterBufferRef *picref)
static int request_frame (AVFilterLink *outlink)
static int query_formats (AVFilterContext *ctx)

Variables

static const AVOption cellauto_options []
static const AVClass cellauto_class
AVFilter avfilter_vsrc_cellauto


Detailed Description

cellular automaton video source, based on Stephen Wolfram "experimentus crucis"

Definition in file vsrc_cellauto.c.


Define Documentation

#define OFFSET (  )     offsetof(CellAutoContext, x)

Definition at line 57 of file vsrc_cellauto.c.


Function Documentation

static const char* cellauto_get_name ( void *  ctx  )  [static]

Definition at line 80 of file vsrc_cellauto.c.

static int config_props ( AVFilterLink outlink  )  [static]

Definition at line 246 of file vsrc_cellauto.c.

static void evolve ( AVFilterContext ctx  )  [static]

Definition at line 257 of file vsrc_cellauto.c.

Referenced by request_frame().

static void fill_picture ( AVFilterContext ctx,
AVFilterBufferRef picref 
) [static]

Definition at line 288 of file vsrc_cellauto.c.

Referenced by request_frame().

static int init ( AVFilterContext ctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 168 of file vsrc_cellauto.c.

static int init_pattern_from_file ( AVFilterContext ctx  )  [static]

Definition at line 148 of file vsrc_cellauto.c.

Referenced by init().

static int init_pattern_from_string ( AVFilterContext ctx  )  [static]

Definition at line 109 of file vsrc_cellauto.c.

Referenced by init(), and init_pattern_from_file().

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 345 of file vsrc_cellauto.c.

static int request_frame ( AVFilterLink outlink  )  [static]

Definition at line 316 of file vsrc_cellauto.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 237 of file vsrc_cellauto.c.


Variable Documentation

Initial value:

 {
    .name        = "cellauto",
    .description = NULL_IF_CONFIG_SMALL("Create pattern generated by an elementary cellular automaton."),
    .priv_size = sizeof(CellAutoContext),
    .init      = init,
    .uninit    = uninit,
    .query_formats = query_formats,

    .inputs    = (const AVFilterPad[]) {
        { .name = NULL}
    },
    .outputs   = (const AVFilterPad[]) {
        { .name            = "default",
          .type            = AVMEDIA_TYPE_VIDEO,
          .request_frame   = request_frame,
          .config_props    = config_props },
        { .name = NULL}
    },
}

Definition at line 352 of file vsrc_cellauto.c.

const AVClass cellauto_class [static]

Initial value:

 {
    "CellAutoContext",
    cellauto_get_name,
    cellauto_options
}

Definition at line 85 of file vsrc_cellauto.c.

const AVOption cellauto_options[] [static]

Initial value:

 {
    { "filename", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "f",        "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "pattern",  "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "p",        "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "rate",     "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
    { "r",        "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
    { "size",     "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "s",        "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
    { "rule",     "set rule",       OFFSET(rule), AV_OPT_TYPE_INT,    {.dbl = 110},  0, 255 },
    { "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1 },
    { "ratio",             "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1 },
    { "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX },
    { "seed",        "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX },
    { "scroll",      "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1 },
    { "start_full",  "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1 },
    { "full",        "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1 },
    { "stitch",      "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT,    {.dbl = 1},   0, 1 },
    { NULL },
}

Definition at line 59 of file vsrc_cellauto.c.


Generated on Fri Oct 26 02:43:51 2012 for FFmpeg by  doxygen 1.5.8