Shaka Packager SDK
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 
14 namespace shaka {
15 namespace media {
16 namespace {
17 const uint8_t kCommonSystemPsshBoxVersion = 1;
18 } // namespace
19 
20 CommonPsshGenerator::CommonPsshGenerator()
21  : PsshGenerator(std::vector<uint8_t>(std::begin(kCommonSystemId),
22  std::end(kCommonSystemId)),
23  kCommonSystemPsshBoxVersion) {}
24 
25 CommonPsshGenerator::~CommonPsshGenerator() = default;
26 
27 bool CommonPsshGenerator::SupportMultipleKeys() {
28  return true;
29 }
30 
31 std::optional<std::vector<uint8_t>>
32 CommonPsshGenerator::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 
41 std::optional<std::vector<uint8_t>>
42 CommonPsshGenerator::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.
Definition: crypto_flags.cc:66