]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
show info about video4linux adapters
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 21 Nov 2007 21:38:46 +0000 (21:38 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 21 Nov 2007 21:38:46 +0000 (21:38 +0000)
htmlui.c
tvhead.h
v4l.c
v4l.h

index 352e9021669241ca988e05956997d29df7c74b67..895174500c7478ad00a16f105ca295650940bba2 100644 (file)
--- a/htmlui.c
+++ b/htmlui.c
@@ -36,6 +36,7 @@
 #include "pvr.h"
 #include "strtab.h"
 #include "dvb.h"
+#include "v4l.h"
 #include "iptv_input.h"
 
 static struct strtab recstatustxt[] = {
@@ -785,6 +786,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
   tcp_queue_t tq;
   int simple = is_client_simple(hc);
   th_dvb_adapter_t *tda;
+  th_v4l_adapter_t *tva;
   th_subscription_t *s;
   th_transport_t *t;
   th_dvb_mux_instance_t *tdmi;
@@ -807,7 +809,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
 
   box_top(&tq, "box");
   tcp_qprintf(&tq, "<div class=\"content\">");
-  tcp_qprintf(&tq, "<b><center>Input sources</b><br>");
+  tcp_qprintf(&tq, "<b><center>Input devices</b><br>");
   tcp_qprintf(&tq, "</div>");
   box_bottom(&tq);
   tcp_qprintf(&tq, "<br>");
@@ -816,7 +818,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
 
   box_top(&tq, "box");
   tcp_qprintf(&tq, "<div class=\"content\">");
-  tcp_qprintf(&tq, "<b>DVB source adapters</b><br>");
+  tcp_qprintf(&tq, "<b><center>DVB adapters</center></b>");
 
   if(LIST_FIRST(&dvb_adapters_running) == NULL) {
     tcp_qprintf(&tq, "No DVB adapters configured<br>");
@@ -884,7 +886,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
 
   box_top(&tq, "box");
   tcp_qprintf(&tq, "<div class=\"content\">");
-  tcp_qprintf(&tq, "<b>IPTV sources</b><br><br>");
+  tcp_qprintf(&tq, "<b><center>IPTV sources</center></b><br>");
 
   LIST_FOREACH(t, &all_transports, tht_global_link) {
     if(t->tht_type != TRANSPORT_IPTV)
@@ -898,9 +900,34 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
 
   tcp_qprintf(&tq, "</div>");
   box_bottom(&tq);
+  tcp_qprintf(&tq, "<br>");
+
+  /* Video4Linux adapters */
+
+  box_top(&tq, "box");
+  tcp_qprintf(&tq, "<div class=\"content\">");
+  tcp_qprintf(&tq, "<b><center>Video4Linux adapters</center></b>");
+
+  LIST_FOREACH(tva, &v4l_adapters, tva_link) {
+    tcp_qprintf(&tq, "<br><b>%s</b><br>",
+               tva->tva_path);
+
+    if(tva->tva_dispatch_handle == NULL) {
+      tcp_qprintf(&tq, "Not currently active<br>");
+    } else {
+      tcp_qprintf(&tq, "Tuned to %.3f MHz<br>",
+                 (float)tva->tva_frequency/1000000.0);
+    }
+  }
 
   tcp_qprintf(&tq, "</div>");
+  box_bottom(&tq);
+  tcp_qprintf(&tq, "</div>");
+
   
+
+
+
   /* Active transports */
 
   tcp_qprintf(&tq, "<div class=\"statuscont\">");
@@ -941,7 +968,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
 
     case TRANSPORT_V4L:
       t1 = tmptxt;
-      snprintf(tmptxt, sizeof(tmptxt), "V4L: %.2f MHz",
+      snprintf(tmptxt, sizeof(tmptxt), "V4L: %.3f MHz",
               (float)t->tht_v4l_frequency / 1000000.0f);
       t2 = t->tht_v4l_adapter->tva_path;
       break;
index 01940849f7c25c919b4fc4ab2455a2adb053fdba..ba13a2de827798ed10a777b7cb8475cb196931aa 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -103,7 +103,6 @@ typedef struct th_v4l_adapter {
   struct th_transport_list tva_transports;
 
   int tva_frequency;
-  int tva_running;
 
   pthread_cond_t tva_run_cond;
 
diff --git a/v4l.c b/v4l.c
index 8f156906faba25147fe6aabca0bec6f4e19d9559..8044bc6c29d950ab2ab3776e9c6038f1afc677c0 100644 (file)
--- a/v4l.c
+++ b/v4l.c
@@ -45,7 +45,7 @@
 #include "transports.h"
 #include "pes.h"
 
-static struct th_v4l_adapter_list v4l_adapters;
+struct th_v4l_adapter_list v4l_adapters;
 
 static void v4l_fd_callback(int events, void *opaque, int fd);
 
diff --git a/v4l.h b/v4l.h
index bee92bf2544e2ccb3cf6d4c7e5602152adfbbb16..2d6b4647f07becee91f1558bea91790aa5b039cd 100644 (file)
--- a/v4l.h
+++ b/v4l.h
@@ -19,6 +19,8 @@
 #ifndef V4L_H_
 #define V4L_H_
 
+extern struct th_v4l_adapter_list v4l_adapters;
+
 void v4l_init(void);
 
 int v4l_configure_transport(th_transport_t *t, const char *muxname,