Revert "Enables PeerConnectionFactory using external fec controller"
This reverts commit 4f07bdb25567d8ef528311e0b50a62c61d543fc3.
Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java
Original change's description:
> Enables PeerConnectionFactory using external fec controller
>
> Bug: webrtc:8799
> Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> Reviewed-on: https://webrtc-review.googlesource.com/43961
> Commit-Queue: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22038}
TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8799
Reviewed-on: https://webrtc-review.googlesource.com/54080
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22040}
diff --git a/modules/video_coding/fec_controller_default.cc b/modules/video_coding/fec_controller_default.cc
index 84e8a7b..9d26aac 100644
--- a/modules/video_coding/fec_controller_default.cc
+++ b/modules/video_coding/fec_controller_default.cc
@@ -145,12 +145,11 @@
loss_prot_logic_->SetMethod(method);
}
void FecControllerDefault::UpdateWithEncodedData(
- const size_t encoded_image_length,
- const FrameType encoded_image_frametype) {
- const size_t encoded_length = encoded_image_length;
+ const EncodedImage& encoded_image) {
+ const size_t encoded_length = encoded_image._length;
CritScope lock(&crit_sect_);
if (encoded_length > 0) {
- const bool delta_frame = encoded_image_frametype != kVideoFrameKey;
+ const bool delta_frame = encoded_image._frameType != kVideoFrameKey;
if (max_payload_size_ > 0 && encoded_length > 0) {
const float min_packets_per_frame =
encoded_length / static_cast<float>(max_payload_size_);
diff --git a/modules/video_coding/fec_controller_default.h b/modules/video_coding/fec_controller_default.h
index 776977a..a7f445f 100644
--- a/modules/video_coding/fec_controller_default.h
+++ b/modules/video_coding/fec_controller_default.h
@@ -39,8 +39,7 @@
uint8_t fraction_lost,
std::vector<bool> loss_mask_vector,
int64_t round_trip_time_ms) override;
- void UpdateWithEncodedData(const size_t encoded_image_length,
- const FrameType encoded_image_frametype) override;
+ void UpdateWithEncodedData(const EncodedImage& encoded_image) override;
bool UseLossVectorMask() override { return false; }
private:
diff --git a/modules/video_coding/generic_encoder.cc b/modules/video_coding/generic_encoder.cc
index d1816e0..bb5f75e 100644
--- a/modules/video_coding/generic_encoder.cc
+++ b/modules/video_coding/generic_encoder.cc
@@ -412,8 +412,7 @@
return result;
if (media_opt_) {
- media_opt_->UpdateWithEncodedData(image_copy._length,
- image_copy._frameType);
+ media_opt_->UpdateWithEncodedData(image_copy);
if (internal_source_) {
// Signal to encoder to drop next frame.
result.drop_next_frame = media_opt_->DropFrame();
diff --git a/modules/video_coding/media_optimization.cc b/modules/video_coding/media_optimization.cc
index ea70f3f..51c5bcb 100644
--- a/modules/video_coding/media_optimization.cc
+++ b/modules/video_coding/media_optimization.cc
@@ -90,12 +90,11 @@
}
void MediaOptimization::UpdateWithEncodedData(
- const size_t encoded_image_length,
- const FrameType encoded_image_frametype) {
- size_t encoded_length = encoded_image_length;
+ const EncodedImage& encoded_image) {
+ size_t encoded_length = encoded_image._length;
rtc::CritScope lock(&crit_sect_);
if (encoded_length > 0) {
- const bool delta_frame = encoded_image_frametype != kVideoFrameKey;
+ const bool delta_frame = encoded_image._frameType != kVideoFrameKey;
frame_dropper_->Fill(encoded_length, delta_frame);
}
}
diff --git a/modules/video_coding/media_optimization.h b/modules/video_coding/media_optimization.h
index 411f86c..5fa0254 100644
--- a/modules/video_coding/media_optimization.h
+++ b/modules/video_coding/media_optimization.h
@@ -51,8 +51,7 @@
// Informs Media Optimization of encoded output.
// TODO(perkj): Deprecate SetEncodingData once its not used for stats in
// VideoStreamEncoder.
- void UpdateWithEncodedData(const size_t encoded_image_length,
- const FrameType encoded_image_frametype);
+ void UpdateWithEncodedData(const EncodedImage& encoded_image);
// InputFrameRate 0 = no frame rate estimate available.
uint32_t InputFrameRate();