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

Issue 9347029: Decouple 'give me more data' and 'rendered end of stream' audio callbacks. (Closed)

Created:
8 years, 10 months ago by enal
Modified:
8 years, 8 months ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, jam, acolwell+watch_chromium.org, annacc+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, vrk (LEFT CHROMIUM), ihf+watch_chromium.org
Visibility:
Public.

Description

Decouple 'give me more data' and 'rendered end of stream' audio callbacks. Make 'rendered end of stream' cllback to be called by the delayed task. That is in the preparation of software audio mixer, it will ask for data at the time unrelated to the actual playback.

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -28 lines) Patch
M content/renderer/media/audio_renderer_impl.h View 1 2 3 4 7 chunks +53 lines, -3 lines 0 comments Download
M content/renderer/media/audio_renderer_impl.cc View 1 2 3 4 10 chunks +69 lines, -20 lines 3 comments Download
M content/renderer/media/audio_renderer_impl_unittest.cc View 1 2 3 4 5 chunks +62 lines, -1 line 1 comment Download
M media/filters/audio_renderer_base.h View 1 2 3 4 3 chunks +11 lines, -2 lines 0 comments Download
M media/filters/audio_renderer_base.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
enal1
And here is promised CL, with (hopefully) correct handling of seek/pause after we scheduled the ...
8 years, 10 months ago (2012-02-07 19:42:06 UTC) #1
scherkus (not reviewing)
I'm a bit confused. Why do we need to execute SignalEndOfStream() on the IO thread? ...
8 years, 10 months ago (2012-02-08 02:10:40 UTC) #2
enal1
Pipeline message loop is not readily available, and it is not available to caller as ...
8 years, 10 months ago (2012-02-08 02:43:22 UTC) #3
scherkus (not reviewing)
apologies as I'm still a bit confused here! is there a bug/issue that this CL ...
8 years, 10 months ago (2012-02-09 04:52:50 UTC) #4
enal1
On 2012/02/09 04:52:50, scherkus wrote: > apologies as I'm still a bit confused here! > ...
8 years, 10 months ago (2012-02-09 19:13:22 UTC) #5
scherkus (not reviewing)
my biggest concern with this CL going in as is is that if I'm having ...
8 years, 10 months ago (2012-02-23 05:54:51 UTC) #6
Ami GONE FROM CHROMIUM
drive-by triggered by scherkus@' mention of "subtle" https://chromiumcodereview.appspot.com/9347029/diff/10003/content/renderer/media/audio_renderer_impl.h File content/renderer/media/audio_renderer_impl.h (right): https://chromiumcodereview.appspot.com/9347029/diff/10003/content/renderer/media/audio_renderer_impl.h#newcode165 content/renderer/media/audio_renderer_impl.h:165: base::subtle::Atomic32 stream_id_; ...
8 years, 10 months ago (2012-02-23 20:18:25 UTC) #7
enal1
https://chromiumcodereview.appspot.com/9347029/diff/10003/content/renderer/media/audio_renderer_impl.h File content/renderer/media/audio_renderer_impl.h (right): https://chromiumcodereview.appspot.com/9347029/diff/10003/content/renderer/media/audio_renderer_impl.h#newcode165 content/renderer/media/audio_renderer_impl.h:165: base::subtle::Atomic32 stream_id_; On 2012/02/23 20:18:25, Ami Fischman wrote: > ...
8 years, 10 months ago (2012-02-23 20:28:04 UTC) #8
enal1
Rewrote the code to (1) Use cancelable callback, (2) Use pipeline thread instead of I/O ...
8 years, 10 months ago (2012-02-24 19:03:27 UTC) #9
scherkus (not reviewing)
I'm really wary of landing this patch. It looks like a lot of the trickiness ...
8 years, 9 months ago (2012-03-03 02:24:32 UTC) #10
enal1
It's not urgent, and it probably can wait till code refactoring is complete. I also ...
8 years, 9 months ago (2012-03-05 17:24:00 UTC) #11
scherkus (not reviewing)
8 years, 9 months ago (2012-03-08 03:19:02 UTC) #12
On 2012/03/05 17:24:00, enal1 wrote:
> It's not urgent, and it probably can wait till code refactoring is
> complete. I also don't like the resulting code, but I didn't want to go and
> change everything to clean things up, I have mixer to implement -- after
> all, on all-hands meeting we were told that using less resources is highest
> priority :-)
> 
> I hoped we can speed up things a bit before worsening latency when mixer
> would be ready (do your remember saying "what andy gath bill taketh away"?)
> 
> Thanks,
> Eugene

Thanks for the details Eugene!

We'll put this CL on hold for now but I do think we should use your test page to
benchmark our end-to-end latency and improve said latency after some of the code
has been cleaned up.

I've filed the following bug with the details + a benchmark:
http://code.google.com/p/chromium/issues/detail?id=117314

Andrew
 
> On Fri, Mar 2, 2012 at 6:24 PM, <mailto:scherkus@chromium.org> wrote:
> 
> > I'm really wary of landing this patch. It looks like a lot of the
> > trickiness
> > stems from AudioRendererBase having ill-defined threading policy.
> >
> > How urgent is it for this to land in M19? It seems like fixing
> > http://crbug.com/116645 first as well as cleaning up the locking/threading
> > policy prior to landing this fix would be better (I think this is on vrk's
> > plate)
> >
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> >
>
18001/content/renderer/media/**audio_renderer_impl.cc<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl.cc>
> > File content/renderer/media/audio_**renderer_impl.cc (right):
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> >
>
18001/content/renderer/media/**audio_renderer_impl.cc#**newcode193<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl.cc#newcode193>
> > content/renderer/media/audio_**renderer_impl.cc:193:
> > base::Bind(&AudioRendererImpl:**:DoSignalEndOfStream, AsWeakPtr()));
> > are weak pointers enforced by cancellable callbacks?
> >
> > seems strange considering AudioRendererImpl is refcounted
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> >
>
18001/content/renderer/media/**audio_renderer_impl.cc#**newcode200<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl.cc#newcode200>
> > content/renderer/media/audio_**renderer_impl.cc:200:
> > DoSetOrCheckMessageLoopProxy()**;
> > I would strongly prefer having pipeline set the message loop as opposed
> > to hijacking it via these methods.
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> >
>
18001/content/renderer/media/**audio_renderer_impl.cc#**newcode288<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl.cc#newcode288>
> > content/renderer/media/audio_**renderer_impl.cc:288: if (delay_ms <= 0) {
> > if the delay time was calculated to be <=0 wouldn't we want to call PDT
> > with a time of 0? otherwise the task will get put behind whatever other
> > tasks are queued when using PostTask
> >
> > in which case using std::max(0, delay) would work
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> >
>
18001/content/renderer/media/**audio_renderer_impl_unittest.**cc<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl_unittest.cc>
> > File content/renderer/media/audio_**renderer_impl_unittest.cc (right):
> >
> > https://chromiumcodereview.**appspot.com/9347029/diff/**
> > 18001/content/renderer/media/**audio_renderer_impl_unittest.**
> >
>
cc#newcode228<https://chromiumcodereview.appspot.com/9347029/diff/18001/content/renderer/media/audio_renderer_impl_unittest.cc#newcode228>
> > content/renderer/media/audio_**renderer_impl_unittest.cc:228:
> > TEST_F(AudioRendererImplTest, OnRenderEndOfStream) {
> > These tests rely way too much on internal knowledge of the class.
> >
> > The fact that we're adding virtual methods, protected members, and tests
> > with friend access is a sign that things have started to go awry! The
> > next person who touches AudioRendererImpl will spend more time updating
> > tests than writing production code.
> >
> > It'd be preferable to eliminate the virtual/protected methods and write
> > these tests using higher-level methods such as Render() and
> > DecodedAudioReady() -- for example you can set recieved_end_of_stream_
> > to true by passing in an EOS Buffer to DecodedAudioReady()
> >
> > Failing that -- we could also check in your HTML test as a layout test
> > and do without C++ unit tests
> >
> >
>
https://chromiumcodereview.**appspot.com/9347029/%3Chttps://chromiumcoderevie...>
> >

Powered by Google App Engine
This is Rietveld 408576698