| Index: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
|
| diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
|
| index fca16df6fad4bd61b0f17f9b618076c8005308c1..4ff80cccecd800ddda956e7b3d38d4da71483b2e 100644
|
| --- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
|
| +++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
|
| @@ -12,14 +12,19 @@
|
| #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SIMULCAST_ENCODER_ADAPTER_H_
|
| #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SIMULCAST_ENCODER_ADAPTER_H_
|
|
|
| +#include <map>
|
| #include <memory>
|
| #include <string>
|
| +#include <utility>
|
| #include <vector>
|
|
|
| #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
|
| +#include "webrtc/modules/video_coding/utility/simulcast_state.h"
|
|
|
| namespace webrtc {
|
|
|
| +class SimulcastState;
|
| +
|
| class VideoEncoderFactory {
|
| public:
|
| virtual VideoEncoder* Create() = 0;
|
| @@ -63,56 +68,28 @@ class SimulcastEncoderAdapter : public VP8Encoder {
|
|
|
| private:
|
| struct StreamInfo {
|
| - StreamInfo()
|
| - : encoder(NULL),
|
| - callback(NULL),
|
| - width(0),
|
| - height(0),
|
| - key_frame_request(false),
|
| - send_stream(true) {}
|
| + StreamInfo() : encoder(nullptr), callback(nullptr), width(0), height(0) {}
|
| StreamInfo(VideoEncoder* encoder,
|
| EncodedImageCallback* callback,
|
| uint16_t width,
|
| - uint16_t height,
|
| - bool send_stream)
|
| - : encoder(encoder),
|
| - callback(callback),
|
| - width(width),
|
| - height(height),
|
| - key_frame_request(false),
|
| - send_stream(send_stream) {}
|
| + uint16_t height)
|
| + : encoder(encoder), callback(callback), width(width), height(height) {}
|
| // Deleted by SimulcastEncoderAdapter::Release().
|
| VideoEncoder* encoder;
|
| EncodedImageCallback* callback;
|
| uint16_t width;
|
| uint16_t height;
|
| - bool key_frame_request;
|
| - bool send_stream;
|
| };
|
|
|
| - // Get the stream bitrate, for the stream |stream_idx|, given the bitrate
|
| - // |new_bitrate_kbit| and the actual configured stream count in
|
| - // |total_number_of_streams|. The function also returns whether there's enough
|
| - // bandwidth to send this stream via |send_stream|.
|
| - uint32_t GetStreamBitrate(int stream_idx,
|
| - size_t total_number_of_streams,
|
| - uint32_t new_bitrate_kbit,
|
| - bool* send_stream) const;
|
| -
|
| - // Populate the codec settings for each stream.
|
| - void PopulateStreamCodec(const webrtc::VideoCodec* inst,
|
| - int stream_index,
|
| - size_t total_number_of_streams,
|
| - bool highest_resolution_stream,
|
| - webrtc::VideoCodec* stream_codec,
|
| - bool* send_stream);
|
| -
|
| bool Initialized() const;
|
|
|
| std::unique_ptr<VideoEncoderFactory> factory_;
|
| std::unique_ptr<TemporalLayersFactory> screensharing_tl_factory_;
|
| VideoCodec codec_;
|
| - std::vector<StreamInfo> streaminfos_;
|
| + SimulcastState stream_states_;
|
| + typedef std::pair<VideoEncoder*, std::unique_ptr<EncodedImageCallback>>
|
| + EncoderContext;
|
| + std::map<uint8_t, EncoderContext> encoders_;
|
| EncodedImageCallback* encoded_complete_callback_;
|
| std::string implementation_name_;
|
| };
|
|
|