summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-02-14 16:32:52 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-02-14 16:32:52 +0100
commit6892b833505808e76660ec4a2057d750e7943091 (patch)
tree28dacc684d57fdba33786db3b116b913cbce21a0 /src
parentee14eb83087923519817f5a664a746ae310a3931 (diff)
video: add statistics for source/disp frames
Diffstat (limited to 'src')
-rw-r--r--src/video.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/video.c b/src/video.c
index 8954e0a..5f55340 100644
--- a/src/video.c
+++ b/src/video.c
@@ -99,6 +99,11 @@ struct vtx {
int efps; /**< Estimated frame-rate */
uint32_t ts_min;
uint32_t ts_max;
+
+ /** Statistics */
+ struct {
+ uint64_t src_frames; /**< Total frames from vidsrc */
+ } stats;
};
@@ -138,6 +143,11 @@ struct vrx {
unsigned n_picup; /**< Picture updates sent */
uint32_t ts_min;
uint32_t ts_max;
+
+ /** Statistics */
+ struct {
+ uint64_t disp_frames; /** Total frames displayed */
+ } stats;
};
@@ -453,6 +463,8 @@ static void vidsrc_frame_handler(struct vidframe *frame, void *arg)
++vtx->frames;
+ ++vtx->stats.src_frames;
+
/* Is the video muted? If so insert video mute image */
if (vtx->muted)
frame = vtx->mute_frame;
@@ -636,6 +648,8 @@ static int video_stream_decode(struct vrx *vrx, const struct rtp_header *hdr,
err |= st->vf->dech(st, frame);
}
+ ++vrx->stats.disp_frames;
+
err = vidisp_display(vrx->vidisp, v->peer, frame);
frame_filt = mem_deref(frame_filt);
if (err == ENODEV) {
@@ -1308,10 +1322,12 @@ static int vtx_debug(struct re_printf *pf, const struct vtx *vtx)
err |= re_hprintf(pf, " tx: encode: %s %s\n",
vtx->vc ? vtx->vc->name : "none",
vtx->frame ? vidfmt_name(vtx->frame->fmt) : "?");
- err |= re_hprintf(pf, " source: %s %u x %u, fps=%d\n",
+ err |= re_hprintf(pf, " source: %s %u x %u, fps=%d"
+ " frames=%llu\n",
vtx->vsrc ? vidsrc_get(vtx->vsrc)->name : "none",
vtx->vsrc_size.w,
- vtx->vsrc_size.h, vtx->vsrc_prm.fps);
+ vtx->vsrc_size.h, vtx->vsrc_prm.fps,
+ vtx->stats.src_frames);
err |= re_hprintf(pf, " skipc=%u\n", vtx->skipc);
err |= re_hprintf(pf, " time = %.3f sec\n",
video_calc_seconds(vtx->ts_max - vtx->ts_min));
@@ -1327,9 +1343,10 @@ static int vrx_debug(struct re_printf *pf, const struct vrx *vrx)
err |= re_hprintf(pf, " rx: decode: %s %s\n",
vrx->vc ? vrx->vc->name : "none",
vidfmt_name(vrx->fmt));
- err |= re_hprintf(pf, " vidisp: %s %u x %u\n",
+ err |= re_hprintf(pf, " vidisp: %s %u x %u frames=%llu\n",
vrx->vidisp ? vidisp_get(vrx->vidisp)->name : "none",
- vrx->size.w, vrx->size.h);
+ vrx->size.w, vrx->size.h,
+ vrx->stats.disp_frames);
err |= re_hprintf(pf, " n_intra=%u, n_picup=%u\n",
vrx->n_intra, vrx->n_picup);
err |= re_hprintf(pf, " time = %.3f sec\n",