libburn 1.5.4
Data Structures | Macros | Typedefs | Enumerations | Functions
libburn.h File Reference
#include <sys/types.h>
#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  burn_toc_entry
 Information about a track on a disc - this is from the q sub channel of the lead-in area of a disc. More...
 
struct  burn_source
 Data source interface for tracks. More...
 
struct  burn_drive_info
 Information on a drive in the system. More...
 
struct  burn_progress
 Operation progress report. More...
 
struct  burn_speed_descriptor
 Description of a speed capability as reported by the drive in conjunction with eventually loaded media. More...
 
struct  burn_multi_caps
 The reply structure for burn_disc_get_multi_caps() More...
 

Macros

#define BURN_CDROM   0
 Session format for normal audio or data discs. More...
 
#define BURN_CDI   0x10
 Session format for obsolete CD-I discs. More...
 
#define BURN_CDXA   0x20
 Session format for CDROM-XA discs. More...
 
#define BURN_POS_END   100
 
#define BURN_MODE_BITS   127
 Mask for mode bits. More...
 
#define BURN_MODE0   (1 << 0)
 Track mode - mode 0 data 0 bytes of user data. More...
 
#define BURN_MODE_RAW   (1 << 1)
 Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY! More...
 
#define BURN_MODE1   (1 << 2)
 Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy. More...
 
#define BURN_MODE2   (1 << 3)
 Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required. More...
 
#define BURN_FORM1   (1 << 4)
 Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader. More...
 
#define BURN_FORM2   (1 << 5)
 Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data. More...
 
#define BURN_AUDIO   (1 << 6)
 Track mode - audio 2352 bytes per sector. More...
 
#define BURN_4CH   (1 << 7)
 Track mode modifier - 4 channel audio. More...
 
#define BURN_COPY   (1 << 8)
 Track mode modifier - Digital copy permitted, can be set on any track. More...
 
#define BURN_PREEMPHASIS   (1 << 9)
 Track mode modifier - 50/15uS pre-emphasis. More...
 
#define BURN_SUBCODE_P16   (1 << 10)
 Input mode modifier - subcodes present packed 16. More...
 
#define BURN_SUBCODE_P96   (1 << 11)
 Input mode modifier - subcodes present packed 96. More...
 
#define BURN_SUBCODE_R96   (1 << 12)
 Input mode modifier - subcodes present raw 96. More...
 
#define BURN_SCMS   (1 << 13)
 Track mode modifier - Serial Copy Management System, SAO only If this is set and BURN_COPY is not set, then copying the emerging track will be forbidden. More...
 
#define BURN_DRIVE_WHITELIST_LEN   255
 Maximum number of particularly permissible drive addresses. More...
 
#define BURN_DRIVE_ADR_LEN   1024
 Maximum length+1 to expect with a drive device file address string. More...
 
#define BURN_FORMAT_IS_UNFORMATTED   1
 Possible formatting status values. More...
 
#define BURN_FORMAT_IS_FORMATTED   2
 
#define BURN_FORMAT_IS_UNKNOWN   3
 
#define BURN_REASONS_LEN   4096
 The length of a rejection reasons string for burn_precheck_write() and burn_write_opts_auto_write_type() . More...
 
#define BURN_CDTEXT_LANGUAGES_0X00
 This is the first list of languages sorted by their Language codes, which start at 0x00. More...
 
#define BURN_CDTEXT_LANGUAGES_0X45
 This is the second list of languages sorted by their Language codes, which start at 0x45. More...
 
#define BURN_CDTEXT_FILLER
 
#define BURN_CDTEXT_GENRE_LIST
 This is the list of Genres sorted by their Genre codes. More...
 
#define BURN_CDTEXT_NUM_GENRES   28
 
#define burn_header_version_major   1
 These three release version numbers tell the revision of this header file and of the API it describes. More...
 
#define burn_header_version_minor   5
 
#define burn_header_version_micro   4
 
#define BURN_MSGS_MESSAGE_LEN   4096
 
#define LIBDAX_AUDIOXTR_STRLEN   4096
 
#define Libburn_dummy_probe_write_modeS   1
 
#define Libburn_disc_with_incomplete_sessioN   1
 

Typedefs

typedef int(* burn_abort_handler_t) (void *handle, int signum, int flag)
 The prototype of a handler function suitable for burn_set_signal_handling() Such a function has to return -2 if it does not want the process to exit with value 1. More...
 

Enumerations

enum  burn_write_types {
  BURN_WRITE_PACKET , BURN_WRITE_TAO , BURN_WRITE_SAO , BURN_WRITE_RAW ,
  BURN_WRITE_NONE
}
 Possible disc writing style/modes. More...
 
enum  burn_block_types {
  BURN_BLOCK_RAW0 = 1 , BURN_BLOCK_RAW16 = 2 , BURN_BLOCK_RAW96P = 4 , BURN_BLOCK_RAW96R = 8 ,
  BURN_BLOCK_MODE1 = 256 , BURN_BLOCK_MODE2R = 512 , BURN_BLOCK_MODE2_PATHETIC = 1024 , BURN_BLOCK_MODE2_LAME = 2048 ,
  BURN_BLOCK_MODE2_OBSCURE = 4096 , BURN_BLOCK_MODE2_OK = 8192 , BURN_BLOCK_SAO = 16384
}
 Data format to send to the drive. More...
 
enum  burn_disc_status {
  BURN_DISC_UNREADY , BURN_DISC_BLANK , BURN_DISC_EMPTY , BURN_DISC_APPENDABLE ,
  BURN_DISC_FULL , BURN_DISC_UNGRABBED , BURN_DISC_UNSUITABLE
}
 Possible status of the drive in regard to the disc in it. More...
 
enum  burn_source_status { BURN_SOURCE_OK , BURN_SOURCE_EOF , BURN_SOURCE_FAILED }
 Possible data source return values. More...
 
enum  burn_drive_status {
  BURN_DRIVE_IDLE , BURN_DRIVE_SPAWNING , BURN_DRIVE_READING , BURN_DRIVE_WRITING ,
  BURN_DRIVE_WRITING_LEADIN , BURN_DRIVE_WRITING_LEADOUT , BURN_DRIVE_ERASING , BURN_DRIVE_GRABBING ,
  BURN_DRIVE_WRITING_PREGAP , BURN_DRIVE_CLOSING_TRACK , BURN_DRIVE_CLOSING_SESSION , BURN_DRIVE_FORMATTING ,
  BURN_DRIVE_READING_SYNC , BURN_DRIVE_WRITING_SYNC
}
 Possible busy states for a drive. More...
 

Functions

int burn_initialize (void)
 Initialize the library. More...
 
void burn_finish (void)
 Shutdown the library. More...
 
int burn_abort (int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle)
 Abort any running drive operation and eventually call burn_finish(). More...
 
int burn_abort_pacifier (void *handle, int patience, int elapsed)
 A pacifier function suitable for burn_abort. More...
 
void burn_set_verbosity (int level)
 ts A61006 : This is for development only. More...
 
void burn_set_scsi_logging (int flag)
 Enable or disable logging of SCSI commands. More...
 
void burn_preset_device_open (int exclusive, int blocking, int abort_on_busy)
 Set parameters for behavior on opening device files. More...
 
void burn_allow_untested_profiles (int yes)
 Allows the use of media types which are implemented in libburn but not yet tested. More...
 
int burn_drive_scan_and_grab (struct burn_drive_info *drive_infos[], char *adr, int load)
 Acquire a drive with known device file address. More...
 
int burn_drive_add_whitelist (char *device_address)
 Add a device to the list of permissible drives. More...
 
void burn_drive_clear_whitelist (void)
 Remove all drives from whitelist. More...
 
int burn_drive_scan (struct burn_drive_info *drive_infos[], unsigned int *n_drives)
 Scan for drives. More...
 
int burn_drive_info_forget (struct burn_drive_info *drive_info, int force)
 Release memory about a single drive and any exclusive lock on it. More...
 
void burn_drive_info_free (struct burn_drive_info drive_infos[])
 When no longer needed, free a whole burn_drive_info array which was returned by burn_drive_scan(). More...
 
int burn_drive_d_get_adr (struct burn_drive *drive, char adr[])
 Inquire the device file address of the given drive. More...
 
int burn_drive_get_adr (struct burn_drive_info *drive_info, char adr[])
 Inquire the device file address of a drive via a given drive_info object. More...
 
int burn_drive_is_enumerable_adr (char *adr)
 Evaluate whether the given address would be a drive device file address which could be listed by a run of burn_drive_scan(). More...
 
int burn_drive_convert_fs_adr (char *path, char adr[])
 Try to convert a given existing filesystem address into a drive device file address. More...
 
int burn_drive_convert_scsi_adr (int bus_no, int host_no, int channel_no, int target_no, int lun_no, char adr[])
 Try to convert a given SCSI address of bus,host,channel,target,lun into a drive device file address. More...
 
int burn_lookup_device_link (char *dev_adr, char link_adr[], char *dir_adr, char **templ, int num_templ, int flag)
 Try to convert a given drive device file address into the address of a symbolic link that points to this drive address. More...
 
int burn_drive_obtain_scsi_adr (char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
 Try to obtain bus,host,channel,target,lun from path. More...
 
int burn_drive_grab (struct burn_drive *drive, int load)
 Grab a drive. More...
 
int burn_drive_probe_cd_write_modes (struct burn_drive_info *drive_info)
 
int burn_drive_snooze (struct burn_drive *d, int flag)
 Calm down or alert a drive. More...
 
int burn_drive_re_assess (struct burn_drive *d, int flag)
 Re-assess drive and media status. More...
 
void burn_drive_release (struct burn_drive *drive, int eject)
 Release a drive. More...
 
int burn_drive_leave_locked (struct burn_drive *d, int flag)
 Like burn_drive_release() but keeping the drive tray closed and its eject button disabled. More...
 
enum burn_disc_status burn_disc_get_status (struct burn_drive *drive)
 Returns what kind of disc a drive is holding. More...
 
int burn_disc_pretend_blank (struct burn_drive *drive)
 WARNING: This revives an old bug-like behavior that might be dangerous. More...
 
int burn_disc_pretend_full (struct burn_drive *drive)
 WARNING: This overrides the safety measures against unsuitable media. More...
 
int burn_disc_pretend_full_uncond (struct burn_drive *drive)
 WARNING: This overrides the safety measures against unsuitable media. More...
 
int burn_drive_get_serial_no (struct burn_drive *d, char **sno, int *sno_len)
 Returns the Drive Serial Number as of MMC feature 108h. More...
 
int burn_drive_get_media_sno (struct burn_drive *d, char **sno, int *sno_len)
 Returns the Media Serial Number as of MMC feature 109h and command ABh READ MEDIA SERIAL NUMBER. More...
 
int burn_disc_read_atip (struct burn_drive *drive)
 Reads ATIP information from inserted media. More...
 
int burn_drive_get_bd_r_pow (struct burn_drive *drive)
 Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in the drive. More...
 
int burn_drive_get_start_end_lba (struct burn_drive *drive, int *start_lba, int *end_lba, int flag)
 Returns start and end lba of the media which is currently inserted in the given drive. More...
 
char * burn_guess_cd_manufacturer (int m_li, int s_li, int f_li, int m_lo, int s_lo, int f_lo, int flag)
 Guess the manufacturer name of CD media from the ATIP addresses of lead-in and lead-out. More...
 
int burn_disc_get_cd_info (struct burn_drive *d, char disc_type[80], unsigned int *disc_id, char bar_code[9], int *app_code, int *valid)
 Retrieve some media information which is mainly specific to CD. More...
 
int burn_disc_get_leadin_text (struct burn_drive *d, unsigned char **text_packs, int *num_packs, int flag)
 Read the array of CD-TEXT packs from the Lead-in of an audio CD. More...
 
int burn_disc_get_bd_spare_info (struct burn_drive *d, int *alloc_blocks, int *free_blocks, int flag)
 Read the current usage of the eventual BD Spare Area. More...
 
int burn_disc_get_phys_format_info (struct burn_drive *d, int *disk_category, char **book_name, int *part_version, int *num_layers, int *num_blocks, int flag)
 Retrieve some media information which is mainly specific to media of the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R Currently the information cannot be retrieved from other media types. More...
 
int burn_disc_track_lba_nwa (struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa)
 Read start lba and Next Writeable Address of a track from media. More...
 
int burn_disc_next_track_is_damaged (struct burn_drive *d, int flag)
 Tells whether a previous attempt to determine the Next Writeable Address of the upcoming track reveiled that the READ TRACK INFORMATION Damage Bit is set for this track and that no valid writable address is available. More...
 
int burn_disc_close_damaged (struct burn_write_opts *o, int flag)
 Try to close the last track and session of media which have bit0 set in the return value of call burn_disc_next_track_is_damaged(). More...
 
int burn_disc_get_msc1 (struct burn_drive *d, int *start_lba)
 Read start lba of the first track in the last complete session. More...
 
off_t burn_disc_available_space (struct burn_drive *d, struct burn_write_opts *o)
 Return the best possible estimation of the currently available capacity of the media. More...
 
int burn_disc_get_profile (struct burn_drive *d, int *pno, char name[80])
 Tells the MMC Profile identifier of the loaded media. More...
 
int burn_disc_get_media_id (struct burn_drive *d, char **product_id, char **media_code1, char **media_code2, char **book_type, int flag)
 Obtain product id and standards defined media codes. More...
 
char * burn_guess_manufacturer (int profile_no, char *manuf_code, char *media_code, int flag)
 Guess the name of a manufacturer by profile number, manufacturer code and media code. More...
 
int burn_disc_erasable (struct burn_drive *d)
 Tells whether a disc can be erased or not. More...
 
enum burn_drive_status burn_drive_get_status (struct burn_drive *drive, struct burn_progress *p)
 Returns the progress and status of a drive. More...
 
struct burn_write_opts * burn_write_opts_new (struct burn_drive *drive)
 Creates a write_opts struct for burning to the specified drive. More...
 
struct burn_drive * burn_write_opts_get_drive (struct burn_write_opts *opts)
 Inquires the drive associated with a burn_write_opts object. More...
 
void burn_write_opts_free (struct burn_write_opts *opts)
 Frees a write_opts struct created with burn_write_opts_new. More...
 
struct burn_read_opts * burn_read_opts_new (struct burn_drive *drive)
 Creates a read_opts struct for reading from the specified drive must be freed with burn_read_opts_free. More...
 
void burn_read_opts_free (struct burn_read_opts *opts)
 Frees a read_opts struct created with burn_read_opts_new. More...
 
void burn_disc_erase (struct burn_drive *drive, int fast)
 Erase a disc in the drive. More...
 
void burn_disc_format (struct burn_drive *drive, off_t size, int flag)
 Format media for use with libburn. More...
 
int burn_disc_get_formats (struct burn_drive *drive, int *status, off_t *size, unsigned *bl_sas, int *num_formats)
 Inquire the formatting status, the associated sizes and the number of available formats. More...
 
int burn_disc_get_format_descr (struct burn_drive *drive, int index, int *type, off_t *size, unsigned *tdp)
 Inquire parameters of an available media format. More...
 
void burn_disc_read (struct burn_drive *drive, const struct burn_read_opts *o)
 Read a disc from the drive and write it to an fd pair. More...
 
int burn_precheck_write (struct burn_write_opts *o, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int silent)
 Examines a completed setup for burn_disc_write() whether it is permissible with drive and media. More...
 
void burn_disc_write (struct burn_write_opts *o, struct burn_disc *disc)
 Write a disc in the drive. More...
 
int burn_drive_set_stream_recording (struct burn_drive *drive, int recmode, int start, int flag)
 Control stream recording during the write run and eventually set the start LBA for stream recording. More...
 
int burn_drive_set_immed (struct burn_drive *drive, int enable)
 Enable or disable use of the Immed bit with long running SCSI commands. More...
 
int burn_drive_get_immed (struct burn_drive *drive)
 Inquire the current setting of usage of the Immed bit. More...
 
void burn_drive_cancel (struct burn_drive *drive)
 Cancel an operation on a drive. More...
 
int burn_drive_wrote_well (struct burn_drive *d)
 Inquire whether the most recent asynchronous media job was successful. More...
 
int burn_drive_was_feat21_failure (struct burn_drive *d)
 Inquire whether a write error occurred which is suspected to have happened due to a false report about DVD-RW capability to be written in write type BURN_WRITE_TAO. More...
 
int burn_msf_to_sectors (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to sector count. More...
 
void burn_sectors_to_msf (int sectors, int *m, int *s, int *f)
 Convert a sector count to minute-second-frame (MSF) More...
 
int burn_msf_to_lba (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to an lba. More...
 
void burn_lba_to_msf (int lba, int *m, int *s, int *f)
 Convert an lba to minute-second-frame (MSF) More...
 
struct burn_disc * burn_disc_create (void)
 Create a new disc. More...
 
void burn_disc_free (struct burn_disc *d)
 Delete disc and decrease the reference count on all its sessions. More...
 
struct burn_session * burn_session_create (void)
 Create a new session. More...
 
void burn_session_free (struct burn_session *s)
 Free a session (and decrease reference count on all tracks inside) More...
 
int burn_disc_add_session (struct burn_disc *d, struct burn_session *s, unsigned int pos)
 Add a session to a disc at a specific position, increasing the sessions's reference count. More...
 
int burn_disc_remove_session (struct burn_disc *d, struct burn_session *s)
 Remove a session from a disc. More...
 
int burn_session_by_cue_file (struct burn_session *session, char *path, int fifo_size, struct burn_source **fifo, unsigned char **text_packs, int *num_packs, int flag)
 Read a CDRWIN cue sheet file and equip the session object by tracks and CD-TEXT according to the content of the file. More...
 
struct burn_track * burn_track_create (void)
 Create a track. More...
 
void burn_track_free (struct burn_track *t)
 Free a track. More...
 
int burn_session_add_track (struct burn_session *s, struct burn_track *t, unsigned int pos)
 Add a track to a session at specified position. More...
 
int burn_session_remove_track (struct burn_session *s, struct burn_track *t)
 Remove a track from a session. More...
 
int burn_session_set_start_tno (struct burn_session *session, int tno, int flag)
 Set the number which shall be written as CD track number with the first track of the session. More...
 
int burn_session_get_start_tno (struct burn_session *session, int flag)
 Inquire the CD track start number, as set by default or by burn_session_set_start_tno(). More...
 
int burn_session_set_cdtext_par (struct burn_session *s, int char_codes[8], int copyrights[8], int languages[8], int flag)
 Set the Character Codes, the Copyright bytes, and the Language Codes for CD-TEXT blocks 0 to 7. More...
 
int burn_session_get_cdtext_par (struct burn_session *s, int char_codes[8], int copyrights[8], int block_languages[8], int flag)
 Obtain the current settings as of burn_session_set_cdtext_par() More...
 
int burn_session_set_cdtext (struct burn_session *s, int block, int pack_type, char *pack_type_name, unsigned char *payload, int length, int flag)
 Attach text or binary data as CD-TEXT attributes to a session. More...
 
int burn_session_get_cdtext (struct burn_session *s, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag)
 Obtain a CD-TEXT attribute that was set by burn_session_set_cdtext() More...
 
int burn_session_input_sheet_v07t (struct burn_session *session, char *path, int block, int flag)
 Read a Sony CD-TEXT Input Sheet Version 0.7T file and attach its text attributes to the given session and its tracks for the given CD-TEXT block number. More...
 
int burn_cdtext_from_session (struct burn_session *s, unsigned char **text_packs, int *num_packs, int flag)
 Produce an array of CD-TEXT packs that could be submitted to burn_write_opts_set_leadin_text(), or stored as *.cdt file, or submitted to burn_make_input_sheet_v07t(). More...
 
int burn_make_input_sheet_v07t (unsigned char *text_packs, int num_packs, int start_tno, int track_count, char **result, int *char_code, int flag)
 Convert an array of CD-TEXT packs into the text format of Sony CD-TEXT Input Sheet Version 0.7T . More...
 
int burn_session_dispose_cdtext (struct burn_session *s, int block)
 Remove all CD-TEXT attributes of the given block from the session. More...
 
int burn_cdtext_from_packfile (char *path, unsigned char **text_packs, int *num_packs, int flag)
 Read an array of CD-TEXT packs from a file. More...
 
void burn_track_define_data (struct burn_track *t, int offset, int tail, int pad, int mode)
 Define the data in a track. More...
 
int burn_track_set_cdtext (struct burn_track *t, int block, int pack_type, char *pack_type_name, unsigned char *payload, int length, int flag)
 Attach text or binary data as CD-TEXT attributes to a track. More...
 
int burn_track_get_cdtext (struct burn_track *t, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag)
 Obtain a CD-TEXT attribute that was set by burn_track_set_cdtext(). More...
 
int burn_track_dispose_cdtext (struct burn_track *t, int block)
 Remove all CD-TEXT attributes of the given block from the track. More...
 
int burn_track_set_cdxa_conv (struct burn_track *t, int value)
 Activates CD XA compatibility modes. More...
 
void burn_track_set_isrc (struct burn_track *t, char *country, char *owner, unsigned char year, unsigned int serial)
 Set the ISRC details for a track. More...
 
int burn_track_set_isrc_string (struct burn_track *t, char isrc[13], int flag)
 Set the composed ISRC string for a track. More...
 
void burn_track_clear_isrc (struct burn_track *t)
 Disable ISRC parameters for a track. More...
 
int burn_track_set_index (struct burn_track *t, int index_number, unsigned int relative_lba, int flag)
 Define an index start address within a track. More...
 
int burn_track_clear_indice (struct burn_track *t, int flag)
 Remove all index start addresses and reset to the default indexing of CD SAO sessions. More...
 
int burn_track_set_pregap_size (struct burn_track *t, int size, int flag)
 Define whether a pre-gap shall be written before the track and how many sectors this pre-gap shall have. More...
 
int burn_track_set_postgap_size (struct burn_track *t, int size, int flag)
 Define whether a post-gap shall be written at the end of the track and how many sectors this gap shall have. More...
 
int burn_track_set_byte_swap (struct burn_track *t, int swap_source_bytes)
 Define whether a track shall swap bytes of its input stream. More...
 
void burn_session_hide_first_track (struct burn_session *s, int onoff)
 Hide the first track in the "pre gap" of the disc. More...
 
struct burn_disc * burn_drive_get_disc (struct burn_drive *d)
 Get the drive's disc struct - free when done. More...
 
enum burn_source_status burn_track_set_source (struct burn_track *t, struct burn_source *s)
 Set the track's data source. More...
 
int burn_track_set_default_size (struct burn_track *t, off_t size)
 Set a default track size to be used only if the track turns out to be of unpredictable length and if the effective write type demands a fixed size. More...
 
void burn_source_free (struct burn_source *s)
 Free a burn_source (decrease its refcount and maybe free it) More...
 
struct burn_sourceburn_file_source_new (const char *path, const char *subpath)
 Creates a data source for an image file (and maybe subcode file) More...
 
int burn_os_open_track_src (char *path, int open_flags, int flag)
 Opens a file with eventual acceleration preparations which may depend on the operating system and on compile time options of libburn. More...
 
void * burn_os_alloc_buffer (size_t amount, int flag)
 Allocate a memory area that is suitable for reading with a file descriptor opened by burn_os_open_track_src(). More...
 
int burn_os_free_buffer (void *buffer, size_t amount, int flag)
 Dispose a memory area which was obtained by burn_os_alloc_buffer(),. More...
 
struct burn_sourceburn_fd_source_new (int datafd, int subfd, off_t size)
 Creates a data source for an image file (a track) from an open readable filedescriptor, an eventually open readable subcodes file descriptor and eventually a fixed size in bytes. More...
 
struct burn_sourceburn_offst_source_new (struct burn_source *inp, struct burn_source *prev, off_t start, off_t size, int flag)
 Creates an offset source which shall provide a byte interval of a stream to its consumer. More...
 
struct burn_sourceburn_fifo_source_new (struct burn_source *inp, int chunksize, int chunks, int flag)
 Creates a fifo which acts as proxy for an already existing data source. More...
 
int burn_fifo_inquire_status (struct burn_source *fifo, int *size, int *free_bytes, char **status_text)
 Inquires state and fill parameters of a fifo burn_source which was created by burn_fifo_source_new() . More...
 
void burn_fifo_get_statistics (struct burn_source *fifo, int *total_min_fill, int *interval_min_fill, int *put_counter, int *get_counter, int *empty_counter, int *full_counter)
 Inquire various counters which reflect the fifo operation. More...
 
void burn_fifo_next_interval (struct burn_source *fifo, int *interval_min_fill)
 Inquire the fifo minimum fill counter for intervals and reset that counter. More...
 
int burn_fifo_peek_data (struct burn_source *fifo, char *buf, int bufsize, int flag)
 Obtain a preview of the first input data of a fifo which was created by burn_fifo_source_new(). More...
 
int burn_fifo_fill (struct burn_source *fifo, int fill, int flag)
 Start the fifo worker thread and wait either until the requested number of bytes have arrived or until it becomes clear that this will not happen. More...
 
int burn_track_set_size (struct burn_track *t, off_t size)
 Sets a fixed track size after the data source object has already been created. More...
 
int burn_track_get_sectors (struct burn_track *)
 Tells how many sectors a track will have on disc, or already has on disc. More...
 
int burn_track_get_counters (struct burn_track *t, off_t *read_bytes, off_t *written_bytes)
 Tells how many source bytes have been read and how many data bytes have been written by the track during burn. More...
 
void burn_drive_set_speed (struct burn_drive *d, int read, int write)
 Sets drive read and write speed. More...
 
int burn_drive_set_speed_exact (struct burn_drive *d, int read, int write)
 Sets drive read and write speed using the "Exact" bit of SCSI command SET STREAMING. More...
 
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)
 Waits until the time has elapsed since the given previous time to transmit the given byte count with the given speed in KB/second (KB = 1000 bytes). More...
 
int burn_drive_set_buffer_waiting (struct burn_drive *d, int enable, int min_usec, int max_usec, int timeout_sec, int min_percent, int max_percent)
 Controls the behavior with writing when the drive buffer is suspected to be full. More...
 
int burn_drive_reset_simulate (struct burn_drive *d, int simulate)
 Control the write simulation mode before or after burn_write_opts get into effect. More...
 
void burn_structure_print_disc (struct burn_disc *d)
 
void burn_structure_print_session (struct burn_session *s)
 
void burn_structure_print_track (struct burn_track *t)
 
int burn_write_opts_set_write_type (struct burn_write_opts *opts, enum burn_write_types write_type, int block_type)
 Sets the write type for the write_opts struct. More...
 
enum burn_write_types burn_write_opts_auto_write_type (struct burn_write_opts *opts, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int flag)
 As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write type and block type for a given write job described by opts and disc. More...
 
void burn_write_opts_set_toc_entries (struct burn_write_opts *opts, int count, struct burn_toc_entry *toc_entries)
 Supplies toc entries for writing - not normally required for cd mastering. More...
 
void burn_write_opts_set_format (struct burn_write_opts *opts, int format)
 Sets the session format for a disc. More...
 
int burn_write_opts_set_simulate (struct burn_write_opts *opts, int sim)
 Sets the simulate value for the write_opts struct . More...
 
int burn_write_opts_set_underrun_proof (struct burn_write_opts *opts, int underrun_proof)
 Controls buffer underrun prevention. More...
 
void burn_write_opts_set_perform_opc (struct burn_write_opts *opts, int opc)
 Sets whether to use opc or not with the write_opts struct. More...
 
void burn_write_opts_set_mediacatalog (struct burn_write_opts *opts, unsigned char mediacatalog[13])
 The Q sub-channel of a CD may contain a Media Catalog Number of 13 decimal digits. More...
 
void burn_write_opts_set_has_mediacatalog (struct burn_write_opts *opts, int has_mediacatalog)
 This call activates the Media Catalog Number for writing. More...
 
void burn_write_opts_set_multi (struct burn_write_opts *opts, int multi)
 Sets the multi flag which eventually marks the emerging session as not being the last one and thus creating a BURN_DISC_APPENDABLE media. More...
 
void burn_write_opts_set_fail21h_sev (struct burn_write_opts *opts, char *severity)
 Set the severity to be used with write error messages which are potentially caused by not using write type BURN_WRITE_SAO on fast blanked DVD-RW. More...
 
int burn_write_opts_set_leadin_text (struct burn_write_opts *opts, unsigned char *text_packs, int num_packs, int flag)
 Submit an array of CD-TEXT packs which shall be written to the Lead-in of a SAO write run on CD. More...
 
void burn_write_opts_set_start_byte (struct burn_write_opts *opts, off_t value)
 Sets a start address for writing to media and write modes which are able to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW). More...
 
void burn_write_opts_set_fillup (struct burn_write_opts *opts, int fill_up_media)
 Caution: still immature and likely to change. More...
 
void burn_write_opts_set_force (struct burn_write_opts *opts, int use_force)
 Eventually makes libburn ignore the failure of some conformance checks: More...
 
void burn_write_opts_set_stream_recording (struct burn_write_opts *opts, int value)
 Eventually makes use of the more modern write command AAh WRITE12 and sets the Streaming bit. More...
 
void burn_write_opts_set_dvd_obs (struct burn_write_opts *opts, int obs)
 Overrides the write chunk size for DVD and BD media which is normally determined according to media type and setting of stream recording. More...
 
void burn_write_opts_set_obs_pad (struct burn_write_opts *opts, int pad)
 Overrides the automatic decision whether to pad up the last write chunk to its full size. More...
 
void burn_write_opts_set_stdio_fsync (struct burn_write_opts *opts, int rhythm)
 Sets the rhythm by which stdio pseudo drives force their output data to be consumed by the receiving storage device. More...
 
void burn_read_opts_set_raw (struct burn_read_opts *opts, int raw_mode)
 Sets whether to read in raw mode or not. More...
 
void burn_read_opts_set_c2errors (struct burn_read_opts *opts, int c2errors)
 Sets whether to report c2 errors or not. More...
 
void burn_read_opts_read_subcodes_audio (struct burn_read_opts *opts, int subcodes_audio)
 Sets whether to read subcodes from audio tracks or not. More...
 
void burn_read_opts_read_subcodes_data (struct burn_read_opts *opts, int subcodes_data)
 Sets whether to read subcodes from data tracks or not. More...
 
void burn_read_opts_set_hardware_error_recovery (struct burn_read_opts *opts, int hardware_error_recovery)
 Sets whether to recover errors if possible. More...
 
void burn_read_opts_report_recovered_errors (struct burn_read_opts *opts, int report_recovered_errors)
 Sets whether to report recovered errors or not. More...
 
void burn_read_opts_transfer_damaged_blocks (struct burn_read_opts *opts, int transfer_damaged_blocks)
 Sets whether blocks with unrecoverable errors should be read or not. More...
 
void burn_read_opts_set_hardware_error_retries (struct burn_read_opts *opts, unsigned char hardware_error_retries)
 Sets the number of retries to attempt when trying to correct an error. More...
 
int burn_drive_get_all_profiles (struct burn_drive *d, int *num_profiles, int profiles[64], char is_current[64])
 Gets the list of profile codes supported by the drive. More...
 
int burn_obtain_profile_name (int profile_code, char name[80])
 Obtains the profile name associated with a profile code. More...
 
void burn_drive_get_feature_codes (struct burn_drive *d, int *count, unsigned int **feature_codes)
 Obtains the list of SCSI Feature Codes from feature descriptors which were obtained from the drive when it was most recently acquired or re-assessed. More...
 
int burn_drive_get_feature (struct burn_drive *d, unsigned int feature_code, unsigned char *flags, unsigned char *additional_length, unsigned char **feature_data, char **feature_text)
 Obtains the fields and data of a particular feature which were obtained from the drive when it was last acquired or re-assessed. More...
 
int burn_drive_get_write_speed (struct burn_drive *d)
 Gets the maximum write speed for a drive and eventually loaded media. More...
 
int burn_drive_get_min_write_speed (struct burn_drive *d)
 Gets the minimum write speed for a drive and eventually loaded media. More...
 
int burn_drive_get_read_speed (struct burn_drive *d)
 Gets the maximum read speed for a drive. More...
 
int burn_drive_get_speedlist (struct burn_drive *d, struct burn_speed_descriptor **speed_list)
 Obtain a copy of the current speed descriptor list. More...
 
int burn_drive_get_best_speed (struct burn_drive *d, int speed_goal, struct burn_speed_descriptor **best_descr, int flag)
 Look up the fastest speed descriptor which is not faster than the given speed_goal. More...
 
int burn_drive_free_speedlist (struct burn_speed_descriptor **speed_list)
 Dispose a speed descriptor list copy which was obtained by burn_drive_get_speedlist(). More...
 
int burn_disc_get_multi_caps (struct burn_drive *d, enum burn_write_types wt, struct burn_multi_caps **caps, int flag)
 Allocates a struct burn_multi_caps (see above) and fills it with values which are appropriate for the drive and the loaded media. More...
 
int burn_disc_free_multi_caps (struct burn_multi_caps **caps)
 Removes from memory a multi session info structure which was returned by burn_disc_get_multi_caps(). More...
 
void burn_track_get_entry (struct burn_track *t, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a track. More...
 
void burn_session_get_leadout_entry (struct burn_session *s, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a session's lead out. More...
 
struct burn_session ** burn_disc_get_sessions (struct burn_disc *d, int *num)
 Gets an array of all complete sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION The result array contains *num + burn_disc_get_incomplete_sessions() elements. More...
 
int burn_disc_get_incomplete_sessions (struct burn_disc *d)
 Obtains the number of incomplete sessions which are recorded in the result array of burn_disc_get_sessions() after the complete sessions. More...
 
int burn_disc_get_sectors (struct burn_disc *d)
 
struct burn_track ** burn_session_get_tracks (struct burn_session *s, int *num)
 Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK. More...
 
int burn_session_get_sectors (struct burn_session *s)
 
int burn_track_get_mode (struct burn_track *track)
 Gets the mode of a track. More...
 
int burn_session_get_hidefirst (struct burn_session *session)
 Returns whether the first track of a session is hidden in the pregap. More...
 
void burn_version (int *major, int *minor, int *micro)
 Returns the library's version in its parts. More...
 
char * burn_scsi_transport_id (int flag)
 Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time. More...
 
int burn_msgs_set_severities (char *queue_severity, char *print_severity, char *print_id)
 Control queueing and stderr printing of messages from libburn. More...
 
int burn_msgs_obtain (char *minimum_severity, int *error_code, char msg_text[], int *os_errno, char severity[])
 Obtain the oldest pending libburn message from the queue which has at least the given minimum_severity. More...
 
int burn_msgs_submit (int error_code, char msg_text[], int os_errno, char severity[], struct burn_drive *d)
 Submit a message to the libburn queueing system. More...
 
int burn_text_to_sev (char *severity_name, int *severity_number, int flag)
 Convert a severity name into a severity number, which gives the severity rank of the name. More...
 
int burn_sev_to_text (int severity_number, char **severity_name, int flag)
 Convert a severity number into a severity name. More...
 
char * burn_list_sev_texts (int flag)
 Return a blank separated list of severity names. More...
 
int burn_set_messenger (void *messenger)
 Replace the messenger object handle of libburn by a compatible handle obtained from a related library. More...
 
void burn_set_signal_handling (void *handle, burn_abort_handler_t handler, int mode)
 Control built-in signal handling. More...
 
int burn_is_aborting (int flag)
 
int burn_random_access_write (struct burn_drive *d, off_t byte_address, char *data, off_t data_count, int flag)
 Write data in random access mode. More...
 
int burn_get_read_capacity (struct burn_drive *d, int *capacity, int flag)
 Inquire the maximum amount of readable data. More...
 
int burn_read_data (struct burn_drive *d, off_t byte_address, char data[], off_t data_size, off_t *data_count, int flag)
 Read data in random access mode. More...
 
int burn_read_audio (struct burn_drive *d, int sector_no, char data[], off_t data_size, off_t *data_count, int flag)
 Read CD audio sectors in random access mode. More...
 
int burn_drive_extract_audio (struct burn_drive *drive, int start_sector, int sector_count, char *target_path, int flag)
 Extract an interval of audio sectors from CD and store it as a WAVE audio file on hard disk. More...
 
int burn_drive_extract_audio_track (struct burn_drive *drive, struct burn_track *track, char *target_path, int flag)
 Extract all audio sectors of a track from CD and store them as a WAVE audio file on hard disk. More...
 
int burn_drive_get_drive_role (struct burn_drive *d)
 Inquire whether the drive object is a real MMC drive or a pseudo-drive created by a stdio: address. More...
 
void burn_allow_drive_role_4 (int allowed)
 Allow drive role 4 "random access read-only" and drive role 5 "random access write-only". More...
 
int burn_drive_equals_adr (struct burn_drive *d1, char *adr2, int drive_role2)
 Find out whether a given address string would lead to the given drive object. More...
 
int libdax_audioxtr_new (struct libdax_audioxtr **xtr, char *path, int flag)
 Open an audio file, check whether suitable, create extractor object. More...
 
int libdax_audioxtr_get_id (struct libdax_audioxtr *xtr, char **fmt, char **fmt_info, int *num_channels, int *sample_rate, int *bits_per_sample, int *msb_first, int flag)
 Obtain identification parameters of opened audio source. More...
 
int libdax_audioxtr_get_size (struct libdax_audioxtr *o, off_t *size, int flag)
 Obtain a prediction about the extracted size based on internal information of the formatted file. More...
 
int libdax_audioxtr_read (struct libdax_audioxtr *xtr, char buffer[], int buffer_size, int flag)
 Obtain next buffer full of extracted data in desired format (only raw audio for now). More...
 
int libdax_audioxtr_detach_fd (struct libdax_audioxtr *o, int *fd, int flag)
 Try to obtain a file descriptor which will deliver extracted data to normal calls of read(2). More...
 
int libdax_audioxtr_destroy (struct libdax_audioxtr **xtr, int flag)
 Clean up after extraction and destroy extractor object. More...
 

Macro Definition Documentation

◆ BURN_4CH

#define BURN_4CH   (1 << 7)

Track mode modifier - 4 channel audio.

Definition at line 115 of file libburn.h.

◆ BURN_AUDIO

#define BURN_AUDIO   (1 << 6)

Track mode - audio 2352 bytes per sector.

may be | with 4ch or preemphasis. NOT TO BE CONFUSED WITH BURN_MODE_RAW Audio data must be 44100Hz 16bit stereo with no riff or other header at beginning. Extra header data will cause pops or clicks. Audio data should also be in little-endian byte order. Big-endian audio data causes static.

Definition at line 113 of file libburn.h.

◆ BURN_CDI

#define BURN_CDI   0x10

Session format for obsolete CD-I discs.

Definition at line 72 of file libburn.h.

◆ BURN_CDROM

#define BURN_CDROM   0

Session format for normal audio or data discs.

Definition at line 70 of file libburn.h.

◆ BURN_CDTEXT_FILLER

#define BURN_CDTEXT_FILLER
Value:
"", "", "", "", \
"", "", "", "", \
"", "", "", "", \
"", "", "", "", \
"", "", "", "", \
"", "", "", "", \
""

Definition at line 2197 of file libburn.h.

◆ BURN_CDTEXT_GENRE_LIST

#define BURN_CDTEXT_GENRE_LIST
Value:
"Not Used", "Not Defined", "Adult Contemporary", "Alternative Rock", \
"Childrens Music", "Classical", "Contemporary Christian", "Country", \
"Dance", "Easy Listening", "Erotic", "Folk", \
"Gospel", "Hip Hop", "Jazz", "Latin", \
"Musical", "New Age", "Opera", "Operetta", \
"Pop Music", "Rap", "Reggae", "Rock Music", \
"Rhythm & Blues", "Sound Effects", "Spoken Word", "World Music"

This is the list of Genres sorted by their Genre codes.

E.g. genre code 0x0000 is "No Used", 0x0008 is "Dance, 0x0010 is "Musical", 0x0018 is "Rhythm & Blues", 0x001b is "World Music". See also file doc/cdtext.txt.

Since
1.2.0

Definition at line 2279 of file libburn.h.

◆ BURN_CDTEXT_LANGUAGES_0X00

#define BURN_CDTEXT_LANGUAGES_0X00
Value:
"Unknown", "Albanian", "Breton", "Catalan", \
"Croatian", "Welsh", "Czech", "Danish", \
"German", "English", "Spanish", "Esperanto", \
"Estonian", "Basque", "Faroese", "French", \
"Frisian", "Irish", "Gaelic", "Galician", \
"Icelandic", "Italian", "Lappish", "Latin", \
"Latvian", "Luxembourgian", "Lithuanian", "Hungarian", \
"Maltese", "Dutch", "Norwegian", "Occitan", \
"Polish", "Portuguese", "Romanian", "Romansh", \
"Serbian", "Slovak", "Slovenian", "Finnish", \
"Swedish", "Turkish", "Flemish", "Wallon"

This is the first list of languages sorted by their Language codes, which start at 0x00.

They stem from from EBU Tech 3264, appendix 3. E.g. language 0x00 is "Unknown", 0x08 is "German", 0x10 is "Frisian", 0x18 is "Latvian", 0x20 is "Polish", 0x28 is "Swedish", 0x2b is "Wallon". See also file doc/cdtext.txt.

Since
1.2.0

Definition at line 2151 of file libburn.h.

◆ BURN_CDTEXT_LANGUAGES_0X45

#define BURN_CDTEXT_LANGUAGES_0X45
Value:
"Zulu", "Vietnamese", "Uzbek", \
"Urdu", "Ukrainian", "Thai", "Telugu", \
"Tatar", "Tamil", "Tadzhik", "Swahili", \
"Sranan Tongo", "Somali", "Sinhalese", "Shona", \
"Serbo-croat", "Ruthenian", "Russian", "Quechua", \
"Pushtu", "Punjabi", "Persian", "Papamiento", \
"Oriya", "Nepali", "Ndebele", "Marathi", \
"Moldavian", "Malaysian", "Malagasay", "Macedonian", \
"Laotian", "Korean", "Khmer", "Kazakh", \
"Kannada", "Japanese", "Indonesian", "Hindi", \
"Hebrew", "Hausa", "Gurani", "Gujurati", \
"Greek", "Georgian", "Fulani", "Dari", \
"Churash", "Chinese", "Burmese", "Bulgarian", \
"Bengali", "Bielorussian", "Bambora", "Azerbaijani", \
"Assamese", "Armenian", "Arabic", "Amharic"

This is the second list of languages sorted by their Language codes, which start at 0x45.

They stem from from EBU Tech 3264, appendix 3. E.g. language 0x45 is "Zulu", 0x50 is "Sranan Tongo", 0x58 is "Pushtu", 0x60 is "Moldavian", 0x68 is "Kannada", 0x70 is "Greek", 0x78 is "Bengali", 0x7f is "Amharic". See also file doc/cdtext.txt.

Since
1.2.0

Definition at line 2172 of file libburn.h.

◆ BURN_CDTEXT_NUM_GENRES

#define BURN_CDTEXT_NUM_GENRES   28

Definition at line 2290 of file libburn.h.

◆ BURN_CDXA

#define BURN_CDXA   0x20

Session format for CDROM-XA discs.

Definition at line 74 of file libburn.h.

◆ BURN_COPY

#define BURN_COPY   (1 << 8)

Track mode modifier - Digital copy permitted, can be set on any track.

Definition at line 117 of file libburn.h.

◆ BURN_DRIVE_ADR_LEN

#define BURN_DRIVE_ADR_LEN   1024

Maximum length+1 to expect with a drive device file address string.

Definition at line 1041 of file libburn.h.

◆ BURN_DRIVE_WHITELIST_LEN

#define BURN_DRIVE_WHITELIST_LEN   255

Maximum number of particularly permissible drive addresses.

Definition at line 974 of file libburn.h.

◆ BURN_FORM1

#define BURN_FORM1   (1 << 4)

Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader.

Definition at line 101 of file libburn.h.

◆ BURN_FORM2

#define BURN_FORM2   (1 << 5)

Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data.

not much LEC.

Definition at line 105 of file libburn.h.

◆ BURN_FORMAT_IS_FORMATTED

#define BURN_FORMAT_IS_FORMATTED   2

Definition at line 1754 of file libburn.h.

◆ BURN_FORMAT_IS_UNFORMATTED

#define BURN_FORMAT_IS_UNFORMATTED   1

Possible formatting status values.

Definition at line 1753 of file libburn.h.

◆ BURN_FORMAT_IS_UNKNOWN

#define BURN_FORMAT_IS_UNKNOWN   3

Definition at line 1755 of file libburn.h.

◆ burn_header_version_major

#define burn_header_version_major   1

These three release version numbers tell the revision of this header file and of the API it describes.

They are memorized by applications at build time. Immediately after burn_initialize() an application should do this check: burn_version(&major, &minor, &micro); if(major > burn_header_version_major || (major == burn_header_version_major && (minor > burn_header_version_minor || (minor == burn_header_version_minor && micro >= burn_header_version_micro)))) { ... Young enough. Go on with program run .... } else { ... Too old. Do not use this libburn version ... }

Definition at line 3816 of file libburn.h.

◆ burn_header_version_micro

#define burn_header_version_micro   4

Definition at line 3818 of file libburn.h.

◆ burn_header_version_minor

#define burn_header_version_minor   5

Definition at line 3817 of file libburn.h.

◆ BURN_MODE0

#define BURN_MODE0   (1 << 0)

Track mode - mode 0 data 0 bytes of user data.

it's all 0s. mode 0. get it? HAH

Definition at line 84 of file libburn.h.

◆ BURN_MODE1

#define BURN_MODE1   (1 << 2)

Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy.

Definition at line 92 of file libburn.h.

◆ BURN_MODE2

#define BURN_MODE2   (1 << 3)

Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required.

Definition at line 97 of file libburn.h.

◆ BURN_MODE_BITS

#define BURN_MODE_BITS   127

Mask for mode bits.

Definition at line 79 of file libburn.h.

◆ BURN_MODE_RAW

#define BURN_MODE_RAW   (1 << 1)

Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY!

Definition at line 88 of file libburn.h.

◆ BURN_MSGS_MESSAGE_LEN

#define BURN_MSGS_MESSAGE_LEN   4096

Definition at line 3896 of file libburn.h.

◆ BURN_POS_END

#define BURN_POS_END   100

Definition at line 76 of file libburn.h.

◆ BURN_PREEMPHASIS

#define BURN_PREEMPHASIS   (1 << 9)

Track mode modifier - 50/15uS pre-emphasis.

Definition at line 119 of file libburn.h.

◆ BURN_REASONS_LEN

#define BURN_REASONS_LEN   4096

The length of a rejection reasons string for burn_precheck_write() and burn_write_opts_auto_write_type() .

Definition at line 1817 of file libburn.h.

◆ BURN_SCMS

#define BURN_SCMS   (1 << 13)

Track mode modifier - Serial Copy Management System, SAO only If this is set and BURN_COPY is not set, then copying the emerging track will be forbidden.

Since
1.2.0

Definition at line 133 of file libburn.h.

◆ BURN_SUBCODE_P16

#define BURN_SUBCODE_P16   (1 << 10)

Input mode modifier - subcodes present packed 16.

Definition at line 121 of file libburn.h.

◆ BURN_SUBCODE_P96

#define BURN_SUBCODE_P96   (1 << 11)

Input mode modifier - subcodes present packed 96.

Definition at line 123 of file libburn.h.

◆ BURN_SUBCODE_R96

#define BURN_SUBCODE_R96   (1 << 12)

Input mode modifier - subcodes present raw 96.

Definition at line 125 of file libburn.h.

◆ Libburn_disc_with_incomplete_sessioN

#define Libburn_disc_with_incomplete_sessioN   1

Definition at line 4483 of file libburn.h.

◆ Libburn_dummy_probe_write_modeS

#define Libburn_dummy_probe_write_modeS   1

Definition at line 4477 of file libburn.h.

◆ LIBDAX_AUDIOXTR_STRLEN

#define LIBDAX_AUDIOXTR_STRLEN   4096

Definition at line 4350 of file libburn.h.

Typedef Documentation

◆ burn_abort_handler_t

typedef int(* burn_abort_handler_t) (void *handle, int signum, int flag)

The prototype of a handler function suitable for burn_set_signal_handling() Such a function has to return -2 if it does not want the process to exit with value 1.

Definition at line 3992 of file libburn.h.

Enumeration Type Documentation

◆ burn_block_types

Data format to send to the drive.

Enumerator
BURN_BLOCK_RAW0 

sync, headers, edc/ecc provided by lib/user

BURN_BLOCK_RAW16 

sync, headers, edc/ecc and p/q subs provided by lib/user

BURN_BLOCK_RAW96P 

sync, headers, edc/ecc and packed p-w subs provided by lib/user

BURN_BLOCK_RAW96R 

sync, headers, edc/ecc and raw p-w subs provided by lib/user

BURN_BLOCK_MODE1 

only 2048 bytes of user data provided by lib/user

BURN_BLOCK_MODE2R 

2336 bytes of user data provided by lib/user

BURN_BLOCK_MODE2_PATHETIC 

2048 bytes of user data provided by lib/user subheader provided in write parameters are we ever going to support this shit? I vote no.

(supposed to be supported on all drives...)

BURN_BLOCK_MODE2_LAME 

2048 bytes of data + 8 byte subheader provided by lib/user hey, this is also dumb

BURN_BLOCK_MODE2_OBSCURE 

2324 bytes of data provided by lib/user subheader provided in write parameters no sir, I don't like it.

BURN_BLOCK_MODE2_OK 

2332 bytes of data supplied by lib/user 8 bytes sub header provided in write parameters this is the second least suck mode2, and is mandatory for all drives to support.

BURN_BLOCK_SAO 

SAO block sizes are based on cue sheet, so use this.

Definition at line 191 of file libburn.h.

192{
193 /** sync, headers, edc/ecc provided by lib/user */
194 BURN_BLOCK_RAW0 = 1,
195 /** sync, headers, edc/ecc and p/q subs provided by lib/user */
197 /** sync, headers, edc/ecc and packed p-w subs provided by lib/user */
199 /** sync, headers, edc/ecc and raw p-w subs provided by lib/user */
201 /** only 2048 bytes of user data provided by lib/user */
202 BURN_BLOCK_MODE1 = 256,
203 /** 2336 bytes of user data provided by lib/user */
204 BURN_BLOCK_MODE2R = 512,
205 /** 2048 bytes of user data provided by lib/user
206 subheader provided in write parameters
207 are we ever going to support this shit? I vote no.
208 (supposed to be supported on all drives...)
209 */
211 /** 2048 bytes of data + 8 byte subheader provided by lib/user
212 hey, this is also dumb
213 */
215 /** 2324 bytes of data provided by lib/user
216 subheader provided in write parameters
217 no sir, I don't like it.
218 */
220 /** 2332 bytes of data supplied by lib/user
221 8 bytes sub header provided in write parameters
222 this is the second least suck mode2, and is mandatory for
223 all drives to support.
224 */
225 BURN_BLOCK_MODE2_OK = 8192,
226 /** SAO block sizes are based on cue sheet, so use this. */
227 BURN_BLOCK_SAO = 16384
228};
@ BURN_BLOCK_SAO
SAO block sizes are based on cue sheet, so use this.
Definition: libburn.h:227
@ BURN_BLOCK_MODE2_OBSCURE
2324 bytes of data provided by lib/user subheader provided in write parameters no sir,...
Definition: libburn.h:219
@ BURN_BLOCK_MODE2_PATHETIC
2048 bytes of user data provided by lib/user subheader provided in write parameters are we ever going...
Definition: libburn.h:210
@ BURN_BLOCK_MODE2_OK
2332 bytes of data supplied by lib/user 8 bytes sub header provided in write parameters this is the s...
Definition: libburn.h:225
@ BURN_BLOCK_RAW0
sync, headers, edc/ecc provided by lib/user
Definition: libburn.h:194
@ BURN_BLOCK_RAW96P
sync, headers, edc/ecc and packed p-w subs provided by lib/user
Definition: libburn.h:198
@ BURN_BLOCK_MODE2_LAME
2048 bytes of data + 8 byte subheader provided by lib/user hey, this is also dumb
Definition: libburn.h:214
@ BURN_BLOCK_RAW16
sync, headers, edc/ecc and p/q subs provided by lib/user
Definition: libburn.h:196
@ BURN_BLOCK_MODE1
only 2048 bytes of user data provided by lib/user
Definition: libburn.h:202
@ BURN_BLOCK_MODE2R
2336 bytes of user data provided by lib/user
Definition: libburn.h:204
@ BURN_BLOCK_RAW96R
sync, headers, edc/ecc and raw p-w subs provided by lib/user
Definition: libburn.h:200

◆ burn_disc_status

Possible status of the drive in regard to the disc in it.

Enumerator
BURN_DISC_UNREADY 

The current status is not yet known.

BURN_DISC_BLANK 

The drive holds a blank disc.

It is ready for writing from scratch. Unused multi-session media: CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R Blanked multi-session media (i.e. treated by burn_disc_erase()) CD-RW, DVD-RW Overwritable media with or without valid data DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE

BURN_DISC_EMPTY 

There is no disc at all in the drive.

BURN_DISC_APPENDABLE 

There is an incomplete disc in the drive.

It is ready for appending another session. Written but not yet closed multi-session media CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R

BURN_DISC_FULL 

There is a disc with data on it in the drive.

It is usable only for reading. Written and closed multi-session media CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R Read-Only media CD-ROM, DVD-ROM, BD-ROM Note that many DVD-ROM drives report any written media as Read-Only media and not by their real media types.

BURN_DISC_UNGRABBED 

The drive was not grabbed when the status was inquired.

BURN_DISC_UNSUITABLE 

The media seems to be unsuitable for reading and for writing.

Definition at line 231 of file libburn.h.

232{
233 /** The current status is not yet known */
235
236 /** The drive holds a blank disc. It is ready for writing from scratch.
237 Unused multi-session media:
238 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
239 Blanked multi-session media (i.e. treated by burn_disc_erase())
240 CD-RW, DVD-RW
241 Overwritable media with or without valid data
242 DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE
243 */
245
246 /** There is no disc at all in the drive */
248
249 /** There is an incomplete disc in the drive. It is ready for appending
250 another session.
251 Written but not yet closed multi-session media
252 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
253 */
255
256 /** There is a disc with data on it in the drive. It is usable only for
257 reading.
258 Written and closed multi-session media
259 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
260 Read-Only media
261 CD-ROM, DVD-ROM, BD-ROM
262 Note that many DVD-ROM drives report any written media
263 as Read-Only media and not by their real media types.
264 */
266
267 /* ts A61007 */
268 /* @since 0.2.4 */
269 /** The drive was not grabbed when the status was inquired */
271
272 /* ts A61020 */
273 /* @since 0.2.6 */
274 /** The media seems to be unsuitable for reading and for writing */
276};
@ BURN_DISC_UNREADY
The current status is not yet known.
Definition: libburn.h:234
@ BURN_DISC_EMPTY
There is no disc at all in the drive.
Definition: libburn.h:247
@ BURN_DISC_UNGRABBED
The drive was not grabbed when the status was inquired.
Definition: libburn.h:270
@ BURN_DISC_BLANK
The drive holds a blank disc.
Definition: libburn.h:244
@ BURN_DISC_UNSUITABLE
The media seems to be unsuitable for reading and for writing.
Definition: libburn.h:275
@ BURN_DISC_APPENDABLE
There is an incomplete disc in the drive.
Definition: libburn.h:254
@ BURN_DISC_FULL
There is a disc with data on it in the drive.
Definition: libburn.h:265

◆ burn_drive_status

Possible busy states for a drive.

Enumerator
BURN_DRIVE_IDLE 

The drive is not in an operation.

BURN_DRIVE_SPAWNING 

The library is spawning the processes to handle a pending operation (A read/write/etc is about to start but hasn't quite yet)

BURN_DRIVE_READING 

The drive is reading data from a disc.

BURN_DRIVE_WRITING 

The drive is writing data to a disc.

BURN_DRIVE_WRITING_LEADIN 

The drive is writing Lead-In.

BURN_DRIVE_WRITING_LEADOUT 

The drive is writing Lead-Out.

BURN_DRIVE_ERASING 

The drive is erasing a disc.

BURN_DRIVE_GRABBING 

The drive is being grabbed.

BURN_DRIVE_WRITING_PREGAP 

The drive gets written zeroes before the track payload data.

BURN_DRIVE_CLOSING_TRACK 

The drive is told to close a track (TAO only)

BURN_DRIVE_CLOSING_SESSION 

The drive is told to close a session (TAO only)

BURN_DRIVE_FORMATTING 

The drive is formatting media.

BURN_DRIVE_READING_SYNC 

The drive is busy in synchronous read (if you see this then it has been interrupted)

BURN_DRIVE_WRITING_SYNC 

The drive is busy in synchronous write (if you see this then it has been interrupted)

Definition at line 292 of file libburn.h.

293{
294 /** The drive is not in an operation */
296 /** The library is spawning the processes to handle a pending
297 operation (A read/write/etc is about to start but hasn't quite
298 yet) */
300 /** The drive is reading data from a disc */
302 /** The drive is writing data to a disc */
304 /** The drive is writing Lead-In */
306 /** The drive is writing Lead-Out */
308 /** The drive is erasing a disc */
310 /** The drive is being grabbed */
312
313 /* ts A61102 */
314 /* @since 0.2.6 */
315 /** The drive gets written zeroes before the track payload data */
317 /** The drive is told to close a track (TAO only) */
319 /** The drive is told to close a session (TAO only) */
321
322 /* ts A61223 */
323 /* @since 0.3.0 */
324 /** The drive is formatting media */
326
327 /* ts A70822 */
328 /* @since 0.4.0 */
329 /** The drive is busy in synchronous read (if you see this then it
330 has been interrupted) */
332 /** The drive is busy in synchronous write (if you see this then it
333 has been interrupted) */
335
336};
@ BURN_DRIVE_FORMATTING
The drive is formatting media.
Definition: libburn.h:325
@ BURN_DRIVE_READING_SYNC
The drive is busy in synchronous read (if you see this then it has been interrupted)
Definition: libburn.h:331
@ BURN_DRIVE_WRITING_LEADIN
The drive is writing Lead-In.
Definition: libburn.h:305
@ BURN_DRIVE_WRITING
The drive is writing data to a disc.
Definition: libburn.h:303
@ BURN_DRIVE_CLOSING_SESSION
The drive is told to close a session (TAO only)
Definition: libburn.h:320
@ BURN_DRIVE_GRABBING
The drive is being grabbed.
Definition: libburn.h:311
@ BURN_DRIVE_WRITING_LEADOUT
The drive is writing Lead-Out.
Definition: libburn.h:307
@ BURN_DRIVE_ERASING
The drive is erasing a disc.
Definition: libburn.h:309
@ BURN_DRIVE_WRITING_SYNC
The drive is busy in synchronous write (if you see this then it has been interrupted)
Definition: libburn.h:334
@ BURN_DRIVE_SPAWNING
The library is spawning the processes to handle a pending operation (A read/write/etc is about to sta...
Definition: libburn.h:299
@ BURN_DRIVE_CLOSING_TRACK
The drive is told to close a track (TAO only)
Definition: libburn.h:318
@ BURN_DRIVE_WRITING_PREGAP
The drive gets written zeroes before the track payload data.
Definition: libburn.h:316
@ BURN_DRIVE_READING
The drive is reading data from a disc.
Definition: libburn.h:301
@ BURN_DRIVE_IDLE
The drive is not in an operation.
Definition: libburn.h:295

◆ burn_source_status

Possible data source return values.

Enumerator
BURN_SOURCE_OK 

The source is ok.

BURN_SOURCE_EOF 

The source is at end of file.

BURN_SOURCE_FAILED 

The source is unusable.

Definition at line 280 of file libburn.h.

281{
282 /** The source is ok */
284 /** The source is at end of file */
286 /** The source is unusable */
288};
@ BURN_SOURCE_EOF
The source is at end of file.
Definition: libburn.h:285
@ BURN_SOURCE_OK
The source is ok.
Definition: libburn.h:283
@ BURN_SOURCE_FAILED
The source is unusable.
Definition: libburn.h:287

◆ burn_write_types

Possible disc writing style/modes.

Enumerator
BURN_WRITE_PACKET 

Packet writing.

currently unsupported, (for DVD Incremental Streaming use TAO)

BURN_WRITE_TAO 

With CD: Track At Once recording 2s gaps between tracks, no fonky lead-ins.

With sequential DVD-R[W]: Incremental Streaming With DVD+R and BD-R: Track of open size With DVD-RAM, DVD+RW, BD-RE: Random Writeable (used sequentially) With overwritable DVD-RW: Rigid Restricted Overwrite

BURN_WRITE_SAO 

With CD: Session At Once Block type MUST be BURN_BLOCK_SAO ts A70122: Currently not capable of mixing data and audio tracks.

With sequential DVD-R[W]: Disc-at-once, DAO Single session, single track, fixed size mandatory, (-dvd-compat) With other DVD or BD media: same as BURN_WRITE_TAO but may demand that track size is known in advance.

BURN_WRITE_RAW 

With CD: Raw disc at once recording.

all subcodes must be provided by lib or user only raw block types are supported With DVD and BD media: not supported.

ts A90901: This had been disabled because its implementation relied on code from cdrdao which is not understood currently. A burn run will abort with "FATAL" error message if this mode is attempted.

Since
0.7.2 ts A91016: Re-implemented according to ECMA-130 Annex A and B. Now understood, explained and not stemming from cdrdao.
0.7.4
BURN_WRITE_NONE 

In replies this indicates that not any writing will work.

As parameter for inquiries it indicates that no particular write mode shall is specified. Do not use for setting a write mode for burning. It will not work.

Definition at line 137 of file libburn.h.

138{
139 /** Packet writing.
140 currently unsupported, (for DVD Incremental Streaming use TAO)
141 */
143
144 /** With CD: Track At Once recording
145 2s gaps between tracks, no fonky lead-ins
146
147 With sequential DVD-R[W]: Incremental Streaming
148 With DVD+R and BD-R: Track of open size
149 With DVD-RAM, DVD+RW, BD-RE: Random Writeable (used sequentially)
150 With overwritable DVD-RW: Rigid Restricted Overwrite
151 */
153
154 /** With CD: Session At Once
155 Block type MUST be BURN_BLOCK_SAO
156 ts A70122: Currently not capable of mixing data and audio tracks.
157
158 With sequential DVD-R[W]: Disc-at-once, DAO
159 Single session, single track, fixed size mandatory, (-dvd-compat)
160 With other DVD or BD media: same as BURN_WRITE_TAO but may demand
161 that track size is known in advance.
162 */
164
165 /** With CD: Raw disc at once recording.
166 all subcodes must be provided by lib or user
167 only raw block types are supported
168 With DVD and BD media: not supported.
169
170 ts A90901: This had been disabled because its implementation
171 relied on code from cdrdao which is not understood
172 currently.
173 A burn run will abort with "FATAL" error message
174 if this mode is attempted.
175 @since 0.7.2
176 ts A91016: Re-implemented according to ECMA-130 Annex A and B.
177 Now understood, explained and not stemming from cdrdao.
178 @since 0.7.4
179 */
181
182 /** In replies this indicates that not any writing will work.
183 As parameter for inquiries it indicates that no particular write
184 mode shall is specified.
185 Do not use for setting a write mode for burning. It will not work.
186 */
188};
@ BURN_WRITE_RAW
With CD: Raw disc at once recording.
Definition: libburn.h:180
@ BURN_WRITE_PACKET
Packet writing.
Definition: libburn.h:142
@ BURN_WRITE_TAO
With CD: Track At Once recording 2s gaps between tracks, no fonky lead-ins.
Definition: libburn.h:152
@ BURN_WRITE_SAO
With CD: Session At Once Block type MUST be BURN_BLOCK_SAO ts A70122: Currently not capable of mixing...
Definition: libburn.h:163
@ BURN_WRITE_NONE
In replies this indicates that not any writing will work.
Definition: libburn.h:187

Function Documentation

◆ burn_abort()

int burn_abort ( int  patience,
int(*)(void *handle, int patience, int elapsed)  pacifier_func,
void *  handle 
)

Abort any running drive operation and eventually call burn_finish().

You MUST shut down the busy drives if an aborting event occurs during a burn run. For that you may call this function either from your own signal handling code or indirectly by activating the built-in signal handling: burn_set_signal_handling("my_app_name : ", NULL, 0); Else you may eventually call burn_drive_cancel() on the active drives and wait for them to assume state BURN_DRIVE_IDLE.

Parameters
patienceMaximum number of seconds to wait for drives to finish.
Since
0.7.8 : If this is -1, then only the cancel operations will be performed and no burn_finish() will happen.
Parameters
pacifier_funcIf not NULL: a function to produce appeasing messages. See burn_abort_pacifier() for an example.
handleOpaque handle to be used with pacifier_func
Returns
1 ok, all went well 0 had to leave a drive in unclean state <0 severe error, do no use libburn again
Since
0.2.6

Referenced by main().

◆ burn_abort_pacifier()

int burn_abort_pacifier ( void *  handle,
int  patience,
int  elapsed 
)

A pacifier function suitable for burn_abort.

Parameters
handleIf not NULL, a pointer to a text suitable for printf("%s")
patienceMaximum number of seconds to wait
elapsedElapsed number of seconds

Referenced by main().

◆ burn_allow_drive_role_4()

void burn_allow_drive_role_4 ( int  allowed)

Allow drive role 4 "random access read-only" and drive role 5 "random access write-only".

By default a random access file assumes drive role 2 "read-write" regardless whether it is actually readable or writeable. If enabled, random-access file objects which recognizably permit no writing will be classified as role 4 and those which permit no reading will get role 5. Candidates are drive addresses of the form stdio:/dev/fd/# , where # is the integer number of an open file descriptor. If this descriptor was opened read-only or write-only, then it gets role 4 or role 5, respectively. Other paths may get tested by an attempt to open them for read-write (role 2) or read-only (role 4) or write-only (role 5). See bit1.

Parameters
allowedBitfield for control purposes: bit0= Enable roles 4 and 5 for drives which get acquired after this call bit1= with bit0: Test whether the file can be opened for read-write, read-only, or write-only. Classify as roles 2, 4, 5. bit2= with bit0 and bit1: Classify files which cannot be opened at all as role 0 : useless dummy. Else classify as role 2. bit3= Classify non-empty role 5 drives as BURN_DISC_APPENDABLE with Next Writeable Address after the end of the file. It is nevertheless possible to change this address by call burn_write_opts_set_start_byte().
Since
1.0.6

◆ burn_allow_untested_profiles()

void burn_allow_untested_profiles ( int  yes)

Allows the use of media types which are implemented in libburn but not yet tested.

The list of those untested profiles is subject to change.

◆ burn_cdtext_from_packfile()

int burn_cdtext_from_packfile ( char *  path,
unsigned char **  text_packs,
int *  num_packs,
int  flag 
)

Read an array of CD-TEXT packs from a file.

This array should be suitable for burn_write_opts_set_leadin_text(). The function tolerates and removes 4-byte headers as produced by cdrecord -vv -toc, if this header tells the correct number of bytes which matches the file size. If no 4-byte header is present, then the function tolerates and removes a trailing 0-byte as of Sony specs.

Parameters
pathFilesystem address of the CD-TEXT pack file. Normally with suffix .cdt or .dat
text_packsWill return the buffer with the CD-TEXT packs. Dispose by free() when no longer needed.
num_packsWill return the number of 18 byte text packs.
flagBitfield for control purposes. Unused yet.Submit 0.
Returns
0 is success, <= 0 failure
Since
1.2.0

◆ burn_cdtext_from_session()

int burn_cdtext_from_session ( struct burn_session *  s,
unsigned char **  text_packs,
int *  num_packs,
int  flag 
)

Produce an array of CD-TEXT packs that could be submitted to burn_write_opts_set_leadin_text(), or stored as *.cdt file, or submitted to burn_make_input_sheet_v07t().

For a description of the format of the array, see file doc/cdtext.txt. The input data stem from burn_session_set_cdtext_par(), burn_session_set_cdtext(), and burn_track_set_cdtext().

Parameters
sSession from which to produce CD-TEXT packs.
text_packsWill return the buffer with the CD-TEXT packs. Dispose by free() when no longer needed.
num_packsWill return the number of 18 byte text packs.
flagBitfield for control purposes. bit0= do not return generated CD-TEXT packs, but check whether production would work and indicate the number of packs by the call return value. This happens also if (text_packs == NULL || num_packs == NULL).
Returns
Without flag bit0: > 0 is success, <= 0 failure With flag bit0: > 0 is number of packs, 0 means no packs will be generated, < 0 means failure
Since
1.2.0

◆ burn_disc_add_session()

int burn_disc_add_session ( struct burn_disc *  d,
struct burn_session *  s,
unsigned int  pos 
)

Add a session to a disc at a specific position, increasing the sessions's reference count.

Parameters
dDisc to add the session to
sSession to add to the disc
posposition to add at (BURN_POS_END is "at the end")
Returns
0 for failure, 1 for success

Referenced by libburner_payload().

◆ burn_disc_available_space()

off_t burn_disc_available_space ( struct burn_drive *  d,
struct burn_write_opts *  o 
)

Return the best possible estimation of the currently available capacity of the media.

This might depend on particular write option settings. For inquiring the space with such a set of options, the drive has to be grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value from the most recent automatic inquiry (e.g. during last drive grabbing). An eventual start address from burn_write_opts_set_start_byte() will be taken into respect with the capacity estimation. Negative results get defaulted to 0. If the drive is actually a file in a large filesystem or a large block device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks = 4 TB - 32 KB.

Parameters
dThe drive to query.
oIf not NULL: write parameters to be set on drive before query
Returns
number of most probably available free bytes
Since
0.3.4

◆ burn_disc_close_damaged()

int burn_disc_close_damaged ( struct burn_write_opts *  o,
int  flag 
)

Try to close the last track and session of media which have bit0 set in the return value of call burn_disc_next_track_is_damaged().

Whether it helps depends much on the reason why the media is reported as damaged by the drive. This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R, 0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential. Note: After writing it is advised to give up the drive and to grab it again in order to learn about its view on the new media state.

Parameters
oWrite options created by burn_write_opts_new() and manipulated by burn_write_opts_set_multi(). burn_write_opts_set_write_type() should be set to BURN_WRITE_TAO, burn_write_opts_set_simulate() should be set to 0.
flagBitfield for control purposes bit0= force close, even if no damage was seen
Returns
<=0 media not marked as damaged, or media type not suitable, or closing attempted but failed 1= attempt finished without error indication
Since
1.1.0

◆ burn_disc_create()

struct burn_disc * burn_disc_create ( void  )

Create a new disc.

Returns
Pointer to a burn_disc object or NULL on failure.

Referenced by libburner_payload().

◆ burn_disc_erasable()

int burn_disc_erasable ( struct burn_drive *  d)

Tells whether a disc can be erased or not.

Parameters
dThe drive to inquire.
Returns
Non-zero means erasable

Referenced by libburner_blank_disc(), and libburner_payload().

◆ burn_disc_erase()

void burn_disc_erase ( struct burn_drive *  drive,
int  fast 
)

Erase a disc in the drive.

The drive must be grabbed successfully BEFORE calling this functions. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function. An erase operation is not cancellable, as control of the operation is passed wholly to the drive and there is no way to interrupt it safely.

Parameters
driveThe drive with which to erase a disc. Only drive roles 1 (MMC) and 5 (stdio random write-only) support erasing.
fastNonzero to do a fast erase, where only the disc's headers are erased; zero to erase the entire disc. With DVD-RW, fast blanking yields media capable only of DAO.

Referenced by libburner_blank_disc().

◆ burn_disc_format()

void burn_disc_format ( struct burn_drive *  drive,
off_t  size,
int  flag 
)

Format media for use with libburn.

This currently applies to DVD-RW in state "Sequential Recording" (profile 0014h) which get formatted to state "Restricted Overwrite" (profile 0013h). DVD+RW can be "de-iced" by setting bit4 of flag. DVD-RAM and BD-RE may get formatted initially or re-formatted to adjust their Defect Management. This function usually returns while the drive is still in the process of formatting. The formatting is done, when burn_drive_get_status() returns BURN_DRIVE_IDLE. This may be immediately after return or may need several thousand seconds to occur.

Parameters
driveThe drive with the disc to format.
sizeThe size in bytes to be used with the format command. It should be divisible by 32*1024. The effect of this parameter may depend on the media profile and on parameter flag.
flagBitfield for control purposes: bit0= after formatting, write the given number of zero-bytes to the media and eventually perform preliminary closing. bit1+2: size mode 0 = use parameter size as far as it makes sense 1 = insist in size 0 even if there is a better default known (on DVD-RAM or BD-R identical to size mode 0, i.e. they never get formatted with payload size 0) 2 = without bit7: format to maximum available size with bit7 : take size from indexed format descriptor 3 = without bit7: format to default size with bit7 : take size from indexed format descriptor bit3= -reserved- bit4= enforce re-format of (partly) formatted media bit5= try to disable eventual defect management bit6= try to avoid lengthy media certification bit7, bit8 to bit15 = bit7 enables MMC expert application mode (else libburn tries to choose a suitable format type): If it is set then bit8 to bit15 contain the index of the format to use. See burn_disc_get_formats(), burn_disc_get_format_descr(). Acceptable types are: 0x00, 0x01, 0x10, 0x11, 0x13, 0x15, 0x26, 0x30, 0x31, 0x32. If bit7 is set, then bit4 is set automatically. bit16= enable POW on blank BD-R
Since
0.3.0

Referenced by libburner_format().

◆ burn_disc_free()

void burn_disc_free ( struct burn_disc *  d)

Delete disc and decrease the reference count on all its sessions.

Parameters
dThe disc to be freed

Referenced by libburner_payload().

◆ burn_disc_free_multi_caps()

int burn_disc_free_multi_caps ( struct burn_multi_caps **  caps)

Removes from memory a multi session info structure which was returned by burn_disc_get_multi_caps().

The pointer *caps gets set to NULL.

Parameters
capsthe info structure to dispose (note: pointer to pointer)
Returns
0 : *caps was already NULL, 1 : memory object was disposed
Since
0.3.2

◆ burn_disc_get_bd_spare_info()

int burn_disc_get_bd_spare_info ( struct burn_drive *  d,
int *  alloc_blocks,
int *  free_blocks,
int  flag 
)

Read the current usage of the eventual BD Spare Area.

This area gets reserved on BD media during formatting. During writing it is used to host replacements of blocks which failed the checkread immediately after writing. This call applies only to recordable BD media. I.e. profiles 0x41 to 0x43.

Parameters
dThe drive to query.
alloc_blocksReturns the number of blocks reserved as Spare Area
free_blocksReturns the number of yet unused blocks in that area
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 = reply prarameters are valid, <=0 = reply is invalid (e.g. because no BD profile)
Since
0.8.8

◆ burn_disc_get_cd_info()

int burn_disc_get_cd_info ( struct burn_drive *  d,
char  disc_type[80],
unsigned int *  disc_id,
char  bar_code[9],
int *  app_code,
int *  valid 
)

Retrieve some media information which is mainly specific to CD.

For other media only the bits in reply parameter valid are supposed to be meaningful.

Parameters
dThe drive to query.
disc_typeA string saying either "CD-DA or CD-ROM", or "CD-I", or ""CD-ROM XA", or "undefined".
disc_idA 32 bit number read from the media. (Meaning unclear yet)
bar_code8 hex digits from a barcode on media read by the drive (if the drive has a bar code reader built in).
app_codeThe Host Application Code which must be set in the Write Parameters Page if the media is not unrestricted (URU==0).
validReplies bits which indicate the validity of other reply parameters or the state of certain CD info bits: bit0= disc_type is valid bit1= disc_id is valid bit2= bar_code is valid bit3= disc_app_code is valid bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO) This seems to be broken with my drives. The bit is 0 and the validity bit for disc_app_code is 0 too. bit5= Disc is nominally erasable (Erasable bit) This will be set with overwritable media which libburn normally considers to be unerasable blank.
Returns
1 success, <= 0 an error occurred
Since
0.7.2

◆ burn_disc_get_format_descr()

int burn_disc_get_format_descr ( struct burn_drive *  drive,
int  index,
int *  type,
off_t *  size,
unsigned *  tdp 
)

Inquire parameters of an available media format.

Parameters
driveThe drive with the disc to format.
indexThe index of the format item. Beginning with 0 up to reply parameter from burn_disc_get_formats() : num_formats - 1
typeThe format type. See mmc5r03c.pdf, 6.5, 04h FORMAT UNIT. 0x00=full, 0x10=CD-RW/DVD-RW full, 0x11=CD-RW/DVD-RW grow, 0x15=DVD-RW quick, 0x13=DVD-RW quick grow, 0x26=DVD+RW background, 0x30=BD-RE with spare areas, 0x31=BD-RE without spare areas
sizeThe maximum size in bytes achievable with this format.
tdpType Dependent Parameter. See mmc5r03c.pdf.
Returns
1 reply is valid , <=0 failure
Since
0.3.0

◆ burn_disc_get_formats()

int burn_disc_get_formats ( struct burn_drive *  drive,
int *  status,
off_t *  size,
unsigned *  bl_sas,
int *  num_formats 
)

Inquire the formatting status, the associated sizes and the number of available formats.

The info is media specific and stems from MMC command 23h READ FORMAT CAPACITY. See mmc5r03c.pdf 6.24 for background details. Media type can be determined via burn_disc_get_profile().

Parameters
driveThe drive with the disc to format.
statusThe current formatting status of the inserted media. See BURN_FORMAT_IS_* macros. Note: "unknown" is the legal status for quick formatted, yet unwritten DVD-RW.
sizeThe size in bytes associated with status. unformatted: the maximum achievable size of the media formatted: the currently formatted capacity unknown: maximum capacity of drive or of media
bl_sasAdditional info "Block Length/Spare Area Size". Expected to be constantly 2048 for non-BD media.
num_formatsThe number of available formats. To be used with burn_disc_get_format_descr() to obtain such a format and eventually with burn_disc_format() to select one.
Returns
1 reply is valid , <=0 failure
Since
0.3.0

Referenced by libburner_format().

◆ burn_disc_get_incomplete_sessions()

int burn_disc_get_incomplete_sessions ( struct burn_disc *  d)

Obtains the number of incomplete sessions which are recorded in the result array of burn_disc_get_sessions() after the complete sessions.

See above.

Parameters
dDisc object to inquire
Returns
Number of incomplete sessions

◆ burn_disc_get_leadin_text()

int burn_disc_get_leadin_text ( struct burn_drive *  d,
unsigned char **  text_packs,
int *  num_packs,
int  flag 
)

Read the array of CD-TEXT packs from the Lead-in of an audio CD.

Each pack consists of 18 bytes, of which 4 are header. 12 bytes are pieces of 0-terminated texts or binary data. 2 bytes hold a CRC. For a description of the format of the array, see file doc/cdtext.txt.

Parameters
dThe drive to query.
text_packsWill point to an allocated memory buffer with CD-TEXT. It will only contain text packs, and not be prepended by the TOC header of four bytes, which gets stored with file cdtext.dat by cdrecord -vv -toc. (The first two of these bytes are supposed to hold the number of CD-TEXT bytes + 2. The other two bytes are supposed to be 0.) Dispose this buffer by free(), when no longer needed.
num_packsWill tell the number of text packs, i.e. the number of bytes in text_packs divided by 18.
flagBitfield for control purposes, Unused yet. Submit 0.
Returns
1 success, 0= no CD-TEXT found, < 0 an error occurred
Since
1.2.0

◆ burn_disc_get_media_id()

int burn_disc_get_media_id ( struct burn_drive *  d,
char **  product_id,
char **  media_code1,
char **  media_code2,
char **  book_type,
int  flag 
)

Obtain product id and standards defined media codes.

The product id is a printable string which is supposed to be the same for identical media but should vary with non-identical media. Some media cannot provide such an id at all. The pair (profile_number, product_id) should be the best id to identify media with identical product specifications. The reply parameters media_code1 and media_code2 can be used with burn_guess_manufacturer() The reply parameters have to be disposed by free() when no longer needed.

Parameters
dThe drive where the media is inserted.
product_idReply: Printable text depicting manufacturer and eventually media id.
media_code1Reply: The eventual manufacturer identification as read from DVD/BD media or a text "XXmYYsZZf" from CD media ATIP lead-in.
media_code2The eventual media id as read from DVD+/BD media or a text "XXmYYsZZf" from CD ATIP lead-out.
book_typeBook type text for DVD and BD. Caution: is NULL with CD, even if return value says ok.
flagBitfield for control purposes bit0= do not escape " _/" (not suitable for burn_guess_manufacturer())
Returns
1= ok, product_id and media codes are valid, 0= no product id_available, reply parameters are NULL <0= error
Since
0.7.2

◆ burn_disc_get_msc1()

int burn_disc_get_msc1 ( struct burn_drive *  d,
int *  start_lba 
)

Read start lba of the first track in the last complete session.

This is the first parameter of mkisofs option -C. The second parameter is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0.

Parameters
dThe drive to query.
start_lbareturns the start address of that track
Returns
<= 0 : failure, 1 = ok
Since
0.3.2

◆ burn_disc_get_multi_caps()

int burn_disc_get_multi_caps ( struct burn_drive *  d,
enum burn_write_types  wt,
struct burn_multi_caps **  caps,
int  flag 
)

Allocates a struct burn_multi_caps (see above) and fills it with values which are appropriate for the drive and the loaded media.

The drive must be grabbed for this call. The returned structure has to be disposed via burn_disc_free_multi_caps() when no longer needed.

Parameters
dThe drive to inquire
wtWith BURN_WRITE_NONE the best capabilities of all write modes get returned. If set to a write mode like BURN_WRITE_SAO the capabilities with that particular mode are returned and the return value is 0 if the desired mode is not possible.
capsreturns the info structure
flagBitfield for control purposes (unused yet, submit 0)
Returns
< 0 : error , 0 : writing seems impossible , 1 : writing possible
Since
0.3.2

◆ burn_disc_get_phys_format_info()

int burn_disc_get_phys_format_info ( struct burn_drive *  d,
int *  disk_category,
char **  book_name,
int *  part_version,
int *  num_layers,
int *  num_blocks,
int  flag 
)

Retrieve some media information which is mainly specific to media of the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R Currently the information cannot be retrieved from other media types.

Parameters
dThe drive to query.
disk_categoryreturns DVD Book to which the media complies
book_namereturns a pointer to the book name of disk_category. This memory is static. Do not alter or free it !
part_versionreturns the Media Version in the DVD Book
num_layersreturns the number of media layers
num_blocksreturns the number of blocks between pysical start and physical end of the media
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 = reply prarameters are valid, <=0 = reply is invalid (e.g. because no DVD-R)
Since
1.1.4

◆ burn_disc_get_profile()

int burn_disc_get_profile ( struct burn_drive *  d,
int *  pno,
char  name[80] 
)

Tells the MMC Profile identifier of the loaded media.

The drive must be grabbed in order to get a non-zero result. libburn currently writes only to profiles 0x09 "CD-R" 0x0a "CD-RW" 0x11 "DVD-R sequential recording" 0x12 "DVD-RAM" 0x13 "DVD-RW restricted overwrite" 0x14 "DVD-RW sequential recording", 0x15 "DVD-R/DL sequential recording", 0x1a "DVD+RW" 0x1b "DVD+R", 0x2b "DVD+R/DL", 0x41 "BD-R sequential recording", 0x43 "BD-RE", 0xffff "stdio file" Note: 0xffff is not a MMC profile but a libburn invention. Read-only are the profiles 0x08 "CD-ROM", 0x10 "DVD-ROM", 0x40 "BD-ROM", Read-only for now is this BD-R profile (testers wanted) 0x42 "BD-R random recording" Empty drives are supposed to report 0x00 ""

Parameters
dThe drive where the media is inserted.
pnoProfile Number. See also mmc5r03c.pdf, table 89
nameProfile Name (see above list, unknown profiles have empty name)
Returns
1 profile is valid, 0 no profile info available
Since
0.3.0

Referenced by libburner_aquire_drive(), and libburner_format().

◆ burn_disc_get_sectors()

int burn_disc_get_sectors ( struct burn_disc *  d)

◆ burn_disc_get_sessions()

struct burn_session ** burn_disc_get_sessions ( struct burn_disc *  d,
int *  num 
)

Gets an array of all complete sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION The result array contains *num + burn_disc_get_incomplete_sessions() elements.

All above *num are incomplete sessions. Typically there is at most one incomplete session with one empty track. DVD+R and BD-R seem support more than one track with even readable data.

Parameters
dDisc to get session array for
numReturns the number of sessions in the array
Returns
array of sessions

◆ burn_disc_get_status()

enum burn_disc_status burn_disc_get_status ( struct burn_drive *  drive)

Returns what kind of disc a drive is holding.

This function may need to be called more than once to get a proper status from it. See burn_disc_status for details.

Parameters
driveThe drive to query for a disc.
Returns
The status of the drive, or what kind of disc is in it. Note: BURN_DISC_UNGRABBED indicates wrong API usage

Referenced by libburner_blank_disc(), libburner_format(), and libburner_payload().

◆ burn_disc_next_track_is_damaged()

int burn_disc_next_track_is_damaged ( struct burn_drive *  d,
int  flag 
)

Tells whether a previous attempt to determine the Next Writeable Address of the upcoming track reveiled that the READ TRACK INFORMATION Damage Bit is set for this track and that no valid writable address is available.

See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)

Parameters
dThe drive to query.
flagBitfield for control purposes (unused yet, submit 0)
Returns
0= Looks ok: Damage Bit is not set, NWA_V is set 1= Damaged and theoretically writable (NWA_V is set) 2= Not writable: NWA_V is not set 3= Damaged and not writable (NWA_V is not set),
Since
1.1.0

◆ burn_disc_pretend_blank()

int burn_disc_pretend_blank ( struct burn_drive *  drive)

WARNING: This revives an old bug-like behavior that might be dangerous.

Sets the drive status to BURN_DISC_BLANK if it is BURN_DISC_UNREADY or BURN_DISC_UNSUITABLE. Thus marking media as writable which actually failed to declare themselves either blank or (partially) filled.

Returns
1 drive status has been set , 0 = unsuitable drive status
Since
0.2.6

◆ burn_disc_pretend_full()

int burn_disc_pretend_full ( struct burn_drive *  drive)

WARNING: This overrides the safety measures against unsuitable media.

Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually failed to declare themselves either blank or (partially) filled.

Since
0.2.6

◆ burn_disc_pretend_full_uncond()

int burn_disc_pretend_full_uncond ( struct burn_drive *  drive)

WARNING: This overrides the safety measures against unsuitable media.

Sets the drive status to BURN_DISC_FULL unconditionally.

Since
1.3.4

◆ burn_disc_read()

void burn_disc_read ( struct burn_drive *  drive,
const struct burn_read_opts *  o 
)

Read a disc from the drive and write it to an fd pair.

The drive must be grabbed successfully BEFORE calling this function. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function.

Parameters
driveThe drive from which to read a disc.
oThe options for the read operation.

◆ burn_disc_read_atip()

int burn_disc_read_atip ( struct burn_drive *  drive)

Reads ATIP information from inserted media.

To be obtained via burn_drive_get_write_speed(), burn_drive_get_min_write_speed(), burn_drive_get_start_end_lba(). The drive must be grabbed for this call.

Parameters
driveThe drive to query.
Returns
1=success, 0=no valid ATIP info read, -1 severe error
Since
0.2.6

◆ burn_disc_remove_session()

int burn_disc_remove_session ( struct burn_disc *  d,
struct burn_session *  s 
)

Remove a session from a disc.

Parameters
dDisc to remove session from
sSession pointer to find and remove

◆ burn_disc_track_lba_nwa()

int burn_disc_track_lba_nwa ( struct burn_drive *  d,
struct burn_write_opts *  o,
int  trackno,
int *  lba,
int *  nwa 
)

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().

Parameters
dThe drive to query.
oIf not NULL: write parameters to be set on drive before query
trackno0=next track to come, >0 number of existing track The first existing track on a CD may have a number higher than 1. Use burn_session_get_start_tno() to inquire this start number.
lbareturn value: start lba
nwareturn value: Next Writeable Address
Returns
1=nwa is valid , 0=nwa is not valid , -1=error
Since
0.2.6

◆ burn_disc_write()

void burn_disc_write ( struct burn_write_opts *  o,
struct burn_disc *  disc 
)

Write a disc in the drive.

The drive must be grabbed successfully before calling this function. Always ensure that the drive reports a status of BURN_DISC_BLANK ot BURN_DISC_APPENDABLE before calling this function. Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix of data and audio tracks. You must use BURN_WRITE_TAO for such sessions. To be set by burn_write_opts_set_write_type(). Note: This function is not suitable for overwriting data in the middle of a valid data area because it is allowed to append trailing data. For exact random access overwriting use burn_random_access_write(). Note: After writing it is advised to give up the drive and to grab it again in order to learn about its view on the new media state. Note: Before mounting the written media it might be necessary to eject and reload in order to allow the operating system to notice the new media state.

Parameters
oThe options for the writing operation.
discThe struct burn_disc * that described the disc to be created

Referenced by libburner_payload().

◆ burn_drive_add_whitelist()

int burn_drive_add_whitelist ( char *  device_address)

Add a device to the list of permissible drives.

As soon as some entry is in the whitelist all non-listed drives are banned from scanning.

Returns
1 success, <=0 failure
Since
0.2.2

◆ burn_drive_cancel()

void burn_drive_cancel ( struct burn_drive *  drive)

Cancel an operation on a drive.

This will only work when the drive's busy state is BURN_DRIVE_READING or BURN_DRIVE_WRITING.

Parameters
driveThe drive on which to cancel the current operation.

◆ burn_drive_clear_whitelist()

void burn_drive_clear_whitelist ( void  )

Remove all drives from whitelist.

This enables all possible drives.

◆ burn_drive_convert_fs_adr()

int burn_drive_convert_fs_adr ( char *  path,
char  adr[] 
)

Try to convert a given existing filesystem address into a drive device file address.

This succeeds with symbolic links or if a hint about the drive's system address can be read from the filesystem object and a matching drive is found.

Parameters
pathThe address of an existing file system object
adrAn application provided array of at least BURN_DRIVE_ADR_LEN characters size. The device file address gets copied to it.
Returns
1 = success , 0 = failure , -1 = severe error
Since
0.2.6

Referenced by libburner_aquire_by_adr().

◆ burn_drive_convert_scsi_adr()

int burn_drive_convert_scsi_adr ( int  bus_no,
int  host_no,
int  channel_no,
int  target_no,
int  lun_no,
char  adr[] 
)

Try to convert a given SCSI address of bus,host,channel,target,lun into a drive device file address.

If a SCSI address component parameter is < 0 then it is not decisive and the first enumerated address which matches the >= 0 parameters is taken as result. Note: bus and (host,channel) are supposed to be redundant.

Parameters
bus_no"Bus Number" (something like a virtual controller)
host_no"Host Number" (something like half a virtual controller)
channel_no"Channel Number" (other half of "Host Number")
target_no"Target Number" or "SCSI Id" (a device)
lun_no"Logical Unit Number" (a sub device)
adrAn application provided array of at least BURN_DRIVE_ADR_LEN characters size. The device file address gets copied to it.
Returns
1 = success , 0 = failure , -1 = severe error
Since
0.2.6

◆ burn_drive_d_get_adr()

int burn_drive_d_get_adr ( struct burn_drive *  drive,
char  adr[] 
)

Inquire the device file address of the given drive.

Parameters
driveThe drive to inquire.
adrAn application provided array of at least BURN_DRIVE_ADR_LEN characters size. The device file address gets copied to it.
Returns
>0 success , <=0 error (due to libburn internal problem)
Since
0.4.0

◆ burn_drive_equals_adr()

int burn_drive_equals_adr ( struct burn_drive *  d1,
char *  adr2,
int  drive_role2 
)

Find out whether a given address string would lead to the given drive object.

This should be done in advance for track source addresses with parameter drive_role set to 2. Although a real MMC drive should hardly exist as two drive objects at the same time, this can easily happen with stdio-drives. So if more than one drive is used by the application, then this gesture is advised: burn_drive_d_get_adr(d2, adr2); if (burn_drive_equals_adr(d1, adr2, burn_drive_get_drive_role(d2))) ... Both drive objects point to the same storage facility ...

Parameters
d1Existing drive object
adr2Address string to be tested. Prefix "stdio:" overrides parameter drive_role2 by either 0 or 2 as appropriate. The string must be shorter than BURN_DRIVE_ADR_LEN.
drive_role2Role as burn_drive_get_drive_role() would attribute to adr2 if it was a drive. Use value 2 for checking track sources or pseudo-drive addresses without "stdio:". Use 1 for checking drive addresses including those with prefix "stdio:".
Returns
1= adr2 leads to d1 , 0= adr2 seems not to lead to d1, -1 = adr2 is bad
Since
0.4.0

◆ burn_drive_extract_audio()

int burn_drive_extract_audio ( struct burn_drive *  drive,
int  start_sector,
int  sector_count,
char *  target_path,
int  flag 
)

Extract an interval of audio sectors from CD and store it as a WAVE audio file on hard disk.

Parameters
driveThe drive from which to read.
start_sectorThe logical block address of the first audio sector which shall be read.
sector_countThe number of audio sectors to be read. Each sector consists of 2352 bytes.
target_pathThe address of the file where to store the extracted audio data. Will be opened O_WRONLY | O_CREAT. The file name should have suffix ".wav".
flagBitfield for control purposes: bit0= Report about progress by UPDATE messages bit3= Enable DAP : "flaw obscuring mechanisms like audio data mute and interpolate"
Since
1.3.2

◆ burn_drive_extract_audio_track()

int burn_drive_extract_audio_track ( struct burn_drive *  drive,
struct burn_track *  track,
char *  target_path,
int  flag 
)

Extract all audio sectors of a track from CD and store them as a WAVE audio file on hard disk.

Parameters
driveThe drive from which to read.
trackThe track which shall be extracted.
target_pathThe address of the file where to store the extracted audio data. Will be opened O_WRONLY | O_CREAT. The file name should have suffix ".wav".
flagBitfield for control purposes: bit0= Report about progress by UPDATE messages bit3= Enable DAP : "flaw obscuring mechanisms like audio data mute and interpolate"
Since
1.3.2

◆ burn_drive_free_speedlist()

int burn_drive_free_speedlist ( struct burn_speed_descriptor **  speed_list)

Dispose a speed descriptor list copy which was obtained by burn_drive_get_speedlist().

Parameters
speed_listThe list copy. *speed_list gets set to NULL.
Returns
1=list disposed , 0= *speedlist was already NULL
Since
0.3.0

◆ burn_drive_get_adr()

int burn_drive_get_adr ( struct burn_drive_info drive_info,
char  adr[] 
)

Inquire the device file address of a drive via a given drive_info object.

(Note: This is a legacy call.)

Parameters
drive_infoThe drive to inquire.Usually some &(drive_infos[driveno])
adrAn application provided array of at least BURN_DRIVE_ADR_LEN characters size. The device file address gets copied to it.
Returns
>0 success , <=0 error (due to libburn internal problem)
Since
0.2.6

Referenced by libburner_aquire_by_driveno().

◆ burn_drive_get_all_profiles()

int burn_drive_get_all_profiles ( struct burn_drive *  d,
int *  num_profiles,
int  profiles[64],
char  is_current[64] 
)

Gets the list of profile codes supported by the drive.

Profiles depict the feature sets which constitute media types. For known profile codes and names see burn_disc_get_profile().

Parameters
dis the drive to query
num_profilesreturns the number of supported profiles
profilesreturns the profile codes
is_currentreturns the status of the corresponding profile code: 1= current, i.e. the matching media is loaded 0= not current, i.e. the matching media is not loaded
Returns
always 1 for now
Since
0.7.0

◆ burn_drive_get_bd_r_pow()

int burn_drive_get_bd_r_pow ( struct burn_drive *  drive)

Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in the drive.

Such a formatting may have been applied by dvd+rw-tools. It prevents sequential multi-session. libburn will refuse to write to such a medium.

Parameters
driveThe drive to query.
Returns
1 if BD-R Pseudo Overwrite , 0 if not BD-R or not POW
Since
1.4.8

◆ burn_drive_get_best_speed()

int burn_drive_get_best_speed ( struct burn_drive *  d,
int  speed_goal,
struct burn_speed_descriptor **  best_descr,
int  flag 
)

Look up the fastest speed descriptor which is not faster than the given speed_goal.

If it is 0, then the fastest one is chosen among the descriptors with the highest end_lba. If it is -1 then the slowest speed descriptor is chosen regardless of end_lba. Parameter flag decides whether the speed goal means write speed or read speed.

Parameters
dDrive to query
speed_goalUpper limit for speed, 0=search for maximum speed , -1 search for minimum speed
best_descrResult of the search, NULL if no match
flagBitfield for control purposes bit0= look for best read speed rather than write speed bit1= look for any source type (else look for source==2 first and for any other source type only with CD media)
Returns
>0 indicates a valid best_descr, 0 = no valid best_descr
Since
0.3.8

◆ burn_drive_get_disc()

struct burn_disc * burn_drive_get_disc ( struct burn_drive *  d)

Get the drive's disc struct - free when done.

Parameters
ddrive to query
Returns
the disc struct or NULL on failure

◆ burn_drive_get_drive_role()

int burn_drive_get_drive_role ( struct burn_drive *  d)

Inquire whether the drive object is a real MMC drive or a pseudo-drive created by a stdio: address.

Parameters
dThe drive to inquire
Returns
0= null-drive 1= real MMC drive 2= stdio-drive, random access, read-write 3= stdio-drive, sequential, write-only 4= stdio-drive, random access, read-only (only if enabled by burn_allow_drive_role_4()) 5= stdio-drive, random access, write-only (only if enabled by burn_allow_drive_role_4())
Since
0.4.0

◆ burn_drive_get_feature()

int burn_drive_get_feature ( struct burn_drive *  d,
unsigned int  feature_code,
unsigned char *  flags,
unsigned char *  additional_length,
unsigned char **  feature_data,
char **  feature_text 
)

Obtains the fields and data of a particular feature which were obtained from the drive when it was last acquired or re-assessed.

See MMC specs for full detail.

Parameters
dDrive to query
feature_codeA number as learned by burn_drive_get_feature_codes()
flagsReturns byte 2 of the feature descriptor: bit0= Current bit1= Persistent bit2-5= Version
additional_lengthReturns byte 3 of descriptor. This is the size of feature_data.
feature_dataReturns further bytes of descriptor. If returned *feature_data is not NULL, dispose it by free() when it is no longer needed.
feature_textReturns text representation of the feature descriptor: Code +/- : Name : Version,P/N : Hex bytes : Parsed info Current features are marked by "+", others by "-". Persistent features are marked by "P", others by "N". feature_text may be submitted as NULL. In this case no text is generated and returned. If returned *feature_text is not NULL, dispose it by free() when it is no longer needed.
Returns
0 feature descriptor is not present -1 out of memory >0 success
Since
1.5.2

◆ burn_drive_get_feature_codes()

void burn_drive_get_feature_codes ( struct burn_drive *  d,
int *  count,
unsigned int **  feature_codes 
)

Obtains the list of SCSI Feature Codes from feature descriptors which were obtained from the drive when it was most recently acquired or re-assessed.

Parameters
dDrive to query
countReturns the number of allocated elements in feature_codes
feature_codesReturns the allocated array of feature codes. If returned *feature_codes is not NULL, dispose it by free() when it is no longer needed.
Since
1.5.2

◆ burn_drive_get_immed()

int burn_drive_get_immed ( struct burn_drive *  drive)

Inquire the current setting of usage of the Immed bit.

Either the still set system dependent default or the value set by call burn_drive_set_immed().

Returns
The current value.
Since
1.4.6

◆ burn_drive_get_media_sno()

int burn_drive_get_media_sno ( struct burn_drive *  d,
char **  sno,
int *  sno_len 
)

Returns the Media Serial Number as of MMC feature 109h and command ABh READ MEDIA SERIAL NUMBER.

Note: This call will return an empty result unless the macro Libburn_enable_scsi_cmd_ABh is defined at compile time. This is because the command READ MEDIA SERIAL NUMBER demands superuser authority on Linux, because no medium with serial number could be tested yet, and because this command made one of the test drives unusable until power cycle when it was executed despite feature 109h was not announced as "current".

Parameters
dThe drive to inquire.
snoReturns the bytes of the serial number. A trailing 0-byte is appended for convenience. There is no warranty that sno contains only non-zero printable bytes. Submit *sno as NULL or pointing to free()-able memory. Apply free() to *sno when no longer needed.
sno_lenReturns the number of valid bytes in returned *sno, not counting the appended trailing 0.
Returns
1= success (but maybe *sno_len is 0), <= 0 severe failure
Since
1.4.2

◆ burn_drive_get_min_write_speed()

int burn_drive_get_min_write_speed ( struct burn_drive *  d)

Gets the minimum write speed for a drive and eventually loaded media.

The return value might change by the media type of already loaded media, again by call burn_drive_grab() and again by call burn_disc_read_atip().

Parameters
dDrive to query
Returns
Minimum write speed in K/s
Since
0.2.6

◆ burn_drive_get_read_speed()

int burn_drive_get_read_speed ( struct burn_drive *  d)

Gets the maximum read speed for a drive.

Parameters
dDrive to query
Returns
Maximum read speed in K/s

◆ burn_drive_get_serial_no()

int burn_drive_get_serial_no ( struct burn_drive *  d,
char **  sno,
int *  sno_len 
)

Returns the Drive Serial Number as of MMC feature 108h.

Parameters
dThe drive to inquire.
snoReturns the bytes of the serial number. A trailing 0-byte is appended for convenience. MMC specifies ASCII 0x20 to 0x7h as possible byte values. But given drive firmware habits there is no warranty that *sno contains no other byte values. Submit *sno as NULL or pointing to free()-able memory. Apply free() to *sno when no longer needed.
sno_lenReturns the number of valid bytes in returned *sno, not counting the appended trailing 0.
Returns
1= success (but maybe *sno_len is 0), <= 0 severe failure
Since
1.4.2

◆ burn_drive_get_speedlist()

int burn_drive_get_speedlist ( struct burn_drive *  d,
struct burn_speed_descriptor **  speed_list 
)

Obtain a copy of the current speed descriptor list.

The drive's list gets updated on various occasions such as burn_drive_grab() but the copy obtained here stays untouched. It has to be disposed via burn_drive_free_speedlist() when it is not longer needed. Speeds may appear several times in the list. The list content depends much on drive and media type. It seems that .source == 1 applies mostly to CD media whereas .source == 2 applies to any media.

Parameters
dDrive to query
speed_listThe copy. If empty, *speed_list gets returned as NULL.
Returns
1=success , 0=list empty , <0 severe error
Since
0.3.0

◆ burn_drive_get_start_end_lba()

int burn_drive_get_start_end_lba ( struct burn_drive *  drive,
int *  start_lba,
int *  end_lba,
int  flag 
)

Returns start and end lba of the media which is currently inserted in the given drive.

The drive has to be grabbed to have hope for reply. Shortcoming (not a feature): unless burn_disc_read_atip() was called only blank media will return valid info.

Parameters
driveThe drive to query.
start_lbaReturns the start lba value
end_lbaReturns the end lba value
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 if lba values are valid , 0 if invalid
Since
0.2.6

◆ burn_drive_get_status()

enum burn_drive_status burn_drive_get_status ( struct burn_drive *  drive,
struct burn_progress p 
)

Returns the progress and status of a drive.

Parameters
driveThe drive to query busy state for.
pReturns the progress of the operation, NULL if you don't care
Returns
the current status of the drive. See also burn_drive_status.

Referenced by libburner_blank_disc(), libburner_format(), and libburner_payload().

◆ burn_drive_get_write_speed()

int burn_drive_get_write_speed ( struct burn_drive *  d)

Gets the maximum write speed for a drive and eventually loaded media.

The return value might change by the media type of already loaded media, again by call burn_drive_grab() and again by call burn_disc_read_atip().

Parameters
dDrive to query
Returns
Maximum write speed in K/s

◆ burn_drive_grab()

int burn_drive_grab ( struct burn_drive *  drive,
int  load 
)

Grab a drive.

This must be done before the drive can be used (for reading, writing, etc).

Parameters
driveThe drive to grab. This is found in a returned burn_drive_info struct.
loadNonzero to make the drive attempt to load a disc (close its tray door, etc).
Returns
1 if it was possible to grab the drive, else 0

Referenced by libburner_aquire_by_driveno().

◆ burn_drive_info_forget()

int burn_drive_info_forget ( struct burn_drive_info drive_info,
int  force 
)

Release memory about a single drive and any exclusive lock on it.

Become unable to inquire or grab it. Expect FATAL consequences if you try.

Parameters
drive_infopointer to a single element out of the array obtained from burn_drive_scan() : &(drive_infos[driveno])
forcecontrols degree of permissible drive usage at the moment this function is called, and the amount of automatically provided drive shutdown : 0= drive must be ungrabbed and BURN_DRIVE_IDLE 1= try to release drive even if in state BURN_DRIVE_GRABBING Use these two only. Further values are to be defined.
Returns
1 on success, 2 if drive was already forgotten, 0 if not permissible, <0 on other failures,
Since
0.2.2

Referenced by libburner_aquire_by_driveno().

◆ burn_drive_info_free()

void burn_drive_info_free ( struct burn_drive_info  drive_infos[])

When no longer needed, free a whole burn_drive_info array which was returned by burn_drive_scan().

For freeing single drive array elements use burn_drive_info_forget().

◆ burn_drive_is_enumerable_adr()

int burn_drive_is_enumerable_adr ( char *  adr)

Evaluate whether the given address would be a drive device file address which could be listed by a run of burn_drive_scan().

No check is made whether a device file with this address exists or whether it leads to a usable MMC drive.

Returns
1 means yes, 0 means no
Since
0.2.6

◆ burn_drive_leave_locked()

int burn_drive_leave_locked ( struct burn_drive *  d,
int  flag 
)

Like burn_drive_release() but keeping the drive tray closed and its eject button disabled.

This physically locked drive state will last until the drive is grabbed again and released via burn_drive_release(). Programs like eject, cdrecord, growisofs will break that ban too.

Parameters
dThe drive to release and leave locked.
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 means success, <=0 means failure
Since
0.4.0

◆ burn_drive_obtain_scsi_adr()

int burn_drive_obtain_scsi_adr ( char *  path,
int *  bus_no,
int *  host_no,
int *  channel_no,
int *  target_no,
int *  lun_no 
)

Try to obtain bus,host,channel,target,lun from path.

If there is an SCSI address at all, then this call should succeed with a drive device file address obtained via burn_drive_d_get_adr(). It is also supposed to succeed with any device file of a (possibly emulated) SCSI device.

Returns
1 = success , 0 = failure , -1 = severe error
Since
0.2.6

◆ burn_drive_probe_cd_write_modes()

int burn_drive_probe_cd_write_modes ( struct burn_drive_info drive_info)

◆ burn_drive_re_assess()

int burn_drive_re_assess ( struct burn_drive *  d,
int  flag 
)

Re-assess drive and media status.

This should be done after a drive underwent a status change and shall be further used without intermediate burn_drive_release(), burn_drive_grab(). E.g. after blanking or burning.

Parameters
dThe already grabbed drive to re-assess.
flagUnused yet. Submit 0.
Returns
1 success , <= 0 could not determine drive and media state
Since
1.1.8

◆ burn_drive_release()

void burn_drive_release ( struct burn_drive *  drive,
int  eject 
)

Release a drive.

This should not be done until the drive is no longer busy (see burn_drive_get_status).

Parameters
driveThe drive to release.
ejectNonzero to make the drive eject the disc in it.

Referenced by main().

◆ burn_drive_reset_simulate()

int burn_drive_reset_simulate ( struct burn_drive *  d,
int  simulate 
)

Control the write simulation mode before or after burn_write_opts get into effect.

Beginning with version 1.4.8 a burn run by burn_disc_write() brings the burn_drive object in the simulation state as set to the burn_write_opts by burn_write_opts_set_simulate(). This state is respected by call burn_random_access_write() until a new call of burn_disc_write() happens or until burn_drive_reset_simulate() is called. This call may only be made when burn_drive_get_status() returns BURN_DRIVE_IDLE.

Parameters
dThe drive to control
simulate1 enables simulation, 0 enables real writing
Returns
1=success , 0=failure
Since
1.4.8

◆ burn_drive_scan()

int burn_drive_scan ( struct burn_drive_info drive_infos[],
unsigned int *  n_drives 
)

Scan for drives.

This function MUST be called until it returns nonzero. In case of re-scanning: All pointers to struct burn_drive and all struct burn_drive_info arrays are invalidated by using this function. Do NOT store drive pointers across calls to this function ! To avoid invalid pointers one MUST free all burn_drive_info arrays by burn_drive_info_free() before calling burn_drive_scan() a second time. If there are drives left, then burn_drive_scan() will refuse to work.

After this call all drives depicted by the returned array are subject to eventual (O_EXCL) locking. See burn_preset_device_open(). This state ends either with burn_drive_info_forget() or with burn_drive_release(). It is unfriendly to other processes on the system to hold drives locked which one does not definitely plan to use soon.

Parameters
drive_infosReturns an array of drive info items (cdroms/burners). The returned array must be freed by burn_drive_info_free() before burn_finish(), and also before calling this function burn_drive_scan() again.
n_drivesReturns the number of drive items in drive_infos.
Returns
0 while scanning is not complete >0 when it is finished successfully, <0 when finished but failed.

Referenced by libburner_aquire_by_driveno().

◆ burn_drive_scan_and_grab()

int burn_drive_scan_and_grab ( struct burn_drive_info drive_infos[],
char *  adr,
int  load 
)

Acquire a drive with known device file address.

This is the sysadmin friendly way to open one drive and to leave all others untouched. It bundles the following API calls to form a non-obtrusive way to use libburn: burn_drive_add_whitelist() , burn_drive_scan() , burn_drive_grab() You are strongly urged to use this call whenever you know the drive address in advance.

If not, then you have to use directly above calls. In that case, you are strongly urged* to drop any unintended drive which will be exclusively occupied and not closed by burn_drive_scan(). This can be done by shutting down the library including a call to burn_finish(). You may later start a new libburn session and should then use the function described here with an address obtained after burn_drive_scan() via burn_drive_d_get_adr(drive_infos[driveno].drive,adr). Another way is to drop the unwanted drives by burn_drive_info_forget().

Operating on multiple drives:

Different than with burn_drive_scan() it is allowed to call burn_drive_scan_and_grab() without giving up any other scanned drives. So this call can be used to get a collection of more than one acquired drives. The attempt to acquire the same drive twice will fail, though.

Pseudo-drives:

burn_drive_scan_and_grab() is able to acquire virtual drives which will accept options much like a MMC burner drive. Many of those options will not cause any effect, though. The address of a pseudo-drive begins with prefix "stdio:" followed by a path. Examples: "stdio:/tmp/pseudo_drive" , "stdio:/dev/null" , "stdio:-"

If the path is empty, the result is a null-drive = drive role 0. It pretends to have loaded no media and supports no reading or writing.

If the path leads to an existing regular file, or to a not yet existing file, or to an existing block device, then the result is a random access stdio-drive capable of reading and writing = drive role 2.

If the path leads to an existing file of any type other than directory, then the result is a sequential write-only stdio-drive = drive role 3.

The special address form "stdio:/dev/fd/{number}" is interpreted literally as reference to open file descriptor {number}. This address form coincides with real files on some systems, but it is in fact hardcoded in libburn. Special address "stdio:-" means stdout = "stdio:/dev/fd/1". The role of such a drive is determined by the file type obtained via fstat({number}).

Roles 2 and 3 perform all their eventual data transfer activities on a file via standard i/o functions open(2), lseek(2), read(2), write(2), close(2). The media profile is reported as 0xffff. Write space information from those media is not necessarily realistic.

The capabilities of role 2 resemble DVD-RAM but it can simulate writing. If the path does not exist in the filesystem yet, it is attempted to create it as a regular file as soon as write operations are started.

The capabilities of role 3 resemble a blank DVD-R. Nevertheless each burn_disc_write() run may only write a single track.

One may distinguish pseudo-drives from MMC drives by call burn_drive_get_drive_role().

Parameters
drive_infosOn success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when it is no longer needed. This is a result from call burn_drive_scan(). See there. Use with driveno 0 only.
adrThe device file address of the desired drive. Either once obtained by burn_drive_d_get_adr() or composed skillfully by application or its user. E.g. "/dev/sr0". Consider to preprocess it by burn_drive_convert_fs_adr().
loadNonzero to make the drive attempt to load a disc (close its tray door, etc).
Returns
1 = success , 0 = drive not found , -1 = other error
Since
0.2.2

Referenced by libburner_aquire_by_adr().

◆ burn_drive_set_buffer_waiting()

int burn_drive_set_buffer_waiting ( struct burn_drive *  d,
int  enable,
int  min_usec,
int  max_usec,
int  timeout_sec,
int  min_percent,
int  max_percent 
)

Controls the behavior with writing when the drive buffer is suspected to be full.

To check and wait for enough free buffer space before writing will move the task of waiting from the operating system's device driver to libburn. While writing is going on and waiting is enabled, any write operation will be checked whether it will fill the drive buffer up to more than max_percent. If so, then waiting will happen until the buffer fill is predicted with at most min_percent. Thus: if min_percent < max_percent then transfer rate will oscillate. This may allow the driver to operate on other devices, e.g. a disk from which to read the input for writing. On the other hand, this checking might reduce maximum throughput to the drive or even get misled by faulty buffer fill replies from the drive. If a setting parameter is < 0, then this setting will stay unchanged by the call. Known burner or media specific pitfalls: To have max_percent larger than the burner's best reported buffer fill has the same effect as min_percent==max_percent. Some burners do not report their full buffer with all media types. Some are not suitable because they report their buffer fill with delay. Some do not go to full speed unless their buffer is full.

Parameters
dThe drive to control
enable0= disable , 1= enable waiting , (-1 = do not change setting)
min_usecShortest possible sleeping period (given in micro seconds)
max_usecLongest possible sleeping period (given in micro seconds)
timeout_secIf a single write has to wait longer than this number of seconds, then waiting gets disabled and mindless writing starts. A value of 0 disables this timeout.
min_percentMinimum of desired buffer oscillation: 25 to 100
max_percentMaximum of desired buffer oscillation: 25 to 100
Returns
1=success , 0=failure
Since
0.3.8

◆ burn_drive_set_immed()

int burn_drive_set_immed ( struct burn_drive *  drive,
int  enable 
)

Enable or disable use of the Immed bit with long running SCSI commands.

If the Immed bit is used, then those SCSI commands end early and leave the drive in not-ready state. libburn then tries periodically whether the drive became ready again. Only then it assumes the command to be completely done. The default setting may depend on the operating system on which libburn was compiled.

Parameters
driveThe drive which will be affected.
enable1= use Immed bit. 0= use no Immed bit. Affected commands can last very long.
Returns
1=success , <=0 failure
Since
1.4.6

◆ burn_drive_set_speed()

void burn_drive_set_speed ( struct burn_drive *  d,
int  read,
int  write 
)

Sets drive read and write speed.

Note: "k" is 1000, not 1024. 1xCD = 176.4 k/s, 1xDVD = 1385 k/s, 1xBD = 4496 k/s. Fractional speeds should be rounded up. Like 4xCD = 706.

Parameters
dThe drive to set speed for
readRead speed in k/s (0 is max, -1 is min).
writeWrite speed in k/s (0 is max, -1 is min).

Referenced by libburner_payload().

◆ burn_drive_set_speed_exact()

int burn_drive_set_speed_exact ( struct burn_drive *  d,
int  read,
int  write 
)

Sets drive read and write speed using the "Exact" bit of SCSI command SET STREAMING.

This command will be used even if a CD medium is present. MMC specifies that with the Exact bit the desired speed settings shall either be obeyed by the drive exactly, or that the drive shall indicate failure and not accept the settings. But many drives reply no error and nevertheless adjust their read speed only coarsly or ignore the setting after a few MB of fast read attempts.

The call parameters have the same meaning as with burn_drive_set_speed().

Parameters
dThe drive to set speed for. It must be a role 1 drive.
readRead speed in k/s (0 is max, -1 is min).
writeWrite speed in k/s (0 is max, -1 is min).
Returns
1=success , 0=failure
Since
1.5.4

◆ burn_drive_set_stream_recording()

int burn_drive_set_stream_recording ( struct burn_drive *  drive,
int  recmode,
int  start,
int  flag 
)

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().

Parameters
driveThe drive which performs the write operation.
recmode-1= disable stream recording 0= leave setting as is 1= enable stream recording
startThe LBA where actual stream recording shall start. (0 means unconditional stream recording)
flagBitfield for control purposes (unused yet, submit 0).
Returns
1=success , <=0 failure
Since
0.6.4

◆ burn_drive_snooze()

int burn_drive_snooze ( struct burn_drive *  d,
int  flag 
)

Calm down or alert a drive.

Some drives stay alert after reading for quite some time. This saves time with the startup for the next read operation but also causes noise and consumes extra energy. It makes sense to calm down the drive if no read operation is expected for the next few seconds. The drive will get alert automatically if operations are required.

Parameters
dThe drive to influence.
flagBitfield for control purposes bit0= become alert (else start snoozing) This is not mandatory for further drive operations
Returns
1= success , 0= drive role not suitable for calming
Since
0.7.0

◆ burn_drive_was_feat21_failure()

int burn_drive_was_feat21_failure ( struct burn_drive *  d)

Inquire whether a write error occurred which is suspected to have happened due to a false report about DVD-RW capability to be written in write type BURN_WRITE_TAO.

Parameters
dThe drive to inquire.
Returns
1= it seems that BURN_WRITE_TAO on DVD-RW caused error, 0= it does not seem so
Since
1.3.4

◆ burn_drive_wrote_well()

int burn_drive_wrote_well ( struct burn_drive *  d)

Inquire whether the most recent asynchronous media job was successful.

This applies to burn_disc_erase(), burn_disc_format(), burn_disc_write(). Reasons for non-success may be: rejection of burn parameters, abort due to fatal errors during write, blank or format, a call to burn_drive_cancel() by the application thread.

Parameters
dThe drive to inquire.
Returns
1=burn seems to have went well, 0=burn failed
Since
0.2.6

◆ burn_fd_source_new()

struct burn_source * burn_fd_source_new ( int  datafd,
int  subfd,
off_t  size 
)

Creates a data source for an image file (a track) from an open readable filedescriptor, an eventually open readable subcodes file descriptor and eventually a fixed size in bytes.

Parameters
datafdThe source of data.
subfdThe eventual source of subchannel data. Only used in exotic raw write modes. Submit -1 for normal tasks.
sizeThe eventual fixed size of eventually both fds. If this value is 0, the size will be determined from datafd.
Returns
Pointer to a burn_source object, NULL indicates failure

Referenced by libburner_payload().

◆ burn_fifo_fill()

int burn_fifo_fill ( struct burn_source fifo,
int  fill,
int  flag 
)

Start the fifo worker thread and wait either until the requested number of bytes have arrived or until it becomes clear that this will not happen.

Filling will go on asynchronously after burn_fifo_fill() returned. This call and burn_fifo_peek_data() do not disturb each other.

Parameters
fifoThe fifo object to start
fillNumber of bytes desired. Expect to get return 1 if at least fifo size - 32k were read.
flagBitfield for control purposes. bit0= fill fifo to maximum size
Returns
<0 on severe error, 0 if not enough data, 1 if desired amount or fifo full
Since
0.7.4

◆ burn_fifo_get_statistics()

void burn_fifo_get_statistics ( struct burn_source fifo,
int *  total_min_fill,
int *  interval_min_fill,
int *  put_counter,
int *  get_counter,
int *  empty_counter,
int *  full_counter 
)

Inquire various counters which reflect the fifo operation.

Parameters
fifoThe fifo object to inquire
total_min_fillThe minimum number of bytes in the fifo. Beginning from the moment when fifo consumption is enabled.
interval_min_fillThe minimum byte number beginning from the moment when fifo consumption is enabled or from the most recent moment when burn_fifo_next_interval() was called.
put_counterThe number of data transactions into the fifo.
get_counterThe number of data transactions out of the fifo.
empty_counterThe number of times the fifo was empty.
full_counterThe number of times the fifo was full.
Since
0.7.4

◆ burn_fifo_inquire_status()

int burn_fifo_inquire_status ( struct burn_source fifo,
int *  size,
int *  free_bytes,
char **  status_text 
)

Inquires state and fill parameters of a fifo burn_source which was created by burn_fifo_source_new() .

Do not use with other burn_source variants.

Parameters
fifoThe fifo object to inquire
sizeThe total size of the fifo
free_bytesThe current free capacity of the fifo
status_textReturns a pointer to a constant text, see below
Returns
<0 reply invalid, >=0 fifo status code: bit0+1=input status, bit2=consumption status, i.e: 0="standby" : data processing not started yet 1="active" : input and consumption are active 2="ending" : input has ended without error 3="failing" : input had error and ended, 4="unused" : ( consumption has ended before processing start ) 5="abandoned" : consumption has ended prematurely 6="ended" : consumption has ended without input error 7="aborted" : consumption has ended after input error
Since
0.4.0

Referenced by libburner_payload().

◆ burn_fifo_next_interval()

void burn_fifo_next_interval ( struct burn_source fifo,
int *  interval_min_fill 
)

Inquire the fifo minimum fill counter for intervals and reset that counter.

Parameters
fifoThe fifo object to inquire
interval_min_fillThe minimum number of bytes in the fifo. Beginning from the moment when fifo consumption is enabled or from the most recent moment when burn_fifo_next_interval() was called.
Since
0.7.4

◆ burn_fifo_peek_data()

int burn_fifo_peek_data ( struct burn_source fifo,
char *  buf,
int  bufsize,
int  flag 
)

Obtain a preview of the first input data of a fifo which was created by burn_fifo_source_new().

The data will later be delivered normally to the consumer track of the fifo. bufsize may not be larger than the fifo size (chunk_size * chunks) - 32k. This call will succeed only if data consumption by the track has not started yet, i.e. best before the call to burn_disc_write(). It will start the worker thread of the fifo with the expectable side effects on the external data source. Then it waits either until enough data have arrived or until it becomes clear that this will not happen. The call may be repeated with increased bufsize. It will always yield the bytes beginning from the first one in the fifo.

Parameters
fifoThe fifo object to start and to inquire
bufPointer to memory of at least bufsize bytes where to deliver the peeked data.
bufsizeNumber of bytes to peek from the start of the fifo data
flagBitfield for control purposes (unused yet, submit 0).
Returns
<0 on severe error, 0 if not enough data, 1 if bufsize bytes read
Since
0.5.0

◆ burn_fifo_source_new()

struct burn_source * burn_fifo_source_new ( struct burn_source inp,
int  chunksize,
int  chunks,
int  flag 
)

Creates a fifo which acts as proxy for an already existing data source.

The fifo provides a ring buffer which shall smoothen the data stream between burn_source and writer thread. Each fifo serves only for one data source. It may be attached to one track as its only data source by burn_track_set_source(), or it may be used as input for other burn sources. A fifo starts its life in "standby" mode with no buffer space allocated. As soon as its consumer requires bytes, the fifo establishes a worker thread and allocates its buffer. After input has ended and all buffer content is consumed, the buffer space gets freed and the worker thread ends. This happens asynchronously. So expect two buffers and worker threads to exist for a short time between tracks. Be modest in your size demands if multiple tracks are to be expected.

Parameters
inpThe burn_source for which the fifo shall act as proxy. It can be disposed by burn_source_free() immediately after this call.
chunksizeThe size in bytes of a chunk. Use 2048 for sources suitable for BURN_BLOCK_MODE1, 2352 for sources which deliver for BURN_BLOCK_AUDIO, 2056 for sources which shall get treated by burn_track_set_cdxa_conv(track, 1). Some variations of burn_source might work only with a particular chunksize. E.g. libisofs demands 2048.
chunksThe number of chunks to be allocated in ring buffer. This value must be >= 2.
flagBitfield for control purposes: bit0= The read method of inp is capable of delivering arbitrary amounts of data per call. Not only one sector. Suitable for inp from burn_file_source_new() and burn_fd_source_new() if not the fd has exotic limitations on read size. You MUST use this on inp which uses an fd opened with burn_os_open_track_src(). Better do not use with other inp types.
Since
0.7.4
Returns
A pointer to the newly created burn_source. Later both burn_sources, inp and the returned fifo, have to be disposed by calling burn_source_free() for each. inp can be freed immediately, the returned fifo may be kept as handle for burn_fifo_inquire_status().
Since
0.4.0

Referenced by libburner_payload().

◆ burn_file_source_new()

struct burn_source * burn_file_source_new ( const char *  path,
const char *  subpath 
)

Creates a data source for an image file (and maybe subcode file)

Parameters
pathThe file address for the main channel payload.
subpathEventual address for subchannel data. Only used in exotic raw write modes. Submit NULL for normal tasks.
Returns
Pointer to a burn_source object, NULL indicates failure

◆ burn_finish()

void burn_finish ( void  )

Shutdown the library.

This should be called before exiting your application. Make sure that all drives you have grabbed are released before calling this.

Referenced by main().

◆ burn_get_read_capacity()

int burn_get_read_capacity ( struct burn_drive *  d,
int *  capacity,
int  flag 
)

Inquire the maximum amount of readable data.

On DVD and BD it is supposed that all LBAs in the range from 0 to capacity - 1 can be read via burn_read_data() although some of them may never have been recorded. With multi-session CD there have to be expected unreadable TAO Run-out blocks. If tracks are recognizable then it is better to only read LBAs which are part of some track and on CD to be cautious about the last two blocks of each track which might be TAO Run-out blocks. If the drive is actually a large file or block device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks = 4 TB - 32 KB.

Parameters
dThe drive from which to read
capacityWill return the result if valid
flagBitfield for control purposes: Unused yet, submit 0.
Returns
1=successful , <=0 an error occurred
Since
0.6.0

◆ burn_guess_cd_manufacturer()

char * burn_guess_cd_manufacturer ( int  m_li,
int  s_li,
int  f_li,
int  m_lo,
int  s_lo,
int  f_lo,
int  flag 
)

Guess the manufacturer name of CD media from the ATIP addresses of lead-in and lead-out.

(Currently only lead-in is interpreted. Lead-out may in future be used to identify the media type in more detail.) The parameters of this call should be obtained by burn_disc_read_atip(d), burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0), burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo).

Parameters
m_li"minute" part of ATIP lead-in or start_lba
s_li"second" of lead-in or start_lba
f_li"frame" of lead-in
m_lo"minute" part of ATIP lead-out
s_lo"second" of lead-out
f_lo"frame" of lead-out
flagBitfield for control purposes, bit0= append a text "(aka ...)" to reply if other brands or vendor names are known.
Returns
Printable text or NULL on memory shortage. Dispose by free() when no longer needed.
Since
0.7.2

◆ burn_guess_manufacturer()

char * burn_guess_manufacturer ( int  profile_no,
char *  manuf_code,
char *  media_code,
int  flag 
)

Guess the name of a manufacturer by profile number, manufacturer code and media code.

The profile number can be obtained by burn_disc_get_profile(), the other two parameters can be obtained as media_code1 and media_code2 by burn_disc_get_media_id().

Parameters
profile_noProfile number (submit -1 if not known)
manuf_codeManufacturer code from media (e.g. "RICOHJPN")
media_codeMedia ID code from media (e.g. "W11")
flagBitfield for control purposes, submit 0
Returns
Printable text or NULL on memory shortage. If the text begins with "Unknown " then no item of the manufacturer list matched the codes. Dispose by free() when no longer needed.
Since
0.7.2

◆ burn_initialize()

int burn_initialize ( void  )

Initialize the library.

This must be called before using any other functions in the library. It may be called more than once with no effect. It is possible to 'restart' the library by shutting it down and re-initializing it. Once this was necessary if you follow the older and more general way of accessing a drive via burn_drive_scan() and burn_drive_grab(). See burn_drive_scan_and_grab() with its strong urges and its explanations.

Returns
Nonzero if the library was able to initialize; zero if initialization failed.

Referenced by main().

◆ burn_is_aborting()

int burn_is_aborting ( int  flag)

◆ burn_lba_to_msf()

void burn_lba_to_msf ( int  lba,
int *  m,
int *  s,
int *  f 
)

Convert an lba to minute-second-frame (MSF)

Parameters
lbaThe lba
mReturns the minute component
sReturns the second component
fReturns the frame component

◆ burn_list_sev_texts()

char * burn_list_sev_texts ( int  flag)

Return a blank separated list of severity names.

Sorted from low to high severity.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
A constant string with the severity names
Since
1.2.6

◆ burn_lookup_device_link()

int burn_lookup_device_link ( char *  dev_adr,
char  link_adr[],
char *  dir_adr,
char **  templ,
int  num_templ,
int  flag 
)

Try to convert a given drive device file address into the address of a symbolic link that points to this drive address.

Modern GNU/Linux systems may shuffle drive addresses from boot to boot. The udev daemon is supposed to create links which always point to the same drive, regardless of its system address. This call tries to find such links.

Parameters
dev_adrShould contain a drive address as returned by burn_drive_scan().
link_adrAn application provided array of at least BURN_DRIVE_ADR_LEN characters size. The found link address gets copied to it.
dir_adrThe address of the directory where to look for links. Normally: "/dev"
templAn array of pointers to name templates, which links have to match. A symbolic link in dir_adr matches a name template if it begins by that text. E.g. link address "/dev/dvdrw1" matches template "dvdrw". If templ is NULL, then the default array gets used: {"dvdrw", "cdrw", "dvd", "cdrom", "cd"} If several links would match, then a link will win, which matches the template with the lowest array index. Among these candidates, the one with the lowest strcmp() rank will be chosen as link_adr.
num_templNumber of array elements in templ.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
<0 severe error, 0 failed to search, 2 nothing found 1 success, link_adr is valid
Since
1.1.4

◆ burn_make_input_sheet_v07t()

int burn_make_input_sheet_v07t ( unsigned char *  text_packs,
int  num_packs,
int  start_tno,
int  track_count,
char **  result,
int *  char_code,
int  flag 
)

Convert an array of CD-TEXT packs into the text format of Sony CD-TEXT Input Sheet Version 0.7T .

Parameters
text_packsArray of bytes which form CD-TEXT packs of 18 bytes each. For a description of the format of the array, see file doc/cdtext.txt. No header of 4 bytes must be prepended which would tell the number of pack bytes + 2. This parameter may be NULL if the currently attached array of packs shall be removed.
num_packsThe number of 18 byte packs in text_packs.
start_tnoThe start number of track counting, if known from CD table-of-content or other sources. Submit 0 to enable the attempt to read it and the track_count from pack type 0x8f.
track_countThe number of tracks, if known from CD table-of-content or orther sources.
resultWill return the buffer with Sheet text. Dispose by free() when no longer needed. It will be filled by the text for the v07t sheet file plus a trailing 0-byte. (Be aware that double-byte characters might contain 0-bytes, too.) Each CD-TEXT language block starts by the line "Input Sheet Version = 0.7T" and a "Remarks" line that tells the block number.
char_codeReturns the character code of the pack array: 0x00 = ISO-8859-1 0x01 = 7 bit ASCII 0x80 = MS-JIS (japanese Kanji, double byte characters) The presence of a code value that is not in this list will cause this function to fail.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 tells the number of valid text bytes in result. This does not include the trailing 0-byte. <= 0 indicates failure.
Since
1.3.2

◆ burn_msf_to_lba()

int burn_msf_to_lba ( int  m,
int  s,
int  f 
)

Convert a minute-second-frame (MSF) value to an lba.

Parameters
mMinute component
sSecond component
fFrame component
Returns
The lba

◆ burn_msf_to_sectors()

int burn_msf_to_sectors ( int  m,
int  s,
int  f 
)

Convert a minute-second-frame (MSF) value to sector count.

Parameters
mMinute component
sSecond component
fFrame component
Returns
The sector count

◆ burn_msgs_obtain()

int burn_msgs_obtain ( char *  minimum_severity,
int *  error_code,
char  msg_text[],
int *  os_errno,
char  severity[] 
)

Obtain the oldest pending libburn message from the queue which has at least the given minimum_severity.

This message and any older message of lower severity will get discarded from the queue and is then lost forever.

Parameters
minimum_severitymay be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL". To call with minimum_severity "NEVER" will discard the whole queue.
error_codeWill become a unique error code as listed in libburn/libdax_msgs.h
msg_textMust provide at least BURN_MSGS_MESSAGE_LEN bytes.
os_errnoWill become the eventual errno related to the message
severityWill become the severity related to the message and should provide at least 80 bytes.
Returns
1 if a matching item was found, 0 if not, <0 for severe errors
Since
0.2.6

◆ burn_msgs_set_severities()

int burn_msgs_set_severities ( char *  queue_severity,
char *  print_severity,
char *  print_id 
)

Control queueing and stderr printing of messages from libburn.

Severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL".

Parameters
queue_severityGives the minimum limit for messages to be queued. Default: "NEVER". If you queue messages then you must consume them by burn_msgs_obtain().
print_severityDoes the same for messages to be printed directly to stderr. Default: "FATAL".
print_idA text prefix to be printed before the message.
Returns
>0 for success, <=0 for error
Since
0.2.6

Referenced by main().

◆ burn_msgs_submit()

int burn_msgs_submit ( int  error_code,
char  msg_text[],
int  os_errno,
char  severity[],
struct burn_drive *  d 
)

Submit a message to the libburn queueing system.

It will be queued or printed as if it was generated by libburn itself.

Parameters
error_codeThe unique error code of your message. Submit 0 if you do not have reserved error codes within the libburnia project.
msg_textNot more than BURN_MSGS_MESSAGE_LEN characters of message text.
os_errnoEventual errno related to the message. Submit 0 if the message is not related to a operating system error.
severityOne of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
dAn eventual drive to which the message shall be related. Submit NULL if the message is not specific to a particular drive object.
Returns
1 if message was delivered, <=0 if failure
Since
0.4.0

◆ burn_nominal_slowdown()

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 
)

Waits until the time has elapsed since the given previous time to transmit the given byte count with the given speed in KB/second (KB = 1000 bytes).

This call may be used between random access read operations like burn_read_data() in order to force a slower speed than the drive is willing to use if it gets read requests as fast as it delivers data.

The parameter us_corr carries microseconds of time deviations from one call to the next one. Such deviations may happen because of small inexactnesses of the sleeper function and because of temporary delays in the data supply so that sleeping for a negative time span would have been necessary. The next call will reduce or enlarge its own sleeping period by this value.

Parameters
kb_per_secondthe desired speed in 1000 bytes per second. Supplied by the caller. @max_corr the maximum backlog in microseconds which shall be compensated by the next call. Supplied by the caller. Not more than 1 billion = 1000 seconds.
prev_timetime keeper updated by burn_nominal_slowdown(). The caller provides the memory and elsewise should carry it unchanged from call to call.
us_corrupdated by burn_nominal_slowdown(). See above. The caller provides the memory and elsewise should carry it unchanged from call to call.
b_since_prevbyte count since the previous call. This number has to be counted and supplied by the caller.
flagBitfield for control purposes: bit0= initialize *prev_time and *us_corr, ignore other parameters, do not wait
Returns
2=no wait because no usable kb_per_second , 1=success , 0=failure
Since
1.5.4

◆ burn_obtain_profile_name()

int burn_obtain_profile_name ( int  profile_code,
char  name[80] 
)

Obtains the profile name associated with a profile code.

Parameters
profile_codethe profile code to be translated
namereturns the profile name (e.g. "DVD+RW")
Returns
1= known profile code , 0= unknown profile code
Since
0.7.0

◆ burn_offst_source_new()

struct burn_source * burn_offst_source_new ( struct burn_source inp,
struct burn_source prev,
off_t  start,
off_t  size,
int  flag 
)

Creates an offset source which shall provide a byte interval of a stream to its consumer.

It is supposed to be chain-linked with other offset sources which serve neighboring consumers. The chronological sequence of consumers and the sequence of offset sources must match. The intervals of the sources must not overlap.

A chain of these burn_source objects may be used to feed multiple tracks from one single stream of input bytes. Each of the offset sources will skip the bytes up to its start address and provide the prescribed number of bytes to the track. Skipping takes into respect the bytes which have been processed by eventual predecessors in the chain. Important: It is not allowed to free an offset source before its successor has ended its work. Best is to keep them all until all tracks are done.

Parameters
inpThe burn_source object from which to read stream data. E.g. created by burn_file_source_new().
prevThe eventual offset source object which shall read data from inp before the new offset source will begin its own work. This must either be a result of burn_offst_source_new() or it must be NULL.
startThe byte address where to start reading bytes for the consumer. inp bytes may get skipped to reach this address.
sizeThe number of bytes to be delivered to the consumer. If size is <= 0 then it may be set later by a call of method set_size(). If it is >= 0, then it can only be changed if flag bit0 was set with burn_offst_source_new().
flagBitfield for control purposes bit0 = Prevent set_size() from overriding interval sizes > 0. If such a size is already set, then the new one will only affect the reply of get_size(). See also above struct burn_source.
Since
1.2.0
Returns
Pointer to a burn_source object, later to be freed by burn_source_free(). NULL indicates failure.
Since
0.8.8

◆ burn_os_alloc_buffer()

void * burn_os_alloc_buffer ( size_t  amount,
int  flag 
)

Allocate a memory area that is suitable for reading with a file descriptor opened by burn_os_open_track_src().

Parameters
amountNumber of bytes to allocate. This should be a multiple of the operating system's i/o block size. 32 KB is guaranteed by libburn to be safe.
flagBitfield for control purposes (unused yet, submit 0).
Returns
The address of the allocated memory, or NULL on failure. A non-NULL return value has finally to be disposed via burn_os_free_buffer().
Since
0.7.4

◆ burn_os_free_buffer()

int burn_os_free_buffer ( void *  buffer,
size_t  amount,
int  flag 
)

Dispose a memory area which was obtained by burn_os_alloc_buffer(),.

Parameters
bufferMemory address to be freed.
amountThe number of bytes which was allocated at that address.
flagBitfield for control purposes (unused yet, submit 0).
Returns
1 success , <=0 failure
Since
0.7.4

◆ burn_os_open_track_src()

int burn_os_open_track_src ( char *  path,
int  open_flags,
int  flag 
)

Opens a file with eventual acceleration preparations which may depend on the operating system and on compile time options of libburn.

You may use this call instead of open(2) for opening file descriptors which shall be handed to burn_fd_source_new(). This should only be done for tracks with BURN_BLOCK_MODE1 (2048 bytes per block).

If you use this call then you MUST allocate the buffers which you use with read(2) by call burn_os_alloc_buffer(). Read sizes MUST be a multiple of a safe buffer amount. Else you risk that track data get altered during transmission. burn_disk_write() will allocate a suitable read/write buffer for its own operations. A fifo created by burn_fifo_source_new() will allocate suitable memory for its buffer if called with flag bit0 and a multiple of a safe buffer amount.

Parameters
pathThe file address to open
open_flagsThe flags as of man 2 open. Normally just O_RDONLY.
flagBitfield for control purposes (unused yet, submit 0).
Returns
A file descriptor as of open(2). Finally to be disposed by close(2). -1 indicates failure.
Since
0.7.4

◆ burn_precheck_write()

int burn_precheck_write ( struct burn_write_opts *  o,
struct burn_disc *  disc,
char  reasons[BURN_REASONS_LEN],
int  silent 
)

Examines a completed setup for burn_disc_write() whether it is permissible with drive and media.

This function is called by burn_disc_write() but an application might be interested in this check in advance.

Parameters
oThe options for the writing operation.
discThe description of the disc to be created
reasonsEventually returns a list of rejection reason statements
silent1= do not issue error messages , 0= report problems
Returns
1 ok, -1= no recordable media detected, 0= other failure
Since
0.3.4

◆ burn_preset_device_open()

void burn_preset_device_open ( int  exclusive,
int  blocking,
int  abort_on_busy 
)

Set parameters for behavior on opening device files.

To be called early after burn_initialize() and before any bus scan. But not mandatory at all. Parameter value 1 enables a feature, 0 disables.
Default is (1,0,0). Have a good reason before you change it.

Parameters
exclusive0 = no attempt to make drive access exclusive. 1 = Try to open only devices which are not marked as busy and try to mark them busy if opened successfully. (O_EXCL on GNU/Linux , flock(LOCK_EX) on FreeBSD.) 2 = in case of a SCSI device, also try to open exclusively the matching /dev/sr, /dev/scd and /dev/st . One may select a device SCSI file family by adding 0 = default family 4 = /dev/srd 8 = /dev/scdd 16 = /dev/sgd Do not use other values ! Add 32 to demand on GNU/Linux an exclusive lock by fcntl(,F_SETLK,) after open() has succeeded.
blockingTry to wait for drives which do not open immediately but also do not return an error as well. (O_NONBLOCK) This might stall indefinitely with /dev/hdX hard disks.
abort_on_busyUnconditionally abort process when a non blocking exclusive opening attempt indicates a busy drive. Use this only after thorough tests with your app.
Since
0.2.2

◆ burn_random_access_write()

int burn_random_access_write ( struct burn_drive *  d,
off_t  byte_address,
char *  data,
off_t  data_count,
int  flag 
)

Write data in random access mode.

The drive must be grabbed successfully before calling this function which circumvents usual libburn session processing and rather writes data without preparations or finalizing. This will work only with overwritable media which are also suitable for burn_write_opts_set_start_byte(). The same address alignment restrictions as with this function apply. I.e. for DVD it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data to be written is subject to the same media dependent alignment rules. Again, 32 KiB is most safe. Call burn_disc_get_multi_caps() can obtain the necessary media info. See resulting struct burn_multi_caps elements .start_adr , .start_alignment , .start_range_low , .start_range_high . Other than burn_disc_write() this is a synchronous call which returns only after the write transaction has ended (successfully or not). So it is wise not to transfer giant amounts of data in a single call. Important: Data have to fit into the already formatted area of the media.

If the burn_drive object is in simulation mode, then no actual write operation or synchronization of the drive buffer will happen. See burn_drive_reset_simulate().

Parameters
dThe drive to which to write
byte_addressThe start address of the write in byte (1 LBA unit = 2048 bytes) (do respect media alignment)
dataThe bytes to be written
data_countThe number of those bytes (do respect media alignment) data_count == 0 is permitted (e.g. to flush the drive buffer without further data transfer).
flagBitfield for control purposes: bit0 = flush the drive buffer after eventual writing
Returns
1=successful , <=0 : number of transferred bytes * -1
Since
0.4.0

◆ burn_read_audio()

int burn_read_audio ( struct burn_drive *  d,
int  sector_no,
char  data[],
off_t  data_size,
off_t *  data_count,
int  flag 
)

Read CD audio sectors in random access mode.

The drive must be grabbed successfully before calling this function. Only CD audio tracks with 2352 bytes per sector can be read this way. I.e. not data tracks, not CD-video-stream, ...

Note that audio data do not have exact block addressing. If you read a sequence of successive blocks then you will get a seamless stream of data. But the actual start and end position of this audio stream will differ by a few dozens of milliseconds, depending on individual CD and individual drive. Expect leading and trailing zeros, as well as slight truncation.

Parameters
dThe drive from which to read. It must be a real MMC drive (i.e. not a stdio file) and it must have a CD loaded (i.e. not DVD or BD).
sector_noThe sector number (Logical Block Address) It may be slightly below 0, depending on drive and medium. -150 is a lower limit.
dataA memory buffer capable of taking data_size bytes
data_sizeThe amount of data to be read. This must be aligned to full multiples of 2352.
data_countThe amount of data actually read (interesting on error)
flagBitfield for control purposes: bit0= - reserved - bit1= do not submit error message if read error bit2= on error do not try to read a second time with single block steps. bit3= Enable DAP : "flaw obscuring mechanisms like audio data mute and interpolate" bit4= return -3 on SCSI error 5 64 00 ILLEGAL MODE FOR THIS TRACK and prevent this error from being reported as event message. Do not retry reading in this case. (Useful to try the last two blocks of a CD track which might be non-audio because of TAO.) bit5= issue messages with severity DEBUG if they would be suppressed by bit1.
Since
1.4.0
Returns
1=successful , <=0 an error occurred with bit3: -2= permission denied error
Since
1.2.6

◆ burn_read_data()

int burn_read_data ( struct burn_drive *  d,
off_t  byte_address,
char  data[],
off_t  data_size,
off_t *  data_count,
int  flag 
)

Read data in random access mode.

The drive must be grabbed successfully before calling this function. With all currently supported drives and media the byte_address has to be aligned to 2048 bytes. Only data tracks with 2048 bytes per sector can be read this way. I.e. not CD-audio, not CD-video-stream ... This is a synchronous call which returns only after the full read job has ended (successfully or not). So it is wise not to read giant amounts of data in a single call.

Parameters
dThe drive from which to read
byte_addressThe start address of the read in byte (aligned to 2048)
dataA memory buffer capable of taking data_size bytes
data_sizeThe amount of data to be read. This does not have to be aligned to any block size.
data_countThe amount of data actually read (interesting on error) The counted bytes are supposed to be valid.
flagBitfield for control purposes: bit0= - reserved - bit1= do not submit error message if read error bit2= on error do not try to read a second time with single block steps.
Since
0.5.2 bit3= return -2 on permission denied error rather than issuing a warning message.
1.0.6 bit4= return -3 on SCSI error 5 64 00 ILLEGAL MODE FOR THIS TRACK and prevent this error from being reported as event message. Do not retry reading in this case. (Useful to try the last two blocks of a CD track which might be non-data because of TAO.)
1.2.6 bit5= issue messages with severity DEBUG if they would be suppressed by bit1.
1.4.0
Returns
1=successful , <=0 an error occurred with bit3: -2= permission denied error
Since
0.4.0

◆ burn_read_opts_free()

void burn_read_opts_free ( struct burn_read_opts *  opts)

Frees a read_opts struct created with burn_read_opts_new.

Parameters
optswrite_opts to free

◆ burn_read_opts_new()

struct burn_read_opts * burn_read_opts_new ( struct burn_drive *  drive)

Creates a read_opts struct for reading from the specified drive must be freed with burn_read_opts_free.

Parameters
driveThe drive to read from
Returns
The read_opts

◆ burn_read_opts_read_subcodes_audio()

void burn_read_opts_read_subcodes_audio ( struct burn_read_opts *  opts,
int  subcodes_audio 
)

Sets whether to read subcodes from audio tracks or not.

Parameters
optsThe read opts to change
subcodes_audioIf non-zero, read subcodes from audio tracks on the disc.

◆ burn_read_opts_read_subcodes_data()

void burn_read_opts_read_subcodes_data ( struct burn_read_opts *  opts,
int  subcodes_data 
)

Sets whether to read subcodes from data tracks or not.

Parameters
optsThe read opts to change
subcodes_dataIf non-zero, read subcodes from data tracks on the disc.

◆ burn_read_opts_report_recovered_errors()

void burn_read_opts_report_recovered_errors ( struct burn_read_opts *  opts,
int  report_recovered_errors 
)

Sets whether to report recovered errors or not.

Parameters
optsThe read opts to change
report_recovered_errorsIf non-zero, recovered errors will be reported.

◆ burn_read_opts_set_c2errors()

void burn_read_opts_set_c2errors ( struct burn_read_opts *  opts,
int  c2errors 
)

Sets whether to report c2 errors or not.

Parameters
optsThe read opts to change
c2errorsIf non-zero, report c2 errors.

◆ burn_read_opts_set_hardware_error_recovery()

void burn_read_opts_set_hardware_error_recovery ( struct burn_read_opts *  opts,
int  hardware_error_recovery 
)

Sets whether to recover errors if possible.

Parameters
optsThe read opts to change
hardware_error_recoveryIf non-zero, attempt to recover errors if possible.

◆ burn_read_opts_set_hardware_error_retries()

void burn_read_opts_set_hardware_error_retries ( struct burn_read_opts *  opts,
unsigned char  hardware_error_retries 
)

Sets the number of retries to attempt when trying to correct an error.

Parameters
optsThe read opts to change
hardware_error_retriesThe number of retries to attempt when correcting an error.

◆ burn_read_opts_set_raw()

void burn_read_opts_set_raw ( struct burn_read_opts *  opts,
int  raw_mode 
)

Sets whether to read in raw mode or not.

Parameters
optsThe read opts to change
raw_modeIf non-zero, reading will be done in raw mode, so that everything in the data tracks on the disc is read, including headers.

◆ burn_read_opts_transfer_damaged_blocks()

void burn_read_opts_transfer_damaged_blocks ( struct burn_read_opts *  opts,
int  transfer_damaged_blocks 
)

Sets whether blocks with unrecoverable errors should be read or not.

Parameters
optsThe read opts to change
transfer_damaged_blocksIf non-zero, blocks with unrecoverable errors will still be read.

◆ burn_scsi_transport_id()

char * burn_scsi_transport_id ( int  flag)

Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time.

For the library compatibility check, BURN_*_VERSION in configure.ac are not decisive. Only the three numbers above do matter. Usage discussion:

Some developers of the libburnia project have differing opinions how to ensure the compatibility of libraries and applications.

It is about whether to use at compile time and at runtime the version numbers isoburn_header_version_* provided here. Thomas Schmitt advises to use them. Vreixo Formoso advises to use other means.

At compile time:

Vreixo Formoso advises to leave proper version matching to properly programmed checks in the the application's build system, which will eventually refuse compilation.

Thomas Schmitt advises to use the macros defined here for comparison with the application's requirements of library revisions and to eventually break compilation.

Both advises are combinable. I.e. be master of your build system and have #if checks in the source code of your application, nevertheless.

At runtime (via *_is_compatible()):

Vreixo Formoso advises to compare the application's requirements of library revisions with the runtime library. This is to enable runtime libraries which are young enough for the application but too old for the lib*.h files seen at compile time.

Thomas Schmitt advises to compare the header revisions defined here with the runtime library. This is to enforce a strictly monotonous chain of revisions from app to header to library, at the cost of excluding some older libraries.

These two advises are mutually exclusive. Obtain the id string of the SCSI transport interface. This interface may be a system specific adapter module of libburn or an adapter to a supporting library like libcdio.

Parameters
flagBitfield for control puposes, submit 0 for now
Returns
A pointer to the id string. Do not alter the string content.
Since
0.7.6

◆ burn_sectors_to_msf()

void burn_sectors_to_msf ( int  sectors,
int *  m,
int *  s,
int *  f 
)

Convert a sector count to minute-second-frame (MSF)

Parameters
sectorsThe sector count
mReturns the minute component
sReturns the second component
fReturns the frame component

◆ burn_session_add_track()

int burn_session_add_track ( struct burn_session *  s,
struct burn_track *  t,
unsigned int  pos 
)

Add a track to a session at specified position.

Parameters
sSession to add to
tTrack to insert in session
posposition to add at (BURN_POS_END is "at the end")
Returns
0 for failure, 1 for success

Referenced by libburner_payload().

◆ burn_session_by_cue_file()

int burn_session_by_cue_file ( struct burn_session *  session,
char *  path,
int  fifo_size,
struct burn_source **  fifo,
unsigned char **  text_packs,
int *  num_packs,
int  flag 
)

Read a CDRWIN cue sheet file and equip the session object by tracks and CD-TEXT according to the content of the file.

For a description of CDRWIN file format see http://digitalx.org/cue-sheet/syntax/ Fully supported commands are: CATALOG , CDTEXTFILE , FLAGS , INDEX , ISRC , PERFORMER , POSTGAP , PREGAP , REM , SONGWRITER , TITLE Further supported commands introduced by cdrecord (usage like PERFORMER): ARRANGER , COMPOSER , MESSAGE Partly supported commands are: FILE which supports only types BINARY , MOTOROLA , WAVE TRACK which supports only datatypes AUDIO , MODE1/2048 Unsupported types of FILE or TRACK lead to failure of the call. libburn does not yet support mixing of AUDIO and MODE1/2048. So this call will fail if such a mix is found. CD-TEXT information is allowed only if all tracks are of datatype AUDIO. Empty lines and lines which start by '#' are ignored.

Parameters
sessionSession where to attach tracks. It must not yet have tracks or else this call will fail.
pathFilesystem address of the CDRWIN cue sheet file. Normally with suffix .cue
fifo_sizeNumber of bytes in fifo. This will be rounded up by the block size of the track mode. <= 0 means no fifo.
fifoReturns a reference to the burn_source object that was installed as fifo between FILE and the track burn sources. One may use this to inquire the fifo state. Dispose it by burn_source_free() when no longer needed. It is permissible to pass this parameter to libburn as NULL, in order to immediately drop ownership on the fifo.
text_packsReturns pre-formatted CD-TEXT packs resulting from cue sheet command CDTEXTFILE. To be used with call burn_write_opts_set_leadin_text(). It is permissible to pass this parameter to libburn as NULL, in order to disable CDTEXTFILE.
num_packsReturns the number of 18 byte records in text_packs.
flagBitfield for control purposes. bit0= Do not attach CD-TEXT information to session and tracks. Do not load text_packs. bit1= Do not use media catalog string of session or ISRC strings of tracks for writing to Q sub-channel.
Returns
> 0 indicates success, <= 0 indicates failure
Since
1.2.0

◆ burn_session_create()

struct burn_session * burn_session_create ( void  )

Create a new session.

Returns
Pointer to a burn_session object or NULL on failure.

Referenced by libburner_payload().

◆ burn_session_dispose_cdtext()

int burn_session_dispose_cdtext ( struct burn_session *  s,
int  block 
)

Remove all CD-TEXT attributes of the given block from the session.

They were attached by burn_session_set_cdtext().

Parameters
sSession where to remove the CD-TEXT attribute
blockNumber of the language block in which the attribute shall appear. Possible values: 0 to 7. -1 causes text packs of all blocks to be removed.
Returns
> 0 is success, <= 0 failure
Since
1.2.0

◆ burn_session_free()

void burn_session_free ( struct burn_session *  s)

Free a session (and decrease reference count on all tracks inside)

Parameters
sSession to be freed

Referenced by libburner_payload().

◆ burn_session_get_cdtext()

int burn_session_get_cdtext ( struct burn_session *  s,
int  block,
int  pack_type,
char *  pack_type_name,
unsigned char **  payload,
int *  length,
int  flag 
)

Obtain a CD-TEXT attribute that was set by burn_session_set_cdtext()

Parameters
sSession to inquire
blockNumber of the language block to inquire.
pack_typePack type number to inquire. Used if pack_type_name is NULL or empty text. Else submit 0 and a name. Pack type 0x8f is generated automatically and may not be inquire in advance. Use burn_cdtext_from_session() to generate all packs including type 0x8f packs.
pack_type_nameThe pack type by name. See above burn_session_set_cdtext().
payloadWill return a pointer to text or binary bytes. Not a copy of data. Do not free() this address. If no text attribute is attached for pack type and block, then payload is returned as NULL. The return value will not indicate error in this case.
lengthWill return the number of bytes pointed to by payload. Including terminating 0-bytes.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
1 single byte char, 2 double byte char, <=0 error
Since
1.2.0

◆ burn_session_get_cdtext_par()

int burn_session_get_cdtext_par ( struct burn_session *  s,
int  char_codes[8],
int  copyrights[8],
int  block_languages[8],
int  flag 
)

Obtain the current settings as of burn_session_set_cdtext_par()

Parameters
sSession which to inquire
char_codesWill return Character Codes for block 0 to 7
copyrightsWill return Copyright bytes for block 0 to 7
block_languagesWill return Language Codes for block 0 to 7
flagBitfiled for control purposes. Unused yet. Submit 0.
Returns
<=0 failure, reply invalid, > 0 success, reply valid
Since
1.2.0

◆ burn_session_get_hidefirst()

int burn_session_get_hidefirst ( struct burn_session *  session)

Returns whether the first track of a session is hidden in the pregap.

Parameters
sessionthe session to query
Returns
non-zero means the first track is hidden

◆ burn_session_get_leadout_entry()

void burn_session_get_leadout_entry ( struct burn_session *  s,
struct burn_toc_entry entry 
)

Gets a copy of the toc_entry structure associated with a session's lead out.

Parameters
sSession to get the entry from
entryStruct for the library to fill out

◆ burn_session_get_sectors()

int burn_session_get_sectors ( struct burn_session *  s)

◆ burn_session_get_start_tno()

int burn_session_get_start_tno ( struct burn_session *  session,
int  flag 
)

Inquire the CD track start number, as set by default or by burn_session_set_start_tno().

Parameters
sessionThe session to be inquired
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 is the currently set CD track start number <= 0 indicates failure
Since
1.2.0

◆ burn_session_get_tracks()

struct burn_track ** burn_session_get_tracks ( struct burn_session *  s,
int *  num 
)

Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK.

Parameters
ssession to get track array for
numReturns the number of tracks in the array
Returns
array of tracks

◆ burn_session_hide_first_track()

void burn_session_hide_first_track ( struct burn_session *  s,
int  onoff 
)

Hide the first track in the "pre gap" of the disc.

Parameters
ssession to change
onoff1 to enable hiding, 0 to disable

◆ burn_session_input_sheet_v07t()

int burn_session_input_sheet_v07t ( struct burn_session *  session,
char *  path,
int  block,
int  flag 
)

Read a Sony CD-TEXT Input Sheet Version 0.7T file and attach its text attributes to the given session and its tracks for the given CD-TEXT block number.

This overrides previous settings made by burn_session_set_cdtext(), burn_track_set_cdtext(), burn_track_set_isrc(), burn_session_set_start_tno(). It can later be overridden by said function calls. The media catalog number from purpose specifier "UPC / EAN" gets into effect only if burn_write_opts_set_has_mediacatalog() is set to 0. The format of a v07t sheet file is documented in doc/cdtext.txt.

Parameters
sessionSession where to attach CD-TEXT attributes
pathLocal filesystem address of the sheet file which shall be read and interpreted.
blockNumber of the language block in which the attributes shall appear. Possible values: 0 to 7.
flagBitfield for control purposes. bit0= Permission to read multiple blocks from the given sheet file. Each block is supposed to begin by a line "Input Sheet Version = 0.7T". Therefore this permission is only valid if the input file begins by such a line.
Since
1.3.2 bit1= Do not use media catalog string of session or ISRC strings of tracks for writing to Q sub-channel.
1.2.0
Returns
> 0 indicates success and the number of interpreted blocks (1 if not flag bit0 is set). <= 0 indicates failure
Since
1.2.0

◆ burn_session_remove_track()

int burn_session_remove_track ( struct burn_session *  s,
struct burn_track *  t 
)

Remove a track from a session.

Parameters
sSession to remove track from
tTrack pointer to find and remove
Returns
0 for failure, 1 for success

◆ burn_session_set_cdtext()

int burn_session_set_cdtext ( struct burn_session *  s,
int  block,
int  pack_type,
char *  pack_type_name,
unsigned char *  payload,
int  length,
int  flag 
)

Attach text or binary data as CD-TEXT attributes to a session.

They can be used to generate CD-TEXT packs by burn_cdtext_from_session() or to write CD-TEXT packs into the lead-in of a CD SAO session. The latter happens only if no array of CD-TEXT packs is attached to the write options by burn_write_opts_set_leadin_text(). For details of the CD-TEXT format and of the payload content, see file doc/cdtext.txt .

Parameters
sSession where to attach CD-TEXT attribute
blockNumber of the language block in which the attribute shall appear. Possible values: 0 to 7.
pack_typePack type number. 0x80 to 0x8e. Used if pack_type_name is NULL or empty text. Else submit 0 and a name. Pack type 0x8f is generated automatically and may not be set by applications.
pack_type_nameThe pack type by name. Defined names are: 0x80 = "TITLE" 0x81 = "PERFORMER" 0x82 = "SONGWRITER" 0x83 = "COMPOSER" 0x84 = "ARRANGER" 0x85 = "MESSAGE" 0x86 = "DISCID" 0x87 = "GENRE" 0x88 = "TOC" 0x89 = "TOC2" 0x8d = "CLOSED" 0x8e = "UPC_ISRC" Names are recognized uppercase and lowercase.
payloadText or binary bytes. The data will be copied to session-internal memory. Pack types 0x80 to 0x85 contain 0-terminated cleartext encoded according to the block's Character Code. If double byte characters are used, then two 0-bytes terminate the cleartext. Pack type 0x86 is 0-terminated ASCII cleartext. Pack type 0x87 consists of two byte big-endian Genre code (see below BURN_CDTEXT_GENRE_LIST), and 0-terminated ASCII cleartext of genre description. Pack type 0x88 mirrors the session table-of-content. Pack type 0x89 is not understood yet. Pack types 0x8a to 0x8c are reserved. Pack type 0x8d contains ISO-8859-1 cleartext which is not to be shown by commercial audio CD players. Pack type 0x8e is ASCII cleartext with UPC/EAN code.
lengthNumber of bytes in payload. Including terminating 0-bytes.
flagBitfield for control purposes. bit0= payload contains double byte characters (with character code 0x80 MS-JIS japanese Kanji)
Returns
> 0 indicates success , <= 0 is failure
Since
1.2.0

◆ burn_session_set_cdtext_par()

int burn_session_set_cdtext_par ( struct burn_session *  s,
int  char_codes[8],
int  copyrights[8],
int  languages[8],
int  flag 
)

Set the Character Codes, the Copyright bytes, and the Language Codes for CD-TEXT blocks 0 to 7.

They will be used in the block summaries of text packs which get generated from text or binary data submitted by burn_session_set_cdtext() and burn_track_set_cdtext(). Character Code value can be 0x00 = ISO-8859-1 0x01 = 7 bit ASCII 0x80 = MS-JIS (japanesei Kanji, double byte characters) Copyright byte value can be 0x00 = not copyrighted 0x03 = copyrighted Language Code value will typically be 0x09 = English or 0x69 = Japanese. See below macros BURN_CDTEXT_LANGUAGES_0X00 and BURN_CDTEXT_LANGUAGES_0X45, but be aware that many of these codes have never been seen on CD, and that many of them do not have a character representation among the above Character Codes. Default is 0x09 = English for block 0 and 0x00 = Unknown for block 1 to 7. Copyright and Character Code are 0x00 for all blocks by default. See also file doc/cdtext.txt, "Format of a CD-TEXT packs array", "Pack type 0x8f".

Parameter value -1 leaves the current setting of the session parameter unchanged.

Parameters
sSession where to change settings
char_codesCharacter Codes for block 0 to 7
copyrightsCopyright bytes for block 0 to 7
languagesLanguage Codes for block 0 to 7
flagBitfiled for control purposes. Unused yet. Submit 0.
Returns
<=0 failure, > 0 success
Since
1.2.0

◆ burn_session_set_start_tno()

int burn_session_set_start_tno ( struct burn_session *  session,
int  tno,
int  flag 
)

Set the number which shall be written as CD track number with the first track of the session.

The following tracks will then get written with consecutive CD track numbers. The resulting number of the last track must not exceed 99. The lowest possible start number is 1, which is also the default. This setting applies only to CD SAO writing.

Parameters
sessionThe session to be manipulated
tnoA number between 1 and 99
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 indicates failure
Since
1.2.0

◆ burn_set_messenger()

int burn_set_messenger ( void *  messenger)

Replace the messenger object handle of libburn by a compatible handle obtained from a related library.

See also: libisofs, API function iso_get_messenger().

Parameters
messengerThe foreign but compatible message handle.
Returns
1 : success, <=0 : failure
Since
0.4.0

◆ burn_set_scsi_logging()

void burn_set_scsi_logging ( int  flag)

Enable or disable logging of SCSI commands.

This call can be made at any time - even before burn_initialize(). It is in effect for all active drives and currently not very thread safe for multiple drives.

Parameters
flagBitfield for control purposes. The default is 0. bit0= log to file /tmp/libburn_sg_command_log bit1= log to stderr bit2= flush output after each line
Since
0.7.4

◆ burn_set_signal_handling()

void burn_set_signal_handling ( void *  handle,
burn_abort_handler_t  handler,
int  mode 
)

Control built-in signal handling.

Either by setting an own handler or by activating the built-in signal handler.

A function parameter handle of NULL activates the built-in abort handler. Depending on mode it may cancel all drive operations, wait for all drives to become idle, exit(1). It may also prepare function burn_drive_get_status() for waiting and performing exit(1). Parameter handle may be NULL or a text that shall be used as prefix for pacifier messages of burn_abort_pacifier(). Other than with an application provided handler, the prefix char array does not have to be kept existing until the eventual signal event. Before version 0.7.8 only action 0 was available. I.e. the built-in handler waited for the drives to become idle and then performed exit(1) directly. But during burn_disc_write() onto real CD or DVD, FreeBSD 8.0 pauses the other threads until the signal handler returns. The new actions try to avoid this deadlock. It is advised to use action 3 at least during burn_disc_write(), burn_disc_erase(), burn_disc_format(): burn_set_signal_handling(text, NULL, 0x30); and to call burn_is_aborting(0) when the drive is BURN_DRIVE_IDLE. If burn_is_aborting(0) returns 1, then call burn_abort() and exit(1).

Parameters
handleOpaque handle eventually pointing to an application provided memory object
handlerA function to be called on signals, if the handling bits in parameter mode are set 0. It will get parameter handle as argument. flag will be 0. It should finally call burn_abort(). See there. If the handler function returns 2 or -2, then the wrapping signal handler of libburn will return and let the program continue its operations. Any other return value causes exit(1).
mode: bit0 - bit3: Handling of received signals: 0 Install libburn wrapping signal handler, which will call handler(handle, signum, 0) on nearly all signals 1 Enable system default reaction on all signals 2 Try to ignore nearly all signals 10 like mode 2 but handle SIGABRT like with mode 0 bit4 - bit7: With handler == NULL : Action of built-in handler. "control thread" is the one which called burn_set_signal_handling(). All actions activate receive mode 2 to ignore further signals. 0 Same as 1 (for pre-0.7.8 backward compatibility)
Since
0.7.8 1 Catch the control thread in abort handler, call burn_abort() with a patience value > 0 and finally exit(1). Does not always work with FreeBSD. 2 Call burn_abort() with patience -1 and return from handler. When the control thread calls burn_drive_get_status(), then call burn_abort() with patience 1 instead, and finally exit(1). Does not always work with FreeBSD. 3 Call burn_abort() with patience -1, return from handler. It is duty of the application to detect a pending abort condition by calling burn_is_aborting() and to wait for all drives to become idle. E.g. by calling burn_abort() with patience >0. 4 Like 3, but without calling burn_abort() with -1. Only the indicator of burn_is_aborting() gets set. bit8:
1.3.2 try to ignore SIGPIPE (regardless of bit0 - bit3)
0.2.6

Referenced by libburner_blank_disc(), libburner_format(), libburner_payload(), and main().

◆ burn_set_verbosity()

void burn_set_verbosity ( int  level)

ts A61006 : This is for development only.

Not suitable for applications. Set the verbosity level of the library. The default value is 0, which means that nothing is output on stderr. The more you increase this, the more debug output should be displayed on stderr for you.

Parameters
levelThe verbosity level desired. 0 for nothing, higher positive values for more information output.

◆ burn_sev_to_text()

int burn_sev_to_text ( int  severity_number,
char **  severity_name,
int  flag 
)

Convert a severity number into a severity name.

Parameters
severity_numberThe rank number: the higher, the more severe.
severity_nameA name as with burn_msgs_submit(), e.g. "SORRY".
flagBitfield for control purposes (unused yet, submit 0)
Returns
>0 success, <=0 failure
Since
0.4.4

◆ burn_source_free()

void burn_source_free ( struct burn_source s)

Free a burn_source (decrease its refcount and maybe free it)

Parameters
sSource to free

Referenced by libburner_payload().

◆ burn_structure_print_disc()

void burn_structure_print_disc ( struct burn_disc *  d)

◆ burn_structure_print_session()

void burn_structure_print_session ( struct burn_session *  s)

◆ burn_structure_print_track()

void burn_structure_print_track ( struct burn_track *  t)

◆ burn_text_to_sev()

int burn_text_to_sev ( char *  severity_name,
int *  severity_number,
int  flag 
)

Convert a severity name into a severity number, which gives the severity rank of the name.

Parameters
severity_nameA name as with burn_msgs_submit(), e.g. "SORRY".
severity_numberThe rank number: the higher, the more severe.
flagBitfield for control purposes (unused yet, submit 0)
Returns
>0 success, <=0 failure
Since
0.4.0

◆ burn_track_clear_indice()

int burn_track_clear_indice ( struct burn_track *  t,
int  flag 
)

Remove all index start addresses and reset to the default indexing of CD SAO sessions.

This means index 0 of track 1 reaches from LBA -150 to LBA -1. Index 1 of track 1 reaches from LBA 0 to track end. Index 1 of track 2 follows immediately. The same happens for all further tracks after the end of their predecessor.

Parameters
tThe track to be manipulated
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 means failure
Since
1.2.0

◆ burn_track_clear_isrc()

void burn_track_clear_isrc ( struct burn_track *  t)

Disable ISRC parameters for a track.

Parameters
tThe track to change

◆ burn_track_create()

struct burn_track * burn_track_create ( void  )

Create a track.

Referenced by libburner_payload().

◆ burn_track_define_data()

void burn_track_define_data ( struct burn_track *  t,
int  offset,
int  tail,
int  pad,
int  mode 
)

Define the data in a track.

Parameters
tthe track to define
offsetThe lib will write this many 0s before start of data
tailThe number of extra 0s to write after data
pad1 means the lib should pad the last sector with 0s if the track isn't exactly sector sized. (otherwise the lib will begin reading from the next track)
modedata format (bitfield)

Referenced by libburner_payload().

◆ burn_track_dispose_cdtext()

int burn_track_dispose_cdtext ( struct burn_track *  t,
int  block 
)

Remove all CD-TEXT attributes of the given block from the track.

They were attached by burn_track_set_cdtext().

Parameters
tTrack where to remove the CD-TEXT attribute.
blockNumber of the language block in which the attribute shall appear. Possible values: 0 to 7. -1 causes text packs of all blocks to be removed.
Returns
> 0 is success, <= 0 failure
Since
1.2.0

◆ burn_track_free()

void burn_track_free ( struct burn_track *  t)

Free a track.

Parameters
tTrack to free

Referenced by libburner_payload().

◆ burn_track_get_cdtext()

int burn_track_get_cdtext ( struct burn_track *  t,
int  block,
int  pack_type,
char *  pack_type_name,
unsigned char **  payload,
int *  length,
int  flag 
)

Obtain a CD-TEXT attribute that was set by burn_track_set_cdtext().

Parameters
tTrack to inquire
blockNumber of the language block to inquire.
pack_typePack type number to inquire. Used if pack_type_name is NULL or empty text. Else submit 0 and a name.
pack_type_nameThe pack type by name. See above burn_track_set_cdtext().
payloadWill return a pointer to text bytes. Not a copy of data. Do not free() this address. If no text attribute is attached for pack type and block, then payload is returned as NULL. The return value will not indicate error in this case.
lengthWill return the number of bytes pointed to by payload. Including terminating 0-bytes.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
1=single byte char , 2= double byte char , <=0 error
Since
1.2.0

◆ burn_track_get_counters()

int burn_track_get_counters ( struct burn_track *  t,
off_t *  read_bytes,
off_t *  written_bytes 
)

Tells how many source bytes have been read and how many data bytes have been written by the track during burn.

Parameters
tThe track to inquire
read_bytesNumber of bytes read from the track source
written_bytesNumber of bytes written to track
Since
0.2.6

◆ burn_track_get_entry()

void burn_track_get_entry ( struct burn_track *  t,
struct burn_toc_entry entry 
)

Gets a copy of the toc_entry structure associated with a track.

Parameters
tTrack to get the entry from
entryStruct for the library to fill out

◆ burn_track_get_mode()

int burn_track_get_mode ( struct burn_track *  track)

Gets the mode of a track.

Parameters
trackthe track to query
Returns
the track's mode

◆ burn_track_get_sectors()

int burn_track_get_sectors ( struct burn_track *  )

Tells how many sectors a track will have on disc, or already has on disc.

This includes offset, payload, tail, and post-gap, but not pre-gap. The result is NOT RELIABLE with tracks of undefined length

◆ burn_track_set_byte_swap()

int burn_track_set_byte_swap ( struct burn_track *  t,
int  swap_source_bytes 
)

Define whether a track shall swap bytes of its input stream.

Parameters
tThe track to change
swap_source_bytes0=do not swap, 1=swap byte pairs
Returns
1=success , 0=unacceptable value
Since
0.2.6

◆ burn_track_set_cdtext()

int burn_track_set_cdtext ( struct burn_track *  t,
int  block,
int  pack_type,
char *  pack_type_name,
unsigned char *  payload,
int  length,
int  flag 
)

Attach text or binary data as CD-TEXT attributes to a track.

The payload will be used to generate CD-TEXT packs by burn_cdtext_from_session() or to write CD-TEXT packs into the lead-in of a CD SAO session. This happens if the CD-TEXT attribute of the session gets generated, which has the same block number and pack type. In this case, each track should have such a CD-TEXT attribute, too. See burn_session_set_cdtext(). Be cautious not to exceed the maximum number of 253 payload packs per language block. Use burn_cdtext_from_session() to learn whether a valid array of CD-TEXT packs can be generated from your attributes.

Parameters
tTrack where to attach CD-TEXT attribute.
blockNumber of the language block in which the attribute shall appear. Possible values: 0 to 7.
pack_typePack type number. 0x80 to 0x85 or 0x8e. Used if pack_type_name is NULL or empty text. Else submit 0 and a name.
pack_type_nameThe pack type by name. Applicable names are: 0x80 = "TITLE" 0x81 = "PERFORMER" 0x82 = "SONGWRITER" 0x83 = "COMPOSER" 0x84 = "ARRANGER" 0x85 = "MESSAGE" 0x8e = "UPC_ISRC"
payload0-terminated cleartext. If double byte characters are used, then two 0-bytes terminate the cleartext.
lengthNumber of bytes in payload. Including terminating 0-bytes.
flagBitfield for control purposes. bit0= payload contains double byte characters (with character code 0x80 MS-JIS japanese Kanji)
Returns
> 0 indicates success , <= 0 is failure
Since
1.2.0

◆ burn_track_set_cdxa_conv()

int burn_track_set_cdxa_conv ( struct burn_track *  t,
int  value 
)

Activates CD XA compatibility modes.

libburn currently writes data only in CD mode 1. Some programs insist in sending data with additional management bytes. These bytes have to be stripped in order to make the input suitable for BURN_MODE1.

Parameters
tThe track to manipulate
value0= no conversion 1= strip 8 byte sector headers of CD-ROM XA mode 2 form 1 see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data all other values are reserved
Returns
1=success , 0=unacceptable value
Since
0.7.2

◆ burn_track_set_default_size()

int burn_track_set_default_size ( struct burn_track *  t,
off_t  size 
)

Set a default track size to be used only if the track turns out to be of unpredictable length and if the effective write type demands a fixed size.

This can be useful to enable write types CD SAO or DVD DAO together with a track source like stdin. If the track source delivers fewer bytes than announced then the track will be padded up with zeros.

Parameters
tThe track to change
sizeThe size to set
Returns
0=failure 1=success
Since
0.3.4

◆ burn_track_set_index()

int burn_track_set_index ( struct burn_track *  t,
int  index_number,
unsigned int  relative_lba,
int  flag 
)

Define an index start address within a track.

The index numbers inside a track have to form sequence starting at 0 or 1 with no gaps up to the highest number used. They affect only writing of CD SAO sessions. The first index start address of a track must be 0. Blocks between index 0 and index 1 are considered to be located before the track start as of the table-of-content.

Parameters
tThe track to be manipulated
index_numberA number between 0 and 99
relative_lbaThe start address relative to the start of the burn_source of the track. It will get mapped to the appropriate absolute block address.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 means failure
Since
1.2.0

◆ burn_track_set_isrc()

void burn_track_set_isrc ( struct burn_track *  t,
char *  country,
char *  owner,
unsigned char  year,
unsigned int  serial 
)

Set the ISRC details for a track.

When writing to CD media, ISRC will get written into the Q sub-channel.

Parameters
tThe track to change
countrythe 2 char country code. Each character must be only numbers or letters.
owner3 char owner code. Each character must be only numbers or letters.
year2 digit year. A number in 0-99 (Yep, not Y2K friendly).
serial5 digit serial number. A number in 0-99999.

◆ burn_track_set_isrc_string()

int burn_track_set_isrc_string ( struct burn_track *  t,
char  isrc[13],
int  flag 
)

Set the composed ISRC string for a track.

This is an alternative to burn_track_set_isrc().

Parameters
tThe track to be manipulated
isrc12 characters which are composed from ISRC details. Format is CCOOOYYSSSSS, terminated by a 0-byte: Country, Owner, Year(decimal digits), Serial(decimal digits).
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 means failure
Since
1.2.0

◆ burn_track_set_postgap_size()

int burn_track_set_postgap_size ( struct burn_track *  t,
int  size,
int  flag 
)

Define whether a post-gap shall be written at the end of the track and how many sectors this gap shall have.

A post-gap occupies the range of an additional index of the track. It contains zeros. No bytes from the track source will be read for writing the post-gap. This setting affects only CD SAO write runs. MMC prescribes to add a post-gap to a data track which is followed by a non-data track. (But libburn does not yet support mixed mode CD SAO sessions.)

Parameters
tThe track to change
sizeNumber of sectors in the post-gap. -1 disables post-gap. libburn allows 0, but MMC does not propose this.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 means failure
Since
1.2.0

◆ burn_track_set_pregap_size()

int burn_track_set_pregap_size ( struct burn_track *  t,
int  size,
int  flag 
)

Define whether a pre-gap shall be written before the track and how many sectors this pre-gap shall have.

A pre-gap is written in the range of track index 0 and contains zeros (audio silence). No bytes from the track source will be read for writing the pre-gap. This setting affects only CD SAO write runs. The first track automatically gets a pre-gap of at least 150 sectors. Its size may be enlarged by this call. Further pre-gaps are demanded by MMC for tracks which follow tracks of a different mode. (But Mode mixing in CD SAO sessions is currently not supported by libburn.)

Parameters
tThe track to change
sizeNumber of sectors in the pre-gap. -1 disables pre-gap, except for the first track. libburn allows 0, but MMC does not propose this.
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
> 0 indicates success, <= 0 means failure
Since
1.2.0

◆ burn_track_set_size()

int burn_track_set_size ( struct burn_track *  t,
off_t  size 
)

Sets a fixed track size after the data source object has already been created.

Parameters
tThe track to operate on
sizethe number of bytes to use as track size
Returns
<=0 indicates failure , >0 success
Since
0.3.6

◆ burn_track_set_source()

enum burn_source_status burn_track_set_source ( struct burn_track *  t,
struct burn_source s 
)

Set the track's data source.

Parameters
tThe track to set the data source for
sThe data source to use for the contents of the track
Returns
An error code stating if the source is ready for use for writing the track, or if an error occurred

Referenced by libburner_payload().

◆ burn_version()

void burn_version ( int *  major,
int *  minor,
int *  micro 
)

Returns the library's version in its parts.

This is the runtime counterpart of the three build time macros burn_header_version_* below.

Parameters
majorThe major version number
minorThe minor version number
microThe micro version number

◆ burn_write_opts_auto_write_type()

enum burn_write_types burn_write_opts_auto_write_type ( struct burn_write_opts *  opts,
struct burn_disc *  disc,
char  reasons[BURN_REASONS_LEN],
int  flag 
)

As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write type and block type for a given write job described by opts and disc.

To be used after all other setups have been made, i.e. immediately before burn_disc_write().

Parameters
optsThe nearly complete write opts to change
discThe already composed session and track model
reasonsThis text string collects reasons for decision or failure
flagBitfield for control purposes: bit0= do not choose type but check the one that is already set bit1= do not issue error messages via burn_msgs queue (is automatically set with bit0)
Returns
Chosen write type. BURN_WRITE_NONE on failure.
Since
0.3.2

Referenced by libburner_payload().

◆ burn_write_opts_free()

void burn_write_opts_free ( struct burn_write_opts *  opts)

Frees a write_opts struct created with burn_write_opts_new.

Parameters
optswrite_opts to free

Referenced by libburner_payload().

◆ burn_write_opts_get_drive()

struct burn_drive * burn_write_opts_get_drive ( struct burn_write_opts *  opts)

Inquires the drive associated with a burn_write_opts object.

Parameters
optsobject to inquire
Returns
pointer to drive
Since
0.4.0

◆ burn_write_opts_new()

struct burn_write_opts * burn_write_opts_new ( struct burn_drive *  drive)

Creates a write_opts struct for burning to the specified drive.

The returned object must later be freed with burn_write_opts_free().

Parameters
driveThe drive to write with
Returns
The write_opts, NULL on error

Referenced by libburner_payload().

◆ burn_write_opts_set_dvd_obs()

void burn_write_opts_set_dvd_obs ( struct burn_write_opts *  opts,
int  obs 
)

Overrides the write chunk size for DVD and BD media which is normally determined according to media type and setting of stream recording.

A chunk size of 64 KB may improve throughput with bus systems which show latency problems.

Parameters
optsThe write opts to change
obsNumber of bytes which shall be sent by a single write command. 0 means automatic size, 32768 and 65336 are the only other accepted sizes for now.
Since
0.7.4

◆ burn_write_opts_set_fail21h_sev()

void burn_write_opts_set_fail21h_sev ( struct burn_write_opts *  opts,
char *  severity 
)

Set the severity to be used with write error messages which are potentially caused by not using write type BURN_WRITE_SAO on fast blanked DVD-RW.

Normally the call burn_write_opts_auto_write_type() can prevent such errors by looking for MMC feature 21h "Incremental Streaming Writable" which anounnces the capability for BURN_WRITE_TAO and multi session. Regrettable many drives announce feature 21h even if they only can do BURN_WRITE_SAO. This mistake becomes obvious by an early write error.

If you plan to call burn_drive_was_feat21_failure() and to repeat the burn attempt with BURN_WRITE_SAO, then set the severity of the error message low enough, so that the application does not see reason to abort.

Parameters
optsThe option object to be manipulated
severitySeverity as with burn_msgs_set_severities(). "ALL" or empty text means the default severity that is attributed to other kinds of write errors.

◆ burn_write_opts_set_fillup()

void burn_write_opts_set_fillup ( struct burn_write_opts *  opts,
int  fill_up_media 
)

Caution: still immature and likely to change.

Problems arose with sequential DVD-RW on one drive.

Controls whether the whole available space of the media shall be filled up by the last track of the last session.

Parameters
optsThe write opts to change
fill_up_mediaIf 1 : fill up by last track, if 0 = do not fill up
Since
0.3.4

◆ burn_write_opts_set_force()

void burn_write_opts_set_force ( struct burn_write_opts *  opts,
int  use_force 
)

Eventually makes libburn ignore the failure of some conformance checks:

  • the check whether CD write+block type is supported by the drive
  • the check whether the media profile supports simulated burning
    Parameters
    optsThe write opts to change
    use_force1=ignore above checks, 0=refuse work on failed check
    Since
    0.3.4

◆ burn_write_opts_set_format()

void burn_write_opts_set_format ( struct burn_write_opts *  opts,
int  format 
)

Sets the session format for a disc.

Parameters
optsThe write opts to change
formatThe session format to set

◆ burn_write_opts_set_has_mediacatalog()

void burn_write_opts_set_has_mediacatalog ( struct burn_write_opts *  opts,
int  has_mediacatalog 
)

This call activates the Media Catalog Number for writing.

The digits of that number have to be set by call burn_write_opts_set_mediacatalog().

Parameters
optsThe write opts to change
has_mediacatalog1= activate writing of catalog to Q sub-channel 0= deactivate it

◆ burn_write_opts_set_leadin_text()

int burn_write_opts_set_leadin_text ( struct burn_write_opts *  opts,
unsigned char *  text_packs,
int  num_packs,
int  flag 
)

Submit an array of CD-TEXT packs which shall be written to the Lead-in of a SAO write run on CD.

Parameters
optsThe option object to be manipulated
text_packsArray of bytes which form CD-TEXT packs of 18 bytes each. For a description of the format of the array, see file doc/cdtext.txt. No header of 4 bytes must be prepended which would tell the number of pack bytes + 2. This parameter may be NULL if the currently attached array of packs shall be removed.
num_packsThe number of 18 byte packs in text_packs. This parameter may be 0 if the currently attached array of packs shall be removed.
flagBitfield for control purposes. bit0= do not verify checksums bit1= repair mismatching checksums bit2= repair checksums if they are 00 00 with each pack
Returns
1 on success, <= 0 on failure
Since
1.2.0

◆ burn_write_opts_set_mediacatalog()

void burn_write_opts_set_mediacatalog ( struct burn_write_opts *  opts,
unsigned char  mediacatalog[13] 
)

The Q sub-channel of a CD may contain a Media Catalog Number of 13 decimal digits.

This call sets the string of digits, but does not yet activate it for writing.

Parameters
optsThe write opts to change
mediacatalogThe 13 decimal digits as ASCII bytes. I.e. '0' = 0x30.

◆ burn_write_opts_set_multi()

void burn_write_opts_set_multi ( struct burn_write_opts *  opts,
int  multi 
)

Sets the multi flag which eventually marks the emerging session as not being the last one and thus creating a BURN_DISC_APPENDABLE media.

Note: DVD-R[W] in write mode BURN_WRITE_SAO are not capable of this. DVD-R DL are not capable of this at all. libburn will refuse to write if burn_write_opts_set_multi() is enabled under such conditions.

Parameters
optsThe option object to be manipulated
multi1=media will be appendable, 0=media will be closed (default)
Since
0.2.6

Referenced by libburner_payload().

◆ burn_write_opts_set_obs_pad()

void burn_write_opts_set_obs_pad ( struct burn_write_opts *  opts,
int  pad 
)

Overrides the automatic decision whether to pad up the last write chunk to its full size.

This applies to DVD, BD and stdio: pseudo-drives. Note: This override may get enabled fixely already at compile time by defining macro Libburn_dvd_always_obs_paD .

Parameters
optsThe write opts to change
pad1 means to pad up in any case, 0 means automatic decision.
Since
1.2.4

◆ burn_write_opts_set_perform_opc()

void burn_write_opts_set_perform_opc ( struct burn_write_opts *  opts,
int  opc 
)

Sets whether to use opc or not with the write_opts struct.

Parameters
optsThe write opts to change
opcIf non-zero, optical power calibration will be performed at start of burn

Referenced by libburner_payload().

◆ burn_write_opts_set_simulate()

int burn_write_opts_set_simulate ( struct burn_write_opts *  opts,
int  sim 
)

Sets the simulate value for the write_opts struct .

This corresponds to the Test Write bit in MMC mode page 05h. Several media types do not support this. See struct burn_multi_caps.might_simulate for actual availability of this feature. If the media is suitable, the drive will perform burn_disc_write() as a simulation instead of effective write operations. This means that the media content and burn_disc_get_status() stay unchanged. Note: With stdio-drives, the target file gets eventually created, opened, lseeked, and closed, but not written. So there are effects on it. Note: Up to version 1.4.6 the call burn_random_access_write() after burn_disc_write() did not simulate because it does not get any burn_write_opts and the drive did not memorize the simulation state. This has changed now. burn_random_access_write() will not write after a simulated burn run. Use burn_drive_reset_simulate(drive, 0) if you really want to end simulation before you call burn_disc_write() with new write options.

Parameters
optsThe write opts to change
simNon-zero enables simulation, 0 enables real writing
Returns
Returns 1 on success and 0 on failure.

Referenced by libburner_payload().

◆ burn_write_opts_set_start_byte()

void burn_write_opts_set_start_byte ( struct burn_write_opts *  opts,
off_t  value 
)

Sets a start address for writing to media and write modes which are able to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW).

now). The address is given in bytes. If it is not -1 then a write run will fail if choice of start address is not supported or if the block alignment of the address is not suitable for media and write mode. Alignment to 32 kB blocks is supposed to be safe with DVD media. Call burn_disc_get_multi_caps() can obtain the necessary media info. See resulting struct burn_multi_caps elements .start_adr , .start_alignment , .start_range_low , .start_range_high .

Parameters
optsThe write opts to change
valueThe address in bytes (-1 = start at default address)
Since
0.3.0

◆ burn_write_opts_set_stdio_fsync()

void burn_write_opts_set_stdio_fsync ( struct burn_write_opts *  opts,
int  rhythm 
)

Sets the rhythm by which stdio pseudo drives force their output data to be consumed by the receiving storage device.

This forcing keeps the memory from being clogged with lots of pending data for slow devices.

Parameters
optsThe write opts to change
rhythmNumber of 2KB output blocks after which fsync(2) is performed. -1 means no fsync() 0 means default 1 means fsync() only at end,
Since
1.3.8 (noop before 1.3.8) elsewise the value must be >= 32. Default is currently 8192 = 16 MB.
0.7.4

◆ burn_write_opts_set_stream_recording()

void burn_write_opts_set_stream_recording ( struct burn_write_opts *  opts,
int  value 
)

Eventually makes use of the more modern write command AAh WRITE12 and sets the Streaming bit.

With DVD-RAM and BD this can override the traditional slowdown to half nominal speed. But if it speeds up writing then it also disables error management and correction. Weigh your priorities. This affects the write operations of burn_disc_write() and subsequent calls of burn_random_access_write().

Parameters
optsThe write opts to change
value0=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
0.4.6

◆ burn_write_opts_set_toc_entries()

void burn_write_opts_set_toc_entries ( struct burn_write_opts *  opts,
int  count,
struct burn_toc_entry toc_entries 
)

Supplies toc entries for writing - not normally required for cd mastering.

Parameters
optsThe write opts to change
countThe number of entries
toc_entries

◆ burn_write_opts_set_underrun_proof()

int burn_write_opts_set_underrun_proof ( struct burn_write_opts *  opts,
int  underrun_proof 
)

Controls buffer underrun prevention.

This is only needed with CD media and possibly with old DVD-R drives. All other media types are not vulnerable to burn failure due to buffer underrun.

Parameters
optsThe write opts to change
underrun_proofif non-zero, buffer underrun protection is enabled
Returns
Returns 1 if the drive announces to be capable of underrun prevention, Returns 0 if not.

Referenced by libburner_payload().

◆ burn_write_opts_set_write_type()

int burn_write_opts_set_write_type ( struct burn_write_opts *  opts,
enum burn_write_types  write_type,
int  block_type 
)

Sets the write type for the write_opts struct.

Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.

Parameters
optsThe write opts to change
write_typeThe write type to use
block_typeThe block type to use
Returns
Returns 1 on success and 0 on failure.

◆ libdax_audioxtr_destroy()

int libdax_audioxtr_destroy ( struct libdax_audioxtr **  xtr,
int  flag 
)

Clean up after extraction and destroy extractor object.

Parameters
xtrOpaque handle to extractor, *xtr is allowed to be NULL, xtr is set to NULL by this function
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 = destroyed object, 0 = was already destroyed
Since
0.2.4

◆ libdax_audioxtr_detach_fd()

int libdax_audioxtr_detach_fd ( struct libdax_audioxtr *  o,
int *  fd,
int  flag 
)

Try to obtain a file descriptor which will deliver extracted data to normal calls of read(2).

This may fail because the format is unsuitable for that, but WAVE (.wav) is ok. If this call succeeds the xtr object will have forgotten its file descriptor and libdax_audioxtr_read() will return a usage error. One may use *fd after libdax_audioxtr_destroy() and will have to close it via close(2) when done with it.

Parameters
oOpaque handle to extractor
fdReturns the file descriptor number
flagBitfield for control purposes bit0= do not dup(2) and close(2) but hand out original fd
Returns
1 success, 0 cannot hand out fd , -1 severe error
Since
0.2.4

◆ libdax_audioxtr_get_id()

int libdax_audioxtr_get_id ( struct libdax_audioxtr *  xtr,
char **  fmt,
char **  fmt_info,
int *  num_channels,
int *  sample_rate,
int *  bits_per_sample,
int *  msb_first,
int  flag 
)

Obtain identification parameters of opened audio source.

Parameters
xtrOpaque handle to extractor
fmtGets pointed to the audio file format id text: ".wav" , ".au"
fmt_infoGets pointed to a format info text telling parameters
num_channelse.g. 1=mono, 2=stereo, etc
sample_ratee.g. 11025, 44100
bits_per_samplee.g. 8= 8 bits per sample, 16= 16 bits ...
msb_firstByte order of samples: 0= Intel = Little Endian 1= Motorola = Big Endian
flagBitfield for control purposes (unused yet, submit 0)
Returns
>0 success, <=0 failure
Since
0.2.4

◆ libdax_audioxtr_get_size()

int libdax_audioxtr_get_size ( struct libdax_audioxtr *  o,
off_t *  size,
int  flag 
)

Obtain a prediction about the extracted size based on internal information of the formatted file.

Parameters
oOpaque handle to extractor
sizeGets filled with the predicted size
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 prediction was possible , 0 no prediction could be made
Since
0.2.4

◆ libdax_audioxtr_new()

int libdax_audioxtr_new ( struct libdax_audioxtr **  xtr,
char *  path,
int  flag 
)

Open an audio file, check whether suitable, create extractor object.

Parameters
xtrOpaque handle to extractor. Gets attached extractor object.
pathAddress of the audio file to extract. "-" is stdin (but might be not suitable for all futurely supported formats).
flagBitfield for control purposes (unused yet, submit 0)
Returns
>0 success 0 unsuitable format -1 severe error -2 path not found
Since
0.2.4

◆ libdax_audioxtr_read()

int libdax_audioxtr_read ( struct libdax_audioxtr *  xtr,
char  buffer[],
int  buffer_size,
int  flag 
)

Obtain next buffer full of extracted data in desired format (only raw audio for now).

Parameters
xtrOpaque handle to extractor
bufferGets filled with extracted data
buffer_sizeMaximum number of bytes to be filled into buffer
flagBitfield for control purposes bit0= do not stop at predicted end of data
Returns
>0 number of valid buffer bytes, 0 End of file -1 operating system reports error -2 usage error by application
Since
0.2.4

Generated for libburn by  doxygen 1.9.5