Go to the documentation of this file.
56 #define LOWEST_AL_FORMAT FFMIN(FFMIN(AL_FORMAT_MONO8,AL_FORMAT_MONO16),FFMIN(AL_FORMAT_STEREO8,AL_FORMAT_STEREO16))
81 static inline int al_get_error(ALCdevice *device,
const char** error_msg_ret)
83 ALCenum
error = alcGetError(device);
85 *error_msg_ret = (
const char*) alcGetString(device,
error);
89 case ALC_INVALID_DEVICE:
92 case ALC_INVALID_CONTEXT:
93 case ALC_INVALID_ENUM:
94 case ALC_INVALID_VALUE:
97 case ALC_OUT_OF_MEMORY:
112 if (!(devices = alcGetString(
NULL, ALC_CAPTURE_DEVICE_SPECIFIER)))
115 av_log(log_ctx,
AV_LOG_INFO,
"List of OpenAL capture devices on this system:\n");
117 for (; *devices !=
'\0'; devices += strlen(devices) + 1)
124 static const ALCenum sample_formats[2][2] = {
125 { AL_FORMAT_MONO8, AL_FORMAT_STEREO8 },
126 { AL_FORMAT_MONO16, AL_FORMAT_STEREO16 }
129 const char *error_msg;
170 alcCaptureStart(ad->
device);
177 alcCaptureCloseDevice(ad->
device);
187 const char *error_msg;
192 alcGetIntegerv(ad->
device, ALC_CAPTURE_SAMPLES, (ALCsizei)
sizeof(ALCint), &nb_samples);
225 alcCaptureStop(ad->
device);
226 alcCaptureCloseDevice(ad->
device);
231 #define OFFSET(x) offsetof(al_data, x)
254 .priv_data_size =
sizeof(
al_data),
static void error(const char *err)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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.
This struct describes the properties of an encoded stream.
static void print_al_capture_devices(void *log_ctx)
Print out a list of OpenAL capture devices on this system.
static int al_get_error(ALCdevice *device, const char **error_msg_ret)
Get the OpenAL error code, translated into an av/errno error code.
static int read_header(AVFormatContext *ctx)
ALCint sample_step
The number of bytes between two consecutive samples of the same channel/component.
ALCenum sample_format
The OpenAL sample format of the captured audio.
static int read_close(AVFormatContext *ctx)
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
@ 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.
int flags
Flags modifying the (de)muxer behaviour.
int av_usleep(unsigned usec)
Sleep for a period of time.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
int sample_rate
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
ALCdevice * device
OpenAL capture device context.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
char * url
input or output URL.
int sample_rate
The sample rate (in Hz) of the captured audio.
const AVInputFormat ff_openal_demuxer
static const AVOption options[]
int list_devices
If true, print a list of capture devices on this system and exit.
#define AV_LOG_INFO
Standard information.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int channels
The number of channels in the captured audio.
int sample_size
The sample size (in bits) of the captured audio.
int64_t av_gettime(void)
Get the current time in microseconds.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
static const al_format_info * get_al_format_info(ALCenum al_fmt)
Get information about an AL_FORMAT value.
void * priv_data
Format private data.