Commit 5a790acc authored by Benjamin Pracht's avatar Benjamin Pracht

* Little cleanup of sap announces :

- use net_* functions
- use vlc_UrlParse function

change sap_session_t structure  : it now includes the  sdp packet, which
isn't regenerated each time it is sent.

parent d5d59ea9
This diff is collapsed.
......@@ -2,7 +2,7 @@
* announce.h : Session announcement
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: announce.h,v 1.1 2003/08/14 20:02:55 zorglub Exp $
* $Id$
*
* Authors: Clment Stenac <zorglub@via.ecp.fr>
*
......@@ -53,9 +53,7 @@
*****************************************************************************/
struct sap_session_t
{
char psz_url[256];
char psz_name[1024];
char psz_port[8];
char * psz_sdp;
module_t p_network;
unsigned int i_socket;
unsigned int i_calls;
......@@ -77,14 +75,15 @@ typedef struct slp_session_t slp_session_t;
/*****************************************************************************
* Prototypes
*****************************************************************************/
char * SDPGenerateUDP(char * ,char *);
sap_session_t * sout_SAPNew (sout_instance_t *,
char *, char* , int, char *);
char* , int, char *);
void sout_SAPDelete (sout_instance_t *,sap_session_t*);
void sout_SAPSend (sout_instance_t *,sap_session_t *);
int sout_SLPReg (sout_instance_t *,char *,char *);
int sout_SLPDereg (sout_instance_t *,char *,char *);
/*
VLC_EXPORT( sap_session_t *, sout_SAPNew, ( sout_instance_t *,char * , char * , int , char *) );
VLC_EXPORT( void, sout_SAPSend, ( sout_instance_t *,sap_session_t *) );
......
......@@ -77,6 +77,7 @@ static int Open( vlc_object_t *p_this )
char *psz_url = sout_cfg_find_value( p_stream->p_cfg, "url" );
char *psz_ipv = sout_cfg_find_value( p_stream->p_cfg, "sap_ipv" );
char *psz_v6_scope = sout_cfg_find_value( p_stream->p_cfg, "sap_v6scope" );
char *psz_sdp = NULL;
sout_cfg_t *p_sap_cfg = sout_cfg_find( p_stream->p_cfg, "sap" );
#ifdef HAVE_SLP_H
......@@ -255,9 +256,10 @@ static int Open( vlc_object_t *p_this )
}
msg_Dbg( p_sout , "Creating SAP with IPv%i", atoi(psz_ipv) );
p_sap = sout_SAPNew( p_sout , psz_url ,
p_sap_cfg->psz_value ? p_sap_cfg->psz_value : psz_url,
atoi(psz_ipv), psz_v6_scope );
psz_sdp = SDPGenerateUDP(p_sap_cfg->psz_value ? p_sap_cfg->psz_value :
psz_url, psz_url);
p_sap = sout_SAPNew( p_sout , psz_sdp,atoi(psz_ipv), psz_v6_scope );
if( !p_sap )
msg_Err( p_sout,"Unable to initialize SAP. SAP disabled");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment