Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: webrtc/call/call.cc

Issue 2649973005: Inform jitter buffer about FlexFEC protection. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 48072d0a0b71790bf2802289cef4324abdaaabe1..b5a1268ed6c3284364fcad66378645b7a3a3be88 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -8,7 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <stdint.h>
#include <string.h>
+
#include <algorithm>
#include <map>
#include <memory>
@@ -66,6 +68,7 @@ namespace internal {
class Call : public webrtc::Call,
public PacketReceiver,
public RecoveredPacketReceiver,
+ public FlexfecProtectionMediator,
public CongestionController::Observer,
public BitrateAllocator::LimitObserver {
public:
@@ -110,6 +113,9 @@ class Call : public webrtc::Call,
// Implements RecoveredPacketReceiver.
bool OnRecoveredPacket(const uint8_t* packet, size_t length) override;
+ // Implements FlexfecProtectionMediator.
+ bool IsProtectedByFlexfec(uint32_t ssrc) override;
+
void NotifyBweOfReceivedPacket(const RtpPacketReceived& packet);
void SetBitrateConfig(
@@ -645,7 +651,7 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
VideoReceiveStream* receive_stream = new VideoReceiveStream(
num_cpu_cores_, congestion_controller_.get(), &packet_router_,
std::move(configuration), voice_engine(), module_process_thread_.get(),
- call_stats_.get(), &remb_);
+ call_stats_.get(), &remb_, this /* flexfec_protection_mediator */);
const webrtc::VideoReceiveStream::Config& config = receive_stream->config();
{
@@ -1204,6 +1210,12 @@ bool Call::OnRecoveredPacket(const uint8_t* packet, size_t length) {
return it->second->OnRecoveredPacket(packet, length);
}
+bool Call::IsProtectedByFlexfec(uint32_t ssrc) {
+ ReadLockScoped read_lock(*receive_crit_);
+ return flexfec_receive_ssrcs_media_.find(ssrc) !=
+ flexfec_receive_ssrcs_media_.end();
+}
+
void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet) {
RTPHeader header;
packet.GetHeader(&header);

Powered by Google App Engine
This is Rietveld 408576698