diff options
-rw-r--r-- | include/hardware/audio.h | 17 | ||||
-rw-r--r-- | modules/audio/audio_hw.c | 14 | ||||
-rw-r--r-- | modules/local_time/local_time_hw.c | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/include/hardware/audio.h b/include/hardware/audio.h index fa34467..1e68cd1 100644 --- a/include/hardware/audio.h +++ b/include/hardware/audio.h @@ -184,6 +184,14 @@ struct audio_stream_out { */ int (*get_render_position)(const struct audio_stream_out *stream, uint32_t *dsp_frames); + + /** + * get the local time at which the next write to the audio driver will be + * presented + */ + int (*get_next_write_timestamp)(const struct audio_stream_out *stream, + int64_t *timestamp); + }; typedef struct audio_stream_out audio_stream_out_t; @@ -272,6 +280,15 @@ struct audio_hw_device { int (*set_master_volume)(struct audio_hw_device *dev, float volume); /** + * Get the current master volume value for the HAL, if the HAL supports + * master volume control. AudioFlinger will query this value from the + * primary audio HAL when the service starts and use the value for setting + * the initial master volume across all HALs. HALs which do not support + * this method should may leave it set to NULL. + */ + int (*get_master_volume)(struct audio_hw_device *dev, float *volume); + + /** * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is * playing, and AUDIO_MODE_IN_CALL when a call is in progress. diff --git a/modules/audio/audio_hw.c b/modules/audio/audio_hw.c index a2d7861..4069ace 100644 --- a/modules/audio/audio_hw.c +++ b/modules/audio/audio_hw.c @@ -126,6 +126,12 @@ static int out_remove_audio_effect(const struct audio_stream *stream, effect_han return 0; } +static int out_get_next_write_timestamp(const struct audio_stream_out *stream, + int64_t *timestamp) +{ + return -EINVAL; +} + /** audio_stream_in implementation **/ static uint32_t in_get_sample_rate(const struct audio_stream *stream) { @@ -236,6 +242,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev, out->stream.set_volume = out_set_volume; out->stream.write = out_write; out->stream.get_render_position = out_get_render_position; + out->stream.get_next_write_timestamp = out_get_next_write_timestamp; *stream_out = &out->stream; return 0; @@ -278,6 +285,12 @@ static int adev_set_master_volume(struct audio_hw_device *dev, float volume) return -ENOSYS; } +static int adev_get_master_volume(struct audio_hw_device *dev, + float *volume) +{ + return -ENOSYS; +} + static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode) { return 0; @@ -401,6 +414,7 @@ static int adev_open(const hw_module_t* module, const char* name, adev->device.init_check = adev_init_check; adev->device.set_voice_volume = adev_set_voice_volume; adev->device.set_master_volume = adev_set_master_volume; + adev->device.get_master_volume = adev_get_master_volume; adev->device.set_mode = adev_set_mode; adev->device.set_mic_mute = adev_set_mic_mute; adev->device.get_mic_mute = adev_get_mic_mute; diff --git a/modules/local_time/local_time_hw.c b/modules/local_time/local_time_hw.c index a1f5d43..308f7d9 100644 --- a/modules/local_time/local_time_hw.c +++ b/modules/local_time/local_time_hw.c @@ -39,7 +39,7 @@ static int64_t ltdev_get_local_time(struct local_time_hw_device* dev) ret = clock_gettime(CLOCK_MONOTONIC, &ts); if (ret < 0) { - LOGW("%s failed to fetch CLOCK_MONOTONIC value! (res = %d)", + ALOGW("%s failed to fetch CLOCK_MONOTONIC value! (res = %d)", dev->common.module->name, ret); return 0; } |