From bf1163a19667377a1861b38fa64a8cf7ee2d0e40 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 16:28:03 +0100 Subject: [PATCH] Instrument code with fps-meter X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM/Vb;]yA5\I~93>J<_`<4)A{':UrE Instrument code with fps-meter: http://git.ao2.it/experiments/fps-meter.git/ --- examples/am7xxx-play.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index 81aff84..4828a9d 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -35,6 +35,7 @@ #include #include +#include "fps-meter.h" static unsigned int run = 1; @@ -342,6 +343,7 @@ static int am7xxx_play(const char *input_format_string, int got_frame; int got_packet; int ret; + struct fps_meter_stats stats; ret = video_input_init(&input_ctx, input_format_string, input_path, input_options); if (ret < 0) { @@ -410,6 +412,8 @@ static int am7xxx_play(const char *input_format_string, goto cleanup_out_buf; } + fps_meter_init(&stats); + got_packet = 0; while (run) { /* read packet */ @@ -503,6 +507,7 @@ static int am7xxx_play(const char *input_format_string, run = 0; goto end_while; } + fps_meter_update(&stats); } end_while: if (!output_ctx.raw_output && got_packet) -- 2.16.2