Home | History | Annotate | Download | only in audio

Lines Matching refs:adev

189     struct generic_audio_device *adev = out->dev;
191 pthread_mutex_lock(&adev->lock);
192 if (adev->fd >= 0)
193 bytes = write(adev->fd, buffer, bytes);
194 pthread_mutex_unlock(&adev->lock);
341 struct generic_audio_device *adev = in->dev;
343 pthread_mutex_lock(&adev->lock);
344 if (adev->fd >= 0)
345 bytes = read(adev->fd, buffer, bytes);
346 if (adev->mic_mute && (bytes > 0)) {
349 pthread_mutex_unlock(&adev->lock);
379 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
385 pthread_mutex_lock(&adev->lock);
386 if (adev->output != NULL) {
439 out->dev = adev;
441 adev->output = (struct audio_stream_out *)out;
445 pthread_mutex_unlock(&adev->lock);
453 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
455 pthread_mutex_lock(&adev->lock);
456 if (stream == adev->output) {
458 adev->output = NULL;
460 pthread_mutex_unlock(&adev->lock);
476 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
478 if (adev->fd >= 0)
518 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
520 pthread_mutex_lock(&adev->lock);
521 adev->mic_mute = state;
522 pthread_mutex_unlock(&adev->lock);
528 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
530 pthread_mutex_lock(&adev->lock);
531 *state = adev->mic_mute;
532 pthread_mutex_unlock(&adev->lock);
552 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
556 pthread_mutex_lock(&adev->lock);
557 if (adev->input != NULL) {
592 in->dev = adev;
594 adev->input = (struct audio_stream_in *)in;
598 pthread_mutex_unlock(&adev->lock);
606 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
608 pthread_mutex_lock(&adev->lock);
609 if (stream == adev->input) {
611 adev->input = NULL;
613 pthread_mutex_unlock(&adev->lock);
618 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
628 adev->fd,
629 adev->mic_mute ? "true": "false",
630 adev->output,
631 adev->input);
633 if (adev->output != NULL)
634 out_dump((const struct audio_stream *)adev->output, fd);
635 if (adev->input != NULL)
636 in_dump((const struct audio_stream *)adev->input, fd);
643 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
645 adev_close_output_stream((struct audio_hw_device *)dev, adev->output);
646 adev_close_input_stream((struct audio_hw_device *)dev, adev->input);
648 if (adev->fd >= 0)
649 close(adev->fd);
658 struct generic_audio_device *adev;
668 adev = calloc(1, sizeof(struct generic_audio_device));
670 adev->fd = fd;
672 adev->device.common.tag = HARDWARE_DEVICE_TAG;
673 adev->device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
674 adev->device.common.module = (struct hw_module_t *) module;
675 adev->device.common.close = adev_close;
677 adev->device.init_check = adev_init_check;
678 adev->device.set_voice_volume = adev_set_voice_volume;
679 adev->device.set_master_volume = adev_set_master_volume;
680 adev->device.get_master_volume = adev_get_master_volume;
681 adev->device.set_master_mute = adev_set_master_mute;
682 adev->device.get_master_mute = adev_get_master_mute;
683 adev->device.set_mode = adev_set_mode;
684 adev->device.set_mic_mute = adev_set_mic_mute;
685 adev->device.get_mic_mute = adev_get_mic_mute;
686 adev->device.set_parameters = adev_set_parameters;
687 adev->device.get_parameters = adev_get_parameters;
688 adev->device.get_input_buffer_size = adev_get_input_buffer_size;
689 adev->device.open_output_stream = adev_open_output_stream;
690 adev->device.close_output_stream = adev_close_output_stream;
691 adev->device.open_input_stream = adev_open_input_stream;
692 adev->device.close_input_stream = adev_close_input_stream;
693 adev->device.dump = adev_dump;
695 *device = &adev->device.common;