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;
191 alcGetIntegerv(ad->
device, ALC_CAPTURE_SAMPLES, (ALCsizei)
sizeof(ALCint), &nb_samples);
199 alcCaptureSamples(ad->
device, pkt->
data, nb_samples);
206 av_destruct_packet(pkt);
217 alcCaptureStop(ad->
device);
218 alcCaptureCloseDevice(ad->
device);
223 #define OFFSET(x) offsetof(al_data, x)
245 .priv_data_size =
sizeof(
al_data),