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
|
|
|
|
|
|
|
|
#ifndef MEDIA_BASE_WIDEVINE_PSSH_GENERATOR_H_
|
|
|
|
#define MEDIA_BASE_WIDEVINE_PSSH_GENERATOR_H_
|
|
|
|
|
2018-08-07 21:43:42 +00:00
|
|
|
#include "packager/media/base/fourccs.h"
|
2018-08-07 20:47:53 +00:00
|
|
|
#include "packager/media/base/pssh_generator.h"
|
2017-09-12 19:22:39 +00:00
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
class WidevinePsshGenerator : public PsshGenerator {
|
|
|
|
public:
|
2018-08-07 21:43:42 +00:00
|
|
|
explicit WidevinePsshGenerator(FourCC protection_scheme);
|
2017-09-12 19:22:39 +00:00
|
|
|
~WidevinePsshGenerator() override;
|
|
|
|
|
|
|
|
/// @name PsshGenerator implemetation overrides.
|
|
|
|
/// @{
|
|
|
|
bool SupportMultipleKeys() override;
|
|
|
|
/// @}
|
|
|
|
|
|
|
|
private:
|
|
|
|
WidevinePsshGenerator& operator=(const WidevinePsshGenerator&) = delete;
|
|
|
|
WidevinePsshGenerator(const WidevinePsshGenerator&) = delete;
|
|
|
|
|
|
|
|
// PsshGenerator implemetation overrides.
|
|
|
|
|
2022-11-04 22:46:41 +00:00
|
|
|
std::optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIds(
|
2017-09-12 19:22:39 +00:00
|
|
|
const std::vector<std::vector<uint8_t>>& key_ids) const override;
|
|
|
|
|
2022-11-04 22:46:41 +00:00
|
|
|
std::optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIdAndKey(
|
2017-09-12 19:22:39 +00:00
|
|
|
const std::vector<uint8_t>& key_id,
|
|
|
|
const std::vector<uint8_t>& key) const override;
|
2018-08-07 21:43:42 +00:00
|
|
|
|
|
|
|
FourCC protection_scheme_ = FOURCC_NULL;
|
2017-09-12 19:22:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|
|
|
|
|
|
|
|
#endif // MEDIA_BASE_WIDEVINE_PSSH_GENERATOR_H_
|