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

Unified Diff: extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h

Issue 1796123002: Implement WiFi Display elementary stream packetizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Comments Created 4 years, 9 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 | « extensions/renderer/api/display_source/wifi_display/wifi_display_media_packetizer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h
new file mode 100644
index 0000000000000000000000000000000000000000..152b4a7ea230d98d25355c4f96c084bb9597b141
--- /dev/null
+++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_STREAM_PACKET_PART_H_
+#define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_STREAM_PACKET_PART_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
+
+namespace extensions {
+
+// WiFi Display elementary stream unit packetization consists of multiple
+// packetization phases. During those phases, unit buffer bytes are not
+// modified but only wrapped in packets.
+// This class allows different kind of WiFi Display stream packets to refer to
+// unit buffer bytes without copying them.
+class WiFiDisplayStreamPacketPart {
+ public:
+ WiFiDisplayStreamPacketPart(const uint8_t* data, size_t size)
+ : data_(data), size_(size) {}
+ template <size_t N>
+ explicit WiFiDisplayStreamPacketPart(const uint8_t (&data)[N])
+ : WiFiDisplayStreamPacketPart(data, N) {}
+
+ const uint8_t* begin() const { return data(); }
+ const uint8_t* data() const { return data_; }
+ bool empty() const { return size() == 0u; }
+ const uint8_t* end() const { return data() + size(); }
+ size_t size() const { return size_; }
+
+ private:
+ const uint8_t* const data_;
+ const size_t size_;
+
+ DISALLOW_COPY_AND_ASSIGN(WiFiDisplayStreamPacketPart);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_STREAM_PACKET_BASE_H_
« no previous file with comments | « extensions/renderer/api/display_source/wifi_display/wifi_display_media_packetizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698