Use single FrameBufferController in VP8, created by a factory.
This CL paves the way to making FrameBufferController injectable. LibvpxVp8Encoder can manage multiple streams. Prior to this CL, each stream had its own frame buffer controller, all of them held in a vector by LibvpxVp8Encoder. This complicated the code and produced some code duplication (cf. SetupTemporalLayers). This CL: 1. Replaces CreateVp8TemporalLayers() by a factory. (Later CLs will make this factory injectable.) 2. Makes LibvpxVp8Encoder use a single controller. This single controller will, in the case of multiple streams, delegate its work to multiple controllers, but that fact is not visible to LibvpxVp8Encoder. This CL also squashes CL #126046 (Send notifications of RTT and PLR changes to Vp8FrameBufferController) into it. Bug: webrtc:10382 Change-Id: Id9b55734bebb457acc276f34a7a9e52cc19c8eb9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126483 Commit-Queue: Elad Alon <eladalon@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27206}
This commit is contained in:
@ -53,13 +53,15 @@ class LibvpxVp8Encoder : public VideoEncoder {
|
||||
int SetRateAllocation(const VideoBitrateAllocation& bitrate,
|
||||
uint32_t new_framerate) override;
|
||||
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
|
||||
EncoderInfo GetEncoderInfo() const override;
|
||||
|
||||
static vpx_enc_frame_flags_t EncodeFlags(const Vp8FrameConfig& references);
|
||||
|
||||
private:
|
||||
void SetupTemporalLayers(const VideoCodec& codec);
|
||||
|
||||
// Get the cpu_speed setting for encoder based on resolution and/or platform.
|
||||
int GetCpuSpeed(int width, int height);
|
||||
|
||||
@ -100,8 +102,7 @@ class LibvpxVp8Encoder : public VideoEncoder {
|
||||
int cpu_speed_default_;
|
||||
int number_of_cores_;
|
||||
uint32_t rc_max_intra_target_;
|
||||
std::vector<std::unique_ptr<Vp8FrameBufferController>>
|
||||
frame_buffer_controllers_;
|
||||
std::unique_ptr<Vp8FrameBufferController> frame_buffer_controller_;
|
||||
std::vector<bool> key_frame_request_;
|
||||
std::vector<bool> send_stream_;
|
||||
std::vector<int> cpu_speed_;
|
||||
|
||||
Reference in New Issue
Block a user