Home | History | Annotate | Download | only in generic

Lines Matching defs:out

175     /* If pcm out then filename must end with 0p/0c */
332 void lock_output_stream(struct stream_out *out)
334 pthread_mutex_lock(&out->pre_lock);
335 pthread_mutex_lock(&out->lock);
336 pthread_mutex_unlock(&out->pre_lock);
344 * following order: hw device > out stream
348 * OUT functions
364 const struct stream_out* out = (const struct stream_out*)stream;
366 proxy_get_period_size(&out->proxy) * audio_stream_out_frame_size(&(out->stream));
372 const struct stream_out *out = (const struct stream_out*)stream;
373 return out->hal_channel_mask;
394 struct stream_out *out = (struct stream_out *)stream;
395 lock_output_stream(out);
396 if (!out->standby) {
397 pthread_mutex_lock(&out->dev->lock);
398 proxy_close(&out->proxy);
399 pthread_mutex_unlock(&out->dev->lock);
400 out->standby = true;
402 pthread_mutex_unlock(&out->lock);
416 struct stream_out *out = (struct stream_out *)stream;
428 lock_output_stream(out);
430 pthread_mutex_lock(&out->dev->lock);
432 if (!profile_is_cached_for(out->profile, card, device)) {
434 if (!out->standby)
437 int saved_card = out->profile->card;
438 int saved_device = out->profile->device;
439 out->profile->card = card;
440 out->profile->device = device;
441 ret_value = profile_read_device_info(out->profile) ? 0 : -EINVAL;
443 out->profile->card = saved_card;
444 out->profile->device = saved_device;
449 pthread_mutex_unlock(&out->dev->lock);
450 pthread_mutex_unlock(&out->lock);
457 struct stream_out *out = (struct stream_out *)stream;
458 lock_output_stream(out);
459 pthread_mutex_lock(&out->dev->lock);
461 char * params_str = device_get_parameters(out->profile, keys);
463 pthread_mutex_unlock(&out->lock);
464 pthread_mutex_unlock(&out->dev->lock);
481 static int start_output_stream(struct stream_out *out)
483 ALOGV("start_output_stream(card:%d device:%d)", out->profile->card, out->profile->device);
485 return proxy_open(&out->proxy);
491 struct stream_out *out = (struct stream_out *)stream;
493 lock_output_stream(out);
494 if (out->standby) {
495 pthread_mutex_lock(&out->dev->lock);
496 ret = start_output_stream(out);
497 pthread_mutex_unlock(&out->dev->lock);
501 out->standby = false;
504 alsa_device_proxy* proxy = &out->proxy;
508 const int num_req_channels = out->hal_channel_count; /* what we told AudioFlinger */
513 if (required_conversion_buffer_size > out->conversion_buffer_size) {
514 out->conversion_buffer_size = required_conversion_buffer_size;
515 out->conversion_buffer = realloc(out->conversion_buffer,
516 out->conversion_buffer_size);
519 const audio_format_t audio_format = out_get_format(&(out->stream.common));
523 out->conversion_buffer, num_device_channels,
525 write_buff = out->conversion_buffer;
529 proxy_write(&out
532 pthread_mutex_unlock(&out->lock);
537 pthread_mutex_unlock(&out->lock);
554 struct stream_out *out = (struct stream_out *)stream; // discard const qualifier
555 lock_output_stream(out);
557 const alsa_device_proxy *proxy = &out->proxy;
560 pthread_mutex_unlock(&out->lock);
594 struct stream_out *out;
595 out = (struct stream_out *)calloc(1, sizeof(struct stream_out));
596 if (!out)
600 out->stream.common.get_sample_rate = out_get_sample_rate;
601 out->stream.common.set_sample_rate = out_set_sample_rate;
602 out->stream.common.get_buffer_size = out_get_buffer_size;
603 out->stream.common.get_channels = out_get_channels;
604 out->stream.common.get_format = out_get_format;
605 out->stream.common.set_format = out_set_format;
606 out->stream.common.standby = out_standby;
607 out->stream.common.dump = out_dump;
608 out->stream.common.set_parameters = out_set_parameters;
609 out->stream.common.get_parameters = out_get_parameters;
610 out->stream.common.add_audio_effect = out_add_audio_effect;
611 out->stream.common.remove_audio_effect = out_remove_audio_effect;
612 out->stream.get_latency = out_get_latency;
613 out->stream.set_volume = out_set_volume;
614 out->stream.write = out_write;
615 out->stream.get_render_position = out_get_render_position;
616 out->stream.get_presentation_position = out_get_presentation_position;
617 out->stream.get_next_write_timestamp = out_get_next_write_timestamp;
619 pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
620 pthread_mutex_init(&out->pre_lock, (const pthread_mutexattr_t *) NULL);
622 out->dev = adev;
624 out->profile = &adev->out_profile;
630 /* Pull out the card/device pair */
631 parse_card_device_params(true, &(out->profile->card), &(out->profile->device));
633 profile_read_device_info(out->profile);
641 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
642 } else if (profile_is_sample_rate_valid(out->profile, config->sample_rate)) {
646 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
652 proxy_config.format = profile_get_default_format(out->profile);
656 if (profile_is_format_valid(out->profile, fmt)) {
660 proxy_config.format = profile_get_default_format(out->profile);
671 proposed_channel_count = profile_get_default_channel_count(out->profile);
682 out->hal_channel_count = proposed_channel_count;
684 out->hal_channel_count = audio_channel_count_from_out_mask(config->channel_mask);
687 out->hal_channel_mask = config->channel_mask;
693 proxy_prepare(&out->proxy, out->profile, &proxy_config);
698 out->conversion_buffer = NULL;
699 out->conversion_buffer_size = 0;
701 out->standby = true;
703 *stream_out = &out->stream;
708 free(out);
716 struct stream_out *out = (struct stream_out *)stream;
717 ALOGV("adev_close_output_stream(c:%d d:%d)", out->profile->card, out->profile->device);
721 free(out->conversion_buffer);
723 out->conversion_buffer = NULL;
724 out->conversion_buffer_size = 0;
906 * OK, we need to figure out how much data to read to be able to output the requested
1011 /* Pull out the card/device pair */