Lines Matching defs:out
203 * card A pointer to a variable to receive the parsed-out card number.
204 * device A pointer to a variable to receive the parsed-out device number.
282 * following order: hw device > out stream
286 * OUT functions
302 const struct stream_out* out = (const struct stream_out*)stream;
304 proxy_get_period_size(&out->proxy) * audio_stream_out_frame_size(&(out->stream));
310 const struct stream_out *out = (const struct stream_out*)stream;
311 return out->hal_channel_mask;
332 struct stream_out *out = (struct stream_out *)stream;
334 stream_lock(&out->lock);
335 if (!out->standby) {
336 device_lock(out->adev);
337 proxy_close(&out->proxy);
338 device_unlock(out->adev);
339 out->standby = true;
341 stream_unlock(&out->lock);
363 struct stream_out *out = (struct stream_out *)stream;
375 stream_lock(&out->lock);
377 device_lock(out->adev);
379 if (!profile_is_cached_for(out->profile, card, device)) {
381 if (!out->standby)
384 int saved_card = out->profile->card;
385 int saved_device = out->profile->device;
386 out->profile->card = card;
387 out->profile->device = device;
388 ret_value = profile_read_device_info(out->profile) ? 0 : -EINVAL;
390 out->profile->card = saved_card;
391 out->profile->device = saved_device;
396 device_unlock(out->adev);
397 stream_unlock(&out->lock);
404 struct stream_out *out = (struct stream_out *)stream;
405 stream_lock(&out->lock);
406 device_lock(out->adev);
408 char * params_str = device_get_parameters(out->profile, keys);
410 device_unlock(out->adev);
411 stream_unlock(&out->lock);
427 static int start_output_stream(struct stream_out *out)
429 ALOGV("start_output_stream(card:%d device:%d)", out->profile->card, out->profile->device);
431 return proxy_open(&out->proxy);
437 struct stream_out *out = (struct stream_out *)stream;
439 stream_lock(&out->lock);
440 if (out->standby) {
441 device_lock(out->adev);
442 ret = start_output_stream(out);
443 device_unlock(out->adev);
447 out->standby = false;
450 alsa_device_proxy* proxy = &out->proxy;
454 const int num_req_channels = out->hal_channel_count; /* what we told AudioFlinger */
459 if (required_conversion_buffer_size > out->conversion_buffer_size) {
460 out->conversion_buffer_size = required_conversion_buffer_size;
461 out->conversion_buffer = realloc(out->conversion_buffer,
462 out->conversion_buffer_size);
465 const audio_format_t audio_format = out_get_format(&(out->stream.common));
469 out->conversion_buffer, num_device_channels,
471 write_buff = out->conversion_buffer;
475 proxy_write(&out->proxy, write_buff, num_write_buff_bytes);
478 stream_unlock(&out->lock);
483 stream_unlock(&out->lock);
500 struct stream_out *out = (struct stream_out *)stream; // discard const qualifier
501 stream_lock(&out->lock);
503 out->proxy;
506 stream_unlock(&out->lock);
536 struct stream_out *out;
538 out = (struct stream_out *)calloc(1, sizeof(struct stream_out));
539 if (out == NULL) {
544 out->stream.common.get_sample_rate = out_get_sample_rate;
545 out->stream.common.set_sample_rate = out_set_sample_rate;
546 out->stream.common.get_buffer_size = out_get_buffer_size;
547 out->stream.common.get_channels = out_get_channels;
548 out->stream.common.get_format = out_get_format;
549 out->stream.common.set_format = out_set_format;
550 out->stream.common.standby = out_standby;
551 out->stream.common.dump = out_dump;
552 out->stream.common.set_parameters = out_set_parameters;
553 out->stream.common.get_parameters = out_get_parameters;
554 out->stream.common.add_audio_effect = out_add_audio_effect;
555 out->stream.common.remove_audio_effect = out_remove_audio_effect;
556 out->stream.get_latency = out_get_latency;
557 out->stream.set_volume = out_set_volume;
558 out->stream.write = out_write;
559 out->stream.get_render_position = out_get_render_position;
560 out->stream.get_presentation_position = out_get_presentation_position;
561 out->stream.get_next_write_timestamp = out_get_next_write_timestamp;
563 stream_lock_init(&out->lock);
565 out->adev = (struct audio_device *)hw_dev;
566 device_lock(out->adev);
567 out->profile = &out->adev->out_profile;
573 /* Pull out the card/device pair */
574 parse_card_device_params(address, &(out->profile->card), &(out->profile->device));
576 profile_read_device_info(out->profile);
582 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
583 } else if (profile_is_sample_rate_valid(out->profile, config->sample_rate)) {
586 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
590 out->adev->device_sample_rate = config->sample_rate;
591 device_unlock(out->adev);
595 proxy_config.format = profile_get_default_format(out->profile);
599 if (profile_is_format_valid(out->profile, fmt)) {
602 proxy_config.format = profile_get_default_format(out->profile);
612 out->hal_channel_count = profile_get_default_channel_count(out->profile);
616 out->hal_channel_count = audio_channel_count_from_out_mask(config->channel_mask);
620 if (out->hal_channel_count > FCC_8) {
621 out->hal_channel_count = FCC_8;
628 config->channel_mask = out->hal_channel_count <= FCC_2
630 ? audio_channel_out_mask_from_count(out->hal_channel_count)
632 : audio_channel_mask_for_index_assignment_from_count(out->hal_channel_count);
635 out->hal_channel_mask = config->channel_mask;
640 proxy_config.channels = profile_get_closest_channel_count(out->profile, out->hal_channel_count);
641 proxy_prepare(&out->proxy, out->profile, &proxy_config);
646 out->conversion_buffer = NULL;
647 out->conversion_buffer_size = 0;
649 out->standby = true;
652 adev_add_stream_to_list(out->adev, &out->adev->output_stream_list, &out->list_node);
654 *stream_out = &out->stream;
659 free(out);
667 struct stream_out *out = (struct stream_out *)stream;
668 ALOGV("adev_close_output_stream(c:%d d:%d)", out->profile->card, out->profile->device);
670 adev_remove_stream_from_list(out->adev, &out->list_node);
675 free(out->conversion_buffer);
677 out->conversion_buffer = NULL;
678 out->conversion_buffer_size = 0;
680 device_lock(out->adev);
681 out->adev->device_sample_rate = 0;
682 device_unlock(out->adev);
873 * OK, we need to figure out how much data to read to be able to output the requested
977 /* Pull out the card/device pair */