New API function burn_disc_track_lba_nwa()
This commit is contained in:
parent
62bd5963d0
commit
6c22b98235
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2006.11.10.185209"
|
#define Cdrskin_timestamP "2006.11.11.122402"
|
||||||
|
@ -1202,3 +1202,31 @@ int burn_disc_read_atip(struct burn_drive *d)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ts A61110 : new API function */
|
||||||
|
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||||
|
int trackno, int *lba, int *nwa)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (burn_drive_is_released(d)) {
|
||||||
|
libdax_msgs_submit(libdax_messenger,
|
||||||
|
d->global_index, 0x0002011b,
|
||||||
|
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||||
|
"Attempt to read track info from ungrabbed drive",
|
||||||
|
0, 0);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (d->busy != BURN_DRIVE_IDLE) {
|
||||||
|
libdax_msgs_submit(libdax_messenger,
|
||||||
|
d->global_index, 0x0002011c,
|
||||||
|
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||||
|
"Attempt to read track info from busy drive",
|
||||||
|
0, 0);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (o!=NULL)
|
||||||
|
d->send_write_parameters(d, o);
|
||||||
|
ret = d->get_nwa(d, trackno, lba, nwa);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,10 @@ struct burn_session;
|
|||||||
/** References a single track on a disc */
|
/** References a single track on a disc */
|
||||||
struct burn_track;
|
struct burn_track;
|
||||||
|
|
||||||
|
/* ts A61111 */
|
||||||
|
/** References a set of write parameters */
|
||||||
|
struct burn_write_opts;
|
||||||
|
|
||||||
/** Session format for normal audio or data discs */
|
/** Session format for normal audio or data discs */
|
||||||
#define BURN_CDROM 0
|
#define BURN_CDROM 0
|
||||||
/** Session format for obsolete CD-I discs */
|
/** Session format for obsolete CD-I discs */
|
||||||
@ -691,6 +695,21 @@ int burn_disc_read_atip(struct burn_drive *drive);
|
|||||||
int burn_drive_get_start_end_lba(struct burn_drive *drive,
|
int burn_drive_get_start_end_lba(struct burn_drive *drive,
|
||||||
int *start_lba, int *end_lba, int flag);
|
int *start_lba, int *end_lba, int flag);
|
||||||
|
|
||||||
|
/* ts A61110 */
|
||||||
|
/** Read start lba and Next Writeable Address of a track from media.
|
||||||
|
Usually a track lba is obtained from the result of burn_track_get_entry().
|
||||||
|
This call retrieves an updated lba, eventual nwa, and can address the
|
||||||
|
invisible track to come.
|
||||||
|
The drive must be grabbed for this call. One may not issue this call
|
||||||
|
during ongoing burn_disc_write() or burn_disc_erase().
|
||||||
|
@param d The drive to query.
|
||||||
|
@param o If not NULL: write parameters to be set on drive before query
|
||||||
|
@param trackno 0=next track to come, >0 number of existing track
|
||||||
|
@return 1=nwa is valid , 0=nwa is not valid , -1=error
|
||||||
|
*/
|
||||||
|
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||||
|
int trackno, int *lba, int *nwa);
|
||||||
|
|
||||||
|
|
||||||
/** Tells whether a disc can be erased or not
|
/** Tells whether a disc can be erased or not
|
||||||
@return Non-zero means erasable
|
@return Non-zero means erasable
|
||||||
|
@ -332,6 +332,8 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
|||||||
0x00020118 (DEBUG,HIGH) = Closing track
|
0x00020118 (DEBUG,HIGH) = Closing track
|
||||||
0x00020119 (DEBUG,HIGH) = Closing session
|
0x00020119 (DEBUG,HIGH) = Closing session
|
||||||
0x0002011a (NOTE,HIGH) = Padding up track to minimum size
|
0x0002011a (NOTE,HIGH) = Padding up track to minimum size
|
||||||
|
0x0002011b (FATAL,HIGH) = Attempt to read track info from ungrabbed drive
|
||||||
|
0x0002011c (FATAL,HIGH) = Attempt to read track info from busy drive
|
||||||
|
|
||||||
libdax_audioxtr:
|
libdax_audioxtr:
|
||||||
0x00020200 (SORRY,HIGH) = Cannot open audio source file
|
0x00020200 (SORRY,HIGH) = Cannot open audio source file
|
||||||
|
@ -99,7 +99,9 @@ void mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
|
|||||||
d->issue_command(d, &c);
|
d->issue_command(d, &c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmc_get_nwa(struct burn_drive *d)
|
/* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
|
||||||
|
@return 1=nwa is valid , 0=nwa is not valid , -1=error */
|
||||||
|
int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa)
|
||||||
{
|
{
|
||||||
struct buffer buf;
|
struct buffer buf;
|
||||||
struct command c;
|
struct command c;
|
||||||
@ -110,21 +112,27 @@ int mmc_get_nwa(struct burn_drive *d)
|
|||||||
c.oplen = sizeof(MMC_TRACK_INFO);
|
c.oplen = sizeof(MMC_TRACK_INFO);
|
||||||
memcpy(c.opcode, MMC_TRACK_INFO, sizeof(MMC_TRACK_INFO));
|
memcpy(c.opcode, MMC_TRACK_INFO, sizeof(MMC_TRACK_INFO));
|
||||||
c.opcode[1] = 1;
|
c.opcode[1] = 1;
|
||||||
c.opcode[5] = 0xFF;
|
if(trackno<=0)
|
||||||
|
c.opcode[5] = 0xFF;
|
||||||
|
else
|
||||||
|
c.opcode[5] = trackno;
|
||||||
c.page = &buf;
|
c.page = &buf;
|
||||||
c.dir = FROM_DRIVE;
|
c.dir = FROM_DRIVE;
|
||||||
d->issue_command(d, &c);
|
d->issue_command(d, &c);
|
||||||
data = c.page->data;
|
data = c.page->data;
|
||||||
|
|
||||||
/* ts A61106 : >>> MMC-1 Table 142 : NWA_V = NWA Valid Flag
|
*lba = (data[8] << 24) + (data[9] << 16)
|
||||||
What to do if this is not 1 ? */
|
+ (data[10] << 8) + data[11];
|
||||||
if (!(data[7]&1))
|
*nwa = (data[12] << 24) + (data[13] << 16)
|
||||||
|
+ (data[14] << 8) + data[15];
|
||||||
|
/* ts A61106 : MMC-1 Table 142 : NWA_V = NWA Valid Flag */
|
||||||
|
if (!(data[7]&1)) {
|
||||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||||
"mmc_get_nwa: Track Info Block: NWA_V == 0", 0, 0);
|
"mmc_get_nwa: Track Info Block: NWA_V == 0", 0, 0);
|
||||||
|
return 0;
|
||||||
return (data[12] << 24) + (data[13] << 16)
|
}
|
||||||
+ (data[14] << 8) + data[15];
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ts A61009 : function is obviously unused. */
|
/* ts A61009 : function is obviously unused. */
|
||||||
|
@ -37,7 +37,11 @@ void mmc_set_speed(struct burn_drive *, int, int);
|
|||||||
void mmc_read_lead_in(struct burn_drive *, struct buffer *);
|
void mmc_read_lead_in(struct burn_drive *, struct buffer *);
|
||||||
void mmc_perform_opc(struct burn_drive *);
|
void mmc_perform_opc(struct burn_drive *);
|
||||||
void mmc_get_configuration(struct burn_drive *);
|
void mmc_get_configuration(struct burn_drive *);
|
||||||
int mmc_get_nwa(struct burn_drive *);
|
|
||||||
|
/* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
|
||||||
|
@return 1=nwa is valid , 0=nwa is not valid , -1=error */
|
||||||
|
int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa);
|
||||||
|
|
||||||
void mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
|
void mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
|
||||||
|
|
||||||
/* ts A61023 : get size and free space of drive buffer */
|
/* ts A61023 : get size and free space of drive buffer */
|
||||||
|
@ -182,7 +182,7 @@ struct burn_drive
|
|||||||
void (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
|
void (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
|
||||||
void (*sync_cache) (struct burn_drive *);
|
void (*sync_cache) (struct burn_drive *);
|
||||||
int (*get_erase_progress) (struct burn_drive *);
|
int (*get_erase_progress) (struct burn_drive *);
|
||||||
int (*get_nwa) (struct burn_drive *);
|
int (*get_nwa) (struct burn_drive *, int trackno, int *lba, int *nwa);
|
||||||
|
|
||||||
/* ts A61009 : removed d in favor of o->drive */
|
/* ts A61009 : removed d in favor of o->drive */
|
||||||
/* void (*close_disc) (struct burn_drive * d,
|
/* void (*close_disc) (struct burn_drive * d,
|
||||||
|
@ -570,7 +570,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
|||||||
{
|
{
|
||||||
struct burn_track *t = s->track[tnum];
|
struct burn_track *t = s->track[tnum];
|
||||||
struct burn_drive *d = o->drive;
|
struct burn_drive *d = o->drive;
|
||||||
int i, tmp = 0, open_ended = 0, ret, nwa;
|
int i, tmp = 0, open_ended = 0, ret, nwa, lba;
|
||||||
int sectors;
|
int sectors;
|
||||||
char msg[80];
|
char msg[80];
|
||||||
|
|
||||||
@ -609,9 +609,10 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
|||||||
d->send_write_parameters(d, o);
|
d->send_write_parameters(d, o);
|
||||||
|
|
||||||
/* ts A61103 */
|
/* ts A61103 */
|
||||||
nwa = d->get_nwa(d);
|
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||||
sprintf(msg, "pre-track %2.2d : get_nwa()= %d , d->nwa= %d\n",
|
sprintf(msg,
|
||||||
tnum+1, nwa, d->nwa);
|
"pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d\n",
|
||||||
|
tnum+1, nwa, ret, d->nwa);
|
||||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
|
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
|
||||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||||
msg,0,0);
|
msg,0,0);
|
||||||
@ -749,8 +750,7 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
|
|||||||
struct burn_drive *d = o->drive;
|
struct burn_drive *d = o->drive;
|
||||||
struct buffer buf;
|
struct buffer buf;
|
||||||
struct burn_track *lt;
|
struct burn_track *lt;
|
||||||
int first = 1, i;
|
int first = 1, i, ret, lba, nwa;
|
||||||
int nwa;
|
|
||||||
char msg[80];
|
char msg[80];
|
||||||
|
|
||||||
/* ts A60924 : libburn/message.c gets obsoleted
|
/* ts A60924 : libburn/message.c gets obsoleted
|
||||||
@ -778,8 +778,8 @@ return crap. so we send the command, then ignore the result.
|
|||||||
|
|
||||||
d->send_write_parameters(d, o);
|
d->send_write_parameters(d, o);
|
||||||
|
|
||||||
nwa = d->get_nwa(d);
|
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||||
sprintf(msg, "Inquired nwa: %d", nwa);
|
sprintf(msg, "Inquired nwa: %d (ret=%d)", nwa, ret);
|
||||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||||
0x00000002,
|
0x00000002,
|
||||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||||
|
Loading…
Reference in New Issue
Block a user