OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 // Class to represent RtpStreamId which is a string. | 701 // Class to represent RtpStreamId which is a string. |
702 // Unlike std::string, it can be copied with memcpy and cleared with memset. | 702 // Unlike std::string, it can be copied with memcpy and cleared with memset. |
703 // Empty value represent unset RtpStreamId. | 703 // Empty value represent unset RtpStreamId. |
704 class StreamId { | 704 class StreamId { |
705 public: | 705 public: |
706 // Stream id is limited to 16 bytes because it is the maximum length | 706 // Stream id is limited to 16 bytes because it is the maximum length |
707 // that can be encoded with one-byte header extensions. | 707 // that can be encoded with one-byte header extensions. |
708 static constexpr size_t kMaxSize = 16; | 708 static constexpr size_t kMaxSize = 16; |
709 | 709 |
| 710 static bool IsLegalName(rtc::ArrayView<const char> name); |
| 711 |
710 StreamId() { value_[0] = 0; } | 712 StreamId() { value_[0] = 0; } |
711 explicit StreamId(rtc::ArrayView<const char> value) { | 713 explicit StreamId(rtc::ArrayView<const char> value) { |
712 Set(value.data(), value.size()); | 714 Set(value.data(), value.size()); |
713 } | 715 } |
714 StreamId(const StreamId&) = default; | 716 StreamId(const StreamId&) = default; |
715 StreamId& operator=(const StreamId&) = default; | 717 StreamId& operator=(const StreamId&) = default; |
716 | 718 |
717 bool empty() const { return value_[0] == 0; } | 719 bool empty() const { return value_[0] == 0; } |
718 const char* data() const { return value_; } | 720 const char* data() const { return value_; } |
719 size_t size() const { return strnlen(value_, kMaxSize); } | 721 size_t size() const { return strnlen(value_, kMaxSize); } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 enum class RtcpMode { kOff, kCompound, kReducedSize }; | 888 enum class RtcpMode { kOff, kCompound, kReducedSize }; |
887 | 889 |
888 enum NetworkState { | 890 enum NetworkState { |
889 kNetworkUp, | 891 kNetworkUp, |
890 kNetworkDown, | 892 kNetworkDown, |
891 }; | 893 }; |
892 | 894 |
893 } // namespace webrtc | 895 } // namespace webrtc |
894 | 896 |
895 #endif // WEBRTC_COMMON_TYPES_H_ | 897 #endif // WEBRTC_COMMON_TYPES_H_ |
OLD | NEW |