DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
key_rotation_fragmenter.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_FORMATS_MP4_KEY_ROTATION_FRAGMENTER_H_
8 #define MEDIA_FORMATS_MP4_KEY_ROTATION_FRAGMENTER_H_
9 
10 #include "packager/media/base/encryption_modes.h"
11 #include "packager/media/base/key_source.h"
12 #include "packager/media/event/muxer_listener.h"
13 #include "packager/media/formats/mp4/encrypting_fragmenter.h"
14 
15 namespace edash_packager {
16 namespace media {
17 namespace mp4 {
18 
19 struct MovieFragment;
20 
24  public:
38  scoped_refptr<StreamInfo> info,
39  TrackFragment* traf,
40  KeySource* encryption_key_source,
41  KeySource::TrackType track_type,
42  int64_t crypto_period_duration,
43  int64_t clear_time,
44  MuxerListener* muxer_listener,
45  EncryptionMode encryption_mode);
46  ~KeyRotationFragmenter() override;
47 
48  protected:
51  Status PrepareFragmentForEncryption(bool enable_encryption) override;
52  void FinalizeFragmentForEncryption() override;
54 
55  private:
56  MovieFragment* moof_;
57 
58  KeySource* encryption_key_source_;
59  KeySource::TrackType track_type_;
60  const int64_t crypto_period_duration_;
61  size_t prev_crypto_period_index_;
62 
63  // For notifying new pssh boxes to the event handler.
64  MuxerListener* const muxer_listener_;
65 
66  DISALLOW_COPY_AND_ASSIGN(KeyRotationFragmenter);
67 };
68 
69 } // namespace mp4
70 } // namespace media
71 } // namespace edash_packager
72 
73 #endif // MEDIA_FORMATS_MP4_KEY_ROTATION_FRAGMENTER_H_
KeyRotationFragmenter(MovieFragment *moof, scoped_refptr< StreamInfo > info, TrackFragment *traf, KeySource *encryption_key_source, KeySource::TrackType track_type, int64_t crypto_period_duration, int64_t clear_time, MuxerListener *muxer_listener, EncryptionMode encryption_mode)
void FinalizeFragmentForEncryption() override
Finalize current fragment for encryption.
EncryptingFragmenter generates MP4 fragments with sample encrypted.
Status PrepareFragmentForEncryption(bool enable_encryption) override
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:35