Commit 65113f55 authored by Pierre Ynard's avatar Pierre Ynard

rtp sout: factor out some SDP code

parent 66b5e14a
...@@ -784,12 +784,29 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url ) ...@@ -784,12 +784,29 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
if( rtsp_url != NULL ) if( rtsp_url != NULL )
sdp_AddAttribute ( &psz_sdp, "control", "%s", rtsp_url ); sdp_AddAttribute ( &psz_sdp, "control", "%s", rtsp_url );
const char *proto = "RTP/AVP"; /* protocol */
if( rtsp_url == NULL )
{
switch( p_sys->proto )
{
case IPPROTO_UDP:
break;
case IPPROTO_TCP:
proto = "TCP/RTP/AVP";
break;
case IPPROTO_DCCP:
proto = "DCCP/RTP/AVP";
break;
case IPPROTO_UDPLITE:
return psz_sdp;
}
}
/* FIXME: locking?! */ /* FIXME: locking?! */
for( i = 0; i < p_sys->i_es; i++ ) for( i = 0; i < p_sys->i_es; i++ )
{ {
sout_stream_id_t *id = p_sys->es[i]; sout_stream_id_t *id = p_sys->es[i];
const char *mime_major; /* major MIME type */ const char *mime_major; /* major MIME type */
const char *proto = "RTP/AVP"; /* protocol */
switch( id->i_cat ) switch( id->i_cat )
{ {
...@@ -806,23 +823,6 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url ) ...@@ -806,23 +823,6 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
continue; continue;
} }
if( rtsp_url == NULL )
{
switch( p_sys->proto )
{
case IPPROTO_UDP:
break;
case IPPROTO_TCP:
proto = "TCP/RTP/AVP";
break;
case IPPROTO_DCCP:
proto = "DCCP/RTP/AVP";
break;
case IPPROTO_UDPLITE:
continue;
}
}
sdp_AddMedia( &psz_sdp, mime_major, proto, inclport * id->i_port, sdp_AddMedia( &psz_sdp, mime_major, proto, inclport * id->i_port,
id->i_payload_type, false, id->i_bitrate, id->i_payload_type, false, id->i_bitrate,
id->psz_enc, id->i_clock_rate, id->i_channels, id->psz_enc, id->i_clock_rate, id->i_channels,
......
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