expose keyframe flag

This commit is contained in:
Devaev Maxim
2021-02-03 05:39:18 +03:00
parent 5cfb3b1e60
commit a165ff4523
7 changed files with 19 additions and 5 deletions

View File

@@ -213,6 +213,8 @@ static int _dump_sink(const char *sink_name, unsigned sink_timeout, _output_cont
unsigned fps_accum = 0;
long long fps_second = 0;
long double last = 0;
while (!global_stop) {
int error = memsink_client_get(sink, frame);
if (error == 0) {
@@ -220,11 +222,12 @@ static int _dump_sink(const char *sink_name, unsigned sink_timeout, _output_cont
const long long now_second = floor_ms(now);
char fourcc_str[8];
LOG_VERBOSE("Frame: size=%zu, resolution=%ux%u, fourcc=%s, stride=%u, online=%d, latency=%.3Lf",
LOG_VERBOSE("Frame: size=%zu, res=%ux%u, fourcc=%s, stride=%u, online=%d, key=%d, latency=%.3Lf, diff=%.3Lf",
frame->used, frame->width, frame->height,
fourcc_to_string(frame->format, fourcc_str, 8),
frame->stride, frame->online,
now - frame->grab_ts);
frame->stride, frame->online, frame->key,
now - frame->grab_ts, (last ? now - last : 0));
last = now;
LOG_DEBUG(" grab_ts=%.3Lf, encode_begin_ts=%.3Lf, encode_end_ts=%.3Lf",
frame->grab_ts, frame->encode_begin_ts, frame->encode_end_ts);