57#define LOWEST_AL_FORMAT FFMIN(FFMIN(AL_FORMAT_MONO8,AL_FORMAT_MONO16),FFMIN(AL_FORMAT_STEREO8,AL_FORMAT_STEREO16))
82static inline int al_get_error(ALCdevice *device,
const char** error_msg_ret)
84 ALCenum
error = alcGetError(device);
86 *error_msg_ret = (
const char*) alcGetString(device,
error);
90 case ALC_INVALID_DEVICE:
93 case ALC_INVALID_CONTEXT:
94 case ALC_INVALID_ENUM:
95 case ALC_INVALID_VALUE:
98 case ALC_OUT_OF_MEMORY:
113 if (!(devices = alcGetString(
NULL, ALC_CAPTURE_DEVICE_SPECIFIER)))
116 av_log(log_ctx,
AV_LOG_INFO,
"List of OpenAL capture devices on this system:\n");
118 for (; *devices !=
'\0'; devices += strlen(devices) + 1)
126 { AL_FORMAT_MONO8, AL_FORMAT_STEREO8 },
127 { AL_FORMAT_MONO16, AL_FORMAT_STEREO16 }
130 const char *error_msg;
143 alcCaptureOpenDevice(
ctx->url[0] ?
ctx->url :
NULL,
171 alcCaptureStart(ad->
device);
178 alcCaptureCloseDevice(ad->
device);
188 const char *error_msg;
193 alcGetIntegerv(ad->
device, ALC_CAPTURE_SAMPLES, (ALCsizei)
sizeof(ALCint), &nb_samples);
208 alcCaptureSamples(ad->
device,
pkt->data, nb_samples);
226 alcCaptureStop(ad->
device);
227 alcCaptureCloseDevice(ad->
device);
232#define OFFSET(x) offsetof(al_data, x)
256 .p.priv_class = &
class,
257 .priv_data_size =
sizeof(
al_data),
const FFInputFormat ff_openal_demuxer
Main libavdevice API header.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
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_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVCodecID
Identify the syntax and semantics of the bitstream.
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_EXIT
Immediate exit was requested; the called function should not be restarted.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
#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
static void print_al_capture_devices(void *log_ctx)
Print out a list of OpenAL capture devices on this system.
static const al_format_info * get_al_format_info(ALCenum al_fmt)
Get information about an AL_FORMAT value.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
static int read_header(AVFormatContext *ctx)
static int read_close(AVFormatContext *ctx)
static int al_get_error(ALCdevice *device, const char **error_msg_ret)
Get the OpenAL error code, translated into an av/errno error code.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
This struct describes the properties of an encoded stream.
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.
This structure stores compressed data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int sample_rate
The sample rate (in Hz) of the captured audio.
ALCenum sample_format
The OpenAL sample format of the captured audio.
int list_devices
If true, print a list of capture devices on this system and exit.
int sample_size
The sample size (in bits) of the captured audio.
int channels
The number of channels in the captured audio.
ALCdevice * device
OpenAL capture device context.
ALCint sample_step
The number of bytes between two consecutive samples of the same channel/component.
static void error(const char *err)
static AVFormatContext * ctx
int av_usleep(unsigned usec)
Sleep for a period of time.
int64_t av_gettime(void)
Get the current time in microseconds.