#include <vlc_atomic.h>
#include <vlc_dialog.h> /* BD+/AACS warnings */
#include <vlc_vout.h> /* vout_PutSubpicture / subpicture_t */
-#include <vlc_url.h> /* vlc_path2uri */
+#include <vlc_url.h> /* vlc_path2uri */
#include <libbluray/bluray.h>
#include <libbluray/keys.h>
#define BD_MENU_TEXT N_( "Blu-ray menus" )
#define BD_MENU_LONGTEXT N_( "Use Blu-ray menus. If disabled, "\
"the movie will start directly" )
+#define BD_REGION_TEXT N_( "Region code" )
+#define BD_REGION_LONGTEXT N_( "Blu-Ray player region code. "\
+ "Some discs can be played only with a correct region code.")
+
+static const char *const ppsz_region_code[] = {
+ "A", "B", "C" };
+static const char *const ppsz_region_code_text[] = {
+ "Region A", "Region B", "Region C" };
+
+#define REGION_DEFAULT 1 /* Index to region list. Actual region code is (1<<REGION_DEFAULT) */
/* Callbacks */
static int blurayOpen ( vlc_object_t * );
set_subcategory( SUBCAT_INPUT_ACCESS )
set_capability( "access_demux", 200)
add_bool( "bluray-menu", false, BD_MENU_TEXT, BD_MENU_LONGTEXT, false )
+ add_string( "bluray-region", ppsz_region_code[REGION_DEFAULT], BD_REGION_TEXT, BD_REGION_LONGTEXT, false)
+ change_string_list( ppsz_region_code, ppsz_region_code_text )
add_shortcut( "bluray", "file" )
}
}
+ /* set player region code */
+ char *psz_region = var_InheritString(p_demux, "bluray-region");
+ unsigned int region = psz_region ? (psz_region[0] - 'A') : REGION_DEFAULT;
+ free(psz_region);
+ bd_set_player_setting(p_sys->bluray, BLURAY_PLAYER_SETTING_REGION_CODE, 1<<region);
+
/* Get titles and chapters */
p_sys->p_meta = bd_get_meta(p_sys->bluray);
if (!p_sys->p_meta)
subpicture_region_t *p_src = p_overlay->p_regions;
if (!p_src)
+ {
+ vlc_mutex_unlock(&p_overlay->lock);
return;
+ }
subpicture_region_t **p_dst = &(p_subpic->p_region);
while (p_src != NULL) {
return VLC_SUCCESS;
}
+static int sendKeyEvent(demux_sys_t *p_sys, unsigned int key)
+{
+ mtime_t now = mdate();
+ if (bd_user_input(p_sys->bluray, now, key) < 0) {
+ return VLC_EGENERIC;
+ }
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* libbluray overlay handling:
*****************************************************************************/
return VLC_SUCCESS;
}
+ case DEMUX_NAV_ACTIVATE:
+ return sendKeyEvent(p_sys, BD_VK_ENTER);
+ case DEMUX_NAV_UP:
+ return sendKeyEvent(p_sys, BD_VK_UP);
+ case DEMUX_NAV_DOWN:
+ return sendKeyEvent(p_sys, BD_VK_DOWN);
+ case DEMUX_NAV_LEFT:
+ return sendKeyEvent(p_sys, BD_VK_LEFT);
+ case DEMUX_NAV_RIGHT:
+ return sendKeyEvent(p_sys, BD_VK_RIGHT);
+
case DEMUX_CAN_RECORD:
case DEMUX_GET_FPS:
case DEMUX_SET_GROUP: