-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Fairplay in --additional_protection_systems
Issue: #245. Change-Id: I15187c1d3463534bf5e11ff97032311bb1d0c3bf
- Loading branch information
Showing
20 changed files
with
137 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2018 Google LLC. 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/fairplay_pssh_generator.h" | ||
|
||
namespace shaka { | ||
namespace media { | ||
namespace { | ||
const uint8_t kFairPlayPsshBoxVersion = 1; | ||
} // namespace | ||
|
||
FairPlayPsshGenerator::FairPlayPsshGenerator() | ||
: PsshGenerator(std::vector<uint8_t>(std::begin(kFairPlaySystemId), | ||
std::end(kFairPlaySystemId)), | ||
kFairPlayPsshBoxVersion) {} | ||
|
||
FairPlayPsshGenerator::~FairPlayPsshGenerator() = default; | ||
|
||
bool FairPlayPsshGenerator::SupportMultipleKeys() { | ||
return true; | ||
} | ||
|
||
base::Optional<std::vector<uint8_t>> | ||
FairPlayPsshGenerator::GeneratePsshDataFromKeyIdAndKey( | ||
const std::vector<uint8_t>& key_id, | ||
const std::vector<uint8_t>& key) const { | ||
NOTIMPLEMENTED(); | ||
return base::nullopt; | ||
} | ||
|
||
base::Optional<std::vector<uint8_t>> | ||
FairPlayPsshGenerator::GeneratePsshDataFromKeyIds( | ||
const std::vector<std::vector<uint8_t>>& key_ids) const { | ||
// Intentionally empty PSSH data for FairPlay. | ||
return std::vector<uint8_t>(); | ||
} | ||
|
||
} // namespace media | ||
} // namespace shaka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2018 Google LLC. 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 | ||
|
||
#ifndef PACKAGER_MEDIA_BASE_FAIRPLAY_PSSH_GENERATOR_H_ | ||
#define PACKAGER_MEDIA_BASE_FAIRPLAY_PSSH_GENERATOR_H_ | ||
|
||
#include "packager/media/base/pssh_generator.h" | ||
|
||
namespace shaka { | ||
namespace media { | ||
|
||
// Unofficial FairPlay system id extracted from | ||
// https://forums.developer.apple.com/thread/6185. | ||
const uint8_t kFairPlaySystemId[] = {0x29, 0x70, 0x1F, 0xE4, 0x3C, 0xC7, | ||
0x4A, 0x34, 0x8C, 0x5B, 0xAE, 0x90, | ||
0xC7, 0x43, 0x9A, 0x47}; | ||
|
||
class FairPlayPsshGenerator : public PsshGenerator { | ||
public: | ||
FairPlayPsshGenerator(); | ||
~FairPlayPsshGenerator() override; | ||
|
||
/// @name PsshGenerator implemetation overrides. | ||
/// @{ | ||
bool SupportMultipleKeys() override; | ||
/// @} | ||
|
||
private: | ||
FairPlayPsshGenerator& operator=(const FairPlayPsshGenerator&) = delete; | ||
FairPlayPsshGenerator(const FairPlayPsshGenerator&) = delete; | ||
|
||
// PsshGenerator implemetation overrides. | ||
|
||
base::Optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIds( | ||
const std::vector<std::vector<uint8_t>>& key_ids) const override; | ||
|
||
base::Optional<std::vector<uint8_t>> GeneratePsshDataFromKeyIdAndKey( | ||
const std::vector<uint8_t>& key_id, | ||
const std::vector<uint8_t>& key) const override; | ||
}; | ||
|
||
} // namespace media | ||
} // namespace shaka | ||
|
||
#endif // PACKAGER_MEDIA_BASE_FAIRPLAY_PSSH_GENERATOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters