Lines Matching full: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);
376 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
380 pthread_mutex_lock(&adev->lock);
381 if (adev->output != NULL) {
418 out->dev = adev;
420 adev->output = (struct audio_stream_out *)out;
424 pthread_mutex_unlock(&adev->lock);
432 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
434 pthread_mutex_lock(&adev->lock);
435 if (stream == adev->output) {
437 adev->output = NULL;
439 pthread_mutex_unlock(&adev->lock);
455 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
457 if (adev->fd >= 0)
497 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
499 pthread_mutex_lock(&adev->lock);
500 adev->mic_mute = state;
501 pthread_mutex_unlock(&adev->lock);
507 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
509 pthread_mutex_lock(&adev->lock);
510 *state = adev->mic_mute;
511 pthread_mutex_unlock(&adev->lock);
528 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
532 pthread_mutex_lock(&adev->lock);
533 if (adev->input != NULL) {
568 in->dev = adev;
570 adev->input = (struct audio_stream_in *)in;
574 pthread_mutex_unlock(&adev->lock);
582 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
584 pthread_mutex_lock(&adev->lock);
585 if (stream == adev->input) {
587 adev->input = NULL;
589 pthread_mutex_unlock(&adev->lock);
594 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
604 adev->fd,
605 adev->mic_mute ? "true": "false",
606 adev->output,
607 adev->input);
609 if (adev->output != NULL)
610 out_dump((const struct audio_stream *)adev->output, fd);
611 if (adev->input != NULL)
612 in_dump((const struct audio_stream *)adev->input, fd);
619 struct generic_audio_device *adev = (struct generic_audio_device *)dev;
621 adev_close_output_stream((struct audio_hw_device *)dev, adev->output);
622 adev_close_input_stream((struct audio_hw_device *)dev, adev->input);
624 if (adev->fd >= 0)
625 close(adev->fd);
634 struct generic_audio_device *adev;
644 adev = calloc(1, sizeof(struct generic_audio_device));
646 adev->fd = fd;
648 adev->device.common.tag = HARDWARE_DEVICE_TAG;
649 adev->device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
650 adev->device.common.module = (struct hw_module_t *) module;
651 adev->device.common.close = adev_close;
653 adev->device.init_check = adev_init_check;
654 adev->device.set_voice_volume = adev_set_voice_volume;
655 adev->device.set_master_volume = adev_set_master_volume;
656 adev->device.get_master_volume = adev_get_master_volume;
657 adev->device.set_master_mute = adev_set_master_mute;
658 adev->device.get_master_mute = adev_get_master_mute;
659 adev->device.set_mode = adev_set_mode;
660 adev->device.set_mic_mute = adev_set_mic_mute;
661 adev->device.get_mic_mute = adev_get_mic_mute;
662 adev->device.set_parameters = adev_set_parameters;
663 adev->device.get_parameters = adev_get_parameters;
664 adev->device.get_input_buffer_size = adev_get_input_buffer_size;
665 adev->device.open_output_stream = adev_open_output_stream;
666 adev->device.close_output_stream = adev_close_output_stream;
667 adev->device.open_input_stream = adev_open_input_stream;
668 adev->device.close_input_stream = adev_close_input_stream;
669 adev->device.dump = adev_dump;
671 *device = &adev->device.common;