Chromium Code Reviews| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 } | 116 } |
| 117 | 117 |
| 118 int32_t VCMGenericEncoder::SetPeriodicKeyFrames(bool enable) { | 118 int32_t VCMGenericEncoder::SetPeriodicKeyFrames(bool enable) { |
| 119 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 119 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
| 120 return encoder_->SetPeriodicKeyFrames(enable); | 120 return encoder_->SetPeriodicKeyFrames(enable); |
| 121 } | 121 } |
| 122 | 122 |
| 123 int32_t VCMGenericEncoder::RequestFrame( | 123 int32_t VCMGenericEncoder::RequestFrame( |
| 124 const std::vector<FrameType>& frame_types) { | 124 const std::vector<FrameType>& frame_types) { |
| 125 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 125 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
| 126 VideoFrame image; | 126 |
| 127 return encoder_->Encode(image, NULL, &frame_types); | 127 // TODO(nisse): Used only with internal source. Delete as soon as |
| 128 // that feature is removed. The only implementation I've been able | |
| 129 // to find ignores what's in the frame. | |
| 130 return encoder_->Encode(VideoFrame(I420Buffer::Create(1, 1), | |
|
magjed_webrtc
2016/11/30 16:23:56
This looks very strange. What's the purpose here?
nisse-webrtc
2016/11/30 16:36:00
The way I understand it, when the "internal source
magjed_webrtc
2016/12/01 11:46:38
Acknowledged.
| |
| 131 kVideoRotation_0, 0), | |
| 132 NULL, &frame_types); | |
| 133 return 0; | |
|
nisse-webrtc
2016/11/30 16:36:00
But this extra return statement looks very wrong.
| |
| 128 } | 134 } |
| 129 | 135 |
| 130 bool VCMGenericEncoder::InternalSource() const { | 136 bool VCMGenericEncoder::InternalSource() const { |
| 131 return internal_source_; | 137 return internal_source_; |
| 132 } | 138 } |
| 133 | 139 |
| 134 bool VCMGenericEncoder::SupportsNativeHandle() const { | 140 bool VCMGenericEncoder::SupportsNativeHandle() const { |
| 135 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 141 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
| 136 return encoder_->SupportsNativeHandle(); | 142 return encoder_->SupportsNativeHandle(); |
| 137 } | 143 } |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 160 media_opt_->UpdateWithEncodedData(encoded_image); | 166 media_opt_->UpdateWithEncodedData(encoded_image); |
| 161 if (internal_source_) { | 167 if (internal_source_) { |
| 162 // Signal to encoder to drop next frame. | 168 // Signal to encoder to drop next frame. |
| 163 result.drop_next_frame = media_opt_->DropFrame(); | 169 result.drop_next_frame = media_opt_->DropFrame(); |
| 164 } | 170 } |
| 165 } | 171 } |
| 166 return result; | 172 return result; |
| 167 } | 173 } |
| 168 | 174 |
| 169 } // namespace webrtc | 175 } // namespace webrtc |
| OLD | NEW |