Chromium Code Reviews| 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" |
| 11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
| 12 #include "media/cdm/json_web_key.h" | 12 #include "media/cdm/json_web_key.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace media { |
| 15 | 15 |
| 16 // Validate that |input| is a set of concatenated 'pssh' boxes and the sizes | 16 // Validate that |input| is a set of concatenated 'pssh' boxes and the sizes |
| 17 // match. Returns true if |input| looks valid, false otherwise. | 17 // match. Returns true if |input| looks valid, false otherwise. |
| 18 MEDIA_EXPORT bool ValidatePsshInput(const std::vector<uint8_t>& input); | 18 MEDIA_EXPORT bool ValidatePsshInput(const std::vector<uint8_t>& input); |
| 19 | 19 |
| 20 // Gets the Key Ids from a 'pssh' box for the Common SystemID among one or | 20 // Gets the Key Ids from the first 'pssh' box containing |system_id| among one |
| 21 // more concatenated 'pssh' boxes. If |input| looks valid, then true is | 21 // or more concatenated 'pssh' boxes. Returns true if such a box is found and |
|
ddorwin
2015/06/25 21:18:12
"such" is ambiguous, especially as it relates to v
jrummell
2015/06/25 22:35:59
Done.
| |
| 22 // returned and |key_ids| is updated to contain the values found. Otherwise | 22 // it contains 1 or more key IDs. Returns false otherwise. |
| 23 // return false. | 23 // Notes: |
| 24 MEDIA_EXPORT bool GetKeyIdsForCommonSystemId(const std::vector<uint8_t>& input, | 24 // 1. If multiple PSSH boxes are found, the "KIDs" of the first matching 'pssh' |
| 25 KeyIdList* key_ids); | 25 // box will be set in |key_ids|. |
| 26 // 2. Only PSSH boxes are allowed in |input|. | |
|
ddorwin
2015/06/25 21:18:12
Will boxes after a supported box still cause an er
jrummell
2015/06/25 22:35:58
Updated comment.
| |
| 27 MEDIA_EXPORT bool GetKeyIds(const std::vector<uint8_t>& input, | |
|
ddorwin
2015/06/25 21:18:12
s/input/pssh_boxes/?
ddorwin
2015/06/25 21:18:12
GetKeyIdsFromPsshBoxes
(There is no context at th
jrummell
2015/06/25 22:35:58
Done.
jrummell
2015/06/25 22:35:59
Done.
| |
| 28 const std::vector<uint8_t>& system_id, | |
| 29 KeyIdList* key_ids); | |
| 26 | 30 |
| 27 // Gets the data field from the first 'pssh' box containing |system_id| UUID. | 31 // Gets the data field from the first 'pssh' box containing |system_id|. |
| 28 // Returns true if such a box is found and successfully parsed. Returns false | 32 // Returns true if such a box is found and successfully parsed. Returns false |
| 29 // otherwise. | 33 // otherwise. |
| 30 // Notes: | 34 // Notes: |
| 31 // 1. If multiple PSSH boxes are found, the "Data" of the first matching 'pssh' | 35 // 1. If multiple PSSH boxes are found, the "Data" of the first matching 'pssh' |
| 32 // box will be set in |pssh_data|. | 36 // box will be set in |pssh_data|. |
| 33 // 2. Only PSSH boxes are allowed in |input|. | 37 // 2. Only PSSH boxes are allowed in |input|. |
| 34 MEDIA_EXPORT bool GetPsshData(const std::vector<uint8_t>& input, | 38 MEDIA_EXPORT bool GetPsshData(const std::vector<uint8_t>& input, |
| 35 const std::vector<uint8_t>& system_id, | 39 const std::vector<uint8_t>& system_id, |
| 36 std::vector<uint8_t>* pssh_data); | 40 std::vector<uint8_t>* pssh_data); |
| 37 | 41 |
| 38 } // namespace media | 42 } // namespace media |
| 39 | 43 |
| 40 #endif // MEDIA_CDM_CENC_UTILS_H_ | 44 #endif // MEDIA_CDM_CENC_UTILS_H_ |
| OLD | NEW |