• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *            http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CLEARKEY_INIT_DATA_PARSER_H_
18 #define CLEARKEY_INIT_DATA_PARSER_H_
19 
20 #include <android/hardware/drm/1.0/types.h>
21 
22 #include "ClearKeyTypes.h"
23 
24 namespace android {
25 namespace hardware {
26 namespace drm {
27 namespace V1_1 {
28 namespace clearkey {
29 
30 using ::android::hardware::drm::V1_0::Status;
31 
32 class InitDataParser {
33 public:
InitDataParser()34     InitDataParser() {}
35 
36     Status parse(const std::vector<uint8_t>& initData,
37             const std::string& type,
38             std::vector<uint8_t>* licenseRequest);
39 
40 private:
41     CLEARKEY_DISALLOW_COPY_AND_ASSIGN(InitDataParser);
42 
43     Status parsePssh(const std::vector<uint8_t>& initData,
44             std::vector<const uint8_t*>* keyIds);
45 
46     std::string generateRequest(
47             const std::vector<const uint8_t*>& keyIds);
48 };
49 
50 } // namespace clearkey
51 } // namespace V1_1
52 } // namespace drm
53 } // namespace hardware
54 } // namespace android
55 
56 #endif // CLEARKEY_INIT_DATA_PARSER_H_
57