2017-09-12 19:22:39 +00:00
|
|
|
// Copyright 2017 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
|
|
|
#include "packager/media/base/widevine_pssh_generator.h"
|
|
|
|
|
|
|
|
#include "packager/media/base/pssh_generator_util.h"
|
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
2018-08-07 20:47:53 +00:00
|
|
|
namespace {
|
|
|
|
// Use version 0 for backward compatibility.
|
|
|
|
const uint8_t kWidevinePsshBoxVersion = 0;
|
|
|
|
} // namespace
|
2017-09-12 19:22:39 +00:00
|
|
|
|
|
|
|
WidevinePsshGenerator::WidevinePsshGenerator()
|
2018-08-07 20:47:53 +00:00
|
|
|
: PsshGenerator(std::vector<uint8_t>(std::begin(kWidevineSystemId),
|
|
|
|
std::end(kWidevineSystemId)),
|
|
|
|
kWidevinePsshBoxVersion) {}
|
2017-09-12 19:22:39 +00:00
|
|
|
|
|
|
|
WidevinePsshGenerator::~WidevinePsshGenerator() {}
|
|
|
|
|
|
|
|
bool WidevinePsshGenerator::SupportMultipleKeys() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
base::Optional<std::vector<uint8_t>>
|
|
|
|
WidevinePsshGenerator::GeneratePsshDataFromKeyIds(
|
|
|
|
const std::vector<std::vector<uint8_t>>& key_ids) const {
|
|
|
|
return GenerateWidevinePsshDataFromKeyIds(key_ids);
|
|
|
|
}
|
|
|
|
|
|
|
|
base::Optional<std::vector<uint8_t>>
|
|
|
|
WidevinePsshGenerator::GeneratePsshDataFromKeyIdAndKey(
|
|
|
|
const std::vector<uint8_t>& key_id,
|
|
|
|
const std::vector<uint8_t>& key) const {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
return base::nullopt;
|
|
|
|
}
|
2018-08-07 20:47:53 +00:00
|
|
|
|
2017-09-12 19:22:39 +00:00
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|