7 #ifndef MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
8 #define MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
11 #include "packager/base/memory/ref_counted.h"
12 #include "packager/media/base/fourccs.h"
13 #include "packager/media/codecs/video_slice_header_parser.h"
14 #include "packager/media/codecs/vpx_parser.h"
15 #include "packager/media/event/muxer_listener.h"
16 #include "packager/media/formats/mp4/fragmenter.h"
43 std::unique_ptr<EncryptionKey> encryption_key,
45 FourCC protection_scheme,
46 uint8_t crypt_byte_block,
47 uint8_t skip_byte_block,
71 const EncryptionKey* encryption_key()
const {
return encryption_key_.get(); }
72 AesCryptor* encryptor() {
return encryptor_.get(); }
73 FourCC protection_scheme()
const {
return protection_scheme_; }
74 uint8_t crypt_byte_block()
const {
return crypt_byte_block_; }
75 uint8_t skip_byte_block()
const {
return skip_byte_block_; }
77 void set_encryption_key(std::unique_ptr<EncryptionKey> encryption_key) {
78 encryption_key_ = std::move(encryption_key);
82 void EncryptBytes(uint8_t* data,
size_t size);
83 Status EncryptSample(scoped_refptr<MediaSample> sample);
86 bool IsSubsampleEncryptionRequired();
88 scoped_refptr<StreamInfo> info_;
89 std::unique_ptr<EncryptionKey> encryption_key_;
90 std::unique_ptr<AesCryptor> encryptor_;
94 const uint8_t nalu_length_size_;
95 const Codec video_codec_;
97 const FourCC protection_scheme_;
98 const uint8_t crypt_byte_block_;
99 const uint8_t skip_byte_block_;
102 std::unique_ptr<VPxParser> vpx_parser_;
103 std::unique_ptr<VideoSliceHeaderParser> header_parser_;
112 #endif // MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_