New API function burn_drive_set_stream_recording()

This commit is contained in:
Thomas Schmitt 2009-02-27 14:30:57 +00:00
parent 39ce45193b
commit 27c75ee526
7 changed files with 59 additions and 11 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.02.20.132334" #define Cdrskin_timestamP "2009.02.27.143100"

View File

@ -62,6 +62,7 @@ int burn_setup_drive(struct burn_drive *d, char *fname)
d->stdio_fd = -1; d->stdio_fd = -1;
d->status = BURN_DISC_UNREADY; d->status = BURN_DISC_UNREADY;
d->do_stream_recording = 0; d->do_stream_recording = 0;
d->stream_recording_start= 0;
return 1; return 1;
} }
@ -792,6 +793,18 @@ enum burn_drive_status burn_drive_get_status(struct burn_drive *d,
return d->busy; return d->busy;
} }
int burn_drive_set_stream_recording(struct burn_drive *d, int recmode,
int start, int flag)
{
if (recmode == 1)
d->do_stream_recording = 1;
else if (recmode == -1)
d->do_stream_recording = 0;
d->stream_recording_start = start;
return(1);
}
void burn_drive_cancel(struct burn_drive *d) void burn_drive_cancel(struct burn_drive *d)
{ {
pthread_mutex_lock(&d->access_lock); pthread_mutex_lock(&d->access_lock);

View File

@ -1388,6 +1388,28 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
*/ */
void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc); void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
/* ts A90227 */
/** Control stream recording during the write run and eventually set the start
LBA for stream recording.
Stream recording is set from struct burn_write_opts when the write run
gets started. See burn_write_opts_set_stream_recording().
The call described here can be used later to override this setting and
to program automatic switching at a given LBA. It also affects subsequent
calls to burn_random_access_write().
@param drive The drive which performs the write operation.
@param recmode -1= disable stream recording
0= leave setting as is
1= enable stream recording
@param start The LBA where actual stream recording shall start.
(0 means unconditional stream recording)
@param flag Bitfield for control purposes (unused yet, submit 0).
@return 1=success , <=0 failure
@since 0.6.4
*/
int burn_drive_set_stream_recording(struct burn_drive *drive, int recmode,
int start, int flag);
/** Cancel an operation on a drive. /** Cancel an operation on a drive.
This will only work when the drive's busy state is BURN_DRIVE_READING or This will only work when the drive's busy state is BURN_DRIVE_READING or
BURN_DRIVE_WRITING. BURN_DRIVE_WRITING.
@ -1906,12 +1928,15 @@ void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force);
/* ts A80412 */ /* ts A80412 */
/** Eventually makes use of the more modern write command AAh WRITE12 and /** Eventually makes use of the more modern write command AAh WRITE12 and
sets the Streaming bit. With DVD-RAM this can override the traditional sets the Streaming bit. With DVD-RAM and BD this can override the
slowdown to half nominal speed. But if it speeds up writing then it also traditional slowdown to half nominal speed. But if it speeds up writing
disables error management and correction. Weigh your priorities. then it also disables error management and correction. Weigh your
This only affects the write operations of burn_disc_write(). priorities. This affects the write operations of burn_disc_write()
and subsequent calls of burn_random_access_write().
@param opts The write opts to change @param opts The write opts to change
@param value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit @param value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit
@since 0.6.4:
>=16 use WRITE12 but not before the LBA given by value
@since 0.4.6 @since 0.4.6
*/ */
void burn_write_opts_set_stream_recording(struct burn_write_opts *opts, void burn_write_opts_set_stream_recording(struct burn_write_opts *opts,

View File

@ -55,10 +55,10 @@ extern struct libdax_msgs *libdax_messenger;
/* ts A70306 */ /* ts A70306 */
#define Libburn_support_dvd_plus_R 1 #define Libburn_support_dvd_plus_R 1
/* ts A70509 : handling 0x41 and 0x42 as read-only types */ /* ts A70509 : handling 0x41 as read-only type */
#define Libburn_support_bd_r_readonlY 1 #define Libburn_support_bd_r_readonlY 1
/* >>> ts A81208 */ /* ts A81208 */
#define Libburn_support_bd_plus_r_srM 1 #define Libburn_support_bd_plus_r_srM 1
@ -124,6 +124,7 @@ extern struct libdax_msgs *libdax_messenger;
BD-RE is now an officially supported profile. BD-RE is now an officially supported profile.
ts A81209 : The first two sessions have been written to BD-R SRM ts A81209 : The first two sessions have been written to BD-R SRM
(auto formatted without Defect Management). (auto formatted without Defect Management).
ts A90107 : BD-R is now supported media type
*/ */
/* ts A70519 : With MMC commands of data direction FROM_DRIVE: /* ts A70519 : With MMC commands of data direction FROM_DRIVE:
@ -744,7 +745,7 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
mmc_wait_for_buffer_free(d, buf); mmc_wait_for_buffer_free(d, buf);
/* ts A80412 */ /* ts A80412 */
if(d->do_stream_recording > 0) { if(d->do_stream_recording > 0 && start >= d->stream_recording_start) {
/* >>> ??? is WRITE12 available ? */ /* >>> ??? is WRITE12 available ? */
/* >>> ??? inquire feature 107h Stream Writing bit ? */ /* >>> ??? inquire feature 107h Stream Writing bit ? */

View File

@ -385,7 +385,7 @@ void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force)
void burn_write_opts_set_stream_recording(struct burn_write_opts *opts, void burn_write_opts_set_stream_recording(struct burn_write_opts *opts,
int value) int value)
{ {
opts->do_stream_recording = !!value; opts->do_stream_recording = value;
} }

View File

@ -205,6 +205,11 @@ struct burn_drive
with BD-RE */ with BD-RE */
int do_stream_recording; int do_stream_recording;
/* ts A90227 : the LBA where stream recording shall start.
Writing to lower LBA will be done without streaming.
*/
int stream_recording_start;
/* ts A61218 from 51h READ DISC INFORMATION */ /* ts A61218 from 51h READ DISC INFORMATION */
int bg_format_status; /* 0=needs format start, 1=needs format restart*/ int bg_format_status; /* 0=needs format start, 1=needs format restart*/

View File

@ -2106,8 +2106,12 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
/* ts A61224 */ /* ts A61224 */
burn_disc_init_write_status(o, disc); /* must be done very early */ burn_disc_init_write_status(o, disc); /* must be done very early */
/* ts A80412 */ /* ts A80412 , A90227 */
d->do_stream_recording = o->do_stream_recording; d->do_stream_recording = !!o->do_stream_recording;
if (o->do_stream_recording >= 16)
d->stream_recording_start = o->do_stream_recording;
else
d->stream_recording_start = 0;
d->buffer = &buf; d->buffer = &buf;
memset(d->buffer, 0, sizeof(struct buffer)); memset(d->buffer, 0, sizeof(struct buffer));