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

Unified Diff: webrtc/media/engine/fakewebrtccall.cc

Issue 2511703002: Wire up FlexFEC in VideoEngine2. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/internalencoderfactory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/fakewebrtccall.cc
diff --git a/webrtc/media/engine/fakewebrtccall.cc b/webrtc/media/engine/fakewebrtccall.cc
index c07a2ebadd1d079e240072e74bf88e3cedd3b796..a303db5e69e7fb4cd3b1ab8cd78ec588b109f4fa 100644
--- a/webrtc/media/engine/fakewebrtccall.cc
+++ b/webrtc/media/engine/fakewebrtccall.cc
@@ -296,6 +296,28 @@ void FakeVideoReceiveStream::EnableEncodedFrameRecording(rtc::PlatformFile file,
rtc::ClosePlatformFile(file);
}
+FakeFlexfecReceiveStream::FakeFlexfecReceiveStream(
+ const webrtc::FlexfecReceiveStream::Config& config)
+ : config_(config), receiving_(false) {}
+
+const webrtc::FlexfecReceiveStream::Config&
+FakeFlexfecReceiveStream::GetConfig() const {
+ return config_;
+}
+
+void FakeFlexfecReceiveStream::Start() {
+ receiving_ = true;
+}
+
+void FakeFlexfecReceiveStream::Stop() {
+ receiving_ = false;
+}
+
+// TODO(brandtr): Implement when the stats have been designed.
+webrtc::FlexfecReceiveStream::Stats FakeFlexfecReceiveStream::GetStats() const {
+ return webrtc::FlexfecReceiveStream::Stats();
+}
+
FakeCall::FakeCall(const webrtc::Call::Config& config)
: config_(config),
audio_network_state_(webrtc::kNetworkUp),
@@ -348,6 +370,11 @@ const FakeAudioReceiveStream* FakeCall::GetAudioReceiveStream(uint32_t ssrc) {
return nullptr;
}
+const std::list<FakeFlexfecReceiveStream>&
+FakeCall::GetFlexfecReceiveStreams() {
+ return flexfec_receive_streams_;
+}
+
webrtc::NetworkState FakeCall::GetNetworkState(webrtc::MediaType media) const {
switch (media) {
case webrtc::MediaType::AUDIO:
@@ -451,13 +478,22 @@ void FakeCall::DestroyVideoReceiveStream(
webrtc::FlexfecReceiveStream* FakeCall::CreateFlexfecReceiveStream(
webrtc::FlexfecReceiveStream::Config config) {
- // TODO(brandtr): Implement when adding integration with WebRtcVideoEngine2.
- return nullptr;
+ flexfec_receive_streams_.push_back(
+ FakeFlexfecReceiveStream(std::move(config)));
+ ++num_created_receive_streams_;
+ return &flexfec_receive_streams_.back();
}
void FakeCall::DestroyFlexfecReceiveStream(
webrtc::FlexfecReceiveStream* receive_stream) {
- // TODO(brandtr): Implement when adding integration with WebRtcVideoEngine2.
+ for (auto it = flexfec_receive_streams_.begin();
+ it != flexfec_receive_streams_.end(); ++it) {
+ if (&(*it) == receive_stream) {
+ flexfec_receive_streams_.erase(it);
+ return;
+ }
+ }
+ ADD_FAILURE() << "DestroyFlexfecReceiveStream called with unknown parameter.";
}
webrtc::PacketReceiver* FakeCall::Receiver() {
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/internalencoderfactory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698