33 #include "libavutil/pixdesc.h"
35 #include "libavutil/imgutils.h"
37 #include "libavutil/mathematics.h"
38 #include "libavutil/mem.h"
39 #include "libavutil/opt.h"
40 #include "libavutil/parseutils.h"
69 frame_rate_q.
den <= 0 || frame_rate_q.
num <= 0) {
87 for (i = 0; i < 4; i++) {
125 color->
w &= ~((1 << color->
hsub) - 1);
126 color->
h &= ~((1 << color->
vsub) - 1);
130 memcpy(rgba_color, color->
color,
sizeof(rgba_color));
132 inlink->
format, rgba_color, &is_packed_rgba,
NULL);
137 is_packed_rgba ?
"rgba" :
"yuva");
138 inlink->
w = color->
w;
139 inlink->
h = color->
h;
154 frame->
pts = color->
pts++;
158 0, 0, color->
w, color->
h);
162 #define OFFSET(x) offsetof(ColorContext, x)
163 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
190 .description =
NULL_IF_CONFIG_SMALL(
"Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"),
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
This structure describes decoded (raw) audio or video data.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
const char * name
Filter name.
packed RGB 8:8:8, 24bpp, RGBRGB...
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
int h
agreed upon image height
static av_cold void uninit(AVFilterContext *ctx)
Various defines for YUV<->RGB conversion.
int vsub
chroma subsampling values
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static const AVFilterPad avfilter_vsrc_color_outputs[]
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
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 *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_LOG_VERBOSE
Detailed information.
static av_cold int color_init(AVFilterContext *ctx)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
A link between two filters.
static int query_formats(AVFilterContext *ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVClass color_class
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
AVFilterContext * src
source filter
static av_cold void color_uninit(AVFilterContext *ctx)
AVPixelFormat
Pixel format.
int av_parse_video_rate(AVRational *rate, const char *str)
Parse str and store the detected values in *rate.
int w
agreed upon image width
common internal API header
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...
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
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 format
agreed upon media format
Main libavfilter public API header.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
packed RGB 8:8:8, 24bpp, BGRBGR...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
rational number numerator/denominator
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
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.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static const uint8_t color[]
struct AVFilterPad AVFilterPad
static av_cold int init(AVCodecParserContext *s)
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
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])
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
av_default_item_name
Return the context name.
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)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static const AVOption options[]