47 char color_string[128] =
"black";
48 char frame_size [128] =
"320x240";
54 sscanf(args,
"%127[^:]:%127[^:]:%127s", color_string, frame_size, frame_rate);
62 frame_rate_q.
den <= 0 || frame_rate_q.
num <= 0) {
80 for (i = 0; i < 4; i++) {
111 uint8_t rgba_color[4];
118 color->
w &= ~((1 << color->
hsub) - 1);
119 color->
h &= ~((1 << color->
vsub) - 1);
123 memcpy(rgba_color, color->
color,
sizeof(rgba_color));
125 inlink->
format, rgba_color, &is_packed_rgba,
NULL);
130 is_packed_rgba ?
"rgba" :
"yuva");
131 inlink->
w = color->
w;
132 inlink->
h = color->
h;
143 picref->
pts = color->
pts++;
149 0, 0, color->
w, color->
h);
159 .description =
NULL_IF_CONFIG_SMALL(
"Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"),
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
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.
int linesize[8]
number of bytes per line
int h
agreed upon image height
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Various defines for YUV<->RGB conversion.
int vsub
chroma subsampling values
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 ...
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P 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.
A link between two filters.
static int query_formats(AVFilterContext *ctx)
int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], enum PixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4])
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
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. ...
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,...)
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
int w
agreed upon image width
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...
AVFilter avfilter_vsrc_color
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
AVFilterContext * src
source filter
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
int format
agreed upon media format
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
A reference to an AVFilterBuffer.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
rational number numerator/denominator
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
static av_cold void uninit(AVFilterContext *ctx)
const char * name
filter name
packed RGB 8:8:8, 24bpp, BGRBGR...
static const uint8_t color[]
static av_cold int color_init(AVFilterContext *ctx, const char *args, void *opaque)
static AVRational frame_rate
#define AV_PERM_WRITE
can write to the buffer
packed RGB 8:8:8, 24bpp, RGBRGB...
int64_t pos
byte position in stream, -1 if unknown
uint8_t * data[8]
picture/audio data for each plane
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
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)
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)