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}
diff --git a/examples/unityplugin/simple_peer_connection.cc b/examples/unityplugin/simple_peer_connection.cc
index df03e37..36e1937 100644
--- a/examples/unityplugin/simple_peer_connection.cc
+++ b/examples/unityplugin/simple_peer_connection.cc
@@ -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 @@
   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 @@
   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 @@
   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;
 }