Chromium Code Reviews| Index: webrtc/modules/video_coding/main/source/generic_encoder.h |
| diff --git a/webrtc/modules/video_coding/main/source/generic_encoder.h b/webrtc/modules/video_coding/main/source/generic_encoder.h |
| index 25235b6b4677ad2565a9d6583bc2cf565727cd40..9943fbd1d6fe386c841dfeecec052a470f02b295 100644 |
| --- a/webrtc/modules/video_coding/main/source/generic_encoder.h |
| +++ b/webrtc/modules/video_coding/main/source/generic_encoder.h |
| @@ -26,6 +26,13 @@ namespace media_optimization { |
| class MediaOptimization; |
| } // namespace media_optimization |
| +struct EncoderParameters { |
| + uint32_t target_bitrate; |
| + uint8_t loss_rate; |
| + int64_t rtt; |
| + uint32_t input_frame_rate; |
| +}; |
| + |
| /*************************************/ |
| /* VCMEncodeFrameCallback class */ |
| /***********************************/ |
| @@ -102,25 +109,17 @@ public: |
| int32_t Encode(const VideoFrame& inputFrame, |
| const CodecSpecificInfo* codecSpecificInfo, |
| const std::vector<FrameType>& frameTypes); |
| - /** |
| - * Set new target bitrate (bits/s) and framerate. |
| - * Return Value: new bit rate if OK, otherwise <0s. |
| - */ |
| - // TODO(tommi): We could replace BitRate and FrameRate below with a GetRates |
| - // method that matches SetRates. For fetching current rates, we'd then only |
| - // grab the lock once instead of twice. |
| - int32_t SetRates(uint32_t target_bitrate, uint32_t frameRate); |
| - /** |
| - * Set a new packet loss rate and a new round-trip time in milliseconds. |
| - */ |
| - int32_t SetChannelParameters(int32_t packetLoss, int64_t rtt); |
| - int32_t CodecConfigParameters(uint8_t* buffer, int32_t size); |
| + |
| + void SetEncoderParameters(const EncoderParameters& params); |
| /** |
| * Register a transport callback which will be called to deliver the encoded |
| * buffers |
| */ |
| int32_t RegisterEncodeCallback( |
| VCMEncodedFrameCallback* VCMencodedFrameCallback); |
| + // TODO(tommi): We could replace BitRate and FrameRate below with a GetRates |
|
stefan-webrtc
2015/10/29 14:12:06
GetEncoderParameters would make more sense then, w
pbos-webrtc
2015/10/29 14:37:33
Yep, done. Note that there's no caller who does us
stefan-webrtc
2015/10/29 14:50:22
But don't you have two methods for this now? Line
pbos-webrtc
2015/10/29 15:26:01
Brain fart, thanks, done. :)
|
| + // method that matches SetEncoderParameters. For fetching current rates, |
| + // we'd then only grab the lock once instead of twice. |
| /** |
| * Get encoder bit rate |
| */ |
| @@ -130,6 +129,8 @@ public: |
| */ |
| uint32_t FrameRate() const; |
| + EncoderParameters encoder_parameters() const; |
| + |
| int32_t SetPeriodicKeyFrames(bool enable); |
| int32_t RequestFrame(const std::vector<FrameType>& frame_types); |
| @@ -146,10 +147,9 @@ private: |
| VideoEncoder* const encoder_; |
| VideoEncoderRateObserver* const rate_observer_; |
| VCMEncodedFrameCallback* vcm_encoded_frame_callback_; |
| - uint32_t bit_rate_; |
| - uint32_t frame_rate_; |
| + EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
| const bool internal_source_; |
| - mutable rtc::CriticalSection rates_lock_; |
| + mutable rtc::CriticalSection params_lock_; |
| VideoRotation rotation_; |
| bool is_screenshare_; |
| }; // end of VCMGenericEncoder class |