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

Issue 10843031: Piping for audio decoding. (Closed)

Created:
8 years, 4 months ago by kxing
Modified:
8 years, 4 months ago
Reviewers:
Sergey Ulanov, garykac, Wez
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 6

Patch Set 2 : Code cleanup #

Patch Set 3 : Small refactoring #

Total comments: 22

Patch Set 4 : Made ChromotingClient own AudioDecodeScheduler #

Patch Set 5 : Changed an #include to a forward declaration #

Total comments: 14

Patch Set 6 : Addressed comments #

Patch Set 7 : Made the AudioDecodeScheduler destructor virtual #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+271 lines, -28 lines) Patch
M remoting/client/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A remoting/client/audio_decode_scheduler.h View 1 2 3 4 5 6 1 chunk +59 lines, -0 lines 1 comment Download
A remoting/client/audio_decode_scheduler.cc View 1 2 3 4 5 1 chunk +58 lines, -0 lines 4 comments Download
M remoting/client/chromoting_client.h View 1 2 3 4 5 4 chunks +8 lines, -10 lines 0 comments Download
M remoting/client/chromoting_client.cc View 1 2 3 4 5 5 chunks +12 lines, -11 lines 1 comment Download
M remoting/client/client_context.h View 1 4 5 1 chunk +5 lines, -1 line 2 comments Download
M remoting/client/client_context.cc View 1 4 5 3 chunks +8 lines, -1 line 1 comment Download
M remoting/client/plugin/chromoting_instance.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M remoting/client/plugin/chromoting_instance.cc View 1 2 3 4 5 2 chunks +3 lines, -4 lines 0 comments Download
M remoting/codec/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A remoting/codec/audio_decoder.h View 1 2 1 chunk +30 lines, -0 lines 1 comment Download
A remoting/codec/audio_decoder.cc View 1 chunk +25 lines, -0 lines 1 comment Download
A remoting/codec/audio_decoder_verbatim.h View 1 2 3 1 chunk +31 lines, -0 lines 0 comments Download
A remoting/codec/audio_decoder_verbatim.cc View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M remoting/remoting.gyp View 1 2 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
kxing
Could someone PTAL?
8 years, 4 months ago (2012-08-01 17:28:29 UTC) #1
Sergey Ulanov
http://codereview.chromium.org/10843031/diff/1/remoting/client/chromoting_client.cc File remoting/client/chromoting_client.cc (right): http://codereview.chromium.org/10843031/diff/1/remoting/client/chromoting_client.cc#newcode147 remoting/client/chromoting_client.cc:147: scoped_ptr<AudioPacket> decoded_packet = Add DCHECK to verify that this ...
8 years, 4 months ago (2012-08-01 17:43:54 UTC) #2
kxing
Could someone PTAL again? http://codereview.chromium.org/10843031/diff/1/remoting/client/chromoting_client.cc File remoting/client/chromoting_client.cc (right): http://codereview.chromium.org/10843031/diff/1/remoting/client/chromoting_client.cc#newcode147 remoting/client/chromoting_client.cc:147: scoped_ptr<AudioPacket> decoded_packet = On 2012/08/01 ...
8 years, 4 months ago (2012-08-01 22:15:37 UTC) #3
kxing
Ping
8 years, 4 months ago (2012-08-02 20:08:16 UTC) #4
Sergey Ulanov
Looks mostly good, but I have some nits, particularly regarding creation/ownership of AudioDecodeScheduler. http://codereview.chromium.org/10843031/diff/6002/remoting/client/audio_decode_scheduler.cc File ...
8 years, 4 months ago (2012-08-02 20:32:48 UTC) #5
kxing
Could someone PTAL again? http://codereview.chromium.org/10843031/diff/6002/remoting/client/audio_decode_scheduler.cc File remoting/client/audio_decode_scheduler.cc (right): http://codereview.chromium.org/10843031/diff/6002/remoting/client/audio_decode_scheduler.cc#newcode24 remoting/client/audio_decode_scheduler.cc:24: AudioDecodeScheduler::~AudioDecodeScheduler() {} On 2012/08/02 20:32:48, ...
8 years, 4 months ago (2012-08-03 14:51:47 UTC) #6
Sergey Ulanov
LGTM provided my nits are addressed. http://codereview.chromium.org/10843031/diff/11003/remoting/client/audio_decode_scheduler.cc File remoting/client/audio_decode_scheduler.cc (right): http://codereview.chromium.org/10843031/diff/11003/remoting/client/audio_decode_scheduler.cc#newcode49 remoting/client/audio_decode_scheduler.cc:49: done.Run(); MessageReader will ...
8 years, 4 months ago (2012-08-03 17:59:55 UTC) #7
kxing
I'll commit this soon, unless someone objects. http://codereview.chromium.org/10843031/diff/11003/remoting/client/audio_decode_scheduler.cc File remoting/client/audio_decode_scheduler.cc (right): http://codereview.chromium.org/10843031/diff/11003/remoting/client/audio_decode_scheduler.cc#newcode49 remoting/client/audio_decode_scheduler.cc:49: done.Run(); On ...
8 years, 4 months ago (2012-08-03 20:55:13 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kxing@chromium.org/10843031/5018
8 years, 4 months ago (2012-08-03 21:40:50 UTC) #9
commit-bot: I haz the power
Try job failure for 10843031-5018 (retry) on mac for step "compile" (clobber build). It's a ...
8 years, 4 months ago (2012-08-03 21:57:18 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kxing@chromium.org/10843031/3006
8 years, 4 months ago (2012-08-03 22:48:16 UTC) #11
commit-bot: I haz the power
Change committed as 149990
8 years, 4 months ago (2012-08-04 01:15:25 UTC) #12
Wez
8 years, 4 months ago (2012-08-07 18:29:04 UTC) #13
https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
File remoting/client/audio_decode_scheduler.cc (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
remoting/client/audio_decode_scheduler.cc:30:
decoder_.reset(AudioDecoder::CreateAudioDecoder(config).release());
nit: decoder_ = AudioDecoder::CreateAudioDecoder(config); ?

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
remoting/client/audio_decode_scheduler.cc:37:
&AudioDecodeScheduler::DecodePacket, base::Unretained(this),
You can't use base::Unretained(this) unless you have some other way to guarantee
that all such tasks you posted to the thread will have been processed by the
time you delete the AudioDecodeScheduler, or will be ignored once it's gone.
You'll need to split AudioDecodeScheduler's DecodePacket handling into a
separate ref-counted class internal to the scheduler, and which posts back to
ProcessDecodedPacket via a WeakPtr to the main scheduler object.

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
remoting/client/audio_decode_scheduler.cc:47:
&AudioDecodeScheduler::ProcessDecodedPacket, base::Unretained(this),
base::Unretained(this) -> weak_ptr_, where weak_ptr_ is initialised in
Initialize() or the constructore, from a weak_factory_ member of the
AudioDecodeScheduler itself.

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
remoting/client/audio_decode_scheduler.cc:54:
audio_player_->ProcessAudioPacket(packet.Pass());
Presumably ProcessAudioPacket plays back asynchronously, so should the done task
be passed to that, so that the caller actually gets notified only when the audio
has actually been played?

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
File remoting/client/audio_decode_scheduler.h (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/aud...
remoting/client/audio_decode_scheduler.h:29:
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
nit: It's not clear what it means for this to be the "main" TaskRunner; it's the
TaskRunner we expect our AudioStub API to be called on, and the one that we
dispatch to the AudioPlayer on, so you might call it the "playback" TaskRunner,
or simply add a comment to clarify how the two TaskRunners will be used.

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/chr...
File remoting/client/chromoting_client.cc (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/chr...
remoting/client/chromoting_client.cc:73: audio_decode_scheduler_.get());
nit: Hmmm, Connect() is getting bloated with parameters not actually related to
connecting; we should move these out into separate setters e.g.
set_audio_scheduler(), in a follow-up CL.

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/cli...
File remoting/client/client_context.cc (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/cli...
remoting/client/client_context.cc:11:
decode_thread_("ChromotingClientDecodeThread"),
nit: ChromotingClientVideoDecodeThread, etc

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/cli...
File remoting/client/client_context.h (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/cli...
remoting/client/client_context.h:31: base::SingleThreadTaskRunner*
decode_task_runner();
nit: video_decode_task_runner()

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/client/cli...
remoting/client/client_context.h:32: base::SingleThreadTaskRunner*
audio_decode_task_runner();
What is the intent in running audio decode on a separate thread from video
decode? Most client devices will have a limited number of cores, and we're
already running VP8 decode mutli-threaded, so except on high-end systems an
additional thread just adds scheduling overhead. Is the aim to ensure that long
video decodes don't block audio decode for too long, for example?

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/codec/audi...
File remoting/codec/audio_decoder.cc (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/codec/audi...
remoting/codec/audio_decoder.cc:21: NOTIMPLEMENTED();
nit: NOTIMPLEMENTED isn't really appropriate here, since this function _is_
implemented and the caller has just supplied an invalid configuration.

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/codec/audi...
File remoting/codec/audio_decoder.h (right):

https://chromiumcodereview.appspot.com/10843031/diff/3006/remoting/codec/audi...
remoting/codec/audio_decoder.h:25: virtual scoped_ptr<AudioPacket>
Decode(scoped_ptr<AudioPacket> packet) = 0;
Given that the AudioEncoder and AudioDecoder interfaces are all but identical,
transcoding AudioPacket->AudioPacket, would a single AudioTranscoder interface
make more sense?

Powered by Google App Engine
This is Rietveld 408576698