summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/exported/web_rtc_offer_options.cc
blob: 6340aef85bf926c2c6c508456b63f6eb44d2f4ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/public/platform/web_rtc_offer_options.h"

#include "third_party/blink/renderer/platform/peerconnection/rtc_offer_options_platform.h"

namespace blink {

WebRTCOfferOptions::WebRTCOfferOptions(RTCOfferOptionsPlatform* options)
    : private_(options) {}

WebRTCOfferOptions::WebRTCOfferOptions(int32_t offer_to_receive_audio,
                                       int32_t offer_to_receive_video,
                                       bool voice_activity_detection,
                                       bool ice_restart)
    : private_(RTCOfferOptionsPlatform::Create(offer_to_receive_audio,
                                               offer_to_receive_video,
                                               voice_activity_detection,
                                               ice_restart)) {}

void WebRTCOfferOptions::Assign(const WebRTCOfferOptions& other) {
  private_ = other.private_;
}

void WebRTCOfferOptions::Reset() {
  private_.Reset();
}

int32_t WebRTCOfferOptions::OfferToReceiveVideo() const {
  DCHECK(!IsNull());
  return private_->OfferToReceiveVideo();
}

int32_t WebRTCOfferOptions::OfferToReceiveAudio() const {
  DCHECK(!IsNull());
  return private_->OfferToReceiveAudio();
}

bool WebRTCOfferOptions::VoiceActivityDetection() const {
  DCHECK(!IsNull());
  return private_->VoiceActivityDetection();
}

bool WebRTCOfferOptions::IceRestart() const {
  DCHECK(!IsNull());
  return private_->IceRestart();
}

}  // namespace blink