2022-08-26 15:44:59 +00:00
|
|
|
// Copyright 2017 Google LLC. All rights reserved.
|
2017-09-12 19:22:39 +00:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
2023-10-10 23:51:11 +00:00
|
|
|
#include <packager/media/base/common_pssh_generator.h>
|
2017-09-12 19:22:39 +00:00
|
|
|
|
2023-10-14 16:36:01 +00:00
|
|
|
#include <packager/macros/classes.h>
|
|
|
|
#include <packager/macros/compiler.h>
|
|
|
|
#include <packager/macros/logging.h>
|
2023-10-10 23:51:11 +00:00
|
|
|
#include <packager/media/base/protection_system_ids.h>
|
2018-09-17 22:23:38 +00:00
|
|
|
|
2017-09-12 19:22:39 +00:00
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
2018-08-07 20:47:53 +00:00
|
|
|
namespace {
|
|
|
|
const uint8_t kCommonSystemPsshBoxVersion = 1;
|
|
|
|
} // namespace
|
2017-09-12 19:22:39 +00:00
|
|
|
|
2018-09-17 22:04:38 +00:00
|
|
|
CommonPsshGenerator::CommonPsshGenerator()
|
2018-08-07 20:47:53 +00:00
|
|
|
: PsshGenerator(std::vector<uint8_t>(std::begin(kCommonSystemId),
|
|
|
|
std::end(kCommonSystemId)),
|
|
|
|
kCommonSystemPsshBoxVersion) {}
|
2017-09-12 19:22:39 +00:00
|
|
|
|
2018-09-17 22:04:38 +00:00
|
|
|
CommonPsshGenerator::~CommonPsshGenerator() = default;
|
2017-09-12 19:22:39 +00:00
|
|
|
|
2018-09-17 22:04:38 +00:00
|
|
|
bool CommonPsshGenerator::SupportMultipleKeys() {
|
2017-09-12 19:22:39 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-11-04 22:46:41 +00:00
|
|
|
std::optional<std::vector<uint8_t>>
|
2018-09-17 22:04:38 +00:00
|
|
|
CommonPsshGenerator::GeneratePsshDataFromKeyIdAndKey(
|
2017-09-12 19:22:39 +00:00
|
|
|
const std::vector<uint8_t>& key_id,
|
|
|
|
const std::vector<uint8_t>& key) const {
|
2022-11-04 22:46:41 +00:00
|
|
|
UNUSED(key_id);
|
|
|
|
UNUSED(key);
|
2017-09-12 19:22:39 +00:00
|
|
|
NOTIMPLEMENTED();
|
2022-11-04 22:46:41 +00:00
|
|
|
return std::nullopt;
|
2017-09-12 19:22:39 +00:00
|
|
|
}
|
|
|
|
|
2022-11-04 22:46:41 +00:00
|
|
|
std::optional<std::vector<uint8_t>>
|
2018-09-17 22:04:38 +00:00
|
|
|
CommonPsshGenerator::GeneratePsshDataFromKeyIds(
|
2017-09-12 19:22:39 +00:00
|
|
|
const std::vector<std::vector<uint8_t>>& key_ids) const {
|
2022-11-04 22:46:41 +00:00
|
|
|
UNUSED(key_ids);
|
2017-09-12 19:22:39 +00:00
|
|
|
// Intentionally empty PSSH data for RawKey.
|
|
|
|
return std::vector<uint8_t>();
|
|
|
|
}
|
2018-08-07 23:01:43 +00:00
|
|
|
|
2017-09-12 19:22:39 +00:00
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|