#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "internal.h"
+#include "formats.h"
+#include "video.h"
#define WIDTH 512
#define HEIGHT 512
{ NULL },
};
-static const char *mptestsrc_get_name(void *ctx)
-{
- return "mptestsrc";
-}
-
-static const AVClass mptestsrc_class = {
- "MPTestContext",
- mptestsrc_get_name,
- mptestsrc_options
-};
+AVFILTER_DEFINE_CLASS(mptestsrc);
static double c[64];
return ret;
}
- if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0 ||
- frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
+ if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);
return ret;
}
PIX_FMT_YUV420P, PIX_FMT_NONE
};
- avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+ ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
return 0;
}
if (test->max_pts >= 0 && test->pts > test->max_pts)
return AVERROR_EOF;
- picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, w, h);
+ picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, w, h);
picref->pts = test->pts++;
// clean image
test->frame_nb++;
- avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
- avfilter_draw_slice(outlink, 0, picref->video->h, 1);
- avfilter_end_frame(outlink);
+ ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+ ff_draw_slice(outlink, 0, picref->video->h, 1);
+ ff_end_frame(outlink);
avfilter_unref_buffer(picref);
return 0;