Go to the documentation of this file.
56 #define OFFSET(x) offsetof(DatascopeContext, x)
57 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
58 #define FLAGSR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
89 int x0,
int y0,
const uint8_t *text,
int vertical)
93 for (; *text; text++) {
115 color->rgba[3] = 255;
116 for (p = 0; p <
draw->nb_planes; p++) {
117 if (
draw->nb_planes == 1) {
118 for (
i = 0;
i < 4;
i++) {
133 color->rgba[3] = 255;
134 for (p = 0; p <
draw->nb_planes; p++) {
135 if (
draw->nb_planes == 1) {
136 for (
i = 0;
i < 4;
i++) {
151 reverse->
rgba[3] = 255;
152 for (p = 0; p <
draw->nb_planes; p++) {
153 reverse->
comp[p].
u8[0] =
color->comp[p].u8[0] > 127 ? 0 : 255;
154 reverse->
comp[p].
u8[1] =
color->comp[p].u8[1] > 127 ? 0 : 255;
155 reverse->
comp[p].
u8[2] =
color->comp[p].u8[2] > 127 ? 0 : 255;
163 reverse->
rgba[3] = 255;
164 for (p = 0; p <
draw->nb_planes; p++) {
165 const unsigned max = (1 <<
draw->desc->comp[p].depth) - 1;
166 const unsigned mid = (
max + 1) / 2;
187 const int PP = td->
PP;
188 const int xoff = td->
xoff;
189 const int yoff = td->
yoff;
190 const int P =
FFMAX(
s->nb_planes,
s->nb_comps);
191 const int C =
s->chars;
192 const int D = ((
s->chars -
s->dformat) >> 2) +
s->dformat * 2;
193 const int W = (outlink->
w - xoff) / (
C * 10);
194 const int H = (outlink->
h - yoff) / (PP * 12);
195 const char *
format[4] = {
"%02X\n",
"%04X\n",
"%03d\n",
"%05d\n"};
197 const int slice_end = (
W * (jobnr+1)) / nb_jobs;
200 for (y = 0; y <
H && (y +
s->y <
inlink->h); y++) {
204 int value[4] = { 0 }, pp = 0;
207 s->reverse_color(&
s->draw, &
color, &reverse);
209 xoff + x *
C * 10, yoff + y * PP * 12,
C * 10, PP * 12);
211 for (p = 0; p <
P; p++) {
214 if (!(
s->components & (1 << p)))
217 draw_text(&
s->draw,
out, &reverse, xoff + x *
C * 10 + 2, yoff + y * PP * 12 + pp * 10 + 2, text, 0);
234 const int PP = td->
PP;
235 const int xoff = td->
xoff;
236 const int yoff = td->
yoff;
237 const int P =
FFMAX(
s->nb_planes,
s->nb_comps);
238 const int C =
s->chars;
239 const int D = ((
s->chars -
s->dformat) >> 2) +
s->dformat * 2;
240 const int W = (outlink->
w - xoff) / (
C * 10);
241 const int H = (outlink->
h - yoff) / (PP * 12);
242 const char *
format[4] = {
"%02X\n",
"%04X\n",
"%03d\n",
"%05d\n"};
244 const int slice_end = (
W * (jobnr+1)) / nb_jobs;
247 for (y = 0; y <
H && (y +
s->y <
inlink->h); y++) {
250 int value[4] = { 0 }, pp = 0;
254 for (p = 0; p <
P; p++) {
257 if (!(
s->components & (1 << p)))
260 draw_text(&
s->draw,
out, &
color, xoff + x *
C * 10 + 2, yoff + y * PP * 12 + pp * 10 + 2, text, 0);
277 const int PP = td->
PP;
278 const int xoff = td->
xoff;
279 const int yoff = td->
yoff;
280 const int P =
FFMAX(
s->nb_planes,
s->nb_comps);
281 const int C =
s->chars;
282 const int D = ((
s->chars -
s->dformat) >> 2) +
s->dformat * 2;
283 const int W = (outlink->
w - xoff) / (
C * 10);
284 const int H = (outlink->
h - yoff) / (PP * 12);
285 const char *
format[4] = {
"%02X\n",
"%04X\n",
"%03d\n",
"%05d\n"};
287 const int slice_end = (
W * (jobnr+1)) / nb_jobs;
290 for (y = 0; y <
H && (y +
s->y <
inlink->h); y++) {
293 int value[4] = { 0 }, pp = 0;
296 for (p = 0; p <
P; p++) {
299 if (!(
s->components & (1 << p)))
302 draw_text(&
s->draw,
out, &
s->white, xoff + x *
C * 10 + 2, yoff + y * PP * 12 + pp * 10 + 2, text, 0);
316 const int P =
FFMAX(
s->nb_planes,
s->nb_comps);
331 0, 0, outlink->
w, outlink->
h);
333 for (
int p = 0; p <
P; p++) {
334 if (
s->components & (1 << p))
340 const int C =
s->chars;
341 int Y = outlink->
h / (PP * 12);
342 int X = outlink->
w / (
C * 10);
343 char text[256] = { 0 };
347 ymaxlen = strlen(text);
350 xmaxlen = strlen(text);
353 Y = (outlink->
h - xmaxlen) / (PP * 12);
354 X = (outlink->
w - ymaxlen) / (
C * 10);
356 for (y = 0; y <
Y; y++) {
357 snprintf(text,
sizeof(text),
"%d",
s->y + y);
360 0, xmaxlen + y * PP * 12 + (PP + 1) * PP - 2, ymaxlen, 10);
362 draw_text(&
s->draw,
out, &
s->yellow, 2, xmaxlen + y * PP * 12 + (PP + 1) * PP, text, 0);
365 for (x = 0; x <
X; x++) {
366 snprintf(text,
sizeof(text),
"%d",
s->x + x);
369 ymaxlen + x *
C * 10 + 2 *
C - 2, 0, 10, xmaxlen);
371 draw_text(&
s->draw,
out, &
s->yellow, ymaxlen + x *
C * 10 + 2 *
C, 2, text, 1);
386 uint8_t
alpha =
s->opacity * 255;
394 s->chars = (
s->draw.desc->comp[0].depth + 7) / 8 * 2 +
s->dformat;
395 s->nb_comps =
s->draw.desc->nb_components;
403 if (
s->draw.desc->comp[0].depth <= 8) {
426 char *res,
int res_len,
int flags)
458 .priv_class = &datascope_class,
495 #define POFFSET(x) offsetof(PixscopeContext, x)
522 s->nb_comps =
s->draw.desc->nb_components;
526 s->colors[0] = &
s->red;
527 s->colors[1] = &
s->green;
528 s->colors[2] = &
s->blue;
529 s->colors[3] = &
s->white;
532 s->colors[0] = &
s->white;
533 s->colors[1] = &
s->blue;
534 s->colors[2] = &
s->red;
535 s->colors[3] = &
s->white;
542 if (
s->draw.desc->comp[0].depth <= 8) {
566 #define SQR(x) ((x)*(x))
574 int max[4] = { 0 },
min[4] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX };
575 float average[4] = { 0 };
576 double std[4] = { 0 }, rms[4] = { 0 };
577 const char rgba[4] = {
'R',
'G',
'B',
'A' };
578 const char yuva[4] = {
'Y',
'U',
'V',
'A' };
579 int x, y,
X,
Y,
i,
w,
h;
604 if (
s->x +
s->w >=
X && (
s->x +
s->w <=
X +
s->ww) &&
605 s->y +
s->h >=
Y && (
s->y +
s->h <=
Y +
s->wh)) {
606 X = (in->
width -
s->ww) * (1 +
s->wx);
611 if (
s->x +
s->w >=
X && (
s->x +
s->w <=
X +
s->ww) &&
612 s->y +
s->h >=
Y && (
s->y +
s->h <=
Y +
s->wh)) {
624 for (y = 0; y <
s->h; y++) {
625 for (x = 0; x <
s->w; x++) {
627 int value[4] = { 0 };
631 x *
w + (
s->ww - 4 - (
s->w *
w)) / 2 +
X, y *
h + 2 +
Y,
w,
h);
632 for (
i = 0;
i < 4;
i++) {
644 s->x - 2,
s->y - 2,
s->w + 4, 1);
648 s->x - 1,
s->y - 1,
s->w + 2, 1);
652 s->x - 1,
s->y - 1, 1,
s->h + 2);
656 s->x - 2,
s->y - 2, 1,
s->h + 4);
660 s->x - 1,
s->y + 1 +
s->h,
s->w + 3, 1);
664 s->x - 2,
s->y + 2 +
s->h,
s->w + 4, 1);
668 s->x + 1 +
s->w,
s->y - 1, 1,
s->h + 2);
672 s->x + 2 +
s->w,
s->y - 2, 1,
s->h + 5);
674 for (
i = 0;
i < 4;
i++) {
675 rms[
i] /=
s->w *
s->h;
676 rms[
i] = sqrt(rms[
i]);
677 average[
i] /=
s->w *
s->h;
680 for (y = 0; y <
s->h; y++) {
681 for (x = 0; x <
s->w; x++) {
682 for (
i = 0;
i < 4;
i++)
683 std[
i] +=
SQR(
s->values[
i][x][y] - average[
i]);
687 for (
i = 0;
i < 4;
i++) {
688 std[
i] /=
s->w *
s->h;
689 std[
i] = sqrt(std[
i]);
692 snprintf(text,
sizeof(text),
"CH AVG MIN MAX RMS\n");
694 for (
i = 0;
i <
s->nb_comps;
i++) {
695 int c =
s->rgba_map[
i];
697 snprintf(text,
sizeof(text),
"%c %07.1f %05d %05d %07.1f\n",
s->is_rgb ? rgba[
i] : yuva[
i], average[
c],
min[
c],
max[
c], rms[
c]);
700 snprintf(text,
sizeof(text),
"CH STD\n");
702 for (
i = 0;
i <
s->nb_comps;
i++) {
703 int c =
s->rgba_map[
i];
705 snprintf(text,
sizeof(text),
"%c %07.2f\n",
s->is_rgb ? rgba[
i] : yuva[
i], std[
c]);
714 char *res,
int res_len,
int flags)
738 .priv_class = &pixscope_class,
792 #define OOFFSET(x) offsetof(OscilloscopeContext, x)
823 int dx =
FFABS(
x1 - x0), sx = x0 <
x1 ? 1 : -1;
824 int dy =
FFABS(
y1 - y0), sy = y0 <
y1 ? 1 : -1;
825 int err = (dx > dy ? dx : -dy) / 2, e2;
829 if (x0 >= 0 && y0 >= 0 && x0 < out->
width && y0 < out->
height) {
830 for (p = 0; p <
draw->nb_planes; p++) {
831 if (
draw->desc->comp[p].depth == 8) {
832 if (
draw->nb_planes == 1) {
833 for (
i = 0;
i <
draw->desc->nb_components;
i++) {
834 out->data[0][y0 *
out->linesize[0] + x0 *
draw->pixelstep[0] +
i] =
color->comp[0].u8[
i];
837 out->data[p][
out->linesize[p] * (y0 >>
draw->vsub[p]) + (x0 >>
draw->hsub[p])] =
color->comp[p].u8[0];
840 if (
draw->nb_planes == 1) {
841 for (
i = 0;
i <
draw->desc->nb_components;
i++) {
851 if (x0 ==
x1 && y0 ==
y1)
872 for (
i = 1;
i <
s->nb_values;
i++) {
873 for (
c = 0;
c <
s->nb_comps;
c++) {
874 if ((1 <<
c) &
s->components) {
875 int x =
i *
s->width /
s->nb_values;
876 int px = (
i - 1) *
s->width /
s->nb_values;
877 int py =
s->height -
s->values[
i-1].p[
s->rgba_map[
c]] *
s->height / 256;
878 int y =
s->height -
s->values[
i].p[
s->rgba_map[
c]] *
s->height / 256;
891 for (
i = 1;
i <
s->nb_values;
i++) {
892 for (
c = 0;
c <
s->nb_comps;
c++) {
893 if ((1 <<
c) &
s->components) {
894 int x =
i *
s->width /
s->nb_values;
895 int px = (
i - 1) *
s->width /
s->nb_values;
896 int py =
s->height -
s->values[
i-1].p[
s->rgba_map[
c]] *
s->height /
s->max;
897 int y =
s->height -
s->values[
i].p[
s->rgba_map[
c]] *
s->height /
s->max;
918 cx =
s->xpos * (
inlink->w - 1);
919 cy =
s->ypos * (
inlink->h - 1);
943 s->nb_comps =
s->draw.desc->nb_components;
947 s->colors[0] = &
s->red;
948 s->colors[1] = &
s->green;
949 s->colors[2] = &
s->blue;
950 s->colors[3] = &
s->white;
953 s->colors[0] = &
s->white;
954 s->colors[1] = &
s->cyan;
955 s->colors[2] = &
s->magenta;
956 s->colors[3] = &
s->white;
963 if (
s->draw.desc->comp[0].depth <= 8) {
971 s->max = (1 <<
s->draw.desc->comp[0].depth);
986 int dx =
FFABS(
x1 - x0), sx = x0 <
x1 ? 1 : -1;
987 int dy =
FFABS(
y1 - y0), sy = y0 <
y1 ? 1 : -1;
988 int err = (dx > dy ? dx : -dy) / 2, e2;
991 if (x0 >= 0 && y0 >= 0 && x0 < out->
width && y0 < out->
height) {
993 int value[4] = { 0 };
996 s->values[
s->nb_values].p[0] =
value[0];
997 s->values[
s->nb_values].p[1] =
value[1];
998 s->values[
s->nb_values].p[2] =
value[2];
999 s->values[
s->nb_values].p[3] =
value[3];
1003 if (
s->draw.desc->comp[0].depth == 8) {
1004 if (
s->draw.nb_planes == 1) {
1007 for (
i = 0;
i <
s->nb_comps;
i++)
1008 out->data[0][
out->linesize[0] * y0 + x0 *
s->draw.pixelstep[0] +
i] = 255 * ((
s->nb_values +
state) & 1);
1010 out->data[0][
out->linesize[0] * y0 + x0] = 255 * ((
s->nb_values +
state) & 1);
1013 if (
s->draw.nb_planes == 1) {
1016 for (
i = 0;
i <
s->nb_comps;
i++)
1017 AV_WN16(
out->data[0] +
out->linesize[0] * y0 + x0 *
s->draw.pixelstep[0] +
i, (
s->max - 1) * ((
s->nb_values +
state) & 1));
1019 AV_WN16(
out->data[0] +
out->linesize[0] * y0 + 2 * x0, (
s->max - 1) * ((
s->nb_values +
state) & 1));
1025 if (x0 ==
x1 && y0 ==
y1)
1048 float average[4] = { 0 };
1050 int min[4] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX };
1057 s->ox,
s->oy,
s->width,
s->height + 20 *
s->statistics);
1059 if (
s->grid && outlink->
h >= 10) {
1061 s->ox,
s->oy,
s->width - 1, 1);
1063 for (
i = 1;
i < 5;
i++) {
1065 s->ox,
s->oy +
i * (
s->height - 1) / 4,
s->width, 1);
1068 for (
i = 0;
i < 10;
i++) {
1070 s->ox +
i * (
s->width - 1) / 10,
s->oy, 1,
s->height);
1074 s->ox +
s->width - 1,
s->oy, 1,
s->height);
1079 for (
i = 0;
i <
s->nb_values;
i++) {
1080 for (
c = 0;
c <
s->nb_comps;
c++) {
1081 if ((1 <<
c) &
s->components) {
1084 average[
c] +=
s->values[
i].p[
s->rgba_map[
c]];
1088 for (
c = 0;
c <
s->nb_comps;
c++) {
1089 average[
c] /=
s->nb_values;
1092 if (
s->statistics &&
s->height > 10 &&
s->width > 280 *
av_popcount(
s->components)) {
1093 for (
c = 0,
i = 0;
c <
s->nb_comps;
c++) {
1094 if ((1 <<
c) &
s->components) {
1095 const char rgba[4] = {
'R',
'G',
'B',
'A' };
1096 const char yuva[4] = {
'Y',
'U',
'V',
'A' };
1099 snprintf(text,
sizeof(text),
"%c avg:%.1f min:%d max:%d\n",
s->is_rgb ? rgba[
c] : yuva[
c], average[
c],
min[
c],
max[
c]);
1109 char *res,
int res_len,
int flags)
1133 .
name =
"oscilloscope",
1136 .priv_class = &oscilloscope_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
#define AV_LOG_WARNING
Something somehow does not look correct.
static void reverse_color8(FFDrawContext *draw, FFDrawColor *color, FFDrawColor *reverse)
static const AVFilterPad pixscope_inputs[]
static int filter_mono(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int pixscope_process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int filter_color2(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
static void pick_color8(FFDrawContext *draw, FFDrawColor *color, AVFrame *in, int x, int y, int *value)
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Link properties exposed to filter code, but not external callers.
void(* draw_trace)(struct OscilloscopeContext *s, AVFrame *frame)
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
void * priv
private data for use by the filter
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_w, int dst_h, const uint8_t *mask, int mask_linesize, int mask_w, int mask_h, int l2depth, unsigned endianness, int x0, int y0)
Blend an alpha mask with an uniform color.
void(* reverse_color)(FFDrawContext *draw, FFDrawColor *color, FFDrawColor *reverse)
A filter pad used for either input or output.
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void update_oscilloscope(AVFilterContext *ctx)
uint16_t values[4][80][80]
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
static int filter_color(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int(* filter)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static void oscilloscope_uninit(AVFilterContext *ctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
static int config_input(AVFilterLink *inlink)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
static const AVFilterPad inputs[]
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
static void pick_color16(FFDrawContext *draw, FFDrawColor *color, AVFrame *in, int x, int y, int *value)
#define FILTER_OUTPUTS(array)
static void reverse_color16(FFDrawContext *draw, FFDrawColor *color, FFDrawColor *reverse)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Rational number (pair of numerator and denominator).
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
static const AVOption datascope_options[]
static const AVOption oscilloscope_options[]
void(* pick_color)(FFDrawContext *draw, FFDrawColor *color, AVFrame *in, int x, int y, int *value)
static void draw_trace8(OscilloscopeContext *s, AVFrame *frame)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static FilterLink * ff_filter_link(AVFilterLink *link)
AVFILTER_DEFINE_CLASS(datascope)
static void draw_trace16(OscilloscopeContext *s, AVFrame *frame)
union FFDrawColor::@314 comp[MAX_PLANES]
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_w, int dst_h, int x0, int y0, int w, int h)
Blend a rectangle with an uniform color.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
static int oscilloscope_process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSpace csp, enum AVColorRange range, unsigned flags)
Init a draw context.
static av_const double hypot(double x, double y)
static const AVFilterPad outputs[]
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
static void draw_text(FFDrawContext *draw, AVFrame *frame, FFDrawColor *color, int x0, int y0, const uint8_t *text, int vertical)
static const AVFilterPad oscilloscope_inputs[]
void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_x, int dst_y, int w, int h)
Fill a rectangle with an uniform color.
AVFilterContext * src
source filter
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
static int pixscope_filter_frame(AVFilterLink *inlink, AVFrame *in)
void(* pick_color)(FFDrawContext *draw, FFDrawColor *color, AVFrame *in, int x, int y, int *value)
const AVFilter ff_vf_pixscope
static int draw(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
static void uninit(AVBSFContext *ctx)
#define i(width, name, range_min, range_max)
int w
agreed upon image width
AVFilterFormats * ff_draw_supported_pixel_formats(unsigned flags)
Return the list of pixel formats supported by the draw functions.
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
#define FILTER_QUERY_FUNC2(func)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
const char * name
Pad name.
void * av_calloc(size_t nmemb, size_t size)
void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
Prepare a color.
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
void(* pick_color)(FFDrawContext *draw, FFDrawColor *color, AVFrame *in, int x, int y, int *value)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
const AVFilter ff_vf_oscilloscope
int h
agreed upon image height
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
const AVFilter ff_vf_datascope
static void draw_scope(OscilloscopeContext *s, int x0, int y0, int x1, int y1, AVFrame *out, PixelValues *p, int state)
const uint8_t avpriv_cga_font[2048]
static const int16_t alpha[]
static int config_output(AVFilterLink *outlink)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
static void draw_line(FFDrawContext *draw, int x0, int y0, int x1, int y1, AVFrame *out, FFDrawColor *color)
static const AVOption pixscope_options[]
static int pixscope_config_input(AVFilterLink *inlink)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
static int oscilloscope_filter_frame(AVFilterLink *inlink, AVFrame *frame)
int64_t frame_count_in
Number of past frames sent through the link.
static int oscilloscope_config_input(AVFilterLink *inlink)