7 #ifndef MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
8 #define MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
11 #include "packager/media/base/fourccs.h"
12 #include "packager/media/codecs/video_slice_header_parser.h"
13 #include "packager/media/codecs/vpx_parser.h"
14 #include "packager/media/event/muxer_listener.h"
15 #include "packager/media/formats/mp4/fragmenter.h"
42 std::unique_ptr<EncryptionKey> encryption_key,
44 FourCC protection_scheme,
45 uint8_t crypt_byte_block,
46 uint8_t skip_byte_block,
70 const EncryptionKey* encryption_key()
const {
return encryption_key_.get(); }
71 AesCryptor* encryptor() {
return encryptor_.get(); }
72 FourCC protection_scheme()
const {
return protection_scheme_; }
73 uint8_t crypt_byte_block()
const {
return crypt_byte_block_; }
74 uint8_t skip_byte_block()
const {
return skip_byte_block_; }
76 void set_encryption_key(std::unique_ptr<EncryptionKey> encryption_key) {
77 encryption_key_ = std::move(encryption_key);
81 void EncryptBytes(uint8_t* data,
size_t size);
82 Status EncryptSample(std::shared_ptr<MediaSample> sample);
85 bool IsSubsampleEncryptionRequired();
87 std::shared_ptr<StreamInfo> info_;
88 std::unique_ptr<EncryptionKey> encryption_key_;
89 std::unique_ptr<AesCryptor> encryptor_;
93 const uint8_t nalu_length_size_;
94 const Codec video_codec_;
96 const FourCC protection_scheme_;
97 const uint8_t crypt_byte_block_;
98 const uint8_t skip_byte_block_;
101 std::unique_ptr<VPxParser> vpx_parser_;
102 std::unique_ptr<VideoSliceHeaderParser> header_parser_;
111 #endif // MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_