00001 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ 00002 00003 #ifndef LIBBURN_H 00004 #define LIBBURN_H 00005 00006 /* 00007 00008 Applications must use 64 bit off_t. E.g. by defining 00009 #define _LARGEFILE_SOURCE 00010 #define _FILE_OFFSET_BITS 64 00011 or take special precautions to interface with the library by 64 bit integers 00012 where this .h files prescribe off_t. 00013 00014 To prevent 64 bit file i/o in the library would keep the application from 00015 processing tracks of more than 2 GB size. 00016 00017 */ 00018 #include <sys/types.h> 00019 00020 #ifndef DOXYGEN 00021 00022 #if defined(__cplusplus) 00023 #define BURN_BEGIN_DECLS \ 00024 namespace burn { \ 00025 extern "C" { 00026 #define BURN_END_DECLS \ 00027 } \ 00028 } 00029 #else 00030 #define BURN_BEGIN_DECLS 00031 #define BURN_END_DECLS 00032 #endif 00033 00034 BURN_BEGIN_DECLS 00035 00036 #endif 00037 00038 /** References a physical drive in the system */ 00039 struct burn_drive; 00040 00041 /** References a whole disc */ 00042 struct burn_disc; 00043 00044 /** References a single session on a disc */ 00045 struct burn_session; 00046 00047 /** References a single track on a disc */ 00048 struct burn_track; 00049 00050 /* ts A61111 */ 00051 /** References a set of write parameters */ 00052 struct burn_write_opts; 00053 00054 /** Session format for normal audio or data discs */ 00055 #define BURN_CDROM 0 00056 /** Session format for obsolete CD-I discs */ 00057 #define BURN_CDI 0x10 00058 /** Session format for CDROM-XA discs */ 00059 #define BURN_CDXA 0x20 00060 00061 #define BURN_POS_END 100 00062 00063 /** Mask for mode bits */ 00064 #define BURN_MODE_BITS 127 00065 00066 /** Track mode - mode 0 data 00067 0 bytes of user data. it's all 0s. mode 0. get it? HAH 00068 */ 00069 #define BURN_MODE0 (1 << 0) 00070 /** Track mode - mode "raw" - all 2352 bytes supplied by app 00071 FOR DATA TRACKS ONLY! 00072 */ 00073 #define BURN_MODE_RAW (1 << 1) 00074 /** Track mode - mode 1 data 00075 2048 bytes user data, and all the LEC money can buy 00076 */ 00077 #define BURN_MODE1 (1 << 2) 00078 /** Track mode - mode 2 data 00079 defaults to formless, 2336 bytes of user data, unprotected 00080 | with a data form if required. 00081 */ 00082 #define BURN_MODE2 (1 << 3) 00083 /** Track mode modifier - Form 1, | with MODE2 for reasonable results 00084 2048 bytes of user data, 4 bytes of subheader 00085 */ 00086 #define BURN_FORM1 (1 << 4) 00087 /** Track mode modifier - Form 2, | with MODE2 for reasonable results 00088 lots of user data. not much LEC. 00089 */ 00090 #define BURN_FORM2 (1 << 5) 00091 /** Track mode - audio 00092 2352 bytes per sector. may be | with 4ch or preemphasis. 00093 NOT TO BE CONFUSED WITH BURN_MODE_RAW 00094 Audio data must be 44100Hz 16bit stereo with no riff or other header at 00095 beginning. Extra header data will cause pops or clicks. Audio data should 00096 also be in little-endian byte order. Big-endian audio data causes static. 00097 */ 00098 #define BURN_AUDIO (1 << 6) 00099 /** Track mode modifier - 4 channel audio. */ 00100 #define BURN_4CH (1 << 7) 00101 /** Track mode modifier - Digital copy permitted, can be set on any track.*/ 00102 #define BURN_COPY (1 << 8) 00103 /** Track mode modifier - 50/15uS pre-emphasis */ 00104 #define BURN_PREEMPHASIS (1 << 9) 00105 /** Input mode modifier - subcodes present packed 16 */ 00106 #define BURN_SUBCODE_P16 (1 << 10) 00107 /** Input mode modifier - subcodes present packed 96 */ 00108 #define BURN_SUBCODE_P96 (1 << 11) 00109 /** Input mode modifier - subcodes present raw 96 */ 00110 #define BURN_SUBCODE_R96 (1 << 12) 00111 00112 /** Possible disc writing style/modes */ 00113 enum burn_write_types 00114 { 00115 /** Packet writing. 00116 currently unsupported, (for DVD Incremental Streaming use TAO) 00117 */ 00118 BURN_WRITE_PACKET, 00119 00120 /** With CD: Track At Once recording 00121 2s gaps between tracks, no fonky lead-ins 00122 00123 With sequential DVD-R[W]: Incremental Streaming 00124 With DVD+R and BD-R: Track of open size 00125 With DVD-RAM, DVD+RW, BD-RE: Random Writeable (used sequentially) 00126 With overwriteable DVD-RW: Rigid Restricted Overwrite 00127 */ 00128 BURN_WRITE_TAO, 00129 00130 /** With CD: Session At Once 00131 Block type MUST be BURN_BLOCK_SAO 00132 ts A70122: Currently not capable of mixing data and audio tracks. 00133 00134 With sequential DVD-R[W]: Disc-at-once, DAO 00135 Single session, single track, fixed size mandatory, (-dvd-compat) 00136 With other DVD or BD media: same as BURN_WRITE_TAO but may demand 00137 that track size is known in advance. 00138 */ 00139 BURN_WRITE_SAO, 00140 00141 /** With CD: Raw disc at once recording. 00142 all subcodes must be provided by lib or user 00143 only raw block types are supported 00144 With DVD and BD media: not supported. 00145 00146 ts A90901: This had been disabled because its implementation 00147 relied on code from cdrdao which is not understood 00148 currently. 00149 A burn run will abort with "FATAL" error message 00150 if this mode is attempted. 00151 @since 0.7.2 00152 ts A91016: Re-implemented according to ECMA-130 Annex A and B. 00153 Now understood, explained and not stemming from cdrdao. 00154 @since 0.7.4 00155 */ 00156 BURN_WRITE_RAW, 00157 00158 /** In replies this indicates that not any writing will work. 00159 As parameter for inquiries it indicates that no particular write 00160 mode shall is specified. 00161 Do not use for setting a write mode for burning. It will not work. 00162 */ 00163 BURN_WRITE_NONE 00164 }; 00165 00166 /** Data format to send to the drive */ 00167 enum burn_block_types 00168 { 00169 /** sync, headers, edc/ecc provided by lib/user */ 00170 BURN_BLOCK_RAW0 = 1, 00171 /** sync, headers, edc/ecc and p/q subs provided by lib/user */ 00172 BURN_BLOCK_RAW16 = 2, 00173 /** sync, headers, edc/ecc and packed p-w subs provided by lib/user */ 00174 BURN_BLOCK_RAW96P = 4, 00175 /** sync, headers, edc/ecc and raw p-w subs provided by lib/user */ 00176 BURN_BLOCK_RAW96R = 8, 00177 /** only 2048 bytes of user data provided by lib/user */ 00178 BURN_BLOCK_MODE1 = 256, 00179 /** 2336 bytes of user data provided by lib/user */ 00180 BURN_BLOCK_MODE2R = 512, 00181 /** 2048 bytes of user data provided by lib/user 00182 subheader provided in write parameters 00183 are we ever going to support this shit? I vote no. 00184 (supposed to be supported on all drives...) 00185 */ 00186 BURN_BLOCK_MODE2_PATHETIC = 1024, 00187 /** 2048 bytes of data + 8 byte subheader provided by lib/user 00188 hey, this is also dumb 00189 */ 00190 BURN_BLOCK_MODE2_LAME = 2048, 00191 /** 2324 bytes of data provided by lib/user 00192 subheader provided in write parameters 00193 no sir, I don't like it. 00194 */ 00195 BURN_BLOCK_MODE2_OBSCURE = 4096, 00196 /** 2332 bytes of data supplied by lib/user 00197 8 bytes sub header provided in write parameters 00198 this is the second least suck mode2, and is mandatory for 00199 all drives to support. 00200 */ 00201 BURN_BLOCK_MODE2_OK = 8192, 00202 /** SAO block sizes are based on cue sheet, so use this. */ 00203 BURN_BLOCK_SAO = 16384 00204 }; 00205 00206 /** Possible status of the drive in regard to the disc in it. */ 00207 enum burn_disc_status 00208 { 00209 /** The current status is not yet known */ 00210 BURN_DISC_UNREADY, 00211 00212 /** The drive holds a blank disc. It is ready for writing from scratch. 00213 Unused multi-session media: 00214 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R 00215 Blanked multi-session media (i.e. treated by burn_disc_erase()) 00216 CD-RW, DVD-RW 00217 Overwriteable media with or without valid data 00218 DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE 00219 */ 00220 BURN_DISC_BLANK, 00221 00222 /** There is no disc at all in the drive */ 00223 BURN_DISC_EMPTY, 00224 00225 /** There is an incomplete disc in the drive. It is ready for appending 00226 another session. 00227 Written but not yet closed multi-session media 00228 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R 00229 */ 00230 BURN_DISC_APPENDABLE, 00231 00232 /** There is a disc with data on it in the drive. It is usable only for 00233 reading. 00234 Written and closed multi-session media 00235 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R 00236 Read-Only media 00237 CD-ROM, DVD-ROM, BD-ROM 00238 Note that many DVD-ROM drives report any written media 00239 as Read-Only media and not by their real media types. 00240 */ 00241 BURN_DISC_FULL, 00242 00243 /* ts A61007 */ 00244 /* @since 0.2.4 */ 00245 /** The drive was not grabbed when the status was inquired */ 00246 BURN_DISC_UNGRABBED, 00247 00248 /* ts A61020 */ 00249 /* @since 0.2.6 */ 00250 /** The media seems to be unsuitable for reading and for writing */ 00251 BURN_DISC_UNSUITABLE 00252 }; 00253 00254 00255 /** Possible data source return values */ 00256 enum burn_source_status 00257 { 00258 /** The source is ok */ 00259 BURN_SOURCE_OK, 00260 /** The source is at end of file */ 00261 BURN_SOURCE_EOF, 00262 /** The source is unusable */ 00263 BURN_SOURCE_FAILED 00264 }; 00265 00266 00267 /** Possible busy states for a drive */ 00268 enum burn_drive_status 00269 { 00270 /** The drive is not in an operation */ 00271 BURN_DRIVE_IDLE, 00272 /** The library is spawning the processes to handle a pending 00273 operation (A read/write/etc is about to start but hasn't quite 00274 yet) */ 00275 BURN_DRIVE_SPAWNING, 00276 /** The drive is reading data from a disc */ 00277 BURN_DRIVE_READING, 00278 /** The drive is writing data to a disc */ 00279 BURN_DRIVE_WRITING, 00280 /** The drive is writing Lead-In */ 00281 BURN_DRIVE_WRITING_LEADIN, 00282 /** The drive is writing Lead-Out */ 00283 BURN_DRIVE_WRITING_LEADOUT, 00284 /** The drive is erasing a disc */ 00285 BURN_DRIVE_ERASING, 00286 /** The drive is being grabbed */ 00287 BURN_DRIVE_GRABBING, 00288 00289 /* ts A61102 */ 00290 /* @since 0.2.6 */ 00291 /** The drive gets written zeroes before the track payload data */ 00292 BURN_DRIVE_WRITING_PREGAP, 00293 /** The drive is told to close a track (TAO only) */ 00294 BURN_DRIVE_CLOSING_TRACK, 00295 /** The drive is told to close a session (TAO only) */ 00296 BURN_DRIVE_CLOSING_SESSION, 00297 00298 /* ts A61223 */ 00299 /* @since 0.3.0 */ 00300 /** The drive is formatting media */ 00301 BURN_DRIVE_FORMATTING, 00302 00303 /* ts A70822 */ 00304 /* @since 0.4.0 */ 00305 /** The drive is busy in synchronous read (if you see this then it 00306 has been interrupted) */ 00307 BURN_DRIVE_READING_SYNC, 00308 /** The drive is busy in synchronous write (if you see this then it 00309 has been interrupted) */ 00310 BURN_DRIVE_WRITING_SYNC 00311 00312 }; 00313 00314 00315 /** Information about a track on a disc - this is from the q sub channel of the 00316 lead-in area of a disc. The documentation here is very terse. 00317 See a document such as mmc3 for proper information. 00318 00319 CAUTION : This structure is prone to future extension ! 00320 00321 Do not restrict your application to unsigned char with any counter like 00322 "session", "point", "pmin", ... 00323 Do not rely on the current size of a burn_toc_entry. 00324 00325 ts A70201 : DVD extension, see below 00326 */ 00327 struct burn_toc_entry 00328 { 00329 /** Session the track is in */ 00330 unsigned char session; 00331 /** Type of data. for this struct to be valid, it must be 1 */ 00332 unsigned char adr; 00333 /** Type of data in the track */ 00334 unsigned char control; 00335 /** Zero. Always. Really. */ 00336 unsigned char tno; 00337 /** Track number or special information */ 00338 unsigned char point; 00339 unsigned char min; 00340 unsigned char sec; 00341 unsigned char frame; 00342 unsigned char zero; 00343 /** Track start time minutes for normal tracks */ 00344 unsigned char pmin; 00345 /** Track start time seconds for normal tracks */ 00346 unsigned char psec; 00347 /** Track start time frames for normal tracks */ 00348 unsigned char pframe; 00349 00350 /* Indicates whether extension data are valid and eventually override 00351 older elements in this structure: 00352 bit0= DVD extension is valid @since 0.3.2 00353 @since 0.5.2 : DVD extensions are made valid for CD too 00354 */ 00355 unsigned char extensions_valid; 00356 00357 /* ts A70201 : DVD extension. extensions_valid:bit0 00358 If invalid the members are guaranteed to be 0. */ 00359 /* @since 0.3.2 */ 00360 /* Tracks and session numbers are 16 bit. Here are the high bytes. */ 00361 unsigned char session_msb; 00362 unsigned char point_msb; 00363 /* pmin, psec, and pframe may be too small if DVD extension is valid */ 00364 int start_lba; 00365 /* min, sec, and frame may be too small if DVD extension is valid */ 00366 int track_blocks; 00367 00368 /* ts A90909 : LRA extension. extensions_valid:bit1 */ 00369 /* @since 0.7.2 */ 00370 /* MMC-5 6.27.3.18 : The Last Recorded Address is valid for DVD-R, 00371 DVD-R DL when LJRS = 00b, DVD-RW, HD DVD-R, and BD-R. 00372 This would mean profiles: 0x11, 0x15, 0x13, 0x14, 0x51, 0x41, 0x42 00373 */ 00374 int last_recorded_address; 00375 }; 00376 00377 00378 /** Data source interface for tracks. 00379 This allows to use arbitrary program code as provider of track input data. 00380 00381 Objects compliant to this interface are either provided by the application 00382 or by API calls of libburn: burn_fd_source_new() , burn_file_source_new(), 00383 and burn_fifo_source_new(). 00384 00385 The API calls allow to use any file object as data source. Consider to feed 00386 an eventual custom data stream asynchronously into a pipe(2) and to let 00387 libburn handle the rest. 00388 In this case the following rule applies: 00389 Call burn_source_free() exactly once for every source obtained from 00390 libburn API. You MUST NOT otherwise use or manipulate its components. 00391 00392 In general, burn_source objects can be freed as soon as they are attached 00393 to track objects. The track objects will keep them alive and dispose them 00394 when they are no longer needed. With a fifo burn_source it makes sense to 00395 keep the own reference for inquiring its state while burning is in 00396 progress. 00397 00398 --- 00399 00400 The following description of burn_source applies only to application 00401 implemented burn_source objects. You need not to know it for API provided 00402 ones. 00403 00404 If you really implement an own passive data producer by this interface, 00405 then beware: it can do anything and it can spoil everything. 00406 00407 In this case the functions (*read), (*get_size), (*set_size), (*free_data) 00408 MUST be implemented by the application and attached to the object at 00409 creation time. 00410 Function (*read_sub) is allowed to be NULL or it MUST be implemented and 00411 attached. 00412 00413 burn_source.refcount MUST be handled properly: If not exactly as many 00414 references are freed as have been obtained, then either memory leaks or 00415 corrupted memory are the consequence. 00416 All objects which are referred to by *data must be kept existent until 00417 (*free_data) is called via burn_source_free() by the last referer. 00418 */ 00419 struct burn_source { 00420 00421 /** Reference count for the data source. MUST be 1 when a new source 00422 is created and thus the first reference is handed out. Increment 00423 it to take more references for yourself. Use burn_source_free() 00424 to destroy your references to it. */ 00425 int refcount; 00426 00427 00428 /** Read data from the source. Semantics like with read(2), but MUST 00429 either deliver the full buffer as defined by size or MUST deliver 00430 EOF (return 0) or failure (return -1) at this call or at the 00431 next following call. I.e. the only incomplete buffer may be the 00432 last one from that source. 00433 libburn will read a single sector by each call to (*read). 00434 The size of a sector depends on BURN_MODE_*. The known range is 00435 2048 to 2352. 00436 00437 If this call is reading from a pipe then it will learn 00438 about the end of data only when that pipe gets closed on the 00439 feeder side. So if the track size is not fixed or if the pipe 00440 delivers less than the predicted amount or if the size is not 00441 block aligned, then burning will halt until the input process 00442 closes the pipe. 00443 00444 IMPORTANT: 00445 If this function pointer is NULL, then the struct burn_source is of 00446 version >= 1 and the job of .(*read)() is done by .(*read_xt)(). 00447 See below, member .version. 00448 */ 00449 int (*read)(struct burn_source *, unsigned char *buffer, int size); 00450 00451 00452 /** Read subchannel data from the source (NULL if lib generated) 00453 WARNING: This is an obscure feature with CD raw write modes. 00454 Unless you checked the libburn code for correctness in that aspect 00455 you should not rely on raw writing with own subchannels. 00456 ADVICE: Set this pointer to NULL. 00457 */ 00458 int (*read_sub)(struct burn_source *, unsigned char *buffer, int size); 00459 00460 00461 /** Get the size of the source's data. Return 0 means unpredictable 00462 size. If application provided (*get_size) allows return 0, then 00463 the application MUST provide a fully functional (*set_size). 00464 */ 00465 off_t (*get_size)(struct burn_source *); 00466 00467 00468 /* ts A70125 : BROKE BINARY BACKWARD COMPATIBILITY AT libburn-0.3.1. */ 00469 /* @since 0.3.2 */ 00470 /** Program the reply of (*get_size) to a fixed value. It is advised 00471 to implement this by a attribute off_t fixed_size; in *data . 00472 The read() function does not have to take into respect this fake 00473 setting. It is rather a note of libburn to itself. Eventually 00474 necessary truncation or padding is done in libburn. Truncation 00475 is usually considered a misburn. Padding is considered ok. 00476 00477 libburn is supposed to work even if (*get_size) ignores the 00478 setting by (*set_size). But your application will not be able to 00479 enforce fixed track sizes by burn_track_set_size() and possibly 00480 even padding might be left out. 00481 */ 00482 int (*set_size)(struct burn_source *source, off_t size); 00483 00484 00485 /** Clean up the source specific data. This function will be called 00486 once by burn_source_free() when the last referer disposes the 00487 source. 00488 */ 00489 void (*free_data)(struct burn_source *); 00490 00491 00492 /** Next source, for when a source runs dry and padding is disabled 00493 WARNING: This is an obscure feature. Set to NULL at creation and 00494 from then on leave untouched and uninterpreted. 00495 */ 00496 struct burn_source *next; 00497 00498 00499 /** Source specific data. Here the various source classes express their 00500 specific properties and the instance objects store their individual 00501 management data. 00502 E.g. data could point to a struct like this: 00503 struct app_burn_source 00504 { 00505 struct my_app *app_handle; 00506 ... other individual source parameters ... 00507 off_t fixed_size; 00508 }; 00509 00510 Function (*free_data) has to be prepared to clean up and free 00511 the struct. 00512 */ 00513 void *data; 00514 00515 00516 /* ts A71222 : Supposed to be binary backwards compatible extension. */ 00517 /* @since 0.4.2 */ 00518 /** Valid only if above member .(*read)() is NULL. This indicates a 00519 version of struct burn_source younger than 0. 00520 From then on, member .version tells which further members exist 00521 in the memory layout of struct burn_source. libburn will only touch 00522 those announced extensions. 00523 00524 Versions: 00525 0 has .(*read)() != NULL, not even .version is present. 00526 1 has .version, .(*read_xt)(), .(*cancel)() 00527 */ 00528 int version; 00529 00530 /** This substitutes for (*read)() in versions above 0. */ 00531 int (*read_xt)(struct burn_source *, unsigned char *buffer, int size); 00532 00533 /** Informs the burn_source that the consumer of data prematurely 00534 ended reading. This call may or may not be issued by libburn 00535 before (*free_data)() is called. 00536 */ 00537 int (*cancel)(struct burn_source *source); 00538 }; 00539 00540 00541 /** Information on a drive in the system */ 00542 struct burn_drive_info 00543 { 00544 /** Name of the vendor of the drive */ 00545 char vendor[9]; 00546 /** Name of the drive */ 00547 char product[17]; 00548 /** Revision of the drive */ 00549 char revision[5]; 00550 00551 /** Invalid: Was: "Location of the drive in the filesystem." */ 00552 /** This string has no meaning any more. Once it stored the persistent 00553 drive address. Now always use function burn_drive_d_get_adr() to 00554 inquire a persistent address. ^^^^^^ ALWAYS ^^^^^^^^ */ 00555 char location[17]; 00556 00557 /** Can the drive read DVD-RAM discs */ 00558 unsigned int read_dvdram:1; 00559 /** Can the drive read DVD-R discs */ 00560 unsigned int read_dvdr:1; 00561 /** Can the drive read DVD-ROM discs */ 00562 unsigned int read_dvdrom:1; 00563 /** Can the drive read CD-R discs */ 00564 unsigned int read_cdr:1; 00565 /** Can the drive read CD-RW discs */ 00566 unsigned int read_cdrw:1; 00567 00568 /** Can the drive write DVD-RAM discs */ 00569 unsigned int write_dvdram:1; 00570 /** Can the drive write DVD-R discs */ 00571 unsigned int write_dvdr:1; 00572 /** Can the drive write CD-R discs */ 00573 unsigned int write_cdr:1; 00574 /** Can the drive write CD-RW discs */ 00575 unsigned int write_cdrw:1; 00576 00577 /** Can the drive simulate a write */ 00578 unsigned int write_simulate:1; 00579 00580 /** Can the drive report C2 errors */ 00581 unsigned int c2_errors:1; 00582 00583 /** The size of the drive's buffer (in kilobytes) */ 00584 int buffer_size; 00585 /** 00586 * The supported block types in tao mode. 00587 * They should be tested with the desired block type. 00588 * See also burn_block_types. 00589 */ 00590 int tao_block_types; 00591 /** 00592 * The supported block types in sao mode. 00593 * They should be tested with the desired block type. 00594 * See also burn_block_types. 00595 */ 00596 int sao_block_types; 00597 /** 00598 * The supported block types in raw mode. 00599 * They should be tested with the desired block type. 00600 * See also burn_block_types. 00601 */ 00602 int raw_block_types; 00603 /** 00604 * The supported block types in packet mode. 00605 * They should be tested with the desired block type. 00606 * See also burn_block_types. 00607 */ 00608 int packet_block_types; 00609 00610 /** The value by which this drive can be indexed when using functions 00611 in the library. This is the value to pass to all libbburn functions 00612 that operate on a drive. */ 00613 struct burn_drive *drive; 00614 }; 00615 00616 00617 /** Operation progress report. All values are 0 based indices. 00618 * */ 00619 struct burn_progress { 00620 /** The total number of sessions */ 00621 int sessions; 00622 /** Current session.*/ 00623 int session; 00624 /** The total number of tracks */ 00625 int tracks; 00626 /** Current track. */ 00627 int track; 00628 /** The total number of indices */ 00629 int indices; 00630 /** Curent index. */ 00631 int index; 00632 /** The starting logical block address */ 00633 int start_sector; 00634 /** On write: The number of sectors. 00635 On blank: 0x10000 as upper limit for relative progress steps */ 00636 int sectors; 00637 /** On write: The current sector being processed. 00638 On blank: Relative progress steps 0 to 0x10000 */ 00639 int sector; 00640 00641 /* ts A61023 */ 00642 /* @since 0.2.6 */ 00643 /** The capacity of the drive buffer */ 00644 unsigned buffer_capacity; 00645 /** The free space in the drive buffer (might be slightly outdated) */ 00646 unsigned buffer_available; 00647 00648 /* ts A61119 */ 00649 /* @since 0.2.6 */ 00650 /** The number of bytes sent to the drive buffer */ 00651 off_t buffered_bytes; 00652 /** The minimum number of bytes stored in buffer during write. 00653 (Caution: Before surely one buffer size of bytes was processed, 00654 this value is 0xffffffff.) 00655 */ 00656 unsigned buffer_min_fill; 00657 }; 00658 00659 00660 /* ts A61226 */ 00661 /* @since 0.3.0 */ 00662 /** Description of a speed capability as reported by the drive in conjunction 00663 with eventually loaded media. There can be more than one such object per 00664 drive. So they are chained via .next and .prev , where NULL marks the end 00665 of the chain. This list is set up by burn_drive_scan() and gets updated 00666 by burn_drive_grab(). 00667 A copy may be obtained by burn_drive_get_speedlist() and disposed by 00668 burn_drive_free_speedlist(). 00669 For technical background info see SCSI specs MMC and SPC: 00670 mode page 2Ah (from SPC 5Ah MODE SENSE) , mmc3r10g.pdf , 6.3.11 Table 364 00671 ACh GET PERFORMANCE, Type 03h , mmc5r03c.pdf , 6.8.5.3 Table 312 00672 */ 00673 struct burn_speed_descriptor { 00674 00675 /** Where this info comes from : 00676 0 = misc , 1 = mode page 2Ah , 2 = ACh GET PERFORMANCE */ 00677 int source; 00678 00679 /** The media type that was current at the time of report 00680 -2 = state unknown, -1 = no media was loaded , else see 00681 burn_disc_get_profile() */ 00682 int profile_loaded; 00683 char profile_name[80]; 00684 00685 /** The attributed capacity of appropriate media in logical block units 00686 i.e. 2352 raw bytes or 2048 data bytes. -1 = capacity unknown. */ 00687 int end_lba; 00688 00689 /** Speed is given in 1000 bytes/s , 0 = invalid. The numbers 00690 are supposed to be usable with burn_drive_set_speed() */ 00691 int write_speed; 00692 int read_speed; 00693 00694 /** Expert info from ACh GET PERFORMANCE and/or mode page 2Ah. 00695 Expect values other than 0 or 1 to get a meaning in future.*/ 00696 /* Rotational control: 0 = CLV/default , 1 = CAV */ 00697 int wrc; 00698 /* 1 = drive promises reported performance over full media */ 00699 int exact; 00700 /* 1 = suitable for mixture of read and write */ 00701 int mrw; 00702 00703 /** List chaining. Use .next until NULL to iterate over the list */ 00704 struct burn_speed_descriptor *prev; 00705 struct burn_speed_descriptor *next; 00706 }; 00707 00708 00709 /** Initialize the library. 00710 This must be called before using any other functions in the library. It 00711 may be called more than once with no effect. 00712 It is possible to 'restart' the library by shutting it down and 00713 re-initializing it. Once this was necessary if you follow the older and 00714 more general way of accessing a drive via burn_drive_scan() and 00715 burn_drive_grab(). See burn_drive_scan_and_grab() with its strong 00716 urges and its explanations. 00717 @return Nonzero if the library was able to initialize; zero if 00718 initialization failed. 00719 */ 00720 int burn_initialize(void); 00721 00722 /** Shutdown the library. 00723 This should be called before exiting your application. Make sure that all 00724 drives you have grabbed are released <i>before</i> calling this. 00725 */ 00726 void burn_finish(void); 00727 00728 00729 /* ts A61002 */ 00730 /** Abort any running drive operation and finally call burn_finish(). 00731 You MUST calm down the busy drive if an aborting event occurs during a 00732 burn run. For that you may call this function either from your own signal 00733 handling code or indirectly by activating the builtin signal handling: 00734 burn_set_signal_handling("my_app_name : ", NULL, 0); 00735 Else you may eventually call burn_drive_cancel() on the active drive and 00736 wait for it to assume state BURN_DRIVE_IDLE. 00737 @param patience Maximum number of seconds to wait for drives to finish 00738 @param pacifier_func If not NULL: a function to produce appeasing messages. 00739 See burn_abort_pacifier() for an example. 00740 @param handle Opaque handle to be used with pacifier_func 00741 @return 1 ok, all went well 00742 0 had to leave a drive in unclean state 00743 <0 severe error, do no use libburn again 00744 @since 0.2.6 00745 */ 00746 int burn_abort(int patience, 00747 int (*pacifier_func)(void *handle, int patience, int elapsed), 00748 void *handle); 00749 00750 /** A pacifier function suitable for burn_abort. 00751 @param handle If not NULL, a pointer to a text suitable for printf("%s") 00752 @param patience Maximum number of seconds to wait 00753 @param elapsed Elapsed number of seconds 00754 */ 00755 int burn_abort_pacifier(void *handle, int patience, int elapsed); 00756 00757 00758 /** ts A61006 : This is for development only. Not suitable for applications. 00759 Set the verbosity level of the library. The default value is 0, which means 00760 that nothing is output on stderr. The more you increase this, the more 00761 debug output should be displayed on stderr for you. 00762 @param level The verbosity level desired. 0 for nothing, higher positive 00763 values for more information output. 00764 */ 00765 void burn_set_verbosity(int level); 00766 00767 /* ts A91111 */ 00768 /** Enable resp. disable logging of SCSI commands (currently Linux only). 00769 This call can be made at any time - even before burn_initialize(). 00770 It is in effect for all active drives and currently not very thread 00771 safe for multiple drives. 00772 @param flag Bitfield for control purposes. The default is 0. 00773 bit0= log to file /tmp/libburn_sg_command_log 00774 bit1= log to stderr 00775 bit2= flush output after each line 00776 @since 0.7.4 00777 */ 00778 void burn_set_scsi_logging(int flag); 00779 00780 /* ts A60813 */ 00781 /** Set parameters for behavior on opening device files. To be called early 00782 after burn_initialize() and before any bus scan. But not mandatory at all. 00783 Parameter value 1 enables a feature, 0 disables. 00784 Default is (1,0,0). Have a good reason before you change it. 00785 @param exclusive Linux only: 00786 0 = no attempt to make drive access exclusive. 00787 1 = Try to open only devices which are not marked as busy 00788 and try to mark them busy if opened sucessfully. (O_EXCL) 00789 There are kernels which simply don't care about O_EXCL. 00790 Some have it off, some have it on, some are switchable. 00791 2 = in case of a SCSI device, also try to open exclusively 00792 the matching /dev/sr, /dev/scd and /dev/st . 00793 One may select a device SCSI file family by adding 00794 0 = default family 00795 4 = /dev/sr%d 00796 8 = /dev/scd%d 00797 16 = /dev/sg%d 00798 Do not use other values ! 00799 Add 32 to demand an exclusive lock by fcntl(,F_SETLK,) 00800 after open() has succeeded. 00801 @param blocking Try to wait for drives which do not open immediately but 00802 also do not return an error as well. (O_NONBLOCK) 00803 This might stall indefinitely with /dev/hdX hard disks. 00804 @param abort_on_busy Unconditionally abort process when a non blocking 00805 exclusive opening attempt indicates a busy drive. 00806 Use this only after thorough tests with your app. 00807 @since 0.2.2 00808 */ 00809 void burn_preset_device_open(int exclusive, int blocking, int abort_on_busy); 00810 00811 00812 /* ts A70223 */ 00813 /** Allows the use of media types which are implemented in libburn but not yet 00814 tested. The list of those untested profiles is subject to change. 00815 Currently it contains: 0x15 "DVD-R/DL sequential recording", 00816 If you really test such media, then please report the outcome on 00817 libburn-hackers@pykix.org 00818 If ever then this call should be done soon after burn_initialize() before 00819 any drive scanning. 00820 @param yes 1=allow all implemented profiles, 0=only tested media (default) 00821 @since 0.3.4 00822 */ 00823 void burn_allow_untested_profiles(int yes); 00824 00825 00826 /* ts A60823 */ 00827 /** Aquire a drive with known persistent address. 00828 00829 This is the sysadmin friendly way to open one drive and to leave all 00830 others untouched. It bundles the following API calls to form a 00831 non-obtrusive way to use libburn: 00832 burn_drive_add_whitelist() , burn_drive_scan() , burn_drive_grab() 00833 You are *strongly urged* to use this call whenever you know the drive 00834 address in advance. 00835 00836 If not, then you have to use directly above calls. In that case, you are 00837 *strongly urged* to drop any unintended drive which will be exclusively 00838 occupied and not closed by burn_drive_scan(). 00839 This can be done by shutting down the library including a call to 00840 burn_finish(). You may later start a new libburn session and should then 00841 use the function described here with an address obtained after 00842 burn_drive_scan() via burn_drive_d_get_adr(drive_infos[driveno].drive,adr). 00843 Another way is to drop the unwanted drives by burn_drive_info_forget(). 00844 00845 Operating on multiple drives: 00846 00847 Different than with burn_drive_scan() it is allowed to call 00848 burn_drive_scan_and_grab() without giving up any other scanned drives. So 00849 this call can be used to get a collection of more than one aquired drives. 00850 The attempt to aquire the same drive twice will fail, though. 00851 00852 Pseudo-drives: 00853 00854 burn_drive_scan_and_grab() is able to aquire virtual drives which will 00855 accept options much like a MMC burner drive. Many of those options will not 00856 cause any effect, though. The address of a pseudo-drive begins with 00857 prefix "stdio:" followed by a path. 00858 Examples: "stdio:/tmp/pseudo_drive" , "stdio:/dev/null" , "stdio:-" 00859 00860 If the path is empty, the result is a null-drive = drive role 0. 00861 It pretends to have loaded no media and supports no reading or writing. 00862 00863 If the path leads to an existing regular file, or to a not yet existing 00864 file, or to an existing block device, then the result is a random access 00865 stdio-drive capable of reading and writing = drive role 2. 00866 00867 If the path leads to an existing file of any type other than directory, 00868 then the result is a sequential write-only stdio-drive = drive role 3. 00869 00870 The special address form "stdio:/dev/fd/{number}" is interpreted literally 00871 as reference to open file descriptor {number}. This address form coincides 00872 with real files on some systems, but it is in fact hardcoded in libburn. 00873 Special address "stdio:-" means stdout = "stdio:/dev/fd/1". 00874 The role of such a drive is determined by the file type obtained via 00875 fstat({number}). 00876 00877 Roles 2 and 3 perform all their eventual data transfer activities on a file 00878 via standard i/o functions open(2), lseek(2), read(2), write(2), close(2). 00879 The media profile is reported as 0xffff. Write space information from those 00880 media is not necessarily realistic. 00881 00882 The capabilities of role 2 resemble DVD-RAM but it can simulate writing. 00883 If the path does not exist in the filesystem yet, it is attempted to create 00884 it as a regular file as soon as write operations are started. 00885 00886 The capabilities of role 3 resemble a blank DVD-R. Nevertheless each 00887 burn_disc_write() run may only write a single track. 00888 00889 One may distinguish pseudo-drives from MMC drives by call 00890 burn_drive_get_drive_role(). 00891 00892 @param drive_infos On success returns a one element array with the drive 00893 (cdrom/burner). Thus use with driveno 0 only. On failure 00894 the array has no valid elements at all. 00895 The returned array should be freed via burn_drive_info_free() 00896 when it is no longer needed. 00897 This is a result from call burn_drive_scan(). See there. 00898 Use with driveno 0 only. 00899 @param adr The persistent address of the desired drive. Either once 00900 obtained by burn_drive_d_get_adr() or composed skillfully by 00901 application resp. its user. E.g. "/dev/sr0". 00902 Consider to preprocess it by burn_drive_convert_fs_adr(). 00903 @param load Nonzero to make the drive attempt to load a disc (close its 00904 tray door, etc). 00905 @return 1 = success , 0 = drive not found , -1 = other error 00906 @since 0.2.2 00907 */ 00908 int burn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], 00909 char* adr, int load); 00910 00911 00912 /* ts A51221 */ 00913 /* @since 0.2.2 */ 00914 /** Maximum number of particularly permissible drive addresses */ 00915 #define BURN_DRIVE_WHITELIST_LEN 255 00916 00917 /** Add a device to the list of permissible drives. As soon as some entry is in 00918 the whitelist all non-listed drives are banned from scanning. 00919 @return 1 success, <=0 failure 00920 @since 0.2.2 00921 */ 00922 int burn_drive_add_whitelist(char *device_address); 00923 00924 /** Remove all drives from whitelist. This enables all possible drives. */ 00925 void burn_drive_clear_whitelist(void); 00926 00927 00928 /** Scan for drives. This function MUST be called until it returns nonzero. 00929 In case of re-scanning: 00930 All pointers to struct burn_drive and all struct burn_drive_info arrays 00931 are invalidated by using this function. Do NOT store drive pointers across 00932 calls to this function ! 00933 To avoid invalid pointers one MUST free all burn_drive_info arrays 00934 by burn_drive_info_free() before calling burn_drive_scan() a second time. 00935 If there are drives left, then burn_drive_scan() will refuse to work. 00936 00937 After this call all drives depicted by the returned array are subject 00938 to eventual (O_EXCL) locking. See burn_preset_device_open(). This state 00939 ends either with burn_drive_info_forget() or with burn_drive_release(). 00940 It is unfriendly to other processes on the system to hold drives locked 00941 which one does not definitely plan to use soon. 00942 @param drive_infos Returns an array of drive info items (cdroms/burners). 00943 The returned array must be freed by burn_drive_info_free() 00944 before burn_finish(), and also before calling this function 00945 burn_drive_scan() again. 00946 @param n_drives Returns the number of drive items in drive_infos. 00947 @return 0 while scanning is not complete 00948 >0 when it is finished sucessfully, 00949 <0 when finished but failed. 00950 */ 00951 int burn_drive_scan(struct burn_drive_info *drive_infos[], 00952 unsigned int *n_drives); 00953 00954 /* ts A60904 : ticket 62, contribution by elmom */ 00955 /** Release memory about a single drive and any exclusive lock on it. 00956 Become unable to inquire or grab it. Expect FATAL consequences if you try. 00957 @param drive_info pointer to a single element out of the array 00958 obtained from burn_drive_scan() : &(drive_infos[driveno]) 00959 @param force controls degree of permissible drive usage at the moment this 00960 function is called, and the amount of automatically provided 00961 drive shutdown : 00962 0= drive must be ungrabbed and BURN_DRIVE_IDLE 00963 1= try to release drive resp. accept BURN_DRIVE_GRABBING 00964 Use these two only. Further values are to be defined. 00965 @return 1 on success, 2 if drive was already forgotten, 00966 0 if not permissible, <0 on other failures, 00967 @since 0.2.2 00968 */ 00969 int burn_drive_info_forget(struct burn_drive_info *drive_info, int force); 00970 00971 00972 /** When no longer needed, free a whole burn_drive_info array which was 00973 returned by burn_drive_scan(). 00974 For freeing single drive array elements use burn_drive_info_forget(). 00975 */ 00976 void burn_drive_info_free(struct burn_drive_info drive_infos[]); 00977 00978 00979 /* ts A60823 */ 00980 /* @since 0.2.2 */ 00981 /** Maximum length+1 to expect with a persistent drive address string */ 00982 #define BURN_DRIVE_ADR_LEN 1024 00983 00984 /* ts A70906 */ 00985 /** Inquire the persistent address of the given drive. 00986 @param drive The drive to inquire. 00987 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN 00988 characters size. The persistent address gets copied to it. 00989 @return >0 success , <=0 error (due to libburn internal problem) 00990 @since 0.4.0 00991 */ 00992 int burn_drive_d_get_adr(struct burn_drive *drive, char adr[]); 00993 00994 /* A60823 */ 00995 /** Inquire the persistent address of a drive via a given drive_info object. 00996 (Note: This is a legacy call.) 00997 @param drive_info The drive to inquire.Usually some &(drive_infos[driveno]) 00998 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN 00999 characters size. The persistent address gets copied to it. 01000 @return >0 success , <=0 error (due to libburn internal problem) 01001 @since 0.2.6 01002 */ 01003 int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[]); 01004 01005 01006 /* ts A60922 ticket 33 */ 01007 /** Evaluate whether the given address would be a possible persistent drive 01008 address of libburn. 01009 @return 1 means yes, 0 means no 01010 @since 0.2.6 01011 */ 01012 int burn_drive_is_enumerable_adr(char *adr); 01013 01014 /* ts A60922 ticket 33 */ 01015 /** Try to convert a given existing filesystem address into a persistent drive 01016 address. This succeeds with symbolic links or if a hint about the drive's 01017 system address can be read from the filesystem object and a matching drive 01018 is found. 01019 @param path The address of an existing file system object 01020 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN 01021 characters size. The persistent address gets copied to it. 01022 @return 1 = success , 0 = failure , -1 = severe error 01023 @since 0.2.6 01024 */ 01025 int burn_drive_convert_fs_adr(char *path, char adr[]); 01026 01027 /* ts A60923 */ 01028 /** Try to convert a given SCSI address of bus,host,channel,target,lun into 01029 a persistent drive address. If a SCSI address component parameter is < 0 01030 then it is not decisive and the first enumerated address which matches 01031 the >= 0 parameters is taken as result. 01032 Note: bus and (host,channel) are supposed to be redundant. 01033 @param bus_no "Bus Number" (something like a virtual controller) 01034 @param host_no "Host Number" (something like half a virtual controller) 01035 @param channel_no "Channel Number" (other half of "Host Number") 01036 @param target_no "Target Number" or "SCSI Id" (a device) 01037 @param lun_no "Logical Unit Number" (a sub device) 01038 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN 01039 characters size. The persistent address gets copied to it. 01040 @return 1 = success , 0 = failure , -1 = severe error 01041 @since 0.2.6 01042 */ 01043 int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no, 01044 int target_no, int lun_no, char adr[]); 01045 01046 /* ts A60923 - A61005 */ 01047 /** Try to obtain bus,host,channel,target,lun from path. If there is an SCSI 01048 address at all, then this call should succeed with a persistent 01049 drive address obtained via burn_drive_d_get_adr(). It is also supposed to 01050 succeed with any device file of a (possibly emulated) SCSI device. 01051 @return 1 = success , 0 = failure , -1 = severe error 01052 @since 0.2.6 01053 */ 01054 int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no, 01055 int *channel_no, int *target_no, int *lun_no); 01056 01057 /** Grab a drive. This must be done before the drive can be used (for reading, 01058 writing, etc). 01059 @param drive The drive to grab. This is found in a returned 01060 burn_drive_info struct. 01061 @param load Nonzero to make the drive attempt to load a disc (close its 01062 tray door, etc). 01063 @return 1 if it was possible to grab the drive, else 0 01064 */ 01065 int burn_drive_grab(struct burn_drive *drive, int load); 01066 01067 /* ts B00114 */ 01068 /* Probe available CD write modes and block types. In earlier versions this 01069 was done unconditionally on drive examination or aquiration. But it is 01070 lengthy and obtrusive, up to spoiling burn runs on the examined drives. 01071 So now this probing is omitted by default. All drives which announce to be 01072 capable of CD or DVD writing, get blindly attributed the capability for 01073 SAO and TAO. Applications which are interested in RAW modes or want to 01074 rely on the traditional write mode information, may use this call. 01075 @param drive_info drive object to be inquired 01076 @return >0 indicates success, <=0 means failure 01077 @since 0.7.6 01078 */ 01079 int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info); 01080 01081 /* ts A90824 */ 01082 /** Calm down or alert a drive. Some drives stay alert after reading for 01083 quite some time. This saves time with the startup for the next read 01084 operation but also causes noise and consumes extra energy. It makes 01085 sense to calm down the drive if no read operation is expected for the 01086 next few seconds. The drive will get alert automatically if operations 01087 are required. 01088 @param d The drive to influence. 01089 @param flag Bitfield for control purposes 01090 bit0= become alert (else start snoozing) 01091 This is not mandatory to allow further drive operations 01092 @return 1= success , 0= drive role not suitable for calming 01093 @since 0.7.0 01094 */ 01095 int burn_drive_snooze(struct burn_drive *d, int flag); 01096 01097 01098 /** Release a drive. This should not be done until the drive is no longer 01099 busy (see burn_drive_get_status). 01100 Linux: The drive device file is not reserved afterwards. (O_EXCL, F_SETLK). 01101 @param drive The drive to release. 01102 @param eject Nonzero to make the drive eject the disc in it. 01103 */ 01104 void burn_drive_release(struct burn_drive *drive, int eject); 01105 01106 01107 /* ts A70918 */ 01108 /** Like burn_drive_release() but keeping the drive tray closed and its 01109 eject button disabled. This physically locked drive state will last until 01110 the drive is grabbed again and released via burn_drive_release(). 01111 Programs like eject, cdrecord, growisofs will break that ban too. 01112 @param d The drive to release and leave locked. 01113 @param flag Bitfield for control purposes (unused yet, submit 0) 01114 @return 1 means success, <=0 means failure 01115 @since 0.4.0 01116 */ 01117 int burn_drive_leave_locked(struct burn_drive *d, int flag); 01118 01119 01120 /** Returns what kind of disc a drive is holding. This function may need to be 01121 called more than once to get a proper status from it. See burn_disc_status 01122 for details. 01123 @param drive The drive to query for a disc. 01124 @return The status of the drive, or what kind of disc is in it. 01125 Note: BURN_DISC_UNGRABBED indicates wrong API usage 01126 */ 01127 enum burn_disc_status burn_disc_get_status(struct burn_drive *drive); 01128 01129 01130 /* ts A61020 */ 01131 /** WARNING: This revives an old bug-like behavior that might be dangerous. 01132 Sets the drive status to BURN_DISC_BLANK if it is BURN_DISC_UNREADY 01133 or BURN_DISC_UNSUITABLE. Thus marking media as writable which actually 01134 failed to declare themselves either blank or (partially) filled. 01135 @return 1 drive status has been set , 0 = unsuitable drive status 01136 @since 0.2.6 01137 */ 01138 int burn_disc_pretend_blank(struct burn_drive *drive); 01139 01140 01141 /* ts A61106 */ 01142 /** WARNING: This overrides the safety measures against unsuitable media. 01143 Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY 01144 or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually 01145 failed to declare themselves either blank or (partially) filled. 01146 @since 0.2.6 01147 */ 01148 int burn_disc_pretend_full(struct burn_drive *drive); 01149 01150 01151 /* ts A61021 */ 01152 /** Reads ATIP information from inserted media. To be obtained via 01153 burn_drive_get_write_speed(), burn_drive_get_min_write_speed(), 01154 burn_drive_get_start_end_lba(). The drive must be grabbed for this call. 01155 @param drive The drive to query. 01156 @return 1=sucess, 0=no valid ATIP info read, -1 severe error 01157 @since 0.2.6 01158 */ 01159 int burn_disc_read_atip(struct burn_drive *drive); 01160 01161 01162 /* ts A61020 */ 01163 /** Returns start and end lba of the media which is currently inserted 01164 in the given drive. The drive has to be grabbed to have hope for reply. 01165 Shortcomming (not a feature): unless burn_disc_read_atip() was called 01166 only blank media will return valid info. 01167 @param drive The drive to query. 01168 @param start_lba Returns the start lba value 01169 @param end_lba Returns the end lba value 01170 @param flag Bitfield for control purposes (unused yet, submit 0) 01171 @return 1 if lba values are valid , 0 if invalid 01172 @since 0.2.6 01173 */ 01174 int burn_drive_get_start_end_lba(struct burn_drive *drive, 01175 int *start_lba, int *end_lba, int flag); 01176 01177 01178 /* ts A90902 */ 01179 /** Guess the manufacturer name of CD media from the ATIP addresses of lead-in 01180 and lead-out. (Currently only lead-in is interpreted. Lead-out may in 01181 future be used to identify the media type in more detail.) 01182 The parameters of this call should be obtained by burn_disc_read_atip(d), 01183 burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0), 01184 burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and 01185 burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo). 01186 @param m_li "minute" part of ATIP lead-in resp. start_lba 01187 @param s_li "second" of lead-in resp. start_lba 01188 @param f_li "frame" of lead-in 01189 @param m_lo "minute" part of ATIP lead-out 01190 @param s_lo "second" of lead-out 01191 @param f_lo "frame" of lead-out 01192 @param flag Bitfield for control purposes, 01193 bit0= append a text "(aka ...)" to reply if other brands or 01194 vendor names are known. 01195 @return Printable text or NULL on memory shortage. 01196 Dispose by free() when no longer needed. 01197 @since 0.7.2 01198 */ 01199 char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li, 01200 int m_lo, int s_lo, int f_lo, int flag); 01201 01202 /* ts A90909 */ 01203 /** Retrieve some media information which is mainly specific to CD. For other 01204 media only the bits in reply parameter valid are supposed to be meaningful. 01205 @param d The drive to query. 01206 @param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I", 01207 or ""CD-ROM XA", or "undefined". 01208 @param disc_id A 32 bit number read from the media. (Meaning unclear yet) 01209 @param bar_code 8 hex digits from a barcode on media read by the drive 01210 (if the drive has a bar code reader built in). 01211 @param app_code The Host Application Code which must be set in the Write 01212 Parameters Page if the media is not unrestricted (URU==0). 01213 @param valid Replies bits which indicate the validity of other reply 01214 parameters or the state of certain CD info bits: 01215 bit0= disc_type is valid 01216 bit1= disc_id is valid 01217 bit2= bar_code is valid 01218 bit3= disc_app_code is valid 01219 bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO) 01220 This seems to be broken with my drives. The bit is 01221 0 and the validity bit for disc_app_code is 0 too. 01222 bit5= Disc is nominally erasable (Erasable bit) 01223 This will be set with overwriteable media which 01224 libburn normally considers to be unerasable blank. 01225 @since 0.7.2 01226 */ 01227 int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80], 01228 unsigned int *disc_id, char bar_code[9], int *app_code, 01229 int *valid); 01230 01231 01232 /* ts A61110 */ 01233 /** Read start lba and Next Writeable Address of a track from media. 01234 Usually a track lba is obtained from the result of burn_track_get_entry(). 01235 This call retrieves an updated lba, eventual nwa, and can address the 01236 invisible track to come. 01237 The drive must be grabbed for this call. One may not issue this call 01238 during ongoing burn_disc_write() or burn_disc_erase(). 01239 @param d The drive to query. 01240 @param o If not NULL: write parameters to be set on drive before query 01241 @param trackno 0=next track to come, >0 number of existing track 01242 @param lba return value: start lba 01243 @param nwa return value: Next Writeable Address 01244 @return 1=nwa is valid , 0=nwa is not valid , -1=error 01245 @since 0.2.6 01246 */ 01247 int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, 01248 int trackno, int *lba, int *nwa); 01249 01250 /* ts A70131 */ 01251 /** Read start lba of the first track in the last complete session. 01252 This is the first parameter of mkisofs option -C. The second parameter 01253 is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0. 01254 @param d The drive to query. 01255 @param start_lba returns the start address of that track 01256 @return <= 0 : failure, 1 = ok 01257 @since 0.3.2 01258 */ 01259 int burn_disc_get_msc1(struct burn_drive *d, int *start_lba); 01260 01261 01262 /* ts A70213 */ 01263 /** Return the best possible estimation of the currently available capacity of 01264 the media. This might depend on particular write option settings. For 01265 inquiring the space with such a set of options, the drive has to be 01266 grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value 01267 from the most recent automatic inquiry (e.g. during last drive grabbing). 01268 An eventual start address from burn_write_opts_set_start_byte() will be 01269 subtracted from the obtained capacity estimation. Negative results get 01270 defaulted to 0. 01271 @param d The drive to query. 01272 @param o If not NULL: write parameters to be set on drive before query 01273 @return number of most probably available free bytes 01274 @since 0.3.4 01275 */ 01276 off_t burn_disc_available_space(struct burn_drive *d, 01277 struct burn_write_opts *o); 01278 01279 01280 /* ts A61202 */ 01281 /** Tells the MMC Profile identifier of the loaded media. The drive must be 01282 grabbed in order to get a non-zero result. 01283 libburn currently writes only to profiles 01284 0x09 "CD-R", 0x0a "CD-RW", 01285 0x11 "DVD-R sequential recording", 0x12 "DVD-RAM", 01286 0x13 "DVD-RW restricted overwrite", 0x14 "DVD-RW sequential recording", 01287 0x1a "DVD+RW", 0x1b "DVD+R", 01288 0x2b "DVD+R/DL", 01289 0x41 "BD-R sequential recording", 0x43 "BD-RE", 01290 0xffff "stdio file" 01291 Note: 0xffff is not a MMC profile but a libburn invention. 01292 If enabled by burn_allow_untested_profiles() it also writes to profiles 01293 0x15 "DVD-R/DL sequential recording", 01294 Read-only are the profiles 01295 0x08 "CD-ROM", 0x10 "DVD-ROM", 01296 0x40 "BD-ROM", 01297 For now read-only is BD-R profile (testers wanted) 01298 0x42 "BD-R random recording" 01299 @param d The drive where the media is inserted. 01300 @param pno Profile Number. See also mmc5r03c.pdf, table 89 01301 @param name Profile Name (see above list, unknown profiles have empty name) 01302 @return 1 profile is valid, 0 no profile info available 01303 @since 0.3.0 01304 */ 01305 int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80]); 01306 01307 01308 /* ts A90903 : API */ 01309 /** Obtain product id and standards defined media codes. 01310 The product id is a printable string which is supposed to be the same 01311 for identical media but should vary with non-identical media. Some media 01312 do not allow to obtain such an id at all. 01313 The pair (profile_number, product_id) should be the best id to identify 01314 media with identical product specifications. 01315 The reply parameters media_code1 and media_code2 can be used with 01316 burn_guess_manufacturer() 01317 The reply parameters have to be disposed by free() when no longer needed. 01318 @param d The drive where the media is inserted. 01319 @param product_id Reply: Printable text depicting manufacturer and 01320 eventually media id. 01321 @param media_code1 Reply: The eventual manufacturer identification as read 01322 from DVD/BD media or a text "XXmYYsZZf" from CD media 01323 ATIP lead-in. 01324 @param media_code2 The eventual media id as read from DVD+/BD media or a 01325 text "XXmYYsZZf" from CD ATIP lead-out. 01326 @param book_type Book type text for DVD and BD. 01327 Caution: is NULL with CD, even if return value says ok. 01328 @param flag Bitfield for control purposes 01329 bit0= do not escape " _/" (not suitable for 01330 burn_guess_manufacturer()) 01331 @return 1= ok, product_id and media codes are valid, 01332 0= no product id_available, reply parameters are NULL 01333 <0= error 01334 @since 0.7.2 01335 */ 01336 int burn_disc_get_media_id(struct burn_drive *d, 01337 char **product_id, char **media_code1, char **media_code2, 01338 char **book_type, int flag); 01339 01340 01341 /* ts A90904 */ 01342 /** Guess the name of a manufacturer by profile number, manufacturer code 01343 and media code. The profile number can be obtained by 01344 burn_disc_get_profile(), the other two parameters can be obtained as 01345 media_code1 and media_code2 by burn_get_media_product_id(). 01346 @param profile_no Profile number (submit -1 if not known) 01347 @param manuf_code Manufacturer code from media (e.g. "RICOHJPN") 01348 @param media_code Media ID code from media (e.g. "W11") 01349 @param flag Bitfield for control purposes, submit 0 01350 @return Printable text or NULL on memory shortage. 01351 If the text begins with "Unknown " then no item of the 01352 manufacturer list matched the codes. 01353 Dispose by free() when no longer needed. 01354 @since 0.7.2 01355 */ 01356 char *burn_guess_manufacturer(int profile_no, 01357 char *manuf_code, char *media_code, int flag); 01358 01359 01360 /** Tells whether a disc can be erased or not 01361 @param d The drive to inquire. 01362 @return Non-zero means erasable 01363 */ 01364 int burn_disc_erasable(struct burn_drive *d); 01365 01366 /** Returns the progress and status of a drive. 01367 @param drive The drive to query busy state for. 01368 @param p Returns the progress of the operation, NULL if you don't care 01369 @return the current status of the drive. See also burn_drive_status. 01370 */ 01371 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive, 01372 struct burn_progress *p); 01373 01374 /** Creates a write_opts struct for burning to the specified drive. 01375 The returned object must later be freed with burn_write_opts_free(). 01376 @param drive The drive to write with 01377 @return The write_opts, NULL on error 01378 */ 01379 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive); 01380 01381 01382 /* ts A70901 */ 01383 /** Inquires the drive associated with a burn_write_opts object. 01384 @param opts object to inquire 01385 @return pointer to drive 01386 @since 0.4.0 01387 */ 01388 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts); 01389 01390 01391 /** Frees a write_opts struct created with burn_write_opts_new 01392 @param opts write_opts to free 01393 */ 01394 void burn_write_opts_free(struct burn_write_opts *opts); 01395 01396 /** Creates a read_opts struct for reading from the specified drive 01397 must be freed with burn_read_opts_free 01398 @param drive The drive to read from 01399 @return The read_opts 01400 */ 01401 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive); 01402 01403 /** Frees a read_opts struct created with burn_read_opts_new 01404 @param opts write_opts to free 01405 */ 01406 void burn_read_opts_free(struct burn_read_opts *opts); 01407 01408 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE 01409 calling this functions. Always ensure that the drive reports a status of 01410 BURN_DISC_FULL before calling this function. An erase operation is not 01411 cancellable, as control of the operation is passed wholly to the drive and 01412 there is no way to interrupt it safely. 01413 @param drive The drive with which to erase a disc. 01414 @param fast Nonzero to do a fast erase, where only the disc's headers are 01415 erased; zero to erase the entire disc. 01416 With DVD-RW, fast blanking yields media capable only of DAO. 01417 */ 01418 void burn_disc_erase(struct burn_drive *drive, int fast); 01419 01420 01421 /* ts A70101 - A70417 */ 01422 /** Format media for use with libburn. This currently applies to DVD-RW 01423 in state "Sequential Recording" (profile 0014h) which get formatted to 01424 state "Restricted Overwrite" (profile 0013h). DVD+RW can be "de-iced" 01425 by setting bit2 of flag. DVD-RAM and BD-RE may get formatted initially 01426 or re-formatted to adjust their Defect Managment. 01427 This function usually returns while the drive is still in the process 01428 of formatting. The formatting is done, when burn_drive_get_status() 01429 returns BURN_DRIVE_IDLE. This may be immediately after return or may 01430 need several thousand seconds to occur. 01431 @param drive The drive with the disc to format. 01432 @param size The size in bytes to be used with the format command. It should 01433 be divisible by 32*1024. The effect of this parameter may 01434 depend on the media profile and on parameter flag. 01435 @param flag Bitfield for control purposes: 01436 bit0= after formatting, write the given number of zero-bytes 01437 to the media and eventually perform preliminary closing. 01438 bit1+2: size mode 01439 0 = use parameter size as far as it makes sense 01440 1 = insist in size 0 even if there is a better default known 01441 (on DVD-RAM or BD-R identical to size mode 0, 01442 i.e. they never get formatted with payload size 0) 01443 2 = without bit7: format to maximum available size 01444 with bit7 : take size from indexed format descriptor 01445 3 = without bit7: format to default size 01446 with bit7 : take size from indexed format descriptor 01447 bit3= -reserved- 01448 bit4= enforce re-format of (partly) formatted media 01449 bit5= try to disable eventual defect management 01450 bit6= try to avoid lengthy media certification 01451 bit7, bit8 to bit15 = 01452 bit7 enables MMC expert application mode (else libburn 01453 tries to choose a suitable format type): 01454 If it is set then bit8 to bit15 contain the index of 01455 the format to use. See burn_disc_get_formats(), 01456 burn_disc_get_format_descr(). 01457 Acceptable types are: 0x00, 0x01, 0x10, 0x11, 0x13, 01458 0x15, 0x26, 0x30, 0x31, 0x32. 01459 If bit7 is set, then bit4 is set automatically. 01460 bit16= enable POW on blank BD-R 01461 @since 0.3.0 01462 */ 01463 void burn_disc_format(struct burn_drive *drive, off_t size, int flag); 01464 01465 01466 /* ts A70112 */ 01467 /* @since 0.3.0 */ 01468 /** Possible formatting status values */ 01469 #define BURN_FORMAT_IS_UNFORMATTED 1 01470 #define BURN_FORMAT_IS_FORMATTED 2 01471 #define BURN_FORMAT_IS_UNKNOWN 3 01472 01473 /* ts A70112 */ 01474 /** Inquire the formatting status, the associated sizes and the number of 01475 available formats. The info is media specific and stems from MMC command 01476 23h READ FORMAT CAPACITY. See mmc5r03c.pdf 6.24 for background details. 01477 Media type can be determined via burn_disc_get_profile(). 01478 @param drive The drive with the disc to format. 01479 @param status The current formatting status of the inserted media. 01480 See BURN_FORMAT_IS_* macros. Note: "unknown" is the 01481 legal status for quick formatted, yet unwritten DVD-RW. 01482 @param size The size in bytes associated with status. 01483 unformatted: the maximum achievable size of the media 01484 formatted: the currently formatted capacity 01485 unknown: maximum capacity of drive or of media 01486 @param bl_sas Additional info "Block Length/Spare Area Size". 01487 Expected to be constantly 2048 for non-BD media. 01488 @param num_formats The number of available formats. To be used with 01489 burn_disc_get_format_descr() to obtain such a format 01490 and eventually with burn_disc_format() to select one. 01491 @return 1 reply is valid , <=0 failure 01492 @since 0.3.0 01493 */ 01494 int burn_disc_get_formats(struct burn_drive *drive, int *status, off_t *size, 01495 unsigned *bl_sas, int *num_formats); 01496 01497 /* ts A70112 */ 01498 /** Inquire parameters of an available media format. 01499 @param drive The drive with the disc to format. 01500 @param index The index of the format item. Beginning with 0 up to reply 01501 parameter from burn_disc_get_formats() : num_formats - 1 01502 @param type The format type. See mmc5r03c.pdf, 6.5, 04h FORMAT UNIT. 01503 0x00=full, 0x10=CD-RW/DVD-RW full, 0x11=CD-RW/DVD-RW grow, 01504 0x15=DVD-RW quick, 0x13=DVD-RW quick grow, 01505 0x26=DVD+RW background, 0x30=BD-RE with spare areas, 01506 0x31=BD-RE without spare areas 01507 @param size The maximum size in bytes achievable with this format. 01508 @param tdp Type Dependent Parameter. See mmc5r03c.pdf. 01509 @return 1 reply is valid , <=0 failure 01510 @since 0.3.0 01511 */ 01512 int burn_disc_get_format_descr(struct burn_drive *drive, int index, 01513 int *type, off_t *size, unsigned *tdp); 01514 01515 01516 01517 /* ts A61109 : this was and is defunct */ 01518 /** Read a disc from the drive and write it to an fd pair. The drive must be 01519 grabbed successfully BEFORE calling this function. Always ensure that the 01520 drive reports a status of BURN_DISC_FULL before calling this function. 01521 @param drive The drive from which to read a disc. 01522 @param o The options for the read operation. 01523 */ 01524 void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o); 01525 01526 01527 01528 /* ts A70222 */ 01529 /* @since 0.3.4 */ 01530 /** The length of a rejection reasons string for burn_precheck_write() and 01531 burn_write_opts_auto_write_type() . 01532 */ 01533 #define BURN_REASONS_LEN 4096 01534 01535 01536 /* ts A70219 */ 01537 /** Examines a completed setup for burn_disc_write() whether it is permissible 01538 with drive and media. This function is called by burn_disc_write() but 01539 an application might be interested in this check in advance. 01540 @param o The options for the writing operation. 01541 @param disc The descrition of the disc to be created 01542 @param reasons Eventually returns a list of rejection reason statements 01543 @param silent 1= do not issue error messages , 0= report problems 01544 @return 1 ok, -1= no recordable media detected, 0= other failure 01545 @since 0.3.4 01546 */ 01547 int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, 01548 char reasons[BURN_REASONS_LEN], int silent); 01549 01550 01551 /** Write a disc in the drive. The drive must be grabbed successfully before 01552 calling this function. Always ensure that the drive reports a status of 01553 BURN_DISC_BLANK ot BURN_DISC_APPENDABLE before calling this function. 01554 Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix 01555 of data and audio tracks. You must use BURN_WRITE_TAO for such sessions. 01556 To be set by burn_write_opts_set_write_type(). 01557 Note: This function is not suitable for overwriting data in the middle of 01558 a valid data area because it is allowed to append trailing data. 01559 For exact random access overwriting use burn_random_access_write(). 01560 @param o The options for the writing operation. 01561 @param disc The struct burn_disc * that described the disc to be created 01562 */ 01563 void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc); 01564 01565 01566 /* ts A90227 */ 01567 /** Control stream recording during the write run and eventually set the start 01568 LBA for stream recording. 01569 Stream recording is set from struct burn_write_opts when the write run 01570 gets started. See burn_write_opts_set_stream_recording(). 01571 The call described here can be used later to override this setting and 01572 to program automatic switching at a given LBA. It also affects subsequent 01573 calls to burn_random_access_write(). 01574 @param drive The drive which performs the write operation. 01575 @param recmode -1= disable stream recording 01576 0= leave setting as is 01577 1= enable stream recording 01578 @param start The LBA where actual stream recording shall start. 01579 (0 means unconditional stream recording) 01580 @param flag Bitfield for control purposes (unused yet, submit 0). 01581 @return 1=success , <=0 failure 01582 @since 0.6.4 01583 */ 01584 int burn_drive_set_stream_recording(struct burn_drive *drive, int recmode, 01585 int start, int flag); 01586 01587 /** Cancel an operation on a drive. 01588 This will only work when the drive's busy state is BURN_DRIVE_READING or 01589 BURN_DRIVE_WRITING. 01590 @param drive The drive on which to cancel the current operation. 01591 */ 01592 void burn_drive_cancel(struct burn_drive *drive); 01593 01594 01595 /* ts A61223 */ 01596 /** Inquire whether the most recent asynchronous media job was successful. 01597 This applies to burn_disc_erase(), burn_disc_format(), burn_disc_write(). 01598 Reasons for non-success may be: rejection of burn parameters, abort due to 01599 fatal errors during write, blank or format, a call to burn_drive_cancel() 01600 by the application thread. 01601 @param d The drive to inquire. 01602 @return 1=burn seems to have went well, 0=burn failed 01603 @since 0.2.6 01604 */ 01605 int burn_drive_wrote_well(struct burn_drive *d); 01606 01607 01608 /** Convert a minute-second-frame (MSF) value to sector count 01609 @param m Minute component 01610 @param s Second component 01611 @param f Frame component 01612 @return The sector count 01613 */ 01614 int burn_msf_to_sectors(int m, int s, int f); 01615 01616 /** Convert a sector count to minute-second-frame (MSF) 01617 @param sectors The sector count 01618 @param m Returns the minute component 01619 @param s Returns the second component 01620 @param f Returns the frame component 01621 */ 01622 void burn_sectors_to_msf(int sectors, int *m, int *s, int *f); 01623 01624 /** Convert a minute-second-frame (MSF) value to an lba 01625 @param m Minute component 01626 @param s Second component 01627 @param f Frame component 01628 @return The lba 01629 */ 01630 int burn_msf_to_lba(int m, int s, int f); 01631 01632 /** Convert an lba to minute-second-frame (MSF) 01633 @param lba The lba 01634 @param m Returns the minute component 01635 @param s Returns the second component 01636 @param f Returns the frame component 01637 */ 01638 void burn_lba_to_msf(int lba, int *m, int *s, int *f); 01639 01640 /** Create a new disc 01641 @return Pointer to a burn_disc object or NULL on failure. 01642 */ 01643 struct burn_disc *burn_disc_create(void); 01644 01645 /** Delete disc and decrease the reference count on all its sessions 01646 @param d The disc to be freed 01647 */ 01648 void burn_disc_free(struct burn_disc *d); 01649 01650 /** Create a new session 01651 @return Pointer to a burn_session object or NULL on failure. 01652 */ 01653 struct burn_session *burn_session_create(void); 01654 01655 /** Free a session (and decrease reference count on all tracks inside) 01656 @param s Session to be freed 01657 */ 01658 void burn_session_free(struct burn_session *s); 01659 01660 /** Add a session to a disc at a specific position, increasing the 01661 sessions's reference count. 01662 @param d Disc to add the session to 01663 @param s Session to add to the disc 01664 @param pos position to add at (BURN_POS_END is "at the end") 01665 @return 0 for failure, 1 for success 01666 */ 01667 int burn_disc_add_session(struct burn_disc *d, struct burn_session *s, 01668 unsigned int pos); 01669 01670 /** Remove a session from a disc 01671 @param d Disc to remove session from 01672 @param s Session pointer to find and remove 01673 */ 01674 int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s); 01675 01676 01677 /** Create a track (for TAO recording, or to put in a session) */ 01678 struct burn_track *burn_track_create(void); 01679 01680 /** Free a track 01681 @param t Track to free 01682 */ 01683 void burn_track_free(struct burn_track *t); 01684 01685 /** Add a track to a session at specified position 01686 @param s Session to add to 01687 @param t Track to insert in session 01688 @param pos position to add at (BURN_POS_END is "at the end") 01689 @return 0 for failure, 1 for success 01690 */ 01691 int burn_session_add_track(struct burn_session *s, struct burn_track *t, 01692 unsigned int pos); 01693 01694 /** Remove a track from a session 01695 @param s Session to remove track from 01696 @param t Track pointer to find and remove 01697 @return 0 for failure, 1 for success 01698 */ 01699 int burn_session_remove_track(struct burn_session *s, struct burn_track *t); 01700 01701 01702 /** Define the data in a track 01703 @param t the track to define 01704 @param offset The lib will write this many 0s before start of data 01705 @param tail The number of extra 0s to write after data 01706 @param pad 1 means the lib should pad the last sector with 0s if the 01707 track isn't exactly sector sized. (otherwise the lib will 01708 begin reading from the next track) 01709 @param mode data format (bitfield) 01710 */ 01711 void burn_track_define_data(struct burn_track *t, int offset, int tail, 01712 int pad, int mode); 01713 01714 01715 /* ts A61024 */ 01716 /** Define whether a track shall swap bytes of its input stream. 01717 @param t The track to change 01718 @param swap_source_bytes 0=do not swap, 1=swap byte pairs 01719 @return 1=success , 0=unacceptable value 01720 @since 0.2.6 01721 */ 01722 int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes); 01723 01724 01725 /* ts A90910 */ 01726 /** Activates CD XA compatibility modes. 01727 libburn currently writes data only in CD mode 1. Some programs insist in 01728 sending data with additional management bytes. These bytes have to be 01729 stripped in order to make the input suitable for BURN_MODE1. 01730 @param t The track to manipulate 01731 @param value 0= no conversion 01732 1= strip 8 byte sector headers of CD-ROM XA mode 2 form 1 01733 see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data 01734 all other values are reserved 01735 @return 1=success , 0=unacceptable value 01736 @since 0.7.2 01737 */ 01738 int burn_track_set_cdxa_conv(struct burn_track *t, int value); 01739 01740 01741 /** Set the ISRC details for a track 01742 @param t The track to change 01743 @param country the 2 char country code. Each character must be 01744 only numbers or letters. 01745 @param owner 3 char owner code. Each character must be only numbers 01746 or letters. 01747 @param year 2 digit year. A number in 0-99 (Yep, not Y2K friendly). 01748 @param serial 5 digit serial number. A number in 0-99999. 01749 */ 01750 void burn_track_set_isrc(struct burn_track *t, char *country, char *owner, 01751 unsigned char year, unsigned int serial); 01752 01753 /** Disable ISRC parameters for a track 01754 @param t The track to change 01755 */ 01756 void burn_track_clear_isrc(struct burn_track *t); 01757 01758 /** Hide the first track in the "pre gap" of the disc 01759 @param s session to change 01760 @param onoff 1 to enable hiding, 0 to disable 01761 */ 01762 void burn_session_hide_first_track(struct burn_session *s, int onoff); 01763 01764 /** Get the drive's disc struct - free when done 01765 @param d drive to query 01766 @return the disc struct or NULL on failure 01767 */ 01768 struct burn_disc *burn_drive_get_disc(struct burn_drive *d); 01769 01770 /** Set the track's data source 01771 @param t The track to set the data source for 01772 @param s The data source to use for the contents of the track 01773 @return An error code stating if the source is ready for use for 01774 writing the track, or if an error occured 01775 01776 */ 01777 enum burn_source_status burn_track_set_source(struct burn_track *t, 01778 struct burn_source *s); 01779 01780 01781 /* ts A70218 */ 01782 /** Set a default track size to be used only if the track turns out to be of 01783 unpredictable length and if the effective write type demands a fixed size. 01784 This can be useful to enable write types CD SAO or DVD DAO together with 01785 a track source like stdin. If the track source delivers fewer bytes than 01786 announced then the track will be padded up with zeros. 01787 @param t The track to change 01788 @param size The size to set 01789 @return 0=failure 1=sucess 01790 @since 0.3.4 01791 */ 01792 int burn_track_set_default_size(struct burn_track *t, off_t size); 01793 01794 /** Free a burn_source (decrease its refcount and maybe free it) 01795 @param s Source to free 01796 */ 01797 void burn_source_free(struct burn_source *s); 01798 01799 /** Creates a data source for an image file (and maybe subcode file) 01800 @param path The file address for the main channel payload. 01801 @param subpath Eventual address for subchannel data. Only used in exotic 01802 raw write modes. Submit NULL for normal tasks. 01803 @return Pointer to a burn_source object, NULL indicates failure 01804 */ 01805 struct burn_source *burn_file_source_new(const char *path, 01806 const char *subpath); 01807 01808 01809 /* ts A91122 : An interface to open(O_DIRECT) or similar OS tricks. */ 01810 01811 /** Opens a file with eventual acceleration preparations which may depend 01812 on the operating system and on compile time options of libburn. 01813 You may use this call instead of open(2) for opening file descriptors 01814 which shall be handed to burn_fd_source_new(). 01815 This should only be done for tracks with BURN_BLOCK_MODE1 (2048 bytes 01816 per block). 01817 01818 If you use this call then you MUST allocate the buffers which you use 01819 with read(2) by call burn_os_alloc_buffer(). Read sizes MUST be a multiple 01820 of a safe buffer amount. Else you risk that track data get altered during 01821 transmission. 01822 burn_disk_write() will allocate a suitable read/write buffer for its own 01823 operations. A fifo created by burn_fifo_source_new() will allocate 01824 suitable memory for its buffer if called with flag bit0 and a multiple 01825 of a safe buffer amount. 01826 @param path The file address to open 01827 @param open_flags The flags as of man 2 open. Normally just O_RDONLY. 01828 @param flag Bitfield for control purposes (unused yet, submit 0). 01829 @return A file descriptor as of open(2). Finally to be disposed 01830 by close(2). 01831 -1 indicates failure. 01832 @since 0.7.4 01833 */ 01834 int burn_os_open_track_src(char *path, int open_flags, int flag); 01835 01836 /** Allocate a memory area that is suitable for reading with a file descriptor 01837 opened by burn_os_open_track_src(). 01838 @param amount Number of bytes to allocate. This should be a multiple 01839 of the operating system's i/o block size. 32 KB is 01840 guaranteed by libburn to be safe. 01841 @param flag Bitfield for control purposes (unused yet, submit 0). 01842 @return The address of the allocated memory, or NULL on failure. 01843 A non-NULL return value has finally to be disposed via 01844 burn_os_free_buffer(). 01845 @since 0.7.4 01846 */ 01847 void *burn_os_alloc_buffer(size_t amount, int flag); 01848 01849 /** Dispose a memory area which was obtained by burn_os_alloc_buffer(), 01850 @param buffer Memory address to be freed. 01851 @param amount The number of bytes which was allocated at that 01852 address. 01853 @param flag Bitfield for control purposes (unused yet, submit 0). 01854 @return 1 success , <=0 failure 01855 @since 0.7.4 01856 */ 01857 int burn_os_free_buffer(void *buffer, size_t amount, int flag); 01858 01859 01860 /** Creates a data source for an image file (a track) from an open 01861 readable filedescriptor, an eventually open readable subcodes file 01862 descriptor and eventually a fixed size in bytes. 01863 @param datafd The source of data. 01864 @param subfd The eventual source of subchannel data. Only used in exotic 01865 raw write modes. Submit -1 for normal tasks. 01866 @param size The eventual fixed size of eventually both fds. 01867 If this value is 0, the size will be determined from datafd. 01868 @return Pointer to a burn_source object, NULL indicates failure 01869 */ 01870 struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size); 01871 01872 01873 /* ts A70930 */ 01874 /** Creates a fifo which acts as proxy for an already existing data source. 01875 The fifo provides a ring buffer which shall smoothen the data stream 01876 between burn_source and writer thread. Each fifo serves only for one 01877 data source and gets attached to one track as its only data source 01878 by burn_track_set_source(). 01879 A fifo starts its life in "standby" mode with no buffer space allocated. 01880 As soon as its track requires bytes, the fifo establishes a worker thread 01881 and allocates its buffer. After input has ended and all buffer content is 01882 consumed, the buffer space gets freed and the worker thread ends. 01883 This happens asynchronously. So expect two buffers and worker threads to 01884 exist for a short time between tracks. Be modest in your size demands if 01885 multiple tracks are to be expected. 01886 @param inp The burn_source for which the fifo shall act as proxy. 01887 It can be disposed by burn_source_free() immediately 01888 after this call. 01889 @param chunksize The size in bytes of a chunk. 01890 Use 2048 for sources suitable for BURN_BLOCK_MODE1, 01891 2352 for sources which deliver for BURN_BLOCK_AUDIO, 01892 2056 for sources which shall get treated by 01893 burn_track_set_cdxa_conv(track, 1). 01894 Some variations of burn_source might work only with 01895 a particular chunksize. E.g. libisofs demands 2048. 01896 @param chunks The number of chunks to be allocated in ring buffer. 01897 This value must be >= 2. 01898 @param flag Bitfield for control purposes: 01899 bit0= The read method of inp is capable of delivering 01900 arbitrary amounts of data per call. Not only one 01901 sector. 01902 Suitable for inp from burn_file_source_new() 01903 and burn_fd_source_new() if not the fd has 01904 exotic limitations on read size. 01905 You MUST use this on inp which uses an fd opened 01906 with burn_os_open_track_src(). 01907 Better do not use with other inp types. 01908 @since 0.7.4 01909 @return A pointer to the newly created burn_source. 01910 Later both burn_sources, inp and the returned fifo, have 01911 to be disposed by calling burn_source_free() for each. 01912 inp can be freed immediately, the returned fifo may be 01913 kept as handle for burn_fifo_inquire_status(). 01914 @since 0.4.0 01915 */ 01916 struct burn_source *burn_fifo_source_new(struct burn_source *inp, 01917 int chunksize, int chunks, int flag); 01918 01919 /* ts A71003 */ 01920 /** Inquires state and fill parameters of a fifo burn_source which was created 01921 by burn_fifo_source_new() . Do not use with other burn_source variants. 01922 @param fifo The fifo object to inquire 01923 @param size The total size of the fifo 01924 @param free_bytes The current free capacity of the fifo 01925 @param status_text Returns a pointer to a constant text, see below 01926 @return <0 reply invalid, >=0 fifo status code: 01927 bit0+1=input status, bit2=consumption status, i.e: 01928 0="standby" : data processing not started yet 01929 1="active" : input and consumption are active 01930 2="ending" : input has ended without error 01931 3="failing" : input had error and ended, 01932 4="unused" : ( consumption has ended before processing start ) 01933 5="abandoned" : consumption has ended prematurely 01934 6="ended" : consumption has ended without input error 01935 7="aborted" : consumption has ended after input error 01936 @since 0.4.0 01937 */ 01938 int burn_fifo_inquire_status(struct burn_source *fifo, int *size, 01939 int *free_bytes, char **status_text); 01940 01941 /* ts A91125 */ 01942 /** Inquire various counters which reflect the fifo operation. 01943 @param fifo The fifo object to inquire 01944 @param total_min_fill The minimum number of bytes in the fifo. Beginning 01945 from the moment when fifo consumption is enabled. 01946 @param interval_min_fill The minimum byte number beginning from the moment 01947 when fifo consumption is enabled or from the 01948 most recent moment when burn_fifo_next_interval() 01949 was called. 01950 @param put_counter The number of data transactions into the fifo. 01951 @param get_counter The number of data transactions out of the fifo. 01952 @param empty_counter The number of times the fifo was empty. 01953 @param full_counter The number of times the fifo was full. 01954 @since 0.7.4 01955 */ 01956 void burn_fifo_get_statistics(struct burn_source *fifo, 01957 int *total_min_fill, int *interval_min_fill, 01958 int *put_counter, int *get_counter, 01959 int *empty_counter, int *full_counter); 01960 01961 /* ts A91125 */ 01962 /** Inquire the fifo minimum fill counter for intervals and reset that counter. 01963 @param fifo The fifo object to inquire 01964 @param interval_min_fill The minimum number of bytes in the fifo. Beginning 01965 from the moment when fifo consumption is enabled 01966 or from the most recent moment when 01967 burn_fifo_next_interval() was called. 01968 @since 0.7.4 01969 */ 01970 void burn_fifo_next_interval(struct burn_source *fifo, int *interval_min_fill); 01971 01972 /* ts A80713 */ 01973 /** Obtain a preview of the first input data of a fifo which was created 01974 by burn_fifo_source_new(). The data will later be delivered normally to 01975 the consumer track of the fifo. 01976 bufsize may not be larger than the fifo size (chunk_size * chunks) - 32k. 01977 This call will succeed only if data consumption by the track has not 01978 started yet, i.e. best before the call to burn_disc_write(). 01979 It will start the worker thread of the fifo with the expectable side 01980 effects on the external data source. Then it waits either until enough 01981 data have arrived or until it becomes clear that this will not happen. 01982 The call may be repeated with increased bufsize. It will always yield 01983 the bytes beginning from the first one in the fifo. 01984 @param fifo The fifo object to inquire resp. start 01985 @param buf Pointer to memory of at least bufsize bytes where to 01986 deliver the peeked data. 01987 @param bufsize Number of bytes to peek from the start of the fifo data 01988 @param flag Bitfield for control purposes (unused yet, submit 0). 01989 @return <0 on severe error, 0 if not enough data, 1 if bufsize bytes read 01990 @since 0.5.0 01991 */ 01992 int burn_fifo_peek_data(struct burn_source *fifo, char *buf, int bufsize, 01993 int flag); 01994 01995 /* ts A91125 */ 01996 /** Start the fifo worker thread and wait either until the requested number 01997 of bytes have arrived or until it becomes clear that this will not happen. 01998 Filling will go on asynchronously after burn_fifo_fill() returned. 01999 This call and burn_fifo_peek_data() do not disturb each other. 02000 @param fifo The fifo object to start 02001 @param fill Number of bytes desired. Expect to get return 1 if 02002 at least fifo size - 32k were read. 02003 @param flag Bitfield for control purposes. 02004 bit0= fill fifo to maximum size 02005 @return <0 on severe error, 0 if not enough data, 02006 1 if desired amount or fifo full 02007 @since 0.7.4 02008 */ 02009 int burn_fifo_fill(struct burn_source *fifo, int fill, int flag); 02010 02011 02012 /* ts A70328 */ 02013 /** Sets a fixed track size after the data source object has already been 02014 created. 02015 @param t The track to operate on 02016 @param size the number of bytes to use as track size 02017 @return <=0 indicates failure , >0 success 02018 @since 0.3.6 02019 */ 02020 int burn_track_set_size(struct burn_track *t, off_t size); 02021 02022 02023 /** Tells how long a track will be on disc 02024 >>> NOTE: Not reliable with tracks of undefined length 02025 */ 02026 int burn_track_get_sectors(struct burn_track *); 02027 02028 02029 /* ts A61101 */ 02030 /** Tells how many source bytes have been read and how many data bytes have 02031 been written by the track during burn. 02032 @param t The track to inquire 02033 @param read_bytes Number of bytes read from the track source 02034 @param written_bytes Number of bytes written to track 02035 @since 0.2.6 02036 */ 02037 int burn_track_get_counters(struct burn_track *t, 02038 off_t *read_bytes, off_t *written_bytes); 02039 02040 02041 /** Sets drive read and write speed 02042 Note: "k" is 1000, not 1024. 1xCD = 176.4 k/s, 1xDVD = 1385 k/s. 02043 Fractional speeds should be rounded up. Like 4xCD = 706. 02044 @param d The drive to set speed for 02045 @param read Read speed in k/s (0 is max, -1 is min). 02046 @param write Write speed in k/s (0 is max, -1 is min). 02047 */ 02048 void burn_drive_set_speed(struct burn_drive *d, int read, int write); 02049 02050 02051 /* ts A70711 */ 02052 /** Controls the behavior with writing when the drive buffer is suspected to 02053 be full. To check and wait for enough free buffer space before writing 02054 will move the task of waiting from the operating system's device driver 02055 to libburn. While writing is going on and waiting is enabled, any write 02056 operation will be checked whether it will fill the drive buffer up to 02057 more than max_percent. If so, then waiting will happen until the buffer 02058 fill is predicted with at most min_percent. 02059 Thus: if min_percent < max_percent then transfer rate will oscillate. 02060 This may allow the driver to operate on other devices, e.g. a disk from 02061 which to read the input for writing. On the other hand, this checking might 02062 reduce maximum throughput to the drive or even get misled by faulty buffer 02063 fill replies from the drive. 02064 If a setting parameter is < 0, then this setting will stay unchanged 02065 by the call. 02066 Known burner or media specific pitfalls: 02067 To have max_percent larger than the burner's best reported buffer fill has 02068 the same effect as min_percent==max_percent. Some burners do not report 02069 their full buffer with all media types. Some are not suitable because 02070 they report their buffer fill with delay. 02071 @param d The drive to control 02072 @param enable 0= disable , 1= enable waiting , (-1 = do not change setting) 02073 @param min_usec Shortest possible sleeping period (given in micro seconds) 02074 @param max_usec Longest possible sleeping period (given in micro seconds) 02075 @param timeout_sec If a single write has to wait longer than this number 02076 of seconds, then waiting gets disabled and mindless 02077 writing starts. A value of 0 disables this timeout. 02078 @param min_percent Minimum of desired buffer oscillation: 25 to 100 02079 @param max_percent Maximum of desired buffer oscillation: 25 to 100 02080 @return 1=success , 0=failure 02081 @since 0.3.8 02082 */ 02083 int burn_drive_set_buffer_waiting(struct burn_drive *d, int enable, 02084 int min_usec, int max_usec, int timeout_sec, 02085 int min_percent, int max_percent); 02086 02087 02088 /* these are for my debugging, they will disappear */ 02089 void burn_structure_print_disc(struct burn_disc *d); 02090 void burn_structure_print_session(struct burn_session *s); 02091 void burn_structure_print_track(struct burn_track *t); 02092 02093 /** Sets the write type for the write_opts struct. 02094 Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix 02095 of data and audio tracks. You must use BURN_WRITE_TAO for such sessions. 02096 @param opts The write opts to change 02097 @param write_type The write type to use 02098 @param block_type The block type to use 02099 @return Returns 1 on success and 0 on failure. 02100 */ 02101 int burn_write_opts_set_write_type(struct burn_write_opts *opts, 02102 enum burn_write_types write_type, 02103 int block_type); 02104 02105 02106 /* ts A70207 */ 02107 /** As an alternative to burn_write_opts_set_write_type() this function tries 02108 to find a suitable write type and block type for a given write job 02109 described by opts and disc. To be used after all other setups have been 02110 made, i.e. immediately before burn_disc_write(). 02111 @param opts The nearly complete write opts to change 02112 @param disc The already composed session and track model 02113 @param reasons This text string collects reasons for decision resp. failure 02114 @param flag Bitfield for control purposes: 02115 bit0= do not choose type but check the one that is already set 02116 bit1= do not issue error messages via burn_msgs queue 02117 (is automatically set with bit0) 02118 @return Chosen write type. BURN_WRITE_NONE on failure. 02119 @since 0.3.2 02120 */ 02121 enum burn_write_types burn_write_opts_auto_write_type( 02122 struct burn_write_opts *opts, struct burn_disc *disc, 02123 char reasons[BURN_REASONS_LEN], int flag); 02124 02125 02126 /** Supplies toc entries for writing - not normally required for cd mastering 02127 @param opts The write opts to change 02128 @param count The number of entries 02129 @param toc_entries 02130 */ 02131 void burn_write_opts_set_toc_entries(struct burn_write_opts *opts, 02132 int count, 02133 struct burn_toc_entry *toc_entries); 02134 02135 /** Sets the session format for a disc 02136 @param opts The write opts to change 02137 @param format The session format to set 02138 */ 02139 void burn_write_opts_set_format(struct burn_write_opts *opts, int format); 02140 02141 /** Sets the simulate value for the write_opts struct . 02142 This corresponds to the Test Write bit in MMC mode page 05h. Several media 02143 types do not support this. See struct burn_multi_caps.might_simulate for 02144 actual availability of this feature. 02145 If the media is suitable, the drive will perform burn_write_disc() as a 02146 simulation instead of effective write operations. This means that the 02147 media content and burn_disc_get_status() stay unchanged. 02148 Note: With stdio-drives, the target file gets eventually created, opened, 02149 lseeked, and closed, but not written. So there are effects on it. 02150 Warning: Call burn_random_access_write() will never do simulation because 02151 it does not get any burn_write_opts. 02152 @param opts The write opts to change 02153 @param sim Non-zero enables simulation, 0 enables real writing 02154 @return Returns 1 on success and 0 on failure. 02155 */ 02156 int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim); 02157 02158 /** Controls buffer underrun prevention 02159 @param opts The write opts to change 02160 @param underrun_proof if non-zero, buffer underrun protection is enabled 02161 @return Returns 1 on success and 0 on failure. 02162 */ 02163 int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts, 02164 int underrun_proof); 02165 02166 /** Sets whether to use opc or not with the write_opts struct 02167 @param opts The write opts to change 02168 @param opc If non-zero, optical power calibration will be performed at 02169 start of burn 02170 02171 */ 02172 void burn_write_opts_set_perform_opc(struct burn_write_opts *opts, int opc); 02173 02174 void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts, int has_mediacatalog); 02175 02176 void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts, unsigned char mediacatalog[13]); 02177 02178 02179 /* ts A61106 */ 02180 /** Sets the multi flag which eventually marks the emerging session as not 02181 being the last one and thus creating a BURN_DISC_APPENDABLE media. 02182 @param opts The option object to be manipulated 02183 @param multi 1=media will be appendable, 0=media will be closed (default) 02184 @since 0.2.6 02185 */ 02186 void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi); 02187 02188 02189 /* ts A61222 */ 02190 /** Sets a start address for writing to media and write modes which allow to 02191 choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW). 02192 now). The address is given in bytes. If it is not -1 then a write run 02193 will fail if choice of start address is not supported or if the block 02194 alignment of the address is not suitable for media and write mode. 02195 Alignment to 32 kB blocks is supposed to be safe with DVD media. 02196 Call burn_disc_get_multi_caps() can obtain the necessary media info. See 02197 resulting struct burn_multi_caps elements .start_adr , .start_alignment , 02198 .start_range_low , .start_range_high . 02199 @param opts The write opts to change 02200 @param value The address in bytes (-1 = start at default address) 02201 @since 0.3.0 02202 */ 02203 void burn_write_opts_set_start_byte(struct burn_write_opts *opts, off_t value); 02204 02205 02206 /* ts A70213 */ 02207 /** Caution: still immature and likely to change. Problems arose with 02208 sequential DVD-RW on one drive. 02209 02210 Controls whether the whole available space of the media shall be filled up 02211 by the last track of the last session. 02212 @param opts The write opts to change 02213 @param fill_up_media If 1 : fill up by last track, if 0 = do not fill up 02214 @since 0.3.4 02215 */ 02216 void burn_write_opts_set_fillup(struct burn_write_opts *opts, 02217 int fill_up_media); 02218 02219 02220 /* ts A70303 */ 02221 /** Eventually makes libburn ignore the failure of some conformance checks: 02222 - the check whether CD write+block type is supported by the drive 02223 - the check whether the media profile supports simulated burning 02224 @param opts The write opts to change 02225 @param use_force 1=ignore above checks, 0=refuse work on failed check 02226 @since 0.3.4 02227 */ 02228 void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force); 02229 02230 02231 /* ts A80412 */ 02232 /** Eventually makes use of the more modern write command AAh WRITE12 and 02233 sets the Streaming bit. With DVD-RAM and BD this can override the 02234 traditional slowdown to half nominal speed. But if it speeds up writing 02235 then it also disables error management and correction. Weigh your 02236 priorities. This affects the write operations of burn_disc_write() 02237 and subsequent calls of burn_random_access_write(). 02238 @param opts The write opts to change 02239 @param value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit 02240 @since 0.6.4: 02241 >=16 use WRITE12 but not before the LBA given by value 02242 @since 0.4.6 02243 */ 02244 void burn_write_opts_set_stream_recording(struct burn_write_opts *opts, 02245 int value); 02246 02247 /* ts A91115 */ 02248 /** Overrides the write chunk size for DVD and BD media which is normally 02249 determined according to media type and setting of stream recording. 02250 A chunk size of 64 KB may improve throughput with bus systems which show 02251 latency problems. 02252 @param opts The write opts to change 02253 @param obs Number of bytes which shall be sent by a single write command. 02254 0 means automatic size, 32768 and 65336 are the only other 02255 accepted sizes for now. 02256 @since 0.7.4 02257 */ 02258 void burn_write_opts_set_dvd_obs(struct burn_write_opts *opts, int obs); 02259 02260 /* ts A91115 */ 02261 /** Sets the rythm by which stdio pseudo drives force their output data to 02262 be consumed by the receiving storage device. This forcing keeps the memory 02263 from being clogged with lots of pending data for slow devices. 02264 @param opts The write opts to change 02265 @param rythm Number of 2KB output blocks after which fsync(2) is 02266 performed. -1 means no fsync(), 0 means default, 02267 elsewise the value must be >= 32. 02268 Default is currently 8192 = 16 MB. 02269 @since 0.7.4 02270 */ 02271 void burn_write_opts_set_stdio_fsync(struct burn_write_opts *opts, int rythm); 02272 02273 02274 /** Sets whether to read in raw mode or not 02275 @param opts The read opts to change 02276 @param raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the 02277 disc is read, including headers. 02278 */ 02279 void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw_mode); 02280 02281 /** Sets whether to report c2 errors or not 02282 @param opts The read opts to change 02283 @param c2errors If non-zero, report c2 errors. 02284 */ 02285 void burn_read_opts_set_c2errors(struct burn_read_opts *opts, int c2errors); 02286 02287 /** Sets whether to read subcodes from audio tracks or not 02288 @param opts The read opts to change 02289 @param subcodes_audio If non-zero, read subcodes from audio tracks on the disc. 02290 */ 02291 void burn_read_opts_read_subcodes_audio(struct burn_read_opts *opts, 02292 int subcodes_audio); 02293 02294 /** Sets whether to read subcodes from data tracks or not 02295 @param opts The read opts to change 02296 @param subcodes_data If non-zero, read subcodes from data tracks on the disc. 02297 */ 02298 void burn_read_opts_read_subcodes_data(struct burn_read_opts *opts, 02299 int subcodes_data); 02300 02301 /** Sets whether to recover errors if possible 02302 @param opts The read opts to change 02303 @param hardware_error_recovery If non-zero, attempt to recover errors if possible. 02304 */ 02305 void burn_read_opts_set_hardware_error_recovery(struct burn_read_opts *opts, 02306 int hardware_error_recovery); 02307 02308 /** Sets whether to report recovered errors or not 02309 @param opts The read opts to change 02310 @param report_recovered_errors If non-zero, recovered errors will be reported. 02311 */ 02312 void burn_read_opts_report_recovered_errors(struct burn_read_opts *opts, 02313 int report_recovered_errors); 02314 02315 /** Sets whether blocks with unrecoverable errors should be read or not 02316 @param opts The read opts to change 02317 @param transfer_damaged_blocks If non-zero, blocks with unrecoverable errors will still be read. 02318 */ 02319 void burn_read_opts_transfer_damaged_blocks(struct burn_read_opts *opts, 02320 int transfer_damaged_blocks); 02321 02322 /** Sets the number of retries to attempt when trying to correct an error 02323 @param opts The read opts to change 02324 @param hardware_error_retries The number of retries to attempt when correcting an error. 02325 */ 02326 void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts, 02327 unsigned char hardware_error_retries); 02328 02329 02330 /* ts A90815 */ 02331 /** Gets the list of profile codes supported by the drive. 02332 Profiles depict the feature sets which constitute media types. For 02333 known profile codes and names see burn_disc_get_profile(). 02334 @param d is the drive to query 02335 @param num_profiles returns the number of supported profiles 02336 @param profiles returns the profile codes 02337 @param is_current returns the status of the corresponding profile code: 02338 1= current, i.e. the matching media is loaded 02339 0= not current, i.e. the matching media is not loaded 02340 @return always 1 for now 02341 @since 0.7.0 02342 */ 02343 int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles, 02344 int profiles[64], char is_current[64]); 02345 02346 02347 /* ts A90815 */ 02348 /** Obtains the profile name associated with a profile code. 02349 @param profile_code the profile code to be translated 02350 @param name returns the profile name (e.g. "DVD+RW") 02351 @return 1= known profile code , 0= unknown profile code 02352 @since 0.7.0 02353 */ 02354 int burn_obtain_profile_name(int profile_code, char name[80]); 02355 02356 02357 /** Gets the maximum write speed for a drive and eventually loaded media. 02358 The return value might change by the media type of already loaded media, 02359 again by call burn_drive_grab() and again by call burn_disc_read_atip(). 02360 @param d Drive to query 02361 @return Maximum write speed in K/s 02362 */ 02363 int burn_drive_get_write_speed(struct burn_drive *d); 02364 02365 02366 /* ts A61021 */ 02367 /** Gets the minimum write speed for a drive and eventually loaded media. 02368 The return value might change by the media type of already loaded media, 02369 again by call burn_drive_grab() and again by call burn_disc_read_atip(). 02370 @param d Drive to query 02371 @return Minimum write speed in K/s 02372 @since 0.2.6 02373 */ 02374 int burn_drive_get_min_write_speed(struct burn_drive *d); 02375 02376 02377 /** Gets the maximum read speed for a drive 02378 @param d Drive to query 02379 @return Maximum read speed in K/s 02380 */ 02381 int burn_drive_get_read_speed(struct burn_drive *d); 02382 02383 02384 /* ts A61226 */ 02385 /** Obtain a copy of the current speed descriptor list. The drive's list gets 02386 updated on various occasions such as burn_drive_grab() but the copy 02387 obtained here stays untouched. It has to be disposed via 02388 burn_drive_free_speedlist() when it is not longer needed. Speeds 02389 may appear several times in the list. The list content depends much on 02390 drive and media type. It seems that .source == 1 applies mostly to CD media 02391 whereas .source == 2 applies to any media. 02392 @param d Drive to query 02393 @param speed_list The copy. If empty, *speed_list gets returned as NULL. 02394 @return 1=success , 0=list empty , <0 severe error 02395 @since 0.3.0 02396 */ 02397 int burn_drive_get_speedlist(struct burn_drive *d, 02398 struct burn_speed_descriptor **speed_list); 02399 02400 /* ts A70713 */ 02401 /** Look up the fastest speed descriptor which is not faster than the given 02402 speed_goal. If it is 0, then the fastest one is chosen among the 02403 descriptors with the highest end_lba. If it is -1 then the slowest speed 02404 descriptor is chosen regardless of end_lba. Parameter flag decides whether 02405 the speed goal means write speed or read speed. 02406 @param d Drive to query 02407 @param speed_goal Upper limit for speed, 02408 0=search for maximum speed , -1 search for minimum speed 02409 @param best_descr Result of the search, NULL if no match 02410 @param flag Bitfield for control purposes 02411 bit0= look for best read speed rather than write speed 02412 bit1= look for any source type (else look for source==2 first 02413 and for any other source type only with CD media) 02414 @return >0 indicates a valid best_descr, 0 = no valid best_descr 02415 @since 0.3.8 02416 */ 02417 int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal, 02418 struct burn_speed_descriptor **best_descr, int flag); 02419 02420 02421 /* ts A61226 */ 02422 /** Dispose a speed descriptor list copy which was obtained by 02423 burn_drive_get_speedlist(). 02424 @param speed_list The list copy. *speed_list gets set to NULL. 02425 @return 1=list disposed , 0= *speedlist was already NULL 02426 @since 0.3.0 02427 */ 02428 int burn_drive_free_speedlist(struct burn_speed_descriptor **speed_list); 02429 02430 02431 /* ts A70203 */ 02432 /* @since 0.3.2 */ 02433 /** The reply structure for burn_disc_get_multi_caps() 02434 */ 02435 struct burn_multi_caps { 02436 02437 /* Multi-session capability allows to keep the media appendable after 02438 writing a session. It also guarantees that the drive will be able 02439 to predict and use the appropriate Next Writeable Address to place 02440 the next session on the media without overwriting the existing ones. 02441 It does not guarantee that the selected write type is able to do 02442 an appending session after the next session. (E.g. CD SAO is capable 02443 of multi-session by keeping a disc appendable. But .might_do_sao 02444 will be 0 afterwards, when checking the appendable media.) 02445 1= media may be kept appendable by burn_write_opts_set_multi(o,1) 02446 0= media will not be appendable 02447 */ 02448 int multi_session; 02449 02450 /* Multi-track capability allows to write more than one track source 02451 during a single session. The written tracks can later be found in 02452 libburn's TOC model with their start addresses and sizes. 02453 1= multiple tracks per session are allowed 02454 0= only one track per session allowed 02455 */ 02456 int multi_track; 02457 02458 /* Start-address capability allows to set a non-zero address with 02459 burn_write_opts_set_start_byte(). Eventually this has to respect 02460 .start_alignment and .start_range_low, .start_range_high in this 02461 structure. 02462 1= non-zero start address is allowed 02463 0= only start address 0 is allowed (to depict the drive's own idea 02464 about the appropriate write start) 02465 */ 02466 int start_adr; 02467 02468 /** The alignment for start addresses. 02469 ( start_address % start_alignment ) must be 0. 02470 */ 02471 off_t start_alignment; 02472 02473 /** The lowest permissible start address. 02474 */ 02475 off_t start_range_low; 02476 02477 /** The highest addressable start address. 02478 */ 02479 off_t start_range_high; 02480 02481 /** Potential availability of write modes 02482 4= needs no size prediction, not to be chosen automatically 02483 3= needs size prediction, not to be chosen automatically 02484 2= available, no size prediction necessary 02485 1= available, needs exact size prediction 02486 0= not available 02487 With CD media (profiles 0x09 and 0x0a) check also the elements 02488 *_block_types of the according write mode. 02489 */ 02490 int might_do_tao; 02491 int might_do_sao; 02492 int might_do_raw; 02493 02494 /** Generally advised write mode. 02495 Not necessarily the one chosen by burn_write_opts_auto_write_type() 02496 because the burn_disc structure might impose particular demands. 02497 */ 02498 enum burn_write_types advised_write_mode; 02499 02500 /** Write mode as given by parameter wt of burn_disc_get_multi_caps(). 02501 */ 02502 enum burn_write_types selected_write_mode; 02503 02504 /** Profile number which was current when the reply was generated */ 02505 int current_profile; 02506 02507 /** Wether the current profile indicates CD media. 1=yes, 0=no */ 02508 int current_is_cd_profile; 02509 02510 /* ts A70528 */ 02511 /* @since 0.3.8 */ 02512 /** Wether the current profile is able to perform simulated write */ 02513 int might_simulate; 02514 }; 02515 02516 /** Allocates a struct burn_multi_caps (see above) and fills it with values 02517 which are appropriate for the drive and the loaded media. The drive 02518 must be grabbed for this call. The returned structure has to be disposed 02519 via burn_disc_free_multi_caps() when no longer needed. 02520 @param d The drive to inquire 02521 @param wt With BURN_WRITE_NONE the best capabilities of all write modes 02522 get returned. If set to a write mode like BURN_WRITE_SAO the 02523 capabilities with that particular mode are returned and the 02524 return value is 0 if the desired mode is not possible. 02525 @param caps returns the info structure 02526 @param flag Bitfield for control purposes (unused yet, submit 0) 02527 @return < 0 : error , 0 : writing seems impossible , 1 : writing possible 02528 @since 0.3.2 02529 */ 02530 int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt, 02531 struct burn_multi_caps **caps, int flag); 02532 02533 /** Removes from memory a multi session info structure which was returned by 02534 burn_disc_get_multi_caps(). The pointer *caps gets set to NULL. 02535 @param caps the info structure to dispose (note: pointer to pointer) 02536 @return 0 : *caps was already NULL, 1 : memory object was disposed 02537 @since 0.3.2 02538 */ 02539 int burn_disc_free_multi_caps(struct burn_multi_caps **caps); 02540 02541 02542 /** Gets a copy of the toc_entry structure associated with a track 02543 @param t Track to get the entry from 02544 @param entry Struct for the library to fill out 02545 */ 02546 void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry); 02547 02548 /** Gets a copy of the toc_entry structure associated with a session's lead out 02549 @param s Session to get the entry from 02550 @param entry Struct for the library to fill out 02551 */ 02552 void burn_session_get_leadout_entry(struct burn_session *s, 02553 struct burn_toc_entry *entry); 02554 02555 /** Gets an array of all the sessions for the disc 02556 THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION 02557 @param d Disc to get session array for 02558 @param num Returns the number of sessions in the array 02559 @return array of sessions 02560 */ 02561 struct burn_session **burn_disc_get_sessions(struct burn_disc *d, 02562 int *num); 02563 02564 int burn_disc_get_sectors(struct burn_disc *d); 02565 02566 /** Gets an array of all the tracks for a session 02567 THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK 02568 @param s session to get track array for 02569 @param num Returns the number of tracks in the array 02570 @return array of tracks 02571 */ 02572 struct burn_track **burn_session_get_tracks(struct burn_session *s, 02573 int *num); 02574 02575 int burn_session_get_sectors(struct burn_session *s); 02576 02577 /** Gets the mode of a track 02578 @param track the track to query 02579 @return the track's mode 02580 */ 02581 int burn_track_get_mode(struct burn_track *track); 02582 02583 /** Returns whether the first track of a session is hidden in the pregap 02584 @param session the session to query 02585 @return non-zero means the first track is hidden 02586 */ 02587 int burn_session_get_hidefirst(struct burn_session *session); 02588 02589 /** Returns the library's version in its parts. 02590 This is the runtime counterpart of the three build time macros 02591 burn_header_version_* below. 02592 @param major The major version number 02593 @param minor The minor version number 02594 @param micro The micro version number 02595 */ 02596 void burn_version(int *major, int *minor, int *micro); 02597 02598 02599 /* ts A80129 */ 02600 /* @since 0.4.4 */ 02601 /** These three release version numbers tell the revision of this header file 02602 and of the API it describes. They are memorized by applications at build 02603 time. 02604 Immediately after burn_initialize() an application should do this check: 02605 burn_version(&major, &minor, µ); 02606 if(major > burn_header_version_major 02607 || (major == burn_header_version_major 02608 && (minor > burn_header_version_minor 02609 || (minor == burn_header_version_minor 02610 && micro >= burn_header_version_micro)))) { 02611 ... Young enough. Go on with program run .... 02612 } else { 02613 ... Too old. Do not use this libburn version ... 02614 } 02615 02616 */ 02617 #define burn_header_version_major 0 02618 #define burn_header_version_minor 7 02619 #define burn_header_version_micro 6 02620 /** Note: 02621 Above version numbers are also recorded in configure.ac because libtool 02622 wants them as parameters at build time. 02623 For the library compatibility check BURN_*_VERSION in configure.ac 02624 are not decisive. Only the three numbers above do matter. 02625 */ 02626 /** Usage discussion: 02627 02628 Some developers of the libburnia project have differing 02629 opinions how to ensure the compatibility of libaries 02630 and applications. 02631 02632 It is about whether to use at compile time and at runtime 02633 the version numbers isoburn_header_version_* provided here. 02634 Thomas Schmitt advises to use them. 02635 Vreixo Formoso advises to use other means. 02636 02637 At compile time: 02638 02639 Vreixo Formoso advises to leave proper version matching 02640 to properly programmed checks in the the application's 02641 build system, which will eventually refuse compilation. 02642 02643 Thomas Schmitt advises to use the macros defined here 02644 for comparison with the application's requirements of 02645 library revisions and to eventually break compilation. 02646 02647 Both advises are combinable. I.e. be master of your 02648 build system and have #if checks in the source code 02649 of your application, nevertheless. 02650 02651 At runtime (via *_is_compatible()): 02652 02653 Vreixo Formoso advises to compare the application's 02654 requirements of library revisions with the runtime 02655 library. This is to allow runtime libraries which are 02656 young enough for the application but too old for 02657 the lib*.h files seen at compile time. 02658 02659 Thomas Schmitt advises to compare the header 02660 revisions defined here with the runtime library. 02661 This is to enforce a strictly monotonous chain 02662 of revisions from app to header to library, 02663 at the cost of excluding some older libraries. 02664 02665 These two advises are mutually exclusive. 02666 02667 */ 02668 02669 /* ts A91226 */ 02670 /** Obtain the id string of the SCSI transport interface. 02671 This interface may be a system specific adapter module of libburn or 02672 an adapter to a supporting library like libcdio. 02673 @flag Bitfield for control puposes, submit 0 for now 02674 @return A pointer to the id string. Do not alter the string content. 02675 @since 0.7.6 02676 */ 02677 char *burn_scsi_transport_id(int flag); 02678 02679 /* ts A60924 : ticket 74 */ 02680 /** Control queueing and stderr printing of messages from libburn. 02681 Severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY", 02682 "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL". 02683 @param queue_severity Gives the minimum limit for messages to be queued. 02684 Default: "NEVER". If you queue messages then you 02685 must consume them by burn_msgs_obtain(). 02686 @param print_severity Does the same for messages to be printed directly 02687 to stderr. Default: "FATAL". 02688 @param print_id A text prefix to be printed before the message. 02689 @return >0 for success, <=0 for error 02690 @since 0.2.6 02691 */ 02692 int burn_msgs_set_severities(char *queue_severity, 02693 char *print_severity, char *print_id); 02694 02695 /* ts A60924 : ticket 74 */ 02696 /* @since 0.2.6 */ 02697 #define BURN_MSGS_MESSAGE_LEN 4096 02698 02699 /** Obtain the oldest pending libburn message from the queue which has at 02700 least the given minimum_severity. This message and any older message of 02701 lower severity will get discarded from the queue and is then lost forever. 02702 @param minimum_severity may be one of "NEVER", "ABORT", "FATAL", 02703 "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", 02704 "DEBUG", "ALL". 02705 To call with minimum_severity "NEVER" will discard the 02706 whole queue. 02707 @param error_code Will become a unique error code as liste in 02708 libburn/libdax_msgs.h 02709 @param msg_text Must provide at least BURN_MSGS_MESSAGE_LEN bytes. 02710 @param os_errno Will become the eventual errno related to the message 02711 @param severity Will become the severity related to the message and 02712 should provide at least 80 bytes. 02713 @return 1 if a matching item was found, 0 if not, <0 for severe errors 02714 @since 0.2.6 02715 */ 02716 int burn_msgs_obtain(char *minimum_severity, 02717 int *error_code, char msg_text[], int *os_errno, 02718 char severity[]); 02719 02720 02721 /* ts A70922 */ 02722 /** Submit a message to the libburn queueing system. It will be queued or 02723 printed as if it was generated by libburn itself. 02724 @param error_code The unique error code of your message. 02725 Submit 0 if you do not have reserved error codes within 02726 the libburnia project. 02727 @param msg_text Not more than BURN_MSGS_MESSAGE_LEN characters of 02728 message text. 02729 @param os_errno Eventual errno related to the message. Submit 0 if 02730 the message is not related to a operating system error. 02731 @param severity One of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", 02732 "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL". 02733 @param d An eventual drive to which the message shall be related. 02734 Submit NULL if the message is not specific to a 02735 particular drive object. 02736 @return 1 if message was delivered, <=0 if failure 02737 @since 0.4.0 02738 */ 02739 int burn_msgs_submit(int error_code, char msg_text[], int os_errno, 02740 char severity[], struct burn_drive *d); 02741 02742 02743 /* ts A71016 */ 02744 /** Convert a severity name into a severity number, which gives the severity 02745 rank of the name. 02746 @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY". 02747 @param severity_number The rank number: the higher, the more severe. 02748 @param flag Bitfield for control purposes (unused yet, submit 0) 02749 @return >0 success, <=0 failure 02750 @since 0.4.0 02751 */ 02752 int burn_text_to_sev(char *severity_name, int *severity_number, int flag); 02753 02754 02755 /* ts A80202 */ 02756 /** Convert a severity number into a severity name 02757 @since 0.4.4 02758 @param severity_number The rank number: the higher, the more severe. 02759 @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY". 02760 @param flag Bitfield for control purposes (unused yet, submit 0) 02761 @since 0.4.4 02762 */ 02763 int burn_sev_to_text(int severity_number, char **severity_name, int flag); 02764 02765 02766 02767 /* ts A70915 */ 02768 /** Replace the messenger object handle of libburn by a compatible handle 02769 obtained from a related library. 02770 See also: libisofs, API function iso_get_messenger(). 02771 @param messenger The foreign but compatible message handle. 02772 @return 1 : success, <=0 : failure 02773 @since 0.4.0 02774 */ 02775 int burn_set_messenger(void *messenger); 02776 02777 02778 /* ts A61002 */ 02779 /* @since 0.2.6 */ 02780 /** The prototype of a handler function suitable for burn_set_abort_handling(). 02781 Such a function has to return -2 if it does not want the process to 02782 exit with value 1. 02783 */ 02784 typedef int (*burn_abort_handler_t)(void *handle, int signum, int flag); 02785 02786 /** Control builtin signal handling. See also burn_abort(). 02787 @param handle Opaque handle eventually pointing to an application 02788 provided memory object 02789 @param handler A function to be called on signals. It will get handle as 02790 argument. It should finally call burn_abort(). See there. 02791 @param mode : 0 call handler(handle, signum, 0) on nearly all signals 02792 1 enable system default reaction on all signals 02793 2 try to ignore nearly all signals 02794 10 like mode 2 but handle SIGABRT like with mode 0 02795 Arguments (text, NULL, 0) activate the builtin abort handler. It will 02796 eventually call burn_abort() and then perform exit(1). If text is not NULL 02797 then it is used as prefix for pacifier messages of burn_abort_pacifier(). 02798 @since 0.2.6 02799 */ 02800 void burn_set_signal_handling(void *handle, burn_abort_handler_t handler, 02801 int mode); 02802 02803 02804 /* ts A70811 */ 02805 /** Write data in random access mode. 02806 The drive must be grabbed successfully before calling this function which 02807 circumvents usual libburn session processing and rather writes data without 02808 preparations or finalizing. This will work only with overwriteable media 02809 which are also suitable for burn_write_opts_set_start_byte(). The same 02810 address alignment restrictions as with this function apply. I.e. for DVD 02811 it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data 02812 to be written is subject to the same media dependent alignment rules. 02813 Again, 32 KiB is most safe. 02814 Call burn_disc_get_multi_caps() can obtain the necessary media info. See 02815 resulting struct burn_multi_caps elements .start_adr , .start_alignment , 02816 .start_range_low , .start_range_high . 02817 Other than burn_disc_write() this is a synchronous call which returns 02818 only after the write transaction has ended (sucessfully or not). So it is 02819 wise not to transfer giant amounts of data in a single call. 02820 Important: Data have to fit into the already formatted area of the media. 02821 @param d The drive to which to write 02822 @param byte_address The start address of the write in byte 02823 (1 LBA unit = 2048 bytes) (do respect media alignment) 02824 @param data The bytes to be written 02825 @param data_count The number of those bytes (do respect media alignment) 02826 data_count == 0 is permitted (e.g. to flush the 02827 drive buffer without further data transfer). 02828 @param flag Bitfield for control purposes: 02829 bit0 = flush the drive buffer after eventual writing 02830 @return 1=sucessful , <=0 : number of transfered bytes * -1 02831 @since 0.4.0 02832 */ 02833 int burn_random_access_write(struct burn_drive *d, off_t byte_address, 02834 char *data, off_t data_count, int flag); 02835 02836 02837 /* ts A81215 */ 02838 /** Inquire the maximum amount of readable data. 02839 It is supposed that all LBAs in the range from 0 to media_read_acpacity-1 02840 can be read via burn_read_data() although some of them may never have been 02841 recorded. If tracks are recognizable then it is better to only read 02842 LBAs which are part of some track. 02843 @param d The drive from which to read 02844 @param capacity Will return the result if valid 02845 @param flag Bitfield for control purposes: Unused yet, submit 0. 02846 @return 1=sucessful , <=0 an error occured 02847 @since 0.6.0 02848 */ 02849 int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag); 02850 02851 02852 /* ts A70812 */ 02853 /** Read data in random access mode. 02854 The drive must be grabbed successfully before calling this function. 02855 With all currently supported drives and media the byte_address has to 02856 be aligned to 2048 bytes. Only data tracks with 2048 bytes per sector 02857 can be read this way. I.e. not CD-audio, not CD-video-stream ... 02858 This is a synchronous call which returns only after the full read job 02859 has ended (sucessfully or not). So it is wise not to read giant amounts 02860 of data in a single call. 02861 @param d The drive from which to read 02862 @param byte_address The start address of the read in byte (aligned to 2048) 02863 @param data A memory buffer capable of taking data_size bytes 02864 @param data_size The amount of data to be read. This does not have to 02865 be aligned to any block size. 02866 @param data_count The amount of data actually read (interesting on error) 02867 @param flag Bitfield for control purposes: 02868 bit0= - reserved - 02869 bit1= do not submit error message if read error 02870 bit2= on error do not try to read a second time 02871 with single block steps. @since 0.5.2 02872 @return 1=sucessful , <=0 an error occured 02873 @since 0.4.0 02874 */ 02875 int burn_read_data(struct burn_drive *d, off_t byte_address, 02876 char data[], off_t data_size, off_t *data_count, int flag); 02877 02878 02879 /* A70904 */ 02880 /** Inquire whether the drive object is a real MMC drive or a pseudo-drive 02881 created by a stdio: address. 02882 @param d The drive to inquire 02883 @return 0= null-drive 02884 1= real MMC drive 02885 2= stdio-drive, random access, read-write 02886 3= stdio-drive, sequential, write-only 02887 @since 0.4.0 02888 */ 02889 int burn_drive_get_drive_role(struct burn_drive *d); 02890 02891 02892 /* ts A70923 */ 02893 /** Find out whether a given address string would lead to the given drive 02894 object. This should be done in advance for track source addresses 02895 with parameter drive_role set to 2. 02896 Although a real MMC drive should hardly exist as two drive objects at 02897 the same time, this can easily happen with stdio-drives. So if more than 02898 one drive is used by the application, then this gesture is advised: 02899 burn_drive_d_get_adr(d2, adr2); 02900 if (burn_drive_equals_adr(d1, adr2, burn_drive_get_drive_role(d2))) 02901 ... Both drive objects point to the same storage facility ... 02902 02903 @param d1 Existing drive object 02904 @param adr2 Address string to be tested. Prefix "stdio:" overrides 02905 parameter drive_role2 by either 0 or 2 as appropriate. 02906 The string must be shorter than BURN_DRIVE_ADR_LEN. 02907 @param drive_role2 Role as burn_drive_get_drive_role() would attribute 02908 to adr2 if it was a drive. Use value 2 for checking track 02909 sources resp. pseudo-drive addresses without "stdio:". 02910 Use 1 for checking drive addresses including those with 02911 prefix "stdio:". 02912 @return 1= adr2 leads to d1 , 0= adr2 seems not to lead to d1, 02913 -1 = adr2 is bad 02914 @since 0.4.0 02915 */ 02916 int burn_drive_equals_adr(struct burn_drive *d1, char *adr2, int drive_role2); 02917 02918 02919 #ifndef DOXYGEN 02920 02921 BURN_END_DECLS 02922 02923 #endif 02924 02925 02926 /* ts A91205 */ 02927 /* The following experiments may be interesting in future: 02928 */ 02929 02930 /* Perform OPC explicitely. 02931 # define Libburn_pioneer_dvr_216d_with_opC 1 02932 */ 02933 02934 /* Load mode page 5 and modify it rather than composing from scratch. 02935 # define Libburn_pioneer_dvr_216d_load_mode5 1 02936 */ 02937 02938 /* Inquire drive events and react by reading configuration or starting unit. 02939 # define Libburn_pioneer_dvr_216d_get_evenT 1 02940 */ 02941 02942 /* ts A91112 */ 02943 /* Do not probe CD modes but declare only data and audio modes supported. 02944 For other modes resp. real probing one has to call 02945 burn_drive_probe_cd_write_modes(). 02946 02947 */ 02948 #define Libburn_dummy_probe_write_modeS 1 02949 02950 02951 02952 #endif /*LIBBURN_H*/