[SCM] Mumudvb packaging branch, upstream, updated. 24c2efb080b56abb8e7be67bae30ba7fe457759e

Brice DUBOST braice at braice.net
Sat Nov 1 13:31:04 UTC 2008


The following commit has been merged in the upstream branch:
commit f388ac36e213a80e39a362c64234ad5725b3f784
Author: Brice DUBOST <braice at braice.net>
Date:   Sun Sep 21 20:41:29 2008 +0200

    Sap announces working
    
     * Added sap_interval
     * Doc update
     * Sap announces when autoconfiguration=2 is set
     * Sap packet size checking

diff --git a/Changelog b/Changelog
index decc85c..0105acd 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,13 @@
+-- Mumudvb 1.5.2 --
+
+New features : 
+
+ * Generation of sap announces (beta)
+
+Bugs corrected : 
+ * Segfault when the directory /var/run/mumudvb doesn't exist
+ * Gcc 4.2 issues when using pat rewriting or autoconfiguration
+
 -- Mumudvb 1.5 --
 
 This is a test version for autoconf and cam support
diff --git a/README b/README
index 9bf9ae4..29c6c9b 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-mumudvb v1.5 - README
+mumudvb v1.5.2 - README
 
 Website :
 http://mumudvb.braice.net
@@ -32,6 +32,7 @@ Special thanks to Dave CHAPMAN (dvbstream author)
  * The program can rewrite the PAT Pid in order to announce only present channels (useful for some set-top boxes)
  * Experimental support for scrambled channels
  * Support for autoconfiguration, see further
+ * Generation of SAP announces
 
 == Detailled feature list ==
 
@@ -182,7 +183,9 @@ autoconfiguration=2
 
 The channels will be streamed over the multicasts ip adresses 239.100.c.n where c is the card number (0 by default) and n is the channel number.
 
-If you donÃt use the common_port directive, mumudvb will use the port 1234.
+If you don't use the common_port directive, mumudvb will use the port 1234.
+
+By default sap announces are activated if you use this autoconfiguration mode. To desactivate them put "sap=0" after the autoconfiguration=2 line.
 
 == Simple autoconfiguration ==
 
@@ -199,3 +202,13 @@ And you have to add "autoconfiguration=1" in the head of your config file.
 Mumudvb will find the audio, video, teletext, subtitling and ac3 pids for you before streaming.
 
 Note : if you put more than one pid for a channel, mumudvb will desactivate autoconfiguration for this channel.
+
+= Sap announces =
+
+The sap announces are made for the client to know wich channels are streamed.
+
+Vlc and most of the set top boxes are know to support them.
+
+Mumudvb will automatically generate and send sap announces if it's asked in the config file or if you are in full autoconfiguration mode.
+
+The sap announces will be only sent for alive channels. When a channel goes down, mumudvb will stop sending announces for this channel, until it goes back.
diff --git a/README-fr b/README-fr
index 3157d68..0bd8aa0 100644
--- a/README-fr
+++ b/README-fr
@@ -1,4 +1,4 @@
-mumudvb v1.5 - README
+mumudvb v1.5.2 - README
 
 = Site =
 Site principal de mumudvb http://mumudvb.braice.net
@@ -29,6 +29,7 @@ Dave CHAPMAN pour avoir 
  * Mumudvb est capable de réécrire à la volée le pid PAT pour n'annoncer que les flux réelement présents (utile pour les set-top boxes).
  * Support expérimental des chaines cryptées
  * Mumudvb est capable de trouver les chaines présentent dans le flux
+ * Génération automatique des annonces SAP
 
 == Liste détaillée des fonctionalités ==
 
@@ -180,6 +181,8 @@ Les cha
 
 Si vous n'utilisez pas la directive common_port, mumudvb utilisera le port 1234.
 
+Par défaut les annonces sap sont générées automatiquement si vous utilisez ce mode d'autoconfiguration. Pour les désactiver ajoutez une ligne "sap=0" apres la ligne autoconfiguration=2.
+
 == Autoconfiguration "simple" ==
 
 Utilisez ce mode lorsque vous voulez controller le nom des chaînes, leurs ip et quelles chaines vous voulez diffuser
@@ -195,3 +198,15 @@ Et vous avez a ajouter "autoconfiguration=1" au d
 Mumudvb trouvera les autres PIDs de chaque chaîne (Audio, Vidéo, Sous-titres, Télétexte et AC3) avant de les diffuser.
 
 Note : si vous précisez plus d'un PID pour une chaine, mumudvb désactivera l'autoconfiguration pour cette chaîne.
+
+= Sap announces =
+
+A traduire ...
+
+The sap announces are made for the client to know wich channels are streamed.
+
+Vlc and most of the set top boxes are know to support them.
+
+Mumudvb will automatically generate and send sap announces if it's asked in the config file or if you are in full autoconfiguration mode.
+
+The sap announces will be only sent for alive channels. When a channel goes down, mumudvb will stop sending announces for this channel, until it goes back.
\ No newline at end of file
diff --git a/doc/README_CONF b/doc/README_CONF
index f8063e8..aff8e26 100644
--- a/doc/README_CONF
+++ b/doc/README_CONF
@@ -18,6 +18,9 @@ All parameters are like: name=value
 ||cam_support                    ||specify if we wants the support for scrambled channels ||
 ||cam_number                     ||the number of the CAM we want to use (default 0) ||
 ||autoconfiguration              ||autoconfiguration 1: find audio and video, 2: full autoconfiguration, see README ||
+||sap                            ||generation of sap announces : 0 no, 1 yes ||
+||sap_organisation               ||Organisation sent in the sap announces (optionnal, default : mumudvb) ||
+||sap_interval                   ||Interval in seconds between sap announces (optionnal, default : 5) ||
 ||freq                           ||transponder's frequency in MHz ||
 ||pol                            ||transponder's polarisation (a char) v or h (not case sensitive) ||
 ||srate                          ||transponder's strate ||
diff --git a/doc/README_CONF-fr b/doc/README_CONF-fr
index 3ad8d15..9aae91a 100644
--- a/doc/README_CONF-fr
+++ b/doc/README_CONF-fr
@@ -18,6 +18,9 @@ Tous les param
 ||cam_support                    ||Spécifie si l'on veut le support pour les chaines cryptées ||
 ||cam_number                     ||Le numéro du module cam (défaut : 0) ||
 ||autoconfiguration              ||autoconfiguration 1: trouve les pids audio et video, 2: autoconfiguration complete, voir README-fr ||
+||sap                            ||Génération des annonces sap : 0 non, 1 oui ||
+||sap_organisation               ||Organisation précisée dans les annonces sap (optionel, défaut : mumudvb) ||
+||sap_interval                   ||Intervale en secondes entre les annonces sap (optionel, defaut : 5) ||
 ||freq                           ||la fréquence du transpondeur en MHz ||
 ||pol                            ||la polarisation (un caractère) v ou h (insensible à la casse) ||
 ||srate                          ||le srate du transpondeur ||
diff --git a/src/mumudvb.c b/src/mumudvb.c
index 6a70043..e3a0dfe 100644
--- a/src/mumudvb.c
+++ b/src/mumudvb.c
@@ -86,6 +86,7 @@ int  write_streamed_channels=1;
 //sap announces
 mumudvb_sap_message_t sap_messages[MAX_CHANNELS]; //the sap message... //TODO : allocate dynamically
 int sap=0; //do we send sap announces ?
+int sap_interval=SAP_DEFAULT_INTERVAL;
 
 //autoconfiguration
 int autoconfiguration = 0;           //Do we use autoconfiguration ?
@@ -372,31 +373,34 @@ main (int argc, char **argv)
 	{
 	  substring = strtok (NULL, delimiteurs);
 	  autoconfiguration = atoi (substring);
-	  if(autoconfiguration)
+	  if((autoconfiguration==1)||(autoconfiguration==2))
 	    {
 	      log_message( MSG_WARN,
 			"!!! You have enabled the support for autoconfiguration, this is a beta feature.Please report any bug/comment\n");
 	    }
+	  else
+	    autoconfiguration=0;
+	  if(autoconfiguration==2)
+	    {
+	      log_message( MSG_INFO,
+			"Full autoconfiguration, we activate SAP announces. if you want to desactivate them see the README.\n");
+	      sap=1;
+	    }
 	}
       else if (!strcmp (substring, "sap"))
 	{
 	  substring = strtok (NULL, delimiteurs);
 	  sap = atoi (substring);
-	  if(autoconfiguration)
+	  if(sap)
 	    {
 	      log_message( MSG_WARN,
-			"!!! You have enabled the support for autoconfiguration, this is a beta feature.Please report any bug/comment\n");
+			"!!! You have enabled the support for sap announces, this is a beta feature.Please report any bug/comment\n");
 	    }
 	}
-      else if (!strcmp (substring, "sap"))
+      else if (!strcmp (substring, "sap_interval"))
 	{
 	  substring = strtok (NULL, delimiteurs);
-	  sap = atoi (substring);
-	  if(autoconfiguration)
-	    {
-	      log_message( MSG_WARN,
-			"!!! You have enabled the support for autoconfiguration, this is a beta feature.Please report any bug/comment\n");
-	    }
+	  sap_interval = atoi (substring);
 	}
       else if (!strcmp (substring, "sap_organisation"))
 	{
@@ -1360,9 +1364,9 @@ SignalHandler (int signum)
 		{
 		  sap_update(channels[curr_channel], &sap_messages[curr_channel]);
 		}
-	      sap_last_time_sent=now-SAP_INTERVAL-1;
+	      sap_last_time_sent=now-sap_interval-1;
 	    }
-	  if((now-sap_last_time_sent)>=SAP_INTERVAL)
+	  if((now-sap_last_time_sent)>=sap_interval)
 	    {
 	      sap_send(sap_messages, number_of_channels);
 	      sap_last_time_sent=now;
diff --git a/src/mumudvb.h b/src/mumudvb.h
index badea7b..2a61848 100644
--- a/src/mumudvb.h
+++ b/src/mumudvb.h
@@ -28,7 +28,7 @@
 #ifndef _MUMUDVB_H
 #define _MUMUDVB_H
 
-#define VERSION "1.5.0"
+#define VERSION "1.5.2"
 
 //#include "ts.h"
 #include "udp.h"  //for the sockaddr
diff --git a/src/sap.c b/src/sap.c
index 2dd83ea..27add15 100644
--- a/src/sap.c
+++ b/src/sap.c
@@ -31,13 +31,6 @@
 #include <string.h>
 
 
-//SAP_init : define the version (rand 1,4242), clear the message and open the socket
-int sap_init(mumudvb_sap_message_t *sap_messages, int num_messages)
-{
-
-  return 0;
-}
-
 //SAP_send : send the sap message
 void sap_send(mumudvb_sap_message_t *sap_messages, int num_messages)
 {
@@ -108,71 +101,61 @@ int sap_add_program(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_messag
   if(!channel.streamed_channel_old)
     return 1;
 
-  //Now we write the sdp part
+  //Now we write the sdp part, in two times to avoid heavy code
 
   //version
   //v=0
 
-  sprintf(temp_string,"v=0\r\n");
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-  
   //owner/creator and session identifier
   //o=username session_id version network_type address_type address
   //ex : o=mumudvb 123134 1 IN IP4 235.255.215.1
-  //TODO find a way to create session id
   //for version we'll use sap version
   //o=....
 
-  sprintf(temp_string,"o=%s %d %d IN IP4 %s\r\n", sap_organisation, sap_serial, sap_message->version, channel.ipOut);
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-
   //session name (basically channel name)
   //s=...
-  sprintf(temp_string,"s=TEST%s\r\n", channel.name); //TODO : remove TEST
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-
 
   //connection information
   //Ex : c=IN IP4 235.214.225.1/2
   // the / is the TTL
   //c=...
 
-  sprintf(temp_string,"o=%s/%d\r\n", channel.ipOut, DEFAULT_TTL);
+  sprintf(temp_string,"v=0\r\no=%s %d %d IN IP4 %s\r\ns=%s\r\no=%s/%d\r\n", 
+	  sap_organisation, sap_serial, sap_message->version, channel.ipOut,
+	  channel.name, 
+	  channel.ipOut, DEFAULT_TTL);
+  if( (sap_message->len+payload_len+strlen(temp_string))>1024)
+    {
+      log_message(MSG_WARN,"Warning : SAP message too long for channel %s\n",channel.name);
+      return 1;
+    }
   memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
   payload_len+=strlen(temp_string);
 
+
   //time session is active
   //t=...
   //permanent : t=0 0
 
-  sprintf(temp_string,"t=0 0\r\n");
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-
   //attributes : group and co, we'll take the minisapserver ones
   //a=...
   //a=tool:mumudvb-VERSION
   //a=type:broadcast
   //a=x-plgroup: //channel's group
 
-  sprintf(temp_string,"a=tool:mumudvb-%s\r\n", VERSION);
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-
-  sprintf(temp_string,"a=type:broadcast\r\n");
-  memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
-  payload_len+=strlen(temp_string);
-
   //media name and transport address
   //m=...
   //m=video channel_port udp mpeg
 
-  sprintf(temp_string,"m=video %d udp mpeg\r\n", channel.portOut);
+  sprintf(temp_string,"t=0 0\r\na=tool:mumudvb-%s\r\na=type:broadcast\r\nm=video %d udp mpeg\r\n", VERSION, channel.portOut);
+  if( (sap_message->len+payload_len+strlen(temp_string))>1024)
+    {
+      log_message(MSG_WARN,"Warning : SAP message too long for channel %s\n",channel.name);
+      return 1;
+    }
   memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, strlen(temp_string));
   payload_len+=strlen(temp_string);
+
   
   log_message(MSG_DEBUG,"DEBUG : SAP payload\n");
   log_message(MSG_DEBUG, &sap_message->buf[sap_message->len]);
@@ -180,8 +163,6 @@ int sap_add_program(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_messag
 
   sap_message->len+=payload_len;
 
-  //TODO : check packet size
-
   return 0;
 
 }
diff --git a/src/sap.h b/src/sap.h
index 3ad88c7..f1800d4 100644
--- a/src/sap.h
+++ b/src/sap.h
@@ -38,7 +38,7 @@
 #define SAP_TTL 255 
 
 //intervall between sap announces
-#define SAP_INTERVAL 5
+#define SAP_DEFAULT_INTERVAL 5
 
 #define SAP_HEADER 0x20 //00100000 : version 1 and nothing else
 #define SAP_HEADER2 0x00 //No auth header

-- 
Mumudvb packaging



More information about the pkg-vdr-dvb-changes mailing list