| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FORMATS_MP2T_DESCRIPTORS_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_DESCRIPTORS_H_ |
| 6 #define MEDIA_FORMATS_MP2T_DESCRIPTORS_H_ | 6 #define MEDIA_FORMATS_MP2T_DESCRIPTORS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 class BitReader; | 15 class BitReader; |
| 16 class EncryptionScheme; |
| 16 | 17 |
| 17 namespace mp2t { | 18 namespace mp2t { |
| 18 | 19 |
| 19 // Representation of a list of descriptors, used in the MPEG-2 Systems standard | 20 // Representation of a list of descriptors, used in the MPEG-2 Systems standard |
| 20 // to extend the definitions of programs or program elements. While the standard | 21 // to extend the definitions of programs or program elements. While the standard |
| 21 // appears to permit multiple descriptors in such a list to have the same tag | 22 // appears to permit multiple descriptors in such a list to have the same tag |
| 22 // value, the implementation herein will not support this. | 23 // value, the implementation herein will not support this. |
| 23 class Descriptors { | 24 class Descriptors { |
| 24 public: | 25 public: |
| 25 Descriptors(); | 26 Descriptors(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 | 40 |
| 40 // Indicates whether a CA descriptor is present. If so, the |system_id|, | 41 // Indicates whether a CA descriptor is present. If so, the |system_id|, |
| 41 // |pid|, and |private_data| values are populated with the contents of the | 42 // |pid|, and |private_data| values are populated with the contents of the |
| 42 // descriptor. | 43 // descriptor. |
| 43 bool HasCADescriptor(int* system_id, | 44 bool HasCADescriptor(int* system_id, |
| 44 int* pid, | 45 int* pid, |
| 45 std::string* private_data) const; | 46 std::string* private_data) const; |
| 46 | 47 |
| 47 // Indicates whether a CA descriptor is present, and if so, whether it is | 48 // Indicates whether a CA descriptor is present, and if so, whether it is |
| 48 // of the type defined by ISO/IEC 23001-9:2014 (i.e. with a specific | 49 // of the type defined by ISO/IEC 23001-9:2014 (i.e. with a specific |
| 49 // system_id value and layout of the private_data). If so, the |ca_pid| and | 50 // system_id value and layout of the private_data). If so, the |ca_pid|, |
| 50 // |pssh_pid| are populated with the contents of the descriptor. | 51 // |pssh_pid| and |scheme| are populated with the contents of the descriptor. |
| 51 bool HasCADescriptorCenc(int* ca_pid, int* pssh_pid) const; | 52 bool HasCADescriptorCenc(int* ca_pid, |
| 53 int* pssh_pid, |
| 54 EncryptionScheme* scheme) const; |
| 52 | 55 |
| 53 // Indicates whether a Private Data Indicator descriptor is present with a | 56 // Indicates whether a Private Data Indicator descriptor is present with a |
| 54 // particular |value|. | 57 // particular |value|. |
| 55 bool HasPrivateDataIndicator(int64_t value) const; | 58 bool HasPrivateDataIndicator(int64_t value) const; |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 using Descriptor = std::pair<int, std::string>; | 61 using Descriptor = std::pair<int, std::string>; |
| 59 std::map<int, std::string> descriptors_; | 62 std::map<int, std::string> descriptors_; |
| 60 | 63 |
| 61 // Allow copy and assign so that it can be used in a std C++ container. | 64 // Allow copy and assign so that it can be used in a std C++ container. |
| 62 }; | 65 }; |
| 63 | 66 |
| 64 } // namespace mp2t | 67 } // namespace mp2t |
| 65 } // namespace media | 68 } // namespace media |
| 66 | 69 |
| 67 #endif // MEDIA_FORMATS_MP2T_DESCRIPTOR_LIST_H_ | 70 #endif // MEDIA_FORMATS_MP2T_DESCRIPTOR_LIST_H_ |
| OLD | NEW |