[libbluray-devel] 3D PSRs
hpi1
git at videolan.org
Wed Aug 29 13:32:22 CEST 2012
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Aug 20 22:35:10 2012 +0300| [5adc61971f8831385d691e855662d25789daee9d] | committer: hpi1
3D PSRs
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=5adc61971f8831385d691e855662d25789daee9d
---
src/libbluray/bluray.c | 8 ++++++++
src/libbluray/bluray.h | 7 +++++++
src/libbluray/hdmv/mobj_print.c | 8 ++++----
src/libbluray/register.c | 23 ++++++++++++++---------
src/libbluray/register.h | 4 ++++
5 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 935264b..bcd3bc2 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1874,6 +1874,9 @@ int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
{ BLURAY_PLAYER_SETTING_MENU_LANG, PSR_MENU_LANG },
{ BLURAY_PLAYER_SETTING_COUNTRY_CODE, PSR_COUNTRY },
{ BLURAY_PLAYER_SETTING_REGION_CODE, PSR_REGION },
+ { BLURAY_PLAYER_SETTING_OUTPUT_PREFER, PSR_OUTPUT_PREFER },
+ { BLURAY_PLAYER_SETTING_DISPLAY_CAP, PSR_DISPLAY_CAP },
+ { BLURAY_PLAYER_SETTING_3D_CAP, PSR_3D_CAP },
{ BLURAY_PLAYER_SETTING_VIDEO_CAP, PSR_VIDEO_CAP },
{ BLURAY_PLAYER_SETTING_TEXT_CAP, PSR_TEXT_CAP },
{ BLURAY_PLAYER_SETTING_PLAYER_PROFILE, PSR_PROFILE_VERSION },
@@ -2052,6 +2055,11 @@ static void _process_psr_change_event(BLURAY *bd, BD_PSR_EVENT *ev)
}
break;
+ /* 3D status */
+ case PSR_3D_STATUS:
+ _queue_event(bd, (BD_EVENT){BD_EVENT_STEREOSCOPIC_STATUS, ev->new_val & 1});
+ break;
+
default:;
}
}
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 411443f..97a26f4 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -464,6 +464,9 @@ typedef enum {
BLURAY_PLAYER_SETTING_MENU_LANG = 18, /* Initial menu language: ISO 639-2 string, ex. "eng" */
BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19, /* Player country code: ISO 3166-1 string, ex. "de" */
BLURAY_PLAYER_SETTING_REGION_CODE = 20, /* Player region code: 1 - region A, 2 - B, 4 - C */
+ BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21, /* output mode preference: 0 - 2D, 1 - 3D */
+ BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23, /* Display capability (bit mask) */
+ BLURAY_PLAYER_SETTING_3D_CAP = 24, /* 3D capability (bit mask) */
BLURAY_PLAYER_SETTING_VIDEO_CAP = 29, /* Player capability for video (bit mask) */
BLURAY_PLAYER_SETTING_TEXT_CAP = 30, /* Player capability for text subtitle (bit mask) */
BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31, /* Profile1: 0, Profile1+: 1, Profile2: 3, Profile3: 8 */
@@ -537,6 +540,10 @@ typedef enum {
/* Interactive menu visible */
BD_EVENT_MENU, /* 0 - no, 1 - yes */
+
+ /* 3D */
+ BD_EVENT_STEREOSCOPIC_STATUS, /* 0 - 2D, 1 - 3D */
+
} bd_event_e;
typedef struct {
diff --git a/src/libbluray/hdmv/mobj_print.c b/src/libbluray/hdmv/mobj_print.c
index 63408ad..01d12b8 100644
--- a/src/libbluray/hdmv/mobj_print.c
+++ b/src/libbluray/hdmv/mobj_print.c
@@ -46,10 +46,10 @@ static const char * const psr_info[128] = {
"/* RO: PSR18: Menu description language code */",
"/* RO: PSR19: Country code */",
"/* RO: PSR20: Region code */ /* 1 - A, 2 - B, 4 - C */",
- "/* PSR21 */",
- "/* PSR22 */",
- "/* PSR23 */",
- "/* PSR24 */",
+ "/* RO: PSR21: Output Mode Preference */ /* 0 - 2D, 1 - 3D */",
+ "/* PSR22: Stereoscopic status */ /* 2D / 3D */ ",
+ "/* RO: PSR23: display capablity */",
+ "/* RO: PSR24: 3D capability */",
"/* PSR25 */",
"/* PSR26 */",
"/* PSR27 */",
diff --git a/src/libbluray/register.c b/src/libbluray/register.c
index 7621866..57883d9 100644
--- a/src/libbluray/register.c
+++ b/src/libbluray/register.c
@@ -57,10 +57,10 @@ static const uint32_t bd_psr_init[BD_PSR_COUNT] = {
0xffffff, /* PS: PSR18: Menu description language code */
0xffff, /* PS: PSR19: Country code */
0x07, /* PS: PSR20: Region code */ /* 1 - A, 2 - B, 4 - C */
- 0, /* PSR21 */
- 0, /* PSR22 */
- 0, /* PSR23 */
- 0, /* PSR24 */
+ 0, /* PS: PSR21: Output mode preference */
+ 0, /* PSR22: Stereoscopic status */
+ 0, /* PS: PSR23: Display capability */
+ 0, /* PS: PSR24: 3D capability */
0, /* PSR25 */
0, /* PSR26 */
0, /* PSR27 */
@@ -125,10 +125,14 @@ static const char * const bd_psr_name[BD_PSR_COUNT] = {
"AUDIO_CAP",
"AUDIO_LANG",
"PG_AND_SUB_LANG",
- "PSR_MENU_LANG",
- "PSR_COUNTRY",
- "PSR_REGION",
- "PSR_VIDEO_CAP",
+ "MENU_LANG",
+ "COUNTRY",
+ "REGION",
+ "OUTPUT_PREFER",
+ "3D_STATUS",
+ "DISPLAY_CAP",
+ "3D_CAP",
+ //"PSR_VIDEO_CAP",
};
/*
@@ -421,7 +425,8 @@ int bd_psr_setting_write(BD_REGISTERS *p, int reg, uint32_t val)
int bd_psr_write(BD_REGISTERS *p, int reg, uint32_t val)
{
if ((reg == 13) ||
- (reg >= 15 && reg <= 20) ||
+ (reg >= 15 && reg <= 21) ||
+ (reg >= 23 && reg <= 24) ||
(reg >= 29 && reg <= 31) ||
(reg >= 48 && reg <= 61)) {
BD_DEBUG(DBG_BLURAY, "bd_psr_write(%d, %d): read-only register !\n", reg, val);
diff --git a/src/libbluray/register.h b/src/libbluray/register.h
index 6e6643d..4fbfdba 100644
--- a/src/libbluray/register.h
+++ b/src/libbluray/register.h
@@ -50,6 +50,10 @@ typedef enum {
PSR_MENU_LANG = 18,
PSR_COUNTRY = 19,
PSR_REGION = 20,
+ PSR_OUTPUT_PREFER = 21,
+ PSR_3D_STATUS = 22,
+ PSR_DISPLAY_CAP = 23,
+ PSR_3D_CAP = 24,
PSR_VIDEO_CAP = 29,
PSR_TEXT_CAP = 30, /* text subtitles */
PSR_PROFILE_VERSION = 31, /* player profile and version */
More information about the libbluray-devel
mailing list