35 Status
Process(std::unique_ptr<StreamData> stream_data)
override;
39 friend class EncryptionHandlerTest;
45 Status ProcessStreamInfo(
const StreamInfo& stream_info);
47 Status ProcessMediaSample(std::shared_ptr<const MediaSample> clear_sample);
49 void SetupProtectionPattern(StreamType stream_type);
53 bool SampleAesEncryptEac3Frame(
const uint8_t* source,
58 void EncryptBytes(
const uint8_t* source,
66 bool ExtractEac3SyncframeSizes(
const uint8_t* source,
68 std::vector<size_t>* syncframe_sizes);
71 void InjectSubsampleGeneratorForTesting(
72 std::unique_ptr<SubsampleGenerator> generator);
73 void InjectEncryptorFactoryForTesting(
74 std::unique_ptr<AesEncryptorFactory> encryptor_factory);
76 const EncryptionParams encryption_params_;
77 const FourCC protection_scheme_ = FOURCC_NULL;
79 std::string stream_label_;
81 std::shared_ptr<EncryptionConfig> encryption_config_;
82 std::unique_ptr<AesCryptor> encryptor_;
83 Codec codec_ = kUnknownCodec;
85 int64_t remaining_clear_lead_ = 0;
87 int64_t crypto_period_duration_ = 0;
89 int64_t prev_crypto_period_index_ = -1;
90 bool check_new_crypto_period_ =
false;
92 std::unique_ptr<SubsampleGenerator> subsample_generator_;
93 std::unique_ptr<AesEncryptorFactory> encryptor_factory_;
95 uint8_t crypt_byte_block_ = 0;
97 uint8_t skip_byte_block_ = 0;