| 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/engine.h" | 5 #include "services/media/framework/engine.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 namespace media { | 8 namespace media { |
| 9 | 9 |
| 10 Engine::Engine() {} | 10 Engine::Engine() {} |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 [] (const InputRef& input, | 32 [] (const InputRef& input, |
| 33 const OutputRef& output, | 33 const OutputRef& output, |
| 34 const Stage::UpstreamCallback& callback) { | 34 const Stage::UpstreamCallback& callback) { |
| 35 DCHECK(input.actual().prepared()); | 35 DCHECK(input.actual().prepared()); |
| 36 input.stage_->UnprepareInput(input.index_); | 36 input.stage_->UnprepareInput(input.index_); |
| 37 output.stage_->UnprepareOutput(output.index_, callback); | 37 output.stage_->UnprepareOutput(output.index_, callback); |
| 38 }); | 38 }); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void Engine::FlushOutput(const OutputRef& output) { | 41 void Engine::FlushOutput(const OutputRef& output) { |
| 42 if (!output.connected()) { |
| 43 return; |
| 44 } |
| 42 VisitDownstream( | 45 VisitDownstream( |
| 43 output, | 46 output, |
| 44 [] (const OutputRef& output, | 47 [] (const OutputRef& output, |
| 45 const InputRef& input, | 48 const InputRef& input, |
| 46 const Stage::DownstreamCallback& callback) { | 49 const Stage::DownstreamCallback& callback) { |
| 47 DCHECK(input.actual().prepared()); | 50 DCHECK(input.actual().prepared()); |
| 48 output.stage_->FlushOutput(output.index_); | 51 output.stage_->FlushOutput(output.index_); |
| 49 input.stage_->FlushInput(input.index_, callback); | 52 input.stage_->FlushInput(input.index_, callback); |
| 50 }); | 53 }); |
| 51 } | 54 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 191 |
| 189 Stage* stage = demand_backlog_.top(); | 192 Stage* stage = demand_backlog_.top(); |
| 190 demand_backlog_.pop(); | 193 demand_backlog_.pop(); |
| 191 DCHECK(stage->in_demand_backlog_); | 194 DCHECK(stage->in_demand_backlog_); |
| 192 stage->in_demand_backlog_ = false; | 195 stage->in_demand_backlog_ = false; |
| 193 return stage; | 196 return stage; |
| 194 } | 197 } |
| 195 | 198 |
| 196 } // namespace media | 199 } // namespace media |
| 197 } // namespace mojo | 200 } // namespace mojo |
| OLD | NEW |