Delete almost all use of MediaConstraintsInterface in the PeerConnection API

Bug: webrtc:9239
Change-Id: I04f4370f624346bf72c7e4e090b57987b558213b
Reviewed-on: https://webrtc-review.googlesource.com/74420
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24396}
This commit is contained in:
Niels Möller
2018-08-07 12:32:18 +02:00
committed by Commit Bot
parent 46399993f2
commit f06f923ef0
29 changed files with 364 additions and 595 deletions

View File

@ -15,7 +15,6 @@
#include "absl/memory/memory.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/test/fakeconstraints.h"
#include "api/videosourceproxy.h"
#include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h"
@ -164,12 +163,11 @@ bool SimplePeerConnection::CreatePeerConnection(const char** turn_urls,
webrtc::PeerConnectionInterface::IceServer stun_server;
stun_server.uri = GetPeerConnectionString();
config_.servers.push_back(stun_server);
webrtc::FakeConstraints constraints;
constraints.SetAllowDtlsSctpDataChannels();
config_.enable_rtp_data_channel = true;
config_.enable_dtls_srtp = false;
peer_connection_ = g_peer_connection_factory->CreatePeerConnection(
config_, &constraints, nullptr, nullptr, this);
config_, nullptr, nullptr, this);
return peer_connection_.get() != nullptr;
}
@ -207,12 +205,12 @@ bool SimplePeerConnection::CreateOffer() {
if (!peer_connection_.get())
return false;
webrtc::FakeConstraints constraints;
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions options;
if (mandatory_receive_) {
constraints.SetMandatoryReceiveAudio(true);
constraints.SetMandatoryReceiveVideo(true);
options.offer_to_receive_audio = true;
options.offer_to_receive_video = true;
}
peer_connection_->CreateOffer(this, &constraints);
peer_connection_->CreateOffer(this, options);
return true;
}
@ -220,12 +218,12 @@ bool SimplePeerConnection::CreateAnswer() {
if (!peer_connection_.get())
return false;
webrtc::FakeConstraints constraints;
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions options;
if (mandatory_receive_) {
constraints.SetMandatoryReceiveAudio(true);
constraints.SetMandatoryReceiveVideo(true);
options.offer_to_receive_audio = true;
options.offer_to_receive_video = true;
}
peer_connection_->CreateAnswer(this, &constraints);
peer_connection_->CreateAnswer(this, options);
return true;
}