Go to the documentation of this file.
28 #if HAVE_CDIO_PARANOIA_H
29 #include <cdio/cdda.h>
30 #include <cdio/paranoia.h>
31 #elif HAVE_CDIO_PARANOIA_PARANOIA_H
32 #include <cdio/paranoia/cdda.h>
33 #include <cdio/paranoia/paranoia.h>
62 s->drive = cdio_cddap_identify(
ctx->
url, CDDA_MESSAGE_LOGIT, &err);
71 if ((
ret = cdio_cddap_open(
s->drive)) < 0 || !
s->drive->opened) {
76 cdio_cddap_verbose_set(
s->drive, CDDA_MESSAGE_LOGIT, CDDA_MESSAGE_LOGIT);
78 cdio_cddap_speed_set(
s->drive,
s->speed);
80 s->paranoia = cdio_paranoia_init(
s->drive);
85 cdio_paranoia_modeset(
s->paranoia,
s->paranoia_mode);
88 if (
s->drive->bigendianp)
94 if (
s->drive->audio_last_sector != CDIO_INVALID_LSN &&
95 s->drive->audio_first_sector != CDIO_INVALID_LSN)
96 st->
duration =
s->drive->audio_last_sector -
s->drive->audio_first_sector;
97 else if (
s->drive->tracks)
98 st->
duration =
s->drive->disc_toc[
s->drive->tracks].dwStartSector;
101 for (
i = 0;
i <
s->drive->tracks;
i++) {
103 snprintf(title,
sizeof(title),
"track %02d",
s->drive->disc_toc[
i].bTrack);
105 s->drive->disc_toc[
i+1].dwStartSector, title);
108 s->last_sector = cdio_cddap_disc_lastsector(
s->drive);
120 buf = cdio_paranoia_read(
s->paranoia,
NULL);
124 if (err = cdio_cddap_errors(
s->drive)) {
129 if (err = cdio_cddap_messages(
s->drive)) {
137 memcpy(
pkt->
data, buf, CDIO_CD_FRAMESIZE_RAW);
144 cdio_paranoia_free(
s->paranoia);
145 cdio_cddap_close(
s->drive);
155 cdio_paranoia_seek(
s->paranoia, timestamp, SEEK_SET);
160 #define OFFSET(x) offsetof(CDIOContext, x)
161 #define DEC AV_OPT_FLAG_DECODING_PARAM
164 {
"paranoia_mode",
"set error recovery mode",
OFFSET(paranoia_mode),
AV_OPT_TYPE_FLAGS, { .i64 = PARANOIA_MODE_DISABLE }, INT_MIN, INT_MAX,
DEC,
"paranoia_mode" },
165 {
"disable",
"apply no fixups", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_DISABLE }, 0, 0,
DEC,
"paranoia_mode" },
166 {
"verify",
"verify data integrity in overlap area", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_VERIFY }, 0, 0,
DEC,
"paranoia_mode" },
167 {
"overlap",
"perform overlapped reads", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_OVERLAP }, 0, 0,
DEC,
"paranoia_mode" },
168 {
"neverskip",
"do not skip failed reads", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_NEVERSKIP }, 0, 0,
DEC,
"paranoia_mode" },
169 {
"full",
"apply all recovery modes", 0,
AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_FULL }, 0, 0,
DEC,
"paranoia_mode" },
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
#define AVERROR_EOF
End of file.
AVStream ** streams
A list of all streams in the file.
#define AV_LOG_VERBOSE
Detailed information.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static av_cold int read_close(AVFormatContext *ctx)
int64_t duration
Decoding: duration of the stream, in stream time base.
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
static av_cold int read_header(AVFormatContext *ctx)
const char * av_default_item_name(void *ptr)
Return the context name.
int sample_rate
Audio only.
char * url
input or output URL.
static const AVOption options[]
const AVInputFormat ff_libcdio_demuxer
#define i(width, name, range_min, range_max)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
cdrom_paranoia_t * paranoia
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
static const AVClass libcdio_class
void * priv_data
Format private data.