Index: webrtc/video/vie_encoder.h |
diff --git a/webrtc/video/vie_encoder.h b/webrtc/video/vie_encoder.h |
index 15fd9cfa58c1ccd1cd373b23ab9b5d463be44bdf..adcfdb115da0074fec5b3fec1856563d84d04744 100644 |
--- a/webrtc/video/vie_encoder.h |
+++ b/webrtc/video/vie_encoder.h |
@@ -36,6 +36,12 @@ namespace webrtc { |
class ProcessThread; |
class SendStatisticsProxy; |
+class ViEEncoderSink : public EncodedImageCallback { |
+ public: |
+ virtual void EncoderConfigurationChanged( |
+ const std::vector<VideoStream>& stream) = 0; |
+}; |
+ |
// VieEncoder represent a video encoder that accepts raw video frames as input |
// and produces an encoded bit stream. |
// Usage: |
@@ -98,12 +104,27 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>, |
private: |
class EncodeTask; |
+ class ConfigureEncoderTask; |
class VideoSourceProxy; |
- void ConfigureEncoderInternal(const VideoCodec& video_codec, |
- size_t max_data_payload_length, |
- std::vector<VideoStream> stream, |
- int min_transmit_bitrate); |
+ struct VideoFrameInfo { |
+ VideoFrameInfo(int width, |
+ int height, |
+ VideoRotation rotation, |
+ bool is_texture) |
+ : width(width), |
+ height(height), |
+ rotation(rotation), |
+ is_texture(is_texture) {} |
+ int width; |
+ int height; |
+ webrtc::VideoRotation rotation; |
+ bool is_texture; |
+ }; |
+ |
+ void ConfigureEncoderOnTaskQueue(VideoEncoderConfig config, |
+ size_t max_data_payload_length); |
+ void ReconfigureEncoder(); |
// Implements VideoSinkInterface. |
void OnFrame(const VideoFrame& video_frame) override; |
@@ -136,8 +157,8 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>, |
const std::unique_ptr<VideoSourceProxy> source_proxy_; |
EncoderSink* sink_; |
const VideoSendStream::Config::EncoderSettings settings_; |
+ const VideoCodecType codec_type_; |
- const std::unique_ptr<VideoProcessing> vp_; |
vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_); |
OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_); |
@@ -151,9 +172,13 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>, |
// of ViEEncoder are called on the same thread. |
rtc::ThreadChecker thread_checker_; |
- VideoCodec encoder_config_ ACCESS_ON(&encoder_queue_); |
+ VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); |
+ |
+ bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); |
sprang_webrtc
2016/09/22 13:06:16
Is encoder_config_ only is in ReconfigureEncoder()
perkj_webrtc
2016/09/26 12:09:42
no- also when the input size change. The the encod
sprang_webrtc
2016/09/26 13:47:37
Acknowledged.
|
+ rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); |
- int encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
+ unsigned int encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
sprang_webrtc
2016/09/22 13:06:16
nit: uint32_t
perkj_webrtc
2016/09/26 12:09:42
Done.
|
+ size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); |
uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); |
bool has_received_sli_ ACCESS_ON(&encoder_queue_); |