libcdio  0.90
dvd.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2004, 2010 Rocky Bernstein <rocky@gnu.org>
00003     Modeled after GNU/Linux definitions in linux/cdrom.h
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00030 #ifndef CDIO_DVD_H_
00031 #define CDIO_DVD_H_
00032 
00033 #include <cdio/types.h>
00034 
00038 typedef enum cdio_dvd_structure
00039 {
00040         CDIO_DVD_STRUCT_PHYSICAL        = 0x00,
00041         CDIO_DVD_STRUCT_COPYRIGHT       = 0x01,
00042         CDIO_DVD_STRUCT_DISCKEY         = 0x02,
00043         CDIO_DVD_STRUCT_BCA             = 0x03,
00044         CDIO_DVD_STRUCT_MANUFACT        = 0x04
00045 } cdio_dvd_structure;
00046 
00050 typedef enum cdio_dvd_book
00051 {
00052         CDIO_DVD_BOOK_DVD_ROM    = 0x0, 
00053         CDIO_DVD_BOOK_DVD_RAM    = 0x1, 
00054         CDIO_DVD_BOOK_DVD_R      = 0x2, 
00055         CDIO_DVD_BOOK_DVD_RW     = 0x3, 
00056         CDIO_DVD_BOOK_HD_DVD_ROM = 0x4, 
00057         CDIO_DVD_BOOK_HD_DVD_RAM = 0x5, 
00058         CDIO_DVD_BOOK_HD_DVD_R   = 0x6, 
00059         CDIO_DVD_BOOK_DVD_PRW    = 0x9, 
00060         CDIO_DVD_BOOK_DVD_PR     = 0xa, 
00061         CDIO_DVD_BOOK_DVD_PRW_DL = 0xd, 
00062         CDIO_DVD_BOOK_DVD_PR_DL  = 0xe  
00063 } cdio_dvd_book;
00064 
00065 typedef struct cdio_dvd_layer {
00066   unsigned int book_version     : 4;
00067   unsigned int book_type        : 4;
00068   unsigned int min_rate         : 4;
00069   unsigned int disc_size        : 4;
00070   unsigned int layer_type       : 4;
00071   unsigned int track_path       : 1;
00072   unsigned int nlayers          : 2;
00073   unsigned int track_density    : 4;
00074   unsigned int linear_density   : 4;
00075   unsigned int bca              : 1;
00076   uint32_t start_sector;
00077   uint32_t end_sector;
00078   uint32_t end_sector_l0;
00079 } cdio_dvd_layer_t;
00080 
00084 #define CDIO_DVD_MAX_LAYERS     4
00085 
00086 typedef struct cdio_dvd_physical {
00087   uint8_t type;
00088   uint8_t layer_num;
00089   cdio_dvd_layer_t layer[CDIO_DVD_MAX_LAYERS];
00090 } cdio_dvd_physical_t;
00091 
00092 typedef struct cdio_dvd_copyright {
00093   uint8_t type;
00094   
00095   uint8_t layer_num;
00096   uint8_t cpst;
00097   uint8_t rmi;
00098 } cdio_dvd_copyright_t;
00099 
00100 typedef struct cdio_dvd_disckey {
00101   uint8_t type;
00102   
00103   unsigned agid : 2;
00104   uint8_t value[2048];
00105 } cdio_dvd_disckey_t;
00106 
00107 typedef struct cdio_dvd_bca {
00108   uint8_t type;
00109   
00110   int len;
00111   uint8_t value[188];
00112 } cdio_dvd_bca_t;
00113 
00114 typedef struct cdio_dvd_manufact {
00115   uint8_t type;
00116   
00117   uint8_t layer_num;
00118   int len;
00119   uint8_t value[2048];
00120 } cdio_dvd_manufact_t;
00121 
00122 typedef union {
00123   uint8_t type;
00124   
00125   cdio_dvd_physical_t   physical;
00126   cdio_dvd_copyright_t  copyright;
00127   cdio_dvd_disckey_t    disckey;
00128   cdio_dvd_bca_t        bca;
00129   cdio_dvd_manufact_t   manufact;
00130 } cdio_dvd_struct_t;
00131 
00132 #endif /* CDIO_DVD_H_ */