dvb: add adapter bandwidth to status page.
This commit is contained in:
parent
df9eeef371
commit
7a7835dc0a
5 changed files with 19 additions and 5 deletions
|
@ -265,6 +265,8 @@ typedef struct th_dvb_adapter {
|
|||
|
||||
int tda_rawmode;
|
||||
|
||||
int tda_bytes;
|
||||
|
||||
// Full mux streaming, protected via the delivery mutex
|
||||
|
||||
streaming_pad_t tda_streaming_pad;
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "service.h"
|
||||
#include "epggrab.h"
|
||||
#include "diseqc.h"
|
||||
#include "atomic.h"
|
||||
|
||||
struct th_dvb_adapter_queue dvb_adapters;
|
||||
struct th_dvb_mux_instance_tree dvb_muxes;
|
||||
|
@ -1063,6 +1064,7 @@ dvb_adapter_input_dvr(void *aux)
|
|||
}
|
||||
}
|
||||
r += c;
|
||||
atomic_add(&tda->tda_bytes, c);
|
||||
|
||||
/* not enough data */
|
||||
if (r < 188) continue;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "dvr/dvr.h"
|
||||
#include "service.h"
|
||||
#include "streaming.h"
|
||||
#include "atomic.h"
|
||||
|
||||
#include "epggrab.h"
|
||||
|
||||
|
@ -90,7 +91,7 @@ dvb_fe_monitor(void *aux)
|
|||
{
|
||||
th_dvb_adapter_t *tda = aux;
|
||||
fe_status_t fe_status;
|
||||
int status, v, vv, i, fec, q;
|
||||
int status, v, vv, i, fec, q, bw;
|
||||
th_dvb_mux_instance_t *tdmi = tda->tda_mux_current;
|
||||
char buf[50];
|
||||
signal_status_t sigstat;
|
||||
|
@ -218,6 +219,8 @@ dvb_fe_monitor(void *aux)
|
|||
}
|
||||
}
|
||||
|
||||
bw = atomic_exchange(&tda->tda_bytes, 0);
|
||||
|
||||
if(notify) {
|
||||
htsmsg_t *m = htsmsg_create_map();
|
||||
htsmsg_add_str(m, "id", tdmi->tdmi_identifier);
|
||||
|
@ -238,6 +241,7 @@ dvb_fe_monitor(void *aux)
|
|||
htsmsg_add_u32(m, "ber", tdmi->tdmi_ber);
|
||||
htsmsg_add_u32(m, "unc", tdmi->tdmi_unc);
|
||||
htsmsg_add_dbl(m, "uncavg", tdmi->tdmi_unc_avg);
|
||||
htsmsg_add_u32(m, "bw", bw);
|
||||
notify_by_msg("tvAdapter", m);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,6 +148,10 @@ tvheadend.status_adapters = function() {
|
|||
colored : true
|
||||
});
|
||||
|
||||
function renderBw(value) {
|
||||
return parseInt(value / 125);
|
||||
}
|
||||
|
||||
var cm = new Ext.grid.ColumnModel([{
|
||||
width : 50,
|
||||
header : "Name",
|
||||
|
@ -160,6 +164,11 @@ tvheadend.status_adapters = function() {
|
|||
width : 100,
|
||||
header : "Currently tuned to",
|
||||
dataIndex : 'currentMux'
|
||||
},{
|
||||
width : 100,
|
||||
header : "Bandwidth (kb/s)",
|
||||
dataIndex : 'bw',
|
||||
renderer: renderBw
|
||||
},{
|
||||
width : 50,
|
||||
header : "Bit error rate",
|
||||
|
@ -198,9 +207,6 @@ tvheadend.status_adapters = function() {
|
|||
return panel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tvheadend.status = function() {
|
||||
|
||||
var panel = new Ext.Panel({
|
||||
|
|
|
@ -7,7 +7,7 @@ tvheadend.tvAdapterStore = new Ext.data.JsonStore({
|
|||
fields : [ 'identifier', 'type', 'name', 'path', 'devicename',
|
||||
'hostconnection', 'currentMux', 'services', 'muxes', 'initialMuxes',
|
||||
'satConf', 'deliverySystem', 'freqMin', 'freqMax', 'freqStep',
|
||||
'symrateMin', 'symrateMax', 'signal', 'snr', 'ber', 'unc', 'uncavg'],
|
||||
'symrateMin', 'symrateMax', 'signal', 'snr', 'ber', 'unc', 'uncavg', 'bw'],
|
||||
url : 'tv/adapter'
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue