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

Unified Diff: services/media/audio/audio_pipe.cc

Issue 1836953002: Motown: Delay audio track completion of Prime requests until a packet arrives. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/media/audio/audio_pipe.h ('k') | services/media/common/media_pipe_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/audio/audio_pipe.cc
diff --git a/services/media/audio/audio_pipe.cc b/services/media/audio/audio_pipe.cc
index 66ae598186e341de769259f40c5c5618f7d25284..eba55cd3a2b7e30a1bd0721e09b3f81264bb2322 100644
--- a/services/media/audio/audio_pipe.cc
+++ b/services/media/audio/audio_pipe.cc
@@ -131,6 +131,22 @@ void AudioPipe::OnPacketReceived(MediaPacketStatePtr state) {
std::move(regions),
start_pts,
next_pts_)));
+
+ if (!prime_callback_.is_null()) {
+ // Prime was requested. Call the callback to indicate priming is complete.
+ // TODO(dalesat): Don't do this until low water mark is reached.
kulakowski 2016/03/28 20:46:12 For my edification: What is priming? What is a "lo
dalesat 2016/03/28 22:19:56 Priming is getting some initial packets of content
kulakowski 2016/03/30 20:44:55 Gotcha. Couple more questions. How is seeking dif
dalesat 2016/03/30 21:04:14 Content is typically authored such that the first
kulakowski 2016/03/31 21:32:12 It really does not seem to me that this is a singl
dalesat 2016/03/31 21:45:14 Sure. Is this a concern for this CL?
kulakowski 2016/03/31 22:43:34 Well if you have a TODO about it in the implementa
+ prime_callback_.Run();
+ prime_callback_.reset();
+ }
+}
+
+void AudioPipe::OnPrimeRequested(const PrimeCallback& cbk) {
+ if (!prime_callback_.is_null()) {
+ // Prime was already requested. Complete the old one and warn.
+ LOG(WARNING) << "multiple prime requests received";
+ prime_callback_.Run();
+ }
+ prime_callback_ = cbk;
}
bool AudioPipe::OnFlushRequested(const FlushCallback& cbk) {
« no previous file with comments | « services/media/audio/audio_pipe.h ('k') | services/media/common/media_pipe_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698