"Patch" libdvdread.
Olaf Beck <[email protected]>
| Newsgroups | gmane.comp.video.ogle.devel |
|---|---|
| Organization | Frozenriver Digital Design |
| Message-ID | <[email protected]> |
Hello Folks, As some of you know I currently hacking a DVD Creation/Authoring framework (dvd-create.sf.net). My present task is to make a ifoedit/create library (libifoedit - yes lame name :). Anyways is will depend on dvdread to read ifo structures and then convert them to editable once that I can manipulate with libifoedit. The case is that dvdread doesn't export the whole ifo structure some small parts are missing. It's offset tables and the time map in the VTS IFO that I main issues although I have also bumped into some incorrect things. Anyhow I have attached a patch for ifo_types.h that will "export" all I need for ifoedit. My question is if you as dvdread developer are happy with my additions to the structure, may be you have questions, suggestions, or want to alter it a bit etc. After the structure is sorted out I will go a head and implement the changes to libdvdread but I think it was a good idea to start with the types so we are on the same line so to say rather than me sending in a bigger patch in one chunk. Cheers Olaf PS: I'm working on the VMG_TXTDT_MG structure but there are many black holes that need to be filled in before it's ready - any hints or more docs regards to it is very welcomed.
ifo_types.h-diff
(text/x-diff, 6.3 KB)
--- ifo_types.h-org Mon Aug 19 22:11:52 2002
+++ ifo_types.h Mon Aug 19 22:12:59 2002
@@ -83,7 +83,8 @@
unsigned int line21_cc_1 : 1;
unsigned int line21_cc_2 : 1;
- unsigned int unknown1 : 2;
+ unsigned int unknown1 : 1;
+ unsigned int bit_rate : 1;
unsigned int picture_size : 2;
unsigned int letterboxed : 1;
@@ -97,15 +98,16 @@
unsigned int film_mode : 1;
unsigned int letterboxed : 1;
unsigned int picture_size : 2;
+ unsigned int bit_rate : 1;
- unsigned int unknown1 : 2;
+ unsigned int unknown1 : 1;
unsigned int line21_cc_2 : 1;
unsigned int line21_cc_1 : 1;
#endif
} ATTRIBUTE_PACKED video_attr_t;
/**
- * Audio Attributes. (Incomplete/Wrong?)
+ * Audio Attributes
*/
typedef struct {
#ifdef WORDS_BIGENDIAN
@@ -130,13 +132,43 @@
unsigned int quantization : 2;
#endif
uint16_t lang_code;
- uint8_t lang_code2; // ??
+ uint8_t lang_code2;
uint8_t lang_extension;
- uint16_t unknown2;
+/* The first byte (bigendian) i.e. bit 15-8 is reserved/unkown
+ The last byte is either karaoke or surround info depending on
+ application_mode setting
+
+ if (application_mode == karaoke ) {
+ Bit 7 - unknown/reserved
+ Bit 6,5,4 - Karaoke channel assigment
+ 0 == Not valid 1+1
+ 1 == Not valid 1/0
+ 2 == 2/0 L,R
+ 3 == 3/0 L,M,R
+ 4 == 2/1 L,R,V1
+ 5 == 3/1 L,M,R,V1
+ 6 == 2/2 L,R,V1,V2
+ 7 == 3/2 L,M,R,V1,V2
+ Bit 3,2 - Karaoke version ?? values
+ Bit 1 - MC intro present
+ probably 0 == true, 1 == false
+ Bit 0 - Karaoke mode
+ 0 == solo
+ 1 == duett
+ } else if ( application_mode == surround ) {
+ Bit 7->4 - reserved/unknown
+ Bit 3 - sutible for surround decoding or not
+ 0 == not sutible
+ 1 == sutible
+ Bit 2->0 reserved/unknown
+ }
+
+*/
+ uint16_t surround_karaoke;
} ATTRIBUTE_PACKED audio_attr_t;
/**
- * Subpicture Attributes.(Incomplete/Wrong)
+ * Subpicture Attributes
*/
typedef struct {
/*
@@ -149,14 +181,80 @@
* language: indicates language if type == 1
* lang extension: if type == 1 contains the lang extension
*/
- uint8_t type;
+
+#ifdef WORDS_BIGENDIAN
+ unsigned int code_mode :3;
+ unsigned int zero3 :3;
+ unsigned int type :2;
+#else
+ unsigned int type :2;
+ unsigned int zero3 :3;
+ unsigned int code_mode :3;
+#endif
+
+
uint8_t zero1;
uint16_t lang_code;
uint8_t lang_extension;
- uint8_t zero2;
+ uint8_t subp_code_ext;
} ATTRIBUTE_PACKED subp_attr_t;
+/**
+ * MultiChannel Extension
+ */
+typedef struct {
+#ifdef WORDS_BIGENDIAN
+ unsigned int zero1 :7;
+ unsigned int ach0_gme :1;
+
+ unsigned int zero2 :7;
+ unsigned int ach1_gme :1;
+
+ unsigned int zero3 :4;
+ unsigned int ach2_gv1e :1;
+ unsigned int ach2_gv2e :1;
+ unsigned int ach2_gm1e :1;
+ unsigned int ach2_gm2e :1;
+
+ unsigned int zero4 :4;
+ unsigned int ach3_gv1e :1;
+ unsigned int ach3_gv2e :1;
+ unsigned int ach3_gmAe :1;
+ unsigned int ach3_se2e :1;
+
+ unsigned int zero5 :4;
+ unsigned int ach4_gv1e :1;
+ unsigned int ach4_gv2e :1;
+ unsigned int ach4_gmBe :1;
+ unsigned int ach4_seBe :1;
+#else
+ unsigned int ach0_gme :1;
+ unsigned int zero1 :7;
+
+ unsigned int ach1_gme :1;
+ unsigned int zero2 :7;
+
+ unsigned int ach2_gm2e :1;
+ unsigned int ach2_gm1e :1;
+ unsigned int ach2_gv2e :1;
+ unsigned int ach2_gv1e :1;
+ unsigned int zero3 :4;
+
+ unsigned int ach3_se2e :1;
+ unsigned int ach3_gmAe :1;
+ unsigned int ach3_gv2e :1;
+ unsigned int ach3_gv1e :1;
+ unsigned int zero4 :4;
+
+ unsigned int ach4_seBe :1;
+ unsigned int ach4_gmBe :1;
+ unsigned int ach4_gv2e :1;
+ unsigned int ach4_gv1e :1;
+ unsigned int zero5 :4;
+#endif
+} multichannel_ext_t;
+
/**
* PGC Command Table.
@@ -165,7 +263,7 @@
uint16_t nr_of_pre;
uint16_t nr_of_post;
uint16_t nr_of_cell;
- uint16_t zero_1;
+ uint16_t end_address;
vm_cmd_t *pre_cmds;
vm_cmd_t *post_cmds;
vm_cmd_t *cell_cmds;
@@ -361,7 +459,7 @@
*/
typedef struct {
uint16_t lang_code;
- uint8_t zero_1;
+ uint8_t lang_ext;
uint8_t exists;
uint32_t lang_start_byte;
pgcit_t *pgcit;
@@ -516,7 +617,7 @@
uint16_t zero_1;
uint16_t pf_ptl_mai_start_byte;
uint16_t zero_2;
- /* uint16_t *pf_ptl_mai // table of nr_of_vtss+1 x 8 */
+ uint16_t *pf_ptl_mai; // table of nr_of_vtss+1 x 8 */
} ATTRIBUTE_PACKED ptl_mait_country_t;
#define PTL_MAIT_COUNTRY_SIZE 8
@@ -527,6 +628,7 @@
uint16_t nr_of_countries;
uint16_t nr_of_vtss;
uint32_t last_byte;
+ uint32_t *ptl_mait_offset; //Table of offsets to each ptl_mait_country
ptl_mait_country_t *countries;
} ATTRIBUTE_PACKED ptl_mait_t;
#define PTL_MAIT_SIZE 8
@@ -570,6 +673,7 @@
uint16_t nr_of_vtss;
uint16_t zero_1;
uint32_t last_byte;
+ uint32_t *vts_atrt_offsets; //Table of offsets to each vts_attributes
vts_attributes_t *vts;
} ATTRIBUTE_PACKED vts_atrt_t;
#define VTS_ATRT_SIZE 8
@@ -703,11 +807,36 @@
uint16_t nr_of_srpts;
uint16_t zero_1;
uint32_t last_byte;
+ uint32_t *ttu_offset; //Offset table for each ttu
ttu_t *title;
} ATTRIBUTE_PACKED vts_ptt_srpt_t;
#define VTS_PTT_SRPT_SIZE 8
+/**
+ * VTS Time Map Information.
+ */
+typedef struct {
+ uint8_t time_unit;
+ uint8_t zero1;
+ uint16_t nr_of_entries;
+ uint32_t *time_entries;
+} ATTRIBUTE_PACKED vts_tmapt_t;
+
+
+/**
+ * VTS Time Map Pointer Table.
+ */
+typedef struct {
+ uint32_t nr_of_vts_tmaps;
+ uint32_t last_byte;
+ uint32_t *vts_tmap_offset; //Offset table for each ttu
+ vts_tmapt_t *tmap;
+} ATTRIBUTE_PACKED vts_tmapti_t;
+#define VTS_TMAP_SIZE 8
+
+
+
#if PRAGMA_PACK
#pragma pack()
#endif
@@ -739,9 +868,13 @@
vtsi_mat_t *vtsi_mat;
vts_ptt_srpt_t *vts_ptt_srpt;
pgcit_t *vts_pgcit;
- int *vts_tmapt; // FIXME add/correct the type
+ vts_tmapti_t *vts_tmapti; // FIXME add/correct the type
c_adt_t *vts_c_adt;
vobu_admap_t *vts_vobu_admap;
+ multichannel_ext_t *multichannel_ext; /* I did not know where to put
+ it the VTSI_MAT is attribute packes
+ and it's also a must to check if we
+ have a karaoke DVD */
} ifo_handle_t;
#endif /* IFO_TYPES_H_INCLUDED */