• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2018 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/video_codecs/sdp_video_format.h"
12 
13 #include "rtc_base/strings/string_builder.h"
14 
15 namespace webrtc {
16 
SdpVideoFormat(const std::string & name)17 SdpVideoFormat::SdpVideoFormat(const std::string& name) : name(name) {}
18 
SdpVideoFormat(const std::string & name,const Parameters & parameters)19 SdpVideoFormat::SdpVideoFormat(const std::string& name,
20                                const Parameters& parameters)
21     : name(name), parameters(parameters) {}
22 
23 SdpVideoFormat::SdpVideoFormat(const SdpVideoFormat&) = default;
24 SdpVideoFormat::SdpVideoFormat(SdpVideoFormat&&) = default;
25 SdpVideoFormat& SdpVideoFormat::operator=(const SdpVideoFormat&) = default;
26 SdpVideoFormat& SdpVideoFormat::operator=(SdpVideoFormat&&) = default;
27 
28 SdpVideoFormat::~SdpVideoFormat() = default;
29 
ToString() const30 std::string SdpVideoFormat::ToString() const {
31   rtc::StringBuilder builder;
32   builder << "Codec name: " << name << ", parameters: {";
33   for (const auto& kv : parameters)
34     builder << " " << kv.first << "=" << kv.second;
35   builder << " }";
36 
37   return builder.str();
38 }
39 
operator ==(const SdpVideoFormat & a,const SdpVideoFormat & b)40 bool operator==(const SdpVideoFormat& a, const SdpVideoFormat& b) {
41   return a.name == b.name && a.parameters == b.parameters;
42 }
43 
44 }  // namespace webrtc
45