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