69 ret = sio_read(
s->hdl,
pkt->data,
pkt->size);
70 if (ret == 0 || sio_eof(
s->hdl)) {
81 bdelay = ret +
s->hwpos -
s->softpos;
84 pkt->pts = cur_time - ((bdelay * 1000000) /
85 (
s->bps *
s->channels *
s->sample_rate));
106 .class_name =
"sndio indev",
const FFInputFormat ff_sndio_demuxer
static av_cold int audio_read_header(AVFormatContext *s1)
static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
@ AV_OPT_TYPE_INT
Underlying C type is int.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
static int audio_read_close(AVFormatContext *context)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
av_cold int ff_sndio_open(AVFormatContext *s1, int is_output, const char *audio_device)
int ff_sndio_close(SndioData *s)
static const AVClass sndio_demuxer_class
static av_cold int audio_read_header(AVFormatContext *s1)
static av_cold int audio_read_close(AVFormatContext *s1)
static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
AVChannelLayout ch_layout
The channel layout and number of channels.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
char * url
input or output URL.
void * priv_data
Format private data.
This structure stores compressed data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t av_gettime(void)
Get the current time in microseconds.