10 #include "../config.h"
31 #include <sys/types.h>
68 #ifdef Libburn_mmap_write_buffeR
76 #define Libburn_cd_obS (32 * 1024)
80 #define Libburn_dvd_obS (32 * 1024)
84 #define Libburn_bd_re_obS (64 * 1024)
88 #define Libburn_bd_r_obS (64 * 1024)
92 #define Libburn_bd_streamed_obS (64 * 1024)
96 #define Libburn_stdio_write_retrieS 16
215 int todo, step, cancelled, seclen;
223 sprintf(msg,
"Padding up track to minimum size (+ %d sectors)",
234 for (; todo > 0; todo -= step) {
260 #ifdef Libburn_experimental_no_close_tracK
268 sprintf(msg,
"Closing track %2.2d", tnum+1);
291 #ifdef Libburn_experimental_no_close_sessioN
297 "Closing session", 0, 0);
316 #ifdef Libburn_write_with_function_print_cuE
319 static char cue_printify(
char c)
321 if (c >= 32 && c < 127)
327 static void print_cue(
struct cue_sheet *sheet)
333 printf(
"ctladr|trno|indx|form|scms| msf | text\n");
334 printf(
"------+----+----+----+----+----------+--------\n");
335 for (i = 0; i < sheet->
count; i++) {
336 unit = sheet->
data + 8 * i;
337 if ((unit[0] & 0xf) == 2) {
339 " %1X %1X | | | | | | %c%c%c%c%c%c%c\n",
340 (unit[0] & 0xf0) >> 4, unit[0] & 0xf,
341 cue_printify(unit[1]), cue_printify(unit[2]),
342 cue_printify(unit[3]), cue_printify(unit[4]),
343 cue_printify(unit[5]), cue_printify(unit[6]),
344 unit[7] == 0 ?
' ' : cue_printify(unit[7]));
345 }
else if ((unit[0] & 0xf) == 3) {
347 " %1X %1X | %2d | | | | | %c%c%c%c%c%c\n",
348 (unit[0] & 0xf0) >> 4, unit[0] & 0xf,
349 unit[1], cue_printify(unit[2]),
350 cue_printify(unit[3]), cue_printify(unit[4]),
351 cue_printify(unit[5]), cue_printify(unit[6]),
352 cue_printify(unit[7]));
353 }
else if (unit[1] > 99) {
354 printf(
" %1X %1X |0x%02X| %2d | %02X | %02X |",
355 (unit[0] & 0xf0) >> 4, unit[0] & 0xf,
356 unit[1], unit[2], unit[3], unit[4]);
357 printf(
" %02d:%02d:%02d |\n",
358 unit[5], unit[6], unit[7]);
360 printf(
" %1X %1X | %2d | %2d | %02X | %02X |",
361 (unit[0] & 0xf0) >> 4, unit[0] & 0xf,
362 unit[1], unit[2], unit[3], unit[4]);
363 printf(
" %02d:%02d:%02d |\n",
364 unit[5], unit[6], unit[7]);
378 ptr = realloc(sheet->
data, (sheet->
count + number) * 8);
382 "Could not allocate new auxiliary object (cue_sheet->data)",
387 sheet->
count += number;
395 unsigned char tno,
unsigned char indx,
396 unsigned char form,
unsigned char scms,
int lba)
406 unit = sheet->
data + (sheet->
count - 1) * 8;
428 unit = sheet->
data + (sheet->
count - 2) * 8;
429 unit[0] = unit[8] = 0x02;
430 for (i = 0; i < 13; i++)
431 unit[1 + (i >= 7) * 8 + (i % 7)] = catalog[i];
448 unit = sheet->
data + (sheet->
count - 2) * 8;
449 unit[0] = unit[8] = (ctladr & 0xf0) | 0x03;
450 unit[1] = unit[9] = tno;
457 sprintf(text,
"%-2.2u", (
unsigned int)
isrc->
year);
461 for (i = 1; i < 7; i++)
462 unit[9 + i] = text[i];
472 int i, m, s, f, form, runtime = -150, ret, track_length;
473 int leadin_form, leadin_start, pregap = 150, postgap;
474 unsigned char ctladr, scms;
479 int ntr = session->
tracks;
482 #define Libburn_track_multi_indeX yes
484 #ifdef Libburn_track_multi_indeX
493 "Session has no defined tracks", 0, 0);
499 #ifdef Libburn_sao_can_appenD
504 sheet = calloc(1,
sizeof(
struct cue_sheet));
511 "Could not allocate new auxiliary object (cue_sheet)",
522 "Track mode has unusable value", 0, 0);
562 leadin_start = runtime;
563 ret =
add_cue(sheet, (ctladr & 64) | 1, 0, 0, leadin_form, 0,
591 "CD track number exceeds 99", 0, 0);
621 #ifndef Libburn_track_multi_indeX
625 for (i = 0; i < ntr; i++) {
661 "Post-gap index number exceeds 99",
671 #ifdef Libburn_track_multi_indeX
675 if(tar[i]->
index[j] == 0x7fffffff) {
678 if (j == 0 && pregap <= 0)
681 tar[i]->
index[j] = 0;
683 tar[i]->
index[j] = 0;
684 }
else if (j == 1 && tar[i]->
index[0] == 0x7fffffff) {
685 tar[i]->
index[j] = 0;
689 tar[i]->
entry = &e[3 + i];
704 tar[i]->
index[j] += runtime;
705 ret =
add_cue(sheet, ctladr | 1,
714 runtime += track_length +
postgap;
720 0, form, 0, runtime);
724 }
else if (pform != form) {
730 ret =
add_cue(sheet, ctladr | 1,
767 tar[i]->
entry = &e[3 + i];
777 1, form, scms, runtime);
781 runtime += track_length;
813 #ifndef Libburn_track_multi_indeX
823 ret =
add_cue(sheet, ctladr | 1, 0xAA, 1, leadin_form & 0x3f,
831 free((
char *) sheet);
866 count = 0 - d->
alba - 150;
885 int first,
unsigned char control,
int mode)
916 int ret, num_packs = 0;
917 unsigned char *text_packs = NULL;
933 int ret, i, j, si, lba, sub_cursor = 0, err, write_lba, sectors = 0;
934 int self_made_text_packs = 0;
935 unsigned char *subdata = NULL;
937 struct buffer *buf = NULL;
939 #ifdef Libburn_debug_cd_texT
940 unsigned char *packs;
948 self_made_text_packs = 1;
961 "Program error: CD-TEXT pack CRC mismatch",
963 { ret = 0;
goto ex; }
969 #ifdef Libburn_debug_cd_texT
972 "libburn_DEBUG: 8 bit CD-TEXT packs to be transmitted:\n");
974 fprintf(stderr,
"%4d :", i / 18);
975 for (j = 0; j < 18; j++) {
976 if (j >= 4 && j <= 15 && packs[i + j] >= 32 &&
977 packs[i + j] <= 126 && packs[i] != 0x88 &&
978 packs[i] != 0x89 && packs[i] != 0x8f)
979 fprintf(stderr,
" %c", packs[i + j]);
981 fprintf(stderr,
" %2.2X", packs[i + j]);
983 fprintf(stderr,
"\n");
991 subdata[si + 0] = (o->
text_packs[i + 0] >> 2) & 0x3f;
992 subdata[si + 1] = (o->
text_packs[i + 0] << 4) & 0x30;
993 subdata[si + 1] |= (o->
text_packs[i + 1] >> 4) & 0x0f;
994 subdata[si + 2] = (o->
text_packs[i + 1] << 2) & 0x3c;
995 subdata[si + 2] |= (o->
text_packs[i + 2] >> 6) & 0x03;
996 subdata[si + 3] = (o->
text_packs[i + 2] >> 0) & 0x3f;
1002 for (lba = d->
start_lba; lba < -150; lba++) {
1004 for (j = 0; j < 4; j++) {
1006 subdata + sub_cursor * 24, 24);
1014 if (buf->
bytes + 96 >= 32768 || lba == -151) {
1016 #ifdef Libburn_debug_cd_texT
1018 "libburn_DEBUG: 6 bit data to be transmitted:\n");
1019 for (i = 0; i < buf->
bytes; i += 24) {
1020 fprintf(stderr,
"%4d :", i / 24);
1021 for (j = 0; j < 24; j++)
1022 fprintf(stderr,
" %2.2X",
1024 fprintf(stderr,
"\n");
1028 err = d->
write(d, write_lba, buf);
1030 { ret = 0;
goto ex; }
1037 if (self_made_text_packs) {
1061 for (i = 0; i < s->
tracks; i++) {
1063 { ret = 0;
goto ex; }
1078 int tnum,
int sectors)
1097 if (t->
index[0] == 0x7fffffff)
1112 int i, tmp = 0, open_ended = 0, ret= 0,
nwa, lba;
1147 printf(
"first track should not have a pregap1\n");
1150 pt = s->
track[tnum - 1];
1151 for (i = 0; i < 75; i++)
1154 { ret = 0;
goto ex; }
1160 { ret = 0;
goto ex; }
1173 ret = d->
get_nwa(d, -1, &lba, &nwa);
1180 "TAO pre-track %2.2d : get_nwa(%d)=%d, d=%d , demand=%.f , cap=%.f\n",
1181 tnum+1, nwa, ret, d->
nwa,
1194 "Drive tells NWA smaller than last written address",
1212 tmp = sectors > 150 ? 150 : sectors;
1214 for (i = 0;
open_ended || i < sectors - tmp; i++) {
1222 { ret = 0;
goto ex; }
1234 for (; i < sectors; i++) {
1237 fprintf(stderr,
"LIBBURN_DEBUG: TNUM=%d TRACKS=%d TMP=%d\n",
1245 { ret = 0;
goto ex; }
1261 { ret = 0;
goto ex; }
1308 for (i = 0; i < disc->
sessions; i++)
1312 goto bad_track_mode_found;
1314 bad_track_mode_found:;
1315 sprintf(msg,
"Unsuitable track mode 0x%x in track %d of session %d",
1335 #ifdef Libburn_reset_progress_asynC
1368 for (sx = 0; sx < disc->
sessions; sx++)
1393 int num_sessions, i, j;
1396 for (i = 0; i < num_sessions; i++)
1397 for (j = 0; j < sessions[i]->
tracks; j++)
1407 int num_sessions, i, ret;
1410 for (i = 0; i < num_sessions; i++) {
1425 char *msg = NULL, *reason_pt;
1426 int no_media = 0, ret, has_cdtext, is_bd_pow = 0;
1434 "DRIVE: is a virtual placeholder (null-drive)");
1436 sprintf(reasons,
"DRIVE: read-only pseudo drive");
1444 if (strncmp(reasons,
"MEDIA: ", 7)==0)
1450 reason_pt= reasons + strlen(reasons);
1452 goto unsuitable_profile;
1458 if (has_cdtext > 0) {
1463 "CD-TEXT supported only with pure audio CD media, ");
1466 "CD-TEXT supported only with CD media, ");
1475 "write start address not properly aligned to 2048, ");
1479 strcat(reasons,
"unsuitable track mode found, ");
1481 strcat(reasons,
"write start address not supported, ");
1485 "CD-TEXT supported only with write type SAO, ");
1488 "No Lead-in start address known with CD-TEXT, ");
1494 "write start address not properly aligned to 32k, ");
1503 strcat(reasons,
"write start address not supported, ");
1506 if (is_bd_pow && !silent)
1510 "Unsuitable media detected: BD-R formatted to POW.",
1514 "unsuitable media formatting POW detected, ");
1519 unsuitable_profile:;
1520 msg = calloc(1, 160);
1521 if (msg != NULL && !silent) {
1523 "Unsuitable media detected. Profile %4.4Xh %s",
1532 strcat(reasons,
"no suitable media profile detected, ");
1542 "No suitable media detected", 0, 0);
1549 "Write job parameters are unsuitable", 0, 0);
1569 "DVD pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
1570 tnum+1,
nwa, ret, d->
nwa);
1578 #ifdef Libburn_pioneer_dvr_216d_with_opC
1579 fprintf(stderr,
"libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : num_opc_tables = %d\n", d->
num_opc_tables);
1581 fprintf(stderr,
"libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : performing OPC\n");
1583 fprintf(stderr,
"libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : done\n");
1587 #ifdef Libburn_pioneer_dvr_216d_get_evenT
1597 size += (off_t) (o->
obs - (size % o->
obs));
1601 sprintf(msg,
"Cannot reserve track of %.f bytes",
1629 "DVD+R pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
1630 tnum+1,
nwa, ret, d->
nwa);
1648 o->
obs += 32768 - (o->
obs % 32768);
1650 size += (off_t) (o->
obs - (size % o->
obs));
1655 sprintf(msg,
"Program error: encountered DVD+R without chunk padding");
1665 sprintf(msg,
"Cannot reserve track of %.f bytes",
1691 sprintf(msg,
"Closing track %2.2d (absolute track number %d)",
1711 sprintf(msg,
"Finalizing %s ...",
1726 sprintf(msg,
"... finalizing %s done ",
1739 int tnum,
int is_last_track)
1745 "Closing track %2.2d (absolute track and session number %d)",
1756 if (is_last_track && !o->
multi)
1770 #ifdef Libburn_simplified_dvd_chunk_transactioN
1809 int curr = 0, valid, err;
1814 #ifdef Libburn_log_in_and_out_streaM
1816 static int tee_fd= -1;
1818 tee_fd= open(
"/tmp/libburn_sg_readin",
1819 O_WRONLY | O_CREAT | O_TRUNC |
O_BINARY,
1829 if (0 && !track->
eos) {
1830 for (curr = 0; curr < opts->
obs; curr += 2048) {
1843 #ifdef Libburn_log_in_and_out_streaM
1844 if(tee_fd!=-1 && valid>0) {
1845 write(tee_fd,
data + curr, valid);
1850 }
else if (!track->
eos){
1858 #ifdef Libburn_log_in_and_out_streaM
1859 if(tee_fd!=-1 && valid>0) {
1860 write(tee_fd,
data, valid);
1871 if (curr < opts->obs)
1872 memset(
data + curr , 0, opts->
obs - curr);
1901 int i, open_ended = 0, ret= 0, is_flushed = 0, track_open = 0;
1902 int first_buf_cap = 0, further_cap = 0, buf_cap_step = 1024;
1940 for (i = 0; open_ended || i <
sectors; i++) {
1946 if (i == first_buf_cap ||
1947 ((i % buf_cap_step) == 0 &&
1948 (i >= further_cap || further_cap < 0))) {
1950 if (further_cap < 0)
1955 #ifdef Libburn_simplified_dvd_chunk_transactioN
1957 ret = transact_dvd_chunk(o, t);
1960 i += o->
obs / 2048 - 1;
1965 { ret = 0;
goto ex; }
2015 if (track_open && !is_flushed)
2069 #ifdef Libburn_dvd_r_dl_multi_no_close_sessioN
2076 "Closing session", 0, 0);
2089 int i, ret, multi_mem;
2117 #ifdef Libburn_bug_A90108_close_disC
2130 "Closing BD-R with accidentally open session",
2145 "Closing open session before writing new one",
2154 for (i = 0; i < s->
tracks; i++) {
2156 is_last_session && i == (s->
tracks - 1));
2165 multi_mem = o->
multi;
2166 if (!is_last_session)
2169 o->
multi = multi_mem;
2236 sprintf(msg,
"Write start address is %d * 32768", d->
nwa);
2309 off_t default_size = 0;
2328 "Write preparation setup failed for DVD+RW");
2338 sprintf(msg,
"Write start address is %d * 2048",
2361 "Write preparation setup failed for DVD-RW");
2379 sprintf(msg,
"Activated track default size %.f",
2393 "Write preparation setup failed for DVD-R[W]");
2411 sprintf(msg,
"Activated track default size %.f",
2421 sprintf(msg,
"Write preparation setup failed for %s",
2440 #ifdef Libburn_dvd_obs_default_64K
2457 sprintf(msg,
"Chosen write chunk size %d exceeds system dependent buffer size", o->
obs);
2469 "Stream recording disabled because of small output buffer");
2476 sprintf(msg,
"dvd/bd Profile= %2.2Xh , obs= %d , obs_pad= %d",
2481 for (i = 0; i < disc->
sessions; i++) {
2506 sprintf(msg,
"Sequential BD-R media now contains %d sessions. It is likely to soon fail writing.", d->
complete_sessions);
2521 int sector_size,
int flag)
2528 #define O_LARGEFILE 0
2540 "Pseudo-drive is a read-only file. Cannot write.",
2553 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
2558 "Failed to open device (a pseudo-drive)", errno, 0);
2565 lseek_res = lseek(fd, start_byte, SEEK_SET);
2566 if (lseek_res == -1) {
2567 sprintf(msg,
"Cannot address start byte %.f",
2568 (
double) start_byte);
2578 d->
nwa = start_byte / sector_size;
2589 for(todo = bufsize; todo > 0; todo -= count) {
2592 (
unsigned char *) (buf + (bufsize - todo)), todo);
2595 (
unsigned char *) (buf + (bufsize - todo)), todo);
2599 return (bufsize - todo);
2609 int todo, done, retries;
2611 if (d->
cancel || count <= 0)
2624 ret = write(fd, buf + done, todo);
2630 if (done != count) {
2633 sprintf(msg,
"Cannot write desired amount of %d bytes.", count);
2635 sprintf(msg + strlen(msg),
" Did %d retries. Last",
2637 sprintf(msg + strlen(msg),
" write(2) returned %d.", ret);
2664 "Invalid file descriptor with stdio pseudo-drive",
2669 if (start != d->
nwa) {
2672 start_byte = ((off_t) start) *
2674 if (lseek(d->
stdio_fd, start_byte, SEEK_SET)==-1) {
2675 sprintf(msg,
"Cannot address start byte %.f",
2676 (
double) start_byte);
2720 "Invalid file descriptor with stdio pseudo-drive",
2735 "syncing cache (stdio fsync)", 0, 0);
2740 if (ret != 0 && errno == EIO) {
2744 "Cannot write desired amount of data. fsync(2) returned %d.",
2771 struct timeval *prev_time,
2772 int *us_corr, off_t b_since_prev,
int flag)
2774 struct timeval tnow;
2775 double to_wait, goal, corr;
2779 gettimeofday(prev_time, NULL);
2783 if (kb_per_second <= 0)
2786 if (max_corr < -1.0e9 || max_corr > 1.0e9)
2787 abs_max_corr = 1000000000;
2789 abs_max_corr = abs(max_corr);
2790 gettimeofday(&tnow, NULL);
2791 goal = ((double) b_since_prev) / 1000.0 / ((double) kb_per_second) +
2792 ((double) prev_time->tv_sec) +
2793 ((double) prev_time->tv_usec) / 1.0e6 +
2794 ((double) *us_corr) / 1.0e6 ;
2795 to_wait = goal - ((double) tnow.tv_sec) -
2796 ((double) tnow.tv_usec) / 1.0e6;
2799 while (to_wait > 0.0) {
2800 if (to_wait >= 0.5) {
2803 }
else if (to_wait >= 0.00001) {
2804 usleep((
int) (to_wait * 1000000.0));
2810 gettimeofday(prev_time, NULL);
2811 corr = (goal - ((double) prev_time->tv_sec) -
2812 ((double) prev_time->tv_usec) / 1.0e6) * 1.0e6;
2813 if (corr > abs_max_corr)
2814 *us_corr = abs_max_corr;
2815 else if (corr < -abs_max_corr)
2816 *us_corr = -abs_max_corr;
2827 int open_ended, bufsize = 16 * 2048, ret, sectors;
2831 int i, prev_sync_sector = 0, us_corr = 0, max_corr = 250000;
2833 struct timeval prev_time;
2853 &prev_time, &us_corr, (off_t) 0, 1);
2855 for (i = 0; open_ended || i < sectors; i++) {
2875 &prev_time, &us_corr,
2884 &prev_time, &us_corr, (off_t) (512 * 2048), 0);
2973 int first = 1, i, ret, lba, nwa = 0, multi_mem, stream_recording_start;
2989 stream_recording_start = 0;
2991 stream_recording_start, 0);
3028 "Pseudo-drive is a read-only file. Cannot write.",
3052 sprintf(msg,
"cd Profile= %2.2Xh , obs= %d , obs_pad= %d",
3064 "Activated track default size %.f",
3091 ret = d->
get_nwa(d, -1, &lba, &nwa);
3093 "SAO|RAW: Inquired nwa: %d , ret= %d , cap=%.f\n",
3104 for (i = 0; i < disc->
sessions; i++) {
3116 #ifdef Libburn_write_with_function_print_cuE
3125 if (sheet->
data != NULL)
3146 #ifdef Libburn_sao_can_appenD
3153 "SAO appendable d->nwa= %d\n", d->
nwa);
3176 multi_mem = o->
multi;
3177 if(i < disc->sessions - 1)
3180 o->
multi = multi_mem;
3197 d->
nwa += first ? 6750 : 2250;
3198 d->
alba += first ? 6750 : 2250;
3230 "Burn run failed", 0, 0);
3237 sizeof(
struct buffer), 0);
3244 sprintf(msg,
"WRITE command repetition happened %u times",
3256 char *data, off_t data_count,
int flag)
3258 int alignment = 0, start, upto, chunksize, err, fd = -1, ret;
3259 int do_close = 0, getfl_ret;
3268 "Drive is not grabbed on random access write", 0, 0);
3275 "Drive is a virtual placeholder (null-drive)", 0, 0);
3282 "Pseudo-drive is a read-only file. Cannot write.",
3288 alignment = 2 * 1024;
3290 alignment = 2 * 1024;
3292 alignment = 32 * 1024;
3294 alignment = 2 * 1024;
3296 alignment = 2 * 1024;
3297 if (alignment == 0) {
3298 sprintf(msg,
"Write start address not supported");
3302 "Write start address not supported", 0, 0);
3305 if ((byte_address % alignment) != 0) {
3307 "Write start address not properly aligned (%d bytes)",
3315 if ((data_count % alignment) != 0) {
3317 "Write data count not properly aligned (%ld bytes)",
3329 "Drive is busy on attempt to write random access",0,0);
3335 getfl_ret = fcntl(d->
stdio_fd, F_GETFL);
3336 if (((O_RDWR | O_WRONLY | O_RDONLY) & getfl_ret) ==
3356 start = byte_address / 2048;
3357 upto = start + data_count / 2048;
3359 for (; start < upto; start += 16) {
3360 chunksize = upto - start;
3381 if(fd >= 0 && do_close)
3383 {ret = -(start * 2048 - byte_address);
goto ex;}
3399 if(fd >= 0 && do_close)
3426 "Drive is busy on attempt to close damaged session",
3434 "Track not marked as damaged. No action taken.",
3481 "Cannot close damaged track on given media type",
int burn_cdtext_from_session(struct burn_session *s, unsigned char **text_packs, int *num_packs, int flag)
int burn_cdtext_crc_mismatches(unsigned char *packs, int num_packs, int flag)
int burn_drive_inquire_media(struct burn_drive *d)
int burn_drive_mark_unready(struct burn_drive *d, int flag)
int burn_drive_grab_stdio(struct burn_drive *d, int flag)
int burn_drive_get_bd_r_pow(struct burn_drive *d)
int burn_drive_set_stream_recording(struct burn_drive *d, int recmode, int start, int flag)
int burn_drive__fd_from_special_adr(char *adr)
#define BURN_FREE_MEM(pt)
#define BURN_ALLOC_MEM(pt, typ, count)
void * burn_os_alloc_buffer(size_t amount, int flag)
void burn_write_opts_free(struct burn_write_opts *opts)
enum burn_write_types burn_write_opts_auto_write_type(struct burn_write_opts *opts, struct burn_disc *disc, char reasons[4096], int flag)
@ BURN_DRIVE_WRITING_LEADIN
@ BURN_DRIVE_CLOSING_SESSION
@ BURN_DRIVE_WRITING_LEADOUT
@ BURN_DRIVE_WRITING_SYNC
@ BURN_DRIVE_CLOSING_TRACK
@ BURN_DRIVE_WRITING_PREGAP
int burn_os_free_buffer(void *buffer, size_t amount, int flag)
int burn_track_set_size(struct burn_track *t, off_t size)
void burn_lba_to_msf(int lba, int *m, int *s, int *f)
struct burn_session ** burn_disc_get_sessions(struct burn_disc *d, int *num)
int libdax_msgs_submit(struct libdax_msgs *m, int origin, int error_code, int severity, int priority, char *msg_text, int os_errno, int flag)
#define LIBDAX_MSGS_SEV_DEBUG
#define LIBDAX_MSGS_SEV_FATAL
#define LIBDAX_MSGS_SEV_NOTE
#define LIBDAX_MSGS_PRIO_HIGH
#define LIBDAX_MSGS_SEV_SORRY
#define LIBDAX_MSGS_SEV_WARNING
#define LIBDAX_MSGS_PRIO_ZERO
#define LIBDAX_MSGS_SEV_FAILURE
void mmc_get_event(struct burn_drive *d)
int burn_write_opts_clone(struct burn_write_opts *from, struct burn_write_opts **to, int flag)
int sector_postgap(struct burn_write_opts *o, unsigned char tno, unsigned char control, int mode)
int sector_write_buffer(struct burn_drive *d, struct burn_track *track, int flag)
int sector_pregap(struct burn_write_opts *o, unsigned char tno, unsigned char control, int mode)
int sector_lout(struct burn_write_opts *o, unsigned char control, int mode)
int sector_headers_is_ok(struct burn_write_opts *o, int mode)
int sector_toc(struct burn_write_opts *o, int mode)
int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
int burn_source_cancel(struct burn_source *src)
unsigned char data[65536+4096]
struct burn_session ** session
enum burn_disc_status status
char current_profile_text[80]
struct burn_write_opts * write_opts
struct burn_progress progress
int current_is_cd_profile
int(* get_nwa)(struct burn_drive *, int trackno, int *lba, int *nwa)
unsigned int waited_tries
struct burn_toc_entry * toc_entry
int(* write)(struct burn_drive *, int, struct buffer *)
void(* sync_cache)(struct burn_drive *)
unsigned int waited_writes
int(* read_buffer_capacity)(struct burn_drive *d)
int(* send_cue_sheet)(struct burn_drive *, struct cue_sheet *)
unsigned int write_retry_count
unsigned int pessimistic_writes
void(* send_write_parameters)(struct burn_drive *, struct burn_session *, int tno, const struct burn_write_opts *)
int(* reserve_track)(struct burn_drive *d, off_t size)
int(* format_unit)(struct burn_drive *d, off_t size, int flag)
void(* close_track_session)(struct burn_drive *d, int session, int track)
enum burn_drive_status busy
off_t pessimistic_buffer_free
off_t media_capacity_remaining
void(* perform_opc)(struct burn_drive *)
int state_of_last_session
unsigned buffer_available
unsigned char mediacatalog[14]
struct burn_track ** track
int(* read)(struct burn_source *, unsigned char *buffer, int size)
struct burn_source * next
int(* read_xt)(struct burn_source *, unsigned char *buffer, int size)
struct burn_source * source
struct burn_toc_entry * entry
int no_text_pack_crc_check
struct burn_drive * drive
unsigned char * text_packs
enum burn_write_types write_type
unsigned char mediacatalog[13]
off_t burn_track_get_default_size(struct burn_track *t)
int burn_track_set_fillup(struct burn_track *t, int fill_up_media)
int burn_track_is_data_done(struct burn_track *t)
int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag)
int burn_track_get_shortage(struct burn_track *t)
int burn_track_get_sectors_2(struct burn_track *t, int flag)
int burn_track_set_sectors(struct burn_track *t, int sectors)
int burn_track_is_open_ended(struct burn_track *t)
#define TOC_CONTROL_AUDIO
int burn_disc_close_session_dvd_minus_rw(struct burn_write_opts *o, struct burn_session *s)
int burn_sector_length(int tracktype)
int burn_disc_init_write_status(struct burn_write_opts *o, struct burn_disc *disc)
int burn_dvd_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag)
int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, char reasons[4096], int silent)
int burn_nominal_slowdown(int kb_per_second, int max_corr, struct timeval *prev_time, int *us_corr, off_t b_since_prev, int flag)
int burn_disc_write_is_ok(struct burn_write_opts *o, struct burn_disc *disc, int flag)
static int add_cue(struct cue_sheet *sheet, unsigned char ctladr, unsigned char tno, unsigned char indx, unsigned char form, unsigned char scms, int lba)
int burn_write_leadin(struct burn_write_opts *o, struct burn_session *s, int first)
#define Libburn_bd_re_obS
int burn_write_flush_buffer(struct burn_write_opts *o, struct burn_track *track)
struct libdax_msgs * libdax_messenger
int burn_dvd_write_track(struct burn_write_opts *o, struct burn_session *s, int tnum, int is_last_track)
int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o)
static int burn_create_text_packs(struct burn_write_opts *o, struct burn_session *s, int flag)
void burn_stdio_mmc_sync_cache(struct burn_drive *d)
static int add_isrc_cue(struct cue_sheet *sheet, unsigned char ctladr, int tno, struct isrc *isrc)
int burn_disc_finalize_dvd_plus_r(struct burn_write_opts *o)
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s, int tnum)
int burn_write_track_minsize(struct burn_write_opts *o, struct burn_session *s, int tnum)
int burn_write_close_session(struct burn_write_opts *o)
int burn_dvd_write_session(struct burn_write_opts *o, struct burn_session *s, int is_last_session)
int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o, int tnum, int is_last_track)
static int burn_write_leadin_cdtext(struct burn_write_opts *o, struct burn_session *s, int flag)
int burn_subcode_length(int tracktype)
int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
static int precheck_disc_has_cdtext(struct burn_disc *disc, int flag)
#define Libburn_bd_streamed_obS
int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s, int tnum, int flag)
int burn_stdio_open_write(struct burn_drive *d, off_t start_byte, int sector_size, int flag)
int burn_stdio_write(int fd, char *buf, int count, struct burn_drive *d, int flag)
static int type_to_ctrl(int mode)
int burn_write_track(struct burn_write_opts *o, struct burn_session *s, int tnum)
int burn_disc_init_track_status(struct burn_write_opts *o, struct burn_session *s, struct burn_track *t, int tnum, int sectors)
int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o, int tnum)
void type_to_form(int mode, unsigned char *ctladr, int *form)
int burn_stdio_mmc_dummy_write(struct burn_drive *d, int start, struct buffer *buf)
int burn_disc_setup_dvd_minus_r(struct burn_write_opts *o, struct burn_disc *disc)
int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
int burn_random_access_write(struct burn_drive *d, off_t byte_address, char *data, off_t data_count, int flag)
int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o, struct burn_disc *disc)
static int add_catalog_cue(struct cue_sheet *sheet, unsigned char catalog[13])
int burn_disc_setup_dvd_plus_r(struct burn_write_opts *o, struct burn_disc *disc)
static int precheck_write_is_audio(struct burn_disc *disc, int flag)
int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o, struct burn_session *s, int tnum)
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
int burn_write_leadout(struct burn_write_opts *o, int first, unsigned char control, int mode)
int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o, struct burn_session *s, int tnum)
int burn_disc_setup_dvd_plus_rw(struct burn_write_opts *o, struct burn_disc *disc)
static int new_cue(struct cue_sheet *sheet, int number, int flag)
int burn_disc_close_session_dvd_plus_rw(struct burn_write_opts *o, struct burn_session *s)
int burn_stdio_mmc_write(struct burn_drive *d, int start, struct buffer *buf)
int burn_stdio_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
struct cue_sheet * burn_create_toc_entries(struct burn_write_opts *o, struct burn_session *session, int nwa)
#define Libburn_stdio_write_retrieS
int burn_stdio_read_source(struct burn_source *source, char *buf, int bufsize, struct burn_write_opts *o, int flag)