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

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed)

Created:
6 years, 10 months ago by DaleCurtis
Modified:
6 years, 9 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Enhance AudioSplicer to crossfade marked splice frames. The AudioSplicer now allows external clients to indicate when a splice frame is coming up with SetSpliceTimestamp(). Once set buffers involved in the splice are queued until enough overlapping buffers are recieved to perform a crossfade. To do this an AudioStreamSanitizer has been factorized out from the existing AudioSplicer code. It handles ensure streams are contiguous much in the way the splicer did before. AudioSplicer itself now owns three separate AudioStreamSanitizers. |sanitizer_| is the one which AudioSplicer callers will access. |pre_splice_sanitizer_| for buffers with timestamps before the splice. |post_splice_sanitizer_| for buffers with timestamps after the splice. Once enough data for the crossfade is received (or end of stream) the pre and post sanitizers are drained, trimmed, and crossfaded in accordance with the MSE audio splice frame algorithm: https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-audio-splice-rendering-algorithm Future changes will enable SourceBufferStream to tag DecoderBuffers with a splice timestamp which will be consumed by AudioBufferStream and passed along to AudioSplicer. BUG=334493 TEST=new unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=254279

Patch Set 1 : Clarity. #

Total comments: 4

Patch Set 2 : Resolve comments. #

Total comments: 16

Patch Set 3 : Fixes from unittest. #

Patch Set 4 : More tests. #

Total comments: 32

Patch Set 5 : Comments. #

Total comments: 4

Patch Set 6 : Fixes. #

Total comments: 23

Patch Set 7 : Comments. #

Total comments: 4

Patch Set 8 : Comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+808 lines, -169 lines) Patch
M media/base/audio_splicer.h View 1 2 3 4 5 6 7 1 chunk +55 lines, -22 lines 0 comments Download
M media/base/audio_splicer.cc View 1 2 3 4 5 6 7 5 chunks +394 lines, -20 lines 0 comments Download
M media/base/audio_splicer_unittest.cc View 1 2 3 4 5 6 12 chunks +336 lines, -120 lines 0 comments Download
M media/base/audio_timestamp_helper.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M media/base/vector_math.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/vector_math.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M media/base/vector_math_unittest.cc View 1 2 3 3 chunks +12 lines, -6 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
DaleCurtis
My proposed solution for handling crossfading. I recommend reviewing for design only at this point. ...
6 years, 10 months ago (2014-02-07 01:35:18 UTC) #1
acolwell GONE FROM CHROMIUM
I don't think the recursive definition is quite right here. Perhaps we need to refactor/rename ...
6 years, 10 months ago (2014-02-10 20:19:57 UTC) #2
DaleCurtis
Reworked per our offline discussions. Still needs tests and such, so I recommend high level ...
6 years, 10 months ago (2014-02-15 01:20:02 UTC) #3
acolwell GONE FROM CHROMIUM
This looks good to me https://codereview.chromium.org/156783003/diff/90001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/90001/media/base/audio_splicer.cc#newcode59 media/base/audio_splicer.cc:59: // Get the current ...
6 years, 10 months ago (2014-02-18 23:22:58 UTC) #4
DaleCurtis
https://codereview.chromium.org/156783003/diff/90001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/90001/media/base/audio_splicer.cc#newcode59 media/base/audio_splicer.cc:59: // Get the current timestamp. This value is computed ...
6 years, 10 months ago (2014-02-19 03:05:13 UTC) #5
DaleCurtis
This should be entirely ready for review now. Unittest all the things! https://codereview.chromium.org/156783003/diff/90001/media/base/audio_splicer.cc File media/base/audio_splicer.cc ...
6 years, 10 months ago (2014-02-22 00:59:04 UTC) #6
acolwell GONE FROM CHROMIUM
looking really good. Just a few comments. https://codereview.chromium.org/156783003/diff/280001/media/base/audio_buffer.cc File media/base/audio_buffer.cc (right): https://codereview.chromium.org/156783003/diff/280001/media/base/audio_buffer.cc#newcode226 media/base/audio_buffer.cc:226: floor(static_cast<double>(duration_.InMicroseconds()) * ...
6 years, 9 months ago (2014-02-24 21:46:10 UTC) #7
DaleCurtis
<Just comments> I'll take a stab at rewriting all the timestamp manipulation everywhere with AudioTimestampHelpers. ...
6 years, 9 months ago (2014-02-24 23:04:09 UTC) #8
DaleCurtis
Rewrote to use AudioTimestampHelper for the cost of a couple hundred lines :) AudioTimestampHelper is ...
6 years, 9 months ago (2014-02-26 02:38:44 UTC) #9
DaleCurtis
https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc#newcode86 media/base/audio_splicer.cc:86: scoped_ptr<AudioStreamSanitizer> ShallowCopy(); After sleeping on it, I'm going to ...
6 years, 9 months ago (2014-02-26 18:51:00 UTC) #10
DaleCurtis
https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc#newcode389 media/base/audio_splicer.cc:389: std::min(pre_splice_ts_helper.frame_count() - frames_before_splice, Also this is wrong since I'm ...
6 years, 9 months ago (2014-02-26 23:41:51 UTC) #11
DaleCurtis
https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/430001/media/base/audio_splicer.cc#newcode86 media/base/audio_splicer.cc:86: scoped_ptr<AudioStreamSanitizer> ShallowCopy(); On 2014/02/26 18:51:00, DaleCurtis wrote: > After ...
6 years, 9 months ago (2014-02-27 00:04:57 UTC) #12
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc#newcode51 media/base/audio_splicer.cc:51: buffer->TrimEnd(frames_to_trim); nit: DCHECK_EQ(buffer->timestamp(), timestamp_helper.GetTimestamp()) ? https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc#newcode56 media/base/audio_splicer.cc:56: typedef std::deque<scoped_refptr<AudioBuffer> ...
6 years, 9 months ago (2014-02-27 17:10:13 UTC) #13
DaleCurtis
https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc#newcode287 media/base/audio_splicer.cc:287: input->timestamp() != splice_timestamp_) { On 2014/02/27 17:10:14, acolwell wrote: ...
6 years, 9 months ago (2014-02-27 19:45:01 UTC) #14
DaleCurtis
https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc#newcode51 media/base/audio_splicer.cc:51: buffer->TrimEnd(frames_to_trim); On 2014/02/27 17:10:14, acolwell wrote: > nit: DCHECK_EQ(buffer->timestamp(), ...
6 years, 9 months ago (2014-02-28 00:24:41 UTC) #15
acolwell GONE FROM CHROMIUM
Looks good. Just a few minor issue and I think you should be good to ...
6 years, 9 months ago (2014-02-28 18:50:26 UTC) #16
DaleCurtis
https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/156783003/diff/450001/media/base/audio_splicer.cc#newcode287 media/base/audio_splicer.cc:287: input->timestamp() != splice_timestamp_) { On 2014/02/28 18:50:27, acolwell wrote: ...
6 years, 9 months ago (2014-02-28 21:14:26 UTC) #17
acolwell GONE FROM CHROMIUM
Awesome! \o/ thanks for doing this. LGTM
6 years, 9 months ago (2014-02-28 21:57:13 UTC) #18
DaleCurtis
The CQ bit was checked by dalecurtis@chromium.org
6 years, 9 months ago (2014-02-28 22:03:02 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/156783003/510001
6 years, 9 months ago (2014-02-28 22:03:29 UTC) #20
DaleCurtis
Thanks for the review!
6 years, 9 months ago (2014-02-28 22:03:45 UTC) #21
commit-bot: I haz the power
6 years, 9 months ago (2014-03-01 00:08:54 UTC) #22
Message was sent while issue was closed.
Change committed as 254279

Powered by Google App Engine
This is Rietveld 408576698