[SCM] Mumudvb packaging branch, upstream, updated. 24c2efb080b56abb8e7be67bae30ba7fe457759e
Brice DUBOST
braice at braice.net
Sat Nov 1 13:31:03 UTC 2008
The following commit has been merged in the upstream branch:
commit 2f110f45427e07cd5e9fb361a635c3b52e4ce31e
Author: Brice DUBOST <braice at braice.net>
Date: Sat Sep 20 21:24:34 2008 +0200
Revert "Generation of sap messages, no sending for the moment"
This reverts commit fb6621f3874c198cf784f398d5315f4ece9e0e43.
diff --git a/src/Makefile b/src/Makefile
index a6e4277..deee3c1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,7 @@ CFLAGS = -Wall -Wextra -O2
IFLAGS = -g root -o root
OUT = mumudvb
-OBJ_FILES = mumudvb.o tune.o udp.o dvb.o pat_rewrite.o cam.o cam_en50221.o log.o ts.o autoconf.o sap.o
+OBJ_FILES = mumudvb.o tune.o udp.o dvb.o pat_rewrite.o cam.o cam_en50221.o log.o ts.o autoconf.o
SRC_FILES = $(OBJ_FILES:.o=.c)
ifdef DESTDIR
diff --git a/src/mumudvb.c b/src/mumudvb.c
index 73b0734..a89b3e6 100644
--- a/src/mumudvb.c
+++ b/src/mumudvb.c
@@ -51,7 +51,8 @@
#include "ts.h"
#include "errors.h"
#include "autoconf.h"
-#include "sap.h"
+
+#define VERSION "1.5.0"
/* Signal handling code shamelessly copied from VDR by Klaus Schmidinger
@@ -81,9 +82,6 @@ char nom_fich_chaines_non_diff[256];
char nom_fich_pid[256];
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 ?
//autoconfiguration
int autoconfiguration = 0; //Do we use autoconfiguration ?
@@ -379,16 +377,6 @@ main (int argc, char **argv)
"!!! You have enabled the support for autoconfiguration, this is a beta feature.Please report any bug/comment\n");
}
}
- else if (!strcmp (substring, "sap"))
- {
- 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");
- }
- }
else if (!strcmp (substring, "freq"))
{
substring = strtok (NULL, delimiteurs);
@@ -1329,12 +1317,6 @@ SignalHandler (int signum)
//end of autoconfiguration
else //we are not doing autoconfiguration we can do something else
{
- //sap announces
- //TODO : update only when it's needed
- if(sap)
- sap_update(channels[0], &sap_messages[0]);
- //end of sap announces
-
for (curr_channel = 0; curr_channel < number_of_channels; curr_channel++)
if ((channels[curr_channel].streamed_channel >= 100) && (!channels[curr_channel].streamed_channel_old))
{
diff --git a/src/mumudvb.h b/src/mumudvb.h
index badea7b..df98825 100644
--- a/src/mumudvb.h
+++ b/src/mumudvb.h
@@ -28,8 +28,6 @@
#ifndef _MUMUDVB_H
#define _MUMUDVB_H
-#define VERSION "1.5.0"
-
//#include "ts.h"
#include "udp.h" //for the sockaddr
diff --git a/src/sap.c b/src/sap.c
deleted file mode 100644
index 843db1d..0000000
--- a/src/sap.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * mumudvb - UDP-ize a DVB transport stream.
- * File for Session Announcement Protocol Announces
- *
- * (C) Brice DUBOST
- *
- * The latest version can be found at http://mumudvb.braice.net
- *
- * Parts of this code is from the VLC project, modified for mumudvb
- * by Brice DUBOST
- *
- * Copyright notice:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "sap.h"
-#include "udp.h"
-#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)
-{
-
- return;
-}
-
-
-//SAP_update : update the contents of the sap message
-int sap_update(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_message)
-{
- //TAILLE DU PAQUET < MTU
- //TODO : add debug messages
-
- //This function is called when the channel changes so it increases the version and update the packet
- char temp_string[256];
-
- sap_message->version++;
- sap_message->buf[0]=SAP_HEADER;
- sap_message->buf[1]=SAP_HEADER2;
- sap_message->buf[2]=(sap_message->version&0xff00)>>8;
- sap_message->buf[3]=sap_message->version&0xff;
-
- //TODO TODO //sap_message->buf[4 5 6 7]= IP;
- sap_message->buf[4]=0;
- sap_message->buf[5]=0;
- sap_message->buf[6]=0;
- sap_message->buf[7]=0;
-
-
- //the mime type
- sprintf(temp_string,"application/sdp");
- memcpy(sap_message->buf + 8, temp_string, sizeof(temp_string));
- sap_message->len=8+sizeof(temp_string);
-
- //boucle sur les chaines
-
- // one program per message
- if(!sap_add_program(channel, sap_message))
- sap_message->to_be_sent=1;
- else
- sap_message->to_be_sent=0;
-
- return 0;
-
-}
-
-int sap_add_program(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_message)
-{
-
- //See RFC 2327
- int payload_len=0;
-
- char temp_string[256];
-
-
- if(!channel.streamed_channel)
- return 1;
-
- //Now we write the sdp part
-
- //version
- //v=0
-
- sprintf(temp_string,"v=0\r\n");
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(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
- //find a way ta create session id
- //for version we'll use sap version
- //o=....
-
- sprintf(temp_string,"o=mumudvb %d %d IN IP4 %s\r\n", sap_message->version, sap_message->version, channel.ipOut);
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(temp_string);
-
- //session name (basically channel name)
- //s=...
- sprintf(temp_string,"s=%s\r\n", channel.name);
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(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);
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(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, sizeof(temp_string));
- payload_len+=sizeof(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-VERSION\r\n");
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(temp_string);
-
- sprintf(temp_string,"a=type:broadcast\r\n");
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(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);
- memcpy(sap_message->buf + sap_message->len + payload_len, temp_string, sizeof(temp_string));
- payload_len+=sizeof(temp_string);
-
- //TODO : display the message for debug
-
- log_message(MSG_DEBUG,"DEBUG : SAP payload\n");
- log_message(MSG_DEBUG,sap_message->buf + sap_message->len);
- log_message(MSG_DEBUG,"DEBUG : end of SAP payload\n");
-
- sap_message->len+=payload_len;
-
- //TODO : check packet size
-
- return 0;
-
-}
diff --git a/src/sap.h b/src/sap.h
deleted file mode 100644
index 8011141..0000000
--- a/src/sap.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * mumudvb - UDP-ize a DVB transport stream.
- * File for Session Announcement Protocol Announces
- *
- * (C) Brice DUBOST
- *
- * The latest version can be found at http://mumudvb.braice.net
- *
- * Parts of this code is from the VLC project, modified for mumudvb
- * by Brice DUBOST
- *
- * Copyright notice:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-#ifndef _SAP_H
-#define _SAP_H
-
-#include "mumudvb.h"
-
-//From RFC 2974
-#define SAP_IP "224.2.127.254"
-#define SAP_PORT 9875
-#define SAP_TTL 255
-
-//intervall between sap announces
-#define SAP_INTERVAL 5
-
-#define SAP_HEADER 0x20 //00100000 : version 1 and nothing else
-#define SAP_HEADER2 0x00 //No auth header
-
-//sap_message
-typedef struct{
- unsigned char buf[MAX_UDP_SIZE]; //the buffer
- int len; //Lenght of the sap message
- int version; //the version of the sap message, MUST be changed when sap changes
- int to_be_sent;
-}mumudvb_sap_message_t;
-
-
-int sap_update(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_message);
-int sap_add_program(mumudvb_channel_t channel, mumudvb_sap_message_t *sap_message);
-
-#endif
--
Mumudvb packaging
More information about the pkg-vdr-dvb-changes
mailing list