include/modules.h \
include/modules_inner.h \
include/mtime.h \
- include/netutils.h \
include/network.h \
include/os_specific.h \
include/stream_control.h \
src/misc/threads.c \
src/misc/cpu.c \
src/misc/configuration.c \
- src/misc/netutils.c \
src/misc/iso_lang.c \
src/misc/iso-639_def.h \
src/misc/messages.c \
+++ /dev/null
-/*****************************************************************************
- * netutils.h: various network functions
- * This header describes miscellanous utility functions shared between several
- * modules.
- *****************************************************************************
- * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: netutils.h,v 1.22 2002/07/31 20:56:50 sam Exp $
- *
- * Authors: Vincent Seguin <seguin@via.ecp.fr>
- * Henri Fallon <henri@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-/* The channel without stream is 0 */
-#define COMMON_CHANNEL 0
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-struct sockaddr_in;
-int network_BuildAddr ( struct sockaddr_in *, char *, int );
-
-#define network_ChannelJoin(a,b) __network_ChannelJoin(VLC_OBJECT(a),b)
-#define network_ChannelCreate(a) __network_ChannelCreate(VLC_OBJECT(a))
-VLC_EXPORT( int, __network_ChannelJoin, ( vlc_object_t *, int ) );
-VLC_EXPORT( int, __network_ChannelCreate, ( vlc_object_t * ) );
-
gtk_widget_show (vbox3);
gtk_container_add (GTK_CONTAINER (mediabook), vbox3);
- network_multicast = gtk_radio_button_new_with_label (network_group, _("UDP/RTP (Address when Multicast)"));
+ network_multicast = gtk_radio_button_new_with_label (network_group, _("UDP/RTP (Adress when Multicast)"));
network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_multicast));
gtk_widget_set_name (network_multicast, "network_multicast");
gtk_widget_ref (network_multicast);
* display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: display.c,v 1.9 2003/02/05 22:11:52 sam Exp $
+ * $Id: display.c,v 1.10 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
GtkWidget * p_network_box;
GtkWidget * p_slider;
GtkWidget * p_label;
- GtkWidget * p_channel;
vlc_bool_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
"network_address_label" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_sys->p_input->psz_source );
- p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_channel_box" ) );
- if( config_GetInt( p_intf, "network-channel" ) )
- {
- gtk_widget_show( GTK_WIDGET( p_channel ) );
- }
- else
- {
- gtk_widget_hide( GTK_WIDGET( p_channel ) );
- }
-
break;
default:
msg_Warn( p_intf, "cannot determine input method" );
}
else
{
- if( config_GetInt( p_intf, "network-channel" ) )
- {
- gtk_widget_show( GTK_WIDGET( p_network_box ) );
-
- p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_channel_box" ) );
- gtk_widget_show( GTK_WIDGET( p_channel ) );
- }
- else
- {
- /* default mode */
- p_label = gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_window ), "label_status" );
- gtk_label_set_text( GTK_LABEL( p_label ), "" );
- gtk_widget_show( GTK_WIDGET( p_file_box ) );
- }
+ /* default mode */
+ p_label = gtk_object_get_data(
+ GTK_OBJECT( p_intf->p_sys->p_window ), "label_status" );
+ gtk_label_set_text( GTK_LABEL( p_label ), "" );
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
/* unsensitize menus */
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"),
<fill>False</fill>
</child>
</widget>
-
- <widget>
- <class>GtkHBox</class>
- <name>network_channel_box</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
-
- <widget>
- <class>GtkLabel</class>
- <name>label_network</name>
- <label>Network Channel:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <padding>5</padding>
- <expand>True</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkSpinButton</class>
- <name>network_channel_spinbutton</name>
- <can_focus>True</can_focus>
- <signal>
- <name>activate</name>
- <handler>GtkNetworkJoin</handler>
- <last_modification_time>Wed, 30 May 2001 02:28:48 GMT</last_modification_time>
- </signal>
- <climb_rate>1</climb_rate>
- <digits>0</digits>
- <numeric>False</numeric>
- <update_policy>GTK_UPDATE_ALWAYS</update_policy>
- <snap>False</snap>
- <wrap>False</wrap>
- <value>0</value>
- <lower>0</lower>
- <upper>100</upper>
- <step>1</step>
- <page>10</page>
- <page_size>10</page_size>
- <child>
- <padding>5</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>network_channel_go_button</name>
- <can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>GtkChannelGo</handler>
- <last_modification_time>Wed, 30 May 2001 02:38:25 GMT</last_modification_time>
- </signal>
- <label>Go!</label>
- <relief>GTK_RELIEF_NONE</relief>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
</widget>
</widget>
</widget>
<class>GtkTable</class>
<name>table4</name>
<border_width>5</border_width>
- <rows>4</rows>
+ <rows>3</rows>
<columns>6</columns>
<homogeneous>False</homogeneous>
<row_spacing>5</row_spacing>
</child>
</widget>
- <widget>
- <class>GtkRadioButton</class>
- <name>network_channel</name>
- <can_focus>True</can_focus>
- <signal>
- <name>toggled</name>
- <handler>GtkNetworkOpenChannel</handler>
- <last_modification_time>Thu, 16 May 2002 01:44:15 GMT</last_modification_time>
- </signal>
- <label>Channel server</label>
- <active>False</active>
- <draw_indicator>True</draw_indicator>
- <child>
- <left_attach>0</left_attach>
- <right_attach>1</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkRadioButton</class>
<name>network_http</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
</child>
</widget>
- <widget>
- <class>GtkLabel</class>
- <name>network_channel_address_label</name>
- <sensitive>False</sensitive>
- <label>Address</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <left_attach>1</left_attach>
- <right_attach>2</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkLabel</class>
<name>network_http_url_label</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
</widget>
</widget>
- <widget>
- <class>GtkCombo</class>
- <name>network_channel_address_combo</name>
- <sensitive>False</sensitive>
- <value_in_list>False</value_in_list>
- <ok_if_empty>True</ok_if_empty>
- <case_sensitive>False</case_sensitive>
- <use_arrows>True</use_arrows>
- <use_arrows_always>False</use_arrows_always>
- <items></items>
- <child>
- <left_attach>2</left_attach>
- <right_attach>4</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
-
- <widget>
- <class>GtkEntry</class>
- <child_name>GtkCombo:entry</child_name>
- <name>network_channel_address</name>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>GtkOpenChanged</handler>
- <last_modification_time>Tue, 09 Jul 2002 13:57:16 GMT</last_modification_time>
- </signal>
- <editable>True</editable>
- <text_visible>True</text_visible>
- <text_max_length>0</text_max_length>
- <text></text>
- </widget>
- </widget>
-
<widget>
<class>GtkLabel</class>
<name>network_multicast_port_label</name>
</child>
</widget>
- <widget>
- <class>GtkLabel</class>
- <name>network_channel_port_label</name>
- <sensitive>False</sensitive>
- <label>Port</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>1</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <left_attach>4</left_attach>
- <right_attach>5</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkSpinButton</class>
<name>network_multicast_port</name>
</child>
</widget>
- <widget>
- <class>GtkSpinButton</class>
- <name>network_channel_port</name>
- <width>75</width>
- <sensitive>False</sensitive>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>GtkOpenChanged</handler>
- <last_modification_time>Tue, 09 Jul 2002 13:57:45 GMT</last_modification_time>
- </signal>
- <climb_rate>1</climb_rate>
- <digits>0</digits>
- <numeric>False</numeric>
- <update_policy>GTK_UPDATE_ALWAYS</update_policy>
- <snap>False</snap>
- <wrap>False</wrap>
- <value>6010</value>
- <lower>0</lower>
- <upper>65535</upper>
- <step>1</step>
- <page>10</page>
- <page_size>10</page_size>
- <child>
- <left_attach>5</left_attach>
- <right_attach>6</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkEntry</class>
<name>network_http_url</name>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
GtkWidget *button_chapter_next;
GtkWidget *network_box;
GtkWidget *network_address_label;
- GtkWidget *network_channel_box;
- GtkWidget *label_network;
- GtkObject *network_channel_spinbutton_adj;
- GtkWidget *network_channel_spinbutton;
- GtkWidget *network_channel_go_button;
GtkWidget *appbar;
GtkTooltips *tooltips;
gtk_widget_show (network_address_label);
gtk_box_pack_start (GTK_BOX (network_box), network_address_label, FALSE, FALSE, 0);
- network_channel_box = gtk_hbox_new (FALSE, 0);
- gtk_widget_ref (network_channel_box);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_box", network_channel_box,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_box);
- gtk_box_pack_start (GTK_BOX (network_box), network_channel_box, FALSE, FALSE, 0);
-
- label_network = gtk_label_new (_("Network Channel:"));
- gtk_widget_ref (label_network);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_network", label_network,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (label_network);
- gtk_box_pack_start (GTK_BOX (network_channel_box), label_network, TRUE, FALSE, 5);
-
- network_channel_spinbutton_adj = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
- network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0);
- gtk_widget_ref (network_channel_spinbutton);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_spinbutton);
- gtk_box_pack_start (GTK_BOX (network_channel_box), network_channel_spinbutton, FALSE, TRUE, 5);
-
- network_channel_go_button = gtk_button_new_with_label (_("Go!"));
- gtk_widget_ref (network_channel_go_button);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_go_button", network_channel_go_button,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_go_button);
- gtk_box_pack_start (GTK_BOX (network_channel_box), network_channel_go_button, FALSE, FALSE, 0);
- gtk_button_set_relief (GTK_BUTTON (network_channel_go_button), GTK_RELIEF_NONE);
-
appbar = gnome_appbar_new (FALSE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "appbar", appbar,
gtk_signal_connect (GTK_OBJECT (button_chapter_next), "clicked",
GTK_SIGNAL_FUNC (GtkChapterNext),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_spinbutton), "activate",
- GTK_SIGNAL_FUNC (GtkNetworkJoin),
- NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_go_button), "clicked",
- GTK_SIGNAL_FUNC (GtkChannelGo),
- NULL);
gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips);
GSList *table4_group = NULL;
GtkWidget *network_udp;
GtkWidget *network_multicast;
- GtkWidget *network_channel;
GtkWidget *network_http;
GtkWidget *network_udp_port_label;
GtkWidget *network_multicast_address_label;
- GtkWidget *network_channel_address_label;
GtkWidget *network_http_url_label;
GtkWidget *network_multicast_address_combo;
GtkWidget *network_multicast_address;
- GtkWidget *network_channel_address_combo;
- GtkWidget *network_channel_address;
GtkWidget *network_multicast_port_label;
- GtkWidget *network_channel_port_label;
GtkObject *network_multicast_port_adj;
GtkWidget *network_multicast_port;
- GtkObject *network_channel_port_adj;
- GtkWidget *network_channel_port;
GtkWidget *network_http_url;
GtkObject *network_udp_port_adj;
GtkWidget *network_udp_port;
gtk_widget_show (open_disc);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (open_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (open_notebook), 1), open_disc);
- table4 = gtk_table_new (4, 6, FALSE);
+ table4 = gtk_table_new (3, 6, FALSE);
gtk_widget_ref (table4);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "table4", table4,
(GtkDestroyNotify) gtk_widget_unref);
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- network_channel = gtk_radio_button_new_with_label (table4_group, _("Channel server"));
- table4_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_channel));
- gtk_widget_ref (network_channel);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel", network_channel,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel);
- gtk_table_attach (GTK_TABLE (table4), network_channel, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
network_http = gtk_radio_button_new_with_label (table4_group, _("HTTP/FTP/MMS"));
table4_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_http));
gtk_widget_ref (network_http);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http", network_http,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http);
- gtk_table_attach (GTK_TABLE (table4), network_http, 0, 1, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (network_multicast_address_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (network_multicast_address_label), 1, 0.5);
- network_channel_address_label = gtk_label_new (_("Address"));
- gtk_widget_ref (network_channel_address_label);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address_label", network_channel_address_label,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address_label);
- gtk_table_attach (GTK_TABLE (table4), network_channel_address_label, 1, 2, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_address_label, FALSE);
-
network_http_url_label = gtk_label_new (_("URL"));
gtk_widget_ref (network_http_url_label);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http_url_label", network_http_url_label,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http_url_label);
- gtk_table_attach (GTK_TABLE (table4), network_http_url_label, 1, 2, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http_url_label, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (network_http_url_label, FALSE);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_multicast_address);
- network_channel_address_combo = gtk_combo_new ();
- gtk_widget_ref (network_channel_address_combo);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address_combo", network_channel_address_combo,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address_combo);
- gtk_table_attach (GTK_TABLE (table4), network_channel_address_combo, 2, 4, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_address_combo, FALSE);
-
- network_channel_address = GTK_COMBO (network_channel_address_combo)->entry;
- gtk_widget_ref (network_channel_address);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address", network_channel_address,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address);
-
network_multicast_port_label = gtk_label_new (_("Port"));
gtk_widget_ref (network_multicast_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_multicast_port_label", network_multicast_port_label,
gtk_widget_set_sensitive (network_multicast_port_label, FALSE);
gtk_misc_set_alignment (GTK_MISC (network_multicast_port_label), 1, 0.5);
- network_channel_port_label = gtk_label_new (_("Port"));
- gtk_widget_ref (network_channel_port_label);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_port_label", network_channel_port_label,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_port_label);
- gtk_table_attach (GTK_TABLE (table4), network_channel_port_label, 4, 5, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_port_label, FALSE);
- gtk_misc_set_alignment (GTK_MISC (network_channel_port_label), 1, 0.5);
-
network_multicast_port_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10);
network_multicast_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_multicast_port_adj), 1, 0);
gtk_widget_ref (network_multicast_port);
gtk_widget_set_usize (network_multicast_port, 75, -2);
gtk_widget_set_sensitive (network_multicast_port, FALSE);
- network_channel_port_adj = gtk_adjustment_new (6010, 0, 65535, 1, 10, 10);
- network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
- gtk_widget_ref (network_channel_port);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_port", network_channel_port,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_port);
- gtk_table_attach (GTK_TABLE (table4), network_channel_port, 5, 6, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_usize (network_channel_port, 75, -2);
- gtk_widget_set_sensitive (network_channel_port, FALSE);
-
network_http_url = gtk_entry_new ();
gtk_widget_ref (network_http_url);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http_url", network_http_url,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http_url);
- gtk_table_attach (GTK_TABLE (table4), network_http_url, 2, 6, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http_url, 2, 6, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (network_http_url, FALSE);
gtk_signal_connect (GTK_OBJECT (network_multicast), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenMulticast),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel), "toggled",
- GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_http), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenHTTP),
NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_address), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_address), "changed",
- GTK_SIGNAL_FUNC (GtkOpenChanged),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_port), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_port), "changed",
- GTK_SIGNAL_FUNC (GtkOpenChanged),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_http_url), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
<fill>True</fill>
</child>
</widget>
-
- <widget>
- <class>GtkHBox</class>
- <name>network_channel_box</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>False</fill>
- </child>
-
- <widget>
- <class>GtkLabel</class>
- <name>channel_label</name>
- <label>Channel:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <padding>5</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkSpinButton</class>
- <name>network_channel_spinbutton</name>
- <can_focus>True</can_focus>
- <signal>
- <name>activate</name>
- <handler>GtkNetworkJoin</handler>
- <last_modification_time>Wed, 30 May 2001 02:48:10 GMT</last_modification_time>
- </signal>
- <climb_rate>1</climb_rate>
- <digits>0</digits>
- <numeric>False</numeric>
- <update_policy>GTK_UPDATE_ALWAYS</update_policy>
- <snap>False</snap>
- <wrap>False</wrap>
- <value>0</value>
- <lower>0</lower>
- <upper>100</upper>
- <step>1</step>
- <page>10</page>
- <page_size>10</page_size>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>network_channel_go_button</name>
- <can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>GtkChannelGo</handler>
- <last_modification_time>Wed, 30 May 2001 02:49:18 GMT</last_modification_time>
- </signal>
- <label>Go!</label>
- <relief>GTK_RELIEF_NONE</relief>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
</widget>
<widget>
<class>GtkTable</class>
<name>table4</name>
<border_width>5</border_width>
- <rows>4</rows>
+ <rows>3</rows>
<columns>6</columns>
<homogeneous>False</homogeneous>
<row_spacing>5</row_spacing>
</child>
</widget>
- <widget>
- <class>GtkRadioButton</class>
- <name>network_channel</name>
- <can_focus>True</can_focus>
- <signal>
- <name>toggled</name>
- <handler>GtkNetworkOpenChannel</handler>
- <last_modification_time>Thu, 16 May 2002 01:44:15 GMT</last_modification_time>
- </signal>
- <label>Channel server</label>
- <active>False</active>
- <draw_indicator>True</draw_indicator>
- <child>
- <left_attach>0</left_attach>
- <right_attach>1</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkRadioButton</class>
<name>network_http</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
</child>
</widget>
- <widget>
- <class>GtkLabel</class>
- <name>network_channel_address_label</name>
- <sensitive>False</sensitive>
- <label>Address</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <left_attach>1</left_attach>
- <right_attach>2</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkLabel</class>
<name>network_http_url_label</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
</widget>
</widget>
- <widget>
- <class>GtkCombo</class>
- <name>network_channel_address_combo</name>
- <sensitive>False</sensitive>
- <value_in_list>False</value_in_list>
- <ok_if_empty>True</ok_if_empty>
- <case_sensitive>False</case_sensitive>
- <use_arrows>True</use_arrows>
- <use_arrows_always>False</use_arrows_always>
- <items></items>
- <child>
- <left_attach>2</left_attach>
- <right_attach>4</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
-
- <widget>
- <class>GtkEntry</class>
- <child_name>GtkCombo:entry</child_name>
- <name>network_channel_address</name>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>GtkOpenChanged</handler>
- <last_modification_time>Tue, 09 Jul 2002 13:57:16 GMT</last_modification_time>
- </signal>
- <editable>True</editable>
- <text_visible>True</text_visible>
- <text_max_length>0</text_max_length>
- <text></text>
- </widget>
- </widget>
-
<widget>
<class>GtkLabel</class>
<name>network_multicast_port_label</name>
</child>
</widget>
- <widget>
- <class>GtkLabel</class>
- <name>network_channel_port_label</name>
- <sensitive>False</sensitive>
- <label>Port</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>1</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <left_attach>4</left_attach>
- <right_attach>5</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>False</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkSpinButton</class>
<name>network_multicast_port</name>
</child>
</widget>
- <widget>
- <class>GtkSpinButton</class>
- <name>network_channel_port</name>
- <width>75</width>
- <sensitive>False</sensitive>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>GtkOpenChanged</handler>
- <last_modification_time>Tue, 09 Jul 2002 13:57:45 GMT</last_modification_time>
- </signal>
- <climb_rate>1</climb_rate>
- <digits>0</digits>
- <numeric>False</numeric>
- <update_policy>GTK_UPDATE_ALWAYS</update_policy>
- <snap>False</snap>
- <wrap>False</wrap>
- <value>6010</value>
- <lower>0</lower>
- <upper>65535</upper>
- <step>1</step>
- <page>10</page>
- <page_size>10</page_size>
- <child>
- <left_attach>5</left_attach>
- <right_attach>6</right_attach>
- <top_attach>2</top_attach>
- <bottom_attach>3</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>False</yfill>
- </child>
- </widget>
-
<widget>
<class>GtkEntry</class>
<name>network_http_url</name>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
- <top_attach>3</top_attach>
- <bottom_attach>4</bottom_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.13 2003/02/09 01:56:21 massiot Exp $
+ * $Id: gtk_callbacks.c,v 1.14 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
#include "common.h"
-#include "netutils.h"
-
/*****************************************************************************
* Useful function to retrieve p_intf
****************************************************************************/
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
-/****************************************************************************
- * Network specific items
- ****************************************************************************/
-void GtkNetworkJoin( GtkEditable * editable, gpointer user_data )
-{
- int i_channel;
-
- i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) );
-#if 0
- msg_Dbg( "intf info: joining channel %d", i_channel );
-
- network_ChannelJoin( i_channel );
-#endif
-}
-
-void GtkChannelGo( GtkButton * button, gpointer user_data )
-{
- GtkWidget * window;
- GtkWidget * spin;
- int i_channel;
-
- intf_thread_t *p_intf = GtkGetIntf( button );
-
- window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
- spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
- "network_channel_spinbutton" ) );
-
- i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) );
- msg_Dbg( p_intf, "joining channel %d", i_channel );
-
- vlc_mutex_lock( &p_intf->change_lock );
- network_ChannelJoin( p_intf, i_channel );
- vlc_mutex_unlock( &p_intf->change_lock );
-
-/* input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); */
-}
-
-
/****************************************************************************
* About box
****************************************************************************/
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.h,v 1.5 2003/01/26 14:49:09 fenrir Exp $
+ * $Id: gtk_callbacks.h,v 1.6 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
void GtkJumpOk ( GtkButton * button, gpointer );
void GtkJumpCancel ( GtkButton * button, gpointer user_data );
-void GtkNetworkJoin ( GtkEditable *, gpointer );
-void GtkChannelGo ( GtkButton *, gpointer );
-
void GtkNetworkOpenChannel ( GtkToggleButton *, gpointer );
gboolean
GtkWidget *chapter_next_button;
GtkWidget *network_box;
GtkWidget *network_address_label;
- GtkWidget *network_channel_box;
- GtkWidget *channel_label;
- GtkObject *network_channel_spinbutton_adj;
- GtkWidget *network_channel_spinbutton;
- GtkWidget *network_channel_go_button;
GtkWidget *intf_statusbar;
GtkAccelGroup *accel_group;
GtkTooltips *tooltips;
gtk_widget_show (network_address_label);
gtk_box_pack_start (GTK_BOX (network_box), network_address_label, TRUE, TRUE, 0);
- network_channel_box = gtk_hbox_new (FALSE, 0);
- gtk_widget_ref (network_channel_box);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_box", network_channel_box,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_box);
- gtk_box_pack_start (GTK_BOX (network_box), network_channel_box, TRUE, FALSE, 0);
-
- channel_label = gtk_label_new (_("Channel:"));
- gtk_widget_ref (channel_label);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel_label", channel_label,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (channel_label);
- gtk_box_pack_start (GTK_BOX (network_channel_box), channel_label, FALSE, FALSE, 5);
-
- network_channel_spinbutton_adj = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
- network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0);
- gtk_widget_ref (network_channel_spinbutton);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_spinbutton);
- gtk_box_pack_start (GTK_BOX (network_channel_box), network_channel_spinbutton, FALSE, TRUE, 0);
-
- network_channel_go_button = gtk_button_new_with_label (_("Go!"));
- gtk_widget_ref (network_channel_go_button);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_go_button", network_channel_go_button,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_go_button);
- gtk_box_pack_start (GTK_BOX (network_channel_box), network_channel_go_button, FALSE, FALSE, 0);
- gtk_button_set_relief (GTK_BUTTON (network_channel_go_button), GTK_RELIEF_NONE);
-
intf_statusbar = gtk_statusbar_new ();
gtk_widget_ref (intf_statusbar);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "intf_statusbar", intf_statusbar,
gtk_signal_connect (GTK_OBJECT (chapter_next_button), "clicked",
GTK_SIGNAL_FUNC (GtkChapterNext),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_spinbutton), "activate",
- GTK_SIGNAL_FUNC (GtkNetworkJoin),
- NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_go_button), "clicked",
- GTK_SIGNAL_FUNC (GtkChannelGo),
- NULL);
gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips);
GSList *table4_group = NULL;
GtkWidget *network_udp;
GtkWidget *network_multicast;
- GtkWidget *network_channel;
GtkWidget *network_http;
GtkWidget *network_udp_port_label;
GtkWidget *network_multicast_address_label;
- GtkWidget *network_channel_address_label;
GtkWidget *network_http_url_label;
GtkWidget *network_multicast_address_combo;
GtkWidget *network_multicast_address;
- GtkWidget *network_channel_address_combo;
- GtkWidget *network_channel_address;
GtkWidget *network_multicast_port_label;
- GtkWidget *network_channel_port_label;
GtkObject *network_multicast_port_adj;
GtkWidget *network_multicast_port;
- GtkObject *network_channel_port_adj;
- GtkWidget *network_channel_port;
GtkWidget *network_http_url;
GtkObject *network_udp_port_adj;
GtkWidget *network_udp_port;
gtk_widget_show (open_disc);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (open_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (open_notebook), 1), open_disc);
- table4 = gtk_table_new (4, 6, FALSE);
+ table4 = gtk_table_new (3, 6, FALSE);
gtk_widget_ref (table4);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "table4", table4,
(GtkDestroyNotify) gtk_widget_unref);
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- network_channel = gtk_radio_button_new_with_label (table4_group, _("Channel server"));
- table4_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_channel));
- gtk_widget_ref (network_channel);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel", network_channel,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel);
- gtk_table_attach (GTK_TABLE (table4), network_channel, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
network_http = gtk_radio_button_new_with_label (table4_group, _("HTTP/FTP/MMS"));
table4_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_http));
gtk_widget_ref (network_http);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http", network_http,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http);
- gtk_table_attach (GTK_TABLE (table4), network_http, 0, 1, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (network_multicast_address_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (network_multicast_address_label), 1, 0.5);
- network_channel_address_label = gtk_label_new (_("Address"));
- gtk_widget_ref (network_channel_address_label);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address_label", network_channel_address_label,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address_label);
- gtk_table_attach (GTK_TABLE (table4), network_channel_address_label, 1, 2, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_address_label, FALSE);
-
network_http_url_label = gtk_label_new (_("URL"));
gtk_widget_ref (network_http_url_label);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http_url_label", network_http_url_label,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http_url_label);
- gtk_table_attach (GTK_TABLE (table4), network_http_url_label, 1, 2, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http_url_label, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (network_http_url_label, FALSE);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_multicast_address);
- network_channel_address_combo = gtk_combo_new ();
- gtk_widget_ref (network_channel_address_combo);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address_combo", network_channel_address_combo,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address_combo);
- gtk_table_attach (GTK_TABLE (table4), network_channel_address_combo, 2, 4, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_address_combo, FALSE);
-
- network_channel_address = GTK_COMBO (network_channel_address_combo)->entry;
- gtk_widget_ref (network_channel_address);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_address", network_channel_address,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_address);
-
network_multicast_port_label = gtk_label_new (_("Port"));
gtk_widget_ref (network_multicast_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_multicast_port_label", network_multicast_port_label,
gtk_widget_set_sensitive (network_multicast_port_label, FALSE);
gtk_misc_set_alignment (GTK_MISC (network_multicast_port_label), 1, 0.5);
- network_channel_port_label = gtk_label_new (_("Port"));
- gtk_widget_ref (network_channel_port_label);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_port_label", network_channel_port_label,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_port_label);
- gtk_table_attach (GTK_TABLE (table4), network_channel_port_label, 4, 5, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_sensitive (network_channel_port_label, FALSE);
- gtk_misc_set_alignment (GTK_MISC (network_channel_port_label), 1, 0.5);
-
network_multicast_port_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10);
network_multicast_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_multicast_port_adj), 1, 0);
gtk_widget_ref (network_multicast_port);
gtk_widget_set_usize (network_multicast_port, 75, -2);
gtk_widget_set_sensitive (network_multicast_port, FALSE);
- network_channel_port_adj = gtk_adjustment_new (6010, 0, 65535, 1, 10, 10);
- network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
- gtk_widget_ref (network_channel_port);
- gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_channel_port", network_channel_port,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (network_channel_port);
- gtk_table_attach (GTK_TABLE (table4), network_channel_port, 5, 6, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_usize (network_channel_port, 75, -2);
- gtk_widget_set_sensitive (network_channel_port, FALSE);
-
network_http_url = gtk_entry_new ();
gtk_widget_ref (network_http_url);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "network_http_url", network_http_url,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_http_url);
- gtk_table_attach (GTK_TABLE (table4), network_http_url, 2, 6, 3, 4,
+ gtk_table_attach (GTK_TABLE (table4), network_http_url, 2, 6, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (network_http_url, FALSE);
gtk_signal_connect (GTK_OBJECT (network_multicast), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenMulticast),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel), "toggled",
- GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_http), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenHTTP),
NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_address), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_address), "changed",
- GTK_SIGNAL_FUNC (GtkOpenChanged),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_multicast_port), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
- gtk_signal_connect (GTK_OBJECT (network_channel_port), "changed",
- GTK_SIGNAL_FUNC (GtkOpenChanged),
- NULL);
gtk_signal_connect (GTK_OBJECT (network_http_url), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL);
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: open.c,v 1.13 2003/01/29 18:10:52 sam Exp $
+ * $Id: open.c,v 1.14 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
#include "playlist.h"
#include "common.h"
-#include "netutils.h"
-
static void GtkOpenShow( intf_thread_t *, int );
static void GtkFileOpenChanged ( GtkWidget *, gpointer );
static void GtkNetworkOpenChanged( GtkWidget *button, gpointer user_data )
{
- intf_thread_t * p_intf = GtkGetIntf( button );
GString * p_target = g_string_new( "" );
unsigned int i_port;
- vlc_bool_t b_channel;
-
- /* Manage channel server */
- b_channel = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
- lookup_widget( GTK_WIDGET(button), "network_channel" ) ) );
- config_PutInt( p_intf, "network-channel", b_channel );
#define SELECTED( s ) GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), \
(s) ) )->active
g_string_sprintfa( p_target, ":%i", i_port );
}
}
- else if( SELECTED( "network_channel" ) )
- {
- char * psz_channel;
- unsigned int i_channel_port;
-
- if( p_intf->p_vlc->p_channel == NULL )
- {
- network_ChannelCreate( p_intf );
- }
-
- psz_channel = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(button), "network_channel_address" ) ) );
- i_channel_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
- lookup_widget( GTK_WIDGET(button), "network_channel_port" ) ) );
-
- config_PutPsz( p_intf, "channel-server", psz_channel );
- if( i_channel_port < 65536 )
- {
- config_PutInt( p_intf, "channel-port", i_channel_port );
- }
-
- /* FIXME: we should use a playlist server instead */
- g_string_append( p_target, "udp://" );
- }
else if( SELECTED( "network_http" ) )
{
g_string_assign( p_target,
GtkNetworkOpenChanged( GTK_WIDGET( togglebutton ), user_data );
}
-
-void GtkNetworkOpenChannel( GtkToggleButton *togglebutton,
- gpointer user_data )
-{
- GtkWidget * p_open;
-
- p_open = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ),
- "network_channel_address_label" ),
- gtk_toggle_button_get_active( togglebutton ) );
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ),
- "network_channel_address_combo" ),
- gtk_toggle_button_get_active( togglebutton ) );
-
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ),
- "network_channel_port_label" ),
- gtk_toggle_button_get_active( togglebutton ) );
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ),
- "network_channel_port" ),
- gtk_toggle_button_get_active( togglebutton ) );
-
- GtkNetworkOpenChanged( GTK_WIDGET( togglebutton ), user_data );
-}
-
void GtkNetworkOpenHTTP( GtkToggleButton *togglebutton,
gpointer user_data )
{
GTK_OBJECT( p_intf->p_sys->p_open ), "network_udp_port" ) ),
config_GetInt( p_intf, "server-port" ) );
- psz_var = config_GetPsz( p_intf, "channel-server" );
- if( psz_var )
- {
- gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_open ), "network_channel_address" ) ),
- psz_var );
- free( psz_var );
- }
-
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_open ), "network_http_url" ) ),
"http://" );
- gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_open ), "network_channel_port" ) ),
- config_GetInt( p_intf, "channel-port" ) );
-
- gtk_toggle_button_set_active( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_open ), "network_channel" ),
- config_GetInt( p_intf, "network-channel" ) );
-
/* Satellite stuff */
psz_var = config_GetPsz( p_intf, "frequency" );
if( psz_var )
{
config_PutPsz( p_intf, "sout", "" );
}
-
- /* Enable the channel box when network channel is selected */
- if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
- "network_channel" ) )->active )
- {
- GtkWidget * p_network_box;
- GtkWidget * p_channel;
- GtkWidget * p_label;
-
- p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_box" ) );
- gtk_widget_show( GTK_WIDGET( p_network_box ) );
- p_label = gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ),
- "label_status" );
- gtk_widget_hide( GTK_WIDGET( p_label ) );
-
- p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_channel_box" ) );
- if( config_GetInt( p_intf, "network-channel" ) )
- {
- gtk_widget_show( GTK_WIDGET( p_channel ) );
- }
- else
- {
- gtk_widget_hide( GTK_WIDGET( p_channel ) );
- }
- }
-
}
void GtkOpenCancel( GtkButton * button, gpointer user_data )
* sout.c :
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: sout.c,v 1.1 2003/01/26 14:49:09 fenrir Exp $
+ * $Id: sout.c,v 1.2 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
#include "playlist.h"
#include "common.h"
-#include "netutils.h"
-
void GtkSoutSettings ( GtkButton *button,
gpointer user_data );
* open.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: open.m,v 1.30 2003/04/30 23:58:56 hartman Exp $
+ * $Id: open.m,v 1.31 2003/05/05 16:09:39 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
#include "playlist.h"
#include "open.h"
-#include "netutils.h"
-
/*****************************************************************************
* GetEjectableMediaOfClass
*****************************************************************************/
break;
default:
- if( i_key >= Pk_0 && i_key <= Pk_9 )
- {
-// network_ChannelJoin( i_key );
- }
break;
}
}
* event.cpp: Event class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.13 2003/04/21 21:51:16 asmax Exp $
+ * $Id: event.cpp,v 1.14 2003/05/05 16:09:40 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
case CTRL_SET_TEXT:
delete[] (char *)Param2;
break;
-
- case VLC_NET_ADDCS:
- if( Param2 == (int)true || force )
- delete[] (char *)Param1;
- break;
}
}
// Network events
else if( Desc == "VLC_NET_ADDUDP" )
return VLC_NET_ADDUDP;
- else if( Desc == "VLC_NET_ADDCS" )
- return VLC_NET_ADDCS;
// Window event
else if( Desc == "WINDOW_MOVE" )
Param2 = atoi( para1 );
break;
- case VLC_NET_ADDCS:
- buf = new char[MAX_PARAM_SIZE + 7];
- sprintf( buf, "%s:%s", para1, para2 );
- Param1 = (unsigned int)buf;
- Param2 = (int)false;
- break;
-
case CTRL_ID_VISIBLE:
Param1 = (unsigned int)FindControl( para1 );
Param2 = GetBool( para2 );
* event.h: Event class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: event.h,v 1.8 2003/04/21 22:12:37 asmax Exp $
+ * $Id: event.h,v 1.9 2003/05/05 16:09:40 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
// Network events
#define VLC_NET_ADDUDP (VLC_MESSAGE + 701)
-#define VLC_NET_ADDCS (VLC_MESSAGE + 703)
// Window event
#define WINDOW_MOVE (VLC_WINDOW + 1)
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.19 2003/05/05 12:15:25 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.20 2003/05/05 16:09:40 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include <wx/wx.h>
#endif
-extern "C" {
-#include "netutils.h"
-}
-
//--- SKIN ------------------------------------------------------------------
#include "../os_api.h"
#include "event.h"
AddNetworkUDP( (int)evt->GetParam2() );
return true;
- case VLC_NET_ADDCS:
- AddNetworkChannelServer( (char *)evt->GetParam1() );
- return true;
-
default:
return true;
}
#include "misc.h"\r
#include "win32_common.h"\r
\r
-#include "netutils.h"\r
-\r
/*****************************************************************************\r
* BORLAND SUCKS\r
* If the following pragma doesn't end with \r\n instead of \n, the file\r
****************************************************************************/\r
void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )\r
{\r
- int i_channel;\r
-\r
- i_channel = SpinEditChannel->Value;\r
- msg_Dbg( p_intf, "joining channel %d", i_channel );\r
-\r
- vlc_mutex_lock( &p_intf->change_lock );\r
- network_ChannelJoin( p_intf, i_channel );\r
- vlc_mutex_unlock( &p_intf->change_lock );\r
-\r
-// input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
+ msg_Err( p_intf, "Deprecated, doesn't do anything" );\r
}\r
//---------------------------------------------------------------------------\r
\r
#include "misc.h"\r
#include "win32_common.h"\r
\r
-#include "netutils.h"\r
-\r
//---------------------------------------------------------------------------\r
//#pragma package(smart_init)\r
#pragma link "CSPIN"\r
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )\r
, PLAYLIST_END );\r
\r
- /* Channel server */\r
- case 2:\r
- config_PutInt( p_intf, "network-channel", TRUE );\r
- config_PutPsz( p_intf, "channel-server", Channel.c_str() );\r
- config_PutInt( p_intf, "channel-port", i_channel_port );\r
-\r
- if( p_intf->p_vlc->p_channel == NULL )\r
- {\r
- network_ChannelCreate( p_intf );\r
- }\r
-\r
- p_intf->p_sys->b_playing = 1;\r
- break;\r
-\r
/* HTTP */\r
case 3:\r
config_PutInt( p_intf, "network-channel", FALSE );\r
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.17 2003/04/29 16:03:14 gbazin Exp $
+ * $Id: directx.c,v 1.18 2003/05/05 16:09:37 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <windows.h>
#include <ddraw.h>
-#include "netutils.h"
-
#include "vout.h"
/*****************************************************************************
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.12 2003/03/04 22:48:55 gbazin Exp $
+ * $Id: events.c,v 1.13 2003/05/05 16:09:37 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <vlc/input.h>
#include <vlc/vout.h>
-#include "netutils.h"
-
#include <windows.h>
#include <windowsx.h>
#include <shellapi.h>
break;
}
- case VK_F1: network_ChannelJoin( p_event, 1 ); break;
- case VK_F2: network_ChannelJoin( p_event, 2 ); break;
- case VK_F3: network_ChannelJoin( p_event, 3 ); break;
- case VK_F4: network_ChannelJoin( p_event, 4 ); break;
- case VK_F5: network_ChannelJoin( p_event, 5 ); break;
- case VK_F6: network_ChannelJoin( p_event, 6 ); break;
- case VK_F7: network_ChannelJoin( p_event, 7 ); break;
- case VK_F8: network_ChannelJoin( p_event, 8 ); break;
- case VK_F9: network_ChannelJoin( p_event, 9 ); break;
- case VK_F10: network_ChannelJoin( p_event, 10 ); break;
- case VK_F11: network_ChannelJoin( p_event, 11 ); break;
- case VK_F12: network_ChannelJoin( p_event, 12 ); break;
}
TranslateMessage(&msg);
break;
* xmga.c : X11 MGA plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xmga.c,v 1.4 2003/03/30 18:14:39 gbazin Exp $
+ * $Id: xmga.c,v 1.5 2003/05/05 16:09:37 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <X11/extensions/XShm.h>
#include <X11/extensions/dpms.h>
-#include "netutils.h" /* network_ChannelJoin */
-
//#include "mga.h"
/*****************************************************************************
INPUT_STATUS_PAUSE );
break;
- case XK_F1: network_ChannelJoin( p_vout, 1 ); break;
- case XK_F2: network_ChannelJoin( p_vout, 2 ); break;
- case XK_F3: network_ChannelJoin( p_vout, 3 ); break;
- case XK_F4: network_ChannelJoin( p_vout, 4 ); break;
- case XK_F5: network_ChannelJoin( p_vout, 5 ); break;
- case XK_F6: network_ChannelJoin( p_vout, 6 ); break;
- case XK_F7: network_ChannelJoin( p_vout, 7 ); break;
- case XK_F8: network_ChannelJoin( p_vout, 8 ); break;
- case XK_F9: network_ChannelJoin( p_vout, 9 ); break;
- case XK_F10: network_ChannelJoin( p_vout, 10 ); break;
- case XK_F11: network_ChannelJoin( p_vout, 11 ); break;
- case XK_F12: network_ChannelJoin( p_vout, 12 ); break;
-
default:
/* "Normal Keys"
* The reason why I use this instead of XK_0 is that
* qte.cpp : QT Embedded plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2003 VideoLAN
- * $Id: qte.cpp,v 1.17 2003/03/30 18:14:39 gbazin Exp $
+ * $Id: qte.cpp,v 1.18 2003/05/05 16:09:38 gbazin Exp $
*
* Authors: Gerald Hansink <gerald.hansink@ordain.nl>
* Jean-Paul Saman <jpsaman@wxs.nl>
extern "C"
{
-#include "netutils.h" /* network_ChannelJoin */
#include "qte.h"
/*****************************************************************************
* sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: sdl.c,v 1.12 2003/05/04 12:40:58 sam Exp $
+ * $Id: sdl.c,v 1.13 2003/05/05 16:09:37 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
#include SDL_INCLUDE_FILE
-#include "netutils.h"
-
#define SDL_MAX_DIRECTBUFFERS 10
#define SDL_DEFAULT_BPP 16
input_Seek( p_vout, -60, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
break;
- case SDLK_F1: network_ChannelJoin( p_vout, 1 ); break;
- case SDLK_F2: network_ChannelJoin( p_vout, 2 ); break;
- case SDLK_F3: network_ChannelJoin( p_vout, 3 ); break;
- case SDLK_F4: network_ChannelJoin( p_vout, 4 ); break;
- case SDLK_F5: network_ChannelJoin( p_vout, 5 ); break;
- case SDLK_F6: network_ChannelJoin( p_vout, 6 ); break;
- case SDLK_F7: network_ChannelJoin( p_vout, 7 ); break;
- case SDLK_F8: network_ChannelJoin( p_vout, 8 ); break;
- case SDLK_F9: network_ChannelJoin( p_vout, 9 ); break;
- case SDLK_F10: network_ChannelJoin( p_vout, 10 ); break;
- case SDLK_F11: network_ChannelJoin( p_vout, 11 ); break;
- case SDLK_F12: network_ChannelJoin( p_vout, 12 ); break;
-
case SDLK_b:
{
audio_volume_t i_volume;
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.14 2003/02/09 23:42:06 sigmunau Exp $
+ * $Id: xcommon.c,v 1.15 2003/05/05 16:09:38 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
# include <X11/extensions/Xvlib.h>
#endif
-#include "netutils.h" /* network_ChannelJoin */
-
#include "xcommon.h"
/*****************************************************************************
input_SetStatus( p_vout, INPUT_STATUS_PAUSE );
break;
- case XK_F1: network_ChannelJoin( p_vout, 1 ); break;
- case XK_F2: network_ChannelJoin( p_vout, 2 ); break;
- case XK_F3: network_ChannelJoin( p_vout, 3 ); break;
- case XK_F4: network_ChannelJoin( p_vout, 4 ); break;
- case XK_F5: network_ChannelJoin( p_vout, 5 ); break;
- case XK_F6: network_ChannelJoin( p_vout, 6 ); break;
- case XK_F7: network_ChannelJoin( p_vout, 7 ); break;
- case XK_F8: network_ChannelJoin( p_vout, 8 ); break;
- case XK_F9: network_ChannelJoin( p_vout, 9 ); break;
- case XK_F10: network_ChannelJoin( p_vout, 10 ); break;
- case XK_F11: network_ChannelJoin( p_vout, 11 ); break;
- case XK_F12: network_ChannelJoin( p_vout, 12 ); break;
-
default:
/* "Normal Keys"
* The reason why I use this instead of XK_0 is that
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: input.c,v 1.228 2003/03/30 01:13:37 massiot Exp $
+ * $Id: input.c,v 1.229 2003/05/05 16:09:35 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
# include <sys/times.h>
#endif
-#include "netutils.h"
#include "vlc_playlist.h"
#include "stream_control.h"
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.81 2003/04/24 17:44:53 gbazin Exp $
+ * $Id: libvlc.c,v 1.82 2003/05/05 16:09:35 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include "os_specific.h"
#include "error.h"
-#include "netutils.h" /* network_ChannelJoin */
#include "stream_control.h"
#include "input_ext-intf.h"
p_vlc->pf_memset = memset;
}
- /*
- * Initialize shared resources and libraries
- */
- if( config_GetInt( p_vlc, "network-channel" )
- && network_ChannelCreate( p_vlc ) )
- {
- /* On error during Channels initialization, switch off channels */
- msg_Warn( p_vlc,
- "channels initialization failed, deactivating channels" );
- config_PutInt( p_vlc, "network-channel", VLC_FALSE );
- }
-
/*
* Initialize playlist and get commandline files
*/
return VLC_ENOOBJ;
}
- /*
- * Go back into channel 0 which is the network
- */
- if( config_GetInt( p_vlc, "network-channel" ) && p_vlc->p_channel )
- {
- network_ChannelJoin( p_vlc, COMMON_CHANNEL );
- }
-
/*
* Free allocated memory
*/
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.58 2003/05/04 23:38:06 massiot Exp $
+ * $Id: libvlc.h,v 1.59 2003/05/05 16:09:35 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
"This is the typical size of UDP packets that we expect. On Ethernet " \
"it is usually 1500.")
-#define NETCHANNEL_TEXT N_("Enable network channel mode")
-#define NETCHANNEL_LONGTEXT N_( \
- "Activate this option if you want to use the VideoLAN Channel Server.")
-
-#define CHAN_SERV_TEXT N_("Channel server address")
-#define CHAN_SERV_LONGTEXT N_( \
- "Indicate here the address of the VideoLAN Channel Server.")
-
-#define CHAN_PORT_TEXT N_("Channel server port")
-#define CHAN_PORT_LONGTEXT N_( \
- "Indicate here the port on which the VideoLAN Channel Server runs.")
-
-#define IFACE_TEXT N_("Network interface")
-#define IFACE_LONGTEXT N_( \
- "If you have several interfaces on your Linux machine and use the " \
- "VLAN solution, you may indicate here which interface to use.")
-
#define IFACE_ADDR_TEXT N_("Network interface address")
#define IFACE_ADDR_LONGTEXT N_( \
"If you have several interfaces on your machine and use the " \
add_category_hint( N_("Input"), NULL, VLC_FALSE );
add_integer( "server-port", 1234, NULL,
SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT, VLC_FALSE );
- add_bool( "network-channel", 0, NULL,
- NETCHANNEL_TEXT, NETCHANNEL_LONGTEXT, VLC_TRUE );
- add_string( "channel-server", "localhost", NULL,
- CHAN_SERV_TEXT, CHAN_SERV_LONGTEXT, VLC_TRUE );
- add_integer( "channel-port", 6010, NULL,
- CHAN_PORT_TEXT, CHAN_PORT_LONGTEXT, VLC_TRUE );
add_integer( "mtu", 1500, NULL, MTU_TEXT, MTU_LONGTEXT, VLC_TRUE );
-#ifdef SYS_DARWIN
- add_string( "iface", "en0", NULL, IFACE_TEXT, IFACE_LONGTEXT, VLC_TRUE );
-#else
- add_string( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT, VLC_TRUE );
-#endif
add_string( "iface-addr", "", NULL, IFACE_ADDR_TEXT, IFACE_ADDR_LONGTEXT, VLC_TRUE );
add_integer( "ttl", 1, NULL, TTL_TEXT, TTL_LONGTEXT, VLC_TRUE );
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.118 2003/04/14 22:22:32 massiot Exp $
+ * $Id: modules.c,v 1.119 2003/05/05 16:09:36 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#endif
#include "error.h"
-#include "netutils.h"
#include "interface.h"
#include "vlc_playlist.h"
+++ /dev/null
-/*****************************************************************************
- * netutils.c: various network functions
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: netutils.c,v 1.81 2003/03/12 05:26:46 sam Exp $
- *
- * Authors: Vincent Seguin <seguin@via.ecp.fr>
- * Benoit Steiner <benny@via.ecp.fr>
- * Henri Fallon <henri@videolan.org>
- * Xavier Marchesini <xav@alarue.net>
- * Christophe Massiot <massiot@via.ecp.fr>
- * Samuel Hocevar <sam@via.ecp.fr>
- * Jon Lech Johansen <jon-vl@nanocrew.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h> /* free(), realloc(), atoi() */
-#include <string.h> /* memset() */
-
-#include <vlc/vlc.h>
-
-#ifdef HAVE_ERRNO_H
-# include <errno.h> /* errno() */
-#endif
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h> /* gethostname() */
-#elif defined( WIN32 ) && !defined( UNDER_CE )
-# include <io.h>
-#endif
-
-#if !defined( _MSC_VER )
-#include <sys/time.h> /* gettimeofday */
-#endif
-
-#if defined( UNDER_CE )
- /* No real network support (FIXME: use winsock1?) */
-#elif defined( WIN32 )
-# include <winsock2.h>
-#else
-# include <netdb.h> /* hostent ... */
-# include <sys/socket.h> /* BSD: struct sockaddr */
-# include <netinet/in.h> /* BSD: struct in_addr */
-# ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
-# endif
-#endif
-
-#ifdef SYS_LINUX
-#include <sys/ioctl.h> /* ioctl() */
-#endif
-
-#ifdef SYS_DARWIN
-#include <IOKit/IOKitLib.h>
-#include <IOKit/network/IOEthernetInterface.h>
-#include <IOKit/network/IOEthernetController.h>
-#endif
-
-#if defined( WIN32 ) && !defined( UNDER_CE )
- /* tools to get the MAC adress from the interface under Windows */
-# include <windows.h>
-# include <stdio.h>
-# include <nb30.h>
-#endif
-
-#ifdef HAVE_NET_IF_H
-#include <net/if.h> /* interface (arch-dependent) */
-#endif
-
-#ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h>
-#endif
-
-#include "netutils.h"
-#include "vlc_playlist.h"
-
-#include "network.h"
-
-/*****************************************************************************
- * input_channel_t: channel library data
- *****************************************************************************
- * Store global channel library data.
- * The part of the code concerning the channel changing process is unstable
- * as it depends on the VideoLAN channel server, which isn't frozen for
- * the time being.
- *****************************************************************************/
-struct input_channel_t
-{
- int i_channel; /* current channel number */
- mtime_t last_change; /* last change date */
-};
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int GetMacAddress ( vlc_object_t *, int i_fd, char *psz_mac );
-#ifdef SYS_DARWIN
-static int GetNetIntfCtrl ( const char *psz_interface,
- io_object_t *ctrl_service );
-#elif defined( WIN32 ) && !defined( UNDER_CE )
-static int GetAdapterInfo ( int i_adapter, char *psz_string );
-#endif
-
-/*****************************************************************************
- * network_ChannelCreate: initialize global channel method data
- *****************************************************************************
- * Initialize channel input method global data. This function should be called
- * once before any input thread is created or any call to other
- * input_Channel*() function is attempted.
- *****************************************************************************/
-int __network_ChannelCreate( vlc_object_t *p_this )
-{
-#if !defined( SYS_LINUX ) && !( defined( WIN32 ) && !defined( UNDER_CE ) )
- msg_Warn( p_this, "VLAN-based channels are not supported "
- "on this architecture" );
-#endif
-
- /* Allocate structure */
- p_this->p_vlc->p_channel = malloc( sizeof( input_channel_t ) );
- if( p_this->p_vlc->p_channel == NULL )
- {
- msg_Err( p_this, "out of memory" );
- return( -1 );
- }
-
- /* Initialize structure */
- p_this->p_vlc->p_channel->i_channel = 0;
- p_this->p_vlc->p_channel->last_change = 0;
-
- msg_Dbg( p_this, "channels initialized" );
- return( 0 );
-}
-
-/*****************************************************************************
- * network_ChannelJoin: join a channel
- *****************************************************************************
- * This function will try to join a channel. If the relevant interface is
- * already on the good channel, nothing will be done. Else, and if possible
- * (if the interface is not locked), the channel server will be contacted
- * and a change will be requested. The function will block until the change
- * is effective. Note that once a channel is no more used, its interface
- * should be unlocked using input_ChannelLeave().
- * Non 0 will be returned in case of error.
- *****************************************************************************/
-int __network_ChannelJoin( vlc_object_t *p_this, int i_channel )
-{
-#define VLCS_VERSION 13
-#define MESSAGE_LENGTH 256
-
-#if defined( SYS_LINUX ) || ( defined( WIN32 ) && !defined( UNDER_CE ) )
- module_t * p_network;
- char * psz_network = NULL;
- network_socket_t socket_desc;
- char psz_mess[ MESSAGE_LENGTH ];
- char psz_mac[ 40 ];
- int i_fd, i_port;
- char *psz_vlcs;
- struct timeval delay;
- fd_set fds;
-
- if( p_this->p_vlc->p_channel == NULL )
- {
- msg_Warn( p_this, "channels not initialized" );
- return 0;
- }
-
- if( p_this->p_vlc->p_channel->i_channel == i_channel )
- {
- return 0;
- }
-
- if( !config_GetInt( p_this, "network-channel" ) )
- {
- msg_Err( p_this, "channels disabled, to enable them, use the"
- " --channels option" );
- return -1;
- }
-
- if( config_GetInt( p_this, "ipv4" ) )
- {
- psz_network = "ipv4";
- }
- if( config_GetInt( p_this, "ipv6" ) )
- {
- psz_network = "ipv6";
- }
-
- /* Getting information about the channel server */
- if( !(psz_vlcs = config_GetPsz( p_this, "channel-server" )) )
- {
- msg_Err( p_this, "configuration variable channel-server empty" );
- return -1;
- }
-
- i_port = config_GetInt( p_this, "channel-port" );
-
- msg_Dbg( p_this, "connecting to %s:%d", psz_vlcs, i_port );
-
- /* Prepare the network_socket_t structure */
- socket_desc.i_type = NETWORK_UDP;
- socket_desc.psz_bind_addr = "";
- socket_desc.i_bind_port = 4321;
- socket_desc.psz_server_addr = psz_vlcs;
- socket_desc.i_server_port = i_port;
-
- /* Find an appropriate network module */
- p_this->p_private = (void*) &socket_desc;
- p_network = module_Need( p_this, "network", psz_network/*, &socket_desc*/ );
- if( p_network == NULL )
- {
- return( -1 );
- }
- module_Unneed( p_this, p_network );
-
- free( psz_vlcs ); /* Do we really need this ? -- Meuuh */
- i_fd = socket_desc.i_handle;
-
- /* Look for the interface MAC address */
- if( GetMacAddress( p_this, i_fd, psz_mac ) )
- {
- msg_Err( p_this, "failed getting MAC address" );
- close( i_fd );
- return -1;
- }
-
- msg_Dbg( p_this, "MAC address is %s", psz_mac );
-
- /* Build the message */
- sprintf( psz_mess, "%d %u %lu %s \n", i_channel, VLCS_VERSION,
- (unsigned long)(mdate() / (uint64_t)1000000),
- psz_mac );
-
- /* Send the message */
- send( i_fd, psz_mess, MESSAGE_LENGTH, 0 );
-
- msg_Dbg( p_this, "attempting to join channel %d", i_channel );
-
- /* We have changed channels ! (or at least, we tried) */
- p_this->p_vlc->p_channel->last_change = mdate();
- p_this->p_vlc->p_channel->i_channel = i_channel;
-
- /* Wait 5 sec for an answer from the server */
- delay.tv_sec = 5;
- delay.tv_usec = 0;
- FD_ZERO( &fds );
- FD_SET( i_fd, &fds );
-
- switch( select( i_fd + 1, &fds, NULL, NULL, &delay ) )
- {
- case 0:
- msg_Err( p_this, "no answer from vlcs" );
- close( i_fd );
- return -1;
-
- case -1:
- msg_Err( p_this, "error while listening to vlcs" );
- close( i_fd );
- return -1;
- }
-
- recv( i_fd, psz_mess, MESSAGE_LENGTH, 0 );
- psz_mess[ MESSAGE_LENGTH - 1 ] = '\0';
-
- if( !strncasecmp( psz_mess, "E:", 2 ) )
- {
- msg_Err( p_this, "vlcs said '%s'", psz_mess + 2 );
- close( i_fd );
- return -1;
- }
- else if( !strncasecmp( psz_mess, "I:", 2 ) )
- {
- msg_Dbg( p_this, "vlcs said '%s'", psz_mess + 2 );
- }
- else
- {
- /* We got something to play ! */
- playlist_t *p_playlist;
- p_playlist = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist != NULL )
- {
- playlist_Add( p_playlist, psz_mess,
- PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
- vlc_object_release( p_playlist );
- }
- }
-
- /* Close the socket and return nicely */
-# if defined( WIN32 )
- closesocket( i_fd );
-# else
- close( i_fd );
-# endif
-
-#endif
- return 0;
-}
-
-/* Following functions are local */
-
-/*****************************************************************************
- * GetMacAddress: extract the MAC Address
- *****************************************************************************/
-static int GetMacAddress( vlc_object_t *p_this, int i_fd, char *psz_mac )
-{
-#if defined( SYS_LINUX )
- struct ifreq interface;
- int i_ret;
- char *psz_interface;
-
- /*
- * Looking for information about the eth0 interface
- */
- interface.ifr_addr.sa_family = AF_INET;
- if( !(psz_interface = config_GetPsz( p_this, "iface" )) )
- {
- msg_Err( p_this, "configuration variable iface empty" );
- return -1;
- }
- strcpy( interface.ifr_name, psz_interface );
- free( psz_interface );
-
- i_ret = ioctl( i_fd, SIOCGIFHWADDR, &interface );
-
- if( i_ret )
- {
- msg_Err( p_this, "ioctl SIOCGIFHWADDR failed" );
- return( i_ret );
- }
-
- sprintf( psz_mac, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
- interface.ifr_hwaddr.sa_data[0] & 0xff,
- interface.ifr_hwaddr.sa_data[1] & 0xff,
- interface.ifr_hwaddr.sa_data[2] & 0xff,
- interface.ifr_hwaddr.sa_data[3] & 0xff,
- interface.ifr_hwaddr.sa_data[4] & 0xff,
- interface.ifr_hwaddr.sa_data[5] & 0xff );
-
- return( 0 );
-
-#elif defined( SYS_DARWIN )
- char *psz_interface;
- io_object_t ctrl_service;
- CFTypeRef cfd_mac_address;
- UInt8 ui_mac_address[kIOEthernetAddressSize];
-
- if( !(psz_interface = config_GetPsz( p_this, "iface" )) )
- {
- msg_Err( p_this, "configuration variable iface empty" );
- return( -1 );
- }
-
- if( GetNetIntfCtrl( psz_interface, &ctrl_service ) )
- {
- msg_Err( p_this, "GetNetIntfCtrl failed" );
- return( -1 );
- }
-
- cfd_mac_address = IORegistryEntryCreateCFProperty( ctrl_service,
- CFSTR(kIOMACAddress),
- kCFAllocatorDefault,
- 0 );
- IOObjectRelease( ctrl_service );
- if( cfd_mac_address == NULL )
- {
- msg_Err( p_this, "IORegistryEntryCreateCFProperty failed" );
- return( -1 );
- }
-
- CFDataGetBytes( cfd_mac_address,
- CFRangeMake(0, kIOEthernetAddressSize),
- ui_mac_address );
- CFRelease( cfd_mac_address );
-
- sprintf( psz_mac, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
- ui_mac_address[0], ui_mac_address[1],
- ui_mac_address[2], ui_mac_address[3],
- ui_mac_address[4], ui_mac_address[5] );
-
- return( 0 );
-
-#elif defined( WIN32 ) && !defined( UNDER_CE )
- int i, i_ret = -1;
-
- /* Get adapter list - support for more than one adapter */
- LANA_ENUM AdapterList;
- NCB Ncb;
-
- msg_Dbg( p_this, "looking for MAC address" );
-
- memset( &Ncb, 0, sizeof( NCB ) );
- Ncb.ncb_command = NCBENUM;
- Ncb.ncb_buffer = (unsigned char *)&AdapterList;
- Ncb.ncb_length = sizeof( AdapterList );
- Netbios( &Ncb );
-
- /* Get all of the local ethernet addresses */
- for ( i = 0; i < AdapterList.length ; ++i )
- {
- if ( GetAdapterInfo ( AdapterList.lana[ i ], psz_mac ) == 0 )
- {
- i_ret = 0;
- }
- }
-
- return( i_ret );
-
-#else
- strcpy( psz_mac, "00:00:00:00:00:00" );
- return( 0 );
-
-#endif
-}
-
-#ifdef SYS_DARWIN
-/*****************************************************************************
- * GetNetIntfCtrl : get parent controller for network interface
- *****************************************************************************/
-static int GetNetIntfCtrl( const char *psz_interface,
- io_object_t *ctrl_service )
-{
- mach_port_t port;
- kern_return_t ret;
- io_object_t intf_service;
- io_iterator_t intf_iterator;
-
- /* get port for IOKit communication */
- if( ( ret = IOMasterPort( MACH_PORT_NULL, &port ) ) != KERN_SUCCESS )
- {
- return( -1 );
- }
-
- /* look up the IOService object for the interface */
- ret = IOServiceGetMatchingServices( port, IOBSDNameMatching( port, 0,
- psz_interface ), &intf_iterator );
- if( ret != KERN_SUCCESS )
- {
- return( -1 );
- }
-
- intf_service = IOIteratorNext( intf_iterator );
- if( intf_service == NULL )
- {
- return( -1 );
- }
-
- ret = IORegistryEntryGetParentEntry( intf_service,
- kIOServicePlane,
- ctrl_service );
- IOObjectRelease( intf_service );
- if( ret != KERN_SUCCESS )
- {
- return( -1 );
- }
-
- return( 0 );
-}
-
-#elif defined( WIN32 ) && !defined( UNDER_CE )
-/*****************************************************************************
- * GetAdapterInfo : gets some informations about the interface using NETBIOS
- *****************************************************************************/
-static int GetAdapterInfo( int i_adapter, char *psz_string )
-{
- struct ASTAT
- {
- ADAPTER_STATUS adapt;
- NAME_BUFFER psz_name[30];
- } Adapter;
-
- /* Reset the LAN adapter so that we can begin querying it */
- NCB Ncb;
- memset( &Ncb, 0, sizeof ( Ncb ) );
- Ncb.ncb_command = NCBRESET;
- Ncb.ncb_lana_num = i_adapter;
-
- if( Netbios( &Ncb ) != NRC_GOODRET )
- {
-//X intf_ErrMsg( "network error: reset returned %i", Ncb.ncb_retcode );
- return -1;
- }
-
- /* Prepare to get the adapter status block */
- memset( &Ncb, 0, sizeof( Ncb ) ) ; /* Initialization */
- Ncb.ncb_command = NCBASTAT;
- Ncb.ncb_lana_num = i_adapter;
-
- strcpy( (char *)Ncb.ncb_callname, "*" );
-
- memset( &Adapter, 0, sizeof ( Adapter ) );
- Ncb.ncb_buffer = ( unsigned char * ) &Adapter;
- Ncb.ncb_length = sizeof ( Adapter );
-
- /* Get the adapter's info and, if this works, return it in standard,
- * colon-delimited form. */
- if ( Netbios( &Ncb ) == 0 )
- {
- sprintf ( psz_string, "%02X:%02X:%02X:%02X:%02X:%02X",
- (int) ( Adapter.adapt.adapter_address[0] ),
- (int) ( Adapter.adapt.adapter_address[1] ),
- (int) ( Adapter.adapt.adapter_address[2] ),
- (int) ( Adapter.adapt.adapter_address[3] ),
- (int) ( Adapter.adapt.adapter_address[4] ),
- (int) ( Adapter.adapt.adapter_address[5] ) );
-
-//X intf_WarnMsg( 2, "network: found MAC address %s", psz_string );
-
- return 0;
- }
- else
- {
-//X intf_ErrMsg( "network error: ASTAT returned %i", Ncb.ncb_retcode );
- return -1;
- }
-}
-#endif /* WIN32 */
-