Home | History | Annotate | Download | only in audio

Lines Matching refs:adev

187     struct generic_audio_device *adev = out->dev;
189 pthread_mutex_lock(&adev->lock);
190 if (adev->fd >= 0)
191 bytes = write(adev->fd, buffer, bytes);
192 pthread_mutex_unlock(&adev->lock);
339 struct generic_audio_device *adev = in->dev;
341 pthread_mutex_lock(&adev->lock);
342 if (adev->fd >= 0)
343 bytes = read(adev->fd, buffer, bytes);
344 if (adev->mic_mute && (bytes > 0)) {
347 pthread_mutex_unlock(&adev->lock);
377 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
381 pthread_mutex_lock(&adev->lock);
382 if (adev->output != NULL) {
419 out->dev = adev;
421 adev->output = (struct audio_stream_out *)out;
425 pthread_mutex_unlock(&adev->lock);
433 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
435 pthread_mutex_lock(&adev->lock);
436 if (stream == adev->output) {
438 adev->output = NULL;
440 pthread_mutex_unlock(&adev->lock);
456 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
458 if (adev->fd >= 0)
498 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
500 pthread_mutex_lock(&adev->lock);
501 adev->mic_mute = state;
502 pthread_mutex_unlock(&adev->lock);
508 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
510 pthread_mutex_lock(&adev->lock);
511 *state = adev->mic_mute;
512 pthread_mutex_unlock(&adev->lock);
532 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
536 pthread_mutex_lock(&adev->lock);
537 if (adev->input != NULL) {
572 in->dev = adev;
574 adev->input = (struct audio_stream_in *)in;
578 pthread_mutex_unlock(&adev->lock);
586 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
588 pthread_mutex_lock(&adev->lock);
589 if (stream == adev->input) {
591 adev->input = NULL;
593 pthread_mutex_unlock(&adev->lock);
598 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
608 adev->fd,
609 adev->mic_mute ? "true": "false",
610 adev->output,
611 adev->input);
613 if (adev->output != NULL)
614 out_dump((const struct audio_stream *)adev->output, fd);
615 if (adev->input != NULL)
616 in_dump((const struct audio_stream *)adev->input, fd);
623 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
625 adev_close_output_stream((struct audio_hw_device *)dev, adev->output);
626 adev_close_input_stream((struct audio_hw_device *)dev, adev->input);
628 if (adev->fd >= 0)
629 close(adev->fd);
638 struct generic_audio_device *adev;
648 adev = calloc(1, sizeof(struct generic_audio_device));
650 adev->fd = fd;
652 adev->device.common.tag = HARDWARE_DEVICE_TAG;
653 adev->device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
654 adev->device.common.module = (struct hw_module_t *) module;
655 adev->device.common.close = adev_close;
657 adev->device.init_check = adev_init_check;
658 adev->device.set_voice_volume = adev_set_voice_volume;
659 adev->device.set_master_volume = adev_set_master_volume;
660 adev->device.get_master_volume = adev_get_master_volume;
661 adev->device.set_master_mute = adev_set_master_mute;
662 adev->device.get_master_mute = adev_get_master_mute;
663 adev->device.set_mode = adev_set_mode;
664 adev->device.set_mic_mute = adev_set_mic_mute;
665 adev->device.get_mic_mute = adev_get_mic_mute;
666 adev->device.set_parameters = adev_set_parameters;
667 adev->device.get_parameters = adev_get_parameters;
668 adev->device.get_input_buffer_size = adev_get_input_buffer_size;
669 adev->device.open_output_stream = adev_open_output_stream;
670 adev->device.close_output_stream = adev_close_output_stream;
671 adev->device.open_input_stream = adev_open_input_stream;
672 adev->device.close_input_stream = adev_close_input_stream;
673 adev->device.dump = adev_dump;
675 *device = &adev->device.common;