Shaka Packager SDK
Loading...
Searching...
No Matches
pssh_generator.h
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#ifndef PACKAGER_MEDIA_BASE_PSSH_GENERATOR_H_
8#define PACKAGER_MEDIA_BASE_PSSH_GENERATOR_H_
9
10#include <cstdint>
11#include <optional>
12#include <vector>
13
14#include <packager/media/base/protection_system_specific_info.h>
15#include <packager/status.h>
16
17// TODO(hmchen): move pssh related files into a sperate folder.
18namespace shaka {
19namespace media {
20
22 public:
25 PsshGenerator(const std::vector<uint8_t>& system_id, uint8_t box_version);
26 virtual ~PsshGenerator();
27
30 virtual bool SupportMultipleKeys() = 0;
31
37 const std::vector<std::vector<uint8_t>>& key_ids,
39
45 Status GeneratePsshFromKeyIdAndKey(const std::vector<uint8_t>& key_id,
46 const std::vector<uint8_t>& key,
48
49 private:
53 virtual std::optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIds(
54 const std::vector<std::vector<uint8_t>>& key_ids) const = 0;
55
60 virtual std::optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIdAndKey(
61 const std::vector<uint8_t>& key_id,
62 const std::vector<uint8_t>& key) const = 0;
63
64 std::vector<uint8_t> system_id_;
65 uint8_t box_version_ = 0;
66};
67
68} // namespace media
69} // namespace shaka
70
71#endif // PACKAGER_MEDIA_BASE_PSSH_GENERATOR_H_
virtual bool SupportMultipleKeys()=0
Status GeneratePsshFromKeyIds(const std::vector< std::vector< uint8_t > > &key_ids, ProtectionSystemSpecificInfo *info) const
Status GeneratePsshFromKeyIdAndKey(const std::vector< uint8_t > &key_id, const std::vector< uint8_t > &key, ProtectionSystemSpecificInfo *info) const
All the methods that are virtual are virtual for mocking.