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}
This commit is contained in:
@ -145,11 +145,12 @@ void FecControllerDefault::SetProtectionMethod(bool enable_fec,
|
||||
loss_prot_logic_->SetMethod(method);
|
||||
}
|
||||
void FecControllerDefault::UpdateWithEncodedData(
|
||||
const EncodedImage& encoded_image) {
|
||||
const size_t encoded_length = encoded_image._length;
|
||||
const size_t encoded_image_length,
|
||||
const FrameType encoded_image_frametype) {
|
||||
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_);
|
||||
|
||||
@ -39,7 +39,8 @@ class FecControllerDefault : public FecController {
|
||||
uint8_t fraction_lost,
|
||||
std::vector<bool> loss_mask_vector,
|
||||
int64_t round_trip_time_ms) override;
|
||||
void UpdateWithEncodedData(const EncodedImage& encoded_image) override;
|
||||
void UpdateWithEncodedData(const size_t encoded_image_length,
|
||||
const FrameType encoded_image_frametype) override;
|
||||
bool UseLossVectorMask() override { return false; }
|
||||
|
||||
private:
|
||||
|
||||
@ -412,7 +412,8 @@ EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
|
||||
return result;
|
||||
|
||||
if (media_opt_) {
|
||||
media_opt_->UpdateWithEncodedData(image_copy);
|
||||
media_opt_->UpdateWithEncodedData(image_copy._length,
|
||||
image_copy._frameType);
|
||||
if (internal_source_) {
|
||||
// Signal to encoder to drop next frame.
|
||||
result.drop_next_frame = media_opt_->DropFrame();
|
||||
|
||||
@ -90,11 +90,12 @@ uint32_t MediaOptimization::InputFrameRateInternal() {
|
||||
}
|
||||
|
||||
void MediaOptimization::UpdateWithEncodedData(
|
||||
const EncodedImage& encoded_image) {
|
||||
size_t encoded_length = encoded_image._length;
|
||||
const size_t encoded_image_length,
|
||||
const FrameType encoded_image_frametype) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,8 @@ class MediaOptimization {
|
||||
// Informs Media Optimization of encoded output.
|
||||
// TODO(perkj): Deprecate SetEncodingData once its not used for stats in
|
||||
// VideoStreamEncoder.
|
||||
void UpdateWithEncodedData(const EncodedImage& encoded_image);
|
||||
void UpdateWithEncodedData(const size_t encoded_image_length,
|
||||
const FrameType encoded_image_frametype);
|
||||
|
||||
// InputFrameRate 0 = no frame rate estimate available.
|
||||
uint32_t InputFrameRate();
|
||||
|
||||
Reference in New Issue
Block a user