History

vf_drawtext: Add pkt_pos, pkt_duration, pkt_size as variables

Changes to vf_drawtext.c written by Calvin Walton <calvin.walton@kepstin.ca> Changes to filters.texi written by greg Luce <electron.rotoscope@gmail.com> with lots of help from Moritz Barsnick and Gyan Fixes #7947.

Calvin Walton committed 7 years ago

Commit 2bd21b91 parent b7b6ddd3 files · +22 −1Browse files

Showing the changes to libavfilter (2 of 3 files). Show all

Unified · Split

2 files
  1. libavfilter/version.h +2 −1
  2. libavfilter/vf_drawtext.c +9 −0
libavfilter/version.h+2−1
@@ -31,7 +31,8 @@ · 30 unmodified lines
3131
3232 #define LIBAVFILTER_VERSION_MAJOR 7
3333 #define LIBAVFILTER_VERSION_MINOR 56
34−#define LIBAVFILTER_VERSION_MICRO 100
34+#define LIBAVFILTER_VERSION_MICRO 101
35+
3536
3637 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3738 LIBAVFILTER_VERSION_MINOR, \
libavfilter/vf_drawtext.c+9−0
@@ -88,6 +88,9 @@ static const char *const var_names[] = { · 87 unmodified lines
8888 "x",
8989 "y",
9090 "pict_type",
91+ "pkt_pos",
92+ "pkt_duration",
93+ "pkt_size",
9194 NULL
9295 };
9396
@@ -125,6 +128,9 @@ enum var_name { · 31 unmodified lines
125128 VAR_X,
126129 VAR_Y,
127130 VAR_PICT_TYPE,
131+ VAR_PKT_POS,
132+ VAR_PKT_DURATION,
133+ VAR_PKT_SIZE,
128134 VAR_VARS_NB
129135 };
130136
@@ -1516,6 +1522,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 1385 unmodified lines
15161522 NAN : frame->pts * av_q2d(inlink->time_base);
15171523
15181524 s->var_values[VAR_PICT_TYPE] = frame->pict_type;
1525+ s->var_values[VAR_PKT_POS] = frame->pkt_pos;
1526+ s->var_values[VAR_PKT_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base);
1527+ s->var_values[VAR_PKT_SIZE] = frame->pkt_size;
15191528 s->metadata = frame->metadata;
15201529
15211530 draw_text(ctx, frame, frame->width, frame->height);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t