Chromium Code Reviews| Index: webrtc/video_encoder.h |
| diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h |
| index d8b7921bc07fad057cfc438021c41c6219b134a6..3e18481bdee0b9df4ca58147ab629c2d9b547ead 100644 |
| --- a/webrtc/video_encoder.h |
| +++ b/webrtc/video_encoder.h |
| @@ -15,6 +15,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "webrtc/base/checks.h" |
| #include "webrtc/common_types.h" |
| #include "webrtc/typedefs.h" |
| #include "webrtc/video_frame.h" |
| @@ -161,7 +162,17 @@ class VideoEncoder { |
| // - framerate : The target frame rate |
| // |
| // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. |
| - virtual int32_t SetRates(uint32_t bitrate, uint32_t framerate) = 0; |
| + virtual int32_t SetRates(uint32_t bitrate, uint32_t framerate) { |
| + RTC_NOTREACHED() << "SetRate(uint32_t, uint32_t) is deprecated."; |
| + return -1; |
| + } |
| + |
| + // Default fallback: Just use the sum of bitrates as the single target rate. |
| + // TODO(sprang): Remove this default implementation when we remove SetRates(). |
| + virtual int32_t SetRateAllocation(const BitrateAllocation& allocation, |
| + uint32_t framerate) { |
| + return SetRates(allocation.get_sum_kbps(), framerate); |
| + } |
| virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } |
| virtual void OnDroppedFrame() {} |
| @@ -189,8 +200,8 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { |
| const CodecSpecificInfo* codec_specific_info, |
| const std::vector<FrameType>* frame_types) override; |
| int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; |
| - |
| - int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; |
| + int32_t SetRateAllocation(const BitrateAllocation& bitrate_allocation, |
| + uint32_t framerate) override; |
| void OnDroppedFrame() override; |
| bool SupportsNativeHandle() const override; |
| @@ -205,7 +216,7 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder { |
| // The last bitrate/framerate set, and a flag for noting they are set. |
| bool rates_set_; |
| - uint32_t bitrate_; |
| + BitrateAllocation bitrate_; |
|
stefan-webrtc
2016/11/02 10:26:36
Rename bitrate_allocation_;
sprang_webrtc
2016/11/02 13:28:34
Done.
|
| uint32_t framerate_; |
| // The last channel parameters set, and a flag for noting they are set. |