mpegts: add selective notifications

I still think too much data is sent in many instances. Often the same
info is sent over and over (particulary where the number of mux/svc per
network/mux increase).
This commit is contained in:
Adam Sutton 2013-07-09 15:26:50 +01:00
parent f6eb21be9a
commit 35b30871bd
6 changed files with 23 additions and 7 deletions

View file

@ -892,6 +892,7 @@ dvb_sdt_callback
/* Save details */
if (save) {
idnode_notify(NULL, &s->s_id, 0, NULL);
s->s_config_save((service_t*)s);
service_refresh_channel((service_t*)s);
}

View file

@ -565,7 +565,7 @@ linuxdvb_satconf_create0
ls->ls_lnb = linuxdvb_lnb_create0(NULL, NULL, ls);
/* Notification */
idnode_notify("linuxdvb_satconf", &ls->mi_id, 0);
idnode_notify("linuxdvb_satconf", &ls->mi_id, 0, NULL);
return ls;
}

View file

@ -445,6 +445,8 @@ mpegts_mux_create0
mpegts_network_t *mn, uint16_t onid, uint16_t tsid, htsmsg_t *conf )
{
char buf[256];
static htsmsg_t *inc = NULL;
idnode_insert(&mm->mm_id, uuid, class);
/* Enabled by default */
@ -485,8 +487,12 @@ mpegts_mux_create0
tvhtrace("mpegts", "%s - created", buf);
/* Notification */
idnode_notify("mpegts_mux", &mm->mm_id, 0);
idnode_notify(NULL, &mn->mn_id, 0);
idnode_notify("mpegts_mux", &mm->mm_id, 0, NULL);
if (!inc) {
inc = htsmsg_create_map();
htsmsg_set_u32(inc, "num_mux", 1);
}
idnode_notify(NULL, &mn->mn_id, 0, inc);
return mm;
}
@ -507,6 +513,7 @@ mpegts_mux_set_onid ( mpegts_mux_t *mm, uint16_t onid )
mm->mm_display_name(mm, buf, sizeof(buf));
mm->mm_config_save(mm);
tvhtrace("mpegts", "%s - set onid %04X (%d)", buf, onid, onid);
//idnode_notify(NULL, &mm->mm_id, 0, NULL);
return 1;
}
@ -520,6 +527,7 @@ mpegts_mux_set_tsid ( mpegts_mux_t *mm, uint16_t tsid )
mm->mm_display_name(mm, buf, sizeof(buf));
mm->mm_config_save(mm);
tvhtrace("mpegts", "%s - set tsid %04X (%d)", buf, tsid, tsid);
//idnode_notify(NULL, &mm->mm_id, 0, NULL);
return 1;
}
@ -533,6 +541,7 @@ mpegts_mux_set_crid_authority ( mpegts_mux_t *mm, const char *defauth )
mm->mm_display_name(mm, buf, sizeof(buf));
mm->mm_config_save(mm);
tvhtrace("mpegts", "%s - set crid authority %s", buf, defauth);
//idnode_notify(NULL, &mm->mm_id, 0, NULL);
return 1;
}

View file

@ -224,7 +224,7 @@ mpegts_network_create0
tvhtrace("mpegts", "created network %s", buf);
/* Notification */
idnode_notify("mpegts_network", &mn->mn_id, 0);
idnode_notify("mpegts_network", &mn->mn_id, 0, NULL);
return mn;
}

View file

@ -298,6 +298,7 @@ mpegts_service_create0
mpegts_mux_t *mm, uint16_t sid, uint16_t pmt_pid, htsmsg_t *conf )
{
char buf[256];
static htsmsg_t *inc = NULL;
service_create0((service_t*)s, class, uuid, S_MPEG_TS, conf);
/* Create */
@ -326,8 +327,13 @@ mpegts_service_create0
tvhlog(LOG_DEBUG, "mpegts", "%s - add service %04X %s", buf, s->s_dvb_service_id, s->s_dvb_svcname);
/* Notification */
idnode_notify(NULL, &s->s_dvb_mux->mm_id, 0);
idnode_notify(NULL, &s->s_dvb_mux->mm_network->mn_id, 0);
if (!inc) {
inc = htsmsg_create_map();
htsmsg_set_u32(inc, "num_mux", 1);
htsmsg_set_u32(inc, "num_svc", 1);
}
idnode_notify(NULL, &s->s_dvb_mux->mm_id, 0, inc);
idnode_notify(NULL, &s->s_dvb_mux->mm_network->mn_id, 0, inc);
return s;
}

View file

@ -523,7 +523,7 @@ service_create0
service_load(t, conf);
/* Notify */
idnode_notify("service", &t->s_id, 0);
idnode_notify("service", &t->s_id, 0, NULL);
return t;
}