Remove OnData from media::AudioInputController::EventHandler |
||
Issue descriptionThe OnData method in media::AudioInputController::EventHandler is only used by SpeechRecognizerImpl. It complicates the AudioInputController which already supports another interface for delivering audio data and is blocking further development on the audio code.
,
Jan 16 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ce9a2515fc22794d7beb2268eaae525279a0c3b1 commit ce9a2515fc22794d7beb2268eaae525279a0c3b1 Author: tommi <tommi@chromium.org> Date: Mon Jan 16 18:35:18 2017 Refactor AudioInputController and related interfaces. * Remove special callback code (OnData callback) for Speech and instead use the callback interface that's already supplied. * Made methods and variables private to keep test code separate and force use of ForTesting methods. * Removed state_ and lock_ variables from AudioInputController and removed the need for acquiring said lock in the audio callback. * Moved inheritance of AudioInputCallback into a subclass. * An instance of the callback subclass only exists while the callback is active. This makes the threading model clearer and allows us to avoid using locks and atomic operations. * Made several member variable const, as their value must never change. * Made supplying a handler_ non-optional as well as sync_writer_. This also simplifies the code quite a bit. * Changed the way we report UMA stats. We don't use a reference counter anymore or atomic operations. I suspect that we've been getting incorrect stats reported due to issues with how we were previously doing this (in addition to slowing down the audio path). * Added a new UMA stat to track how often we get errors reported from the audio layer during capture. BUG= 681150 , 681152 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2624403002 Cr-Commit-Position: refs/heads/master@{#443925} [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/renderer_host/media/audio_input_renderer_host.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/renderer_host/media/audio_input_renderer_host.h [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/renderer_host/media/audio_input_renderer_host_unittest.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/speech/speech_recognition_browsertest.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/speech/speech_recognizer_impl.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/speech/speech_recognizer_impl.h [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/content/browser/speech/speech_recognizer_impl_unittest.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/audio_input_controller.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/audio_input_controller.h [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/audio_input_controller_unittest.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/audio_io.h [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/test_audio_input_controller_factory.cc [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/media/audio/test_audio_input_controller_factory.h [modify] https://crrev.com/ce9a2515fc22794d7beb2268eaae525279a0c3b1/tools/metrics/histograms/histograms.xml
,
Jan 16 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by tommi@chromium.org
, Jan 13 2017