* udp.c: raw UDP & RTP input module
*****************************************************************************
* Copyright (C) 2001-2004 VideoLAN
- * $Id: udp.c,v 1.29 2004/01/31 18:02:32 alexis Exp $
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Tristan Leteurtre <tooney@via.ecp.fr>
free( psz_name );
/* FIXME */
- p_input->i_mtu = config_GetInt( p_this, "mtu" );
+ var_Create( p_input, "mtu", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_input, "mtu", &val);
+ p_input->i_mtu = val.i_int;
/* fill p_input fields */
p_input->pf_read = RTPChoose;
* sgimb.c: a meta demux to parse sgimb referrer files
*****************************************************************************
* Copyright (C) 2004 VideoLAN
- * $Id: $
+ * $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
*
char *psz_name; /* sgiShowingName= */
char *psz_user; /* sgiUserAccount= */
char *psz_password; /* sgiUserPassword= */
+ char *psz_mcast_ip; /* sgiMulticastAddress= */
+ int i_mcast_port; /* sgiMulticastPort= */
+ int i_packet_size; /* sgiPacketSize= */
mtime_t i_duration; /* sgiDuration= */
int i_port; /* sgiRtspPort= */
int i_sid; /* sgiSid= */
p_sys->psz_name = NULL;
p_sys->psz_user = NULL;
p_sys->psz_password = NULL;
+ p_sys->psz_mcast_ip = NULL;
+ p_sys->i_mcast_port = 0;
+ p_sys->i_packet_size = 0;
p_sys->i_duration = (mtime_t)0;
p_sys->i_port = 0;
free( p_sys->psz_user );
if( p_sys->psz_password )
free( p_sys->psz_password );
+ if( p_sys->psz_mcast_ip )
+ free( p_sys->psz_mcast_ip );
free( p_demux->p_sys );
return;
}
psz_bol += sizeof("sgiShowingName=") - 1;
p_sys->psz_name = strdup( psz_bol );
}
+ else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) )
+ {
+ psz_bol += sizeof("sgiMulticastAddress=") - 1;
+ p_sys->psz_mcast_ip = strdup( psz_bol );
+ }
+ else if( !strncasecmp( psz_bol, "sgiMulticastPort=", sizeof("sgiMulticastPort=") - 1 ) )
+ {
+ psz_bol += sizeof("sgiMulticastPort=") - 1;
+ p_sys->i_mcast_port = (int) strtol( psz_bol, NULL, 0 );
+ }
+ else if( !strncasecmp( psz_bol, "sgiPacketSize=", sizeof("sgiPacketSize=") - 1 ) )
+ {
+ psz_bol += sizeof("sgiPacketSize=") - 1;
+ p_sys->i_packet_size = (int) strtol( psz_bol, NULL, 0 );
+ }
else if( !strncasecmp( psz_bol, "sgiDuration=", sizeof("sgiDuration=") - 1 ) )
{
psz_bol += sizeof("sgiDuration=") - 1;
{
demux_sys_t *p_sys = p_demux->p_sys;
playlist_t *p_playlist;
+ playlist_item_t *p_item;
char *psz_line;
int i_position;
ParseLine( p_demux, psz_line );
if( psz_line ) free( psz_line );
}
-
- if( p_sys->psz_uri == NULL )
+
+ if( p_sys->psz_mcast_ip )
+ {
+ char *temp;
+
+ temp = (char *)malloc( sizeof("udp/ts2://@000.000.000.000:123456789" ) );
+ sprintf( temp, "udp/ts2://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
+ if( p_sys->psz_uri ) free( p_sys->psz_uri );
+ p_sys->psz_uri = strdup( temp );
+ free( temp );
+ }
+ else if( p_sys->psz_uri == NULL )
{
if( p_sys->psz_server && p_sys->psz_location )
{
free( temp );
}
}
-
- playlist_AddExt( p_playlist, p_sys->psz_uri,
- p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
- PLAYLIST_INSERT, i_position, p_sys->i_duration, NULL, 0 );
+
+ p_item = playlist_ItemNew( p_playlist, p_sys->psz_uri,
+ p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri );
+
+ if( !p_item || !p_item->input.psz_uri )
+ {
+ msg_Err( p_demux, "A valid playlistitem could not be created" );
+ return VLC_EGENERIC;
+ }
+
+ if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
+ {
+ char *psz_option = (char *) malloc( 20 );
+ sprintf( psz_option, "mtu=%i", p_sys->i_packet_size );
+ playlist_ItemAddOption( p_item, psz_option );
+ free( psz_option );
+ }
+
+ playlist_ItemSetDuration( p_item, p_sys->i_duration );
+ playlist_AddItem( p_playlist, p_item, PLAYLIST_INSERT, i_position );
vlc_object_release( p_playlist );
return VLC_SUCCESS;
* ipv4.c: IPv4 network abstraction layer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ipv4.c,v 1.25 2004/02/22 23:09:25 titer Exp $
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com>
int i_handle, i_opt;
socklen_t i_opt_size;
struct sockaddr_in sock;
+ vlc_value_t val;
/* If IP_ADD_SOURCE_MEMBERSHIP is not defined in the headers
(because it's not in glibc for example), we have to define the
}
p_socket->i_handle = i_handle;
- p_socket->i_mtu = config_GetInt( p_this, "mtu" );
+
+ var_Create( p_this, "mtu", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_this, "mtu", &val );
+ p_socket->i_mtu = val.i_int;
return( 0 );
}
* ipv6.c: IPv6 network abstraction layer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: ipv6.c,v 1.16 2004/02/15 22:20:56 gbazin Exp $
+ * $Id$
*
* Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr>
int i_handle, i_opt;
socklen_t i_opt_size;
struct sockaddr_in6 sock;
+ vlc_value_t val;
/* Open a SOCK_DGRAM (UDP) socket, in the AF_INET6 domain, automatic (0)
* protocol */
}
p_socket->i_handle = i_handle;
- p_socket->i_mtu = config_GetInt( p_this, "mtu" );
+
+ var_Create( p_this, "mtu", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_this, "mtu", &val );
+ p_socket->i_mtu = val.i_int;
return( 0 );
}