7 #ifndef MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
8 #define MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_
10 #include "packager/base/memory/ref_counted.h"
11 #include "packager/base/memory/scoped_ptr.h"
12 #include "packager/media/base/fourccs.h"
13 #include "packager/media/filters/vpx_parser.h"
14 #include "packager/media/formats/mp4/fragmenter.h"
15 #include "packager/media/formats/mp4/video_slice_header_parser.h"
17 namespace edash_packager {
41 scoped_ptr<EncryptionKey> encryption_key,
43 FourCC protection_scheme,
44 uint8_t crypt_byte_block,
45 uint8_t skip_byte_block);
68 const EncryptionKey* encryption_key()
const {
return encryption_key_.get(); }
69 AesCryptor* encryptor() {
return encryptor_.get(); }
70 FourCC protection_scheme()
const {
return protection_scheme_; }
71 uint8_t crypt_byte_block()
const {
return crypt_byte_block_; }
72 uint8_t skip_byte_block()
const {
return skip_byte_block_; }
74 void set_encryption_key(scoped_ptr<EncryptionKey> encryption_key) {
75 encryption_key_ = encryption_key.Pass();
79 void EncryptBytes(uint8_t* data, uint32_t size);
80 Status EncryptSample(scoped_refptr<MediaSample> sample);
83 bool IsSubsampleEncryptionRequired();
85 scoped_refptr<StreamInfo> info_;
86 scoped_ptr<EncryptionKey> encryption_key_;
87 scoped_ptr<AesCryptor> encryptor_;
91 const uint8_t nalu_length_size_;
92 const VideoCodec video_codec_;
94 const FourCC protection_scheme_;
95 const uint8_t crypt_byte_block_;
96 const uint8_t skip_byte_block_;
98 scoped_ptr<VPxParser> vpx_parser_;
99 scoped_ptr<VideoSliceHeaderParser> header_parser_;
108 #endif // MEDIA_FORMATS_MP4_ENCRYPTING_FRAGMENTER_H_