Chromium Code Reviews| Index: extensions/renderer/api/display_source/wifi_display/wifi_display_elementary_stream_packetizer.h |
| diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_elementary_stream_packetizer.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_elementary_stream_packetizer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..da647d1f4bc50906461801644d7f6b74e69b9fae |
| --- /dev/null |
| +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_elementary_stream_packetizer.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2016 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_ELEMENTARY_STREAM_PACKETIZER_H_ |
| +#define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_ELEMENTARY_STREAM_PACKETIZER_H_ |
| + |
| +#include "base/time/time.h" |
| +#include "extensions/renderer/api/display_source/wifi_display/wifi_display_stream_packet_part.h" |
| + |
| +namespace extensions { |
| + |
| +// WiFi Display elementary stream packet represents a Packetized Elementary |
| +// Stream (PES) packet containing WiFi Display elementary stream unit data. |
| +class WiFiDisplayElementaryStreamPacket { |
| + public: |
| + using HeaderBuffer = uint8_t[19]; |
| + using Part = WiFiDisplayStreamPacketPart; |
|
asargent_no_longer_on_chrome
2016/03/16 22:47:57
nit: I'm not sure that the "Part" alias really aid
e_hakkinen
2016/03/17 15:29:26
Done.
|
| + |
| + WiFiDisplayElementaryStreamPacket(const HeaderBuffer& header_data, |
| + size_t header_size, |
| + const uint8_t* unit_header_data, |
| + size_t unit_header_size, |
| + const uint8_t* unit_data, |
| + size_t unit_size); |
| + |
| + const Part& header() const { return header_; } |
| + const Part& unit_header() const { return unit_header_; } |
| + const Part& unit() const { return unit_; } |
| + |
| + private: |
| + HeaderBuffer header_buffer_; |
| + Part header_; |
| + Part unit_header_; |
| + Part unit_; |
| +}; |
|
asargent_no_longer_on_chrome
2016/03/16 22:47:58
nit: add DISALLOW_COPY_AND_ASSIGN
(also make sure
e_hakkinen
2016/03/17 15:29:26
Done.
|
| + |
| +// The WiFi Display elementary stream packetizer packetizes unit buffers to |
| +// Packetized Elementary Stream (PES) packets. |
| +// It is used internally by a WiFi Display transport stream packetizer. |
| +class WiFiDisplayElementaryStreamPacketizer { |
| + public: |
| + enum : uint8_t { |
| + kPrivateStream1Id = 0xBDu, |
| + kFirstAudioStreamId = 0xC0u, |
| + kLastAudioStreamId = 0xDFu, |
| + kFirstVideoStreamId = 0xE0u, |
| + kLastVideoStreamId = 0xEFu, |
| + }; |
| + |
| + WiFiDisplayElementaryStreamPacket EncodeElementaryStreamUnit( |
| + uint8_t stream_id, |
| + const uint8_t* unit_header_data, |
| + size_t unit_header_size, |
| + const uint8_t* unit_data, |
| + size_t unit_size, |
| + const base::TimeTicks& pts, |
| + const base::TimeTicks& dts); |
|
asargent_no_longer_on_chrome
2016/03/16 22:47:58
Is there a reason this isn't a static method? Ther
e_hakkinen
2016/03/17 15:29:26
Not really. Done.
|
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_ELEMENTARY_STREAM_PACKETIZER_H_ |