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

Issue 10912079: Adds AudioFifo class to Chrome media. (Closed)

Created:
8 years, 3 months ago by henrika (OOO until Aug 14)
Modified:
8 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, scherkus (not reviewing), tommi (sloooow) - chröme
Visibility:
Public.

Description

Ports the WebCore::AudioFIFO in WebKit to Chrome style. This class will be use in an upcoming AudioPullFifo class. BUG=none TEST=media_unittests --gtest_filter=AudioFifoTest.* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=155171

Patch Set 1 #

Total comments: 52

Patch Set 2 : Changes based on review by Chris #

Patch Set 3 : Changes based on review by Dale #

Total comments: 7

Patch Set 4 : Added frames_to_consum to Consume() #

Total comments: 25

Patch Set 5 : More changes proposed by Dale #

Unified diffs Side-by-side diffs Delta from patch set Stats (+415 lines, -0 lines) Patch
A media/base/audio_fifo.h View 1 2 3 4 1 chunk +64 lines, -0 lines 0 comments Download
A media/base/audio_fifo.cc View 1 2 3 4 1 chunk +134 lines, -0 lines 0 comments Download
A media/base/audio_fifo_unittest.cc View 1 2 3 4 1 chunk +214 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
henrika (OOO until Aug 14)
Please review a first version of media::AudioFifo. The API is not identical to the original ...
8 years, 3 months ago (2012-09-04 15:28:59 UTC) #1
Chris Rogers
Henrik, looks great, especially the tests! I have a couple of nits. Dale: could you ...
8 years, 3 months ago (2012-09-04 20:07:20 UTC) #2
henrika (OOO until Aug 14)
Thanks Chris. Uploaded new patch and answered your questions. Waiting for feedback from Dale as ...
8 years, 3 months ago (2012-09-05 10:14:36 UTC) #3
DaleCurtis
In general looks good. I don't have any functional complaints, just API level comments. Testing ...
8 years, 3 months ago (2012-09-05 10:34:18 UTC) #4
henrika (OOO until Aug 14)
- Removed helper methods. - Modified member names. - New public API: Append->Push, Remove->Consume. http://codereview.chromium.org/10912079/diff/1/media/base/audio_fifo.cc ...
8 years, 3 months ago (2012-09-05 12:49:04 UTC) #5
DaleCurtis
http://codereview.chromium.org/10912079/diff/1/media/base/audio_fifo.h File media/base/audio_fifo.h (right): http://codereview.chromium.org/10912079/diff/1/media/base/audio_fifo.h#newcode26 media/base/audio_fifo.h:26: bool Append(const AudioBus* source); On 2012/09/05 12:49:04, henrika wrote: ...
8 years, 3 months ago (2012-09-05 13:09:22 UTC) #6
henrika (OOO until Aug 14)
Based on off-line discussions I will modify the public API to: // Consumes |frames_to_consume| audio ...
8 years, 3 months ago (2012-09-05 15:26:32 UTC) #7
DaleCurtis
Per discussion yesterday, LGTM. We'll iterate and improve in AudioPullFIFO.
8 years, 3 months ago (2012-09-06 08:20:14 UTC) #8
henrika (OOO until Aug 14)
Modified Consume() and also cleaned up the unit test to make it more clear. Andrew: ...
8 years, 3 months ago (2012-09-06 09:40:06 UTC) #9
DaleCurtis
I'm also a media/ OWNER, so you don't need to wait for scherkus unless you ...
8 years, 3 months ago (2012-09-06 11:14:13 UTC) #10
henrika (OOO until Aug 14)
Thanks Dale. Fixed. http://codereview.chromium.org/10912079/diff/13001/media/base/audio_fifo.cc File media/base/audio_fifo.cc (right): http://codereview.chromium.org/10912079/diff/13001/media/base/audio_fifo.cc#newcode7 media/base/audio_fifo.cc:7: #include "media/audio/audio_parameters.h" Fixed. Don't need this ...
8 years, 3 months ago (2012-09-06 11:52:46 UTC) #11
scherkus (not reviewing)
few post-land nits/questions https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_fifo.cc File media/base/audio_fifo.cc (right): https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_fifo.cc#newcode7 media/base/audio_fifo.cc:7: #include "media/audio/audio_parameters.h" a->z ordering https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_fifo.cc#newcode12 media/base/audio_fifo.cc:12: ...
8 years, 3 months ago (2012-09-06 13:53:57 UTC) #12
henrika (OOO until Aug 14)
Thanks Andrew, will fix all this in an upcoming AudioPullFifo CL. On Thu, Sep 6, ...
8 years, 3 months ago (2012-09-06 14:02:02 UTC) #13
henrika (OOO until Aug 14)
8 years, 3 months ago (2012-09-07 14:10:37 UTC) #14
Fixed and added to AudioPullFifo CL.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
File media/base/audio_fifo.cc (right):

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.cc:7: #include "media/audio/audio_parameters.h"
On 2012/09/06 13:53:57, scherkus wrote:
> a->z ordering

Done.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.cc:12: static void GetSizes(
On 2012/09/06 13:53:57, scherkus wrote:
> docs please

Done.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.cc:25: static int UpdatePos(int pos, int step, int
max_size) {
On 2012/09/06 13:53:57, scherkus wrote:
> docs

Done.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.cc:80: DLOG(ERROR) << "FIFO underrun.";
Got it. Will modify.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.cc:87: DLOG(ERROR) << "Insufficient space in
destination.";
see above

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
File media/base/audio_fifo.h (right):

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.h:32: bool Consume(AudioBus* destination, int
frames_to_consume);
Are you suggesting that I modify to void and add CHECK() for these two failing
cases?

And yes, the user can either do the sanity check you list or go for it and check
the return value ;-)

Disussed off-line; will change.

https://chromiumcodereview.appspot.com/10912079/diff/13001/media/base/audio_f...
media/base/audio_fifo.h:38: int frames_in_fifo() const { return frames_in_fifo_;
}
LOL, that's my melody as well but not all reviewers like the initial proposal
since it could be mixed up with the max number of frames it can contain ;-)

I'll be happy to change. Done.

Powered by Google App Engine
This is Rietveld 408576698