Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc

Issue 2978743002: Fix potential incorrect sync flags used with screenshare TL stream. (Closed)
Patch Set: test case, plus frame config constructor fixes Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
2 * 2 *
3 * Use of this source code is governed by a BSD-style license 3 * Use of this source code is governed by a BSD-style license
4 * that can be found in the LICENSE file in the root of the source 4 * that can be found in the LICENSE file in the root of the source
5 * tree. An additional intellectual property rights grant can be found 5 * tree. An additional intellectual property rights grant can be found
6 * in the file PATENTS. All contributing project authors may 6 * in the file PATENTS. All contributing project authors may
7 * be found in the AUTHORS file in the root of the source tree. 7 * be found in the AUTHORS file in the root of the source tree.
8 */ 8 */
9 9
10 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" 10 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 active_layer_ = 0; 145 active_layer_ = 0;
146 } 146 }
147 } 147 }
148 148
149 switch (active_layer_) { 149 switch (active_layer_) {
150 case 0: 150 case 0:
151 layer_state = TemporalLayerState::kTl0; 151 layer_state = TemporalLayerState::kTl0;
152 last_emitted_tl0_timestamp_ = unwrapped_timestamp; 152 last_emitted_tl0_timestamp_ = unwrapped_timestamp;
153 break; 153 break;
154 case 1: 154 case 1:
155 if (TimeToSync(unwrapped_timestamp)) { 155 if (layers_[1].state != TemporalLayer::State::kDropped) {
156 last_sync_timestamp_ = unwrapped_timestamp; 156 if (TimeToSync(unwrapped_timestamp)) {
157 layer_state = TemporalLayerState::kTl1Sync; 157 last_sync_timestamp_ = unwrapped_timestamp;
158 layer_state = TemporalLayerState::kTl1Sync;
159 } else {
160 layer_state = TemporalLayerState::kTl1;
161 }
158 } else { 162 } else {
159 layer_state = TemporalLayerState::kTl1; 163 layer_state = last_sync_timestamp_ == unwrapped_timestamp
164 ? TemporalLayerState::kTl1Sync
165 : TemporalLayerState::kTl1;
160 } 166 }
161 break; 167 break;
162 case -1: 168 case -1:
163 layer_state = TemporalLayerState::kDrop; 169 layer_state = TemporalLayerState::kDrop;
164 ++stats_.num_dropped_frames_; 170 ++stats_.num_dropped_frames_;
165 break; 171 break;
166 default: 172 default:
167 RTC_NOTREACHED(); 173 RTC_NOTREACHED();
168 } 174 }
169 175
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.Screenshare.Layer1.Qp", 466 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.Screenshare.Layer1.Qp",
461 stats_.tl1_qp_sum_ / stats_.num_tl1_frames_); 467 stats_.tl1_qp_sum_ / stats_.num_tl1_frames_);
462 RTC_HISTOGRAM_COUNTS_10000( 468 RTC_HISTOGRAM_COUNTS_10000(
463 "WebRTC.Video.Screenshare.Layer1.TargetBitrate", 469 "WebRTC.Video.Screenshare.Layer1.TargetBitrate",
464 stats_.tl1_target_bitrate_sum_ / stats_.num_tl1_frames_); 470 stats_.tl1_target_bitrate_sum_ / stats_.num_tl1_frames_);
465 } 471 }
466 } 472 }
467 } 473 }
468 474
469 } // namespace webrtc 475 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698