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

Side by Side Diff: services/media/framework/graph.cc

Issue 1692443002: Motown: Framework parts for mojo transport (producer/consumer/mediapipe) and control (audiotrack). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Added comments to AudioTrackController::SetRate regarding the proper way to implement it. 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 unified diff | Download patch
« no previous file with comments | « services/media/framework/graph.h ('k') | services/media/framework/parts/decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/media/framework/graph.h" 5 #include "services/media/framework/graph.h"
6 6
7 namespace mojo { 7 namespace mojo {
8 namespace media { 8 namespace media {
9 9
10 Graph::Graph() { 10 Graph::Graph() {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 DCHECK(input.valid()); 192 DCHECK(input.valid());
193 engine_.PrepareInput(input); 193 engine_.PrepareInput(input);
194 } 194 }
195 195
196 void Graph::PrimeSinks() { 196 void Graph::PrimeSinks() {
197 for (Stage* sink : sinks_) { 197 for (Stage* sink : sinks_) {
198 sink->Prime(); 198 sink->Prime();
199 } 199 }
200 } 200 }
201 201
202 void Graph::FlushOutput(const OutputRef& output) {
203 DCHECK(output);
204 engine_.FlushOutput(output);
205 }
206
207 void Graph::FlushAllOutputs(PartRef part) {
208 DCHECK(part.valid());
209 size_t output_count = part.output_count();
210 for (size_t output_index = 0; output_index < output_count; output_index++) {
211 FlushOutput(part.output(output_index));
212 }
213 }
214
202 PartRef Graph::Add(Stage* stage) { 215 PartRef Graph::Add(Stage* stage) {
203 stages_.push_back(stage); 216 stages_.push_back(stage);
204 217
205 if (stage->input_count() == 0) { 218 if (stage->input_count() == 0) {
206 sources_.push_back(stage); 219 sources_.push_back(stage);
207 } 220 }
208 221
209 if (stage->output_count() == 0) { 222 if (stage->output_count() == 0) {
210 sinks_.push_back(stage); 223 sinks_.push_back(stage);
211 } 224 }
212 225
213 stage->SetUpdateCallback(update_function_); 226 stage->SetUpdateCallback(update_function_);
214 227
215 return PartRef(stage); 228 return PartRef(stage);
216 } 229 }
217 230
218 } // namespace media 231 } // namespace media
219 } // namespace mojo 232 } // namespace mojo
OLDNEW
« no previous file with comments | « services/media/framework/graph.h ('k') | services/media/framework/parts/decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698