Loading audio/5.0/IStreamIn.hal +23 −0 Original line number Diff line number Diff line Loading @@ -165,4 +165,27 @@ interface IStreamIn extends IStream { */ getActiveMicrophones() generates(Result retval, vec<MicrophoneInfo> microphones); /** * Specifies the logical microphone (for processing). * * Optional method * * @param Direction constant * @return retval OK if the call is successful, an error code otherwise. */ setMicrophoneDirection(MicrophoneDirection direction) generates(Result retval); /** * Specifies the zoom factor for the selected microphone (for processing). * * Optional method * * @param the desired field dimension of microphone capture. Range is from -1 (wide angle), * though 0 (no zoom) to 1 (maximum zoom). * * @return retval OK if the call is not successful, an error code otherwise. */ setMicrophoneFieldDimension(float zoom) generates(Result retval); }; audio/5.0/types.hal +26 −0 Original line number Diff line number Diff line Loading @@ -221,3 +221,29 @@ struct MicrophoneInfo { */ AudioMicrophoneCoordinate orientation; }; /** * Constants used by the HAL to determine how to select microphones and process those inputs in * order to optimize for capture in the specified direction. * * MicrophoneDirection Constants are defined in MicrophoneDirection.java. */ @export(name="audio_microphone_direction_t", value_prefix="MIC_DIRECTION_") enum MicrophoneDirection : int32_t { /** * Don't do any directionality processing of the activated microphone(s). */ UNSPECIFIED = 0, /** * Optimize capture for audio coming from the screen-side of the device. */ FRONT = 1, /** * Optimize capture for audio coming from the side of the device opposite the screen. */ BACK = 2, /** * Optimize capture for audio coming from an off-device microphone. */ EXTERNAL = 3, }; audio/core/all-versions/default/StreamIn.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,27 @@ Return<void> StreamIn::getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) { } #endif #if MAJOR_VERSION >= 5 Return<Result> StreamIn::setMicrophoneDirection(MicrophoneDirection direction) { if (mStream->set_microphone_direction == nullptr) { return Result::NOT_SUPPORTED; } return Stream::analyzeStatus( "set_microphone_direction", mStream->set_microphone_direction( mStream, static_cast<audio_microphone_direction_t>(direction))); } Return<Result> StreamIn::setMicrophoneFieldDimension(float zoom) { if (mStream->set_microphone_field_dimension == nullptr) { return Result::NOT_SUPPORTED; } return Stream::analyzeStatus("set_microphone_field_dimension", mStream->set_microphone_field_dimension(mStream, zoom)); } #endif } // namespace implementation } // namespace CPP_VERSION } // namespace audio Loading audio/core/all-versions/default/include/core/default/StreamIn.h +4 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,10 @@ struct StreamIn : public IStreamIn { Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override; Return<void> getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) override; #endif #if MAJOR_VERSION >= 5 Return<Result> setMicrophoneDirection(MicrophoneDirection direction) override; Return<Result> setMicrophoneFieldDimension(float zoom) override; #endif static Result getCapturePositionImpl(audio_stream_in_t* stream, uint64_t* frames, uint64_t* time); Loading compatibility_matrices/compatibility_matrix.current.xml +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ </hal> <hal format="hidl" optional="false"> <name>android.hardware.audio</name> <version>4.0</version> <version>5.0</version> <interface> <name>IDevicesFactory</name> <instance>default</instance> Loading @@ -17,7 +17,7 @@ </hal> <hal format="hidl" optional="false"> <name>android.hardware.audio.effect</name> <version>4.0</version> <version>5.0</version> <interface> <name>IEffectsFactory</name> <instance>default</instance> Loading Loading
audio/5.0/IStreamIn.hal +23 −0 Original line number Diff line number Diff line Loading @@ -165,4 +165,27 @@ interface IStreamIn extends IStream { */ getActiveMicrophones() generates(Result retval, vec<MicrophoneInfo> microphones); /** * Specifies the logical microphone (for processing). * * Optional method * * @param Direction constant * @return retval OK if the call is successful, an error code otherwise. */ setMicrophoneDirection(MicrophoneDirection direction) generates(Result retval); /** * Specifies the zoom factor for the selected microphone (for processing). * * Optional method * * @param the desired field dimension of microphone capture. Range is from -1 (wide angle), * though 0 (no zoom) to 1 (maximum zoom). * * @return retval OK if the call is not successful, an error code otherwise. */ setMicrophoneFieldDimension(float zoom) generates(Result retval); };
audio/5.0/types.hal +26 −0 Original line number Diff line number Diff line Loading @@ -221,3 +221,29 @@ struct MicrophoneInfo { */ AudioMicrophoneCoordinate orientation; }; /** * Constants used by the HAL to determine how to select microphones and process those inputs in * order to optimize for capture in the specified direction. * * MicrophoneDirection Constants are defined in MicrophoneDirection.java. */ @export(name="audio_microphone_direction_t", value_prefix="MIC_DIRECTION_") enum MicrophoneDirection : int32_t { /** * Don't do any directionality processing of the activated microphone(s). */ UNSPECIFIED = 0, /** * Optimize capture for audio coming from the screen-side of the device. */ FRONT = 1, /** * Optimize capture for audio coming from the side of the device opposite the screen. */ BACK = 2, /** * Optimize capture for audio coming from an off-device microphone. */ EXTERNAL = 3, };
audio/core/all-versions/default/StreamIn.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,27 @@ Return<void> StreamIn::getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) { } #endif #if MAJOR_VERSION >= 5 Return<Result> StreamIn::setMicrophoneDirection(MicrophoneDirection direction) { if (mStream->set_microphone_direction == nullptr) { return Result::NOT_SUPPORTED; } return Stream::analyzeStatus( "set_microphone_direction", mStream->set_microphone_direction( mStream, static_cast<audio_microphone_direction_t>(direction))); } Return<Result> StreamIn::setMicrophoneFieldDimension(float zoom) { if (mStream->set_microphone_field_dimension == nullptr) { return Result::NOT_SUPPORTED; } return Stream::analyzeStatus("set_microphone_field_dimension", mStream->set_microphone_field_dimension(mStream, zoom)); } #endif } // namespace implementation } // namespace CPP_VERSION } // namespace audio Loading
audio/core/all-versions/default/include/core/default/StreamIn.h +4 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,10 @@ struct StreamIn : public IStreamIn { Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override; Return<void> getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) override; #endif #if MAJOR_VERSION >= 5 Return<Result> setMicrophoneDirection(MicrophoneDirection direction) override; Return<Result> setMicrophoneFieldDimension(float zoom) override; #endif static Result getCapturePositionImpl(audio_stream_in_t* stream, uint64_t* frames, uint64_t* time); Loading
compatibility_matrices/compatibility_matrix.current.xml +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ </hal> <hal format="hidl" optional="false"> <name>android.hardware.audio</name> <version>4.0</version> <version>5.0</version> <interface> <name>IDevicesFactory</name> <instance>default</instance> Loading @@ -17,7 +17,7 @@ </hal> <hal format="hidl" optional="false"> <name>android.hardware.audio.effect</name> <version>4.0</version> <version>5.0</version> <interface> <name>IEffectsFactory</name> <instance>default</instance> Loading