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 
server_url() const15 std::string IceCandidateInterface::server_url() const {
16   return "";
17 }
18 
RemoveCandidates(const std::vector<cricket::Candidate> & candidates)19 size_t SessionDescriptionInterface::RemoveCandidates(
20     const std::vector<cricket::Candidate>& candidates) {
21   return 0;
22 }
23 
24 const char SessionDescriptionInterface::kOffer[] = "offer";
25 const char SessionDescriptionInterface::kPrAnswer[] = "pranswer";
26 const char SessionDescriptionInterface::kAnswer[] = "answer";
27 const char SessionDescriptionInterface::kRollback[] = "rollback";
28 
SdpTypeToString(SdpType type)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;
37     case SdpType::kRollback:
38       return SessionDescriptionInterface::kRollback;
39   }
40   return "";
41 }
42 
SdpTypeFromString(const std::string & type_str)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;
50   } else if (type_str == SessionDescriptionInterface::kRollback) {
51     return SdpType::kRollback;
52   } else {
53     return absl::nullopt;
54   }
55 }
56 
57 }  // namespace webrtc
58