]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add URL for RTSP streaming
authorAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 05:46:12 +0000 (05:46 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 05:46:12 +0000 (05:46 +0000)
ajaxui/ajaxui_channels.c

index 2ed6535659546bdd3464eafa19b5db6f0c59c655..bcd04e1dc1d39459a2580f6999cb881d04b65e5f 100644 (file)
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
 #include <pthread.h>
 #include <assert.h>
 #include <stdio.h>
@@ -23,6 +27,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+
 #include "tvhead.h"
 #include "http.h"
 #include "ajaxui.h"
@@ -131,6 +136,7 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
   th_channel_t *ch;
   th_channel_group_t *tcg;
   char dispname[20];
+  struct sockaddr_in *si;
 
   if(remain == NULL || (tcg = channel_group_by_tag(atoi(remain))) == NULL)
     return HTTP_STATUS_NOT_FOUND;
@@ -146,6 +152,8 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
 
     ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, dispname);
 
+    /* inner */
+
     tcp_qprintf(tq, 
                "<div style=\"width: 100%%; overflow: hidden; height:36px\">");
 
@@ -158,6 +166,17 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
                  ch->ch_icon);
     }
 
+    tcp_qprintf(tq, "</div>");
+
+    tcp_qprintf(tq, "<div style=\"float:left; text-align: right\">");
+
+    si = (struct sockaddr_in *)&hc->hc_tcp_session.tcp_self_addr;
+
+    tcp_qprintf(tq,
+               "<a href=\"rtsp://%s:%d/%s\">Stream</a>",
+               inet_ntoa(si->sin_addr), ntohs(si->sin_port),
+               ch->ch_sname);
+
     tcp_qprintf(tq, "</div>");
     tcp_qprintf(tq, "</div>");