summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libspudec/nav_types.h277
1 files changed, 87 insertions, 190 deletions
diff --git a/src/libspudec/nav_types.h b/src/libspudec/nav_types.h
index f8d837377..aa54a329c 100644
--- a/src/libspudec/nav_types.h
+++ b/src/libspudec/nav_types.h
@@ -1,5 +1,8 @@
-/**
- * Copyright (C) 2000 Håkan Hjort <d95hjort@dtek.chalmers.se>
+#ifndef NAV_TYPES_H_INCLUDED
+#define NAV_TYPES_H_INCLUDED
+
+/*
+ * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort@dtek.chalmers.se>
*
* The data structures in this file should represent the layout of the
* pci and dsi packets as they are stored in the stream. Information
@@ -26,10 +29,9 @@
* USA
*/
-#ifndef NAV_TYPES_H_INCLUDED
-#define NAV_TYPES_H_INCLUDED
-
#include <inttypes.h>
+#include "../input/libdvdread/ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
+
#undef ATTRIBUTE_PACKED
#undef PRAGMA_PACK_BEGIN
@@ -63,104 +65,19 @@
#pragma pack(1)
#endif
-/**
- * DVD Time Information.
- */
-typedef struct {
- uint8_t hour;
- uint8_t minute;
- uint8_t second;
- uint8_t frame_u; /* The two high bits are the frame rate. */
-} ATTRIBUTE_PACKED dvd_time_t;
-
-/**
- * Type to store per-command data.
- */
-typedef struct {
- uint8_t bytes[8];
-} ATTRIBUTE_PACKED vm_cmd_t;
-
-/**
- * User Operations.
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
- unsigned int zero : 7; /* 25-31 */
- unsigned int video_pres_mode_change : 1; /* 24 */
-
- unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */
- unsigned int angle_change : 1; /* 22 */
- unsigned int subpic_stream_change : 1; /* 21 */
- unsigned int audio_stream_change : 1; /* 20 */
- unsigned int pause_on : 1; /* 19 */
- unsigned int still_off : 1; /* 18 */
- unsigned int button_select_or_activate : 1; /* 17 */
- unsigned int resume : 1; /* 16 */
-
- unsigned int chapter_menu_call : 1; /* 15 */
- unsigned int angle_menu_call : 1; /* 14 */
- unsigned int audio_menu_call : 1; /* 13 */
- unsigned int subpic_menu_call : 1; /* 12 */
- unsigned int root_menu_call : 1; /* 11 */
- unsigned int title_menu_call : 1; /* 10 */
- unsigned int backward_scan : 1; /* 9 */
- unsigned int forward_scan : 1; /* 8 */
-
- unsigned int next_pg_search : 1; /* 7 */
- unsigned int prev_or_top_pg_search : 1; /* 6 */
- unsigned int time_or_chapter_search : 1; /* 5 */
- unsigned int go_up : 1; /* 4 */
- unsigned int stop : 1; /* 3 */
- unsigned int title_play : 1; /* 2 */
- unsigned int chapter_search_or_play : 1; /* 1 */
- unsigned int title_or_time_play : 1; /* 0 */
-#else
- unsigned int video_pres_mode_change : 1; /* 24 */
- unsigned int zero : 7; /* 25-31 */
-
- unsigned int resume : 1; /* 16 */
- unsigned int button_select_or_activate : 1; /* 17 */
- unsigned int still_off : 1; /* 18 */
- unsigned int pause_on : 1; /* 19 */
- unsigned int audio_stream_change : 1; /* 20 */
- unsigned int subpic_stream_change : 1; /* 21 */
- unsigned int angle_change : 1; /* 22 */
- unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */
-
- unsigned int forward_scan : 1; /* 8 */
- unsigned int backward_scan : 1; /* 9 */
- unsigned int title_menu_call : 1; /* 10 */
- unsigned int root_menu_call : 1; /* 11 */
- unsigned int subpic_menu_call : 1; /* 12 */
- unsigned int audio_menu_call : 1; /* 13 */
- unsigned int angle_menu_call : 1; /* 14 */
- unsigned int chapter_menu_call : 1; /* 15 */
-
- unsigned int title_or_time_play : 1; /* 0 */
- unsigned int chapter_search_or_play : 1; /* 1 */
- unsigned int title_play : 1; /* 2 */
- unsigned int stop : 1; /* 3 */
- unsigned int go_up : 1; /* 4 */
- unsigned int time_or_chapter_search : 1; /* 5 */
- unsigned int prev_or_top_pg_search : 1; /* 6 */
- unsigned int next_pg_search : 1; /* 7 */
-#endif
-} ATTRIBUTE_PACKED user_ops_t;
-
-
/**
* PCI General Information
*/
typedef struct {
- uint32_t nv_pck_lbn;
- uint16_t vobu_cat;
- uint16_t zero1;
- user_ops_t vobu_uop_ctl;
- uint32_t vobu_s_ptm;
- uint32_t vobu_e_ptm;
- uint32_t vobu_se_e_ptm;
- dvd_time_t e_eltm;
+ uint32_t nv_pck_lbn; /**< sector address of this nav pack */
+ uint16_t vobu_cat; /**< 'category' of vobu */
+ uint16_t zero1; /**< reserved */
+ user_ops_t vobu_uop_ctl; /**< UOP of vobu */
+ uint32_t vobu_s_ptm; /**< start presentation time of vobu */
+ uint32_t vobu_e_ptm; /**< end presentation time of vobu */
+ uint32_t vobu_se_e_ptm; /**< end ptm of sequence end in vobu */
+ dvd_time_t e_eltm; /**< Cell elapsed time */
char vobu_isrc[32];
} ATTRIBUTE_PACKED pci_gi_t;
@@ -168,26 +85,32 @@ typedef struct {
* Non Seamless Angle Information
*/
typedef struct {
- uint32_t nsml_agl_dsta[9];
+ uint32_t nsml_agl_dsta[9]; /**< address of destination vobu in AGL_C#n */
} ATTRIBUTE_PACKED nsml_agli_t;
/**
* Highlight General Information
+ *
+ * For btngrX_dsp_ty the bits have the following meaning:
+ * 000b: normal 4/3 only buttons
+ * XX1b: wide (16/9) buttons
+ * X1Xb: letterbox buttons
+ * 1XXb: pan&scan buttons
*/
typedef struct {
- uint16_t hli_ss; /* only low 2 bits */
- uint32_t hli_s_ptm;
- uint32_t hli_e_ptm;
- uint32_t btn_se_e_ptm;
+ uint16_t hli_ss; /**< status, only low 2 bits 0: no buttons, 1: different 2: equal 3: eual except for button cmds */
+ uint32_t hli_s_ptm; /**< start ptm of hli */
+ uint32_t hli_e_ptm; /**< end ptm of hli */
+ uint32_t btn_se_e_ptm; /**< end ptm of button select */
#ifdef WORDS_BIGENDIAN
- unsigned int zero1 : 2;
- unsigned int btngr_ns : 2;
- unsigned int zero2 : 1;
- unsigned int btngr1_dsp_ty : 3; /* type=1 for Widescreen, type=4 for Pan/Scan */
- unsigned int zero3 : 1;
- unsigned int btngr2_dsp_ty : 3;
- unsigned int zero4 : 1;
- unsigned int btngr3_dsp_ty : 3;
+ unsigned int zero1 : 2; /**< reserved */
+ unsigned int btngr_ns : 2; /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */
+ unsigned int zero2 : 1; /**< reserved */
+ unsigned int btngr1_dsp_ty : 3; /**< display type of subpic stream for button group 1 */
+ unsigned int zero3 : 1; /**< reserved */
+ unsigned int btngr2_dsp_ty : 3; /**< display type of subpic stream for button group 2 */
+ unsigned int zero4 : 1; /**< reserved */
+ unsigned int btngr3_dsp_ty : 3; /**< display type of subpic stream for button group 3 */
#else
unsigned int btngr1_dsp_ty : 3;
unsigned int zero2 : 1;
@@ -198,82 +121,56 @@ typedef struct {
unsigned int btngr2_dsp_ty : 3;
unsigned int zero3 : 1;
#endif
- uint8_t btn_ofn;
- uint8_t btn_ns; /* only low 6 bits */
- uint8_t nsl_btn_ns; /* only low 6 bits */
- uint8_t zero5;
- uint8_t fosl_btnn; /* only low 6 bits */
- uint8_t foac_btnn; /* only low 6 bits */
+ uint8_t btn_ofn; /**< button offset number range 0-255 */
+ uint8_t btn_ns; /**< number of valid buttons <= 36/18/12 (low 6 bits) */
+ uint8_t nsl_btn_ns; /**< number of buttons selectable by U_BTNNi (low 6 bits) nsl_btn_ns <= btn_ns */
+ uint8_t zero5; /**< reserved */
+ uint8_t fosl_btnn; /**< forcedly selected button (low 6 bits) */
+ uint8_t foac_btnn; /**< forcedly activated button (low 6 bits) */
} ATTRIBUTE_PACKED hl_gi_t;
/**
* Button Color Information Table
+ * Each entry beeing a 32bit word that contains the color indexs and alpha
+ * values to use. They are all represented by 4 bit number and stored
+ * like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0]. The actual palette
+ * that the indexes reference is in the PGC.
+ * @TODO split the uint32_t into a struct
*/
typedef struct {
- uint32_t btn_coli[3][2];
+ uint32_t btn_coli[3][2]; /**< [button color number-1][select:0/action:1] */
} ATTRIBUTE_PACKED btn_colit_t;
-
-/*
- btn_coln 11000000 00000000 00000000 00000000 00000000 00000000
- x_start 00111111 11110000 00000000 00000000 00000000 00000000
- zero1 00000000 00001100 00000000 00000000 00000000 00000000
- x_end 00000000 00000011 11111111 00000000 00000000 00000000
- auto_action_mode 00000000 00000000 00000000 11000000 00000000 00000000
- y_start 00000000 00000000 00000000 00111111 11110000 00000000
- zero2 00000000 00000000 00000000 00000000 00001100 00000000
- y_end 00000000 00000000 00000000 00000000 00000011 11111111
-
- unsigned int btn_coln : 2; 0 - m[0]>>6
- unsigned int x_start : 10; 2 - m[0]<<4 | m[1]>>4
- unsigned int zero1 : 2; 12 - m[1]>>2
- unsigned int x_end : 10; 14 - m[1]<<8 | m[2]
-
- unsigned int auto_action_mode : 2; 24 - m[3]>>6
- unsigned int y_start : 10; 26 - m[3]<<4 | m[4]>>4
- unsigned int zero2 : 2; 36 - m[4]>>2
- unsigned int y_end : 10; 38 - m[4]<<8 | m[5]
- */
-
/**
* Button Information
*/
typedef struct {
-#if 0 /* Wierd Sun CC code that does not work */
- unsigned int zero1 : 2;
- unsigned int x_start : 10;
- unsigned int x_end : 10;
- unsigned int y_start : 10;
-
- unsigned int zero2 : 2;
- unsigned int btn_coln : 2;
- unsigned int auto_action_mode : 2;
- unsigned int y_end : 10;
-#endif
#ifdef WORDS_BIGENDIAN
- unsigned int btn_coln : 2;
- unsigned int x_start : 10;
- unsigned int zero1 : 2;
- unsigned int x_end : 10;
- unsigned int auto_action_mode : 2;
- unsigned int y_start : 10;
- unsigned int zero2 : 2;
- unsigned int y_end : 10;
-
- unsigned int zero3 : 2;
- unsigned int up : 6;
- unsigned int zero4 : 2;
- unsigned int down : 6;
- unsigned int zero5 : 2;
- unsigned int left : 6;
- unsigned int zero6 : 2;
- unsigned int right : 6;
+ unsigned int btn_coln : 2; /**< button color number */
+ unsigned int x_start : 10; /**< x start offset within the overlay */
+ unsigned int zero1 : 2; /**< reserved */
+ unsigned int x_end : 10; /**< x end offset within the overlay */
+
+ unsigned int auto_action_mode : 2; /**< 0: no, 1: activated if selected */
+ unsigned int y_start : 10; /**< y start offset within the overlay */
+ unsigned int zero2 : 2; /**< reserved */
+ unsigned int y_end : 10; /**< y end offset within the overlay */
+
+ unsigned int zero3 : 2; /**< reserved */
+ unsigned int up : 6; /**< button index when pressing up */
+ unsigned int zero4 : 2; /**< reserved */
+ unsigned int down : 6; /**< button index when pressing down */
+ unsigned int zero5 : 2; /**< reserved */
+ unsigned int left : 6; /**< button index when pressing left */
+ unsigned int zero6 : 2; /**< reserved */
+ unsigned int right : 6; /**< button index when pressing right */
#else
unsigned int x_end : 10;
unsigned int zero1 : 2;
unsigned int x_start : 10;
unsigned int btn_coln : 2;
+
unsigned int y_end : 10;
unsigned int zero2 : 2;
unsigned int y_start : 10;
@@ -318,27 +215,27 @@ typedef struct {
*/
typedef struct {
uint32_t nv_pck_scr;
- uint32_t nv_pck_lbn;
- uint32_t vobu_ea;
- uint32_t vobu_1stref_ea;
- uint32_t vobu_2ndref_ea;
- uint32_t vobu_3rdref_ea;
- uint16_t vobu_vob_idn;
- uint8_t zero1;
- uint8_t vobu_c_idn;
- dvd_time_t c_eltm;
+ uint32_t nv_pck_lbn; /**< sector address of this nav pack */
+ uint32_t vobu_ea; /**< end address of this VOBU */
+ uint32_t vobu_1stref_ea; /**< end address of the 1st reference image */
+ uint32_t vobu_2ndref_ea; /**< end address of the 2nd reference image */
+ uint32_t vobu_3rdref_ea; /**< end address of the 3rd reference image */
+ uint16_t vobu_vob_idn; /**< VOB Id number that this VOBU is part of */
+ uint8_t zero1; /**< reserved */
+ uint8_t vobu_c_idn; /**< Cell Id number that this VOBU is part of */
+ dvd_time_t c_eltm; /**< Cell elapsed time */
} ATTRIBUTE_PACKED dsi_gi_t;
/**
* Seamless Playback Information
*/
typedef struct {
- uint16_t category; /* category of seamless VOBU */
- uint32_t ilvu_ea; /* end address of interleaved Unit (sectors) */
- uint32_t ilvu_sa; /* start address of next interleaved unit (sectors) */
- uint16_t size; /* size of next interleaved unit (sectors) */
- uint32_t vob_v_s_s_ptm; /* video start ptm in vob */
- uint32_t vob_v_e_e_ptm; /* video end ptm in vob */
+ uint16_t category; /**< 'category' of seamless VOBU */
+ uint32_t ilvu_ea; /**< end address of interleaved Unit */
+ uint32_t ilvu_sa; /**< start address of next interleaved unit */
+ uint16_t size; /**< size of next interleaved unit */
+ uint32_t vob_v_s_s_ptm; /**< video start ptm in vob */
+ uint32_t vob_v_e_e_ptm; /**< video end ptm in vob */
struct {
uint32_t stp_ptm1;
uint32_t stp_ptm2;
@@ -351,8 +248,8 @@ typedef struct {
* Seamless Angle Infromation for one angle
*/
typedef struct {
- uint32_t address; /* Sector offset to next ILVU, high bit is before/after */
- uint16_t size; /* Byte size of the ILVU poited to by address. */
+ uint32_t address; /**< offset to next ILVU, high bit is before/after */
+ uint16_t size; /**< byte size of the ILVU pointed to by address */
} ATTRIBUTE_PACKED sml_agl_data_t;
/**
@@ -366,11 +263,11 @@ typedef struct {
* VOBU Search Information
*/
typedef struct {
- uint32_t next_video; /* Next vobu that contains video */
- uint32_t fwda[19]; /* Forwards, time */
+ uint32_t next_video; /**< Next vobu that contains video */
+ uint32_t fwda[19]; /**< Forwards, time */
uint32_t next_vobu;
uint32_t prev_vobu;
- uint32_t bwda[19]; /* Backwards, time */
+ uint32_t bwda[19]; /**< Backwards, time */
uint32_t prev_video;
} ATTRIBUTE_PACKED vobu_sri_t;
@@ -380,8 +277,8 @@ typedef struct {
* Synchronous Information
*/
typedef struct {
- uint16_t a_synca[8]; /* Sector offset to first audio packet for this VOBU */
- uint32_t sp_synca[32]; /* Sector offset to first subpicture packet */
+ uint16_t a_synca[8]; /**< offset to first audio packet for this VOBU */
+ uint32_t sp_synca[32]; /**< offset to first subpicture packet */
} ATTRIBUTE_PACKED synci_t;
/**