diff --git a/src/htsp_server.c b/src/htsp_server.c index c1ccc3b9..b84768e0 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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 */ diff --git a/src/main.c b/src/main.c index acc757d8..43459ad7 100644 --- a/src/main.c +++ b/src/main.c @@ -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) { diff --git a/src/tvheadend.h b/src/tvheadend.h index 0ceb242c..eb317b9c 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -36,6 +36,7 @@ extern const char *tvheadend_version; extern char *tvheadend_cwd; +extern const char *tvheadend_capabilities[]; #define PTS_UNSET INT64_C(0x8000000000000000)