/**
* @file
- * drawtext filter, based on the original FFmpeg vhook/drawtext.c
+ * drawtext filter, based on the original vhook/drawtext.c
* filter by Gustavo Sverzut Barbieri
*/
#include FT_FREETYPE_H
#include FT_GLYPH_H
-static const char *var_names[] = {
- "E",
- "PHI",
- "PI",
+static const char * const var_names[] = {
"w", ///< width of the input video
"h", ///< height of the input video
"tw", "text_w", ///< width of the rendered text
};
enum var_name {
- VAR_E,
- VAR_PHI,
- VAR_PI,
VAR_W,
VAR_H,
VAR_TW, VAR_TEXT_W,
dtext->shadowcolor[3] = rgba[3];
}
- dtext->var_values[VAR_E] = M_E;
- dtext->var_values[VAR_PHI] = M_PHI;
- dtext->var_values[VAR_PI] = M_PI;
dtext->var_values[VAR_W] = inlink->w;
dtext->var_values[VAR_H] = inlink->h;
dtext->var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? av_q2d(inlink->sample_aspect_ratio) : 1;
.uninit = uninit,
.query_formats = query_formats,
- .inputs = (AVFilterPad[]) {{ .name = "default",
+ .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = avfilter_null_get_video_buffer,
.start_frame = avfilter_null_start_frame,
AV_PERM_READ,
.rej_perms = AV_PERM_PRESERVE },
{ .name = NULL}},
- .outputs = (AVFilterPad[]) {{ .name = "default",
+ .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}},
.process_command = command,