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 | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 24 | void CreateSessionDescriptionObserver::OnFailure(RTCError error) { |
| 25 | OnFailure(error.message()); |
| 26 | } |
| 27 | |
| 28 | void CreateSessionDescriptionObserver::OnFailure(const std::string& error) { |
| 29 | OnFailure(RTCError(RTCErrorType::INTERNAL_ERROR, std::string(error))); |
| 30 | } |
| 31 | |
| 32 | void SetSessionDescriptionObserver::OnFailure(RTCError error) { |
| 33 | std::string message(error.message()); |
| 34 | OnFailure(message); |
| 35 | } |
| 36 | |
| 37 | void SetSessionDescriptionObserver::OnFailure(const std::string& error) { |
| 38 | OnFailure(RTCError(RTCErrorType::INTERNAL_ERROR, std::string(error))); |
| 39 | } |
| 40 | |
Mirko Bonadei | 93428bf | 2018-10-11 09:24:21 +0200 | [diff] [blame] | 41 | const char SessionDescriptionInterface::kOffer[] = "offer"; |
| 42 | const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; |
| 43 | const char SessionDescriptionInterface::kAnswer[] = "answer"; |
| 44 | |
| 45 | const char* SdpTypeToString(SdpType type) { |
| 46 | switch (type) { |
| 47 | case SdpType::kOffer: |
| 48 | return SessionDescriptionInterface::kOffer; |
| 49 | case SdpType::kPrAnswer: |
| 50 | return SessionDescriptionInterface::kPrAnswer; |
| 51 | case SdpType::kAnswer: |
| 52 | return SessionDescriptionInterface::kAnswer; |
| 53 | } |
| 54 | return ""; |
| 55 | } |
| 56 | |
| 57 | absl::optional<SdpType> SdpTypeFromString(const std::string& type_str) { |
| 58 | if (type_str == SessionDescriptionInterface::kOffer) { |
| 59 | return SdpType::kOffer; |
| 60 | } else if (type_str == SessionDescriptionInterface::kPrAnswer) { |
| 61 | return SdpType::kPrAnswer; |
| 62 | } else if (type_str == SessionDescriptionInterface::kAnswer) { |
| 63 | return SdpType::kAnswer; |
| 64 | } else { |
| 65 | return absl::nullopt; |
| 66 | } |
| 67 | } |
| 68 | |
Steve Anton | 845bb73 | 2017-12-05 12:50:26 -0800 | [diff] [blame] | 69 | } // namespace webrtc |