Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
hardware_libhardware
Commits
253def9f
Commit
253def9f
authored
10 years ago
by
Eric Laurent
Browse files
Options
Download
Email Patches
Plain Diff
usb audio: implement microphone mute.
Bug: 17321604. Change-Id: I8e3daf2636dfd5f85d990c0093c52c908064afac
parent
b5459839
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
modules/usbaudio/audio_hw.c
modules/usbaudio/audio_hw.c
+10
-0
No files found.
modules/usbaudio/audio_hw.c
View file @
253def9f
...
...
@@ -66,6 +66,8 @@ struct audio_device {
/* input */
alsa_device_profile
in_profile
;
bool
mic_muted
;
bool
standby
;
};
...
...
@@ -869,6 +871,10 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, size_t byte
sample_size_in_bytes
,
num_read_buff_bytes
);
}
}
/* no need to acquire in->dev->lock to read mic_muted here as we don't change its state */
if
(
num_read_buff_bytes
>
0
&&
in
->
dev
->
mic_muted
)
memset
(
buffer
,
0
,
num_read_buff_bytes
);
}
err:
...
...
@@ -1061,6 +1067,10 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
static
int
adev_set_mic_mute
(
struct
audio_hw_device
*
dev
,
bool
state
)
{
struct
audio_device
*
adev
=
(
struct
audio_device
*
)
dev
;
pthread_mutex_lock
(
&
adev
->
lock
);
adev
->
mic_muted
=
state
;
pthread_mutex_unlock
(
&
adev
->
lock
);
return
-
ENOSYS
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment