OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 sinks_.push_back(SinkPair(sink, wants)); | 29 sinks_.push_back(SinkPair(sink, wants)); |
30 } else { | 30 } else { |
31 sink_pair->wants = wants; | 31 sink_pair->wants = wants; |
32 } | 32 } |
33 | 33 |
34 // Rotation must be applied by the source if one sink wants it. | 34 // Rotation must be applied by the source if one sink wants it. |
35 current_wants_.rotation_applied = false; | 35 current_wants_.rotation_applied = false; |
36 for (auto& sink_pair : sinks_) { | 36 for (auto& sink_pair : sinks_) { |
37 current_wants_.rotation_applied |= sink_pair.wants.rotation_applied; | 37 current_wants_.rotation_applied |= sink_pair.wants.rotation_applied; |
38 } | 38 } |
| 39 |
| 40 // Only store the last request for scaling up / down... |
| 41 // TODO(perkj): This would be simpler if the resolution request was for a |
| 42 // fixed resolution. |
| 43 current_wants_.resolution = wants.resolution; |
39 } | 44 } |
40 | 45 |
41 void VideoBroadcaster::RemoveSink( | 46 void VideoBroadcaster::RemoveSink( |
42 VideoSinkInterface<cricket::VideoFrame>* sink) { | 47 VideoSinkInterface<cricket::VideoFrame>* sink) { |
43 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 48 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
44 RTC_DCHECK(sink != nullptr); | 49 RTC_DCHECK(sink != nullptr); |
45 RTC_DCHECK(FindSinkPair(sink)); | 50 RTC_DCHECK(FindSinkPair(sink)); |
46 | 51 |
47 sinks_.erase(std::remove_if(sinks_.begin(), sinks_.end(), | 52 sinks_.erase(std::remove_if(sinks_.begin(), sinks_.end(), |
48 [sink](const SinkPair& sink_pair) { | 53 [sink](const SinkPair& sink_pair) { |
(...skipping 24 matching lines...) Expand all Loading... |
73 auto sink_pair_it = std::find_if( | 78 auto sink_pair_it = std::find_if( |
74 sinks_.begin(), sinks_.end(), | 79 sinks_.begin(), sinks_.end(), |
75 [sink](const SinkPair& sink_pair) { return sink_pair.sink == sink; }); | 80 [sink](const SinkPair& sink_pair) { return sink_pair.sink == sink; }); |
76 if (sink_pair_it != sinks_.end()) { | 81 if (sink_pair_it != sinks_.end()) { |
77 return &*sink_pair_it; | 82 return &*sink_pair_it; |
78 } | 83 } |
79 return nullptr; | 84 return nullptr; |
80 } | 85 } |
81 | 86 |
82 } // namespace rtc | 87 } // namespace rtc |
OLD | NEW |