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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "services/media/framework/refs.h" | 6 #include "services/media/framework/refs.h" |
7 #include "services/media/framework/stages/input.h" | 7 #include "services/media/framework/stages/input.h" |
8 #include "services/media/framework/stages/output.h" | 8 #include "services/media/framework/stages/output.h" |
9 #include "services/media/framework/stages/stage.h" | 9 #include "services/media/framework/stages/stage.h" |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 bool InputRef::connected() const { | 48 bool InputRef::connected() const { |
49 DCHECK(valid()); | 49 DCHECK(valid()); |
50 return actual().connected(); | 50 return actual().connected(); |
51 } | 51 } |
52 | 52 |
53 const OutputRef& InputRef::mate() const { | 53 const OutputRef& InputRef::mate() const { |
54 DCHECK(valid()); | 54 DCHECK(valid()); |
55 return actual().mate(); | 55 return actual().mate(); |
56 } | 56 } |
57 | 57 |
58 InputRef::InputRef(Stage* stage, size_t index) : | 58 InputRef::InputRef(Stage* stage, size_t index) : stage_(stage), index_(index) { |
59 stage_(stage), index_(index) { | |
60 DCHECK(valid()); | 59 DCHECK(valid()); |
61 } | 60 } |
62 | 61 |
63 Input& InputRef::actual() const { | 62 Input& InputRef::actual() const { |
64 DCHECK(valid()); | 63 DCHECK(valid()); |
65 return stage_->input(index_); | 64 return stage_->input(index_); |
66 } | 65 } |
67 | 66 |
68 bool InputRef::valid() const { | 67 bool InputRef::valid() const { |
69 return stage_ != nullptr && index_ < stage_->input_count(); | 68 return stage_ != nullptr && index_ < stage_->input_count(); |
70 } | 69 } |
71 | 70 |
72 bool OutputRef::connected() const { | 71 bool OutputRef::connected() const { |
73 DCHECK(valid()); | 72 DCHECK(valid()); |
74 return actual().connected(); | 73 return actual().connected(); |
75 } | 74 } |
76 | 75 |
77 const InputRef& OutputRef::mate() const { | 76 const InputRef& OutputRef::mate() const { |
78 DCHECK(valid()); | 77 DCHECK(valid()); |
79 return actual().mate(); | 78 return actual().mate(); |
80 } | 79 } |
81 | 80 |
82 OutputRef::OutputRef(Stage* stage, size_t index) : | 81 OutputRef::OutputRef(Stage* stage, size_t index) |
83 stage_(stage), index_(index) { | 82 : stage_(stage), index_(index) { |
84 DCHECK(valid()); | 83 DCHECK(valid()); |
85 } | 84 } |
86 | 85 |
87 Output& OutputRef::actual() const { | 86 Output& OutputRef::actual() const { |
88 DCHECK(valid()); | 87 DCHECK(valid()); |
89 return stage_->output(index_); | 88 return stage_->output(index_); |
90 } | 89 } |
91 | 90 |
92 bool OutputRef::valid() const { | 91 bool OutputRef::valid() const { |
93 return stage_ != nullptr && index_ < stage_->output_count(); | 92 return stage_ != nullptr && index_ < stage_->output_count(); |
94 } | 93 } |
95 | 94 |
96 } // namespace media | 95 } // namespace media |
97 } // namespace mojo | 96 } // namespace mojo |
OLD | NEW |