67 #define OFFSET(x) offsetof(GraphMonitorContext, x)
68 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
116 for (
int i = 0;
i <
out->height;
i++)
117 for (
int j = 0; j <
out->width; j++)
129 if (y + 8 >= pic->
height ||
130 x + strlen(txt) * 8 >= pic->
width)
133 for (
i = 0; txt[
i];
i++) {
137 for (char_y = 0; char_y < font_height; char_y++) {
139 if (font[txt[
i] * font_height + char_y] &
mask) {
153 for (
int j = 0; j <
filter->nb_inputs; j++) {
161 for (
int j = 0; j <
filter->nb_outputs; j++) {
178 char buffer[1024] = { 0 };
189 xpos += strlen(
buffer) * 8;
198 xpos += strlen(
buffer) * 8;
207 xpos += strlen(
buffer) * 8;
212 xpos += strlen(
buffer) * 8;
217 xpos += strlen(
buffer) * 8;
220 xpos += strlen(
buffer) * 8;
225 xpos += strlen(
buffer) * 8;
230 xpos += strlen(
buffer) * 8;
235 xpos += strlen(
buffer) * 8;
240 xpos += strlen(
buffer) * 8;
245 xpos += strlen(
buffer) * 8;
262 for (
int i = 0;
i <
ctx->graph->nb_filters;
i++) {
264 char buffer[1024] = { 0 };
271 xpos += strlen(
filter->name) * 8 + 10;
274 for (
int j = 0; j <
filter->nb_inputs; j++) {
284 xpos += strlen(
buffer) * 8;
286 xpos += strlen(l->
src->
name) * 8 + 10;
292 for (
int j = 0; j <
filter->nb_outputs; j++) {
302 xpos += strlen(
buffer) * 8;
304 xpos += strlen(l->
dst->
name) * 8 + 10;
358 s->bg[3] = 255 *
s->opacity;
359 s->white[0] =
s->white[1] =
s->white[2] = 255;
360 s->yellow[0] =
s->yellow[1] = 255;
375 #if CONFIG_GRAPHMONITOR_FILTER
387 static const AVFilterPad graphmonitor_outputs[] = {
397 .
name =
"graphmonitor",
400 .priv_class = &graphmonitor_class,
403 .
inputs = graphmonitor_inputs,
404 .
outputs = graphmonitor_outputs,
409 #if CONFIG_AGRAPHMONITOR_FILTER
411 #define agraphmonitor_options graphmonitor_options
414 static const AVFilterPad agraphmonitor_inputs[] = {
422 static const AVFilterPad agraphmonitor_outputs[] = {
432 .
name =
"agraphmonitor",
435 .priv_class = &agraphmonitor_class,
438 .
inputs = agraphmonitor_inputs,
439 .
outputs = agraphmonitor_outputs,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
AVFilter ff_avf_agraphmonitor
AVFilter ff_vf_graphmonitor
int ff_outlink_get_status(AVFilterLink *link)
Get the status on an output link.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
size_t ff_inlink_queued_frames(AVFilterLink *link)
Get the number of frames available on the link.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Main libavfilter public API header.
#define flags(name, subs,...)
static av_always_inline void filter(int16_t *output, ptrdiff_t out_stride, const int16_t *low, ptrdiff_t low_stride, const int16_t *high, ptrdiff_t high_stride, int len, int clip)
mode
Use these values in ebur128_init (or'ed).
simple arithmetic expression evaluator
static const AVOption graphmonitor_options[]
static int create_frame(AVFilterContext *ctx, int64_t pts)
static void clear_image(GraphMonitorContext *s, AVFrame *out, AVFilterLink *outlink)
static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint8_t *color)
static int query_formats(AVFilterContext *ctx)
static void draw_items(AVFilterContext *ctx, AVFrame *out, int xpos, int ypos, AVFilterLink *l, size_t frames)
static int filter_have_queued(AVFilterContext *filter)
static int activate(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define FF_FILTER_FORWARD_STATUS(inlink, outlink)
Acknowledge the status on an input link and forward it to an output link.
#define FFERROR_NOT_READY
Filters implementation helper functions.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
static int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
#define AVFILTER_DEFINE_CLASS(fname)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
static const uint16_t mask[17]
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Describe the class of an AVClass context structure.
char * name
name of this filter instance
void * priv
private data for use by the filter
A link between two filters.
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
int w
agreed upon image width
int h
agreed upon image height
int channels
Number of channels.
enum AVMediaType type
filter media type
AVFilterContext * src
source filter
int64_t frame_count_in
Number of past frames sent through the link.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
int64_t current_pts_us
Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units.
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Rational number (pair of numerator and denominator).
timestamp utils, mostly useful for debugging/logging purposes
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
const uint8_t avpriv_cga_font[2048]
CGA/EGA/VGA ROM font data.