New struct burn_progress_v2 and API call burn_drive_get_status_v2()

This commit is contained in:
2024-03-01 19:51:34 +01:00
parent 17a020e9fc
commit d48bbb4b66
10 changed files with 143 additions and 29 deletions

View File

@ -680,7 +680,8 @@ struct burn_drive_info
/** Operation progress report. All values are 0 based indices.
* */
Handed out by burn_drive_get_status().
**/
struct burn_progress {
/** The total number of sessions */
int sessions;
@ -722,6 +723,52 @@ struct burn_progress {
};
/** Operation progress report with long block numbers.
All values are 0 based indices.
Handed out by burn_drive_get_status_v2().
@since 1.5.8
**/
struct burn_progress_v2 {
/** Revision of the struct format.
0= Elements up to .buffer_min_fill */
int revision;
/** The total number of sessions */
int sessions;
/** Current session.*/
int session;
/** The total number of tracks */
int tracks;
/** Current track. */
int track;
/** The total number of indices */
int indices;
/** Current index. */
int index;
/** The starting logical block address */
off_t start_sector;
/** On write: The number of sectors.
On blank: 0x10000 as upper limit for relative progress steps */
off_t sectors;
/** On write: The current sector being processed.
On blank: Relative progress steps 0 to 0x10000 */
off_t sector;
/** The capacity of the drive buffer */
off_t buffer_capacity;
/** The free space in the drive buffer (might be slightly outdated) */
off_t buffer_available;
/** The number of bytes sent to the drive buffer */
off_t buffered_bytes;
/** The minimum number of bytes stored in buffer during write.
(Caution: Before surely one buffer size of bytes was processed,
this value is 0xffffffffffffffff.)
*/
off_t buffer_min_fill;
};
/* ts A61226 */
/* @since 0.3.0 */
/** Description of a speed capability as reported by the drive in conjunction
@ -1667,6 +1714,15 @@ int burn_disc_erasable(struct burn_drive *d);
enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
struct burn_progress *p);
/** Returns the progress with long block numbers and the status of the drive.
@param drive The drive to query busy state for.
@param p Returns the progress of the operation, NULL if you don't care
@return the current status of the drive. See also burn_drive_status.
@since 1.5.8
*/
enum burn_drive_status burn_drive_get_status_v2(struct burn_drive *drive,
struct burn_progress_v2 *p);
/** Creates a write_opts struct for burning to the specified drive.
The returned object must later be freed with burn_write_opts_free().
@param drive The drive to write with