/* ES list */
int i_es;
media_es_t **es;
+ char *psz_mux;
/* RTSP client */
int i_rtsp;
memset( p_media, 0, sizeof(vod_media_t) );
p_media->es = 0;
+ p_media->psz_mux = 0;
p_media->rtsp = 0;
asprintf( &p_media->psz_rtsp_path, "%s%s", p_sys->psz_path, psz_name );
char *psz_urlc;
memset( p_es, 0, sizeof(media_es_t) );
+ p_media->psz_mux = NULL;
/* TODO: update SDP, etc... */
asprintf( &psz_urlc, "%s/trackid=%d",
free( p_hexa );
}
break;
+ case VLC_FOURCC( 'm', 'p', '2', 't' ):
+ p_media->psz_mux = "ts";
+ p_es->i_payload_type = 33;
+ p_es->psz_rtpmap = strdup( "MP2T/90000" );
+ break;
+ case VLC_FOURCC( 'm', 'p', '2', 'p' ):
+ p_media->psz_mux = "ps";
+ p_es->i_payload_type = p_media->i_payload_type++;
+ p_es->psz_rtpmap = strdup( "MP2P/90000" );
+ break;
default:
msg_Err( p_vod, "cannot add this stream (unsupported "
i_port_video = p_rtsp->es[i]->i_port;
}
- asprintf( &psz_output, "rtp{dst=%s,port-video=%i,port-audio=%i}",
- ip, i_port_video, i_port_audio );
+ if( p_media->psz_mux )
+ {
+ asprintf( &psz_output, "rtp{dst=%s,port=%i,mux=%s}",
+ ip, i_port_video, p_media->psz_mux );
+ }
+ else
+ {
+ asprintf( &psz_output, "rtp{dst=%s,port-video=%i,"
+ "port-audio=%i}", ip, i_port_video, i_port_audio );
+ }
+
vod_MediaControl( p_vod, p_media, psz_session, VOD_MEDIA_PLAY,
psz_output );
free( psz_output );
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
+#include <ctype.h> /* tolower() */
#include <vlc/vlc.h>
{
vlm_MediaSetup( vlm, media, p_command[i], NULL );
}
+ else if( i + 1 >= i_command && !strcmp( p_command[i], "mux" ) )
+ {
+ if( media->i_type != VOD_TYPE )
+ {
+ message = vlm_MessageNew( p_command[0],
+ "mux only available for broadcast" );
+ }
+ else
+ {
+ vlm_MediaSetup( vlm, media, p_command[i],
+ p_command[i+1] );
+ i++;
+ }
+ }
else if( strcmp( p_command[i], "loop" ) == 0 ||
strcmp( p_command[i], "unloop" ) == 0 )
{
media->b_loop = VLC_FALSE;
media->vod_media = NULL;
media->psz_vod_output = NULL;
+ media->psz_mux = NULL;
media->i_input = 0;
media->input = NULL;
media->psz_output = NULL;
if( media->input ) free( media->input );
if( media->psz_output ) free( media->psz_output );
+ if( media->psz_mux ) free( media->psz_mux );
while( media->i_option-- ) free( media->option[media->i_option] );
if( media->option ) free( media->option );
{
media->b_enabled = VLC_FALSE;
}
+ else if( strcmp( psz_cmd, "mux" ) == 0 )
+ {
+ if( media->psz_mux ) free( media->psz_mux );
+ media->psz_mux = NULL;
+ if( psz_value ) media->psz_mux = strdup( psz_value );
+ }
else if( strcmp( psz_cmd, "input" ) == 0 )
{
char *input;
}
free( psz_output );
+ if( media->psz_mux )
+ {
+ input_item_t item;
+ es_format_t es, *p_es = &es;
+ char fourcc[5];
+
+ sprintf( fourcc, "%4.4s", media->psz_mux );
+ fourcc[0] = tolower(fourcc[0]); fourcc[1] = tolower(fourcc[1]);
+ fourcc[2] = tolower(fourcc[2]); fourcc[3] = tolower(fourcc[3]);
+
+ item = media->item;
+ item.i_es = 1;
+ item.es = &p_es;
+ es_format_Init( &es, VIDEO_ES, *((int *)fourcc) );
+
+ media->vod_media =
+ vlm->vod->pf_media_new( vlm->vod, media->psz_name, &item );
+ return VLC_SUCCESS;
+ }
+
media->vod_media =
vlm->vod->pf_media_new( vlm->vod, media->psz_name,
&media->item );
vlm_MessageNew( "loop", media->b_loop ?
"yes" : "no" ) );
+ if( media->i_type == VOD_TYPE && media->psz_mux )
+ vlm_MessageAdd( msg_media,
+ vlm_MessageNew( "mux", media->psz_mux ) );
+
msg_child = vlm_MessageAdd( msg_media,
vlm_MessageNew( "inputs", NULL ) );
}
- else if( psz_filter && strcmp( psz_filter, "media") == 0 )
+ else if( psz_filter && strcmp( psz_filter, "media" ) == 0 )
{
int i, j;
vlm_message_t *msg;
vlm_MessageNew( "enabled", m->b_enabled ?
"yes" : "no" ) );
+ if( m->i_type == VOD_TYPE && m->psz_mux )
+ vlm_MessageAdd( msg_media,
+ vlm_MessageNew( "mux", m->psz_mux ) );
+
msg_instance = vlm_MessageAdd( msg_media,
vlm_MessageNew( "instances", 0 ) );