OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 | 80 |
81 for (FrameType frame_type : frame_types) | 81 for (FrameType frame_type : frame_types) |
82 RTC_DCHECK(frame_type == kVideoFrameKey || frame_type == kVideoFrameDelta); | 82 RTC_DCHECK(frame_type == kVideoFrameKey || frame_type == kVideoFrameDelta); |
83 | 83 |
84 for (size_t i = 0; i < streams_or_svc_num_; ++i) | 84 for (size_t i = 0; i < streams_or_svc_num_; ++i) |
85 vcm_encoded_frame_callback_->OnEncodeStarted(frame.render_time_ms(), i); | 85 vcm_encoded_frame_callback_->OnEncodeStarted(frame.render_time_ms(), i); |
86 int32_t result = encoder_->Encode(frame, codec_specific, &frame_types); | 86 int32_t result = encoder_->Encode(frame, codec_specific, &frame_types); |
87 | 87 |
88 if (is_screenshare_ && | 88 if (is_screenshare_ && |
89 result == WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT) { | 89 result == WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT) { |
90 // Target bitrate exceeded, encoder state has been reset - try again. | 90 RTC_NOTREACHED(); |
ilnik
2017/09/12 12:52:00
Should we leave this here? What if libvpx return o
sprang_webrtc
2017/09/12 14:17:11
It should not, and we don't want to get stuck in a
ilnik
2017/09/12 14:34:58
Done.
| |
91 return encoder_->Encode(frame, codec_specific, &frame_types); | |
92 } | 91 } |
93 | 92 |
94 return result; | 93 return result; |
95 } | 94 } |
96 | 95 |
97 void VCMGenericEncoder::SetEncoderParameters(const EncoderParameters& params) { | 96 void VCMGenericEncoder::SetEncoderParameters(const EncoderParameters& params) { |
98 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 97 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
99 bool channel_parameters_have_changed; | 98 bool channel_parameters_have_changed; |
100 bool rates_have_changed; | 99 bool rates_have_changed; |
101 { | 100 { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 media_opt_->UpdateWithEncodedData(encoded_image); | 344 media_opt_->UpdateWithEncodedData(encoded_image); |
346 if (internal_source_) { | 345 if (internal_source_) { |
347 // Signal to encoder to drop next frame. | 346 // Signal to encoder to drop next frame. |
348 result.drop_next_frame = media_opt_->DropFrame(); | 347 result.drop_next_frame = media_opt_->DropFrame(); |
349 } | 348 } |
350 } | 349 } |
351 return result; | 350 return result; |
352 } | 351 } |
353 | 352 |
354 } // namespace webrtc | 353 } // namespace webrtc |
OLD | NEW |