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