1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4 * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
6 * Libbrasero-media is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * The Libbrasero-media authors hereby grant permission for non-GPL compatible
12 * GStreamer plugins to be used and distributed together with GStreamer
13 * and Libbrasero-media. This permission is above and beyond the permissions granted
14 * by the GPL license by which Libbrasero-media is covered. If you modify this code
15 * you may extend this exception to your version of the code, but you are not
16 * obligated to do so. If you do not wish to do so, delete this exception
17 * statement from your version.
19 * Libbrasero-media is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to:
26 * The Free Software Foundation, Inc.,
27 * 51 Franklin Street, Fifth Floor
28 * Boston, MA 02110-1301, USA.
33 #include "scsi-base.h"
35 #ifndef _SCSI_READ_DISC_INFO_H
36 #define _SCSI_READ_DISC_INFO_H
41 BRASERO_SCSI_SESSION_EMPTY
= 0x00,
42 BRASERO_SCSI_SESSION_INCOMPLETE
= 0x01,
43 BRASERO_SCSI_SESSION_DAMAGED
= 0x02,
44 BRASERO_SCSI_SESSION_COMPLETE
= 0x03
45 } BraseroScsiSessionState
;
48 BRASERO_SCSI_DISC_EMPTY
= 0x00,
49 BRASERO_SCSI_DISC_INCOMPLETE
= 0x01,
50 BRASERO_SCSI_DISC_FINALIZED
= 0x02,
51 BRASERO_SCSI_DISC_OTHERS
= 0x03
52 } BraseroScsiDiscStatus
;
55 BRASERO_SCSI_BG_FORMAT_BLANK_OR_NOT_RW
= 0x00,
56 BRASERO_SCSI_BG_FORMAT_STARTED
= 0x01,
57 BRASERO_SCSI_BG_FORMAT_IN_PROGESS
= 0x02,
58 BRASERO_SCSI_BG_FORMAT_COMPLETED
= 0x03
59 } BraseroScsiBgFormatStatus
;
62 BRASERO_SCSI_DISC_CDDA_CDROM
= 0x00,
63 BRASERO_SCSI_DISC_CD_I
= 0x10,
64 BRASERO_SCSI_DISC_XA
= 0x20,
65 BRASERO_SCSI_DISC_UNDEFINED
= 0xFF
67 } BraseroScsiTrackDataFormat
;
70 struct _BraseroScsiOPCEntry
{
74 typedef struct _BraseroScsiOPCEntry BraseroScsiOPCEntry
;
76 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
78 struct _BraseroScsiDiscInfoStd
{
82 uchar last_session_state
:2;
86 uchar first_track_num
;
87 uchar sessions_num_low
;
88 uchar first_track_nb_lastses_low
;
89 uchar last_track_nb_lastses_low
;
91 uchar bg_format_status
:2;
94 uchar disc_app_code_valid
:1;
95 uchar unrestricted_use
:1;
96 uchar disc_barcode_valid
:1;
97 uchar disc_id_valid
:1;
101 uchar sessions_num_high
;
102 uchar first_track_nb_lastses_high
;
103 uchar last_track_nb_lastses_high
;
106 uchar last_session_leadin
[4];
108 uchar last_possible_leadout_res
;
109 uchar last_possible_leadout_mn
;
110 uchar last_possible_leadout_sec
;
111 uchar last_possible_leadout_frame
;
113 uchar disc_barcode
[8];
118 BraseroScsiOPCEntry opc_entry
[0];
121 struct _BraseroScsiTrackResInfo
{
129 uchar max_track_num
[2];
131 uchar max_appendable_track
[2];
132 uchar appendable_track_num
[2];
135 struct _BraseroScsiPOWResInfo
{
143 uchar remaining_pow_replacements
[4];
144 uchar remaining_pow_realloc
[4];
145 uchar remaining_pow_update
[4];
150 struct _BraseroScsiDiscInfoStd
{
155 uchar last_session_state
:2;
158 uchar first_track_num
;
159 uchar sessions_num_low
;
160 uchar first_track_nb_lastses_low
;
161 uchar last_track_nb_lastses_low
;
163 uchar disc_id_valid
:1;
164 uchar disc_barcode_valid
:1;
165 uchar unrestricted_use
:1;
166 uchar disc_app_code_valid
:1;
169 uchar bg_format_status
:2;
173 uchar sessions_num_high
;
174 uchar first_track_nb_lastses_high
;
175 uchar last_track_nb_lastses_high
;
178 uchar last_session_leadin
[4];
180 uchar last_possible_leadout_res
;
181 uchar last_possible_leadout_mn
;
182 uchar last_possible_leadout_sec
;
183 uchar last_possible_leadout_frame
;
185 uchar disc_barcode
[8];
190 BraseroScsiOPCEntry opc_entry
[0];
193 struct _BraseroScsiTrackResInfo
{
201 uchar max_track_num
[2];
202 uchar tracks_num
[2];
203 uchar max_appendable_tracks
[2];
204 uchar appendable_track_num
[2];
207 struct _BraseroScsiPOWResInfo
{
215 uchar remaining_pow_replacements
[4];
216 uchar remaining_pow_realloc
[4];
217 uchar remaining_pow_update
[4];
222 #define BRASERO_FIRST_TRACK_IN_LAST_SESSION(info) (((info)->first_track_nb_lastses_high << 8) + (info)->first_track_nb_lastses_low)
223 #define BRASERO_LAST_TRACK_IN_LAST_SESSION(info) (((info)->last_track_nb_lastses_high << 8) + (info)->last_track_nb_lastses_low)
224 #define BRASERO_SESSION_NUM(info) (((info)->sessions_num_high << 8) + (info)->sessions_num_low)
226 typedef struct _BraseroScsiDiscInfoStd BraseroScsiDiscInfoStd
;
227 typedef struct _BraseroScsiTrackResInfo BraseroScsiTrackResInfo
;
228 typedef struct _BraseroScsiPOWResInfo BraseroScsiPOWResInfo
;
232 #endif /* _SCSI_READ_DISC_INFO_H */