7 #ifndef MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
8 #define MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
10 #include "packager/base/memory/scoped_ptr.h"
11 #include "packager/media/filters/vpx_parser.h"
12 #include "packager/media/formats/mp4/fragmenter.h"
14 namespace edash_packager {
17 class AesCtrEncryptor;
35 scoped_ptr<EncryptionKey> encryption_key,
37 VideoCodec video_codec,
38 uint8_t nalu_length_size);
61 EncryptionKey* encryption_key() {
return encryption_key_.get(); }
64 void set_encryption_key(scoped_ptr<EncryptionKey> encryption_key) {
65 encryption_key_ = encryption_key.Pass();
69 void EncryptBytes(uint8_t* data, uint32_t size);
70 Status EncryptSample(scoped_refptr<MediaSample> sample);
73 bool IsSubsampleEncryptionRequired() {
74 return vpx_parser_ || nalu_length_size_ != 0;
77 scoped_ptr<EncryptionKey> encryption_key_;
78 scoped_ptr<AesCtrEncryptor> encryptor_;
81 VideoCodec video_codec_;
85 const uint8_t nalu_length_size_;
88 scoped_ptr<VPxParser> vpx_parser_;
97 #endif // MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_