| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |