Commit 0b54d9c6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Support for disabling SDP source-filter in SAP announces

parent ab363722
......@@ -753,6 +753,10 @@ static const char *ppsz_clock_descriptions[] =
"When the SAP flow control is disabled, " \
"this lets you set the fixed interval between SAP announcements." )
#define ANN_SAP_SFILTER_TEXT N_("Use SAP source filter")
#define ANN_SAP_SFILTER_LONGTEXT N_( \
"When this is disabled, SAP announcements do not include a " \
"source-filter parameter and source-specific multicast is not used.")
/*****************************************************************************
* Advanced
......@@ -1553,6 +1557,8 @@ vlc_module_begin();
ANN_SAPCTRL_LONGTEXT, VLC_TRUE );
add_integer( "sap-interval", 5, NULL, ANN_SAPINTV_TEXT,
ANN_SAPINTV_LONGTEXT, VLC_TRUE );
add_bool( "sap-source-filter", VLC_TRUE, NULL, ANN_SAP_SFILTER_TEXT,
ANN_SAP_SFILTER_LONGTEXT, VLC_TRUE );
set_subcategory( SUBCAT_SOUT_VOD );
/* CPU options */
......
......@@ -614,29 +614,41 @@ static char *SDPGenerate( sap_handler_t *p_sap,
else
psz_uri = p_session->psz_uri;
char *sfilter = NULL;
if (var_CreateGetBool (p_sap, "sap-source-filter"))
{
if (asprintf (&sfilter, "a=source-filter: incl IN IP%c * %s\r\n",
ipv, p_addr->psz_machine) == -1)
return NULL;
}
/* see the lists in modules/stream_out/rtp.c for compliance stuff */
if( asprintf( &psz_sdp,
"v=0\r\n"
"o=- "I64Fd" %d IN IP%c %s\r\n"
"s=%s\r\n"
"c=IN IP%c %s/%d\r\n"
"t=0 0\r\n"
"a=tool:"PACKAGE_STRING"\r\n"
"a=recvonly\r\n"
"a=type:broadcast\n"
"a=source-filter: incl IN IP%c * %s\r\n"
"m=video %d %s %d\r\n"
"%s%s%s",
i_sdp_id, i_sdp_version,
ipv, p_addr->psz_machine,
psz_name, ipv, psz_uri,
(p_session->i_ttl != -1) ? p_session->i_ttl : 255,
ipv, p_addr->psz_machine,
p_session->i_port,
p_session->b_rtp ? "RTP/AVP" : "udp",
p_session->i_payload,
psz_group ? "a=x-plgroup:" : "",
psz_group ? psz_group : "", psz_group ? "\r\n" : "" ) == -1 )
int res = asprintf (&psz_sdp,
"v=0\r\n"
"o=- "I64Fd" %d IN IP%c %s\r\n"
"s=%s\r\n"
"c=IN IP%c %s/%d\r\n"
"t=0 0\r\n"
"a=tool:"PACKAGE_STRING"\r\n"
"a=recvonly\r\n"
"a=type:broadcast\n"
"%s"
"m=video %d %s %d\r\n"
"%s%s%s",
i_sdp_id, i_sdp_version,
ipv, p_addr->psz_machine,
psz_name, ipv, psz_uri,
(p_session->i_ttl != -1) ? p_session->i_ttl : 255,
(sfilter != NULL) ? sfilter : "",
p_session->i_port,
p_session->b_rtp ? "RTP/AVP" : "udp",
p_session->i_payload,
psz_group ? "a=x-plgroup:" : "",
psz_group ? psz_group : "", psz_group ? "\r\n" : "");
if (sfilter != NULL)
free (sfilter);
if (res == -1)
return NULL;
msg_Dbg( p_sap, "Generated SDP (%i bytes):\n%s", strlen(psz_sdp),
......
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