Commit ab1d6024 authored by Stéphane Borel's avatar Stéphane Borel

*More cleanification in gtk interface: now to change the

title/chapter/audio/spu/angle, we tell the input to do intead of doing
it inside the interface. It results in fewer locks during the changes.

*The dvd plugin reads again blocks of 32 sectors to gain speed since
there are no more lock-ups during stream change. I've also created a new
file that contain function to described video and audio streams with ifo
datas.

The changes are made only for gtk. We should update the other interfaces
soon (beos at least).

There is a memory corruption somewhere that make the vlc crash. I've no
idea where to search.
parent 62b322c2
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.36 2001/05/01 12:22:18 sam Exp $
* $Id: input_ext-intf.h,v 1.37 2001/05/19 00:39:29 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -196,6 +196,9 @@ typedef struct stream_descriptor_s
input_area_t ** pp_areas; /* list of areas in stream == offset
* interval with own properties */
input_area_t * p_selected_area;
input_area_t * p_new_area; /* Newly selected area from
* the interface */
u32 i_mux_rate; /* the rate we read the stream (in
* units of 50 bytes/s) ; 0 if undef */
......@@ -216,6 +219,10 @@ typedef struct stream_descriptor_s
es_descriptor_t ** pp_es; /* carried elementary streams */
int i_selected_es_number;
es_descriptor_t ** pp_selected_es; /* ES with a decoder */
es_descriptor_t * p_newly_selected_es; /* ES selected from
* the interface */
es_descriptor_t * p_removed_es; /* ES removed from the interface */
/* Stream control */
stream_ctrl_t control;
......@@ -346,3 +353,5 @@ int input_ChangeES ( struct input_thread_s *, struct es_descriptor_s *, u8 );
int input_ToggleES ( struct input_thread_s *,
struct es_descriptor_s *,
boolean_t );
int input_ChangeArea( input_thread_t *, input_area_t * );
......@@ -7,7 +7,7 @@
# Objects
#
PLUGIN_C = dvd.o input_dvd.o dvd_netlist.o dvd_ioctl.o dvd_ifo.o dvd_udf.o dvd_css.o
PLUGIN_C = dvd.o input_dvd.o dvd_netlist.o dvd_ioctl.o dvd_ifo.o dvd_udf.o dvd_css.o dvd_summary.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
......
......@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.28 2001/05/07 03:14:09 stef Exp $
* $Id: dvd_css.c,v 1.29 2001/05/19 00:39:29 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -48,7 +48,6 @@
#include "dvd_csstables.h"
#endif /* HAVE_CSS */
#include "dvd_ioctl.h"
#include "dvd_ifo.h"
#include "input_dvd.h"
......
......@@ -2,7 +2,7 @@
* dvd_css.h: Structures for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.h,v 1.7 2001/04/11 04:31:59 sam Exp $
* $Id: dvd_css.h,v 1.8 2001/05/19 00:39:29 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -55,3 +55,12 @@ typedef struct css_s
dvd_key_t pi_title_key;
} css_t;
/*****************************************************************************
* Prototypes in dvd_css.c
*****************************************************************************/
struct css_s;
int CSSTest ( int );
int CSSInit ( int, struct css_s * );
int CSSGetKey ( int, struct css_s * );
int CSSDescrambleSector ( u8 * , u8 * );
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.26 2001/05/07 04:42:42 sam Exp $
* $Id: dvd_ifo.c,v 1.27 2001/05/19 00:39:29 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -43,7 +43,6 @@
#include "intf_msg.h"
#include "dvd_ifo.h"
#include "dvd_udf.h"
#include "dvd_css.h"
#include "input_dvd.h"
/*
......@@ -508,6 +507,7 @@ int IfoTitleSet( ifo_t * p_ifo )
off_t i_off;
off_t i_start;
u64 i_temp;
u16 i_short;
int i, j;
if( p_ifo->vts.b_initialized )
......@@ -570,8 +570,27 @@ DumpBits( p_ifo, pi_buffer, &p_current, 2 );
/* FIXME : take care of endianness */
}
DumpBits( p_ifo, pi_buffer, &p_current, 2 );
// GETS( &manager_inf.video_atrt );
DumpBits( p_ifo, pi_buffer, &p_current, 2 );
i_short = ReadWord( p_ifo, pi_buffer, &p_current );
i_short >>= 2;
manager_inf.video_attr.i_mode = i_short & 0x1;
i_short >>= 1;
manager_inf.video_attr.i_letterboxed = i_short & 0x1;
i_short >>= 1;
manager_inf.video_attr.i_source_res = i_short & 0x3;
i_short >>= 2;
manager_inf.video_attr.i_line21_2 = i_short & 0x1;
i_short >>= 1;
manager_inf.video_attr.i_line21_1 = i_short & 0x1;
i_short >>= 1;
manager_inf.video_attr.i_perm_displ = i_short & 0x3;
i_short >>= 2;
manager_inf.video_attr.i_ratio = i_short & 0x3;
i_short >>= 2;
manager_inf.video_attr.i_system = i_short & 0x3;
i_short >>= 2;
manager_inf.video_attr.i_compression = i_short & 0x3;
DumpBits( p_ifo, pi_buffer, &p_current, 1 );
manager_inf.i_audio_nb = ReadByte( p_ifo, pi_buffer, &p_current );
//fprintf( stderr, "vtsi audio nb : %d\n", manager_inf.i_audio_nb );
......@@ -613,7 +632,9 @@ DumpBits( p_ifo, pi_buffer, &p_current, 2 );
i_temp = hton64( i_temp ) >> 16;
//fprintf( stderr, "Subpic %d: %llx\n", i, i_temp );
manager_inf.p_spu_attr[i].i_caption = i_temp & 0xff;
i_temp >>= 16;
i_temp >>= 8;
manager_inf.p_spu_attr[i].i_foo = i_temp & 0xff;
i_temp >>= 8;
manager_inf.p_spu_attr[i].i_lang_code = i_temp & 0xffff;
i_temp >>= 16;
manager_inf.p_spu_attr[i].i_prefix = i_temp & 0xffff;
......@@ -929,6 +950,8 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, off_t i_pos )
u8 pi_buffer[DVD_LB_SIZE];
u8 * p_current;
off_t i_start;
u16 i_audio;
u32 i_spu;
int i;
p_current = FillBuffer( p_ifo, pi_buffer, i_pos );
......@@ -945,11 +968,25 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, off_t i_pos )
p_title->i_prohibited_user_op = ReadDouble( p_ifo, pi_buffer, &p_current );
for( i = 0 ; i < 8 ; i++ )
{
p_title->pi_audio_status[i] = ReadWord( p_ifo, pi_buffer, &p_current );
i_audio = ReadWord( p_ifo, pi_buffer, &p_current );
p_title->pi_audio_status[i].i_foo = i_audio & 0xff;
i_audio >>= 8;
p_title->pi_audio_status[i].i_position = i_audio & 0x07;
i_audio >>= 7;
p_title->pi_audio_status[i].i_available = i_audio;
}
for( i = 0 ; i < 32 ; i++ )
{
p_title->pi_subpic_status[i] = ReadDouble( p_ifo, pi_buffer, &p_current );
i_spu = ReadDouble( p_ifo, pi_buffer, &p_current );
p_title->pi_spu_status[i].i_position_pan = i_spu & 0x1f;
i_spu >>= 8;
p_title->pi_spu_status[i].i_position_letter = i_spu & 0x1f;
i_spu >>= 8;
p_title->pi_spu_status[i].i_position_wide = i_spu & 0x1f;
i_spu >>= 8;
p_title->pi_spu_status[i].i_position_43 = i_spu & 0x1f;
i_spu >>= 7;
p_title->pi_spu_status[i].i_available = i_spu;
}
p_title->i_next_title_num = ReadWord( p_ifo, pi_buffer, &p_current );
p_title->i_prev_title_num = ReadWord( p_ifo, pi_buffer, &p_current );
......
......@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.h,v 1.14 2001/04/22 00:08:25 stef Exp $
* $Id: dvd_ifo.h,v 1.15 2001/05/19 00:39:30 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -65,6 +65,14 @@ typedef struct ifo_audio_s
u8 i_bar ;// 8; // 0x00000000 ?
} ifo_audio_t;
/* Audio Status */
typedef struct audio_status_s
{
u8 i_available; // 1
u8 i_position; // 7
u8 i_foo; // 8
} audio_status_t;
typedef struct ifo_spu_t
{
u16 i_prefix ;// 16; // 0x0100 ?
......@@ -73,6 +81,15 @@ typedef struct ifo_spu_t
u8 i_caption ;// 8; // 0x00 ?
} ifo_spu_t;
/* Subpicture status */
typedef struct spu_status_s
{
u8 i_available; //1
u8 i_position_43; //7
u8 i_position_wide; //8
u8 i_position_letter; //8
u8 i_position_pan; //8
} spu_status_t;
/* Ifo vitual machine Commands */
......@@ -153,8 +170,8 @@ typedef struct title_s
u8 i_cell_nb; // 1 byte
u32 i_play_time; // 4 bytes
u32 i_prohibited_user_op; // 4 bytes
u16 pi_audio_status[8]; // 8*2 bytes
u32 pi_subpic_status[32]; // 32*4 bytes
audio_status_t pi_audio_status[8]; // 8*2 bytes
spu_status_t pi_spu_status[32]; // 32*4 bytes
u16 i_next_title_num; // 2 bytes
u16 i_prev_title_num; // 2 bytes
u16 i_go_up_title_num; // 2 bytes
......@@ -530,3 +547,13 @@ typedef struct ifo_s
vts_t vts; /* Vts ifo for current title set */
} ifo_t;
/*****************************************************************************
* Prototypes in dvd_ifo.c
*****************************************************************************/
struct thread_dvd_data_s;
int IfoCreate ( struct thread_dvd_data_s * );
int IfoInit ( struct ifo_s * );
int IfoTitleSet ( struct ifo_s * );
void IfoDestroy ( struct ifo_s * );
This diff is collapsed.
/*****************************************************************************
* dvd_summary.h: prototype of functions that print out current options.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_summary.h,v 1.1 2001/05/19 00:39:30 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* 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.
*****************************************************************************/
struct thread_dvd_data_s;
char * IfoLanguage( u16 );
void IfoPrintTitle( struct thread_dvd_data_s * );
void IfoPrintVideo( struct thread_dvd_data_s * );
void IfoPrintAudio( struct thread_dvd_data_s *, int );
void IfoPrintSpu ( struct thread_dvd_data_s *, int );
This diff is collapsed.
......@@ -2,7 +2,7 @@
* input_dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dvd.h,v 1.21 2001/04/22 00:08:26 stef Exp $
* $Id: input_dvd.h,v 1.22 2001/05/19 00:39:30 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -40,7 +40,6 @@ typedef struct thread_dvd_data_s
/* Navigation information */
int i_title;
int i_vts_title;
int i_title_id;
int i_chapter_nb;
......@@ -67,19 +66,3 @@ typedef struct thread_dvd_data_s
struct ifo_s * p_ifo;
} thread_dvd_data_t;
/*****************************************************************************
* Prototypes in dvd_css.c
*****************************************************************************/
int CSSTest ( int );
int CSSInit ( int, struct css_s * );
int CSSGetKey ( int, struct css_s * );
int CSSDescrambleSector ( u8 * , u8 * );
/*****************************************************************************
* Prototypes in dvd_ifo.c
*****************************************************************************/
int IfoCreate ( struct thread_dvd_data_s * );
int IfoInit ( struct ifo_s * );
int IfoTitleSet ( struct ifo_s * );
void IfoDestroy ( struct ifo_s * );
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.18 2001/05/15 14:49:48 stef Exp $
* $Id: gtk_callbacks.c,v 1.19 2001/05/19 00:39:30 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -200,11 +200,12 @@ void GtkTitlePrev( GtkButton * button, gpointer user_data )
if( i_id > 0 )
{
p_area = p_intf->p_input->stream.pp_areas[i_id];
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
GtkSetupMenus( p_intf );
}
}
......@@ -221,11 +222,12 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
if( i_id < p_intf->p_input->stream.i_area_nb )
{
p_area = p_intf->p_input->stream.pp_areas[i_id];
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
GtkSetupMenus( p_intf );
}
}
......@@ -242,11 +244,12 @@ void GtkChapterPrev( GtkButton * button, gpointer user_data )
if( p_area->i_part > 0 )
{
p_area->i_part--;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
GtkSetupMenus( p_intf );
}
}
......@@ -262,11 +265,12 @@ void GtkChapterNext( GtkButton * button, gpointer user_data )
if( p_area->i_part < p_area->i_part_nb )
{
p_area->i_part++;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
GtkSetupMenus( p_intf );
}
}
......@@ -274,8 +278,7 @@ void GtkChapterNext( GtkButton * button, gpointer user_data )
* About box
****************************************************************************/
gboolean
GtkAboutShow (GtkWidget *widget,
gboolean GtkAboutShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
......@@ -305,8 +308,7 @@ void GtkAboutOk( GtkButton * button, gpointer user_data)
* Jump box
****************************************************************************/
gboolean
GtkJumpShow (GtkWidget *widget,
gboolean GtkJumpShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
......@@ -326,8 +328,7 @@ GtkJumpShow (GtkWidget *widget,
}
void
GtkJumpOk (GtkButton *button,
void GtkJumpOk( GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf;
......@@ -365,8 +366,7 @@ GtkJumpOk (GtkButton *button,
}
void
GtkJumpCancel (GtkButton *button,
void GtkJumpCancel( GtkButton *button,
gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
......@@ -404,11 +404,3 @@ void GtkJumpActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkJumpShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkPlaylistDestroy (GtkObject *object,
gpointer user_data)
{
}
......@@ -33,7 +33,3 @@ void GtkWindowToggleActivate( GtkMenuItem *, gpointer );
void GtkFullscreenActivate ( GtkMenuItem *, gpointer );
void GtkAboutActivate ( GtkMenuItem *, gpointer );
void GtkJumpActivate ( GtkMenuItem *, gpointer );
void
GtkPlaylistDestroy (GtkObject *object,
gpointer user_data);
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gtk_menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_menu.h,v 1.2 2001/05/15 14:49:48 stef Exp $
* $Id: gtk_menu.h,v 1.3 2001/05/19 00:39:30 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
......@@ -21,3 +21,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
struct intf_thread_s;
gint GtkSetupMenus( struct intf_thread_s * );
......@@ -2,7 +2,7 @@
* gtk_playlist.h : Playlist functions for the Gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_playlist.h,v 1.3 2001/05/15 14:49:48 stef Exp $
* $Id: gtk_playlist.h,v 1.4 2001/05/19 00:39:30 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -50,3 +50,13 @@ void GtkPlaylistActivate ( GtkMenuItem *, gpointer );
void GtkNextActivate ( GtkMenuItem *, gpointer );
void GtkPrevActivate ( GtkMenuItem *, gpointer );
struct intf_thread_s;
struct playlist_s;
void GtkDropDataReceived ( struct intf_thread_s *, GtkSelectionData *,
guint, int );
int GtkAppendList ( struct playlist_s *, int, GList * );
void GtkRebuildCList ( GtkCList *, struct playlist_s * );
void GtkPlayListManage ( struct intf_thread_s * );
......@@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.19 2001/05/15 14:49:48 stef Exp $
* $Id: intf_gtk.c,v 1.20 2001/05/19 00:39:30 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -312,7 +312,7 @@ static gint GtkManage( gpointer p_data )
}
/* update the playlist */
GtkPlayListManage( p_data );
// GtkPlayListManage( p_data );
if( p_intf->p_input != NULL && !p_intf->b_die )
{
......@@ -357,9 +357,15 @@ static gint GtkManage( gpointer p_data )
}
#undef p_area
}
GtkSetupMenu( p_intf );
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
if( p_intf->p_sys->i_part !=
p_intf->p_input->stream.p_selected_area->i_part )
{
p_intf->p_sys->b_chapter_update = 1;
GtkSetupMenus( p_intf );
}
}
else if( !p_intf->b_die )
{
......
......@@ -2,7 +2,7 @@
* intf_gtk.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.h,v 1.4 2001/05/15 01:01:44 stef Exp $
* $Id: intf_gtk.h,v 1.5 2001/05/19 00:39:30 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -99,21 +99,4 @@ typedef struct intf_sys_s
} intf_sys_t;
/****************************************************************************
* Prototypes
****************************************************************************/
/*
* from gtk_menu.c
*/
gint GtkSetupMenu( intf_thread_t * );
/*
* from gtk_playlist.c
*/
void GtkDropDataReceived ( intf_thread_t *, GtkSelectionData *,
guint, int );
int GtkAppendList ( playlist_t *, int, GList * );
void GtkRebuildCList ( GtkCList *, playlist_t * );
void GtkPlayListManage ( intf_thread_t * );
......@@ -2,7 +2,7 @@
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.5 2001/05/15 01:01:44 stef Exp $
* $Id: aout_spdif.c,v 1.6 2001/05/19 00:39:30 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -90,10 +90,10 @@ void aout_SpdifThread( aout_thread_t * p_aout )
/* TODO: write the muliplexer :) */
if( p_aout->fifo[i_fifo].i_type == AOUT_ADEC_SPDIF_FIFO )
{
// vlc_mutex_lock( &p_aout->fifo[i_fifo].data_lock );
vlc_mutex_lock( &p_aout->fifo[i_fifo].data_lock );
if( p_aout->fifo[i_fifo].b_die )
{
// vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
aout_FreeFifo( &p_aout->fifo[i_fifo] );
}
else if( !AOUT_FIFO_ISEMPTY( p_aout->fifo[i_fifo] ) )
......@@ -112,11 +112,15 @@ void aout_SpdifThread( aout_thread_t * p_aout )
p_aout->fifo[i_fifo].l_start_frame =
(p_aout->fifo[i_fifo].l_start_frame + 1 )
& AOUT_FIFO_SIZE;
// vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
i_frame++;
i_blank = 0;
}
else
{
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
}
}
}
if( !i_frame )
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.107 2001/05/07 03:14:09 stef Exp $
* $Id: input.c,v 1.108 2001/05/19 00:39:30 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -133,6 +133,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->stream.i_area_nb = 0;
p_input->stream.pp_areas = NULL;
p_input->stream.p_selected_area = NULL;
p_input->stream.p_new_area = NULL;
/* By default there is one areas in a stream */
input_AddArea( p_input );
p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
......@@ -239,6 +240,12 @@ static void RunThread( input_thread_t *p_input )
vlc_mutex_lock( &p_input->stream.stream_lock );
if( p_input->stream.p_new_area )
{
p_input->pf_set_area( p_input, p_input->stream.p_new_area );
p_input->stream.p_new_area = NULL;
}
if( p_input->stream.p_selected_area->i_seek != NO_SEEK )
{
if( p_input->stream.b_seekable && p_input->pf_seek != NULL )
......@@ -261,6 +268,18 @@ static void RunThread( input_thread_t *p_input )
p_input->stream.p_selected_area->i_seek = NO_SEEK;
}
if( p_input->stream.p_removed_es )
{
input_UnselectES( p_input, p_input->stream.p_removed_es );
p_input->stream.p_removed_es = NULL;
}
if( p_input->stream.p_newly_selected_es )
{
input_SelectES( p_input, p_input->stream.p_newly_selected_es );
p_input->stream.p_newly_selected_es = NULL;
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
i_error = p_input->pf_read( p_input, pp_packets );
......
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-intf.c,v 1.23 2001/05/07 03:14:09 stef Exp $
* $Id: input_ext-intf.c,v 1.24 2001/05/19 00:39:30 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -236,8 +236,9 @@ void input_DumpStream( input_thread_t * p_input )
/*****************************************************************************
* input_ChangeES: answers to a user request with calls to (Un)SelectES
* ---
*****************************************************************************
* Useful since the interface plugins know p_es
* This functon is deprecated, use input_ToggleEs instead.
*****************************************************************************/
int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
u8 i_cat )
......@@ -317,11 +318,11 @@ int input_ToggleES( input_thread_t * p_input, es_descriptor_t * p_es,
{
if( b_select )
{
input_SelectES( p_input, p_es );
p_input->stream.p_newly_selected_es = p_es;
}
else
{
input_UnselectES( p_input, p_es );
p_input->stream.p_removed_es = p_es;
}
}
......@@ -329,3 +330,17 @@ int input_ToggleES( input_thread_t * p_input, es_descriptor_t * p_es,
return 0;
}
/****************************************************************************
* input_ChangeArea: interface request an area change
****************************************************************************/
int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_new_area = p_area;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0;
}
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.55 2001/05/01 12:22:18 sam Exp $
* $Id: input_programs.c,v 1.56 2001/05/19 00:39:30 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -64,6 +64,8 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
p_input->stream.b_changed = 0;
p_input->stream.pp_es = NULL;
p_input->stream.pp_selected_es = NULL;
p_input->stream.p_removed_es = NULL;
p_input->stream.p_newly_selected_es = NULL;
p_input->stream.pp_programs = NULL;
if( i_data_len )
......@@ -673,19 +675,11 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
vlc_mutex_lock( &p_input->stream.stream_lock );
}
break;
#if 0
case LPCM_AUDIO_ES:
if( p_main->b_audio )
{
if( p_main->b_spdif )
{
decoder.pf_create_thread = spdif_CreateThread;
}
else
{
intf_ErrMsg( "input error: LPCM audio not handled yet" );
break;
}
p_config = (void *)GetAdecConfig( p_input, p_es );
......@@ -696,7 +690,6 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
vlc_mutex_lock( &p_input->stream.stream_lock );
}
break;
#endif
case DVD_SPU_ES:
if( p_main->b_video )
{
......
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