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_CDM_CENC_UTILS_H_ | 5 #ifndef MEDIA_CDM_CENC_UTILS_H_ |
6 #define MEDIA_CDM_CENC_UTILS_H_ | 6 #define MEDIA_CDM_CENC_UTILS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // more concatenated 'pssh' boxes. If |input| looks valid, then true is | 21 // more concatenated 'pssh' boxes. If |input| looks valid, then true is |
22 // returned and |key_ids| is updated to contain the values found. Otherwise | 22 // returned and |key_ids| is updated to contain the values found. Otherwise |
23 // return false. | 23 // return false. |
24 // TODO(jrummell): This returns true if no Common SystemID 'pssh' boxes are | 24 // TODO(jrummell): This returns true if no Common SystemID 'pssh' boxes are |
25 // found, or are included but don't contain any key IDs. This should be | 25 // found, or are included but don't contain any key IDs. This should be |
26 // fixed once the test files are updated to include correct 'pssh' boxes. | 26 // fixed once the test files are updated to include correct 'pssh' boxes. |
27 // http://crbug.com/460308 | 27 // http://crbug.com/460308 |
28 MEDIA_EXPORT bool GetKeyIdsForCommonSystemId(const std::vector<uint8_t>& input, | 28 MEDIA_EXPORT bool GetKeyIdsForCommonSystemId(const std::vector<uint8_t>& input, |
29 KeyIdList* key_ids); | 29 KeyIdList* key_ids); |
30 | 30 |
| 31 // Gets the data field from the first 'pssh' box containing |system_id| UUID. |
| 32 // Returns true if such a box is found and successfully parsed. Returns false |
| 33 // otherwise. |
| 34 // Notes: |
| 35 // 1. If multiple PSSH boxes are found, the "Data" of the first matching 'pssh' |
| 36 // box will be set in |pssh_data|. |
| 37 // 2. Only PSSH boxes are allowed in |input|. |
| 38 MEDIA_EXPORT bool GetPsshData(const std::vector<uint8_t>& input, |
| 39 const std::vector<uint8_t>& system_id, |
| 40 std::vector<uint8_t>* pssh_data); |
| 41 |
31 } // namespace media | 42 } // namespace media |
32 | 43 |
33 #endif // MEDIA_CDM_CENC_UTILS_H_ | 44 #endif // MEDIA_CDM_CENC_UTILS_H_ |
OLD | NEW |