Chromium Code Reviews| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 // <0 - Errors: WEBRTC_VIDEO_CODEC_ERROR | 154 // <0 - Errors: WEBRTC_VIDEO_CODEC_ERROR |
| 155 virtual int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) = 0; | 155 virtual int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) = 0; |
| 156 | 156 |
| 157 // Inform the encoder about the new target bit rate. | 157 // Inform the encoder about the new target bit rate. |
| 158 // | 158 // |
| 159 // Input: | 159 // Input: |
| 160 // - bitrate : New target bit rate | 160 // - bitrate : New target bit rate |
| 161 // - framerate : The target frame rate | 161 // - framerate : The target frame rate |
| 162 // | 162 // |
| 163 // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. | 163 // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. |
| 164 virtual int32_t SetRates(uint32_t bitrate, uint32_t framerate) = 0; | 164 virtual int32_t SetRates(uint32_t bitrate, uint32_t framerate) = 0; |
|
perkj_webrtc
2016/10/21 08:24:29
Deprecate SetRates and add a default implementatio
sprang_webrtc
2016/10/25 10:44:25
Done.
| |
| 165 | 165 |
| 166 // Default fallback: Just use the sum of bitrates as the single target rate. | |
| 167 virtual int32_t SetRateAllocation(const BitrateAllocation& allocation, | |
| 168 uint32_t framerate) { | |
| 169 return SetRates(allocation.get_sum_kbps(), framerate); | |
| 170 } | |
| 171 | |
| 166 virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } | 172 virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } |
| 167 virtual void OnDroppedFrame() {} | 173 virtual void OnDroppedFrame() {} |
| 168 virtual bool SupportsNativeHandle() const { return false; } | 174 virtual bool SupportsNativeHandle() const { return false; } |
| 169 virtual const char* ImplementationName() const { return "unknown"; } | 175 virtual const char* ImplementationName() const { return "unknown"; } |
| 170 }; | 176 }; |
| 171 | 177 |
| 172 // Class used to wrap external VideoEncoders to provide a fallback option on | 178 // Class used to wrap external VideoEncoders to provide a fallback option on |
| 173 // software encoding when a hardware encoder fails to encode a stream due to | 179 // software encoding when a hardware encoder fails to encode a stream due to |
| 174 // hardware restrictions, such as max resolution. | 180 // hardware restrictions, such as max resolution. |
| 175 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { | 181 class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 | 221 |
| 216 const EncoderType encoder_type_; | 222 const EncoderType encoder_type_; |
| 217 webrtc::VideoEncoder* const encoder_; | 223 webrtc::VideoEncoder* const encoder_; |
| 218 | 224 |
| 219 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; | 225 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; |
| 220 std::string fallback_implementation_name_; | 226 std::string fallback_implementation_name_; |
| 221 EncodedImageCallback* callback_; | 227 EncodedImageCallback* callback_; |
| 222 }; | 228 }; |
| 223 } // namespace webrtc | 229 } // namespace webrtc |
| 224 #endif // WEBRTC_VIDEO_ENCODER_H_ | 230 #endif // WEBRTC_VIDEO_ENCODER_H_ |
| OLD | NEW |