Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Issue 9956169: Improved timer implementation in AudioInputController (Closed)

Created:
8 years, 8 months ago by henrika (OOO until Aug 14)
Modified:
8 years, 8 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, Primiano Tucci (use gerrit), Satish
Visibility:
Public.

Description

Improved timer implementation in AudioInputController since AudioInputController::DoResetNoDataTimer() has an extreme task execution count in chrome://profiler. There is no longer a PostTask in OnData() to reset the data timer. Instead, a simple flag is set and this flag is checked, and reset, on a periodic basis. If packets no longer are generated, the cleared flag will be detected an and OnError() callback will be given to the event handler. I have verified the new design in different ways: 1) Verified that no AudioInputController function pops up in the profiler. 2) media_unittest --gtest_filter=AudioInputControllerTest*RecordAndError 3) Tried out the speech input API and the removed the microphone while recording and verified that it worked. 4) Same as 3) but for WebRTC in loopback using the https://apprtc.appspot.com/?debug=loopback demo. BUG=123588 TEST=media_unittest --gtest_filter=AudioInputControllerTest*RecordAndError Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=132583

Patch Set 1 #

Total comments: 18

Patch Set 2 : Changes based on first review round #

Total comments: 2

Patch Set 3 : Rebased and final nits #

Patch Set 4 : Nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -40 lines) Patch
M media/audio/audio_input_controller.h View 1 2 3 4 chunks +28 lines, -17 lines 0 comments Download
M media/audio/audio_input_controller.cc View 1 2 3 8 chunks +45 lines, -23 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
henrika (OOO until Aug 14)
This CL ensures that AudioInputController tasks no longer exists among the top counts in the ...
8 years, 8 months ago (2012-04-17 11:40:43 UTC) #1
henrika (OOO until Aug 14)
CC: satish and primiano for Speech Input FYI.
8 years, 8 months ago (2012-04-17 11:42:21 UTC) #2
tommi (sloooow) - chröme
great stuff! is the unit test missing or am I misunderstanding the description? (a unit ...
8 years, 8 months ago (2012-04-17 11:58:31 UTC) #3
no longer working on chromium
Great work, thanks for cleaning it up. https://chromiumcodereview.appspot.com/9956169/diff/1/media/audio/audio_input_controller.cc File media/audio/audio_input_controller.cc (right): https://chromiumcodereview.appspot.com/9956169/diff/1/media/audio/audio_input_controller.cc#newcode144 media/audio/audio_input_controller.cc:144: no_data_timer_.reset(new base::DelayTimer<AudioInputController>(FROM_HERE, ...
8 years, 8 months ago (2012-04-17 12:20:41 UTC) #4
henrika (OOO until Aug 14)
Done. http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc File media/audio/audio_input_controller.cc (right): http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc#newcode144 media/audio/audio_input_controller.cc:144: no_data_timer_.reset(new base::DelayTimer<AudioInputController>(FROM_HERE, On 2012/04/17 11:58:31, tommi wrote: > ...
8 years, 8 months ago (2012-04-17 13:03:27 UTC) #5
henrika (OOO until Aug 14)
Tommi, I made the "TEST=" section more clear regarding the unit test.
8 years, 8 months ago (2012-04-17 13:05:03 UTC) #6
tommi (sloooow) - chröme
lgtm with two comments. http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc File media/audio/audio_input_controller.cc (right): http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc#newcode175 media/audio/audio_input_controller.cc:175: if (no_data_timer_.get()) { On 2012/04/17 ...
8 years, 8 months ago (2012-04-17 13:12:49 UTC) #7
henrika (OOO until Aug 14)
Thanks! http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc File media/audio/audio_input_controller.cc (right): http://codereview.chromium.org/9956169/diff/1/media/audio/audio_input_controller.cc#newcode175 media/audio/audio_input_controller.cc:175: if (no_data_timer_.get()) { On 2012/04/17 13:12:49, tommi wrote: ...
8 years, 8 months ago (2012-04-17 13:38:31 UTC) #8
no longer working on chromium
lgtm
8 years, 8 months ago (2012-04-17 13:40:15 UTC) #9
primiano CORP (USE chromium)
Thanks for the CC. No problem on our side since OnError is reposted anyway in ...
8 years, 8 months ago (2012-04-17 13:52:08 UTC) #10
henrika (OOO until Aug 14)
Great. I just wanted to let you know about the change since there had also ...
8 years, 8 months ago (2012-04-17 13:56:11 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/henrika@chromium.org/9956169/7003
8 years, 8 months ago (2012-04-17 14:38:23 UTC) #12
commit-bot: I haz the power
8 years, 8 months ago (2012-04-17 16:03:48 UTC) #13
Change committed as 132583

Powered by Google App Engine
This is Rietveld 408576698