Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1896)

Unified Diff: webrtc/common_types.h

Issue 2805023002: Add read support of RtpStreamId/RepairedRtpStreamId header extensions. (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/common_types.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.h
diff --git a/webrtc/common_types.h b/webrtc/common_types.h
index e1a4c77d37adf184bb43b0fd87070d635f54d917..1c16199cb1a1c9aa33fbfffca701c50feb35039c 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -19,6 +19,7 @@
#include <vector>
#include "webrtc/api/video/video_rotation.h"
+#include "webrtc/base/array_view.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/optional.h"
#include "webrtc/typedefs.h"
@@ -694,6 +695,33 @@ struct PlayoutDelay {
int max_ms;
};
+class StreamId {
+ public:
+ // Stream id is limited to 16 bytes because it is the maximum length
+ // that can be encoded with one-byte header extensions.
+ static constexpr size_t kMaxSize = 16;
+
+ StreamId() { value_[0] = 0; }
+ explicit StreamId(rtc::ArrayView<const char> value) {
+ Set(value.data(), value.size());
+ }
+ StreamId(const StreamId&) = default;
+ StreamId& operator=(const StreamId&) = default;
+
+ bool empty() const { return value_[0] == 0; }
+ void Set(rtc::ArrayView<const uint8_t> value) {
+ Set(value.data(), value.size());
+ }
+ void Set(const void* data, size_t size);
nisse-webrtc 2017/04/10 12:25:00 I would have expected const char* or const uint8_t
danilchap 2017/04/10 13:27:05 changed to const char* and made the cast explicit.
+
+ friend bool operator==(const StreamId& lhs, const StreamId& rhs) {
+ return strncmp(lhs.value_, rhs.value_, kMaxSize) == 0;
+ }
+
+ private:
+ char value_[kMaxSize];
+};
+
struct RTPHeaderExtension {
RTPHeaderExtension();
@@ -717,6 +745,12 @@ struct RTPHeaderExtension {
VideoRotation videoRotation;
PlayoutDelay playout_delay = {-1, -1};
+
+ // For identification of a stream when ssrc is not signaled. See
+ // https://tools.ietf.org/html/draft-ietf-avtext-rid-09
+ // TODO(danilchap): Update url from draft to release version.
+ StreamId stream_id;
+ StreamId repaired_stream_id;
};
struct RTPHeader {
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/common_types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698