]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add new capabilities field to determine what optional features are included.
authorAdam Sutton <dev@adamsutton.me.uk>
Wed, 19 Dec 2012 21:21:05 +0000 (21:21 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Wed, 19 Dec 2012 22:29:17 +0000 (22:29 +0000)
src/htsp_server.c
src/main.c
src/tvheadend.h

index c1ccc3b930e40b4cdbdf872fd08423574f2628b0..b84768e035067dc62207ce32967199b10e78230e 100644 (file)
@@ -672,6 +672,7 @@ htsp_method_hello(htsp_connection_t *htsp, htsmsg_t *in)
   htsmsg_t *l, *r = htsmsg_create_map();
   uint32_t v;
   const char *name;
+  int i = 0;
 
   if(htsmsg_get_u32(in, "htspversion", &v))
     return htsp_error("Missing argument 'htspversion'");
@@ -691,6 +692,10 @@ htsp_method_hello(htsp_connection_t *htsp, htsmsg_t *in)
 
   /* Capabilities */
   l = htsmsg_create_list();
+  while (tvheadend_capabilities[i]) {
+    htsmsg_add_str(l, NULL, tvheadend_capabilities[i]);
+    i++;
+  }
   htsmsg_add_msg(r, "servercapability", l);
 
   /* Set version to lowest num */
index acc757d8bb65053e7117c89fc2a2451c88628e7b..43459ad7c368cef29897b5b7fbf97568219076b2 100644 (file)
@@ -78,6 +78,19 @@ int htsp_port;
 int htsp_port_extra;
 char *tvheadend_cwd;
 
+const char *tvheadend_capabilities[] = {
+#if ENABLE_CWC
+  "cwc",
+#endif
+#if ENABLE_V4L
+  "v4l",
+#endif
+#if ENABLE_LINUXDVB
+  "linuxdvb",
+#endif
+  NULL
+};
+
 static void
 handle_sigpipe(int x)
 {
index 0ceb242c66f6932e06839bad8401466cda2c415a..eb317b9cc3e2e4153f0c1433e1dad5a8969d4305 100644 (file)
@@ -36,6 +36,7 @@
 
 extern const char *tvheadend_version;
 extern char *tvheadend_cwd;
+extern const char *tvheadend_capabilities[];
 
 #define PTS_UNSET INT64_C(0x8000000000000000)