Shaka Packager SDK
Loading...
Searching...
No Matches
cpix_parser.h
1// Copyright 2026 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_MEDIA_BASE_CPIX_PARSER_H_
8#define PACKAGER_MEDIA_BASE_CPIX_PARSER_H_
9
10#include <cstdint>
11#include <limits>
12#include <optional>
13#include <string>
14#include <vector>
15
16#include <packager/status.h>
17
18namespace shaka {
19namespace media {
20
26 std::string algorithm;
28 std::vector<uint8_t> cipher_value;
31 std::vector<uint8_t> value_mac;
32};
33
37 std::vector<uint8_t> key_id;
40 std::vector<uint8_t> key;
44 std::optional<CpixEncryptedValue> encrypted_key;
46 std::vector<uint8_t> iv;
50};
51
56 std::vector<uint8_t> key_id;
58 std::vector<uint8_t> system_id;
61 std::vector<uint8_t> pssh;
62};
63
68 int64_t min_pixels = 0;
70 int64_t max_pixels = std::numeric_limits<int64_t>::max();
71};
72
77 std::vector<uint8_t> key_id;
83 bool has_audio_filter = false;
86 std::vector<CpixVideoFilter> video_filters;
87};
88
102
106 std::vector<CpixContentKey> content_keys;
107 std::vector<CpixDrmSystem> drm_systems;
108 std::vector<CpixUsageRule> usage_rules;
109 std::vector<CpixDeliveryData> delivery_data;
110};
111
118Status ParseCpixDocument(const std::string& xml, CpixDocument* document);
119
120} // namespace media
121} // namespace shaka
122
123#endif // PACKAGER_MEDIA_BASE_CPIX_PARSER_H_
All the methods that are virtual are virtual for mocking.
A content key from a CPIX ContentKeyList.
Definition cpix_parser.h:35
std::string common_encryption_scheme
Definition cpix_parser.h:49
std::optional< CpixEncryptedValue > encrypted_key
Definition cpix_parser.h:44
std::vector< uint8_t > iv
Optional IV, from the explicitIV attribute. Empty if not present.
Definition cpix_parser.h:46
std::vector< uint8_t > key_id
16-byte CENC key ID, from the kid attribute.
Definition cpix_parser.h:37
std::vector< uint8_t > key
Definition cpix_parser.h:40
CpixEncryptedValue document_key
Encrypted document key, from DocumentKey/Data/Secret/EncryptedValue.
Definition cpix_parser.h:94
std::vector< uint8_t > pssh
Definition cpix_parser.h:61
std::vector< uint8_t > system_id
16-byte DRM system ID, from the systemId attribute.
Definition cpix_parser.h:58
std::vector< uint8_t > key_id
16-byte CENC key ID, from the kid attribute.
Definition cpix_parser.h:56
std::vector< uint8_t > value_mac
Definition cpix_parser.h:31
std::vector< uint8_t > cipher_value
Ciphertext, from CipherData/CipherValue.
Definition cpix_parser.h:28
std::vector< uint8_t > key_id
16-byte CENC key ID, from the kid attribute.
Definition cpix_parser.h:77
std::vector< CpixVideoFilter > video_filters
Definition cpix_parser.h:86
int64_t max_pixels
From the optional maxPixels attribute. Unbounded if not present.
Definition cpix_parser.h:70
int64_t min_pixels
From the optional minPixels attribute. 0 if not present.
Definition cpix_parser.h:68