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

Side by Side Diff: services/media/common/media_pipe_base.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, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "services/media/common/media_pipe_base.h" 6 #include "services/media/common/media_pipe_base.h"
7 7
8 namespace mojo { 8 namespace mojo {
9 namespace media { 9 namespace media {
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 DCHECK(packet->extra_payload); 130 DCHECK(packet->extra_payload);
131 r = &packet->extra_payload[i++]; 131 r = &packet->extra_payload[i++];
132 } 132 }
133 133
134 // Looks good, send this packet up to the implementation layer. 134 // Looks good, send this packet up to the implementation layer.
135 MediaPacketStatePtr ptr(new MediaPacketState(packet.Pass(), buffer_, cbk)); 135 MediaPacketStatePtr ptr(new MediaPacketState(packet.Pass(), buffer_, cbk));
136 OnPacketReceived(std::move(ptr)); 136 OnPacketReceived(std::move(ptr));
137 } 137 }
138 138
139 void MediaPipeBase::Prime(const PrimeCallback& cbk) { 139 void MediaPipeBase::Prime(const PrimeCallback& cbk) {
140 cbk.Run(); 140 OnPrimeRequested(cbk);
141 } 141 }
142 142
143 void MediaPipeBase::Flush(const FlushCallback& cbk) { 143 void MediaPipeBase::Flush(const FlushCallback& cbk) {
144 // If we have not been successfully initialized, then we should not be getting 144 // If we have not been successfully initialized, then we should not be getting
145 // packets pushed to us. 145 // packets pushed to us.
146 if (!buffer_) { 146 if (!buffer_) {
147 LOG(ERROR) << "Flush called with no shared buffer established!"; 147 LOG(ERROR) << "Flush called with no shared buffer established!";
148 Reset(); 148 Reset();
149 return; 149 return;
150 } 150 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (MOJO_RESULT_OK != res) { 206 if (MOJO_RESULT_OK != res) {
207 LOG(ERROR) << "Failed to map shared buffer of size " << size_ 207 LOG(ERROR) << "Failed to map shared buffer of size " << size_
208 << " (res " << res << ")"; 208 << " (res " << res << ")";
209 DCHECK(base_ == nullptr); 209 DCHECK(base_ == nullptr);
210 handle_.reset(); 210 handle_.reset();
211 } 211 }
212 } 212 }
213 213
214 } // namespace media 214 } // namespace media
215 } // namespace mojo 215 } // namespace mojo
OLDNEW
« services/media/audio/audio_pipe.cc ('K') | « services/media/common/media_pipe_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698