55 char color_string[128] =
"black";
57 char frame_rate [128] =
"25";
62 sscanf(args,
"%127[^:]:%127[^:]:%127s", color_string, frame_size, frame_rate);
70 frame_rate_q.
den <= 0 || frame_rate_q.
num <= 0) {
88 for (i = 0; i < 4; i++) {
126 color->
w &= ~((1 << color->
hsub) - 1);
127 color->
h &= ~((1 << color->
vsub) - 1);
131 memcpy(rgba_color, color->
color,
sizeof(rgba_color));
133 inlink->
format, rgba_color, &is_packed_rgba,
NULL);
138 is_packed_rgba ?
"rgba" :
"yuva");
139 inlink->
w = color->
w;
140 inlink->
h = color->
h;
155 picref->
pts = color->
pts++;
160 0, 0, color->
w, color->
h);
176 .description =
NULL_IF_CONFIG_SMALL(
"Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"),
186 .
outputs = avfilter_vsrc_color_outputs,
static void uninit(AVFilterContext *ctx)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
AVFilterBufferRefVideoProps * video
video buffer specific properties
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
static av_cold int color_init(AVFilterContext *ctx, const char *args)
int linesize[8]
number of bytes per line
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVFilterPad outputs[]
packed RGB 8:8:8, 24bpp, RGBRGB...
memory handling functions
int h
agreed upon image height
int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
Send a frame of data to the next filter.
Various defines for YUV<->RGB conversion.
int vsub
chroma subsampling values
static const AVFilterPad avfilter_vsrc_color_outputs[]
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static int color_config_props(AVFilterLink *inlink)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * name
Pad name.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
AVRational pixel_aspect
pixel aspect ratio
static int init(AVCodecParserContext *s)
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
int64_t pts
presentation timestamp.
A filter pad used for either input or output.
static const uint8_t frame_size[4]
A link between two filters.
static int query_formats(AVFilterContext *ctx)
AVFilterBufferRef * ff_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
void * priv
private data for use by the filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
static av_cold void color_uninit(AVFilterContext *ctx)
void av_log(void *avcl, int level, const char *fmt,...)
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
common internal API header
struct AVRational AVRational
rational number numerator/denominator
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
AVFilter avfilter_vsrc_color
packed RGB 8:8:8, 24bpp, BGRBGR...
AVFilterContext * src
source filter
int format
agreed upon media format
A reference to an AVFilterBuffer.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static const AVFilterPad inputs[]
rational number numerator/denominator
const char * name
filter name
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static const uint8_t color[]
#define AV_PERM_WRITE
can write to the buffer
int64_t pos
byte position in stream, -1 if unknown
int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4])
uint8_t * data[8]
picture/audio data for each plane
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
static int color_request_frame(AVFilterLink *link)
void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], uint8_t *src[4], int pixelstep[4], int hsub, int vsub, int x, int y, int w, int h)
AVPixelFormat
Pixel format.