OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const float kTl1MaxTimeToDropFrames = 20.0f; | 95 const float kTl1MaxTimeToDropFrames = 20.0f; |
96 | 96 |
97 struct ScreenshareTemporalLayersFactory : webrtc::TemporalLayers::Factory { | 97 struct ScreenshareTemporalLayersFactory : webrtc::TemporalLayers::Factory { |
98 ScreenshareTemporalLayersFactory() | 98 ScreenshareTemporalLayersFactory() |
99 : tl1_frame_dropper_(kTl1MaxTimeToDropFrames) {} | 99 : tl1_frame_dropper_(kTl1MaxTimeToDropFrames) {} |
100 | 100 |
101 virtual ~ScreenshareTemporalLayersFactory() {} | 101 virtual ~ScreenshareTemporalLayersFactory() {} |
102 | 102 |
103 virtual webrtc::TemporalLayers* Create(int num_temporal_layers, | 103 virtual webrtc::TemporalLayers* Create(int num_temporal_layers, |
104 uint8_t initial_tl0_pic_idx) const { | 104 uint8_t initial_tl0_pic_idx) const { |
105 return new webrtc::ScreenshareLayers(num_temporal_layers, | 105 return new webrtc::ScreenshareLayers(num_temporal_layers, rand()); |
106 rand(), | |
107 &tl0_frame_dropper_, | |
108 &tl1_frame_dropper_); | |
109 } | 106 } |
110 | 107 |
111 mutable webrtc::FrameDropper tl0_frame_dropper_; | 108 mutable webrtc::FrameDropper tl0_frame_dropper_; |
112 mutable webrtc::FrameDropper tl1_frame_dropper_; | 109 mutable webrtc::FrameDropper tl1_frame_dropper_; |
113 }; | 110 }; |
114 | 111 |
115 // An EncodedImageCallback implementation that forwards on calls to a | 112 // An EncodedImageCallback implementation that forwards on calls to a |
116 // SimulcastEncoderAdapter, but with the stream index it's registered with as | 113 // SimulcastEncoderAdapter, but with the stream index it's registered with as |
117 // the first parameter to Encoded. | 114 // the first parameter to Encoded. |
118 class AdapterEncodedImageCallback : public webrtc::EncodedImageCallback { | 115 class AdapterEncodedImageCallback : public webrtc::EncodedImageCallback { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 | 498 |
502 bool SimulcastEncoderAdapter::Initialized() const { | 499 bool SimulcastEncoderAdapter::Initialized() const { |
503 return !streaminfos_.empty(); | 500 return !streaminfos_.empty(); |
504 } | 501 } |
505 | 502 |
506 void SimulcastEncoderAdapter::OnDroppedFrame() { | 503 void SimulcastEncoderAdapter::OnDroppedFrame() { |
507 streaminfos_[0].encoder->OnDroppedFrame(); | 504 streaminfos_[0].encoder->OnDroppedFrame(); |
508 } | 505 } |
509 | 506 |
510 } // namespace webrtc | 507 } // namespace webrtc |
OLD | NEW |