Commit bf5a018c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

demux: Add INPUT_NAV_MENU

Currently DVD/BluRay menu call expects the menu to be in title 0.
It also seeks to chapter 2 or 0 (DVD menu type is selected by
selecting chapter). Using dedicated control allows the plugins to
decide how menu call should be handled.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 473920a5
......@@ -278,6 +278,8 @@ enum demux_query_e
DEMUX_NAV_RIGHT,
/** Activate the popup Menu (for BD). Can fail */
DEMUX_NAV_POPUP,
/** Activate disc Root Menu. Can fail */
DEMUX_NAV_MENU, /* res=can fail */
};
/*************************************************************************
......
......@@ -443,6 +443,8 @@ enum input_query_e
INPUT_NAV_RIGHT,
/** Activate the popup Menu (for BD). res=can fail */
INPUT_NAV_POPUP,
/** Activate disc Root Menu. res=can fail */
INPUT_NAV_MENU,
/* Meta datas */
INPUT_ADD_INFO, /* arg1= char* arg2= char* arg3=... res=can fail */
......
......@@ -142,6 +142,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
case INPUT_NAV_LEFT:
case INPUT_NAV_RIGHT:
case INPUT_NAV_POPUP:
case INPUT_NAV_MENU:
input_ControlPush( p_input, i_query - INPUT_NAV_ACTIVATE
+ INPUT_CONTROL_NAV_ACTIVATE, NULL );
return VLC_SUCCESS;
......
......@@ -1498,6 +1498,7 @@ static bool ControlIsSeekRequest( int i_type )
case INPUT_CONTROL_NAV_LEFT:
case INPUT_CONTROL_NAV_RIGHT:
case INPUT_CONTROL_NAV_POPUP:
case INPUT_CONTROL_NAV_MENU:
return true;
default:
return false;
......@@ -1977,6 +1978,7 @@ static bool Control( input_thread_t *p_input,
case INPUT_CONTROL_NAV_LEFT:
case INPUT_CONTROL_NAV_RIGHT:
case INPUT_CONTROL_NAV_POPUP:
case INPUT_CONTROL_NAV_MENU:
demux_Control( p_input->p->master->p_demux, i_type
- INPUT_CONTROL_NAV_ACTIVATE + DEMUX_NAV_ACTIVATE );
break;
......
......@@ -200,6 +200,7 @@ enum input_control_e
INPUT_CONTROL_NAV_LEFT,
INPUT_CONTROL_NAV_RIGHT,
INPUT_CONTROL_NAV_POPUP,
INPUT_CONTROL_NAV_MENU,
INPUT_CONTROL_SET_ES,
INPUT_CONTROL_RESTART_ES,
......
......@@ -113,6 +113,7 @@ static const vlc_input_callback_t p_input_navigation_callbacks[] =
CALLBACK( "next-title", TitleCallback ),
CALLBACK( "prev-title", TitleCallback ),
CALLBACK( "menu-popup", TitleCallback ),
CALLBACK( "menu-title", TitleCallback ),
CALLBACK( NULL, NULL )
};
......@@ -271,6 +272,13 @@ void input_ControlVarNavigation( input_thread_t *p_input )
var_AddCallback( p_input, "prev-title", TitleCallback, NULL );
}
if( var_Type( p_input, "menu-title" ) == 0 ) {
var_Create( p_input, "menu-title", VLC_VAR_VOID );
text.psz_string = _("Menu title");
var_Change( p_input, "menu-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "menu-title", TitleCallback, NULL );
}
if( var_Type( p_input, "menu-popup" ) == 0 ) {
var_Create( p_input, "menu-popup", VLC_VAR_VOID );
text.psz_string = _("Menu popup");
......@@ -680,6 +688,10 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
if( val.i_int >= 0 )
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val, NULL );
}
else if( !strcmp( psz_cmd, "menu-title" ) )
{
input_ControlPush( p_input, INPUT_CONTROL_NAV_MENU, NULL );
}
else if( !strcmp( psz_cmd, "menu-popup" ) )
{
input_ControlPush( p_input, INPUT_CONTROL_NAV_POPUP, NULL );
......
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