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

Side by Side Diff: media/formats/mp2t/descriptors.h

Issue 1517473002: Support HLS MPEG2 TS with SAMPLE-AES encryption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@encryption_scheme
Patch Set: tidying up prior to review Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_FORMATS_MP2T_DESCRIPTORS_H_
6 #define MEDIA_FORMATS_MP2T_DESCRIPTORS_H_
7
8 #include <map>
9 #include <string>
10 #include <utility>
11 #include <vector>
12
13 #include "base/basictypes.h"
14
15 namespace media {
16
17 class BitReader;
18
19 namespace mp2t {
20
21 // Representation of a list of descriptors, used in the MPEG-2 Systems standard
ddorwin 2015/12/10 20:10:58 Is there a reason we didn't need this before? Is t
dougsteed 2015/12/14 22:51:46 Part 9 does require a descriptor, and so also does
22 // to extend the definitions of programs or program elements. While the standard
23 // appears to permit multiple descriptors in such a list to have the same tag
24 // value, the implementation herein will not support this.
25 class Descriptors {
26 public:
27 Descriptors();
28 ~Descriptors();
29
30 // Attempts to read a (possibly empty) list of descriptors from the |reader|.
31 // If |size| > 0, the descriptors must occupy exactly |size| bytes, Otherwise,
32 // the descriptors should use all available bits from the reader.
33 bool Read(BitReader* reader, int size);
34
35 // Indicates whether a Registration descriptor is present. If so, the
36 // |format_identifier| and |additional_info| values are populated with the
37 // contents of the descriptor.
38 bool HasRegistrationDescriptor(int64* format_identifier,
39 std::string* additional_info) const;
40
41 // Indicates whether a CA descriptor is present. If so, the |system_id|,
42 // |pid|, and |private_data| values are populated with the contents of the
43 // descriptor.
44 bool HasCADescriptor(int* system_id,
45 int* pid,
46 std::string* private_data) const;
47
48 // Indicates whether a CA descriptor is present, and if so, whether it is
49 // of the type defined by ISO/IEC 23001-9:2014 (i.e. with a specific
50 // system_id value and layout of the private_data). If so, the |ca_pid| and
51 // |pssh_pid| are populated with the contents of the descriptor.
52 bool HasCADescriptorCenc(int* ca_pid, int* pssh_pid) const;
53
54 // Indicates whether a Private Data Indicator descriptor is present with a
55 // particular |value|.
56 bool HasPrivateDataIndicator(int64 value) const;
57
58 private:
59 typedef std::pair<int, std::string> Descriptor;
60 std::map<int, std::string> descriptors_;
61
62 // Allow copy and assign so that it can be used in a std C++ container.
63 };
64
65 } // namespace mp2t
66 } // namespace media
67
68 #endif // MEDIA_FORMATS_MP2T_DESCRIPTOR_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698