Shaka Packager SDK
Loading...
Searching...
No Matches
common_pssh_generator.cc
1// Copyright 2017 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#include <packager/media/base/common_pssh_generator.h>
8
9#include <cstdint>
10#include <iterator>
11#include <optional>
12#include <vector>
13
14#include <packager/macros/compiler.h>
15#include <packager/macros/logging.h>
16#include <packager/media/base/protection_system_ids.h>
17#include <packager/media/base/pssh_generator.h>
18
19namespace shaka {
20namespace media {
21namespace {
22const uint8_t kCommonSystemPsshBoxVersion = 1;
23} // namespace
24
25CommonPsshGenerator::CommonPsshGenerator()
26 : PsshGenerator(std::vector<uint8_t>(std::begin(kCommonSystemId),
27 std::end(kCommonSystemId)),
28 kCommonSystemPsshBoxVersion) {}
29
30CommonPsshGenerator::~CommonPsshGenerator() = default;
31
32bool CommonPsshGenerator::SupportMultipleKeys() {
33 return true;
34}
35
36std::optional<std::vector<uint8_t>>
37CommonPsshGenerator::GeneratePsshDataFromKeyIdAndKey(
38 const std::vector<uint8_t>& key_id,
39 const std::vector<uint8_t>& key) const {
40 UNUSED(key_id);
41 UNUSED(key);
42 NOTIMPLEMENTED();
43 return std::nullopt;
44}
45
46std::optional<std::vector<uint8_t>>
47CommonPsshGenerator::GeneratePsshDataFromKeyIds(
48 const std::vector<std::vector<uint8_t>>& key_ids) const {
49 UNUSED(key_ids);
50 // Intentionally empty PSSH data for RawKey.
51 return std::vector<uint8_t>();
52}
53
54} // namespace media
55} // namespace shaka
All the methods that are virtual are virtual for mocking.