Feature #4934
closedSAT>IP: Print list of PIDs used in the SUBSCRIPTION section of the UI
0%
Description
Hi Jaroslav,
Another interesting patch for improving the UI.
For a lot of time I need to know the pid list used by users (for SAT>IP debug). And in several environments the use of the Debug output it's a pain. So I prepared a new improvement for the UI.
This patch, adds the option for printing in the Subscription section the list of pids.
diff --git a/src/subscriptions.c b/src/subscriptions.c
index 0b30b2a..afea446 100644
--- a/src/subscriptions.c
+++ b/src/subscriptions.c
@@ -1015,6 +1015,7 @@ subscription_create_msg(th_subscription_t *s, const char *lang)
profile_t *pro;
char buf[284];
const char *state;
+ htsmsg_t *l;
htsmsg_add_u32(m, "id", s->ths_id);
htsmsg_add_u32(m, "start", s->ths_start);
@@ -1080,6 +1081,23 @@ subscription_create_msg(th_subscription_t *s, const char *lang)
} else if(s->ths_dvrfile != NULL)
htsmsg_add_str(m, "service", s->ths_dvrfile ?: "");
+#if ENABLE_MPEGTS
+ mpegts_service_t *ms = (mpegts_service_t *)s->ths_service;
+ mpegts_apids_t *pids;
+ if ((pids = ms->s_pids) != NULL) {
+ l = htsmsg_create_list();
+ if (pids->all) {
+ htsmsg_add_s32(l, NULL, 8192);
+ } else {
+ int i;
+ for (i = 0; i < pids->count; i++) {
+ htsmsg_add_s32(l, NULL, pids->pids[i].pid);
+ }
+ }
+ htsmsg_add_msg(m, "pids", l);
+ }
+#endif
+
htsmsg_add_u32(m, "in", atomic_get(&s->ths_bytes_in_avg));
htsmsg_add_u32(m, "out", atomic_get(&s->ths_bytes_out_avg));
htsmsg_add_s64(m, "total_in", atomic_get_u64(&s->ths_total_bytes_in));
diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js
index 0ac4b78..988934e 100644
--- a/src/webui/static/app/status.js
+++ b/src/webui/static/app/status.js
@@ -20,6 +20,7 @@ tvheadend.status_subs = function(panel, index)
r.data.channel = m.channel;
r.data.service = m.service;
r.data.state = m.state;
+ if (m.pids) r.data.pids = m.pids;
if (m.descramble) r.data.descramble = m.descramble;
if (m.profile) r.data.profile = m.profile;
r.data.errors = m.errors;
@@ -49,6 +50,7 @@ tvheadend.status_subs = function(panel, index)
{ name: 'service', sortType: stype },
{ name: 'profile', sortType: stype },
{ name: 'state', sortType: stype },
+ { name: 'pids' },
{ name: 'descramble', sortType: stype },
{ name: 'errors', sortType: stype },
{ name: 'in', sortType: stype },
@@ -115,7 +117,7 @@ tvheadend.status_subs = function(panel, index)
sortable: true
},
{
- width: 250,
+ width: 210,
id: 'service',
header: _("Service"),
dataIndex: 'service',
@@ -147,6 +149,22 @@ tvheadend.status_subs = function(panel, index)
sortable: true
},
{
+ width: 90,
+ id: 'pids',
+ header: _("PID list"),
+ dataIndex: 'pids',
+ sortable: false,
+ renderer: function(v) {
+ var r = [];
+ Ext.each(v, function(pid) {
+ r.push(pid);
+ });
+ if (r.length < 1) return "";
+ r.sort(function(a, b){return a-b});
+ return r.join(',');
+ }
+ },
+ {
width: 80,
id: 'descramble',
header: _("Descramble"),
I hope you agree and commit this patch! ;)
Regards!
Files
Updated by Mono Polimorph over 7 years ago
Hi,
No comments about this patch? (!)
Updated by Mono Polimorph over 7 years ago
Mono Polimorph wrote:
Hi,
No comments about this patch? (!)
Hi Jaroslav,
Another weak passed, and no comments.
Please, review this patch and think that I can't use GitHub. :(
This patch doesn't have any side effects. But it is very useful for helping in show errors when using the SAT>IP protocol, as you can view in the UI the pids used by clients. So you can compare it with the requests in the LOGs.
Please, commit it! I do a lot of effort in prerare patches for improving TVH. :)
Regards.
Updated by Pablo R. over 7 years ago
perexg said:
The implementation is not correct. The active pid list per service is managed in the mpegts input - mm->mm_pids, the service pointer is in owner fields (mpegts_pid_t). So, we need probably another callback in service_t which returns the htsmsg_t list and put this code to mpegts_service.c and/or mpegts_input.c. Also, s->ths_service might be NULL (there is already check for this).
I mean that the implementation is not correct for standard services - if we add such feature, the subscribed PIDs should be visible for all subscriptions (in my opinion - including the RAW services like epggrab).
Updated by Mono Polimorph about 7 years ago
Hi Jaroslav,
Any idea when we can see the used PIDs list in the UI?
Perhaps my patch isn't perfect. But, it's a great improvement to see inside the Web UI the list of pids used by each tuner in realtime.
Please, consider it.
Thank you!
Updated by Jaroslav Kysela about 7 years ago
- Status changed from New to Fixed
Implemented a bit differently in the master.
Updated by Mono Polimorph about 7 years ago
Jaroslav Kysela wrote:
Implemented a bit differently in the master.
Great! I'll try it.
Thank you Jaroslav!