Steve Anton | 845bb73 | 2017-12-05 12:50:26 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "api/jsep.h" |
| 12 | |
| 13 | namespace webrtc { |
| 14 | |
| 15 | std::string IceCandidateInterface::server_url() const { |
| 16 | return ""; |
| 17 | } |
| 18 | |
| 19 | size_t SessionDescriptionInterface::RemoveCandidates( |
| 20 | const std::vector<cricket::Candidate>& candidates) { |
| 21 | return 0; |
| 22 | } |
| 23 | |
Mirko Bonadei | 93428bf | 2018-10-11 09:24:21 +0200 | [diff] [blame] | 24 | const char SessionDescriptionInterface::kOffer[] = "offer"; |
| 25 | const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; |
| 26 | const char SessionDescriptionInterface::kAnswer[] = "answer"; |
Eldar Rello | 5ab79e6 | 2019-10-09 18:29:44 +0300 | [diff] [blame] | 27 | const char SessionDescriptionInterface::kRollback[] = "rollback"; |
Mirko Bonadei | 93428bf | 2018-10-11 09:24:21 +0200 | [diff] [blame] | 28 | |
| 29 | const char* SdpTypeToString(SdpType type) { |
| 30 | switch (type) { |
| 31 | case SdpType::kOffer: |
| 32 | return SessionDescriptionInterface::kOffer; |
| 33 | case SdpType::kPrAnswer: |
| 34 | return SessionDescriptionInterface::kPrAnswer; |
| 35 | case SdpType::kAnswer: |
| 36 | return SessionDescriptionInterface::kAnswer; |
Eldar Rello | 5ab79e6 | 2019-10-09 18:29:44 +0300 | [diff] [blame] | 37 | case SdpType::kRollback: |
| 38 | return SessionDescriptionInterface::kRollback; |
Mirko Bonadei | 93428bf | 2018-10-11 09:24:21 +0200 | [diff] [blame] | 39 | } |
| 40 | return ""; |
| 41 | } |
| 42 | |
| 43 | absl::optional<SdpType> SdpTypeFromString(const std::string& type_str) { |
| 44 | if (type_str == SessionDescriptionInterface::kOffer) { |
| 45 | return SdpType::kOffer; |
| 46 | } else if (type_str == SessionDescriptionInterface::kPrAnswer) { |
| 47 | return SdpType::kPrAnswer; |
| 48 | } else if (type_str == SessionDescriptionInterface::kAnswer) { |
| 49 | return SdpType::kAnswer; |
Eldar Rello | 5ab79e6 | 2019-10-09 18:29:44 +0300 | [diff] [blame] | 50 | } else if (type_str == SessionDescriptionInterface::kRollback) { |
| 51 | return SdpType::kRollback; |
Mirko Bonadei | 93428bf | 2018-10-11 09:24:21 +0200 | [diff] [blame] | 52 | } else { |
| 53 | return absl::nullopt; |
| 54 | } |
| 55 | } |
| 56 | |
Steve Anton | 845bb73 | 2017-12-05 12:50:26 -0800 | [diff] [blame] | 57 | } // namespace webrtc |