INCOMPATIBLE API CHANGE: isoburn_prepare_new_image() now gets output drive

This commit is contained in:
Thomas Schmitt 2008-01-26 17:12:47 +00:00
parent 10f46f4536
commit 76ed06fe60
5 changed files with 48 additions and 9 deletions

View File

@ -475,12 +475,12 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
ret= isoburn_find_emulator(&o, d, 0); ret= isoburn_find_emulator(&o, d, 0);
if(ret<0) if(ret<0)
return(-1); return(-1);
if(o==NULL)
return(0);
#ifdef Libisoburn_no_fifO #ifdef Libisoburn_no_fifO
if(o==NULL)
return(-1);
if(o->iso_source==NULL) if(o->iso_source==NULL)
return(0); return(-1);
ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes); ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes);
if(hsize > 1024*1024*1024) if(hsize > 1024*1024*1024)
*size= 1024*1024*1024; *size= 1024*1024*1024;
@ -491,12 +491,16 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
else else
*free_bytes= hfree_bytes; *free_bytes= hfree_bytes;
*status_text= ""; *status_text= "";
if(ret==1) if(ret==0)
*status_text= "standby";
else if(ret==1)
*status_text= "active"; *status_text= "active";
else if(ret==2) else if(ret==2)
*status_text= "ending"; *status_text= "ending";
else if(ret==3) else if(ret==3)
*status_text= "failing"; *status_text= "failing";
else if(ret==4)
*status_text= "unused";
else if(ret==5) else if(ret==5)
*status_text= "abandoned"; *status_text= "abandoned";
else if(ret==6) else if(ret==6)
@ -504,6 +508,8 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
else if(ret==7) else if(ret==7)
*status_text= "aborted"; *status_text= "aborted";
#else #else
if(o==NULL)
return(0);
if(o->fifo==NULL) if(o->fifo==NULL)
return(0); return(0);
ret= burn_fifo_inquire_status(o->fifo, size, free_bytes, status_text); ret= burn_fifo_inquire_status(o->fifo, size, free_bytes, status_text);

View File

@ -379,9 +379,33 @@ int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc,
} }
int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc, int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
struct isoburn_source_opts *opts) struct isoburn_source_opts *opts,
struct burn_drive *out_drive)
{ {
return isoburn_prepare_disc_aux(d, disc, opts, 1); int ret;
struct isoburn *in_o, *out_o;
ret= isoburn_prepare_disc_aux(d, disc, opts, 1);
if (ret<=0)
return ret;
#ifdef Libisoburn_no_fifO
/* Hand over source reference for optional fifo status inquiry */
if(out_drive==NULL)
return 1;
ret= isoburn_find_emulator(&out_o, out_drive, 0);
if(ret<0 || out_o==NULL)
return 1;
ret= isoburn_find_emulator(&in_o, d, 0);
if(ret<0 || in_o==NULL)
return 1; /* then without fifo status inquiry */
if(out_o->iso_source!=NULL)
burn_source_free(out_o->iso_source);
out_o->iso_source= in_o->iso_source;
in_o->iso_source= NULL;
#endif /* Libisoburn_no_fifO */
return 1;
} }

View File

@ -356,10 +356,16 @@ int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc,
burn_disc_write(). burn_disc_write().
@param d The source drive, grabbed with isoburn_drive_scan_and_grab(). @param d The source drive, grabbed with isoburn_drive_scan_and_grab().
@param disc Returns the newly created burn_disc object. @param disc Returns the newly created burn_disc object.
@param opts Options for image generation and data transport to media
@param out_drive The libburn drive which shall be write target.
Submit libisoburn drives to later get access to libisofs
source fifo via isoburn_get_fifo_status().
If that is not desired, then out_drive may be NULL.
@return <=0 error , 1 = success @return <=0 error , 1 = success
*/ */
int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc, int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
struct isoburn_source_opts *opts); struct isoburn_source_opts *opts,
struct burn_drive *out_drive);
/** Start writing of the new session. /** Start writing of the new session.
This call is asynchrounous. I.e. it returns quite soon and the progress has This call is asynchrounous. I.e. it returns quite soon and the progress has
@ -373,6 +379,9 @@ void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
/** Inquire state and fill parameters of the fifo which is attached to /** Inquire state and fill parameters of the fifo which is attached to
the emerging track. This should be done in the pacifier loop while the emerging track. This should be done in the pacifier loop while
isoburn_disc_write() or burn_disc_write() are active. isoburn_disc_write() or burn_disc_write() are active.
This works only with drives obtained by isoburn_drive_scan_and_grab()
or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then
parameter out_drive must have announced the track output drive.
Hint: If only burn_write_opts and not burn_drive is known, then the drive Hint: If only burn_write_opts and not burn_drive is known, then the drive
can be obtained by burn_write_opts_get_drive(). can be obtained by burn_write_opts_get_drive().
@parm d The drive to which the track with the fifo gets burned. @parm d The drive to which the track with the fifo gets burned.

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.01.26.142130" #define Xorriso_timestamP "2008.01.26.171156"

View File

@ -581,7 +581,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
"on attempt to get source for write", 0); "on attempt to get source for write", 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
ret= isoburn_prepare_new_image(source_drive, &disc, &sopts); ret= isoburn_prepare_new_image(source_drive, &disc, &sopts, drive);
} }
if (ret <= 0) { if (ret <= 0) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);