Home | History | Annotate | Download | only in audio

Lines Matching refs:buffer

541 /* buffer_remix: functor for doing in-place buffer manipulations.
607 char *buffer;
627 int16_t *buffer;
680 ALOGE("BUG: remove_channels_from_buf() can not add channels to a buffer.\n");
714 if (in->buffer) {
716 free(in->buffer);
717 in->buffer = malloc(in->config.period_size * br->sample_size * chans);
718 if (!in->buffer)
719 ALOGE("Could not reallocate memory for input buffer\n");
1453 struct echo_reference_buffer *buffer)
1458 LOGFUNC("%s(%p, %ul, %p)", __FUNCTION__, out, frames, buffer);
1460 status = pcm_get_htimestamp(out->pcm, &kernel_frames, &buffer->time_stamp);
1462 buffer->time_stamp.tv_sec = 0;
1463 buffer->time_stamp.tv_nsec = 0;
1464 buffer->delay_ns = 0;
1472 /* adjust render time stamp with delay added by current driver buffer.
1475 buffer->delay_ns = (long)(((int64_t)(kernel_frames + frames)* 1000000000)/
1659 static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
1673 LOGFUNC("%s(%p, %p, %d)", __FUNCTION__, stream, buffer, bytes);
1706 out->buffer = malloc(RESAMPLER_BUFFER_SIZE); /* todo: allow for reallocing */
1709 (int16_t *)buffer,
1711 (int16_t *)out->buffer,
1713 buf = out->buffer;
1716 buf = (void *)buffer;
1720 b.raw = (void *)buffer;
1727 /* do not allow more than out->write_threshold frames in kernel pcm driver buffer */
2022 struct echo_reference_buffer *buffer)
2025 /* read frames available in kernel driver buffer */
2033 LOGFUNC("%s(%p, %ul, %p)", __FUNCTION__, in, frames, buffer);
2036 buffer->time_stamp.tv_sec = 0;
2037 buffer->time_stamp.tv_nsec = 0;
2038 buffer->delay_ns = 0;
2043 /* read frames available in audio HAL input buffer
2045 * in current buffer */
2058 buffer->time_stamp = tstamp;
2059 buffer->delay_ns = delay_ns;
2063 buffer->time_stamp.tv_sec , buffer->time_stamp.tv_nsec, buffer->delay_ns,
2100 ALOGW("update_echo_reference: NOT enough frames to read ref buffer");
2143 /* read frames from echo reference buffer and update echo delay
2176 struct resampler_buffer* buffer)
2182 LOGFUNC("%s(%p, %p)", __FUNCTION__, buffer_provider, buffer);
2184 if (buffer_provider == NULL || buffer == NULL)
2192 buffer->raw = NULL;
2193 buffer->frame_count = 0;
2205 (void*)in->buffer,
2209 buffer->raw = NULL;
2210 buffer->frame_count = 0;
2216 remix->remix_func(remix, in->buffer, in->frames_in);
2219 buffer->frame_count = (buffer->frame_count > in->frames_in) ?
2220 in->frames_in : buffer->frame_count;
2221 buffer->i16 = in->buffer + (in->config.period_size - in->frames_in) *
2229 struct resampler_buffer* buffer)
2233 LOGFUNC("%s(%p, %p)", __FUNCTION__, buffer_provider, buffer);
2235 if (buffer_provider == NULL || buffer == NULL)
2241 in->frames_in -= buffer->frame_count;
2245 * if necessary and output the number of frames requested to the buffer specified */
2246 static ssize_t read_frames(struct omap4_stream_in *in, void *buffer, ssize_t frames)
2251 LOGFUNC("%s(%p, %p, %ld)", __FUNCTION__, in, buffer, frames);
2262 (int16_t *)((char *)buffer + frames_wr * frame_size),
2271 memcpy((char *)buffer +
2291 * to the buffer specified */
2292 static ssize_t process_frames(struct omap4_stream_in *in, void* buffer, ssize_t frames)
2299 LOGFUNC("%s(%p, %p, %ld)", __FUNCTION__, in, buffer, frames);
2302 /* first reload enough frames at the end of process input buffer */
2333 out_buf.s16 = (int16_t *)buffer + frames_wr * in->config.channels;
2359 static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
2367 LOGFUNC("%s(%p, %p, %d)", __FUNCTION__, stream, buffer, bytes);
2386 ret = process_frames(in, buffer, frames_rq);
2388 ret = read_frames(in, buffer, frames_rq);
2390 ret = pcm_read(in->pcm, buffer, bytes);
2396 memset(buffer, 0, bytes);
2525 out->buffer = malloc(RESAMPLER_BUFFER_SIZE); /* todo: allow for reallocing */
2580 if (out->buffer)
2581 free(out->buffer);
2771 in->buffer = malloc(2 * in->config.period_size * audio_stream_frame_size(&in->stream.common));
2772 if (!in->buffer) {
2818 free(in->buffer);