#define NAME_LONGTEXT N_( \
"This is the name of the session that will be announced in the SDP " \
"(Session Descriptor)." )
-#define DESC_TEXT N_("Session description")
+#define DESC_TEXT N_("Session descriptipn")
#define DESC_LONGTEXT N_( \
- "This allows you to give a broader description of the stream, that will " \
- "be announced in the SDP (Session Descriptor)." )
+ "This allows you to give a short description with details about the stream, " \
+ "that will be announced in the SDP (Session Descriptor)." )
#define URL_TEXT N_("Session URL")
#define URL_LONGTEXT N_( \
"This allows you to give an URL with more details about the stream " \
"be announced in the SDP (Session Descriptor)." )
#define EMAIL_TEXT N_("Session email")
#define EMAIL_LONGTEXT N_( \
- "This allows you to give a contact mail address for the stream, that will " \
- "be announced in the SDP (Session Descriptor)." )
+ "This allows you to give a contact mail address for the stream, that will " \
+ "be announced in the SDP (Session Descriptor)." )
+#define PHONE_TEXT N_("Session phone number")
+#define PHONE_LONGTEXT N_( \
+ "This allows you to give a contact telephone number for the stream, that will " \
+ "be announced in the SDP (Session Descriptor)." )
+
#define PORT_TEXT N_("Port")
#define PORT_LONGTEXT N_( \
"This allows you to specify the base port for the RTP streaming." )
URL_LONGTEXT, VLC_TRUE );
add_string( SOUT_CFG_PREFIX "email", "", NULL, EMAIL_TEXT,
EMAIL_LONGTEXT, VLC_TRUE );
+ add_string( SOUT_CFG_PREFIX "phone", "", NULL, PHONE_TEXT,
+ PHONE_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "port", 1234, NULL, PORT_TEXT,
PORT_LONGTEXT, VLC_TRUE );
*****************************************************************************/
static const char *ppsz_sout_options[] = {
"dst", "name", "port", "port-audio", "port-video", "*sdp", "ttl", "mux",
- "description", "url", "email",
+ "description", "url", "email", "phone",
"dccp", "tcp", "udplite",
"mp4a-latm", NULL
};
dstlen = sizeof( struct sockaddr_in );
}
- psz_sdp = sdp_Start( p_sys->psz_session_name,
- p_sys->psz_session_description,
- p_sys->psz_session_url, p_sys->psz_session_email,
- NULL, NULL, 0, (struct sockaddr *)&dst, dstlen );
+ psz_sdp = vlc_sdp_Start( VLC_OBJECT( p_stream ), SOUT_CFG_PREFIX,
+ NULL, 0, (struct sockaddr *)&dst, dstlen );
if( psz_sdp == NULL )
return NULL;
/* TODO: a=source-filter */
+ if( rtsp_url != NULL )
+ sdp_AddAttribute ( &psz_sdp, "control", "%s", rtsp_url );
+
/* FIXME: locking?! */
for( i = 0; i < p_sys->i_es; i++ )
{
id->psz_rtpmap, id->psz_fmtp);
if( rtsp_url != NULL )
- sdp_AddAttribute ( &psz_sdp, "control", "/trackID=%d", i );
+ sdp_AddAttribute ( &psz_sdp, "control", "%s/trackID=%d",
+ rtsp_url, i );
}
return psz_sdp;
static int rtp_packetize_h263 ( sout_stream_t *, sout_stream_id_t *, block_t * );
static int rtp_packetize_h264 ( sout_stream_t *, sout_stream_id_t *, block_t * );
static int rtp_packetize_amr ( sout_stream_t *, sout_stream_id_t *, block_t * );
+static int rtp_packetize_t140 ( sout_stream_t *, sout_stream_id_t *, block_t * );
static void sprintf_hexa( char *s, uint8_t *p_data, int i_data )
{
id->i_clock_rate = p_fmt->audio.i_rate;
id->pf_packetize = rtp_packetize_amr;
break;
+ case VLC_FOURCC( 't', '1', '4', '0' ):
+ id->psz_rtpmap = strdup( "t140/1000" );
+ id->i_clock_rate = 1000;
+ id->pf_packetize = rtp_packetize_t140;
+ break;
default:
msg_Err( p_stream, "cannot add this stream (unsupported "
return VLC_SUCCESS;
}
+static int rtp_packetize_t140( sout_stream_t *p_stream, sout_stream_id_t *id,
+ block_t *in )
+{
+ const size_t i_max = id->i_mtu - 12;
+ const uint8_t *p_data = in->p_buffer;
+ size_t i_data = in->i_buffer;
+
+ for( unsigned i_packet = 0; i_data > 0; i_packet++ )
+ {
+ size_t i_payload = i_data;
+
+ /* Make sure we stop on an UTF-8 character boundary
+ * (assuming the input is valid UTF-8) */
+ if( i_data > i_max )
+ {
+ i_payload = i_max;
+
+ while( ( p_data[i_payload] & 0xC0 ) == 0x80 )
+ {
+ if( i_payload == 0 )
+ return VLC_SUCCESS; /* fishy input! */
+
+ i_payload--;
+ }
+ }
+
+ block_t *out = block_New( p_stream, 12 + i_payload );
+ if( out == NULL )
+ return VLC_SUCCESS;
+
+ rtp_packetize_common( id, out, 0, in->i_pts + i_packet );
+ memcpy( out->p_buffer + 12, p_data, i_payload );
+
+ out->i_buffer = 12 + i_payload;
+ out->i_dts = out->i_pts;
+ out->i_length = 0;
+
+ rtp_packetize_send( id, out );
+
+ p_data += i_payload;
+ i_data -= i_payload;
+ }
+
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* Non-RTP mux
*****************************************************************************/