libcdio-paranoia 10.2+2.0.2
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
paranoia.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <cdio/paranoia/cdda.h>
#include "../cdda_interface/smallft.h"
#include <cdio/paranoia/version.h>
#include "p_block.h"
#include <cdio/paranoia/paranoia.h>
#include "overlap.h"
#include "gap.h"
#include "isort.h"
#include <errno.h>

Data Structures

struct  sync_result
 

Macros

#define MIN_SEEK_MS   6
 
#define rc(r)   (r->vector)
 
#define OVERLAP_ADJ   (MIN_WORDS_OVERLAP/2-1)
 

Typedefs

typedef struct sync_result sync_result_t
 

Enumerations

enum  { FLAGS_EDGE =0x1 , FLAGS_UNREAD =0x2 , FLAGS_VERIFIED =0x4 }
 

Functions

void paranoia_free (cdrom_paranoia_t *p)
 
void paranoia_modeset (cdrom_paranoia_t *p, int mode_flags)
 
lsn_t paranoia_seek (cdrom_paranoia_t *p, int32_t seek, int whence)
 
int16_t * cdio_paranoia_read (cdrom_paranoia_t *p, void(*callback)(long, paranoia_cb_mode_t))
 
int16_t * cdio_paranoia_read_limited (cdrom_paranoia_t *p, void(*callback)(long int, paranoia_cb_mode_t), int max_retries)
 
void cdio_paranoia_overlapset (cdrom_paranoia_t *p, long int overlap)
 
const char * cdio_paranoia_version (void)
 

Variables

const char * paranoia_cb_mode2str []
 
paranoia_mode_t debug_paranoia_mode
 
paranoia_cb_mode_t debug_paranoia_cb_mode
 
enum { ... }  paranoia_read_flags
 

Macro Definition Documentation

◆ MIN_SEEK_MS

#define MIN_SEEK_MS   6

◆ OVERLAP_ADJ

#define OVERLAP_ADJ   (MIN_WORDS_OVERLAP/2-1)

◆ rc

#define rc (   r)    (r->vector)

Typedef Documentation

◆ sync_result_t

typedef struct sync_result sync_result_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Flags indicating the status of a read samples.

Imagine the below enumeration values are #defines to be used in a bitmask rather than distinct values of an enum.

The variable part of the declaration is trickery to force the enum symbol values to be recorded in debug symbol tables. They are used to allow one refer to the enumeration value names in a debugger and in debugger expressions.

Enumerator
FLAGS_EDGE 

first/last N words of frame

FLAGS_UNREAD 

unread, hence missing and unmatchable

FLAGS_VERIFIED 

block read and verified

Function Documentation

◆ cdio_paranoia_overlapset()

void cdio_paranoia_overlapset ( cdrom_paranoia_t p,
long int  overlap 
)

◆ cdio_paranoia_read()

int16_t * cdio_paranoia_read ( cdrom_paranoia_t p,
void(*)(long, paranoia_cb_mode_t callback 
)

========================================================================== cdio_paranoia_read(), cdio_paranoia_read_limited()

These functions "read" the next sector of audio data and returns a pointer to a full sector of verified samples (2352 bytes).

The returned buffer is not to be freed by the caller. It will persist only until the next call to paranoia_read() for this p

◆ cdio_paranoia_read_limited()

int16_t * cdio_paranoia_read_limited ( cdrom_paranoia_t p,
void(*)(long int, paranoia_cb_mode_t callback,
int  max_retries 
)

The same as cdio_paranoia_read but the number of retries is set.

Parameters
pparanoia object.
callbackcallback routine which gets called with the status on each read.
max_retriesnumber of times to try re-reading a block before failing.
Returns
the block of CDIO_FRAMEIZE_RAW bytes (or CDIO_FRAMESIZE_RAW / 2 16-bit integers). Unless byte-swapping has been turned off the 16-bit integers Endian independent order.
See also
cdio_paranoia_read.

◆ cdio_paranoia_version()

const char * cdio_paranoia_version ( void  )

Get libcdio-paranoia version.

Returns
paranoia version string

References LIBCDIO_PARANOIA_VERSION.

◆ paranoia_free()

void paranoia_free ( cdrom_paranoia_t p)

◆ paranoia_modeset()

void paranoia_modeset ( cdrom_paranoia_t p,
int  mode_flags 
)

Set the kind of repair you want to on for reading. The modes are listed above

Parameters
pparanoia type
mode_flagsparanoia mode flags built from values in paranoia_mode_t, e.g. PARANOIA_MODE_FULL^PARANOIA_MODE_NEVERSKIP

◆ paranoia_seek()

lsn_t paranoia_seek ( cdrom_paranoia_t p,
int32_t  seek,
int  whence 
)

reposition reading offset.

Parameters
pparanoia type
seekbyte offset to seek to
whencelike corresponding parameter in libc's lseek, e.g. SEEK_SET or SEEK_END.

Variable Documentation

◆ debug_paranoia_cb_mode

paranoia_cb_mode_t debug_paranoia_cb_mode

◆ debug_paranoia_mode

paranoia_mode_t debug_paranoia_mode

The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions

◆ paranoia_cb_mode2str

const char* paranoia_cb_mode2str[]
Initial value:
= {
"read",
"verify",
"fixup edge",
"fixup atom",
"scratch",
"repair",
"skip",
"drift",
"backoff",
"overlap",
"fixup dropped",
"fixup duplicated",
"read error"
}

◆ 

enum { ... } paranoia_read_flags

Flags indicating the status of a read samples.

Imagine the below enumeration values are #defines to be used in a bitmask rather than distinct values of an enum.

The variable part of the declaration is trickery to force the enum symbol values to be recorded in debug symbol tables. They are used to allow one refer to the enumeration value names in a debugger and in debugger expressions.