add per stream stats
This commit is contained in:
parent
f67adcf3d7
commit
b2dbbf9daf
4 changed files with 8 additions and 0 deletions
2
pes.c
2
pes.c
|
@ -82,6 +82,8 @@ pes_packet_input(th_transport_t *t, th_stream_t *st, uint8_t *buf, size_t len)
|
||||||
th_pkt_t *pkt;
|
th_pkt_t *pkt;
|
||||||
AVRational mpeg_tc = {1, 90000};
|
AVRational mpeg_tc = {1, 90000};
|
||||||
|
|
||||||
|
avgstat_add(&st->st_rate, len, dispatch_clock);
|
||||||
|
|
||||||
hdr = getu8(buf, len);
|
hdr = getu8(buf, len);
|
||||||
flags = getu8(buf, len);
|
flags = getu8(buf, len);
|
||||||
hlen = getu8(buf, len);
|
hlen = getu8(buf, len);
|
||||||
|
|
|
@ -374,5 +374,7 @@ transport_add_stream(th_transport_t *t, int pid, tv_streamtype_t type)
|
||||||
TAILQ_INIT(&st->st_durationq);
|
TAILQ_INIT(&st->st_durationq);
|
||||||
TAILQ_INIT(&st->st_pktq);
|
TAILQ_INIT(&st->st_pktq);
|
||||||
|
|
||||||
|
avgstat_init(&st->st_rate, 10);
|
||||||
|
avgstat_init(&st->st_cc_errors, 10);
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,7 @@ ts_recv_packet(th_transport_t *t, int pid, uint8_t *tsb)
|
||||||
if(st->st_cc_valid && cc != st->st_cc) {
|
if(st->st_cc_valid && cc != st->st_cc) {
|
||||||
/* Incorrect CC */
|
/* Incorrect CC */
|
||||||
avgstat_add(&t->tht_cc_errors, 1, dispatch_clock);
|
avgstat_add(&t->tht_cc_errors, 1, dispatch_clock);
|
||||||
|
avgstat_add(&st->st_cc_errors, 1, dispatch_clock);
|
||||||
err = 1;
|
err = 1;
|
||||||
}
|
}
|
||||||
st->st_cc_valid = 1;
|
st->st_cc_valid = 1;
|
||||||
|
|
3
tvhead.h
3
tvhead.h
|
@ -247,6 +247,9 @@ typedef struct th_stream {
|
||||||
uint8_t st_cc; /* Last CC */
|
uint8_t st_cc; /* Last CC */
|
||||||
uint8_t st_cc_valid; /* Is CC valid at all? */
|
uint8_t st_cc_valid; /* Is CC valid at all? */
|
||||||
|
|
||||||
|
avgstat_t st_cc_errors;
|
||||||
|
avgstat_t st_rate;
|
||||||
|
|
||||||
tv_streamtype_t st_type;
|
tv_streamtype_t st_type;
|
||||||
int st_demuxer_fd;
|
int st_demuxer_fd;
|
||||||
int st_index;
|
int st_index;
|
||||||
|
|
Loading…
Add table
Reference in a new issue