Commit ee2ba2eb authored by Sam Hocevar's avatar Sam Hocevar

* ./src/misc/netutils.c: factored code common to the interfaces into the

    network_ChannelJoin function.
  * ./plugins/mga/xmga.c, ./plugins/x11/xcommon.c, ./plugins/sdl/vout_sdl.c,
    ./plugins/directx/vout_events.c: we can now use keys F1 to F12 to switch
    channels from the video output window.
parent 91dc9852
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
HEAD HEAD
* ./src/misc/netutils.c: factored code common to the interfaces into the
network_ChannelJoin function.
* ./plugins/mga/xmga.c, ./plugins/x11/xcommon.c, ./plugins/sdl/vout_sdl.c,
./plugins/directx/vout_events.c: we can now use keys F1 to F12 to switch
channels from the video output window.
* ./plugins/motion/motionmmx.c: MMX motion optimizations courtesy of * ./plugins/motion/motionmmx.c: MMX motion optimizations courtesy of
Vladimir Chernyshov <greengrass@writeme.com>. Vladimir Chernyshov <greengrass@writeme.com>.
* ./plugins/dvdread/dvdread.c: disabled the dvdread plugin because it * ./plugins/dvdread/dvdread.c: disabled the dvdread plugin because it
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_events.c: Windows DirectX video output events handler * vout_events.c: Windows DirectX video output events handler
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: vout_events.c,v 1.18 2002/05/18 22:41:43 gbazin Exp $ * $Id: vout_events.c,v 1.18.2.1 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -140,10 +140,22 @@ void DirectXEventThread( vout_thread_t *p_vout ) ...@@ -140,10 +140,22 @@ void DirectXEventThread( vout_thread_t *p_vout )
switch( msg.wParam ) switch( msg.wParam )
{ {
case VK_ESCAPE: case VK_ESCAPE:
case VK_F12:
/* exit application */ /* exit application */
p_main->p_intf->b_die = 1; p_main->p_intf->b_die = 1;
break; break;
case VK_F1: network_ChannelJoin( 1 ); break;
case VK_F2: network_ChannelJoin( 2 ); break;
case VK_F3: network_ChannelJoin( 3 ); break;
case VK_F4: network_ChannelJoin( 4 ); break;
case VK_F5: network_ChannelJoin( 5 ); break;
case VK_F6: network_ChannelJoin( 6 ); break;
case VK_F7: network_ChannelJoin( 7 ); break;
case VK_F8: network_ChannelJoin( 8 ); break;
case VK_F9: network_ChannelJoin( 9 ); break;
case VK_F10: network_ChannelJoin( 10 ); break;
case VK_F11: network_ChannelJoin( 11 ); break;
case VK_F12: network_ChannelJoin( 12 ); break;
} }
TranslateMessage(&msg); TranslateMessage(&msg);
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.39 2002/05/18 02:12:20 ipkiss Exp $ * $Id: gtk_callbacks.c,v 1.39.2.1 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -307,27 +307,8 @@ void GtkChannelGo( GtkButton * button, gpointer user_data ) ...@@ -307,27 +307,8 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel ); intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( i_channel ); network_ChannelJoin( i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_vlc_wrapper.c: MacOS X plugin for vlc * intf_vlc_wrapper.c: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.6.2.5 2002/06/02 22:32:46 massiot Exp $ * $Id: intf_vlc_wrapper.m,v 1.6.2.6 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -211,27 +211,8 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -211,27 +211,8 @@ static Intf_VLCWrapper *o_intf = nil;
intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel ); intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( p_intf->p_sys->i_channel ); network_ChannelJoin( p_intf->p_sys->i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
...@@ -249,27 +230,8 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -249,27 +230,8 @@ static Intf_VLCWrapper *o_intf = nil;
intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel ); intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( p_intf->p_sys->i_channel ); network_ChannelJoin( p_intf->p_sys->i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xmga.c : X11 MGA plugin for vlc * xmga.c : X11 MGA plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xmga.c,v 1.15 2002/05/30 08:17:04 gbazin Exp $ * $Id: xmga.c,v 1.15.2.1 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -555,6 +555,19 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -555,6 +555,19 @@ static int vout_Manage( vout_thread_t *p_vout )
INPUT_STATUS_PAUSE ); INPUT_STATUS_PAUSE );
break; break;
case XK_F1: network_ChannelJoin( 1 ); break;
case XK_F2: network_ChannelJoin( 2 ); break;
case XK_F3: network_ChannelJoin( 3 ); break;
case XK_F4: network_ChannelJoin( 4 ); break;
case XK_F5: network_ChannelJoin( 5 ); break;
case XK_F6: network_ChannelJoin( 6 ); break;
case XK_F7: network_ChannelJoin( 7 ); break;
case XK_F8: network_ChannelJoin( 8 ); break;
case XK_F9: network_ChannelJoin( 9 ); break;
case XK_F10: network_ChannelJoin( 10 ); break;
case XK_F11: network_ChannelJoin( 11 ); break;
case XK_F12: network_ChannelJoin( 12 ); break;
default: default:
/* "Normal Keys" /* "Normal Keys"
* The reason why I use this instead of XK_0 is that * The reason why I use this instead of XK_0 is that
...@@ -575,17 +588,6 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -575,17 +588,6 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE; p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break; break;
case '0': network_ChannelJoin( 0 ); break;
case '1': network_ChannelJoin( 1 ); break;
case '2': network_ChannelJoin( 2 ); break;
case '3': network_ChannelJoin( 3 ); break;
case '4': network_ChannelJoin( 4 ); break;
case '5': network_ChannelJoin( 5 ); break;
case '6': network_ChannelJoin( 6 ); break;
case '7': network_ChannelJoin( 7 ); break;
case '8': network_ChannelJoin( 8 ); break;
case '9': network_ChannelJoin( 9 ); break;
default: default:
break; break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method * vout_sdl.c: SDL video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_sdl.c,v 1.91 2002/05/18 17:47:47 sam Exp $ * $Id: vout_sdl.c,v 1.91.2.1 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org> * Pierre Baillet <oct@zoy.org>
...@@ -466,7 +466,6 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -466,7 +466,6 @@ static int vout_Manage( vout_thread_t *p_vout )
vout_Seek( -60 ); vout_Seek( -60 );
break; break;
case SDLK_F10: network_ChannelJoin( 0 ); break;
case SDLK_F1: network_ChannelJoin( 1 ); break; case SDLK_F1: network_ChannelJoin( 1 ); break;
case SDLK_F2: network_ChannelJoin( 2 ); break; case SDLK_F2: network_ChannelJoin( 2 ); break;
case SDLK_F3: network_ChannelJoin( 3 ); break; case SDLK_F3: network_ChannelJoin( 3 ); break;
...@@ -476,6 +475,9 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -476,6 +475,9 @@ static int vout_Manage( vout_thread_t *p_vout )
case SDLK_F7: network_ChannelJoin( 7 ); break; case SDLK_F7: network_ChannelJoin( 7 ); break;
case SDLK_F8: network_ChannelJoin( 8 ); break; case SDLK_F8: network_ChannelJoin( 8 ); break;
case SDLK_F9: network_ChannelJoin( 9 ); break; case SDLK_F9: network_ChannelJoin( 9 ); break;
case SDLK_F10: network_ChannelJoin( 10 ); break;
case SDLK_F11: network_ChannelJoin( 11 ); break;
case SDLK_F12: network_ChannelJoin( 12 ); break;
default: default:
break; break;
......
...@@ -539,27 +539,8 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender ) ...@@ -539,27 +539,8 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel ); intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( i_channel ); network_ChannelJoin( i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.35 2002/05/29 10:08:03 gbazin Exp $ * $Id: xcommon.c,v 1.35.2.1 2002/06/03 00:28:07 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -721,6 +721,19 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -721,6 +721,19 @@ static int vout_Manage( vout_thread_t *p_vout )
INPUT_STATUS_PAUSE ); INPUT_STATUS_PAUSE );
break; break;
case XK_F1: network_ChannelJoin( 1 ); break;
case XK_F2: network_ChannelJoin( 2 ); break;
case XK_F3: network_ChannelJoin( 3 ); break;
case XK_F4: network_ChannelJoin( 4 ); break;
case XK_F5: network_ChannelJoin( 5 ); break;
case XK_F6: network_ChannelJoin( 6 ); break;
case XK_F7: network_ChannelJoin( 7 ); break;
case XK_F8: network_ChannelJoin( 8 ); break;
case XK_F9: network_ChannelJoin( 9 ); break;
case XK_F10: network_ChannelJoin( 10 ); break;
case XK_F11: network_ChannelJoin( 11 ); break;
case XK_F12: network_ChannelJoin( 12 ); break;
default: default:
/* "Normal Keys" /* "Normal Keys"
* The reason why I use this instead of XK_0 is that * The reason why I use this instead of XK_0 is that
...@@ -741,17 +754,6 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -741,17 +754,6 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE; p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break; break;
case '0': network_ChannelJoin( 0 ); break;
case '1': network_ChannelJoin( 1 ); break;
case '2': network_ChannelJoin( 2 ); break;
case '3': network_ChannelJoin( 3 ); break;
case '4': network_ChannelJoin( 4 ); break;
case '5': network_ChannelJoin( 5 ); break;
case '6': network_ChannelJoin( 6 ); break;
case '7': network_ChannelJoin( 7 ); break;
case '8': network_ChannelJoin( 8 ); break;
case '9': network_ChannelJoin( 9 ); break;
default: default:
break; break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* netutils.c: various network functions * netutils.c: various network functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: netutils.c,v 1.66.2.1 2002/06/02 01:22:04 massiot Exp $ * $Id: netutils.c,v 1.66.2.2 2002/06/03 00:28:08 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
#include "netutils.h" #include "netutils.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "intf_playlist.h" #include "intf_playlist.h"
#include "network.h" #include "network.h"
...@@ -157,6 +160,26 @@ int network_ChannelJoin( int i_channel ) ...@@ -157,6 +160,26 @@ int network_ChannelJoin( int i_channel )
struct timeval delay; struct timeval delay;
fd_set fds; fd_set fds;
if( p_main->p_channel->i_channel == i_channel )
{
return 0;
}
/* FIXME: ugly hack to close input and outputs */
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
if( !config_GetIntVariable( "network-channel" ) ) if( !config_GetIntVariable( "network-channel" ) )
{ {
intf_ErrMsg( "network: channels disabled, to enable them, use the " intf_ErrMsg( "network: channels disabled, to enable them, use the "
...@@ -182,8 +205,7 @@ int network_ChannelJoin( int i_channel ) ...@@ -182,8 +205,7 @@ int network_ChannelJoin( int i_channel )
i_port = config_GetIntVariable( "channel-port" ); i_port = config_GetIntVariable( "channel-port" );
intf_WarnMsg( 5, "channel: connecting to %s:%d", intf_WarnMsg( 5, "channel: connecting to %s:%d", psz_vlcs, i_port );
psz_vlcs, i_port );
/* Prepare the network_socket_t structure */ /* Prepare the network_socket_t structure */
socket_desc.i_type = NETWORK_UDP; socket_desc.i_type = NETWORK_UDP;
...@@ -267,6 +289,8 @@ int network_ChannelJoin( int i_channel ) ...@@ -267,6 +289,8 @@ int network_ChannelJoin( int i_channel )
# define p_item \ # define p_item \
(&p_main->p_playlist->p_item[ p_main->p_playlist->i_index + 1]) (&p_main->p_playlist->p_item[ p_main->p_playlist->i_index + 1])
vlc_mutex_lock( &p_main->p_playlist->change_lock ); vlc_mutex_lock( &p_main->p_playlist->change_lock );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
if( p_item ) if( p_item )
{ {
free( p_item->psz_name ); free( p_item->psz_name );
......
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