Commit 38b5689a authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dvdplay/*: support for dvd menus navigation ("dvd_menus" object variable).
* modules/gui/wxwindows/menus.cpp: support for dvd menus navigation.
* src/input/input_programs.c: programs object var was not reset correctly.
parent e69c7de6
$Id: NEWS,v 1.63 2003/08/10 21:26:07 gbazin Exp $ $Id: NEWS,v 1.64 2003/08/13 01:45:13 gbazin Exp $
Changes between 0.6.1 and 0.6.2: Changes between 0.6.1 and 0.6.2:
--------------------------------- ---------------------------------
...@@ -14,6 +14,9 @@ Access input: ...@@ -14,6 +14,9 @@ Access input:
* Support for DVB-S/C/T cards using v4l2 API for Linux 2.6.x kernels. * Support for DVB-S/C/T cards using v4l2 API for Linux 2.6.x kernels.
* Few fixes to the VCD navigation. * Few fixes to the VCD navigation.
Interfaces:
* Support for DVD menus navigation added to the wxWindows interface.
UNIX ports: UNIX ports:
* ALSA multi-channel support fixed and tested. * ALSA multi-channel support fixed and tested.
* Fixed fullscreen with gnome metacity. * Fixed fullscreen with gnome metacity.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* access.c: access capabilities for dvdplay plugin. * access.c: access capabilities for dvdplay plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: access.c,v 1.18 2003/05/08 19:06:44 titer Exp $ * $Id: access.c,v 1.19 2003/08/13 01:45:13 gbazin Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -65,6 +65,10 @@ static void pf_vmg_callback ( void*, dvdplay_event_t ); ...@@ -65,6 +65,10 @@ static void pf_vmg_callback ( void*, dvdplay_event_t );
static int dvdNewArea( input_thread_t *, input_area_t * ); static int dvdNewArea( input_thread_t *, input_area_t * );
static int dvdNewPGC ( input_thread_t * ); static int dvdNewPGC ( input_thread_t * );
static int MenusCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
/***************************************************************************** /*****************************************************************************
* OpenDVD: open libdvdplay * OpenDVD: open libdvdplay
*****************************************************************************/ *****************************************************************************/
...@@ -79,6 +83,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -79,6 +83,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
unsigned int i_chapter; unsigned int i_chapter;
unsigned int i_angle; unsigned int i_angle;
unsigned int i; unsigned int i;
vlc_value_t val, text;
p_dvd = malloc( sizeof(dvd_data_t) ); p_dvd = malloc( sizeof(dvd_data_t) );
if( p_dvd == NULL ) if( p_dvd == NULL )
...@@ -191,6 +196,27 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -191,6 +196,27 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
var_Create( p_input, "highlight", VLC_VAR_BOOL ); var_Create( p_input, "highlight", VLC_VAR_BOOL );
var_Create( p_input, "highlight-mutex", VLC_VAR_MUTEX ); var_Create( p_input, "highlight-mutex", VLC_VAR_MUTEX );
/* Create a few object variables used for navigation in the interfaces */
var_Create( p_input, "dvd_menus",
VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND );
text.psz_string = _("DVD menus");
var_Change( p_input, "dvd_menus", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "dvd_menus", MenusCallback, NULL );
val.i_int = ROOT_MENU; text.psz_string = _("Root");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = TITLE_MENU; text.psz_string = _("Title");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = PART_MENU; text.psz_string = _("Chapter");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = SUBPICTURE_MENU; text.psz_string = _("Subtitle");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = AUDIO_MENU; text.psz_string = _("Audio");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = ANGLE_MENU; text.psz_string = _("Angle");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
val.i_int = 99; text.psz_string = _("Resume");
var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text );
return 0; return 0;
} }
...@@ -286,7 +312,6 @@ static int dvdplay_SetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -286,7 +312,6 @@ static int dvdplay_SetArea( input_thread_t * p_input, input_area_t * p_area )
dvdNewArea( p_input, p_area ); dvdNewArea( p_input, p_area );
/* Reinit ES */
dvdNewPGC( p_input ); dvdNewPGC( p_input );
dvdplay_start( p_dvd->vmg, p_area->i_id ); dvdplay_start( p_dvd->vmg, p_area->i_id );
...@@ -411,11 +436,15 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event ) ...@@ -411,11 +436,15 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event )
} }
/* new pgc in same title: reinit ES */ /* new pgc in same title: reinit ES */
dvdplay_ES( p_input );
dvdNewPGC( p_input ); dvdNewPGC( p_input );
p_input->stream.b_changed = 1; p_input->stream.b_changed = 1;
break; break;
case JUMP:
dvdplay_ES( p_input );
dvdNewPGC( p_input );
case NEW_PG: case NEW_PG:
/* update current chapter */ /* update current chapter */
p_input->stream.p_selected_area->i_part = p_input->stream.p_selected_area->i_part =
...@@ -438,9 +467,6 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event ) ...@@ -438,9 +467,6 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event )
case END_OF_CELL: case END_OF_CELL:
p_dvd->b_end_of_cell = 1; p_dvd->b_end_of_cell = 1;
break; break;
case JUMP:
dvdplay_ES( p_input );
break;
case STILL_TIME: case STILL_TIME:
/* we must pause only from demux /* we must pause only from demux
* when the data in cache has been decoded */ * when the data in cache has been decoded */
...@@ -534,6 +560,9 @@ static int dvdNewArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -534,6 +560,9 @@ static int dvdNewArea( input_thread_t * p_input, input_area_t * p_area )
/* No PSM to read in DVD mode, we already have all information */ /* No PSM to read in DVD mode, we already have all information */
p_input->stream.p_selected_program->b_is_ok = 1; p_input->stream.p_selected_program->b_is_ok = 1;
/* Reinit ES */
dvdplay_ES( p_input );
/* Update the navigation variables without triggering a callback */ /* Update the navigation variables without triggering a callback */
val.i_int = p_area->i_id; val.i_int = p_area->i_id;
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "title", VLC_VAR_SETVALUE, &val, NULL );
...@@ -553,19 +582,8 @@ static int dvdNewArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -553,19 +582,8 @@ static int dvdNewArea( input_thread_t * p_input, input_area_t * p_area )
static int dvdNewPGC( input_thread_t * p_input ) static int dvdNewPGC( input_thread_t * p_input )
{ {
dvd_data_t * p_dvd; dvd_data_t * p_dvd = (dvd_data_t*)p_input->p_access_data;
// int i_audio_nr = -1;
// int i_audio = -1;
// int i_subp_nr = -1;
// int i_subp = -1;
// int i_sec;
p_dvd = (dvd_data_t*)p_input->p_access_data;
// dvdplay_audio_info( p_dvd->vmg, &i_audio_nr, &i_audio );
// dvdplay_subp_info( p_dvd->vmg, &i_subp_nr, &i_subp );
dvdplay_ES( p_input );
p_input->stream.p_selected_area->i_start = p_input->stream.p_selected_area->i_start =
LB2OFF( dvdplay_title_first( p_dvd->vmg ) ); LB2OFF( dvdplay_title_first( p_dvd->vmg ) );
p_input->stream.p_selected_area->i_size = p_input->stream.p_selected_area->i_size =
...@@ -582,11 +600,26 @@ static int dvdNewPGC( input_thread_t * p_input ) ...@@ -582,11 +600,26 @@ static int dvdNewPGC( input_thread_t * p_input )
p_input->stream.b_seekable = 0; p_input->stream.b_seekable = 0;
} }
#if 0
i_sec = dvdplay_title_time( p_dvd->vmg );
msg_Dbg( p_input, "title time: %d:%02d:%02d (%d)",
i_sec/3600, (i_sec%3600)/60, i_sec%60, i_sec );
#endif
return 0; return 0;
} }
static int MenusCallback( vlc_object_t *p_this, char const *psz_name,
vlc_value_t oldval, vlc_value_t newval, void *p_arg )
{
input_thread_t * p_input;
dvd_data_t * p_dvd;
p_input = (input_thread_t*)p_this;
p_dvd = (dvd_data_t*)p_input->p_access_data;
vlc_mutex_lock( &p_input->stream.stream_lock );
if( newval.i_int < 99 )
dvdplay_menu( p_dvd->vmg, newval.i_int, 0 );
else
dvdplay_resume( p_dvd->vmg );
vlc_mutex_unlock( &p_input->stream.stream_lock );
if( p_dvd->p_intf ) dvdIntfResetStillTime( p_dvd->p_intf );
return VLC_SUCCESS;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.c: interface for DVD video manager * intf.c: interface for DVD video manager
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.6 2003/01/29 15:55:44 sam Exp $ * $Id: intf.c,v 1.7 2003/08/13 01:45:13 gbazin Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -424,3 +424,15 @@ int dvdIntfStillTime( intf_thread_t *p_intf, int i_sec ) ...@@ -424,3 +424,15 @@ int dvdIntfStillTime( intf_thread_t *p_intf, int i_sec )
return VLC_SUCCESS; return VLC_SUCCESS;
} }
/*****************************************************************************
* dvdIntfStillTime: function provided to reset still image
*****************************************************************************/
int dvdIntfResetStillTime( intf_thread_t *p_intf )
{
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->m_still_time = 0;
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: send info to intf. * intf.h: send info to intf.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf.h,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: intf.h,v 1.2 2003/08/13 01:45:13 gbazin Exp $
* *
* Author: Stéphane Borel <stef@via.ecp.fr> * Author: Stéphane Borel <stef@via.ecp.fr>
* *
...@@ -22,3 +22,4 @@ ...@@ -22,3 +22,4 @@
*****************************************************************************/ *****************************************************************************/
int dvdIntfStillTime( struct intf_thread_t *, int ); int dvdIntfStillTime( struct intf_thread_t *, int );
int dvdIntfResetStillTime( intf_thread_t *p_intf );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc * menus.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.17 2003/07/20 10:38:49 gbazin Exp $ * $Id: menus.cpp,v 1.18 2003/08/13 01:45:13 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -169,9 +169,11 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent, ...@@ -169,9 +169,11 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter"; ppsz_varnames[i] = "chapter";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "program";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "navigation"; ppsz_varnames[i] = "navigation";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "program"; ppsz_varnames[i] = "dvd_menus";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "video-es"; ppsz_varnames[i] = "video-es";
...@@ -294,9 +296,11 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent ) ...@@ -294,9 +296,11 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter"; ppsz_varnames[i] = "chapter";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "program";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "navigation"; ppsz_varnames[i] = "navigation";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "program"; ppsz_varnames[i] = "dvd_menus";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "prev-title"; ppsz_varnames[i] = "prev-title";
...@@ -518,8 +522,10 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object ) ...@@ -518,8 +522,10 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object )
new wxMenuItemExt( menu, ++i_item_id, new wxMenuItemExt( menu, ++i_item_id,
wxU(text_list.p_list->p_values[i].psz_string ? wxU(text_list.p_list->p_values[i].psz_string ?
text_list.p_list->p_values[i].psz_string : text_list.p_list->p_values[i].psz_string :
another_val.psz_string), another_val.psz_string), wxT(""),
wxT(""), wxITEM_RADIO, strdup(psz_var), i_type & VLC_VAR_ISCOMMAND ?
wxITEM_NORMAL : wxITEM_RADIO,
strdup(psz_var),
p_object->i_object_id, another_val, i_type ); p_object->i_object_id, another_val, i_type );
menu->Append( menuitem ); menu->Append( menuitem );
...@@ -536,8 +542,10 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object ) ...@@ -536,8 +542,10 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object )
(wxString)wxU( (wxString)wxU(
text_list.p_list->p_values[i].psz_string) : text_list.p_list->p_values[i].psz_string) :
wxString::Format(wxT("%d"), wxString::Format(wxT("%d"),
val_list.p_list->p_values[i].i_int), val_list.p_list->p_values[i].i_int), wxT(""),
wxT(""), wxITEM_RADIO, strdup(psz_var), i_type & VLC_VAR_ISCOMMAND ?
wxITEM_NORMAL : wxITEM_RADIO,
strdup(psz_var),
p_object->i_object_id, p_object->i_object_id,
val_list.p_list->p_values[i], i_type ); val_list.p_list->p_values[i], i_type );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2002 VideoLAN * Copyright (C) 1999-2002 VideoLAN
* $Id: input_programs.c,v 1.116 2003/07/30 21:09:06 gbazin Exp $ * $Id: input_programs.c,v 1.117 2003/08/13 01:45:13 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -271,7 +271,7 @@ void input_DelProgram( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm ) ...@@ -271,7 +271,7 @@ void input_DelProgram( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm )
return; return;
} }
val.i_int = i_pgrm_index; val.i_int = p_input->stream.pp_programs[i_pgrm_index]->i_number;
var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL ); var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL );
/* Free the structures that describe the es that belongs to that program */ /* Free the structures that describe the es that belongs to that program */
......
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