blob: a0e63a82b017c79ce8427a8ae6c9872efbfd573f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// 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_INFO_H_
#define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_ELEMENTARY_STREAM_INFO_H_
#include <stdint.h>
#include <vector>
#include "extensions/renderer/api/display_source/wifi_display/wifi_display_elementary_stream_descriptor.h"
namespace extensions {
// WiFi Display elementary stream info is a container for elementary stream
// information and is used for passing that information to a WiFi Display
// transport stream packetizer.
class WiFiDisplayElementaryStreamInfo {
public:
using DescriptorVector = std::vector<WiFiDisplayElementaryStreamDescriptor>;
using DescriptorTag = WiFiDisplayElementaryStreamDescriptor::DescriptorTag;
enum ElementaryStreamType : uint8_t {
AUDIO_AAC = 0x0Fu,
AUDIO_AC3 = 0x81u,
AUDIO_LPCM = 0x83u,
VIDEO_H264 = 0x1Bu,
};
explicit WiFiDisplayElementaryStreamInfo(ElementaryStreamType type);
WiFiDisplayElementaryStreamInfo(ElementaryStreamType type,
DescriptorVector descriptors);
WiFiDisplayElementaryStreamInfo(const WiFiDisplayElementaryStreamInfo&);
WiFiDisplayElementaryStreamInfo(WiFiDisplayElementaryStreamInfo&&);
~WiFiDisplayElementaryStreamInfo();
WiFiDisplayElementaryStreamInfo& operator=(WiFiDisplayElementaryStreamInfo&&);
const DescriptorVector& descriptors() const { return descriptors_; }
ElementaryStreamType type() const { return type_; }
void AddDescriptor(WiFiDisplayElementaryStreamDescriptor descriptor);
const WiFiDisplayElementaryStreamDescriptor* FindDescriptor(
DescriptorTag descriptor_tag) const;
template <typename Descriptor>
const Descriptor* FindDescriptor() const {
return static_cast<const Descriptor*>(
FindDescriptor(static_cast<DescriptorTag>(Descriptor::kTag)));
}
private:
DescriptorVector descriptors_;
ElementaryStreamType type_;
};
} // namespace extensions
#endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_ELEMENTARY_STREAM_INFO_H_
|