7 #ifndef PACKAGER_MEDIA_CRYPTO_SUBSAMPLE_GENERATOR_H_
8 #define PACKAGER_MEDIA_CRYPTO_SUBSAMPLE_GENERATOR_H_
13 #include <packager/media/base/fourccs.h>
14 #include <packager/media/base/stream_info.h>
15 #include <packager/status.h>
21 class VideoSliceHeaderParser;
23 struct SubsampleEntry;
48 virtual Status
Initialize(FourCC protection_scheme,
61 std::vector<SubsampleEntry>* subsamples);
64 void InjectVpxParserForTesting(std::unique_ptr<VPxParser> vpx_parser);
65 void InjectVideoSliceHeaderParserForTesting(
66 std::unique_ptr<VideoSliceHeaderParser> header_parser);
67 void InjectAV1ParserForTesting(std::unique_ptr<AV1Parser> av1_parser);
73 Status GenerateSubsamplesFromVPxFrame(
76 std::vector<SubsampleEntry>* subsamples);
77 Status GenerateSubsamplesFromH26xFrame(
80 std::vector<SubsampleEntry>* subsamples);
81 Status GenerateSubsamplesFromAV1Frame(
84 std::vector<SubsampleEntry>* subsamples);
86 const bool vp9_subsample_encryption_ =
false;
88 bool align_protected_data_ =
false;
89 Codec codec_ = kUnknownCodec;
92 uint8_t nalu_length_size_ = 0;
94 size_t leading_clear_bytes_size_ = 0;
98 size_t min_protected_data_size_ = 0;
101 std::unique_ptr<VPxParser> vpx_parser_;
103 std::unique_ptr<VideoSliceHeaderParser> header_parser_;
105 std::unique_ptr<AV1Parser> av1_parser_;
All the methods that are virtual are virtual for mocking.