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/key_source.h"
11 #include "packager/media/event/muxer_listener.h"
12 #include "packager/media/formats/mp4/encrypting_fragmenter.h"
13 
14 namespace edash_packager {
15 namespace media {
16 namespace mp4 {
17 
18 struct MovieFragment;
19 
23  public:
37  scoped_refptr<StreamInfo> info,
38  TrackFragment* traf,
39  KeySource* encryption_key_source,
40  KeySource::TrackType track_type,
41  int64_t crypto_period_duration,
42  int64_t clear_time,
43  MuxerListener* muxer_listener);
44  ~KeyRotationFragmenter() override;
45 
46  protected:
49  Status PrepareFragmentForEncryption(bool enable_encryption) override;
50  void FinalizeFragmentForEncryption() override;
52 
53  private:
54  MovieFragment* moof_;
55 
56  KeySource* encryption_key_source_;
57  KeySource::TrackType track_type_;
58  const int64_t crypto_period_duration_;
59  size_t prev_crypto_period_index_;
60 
61  // For notifying new pssh boxes to the event handler.
62  MuxerListener* const muxer_listener_;
63 
64  DISALLOW_COPY_AND_ASSIGN(KeyRotationFragmenter);
65 };
66 
67 } // namespace mp4
68 } // namespace media
69 } // namespace edash_packager
70 
71 #endif // MEDIA_FORMATS_MP4_KEY_ROTATION_FRAGMENTER_H_
void FinalizeFragmentForEncryption() override
Finalize current fragment for encryption.
EncryptingFragmenter generates MP4 fragments with sample encrypted.
Status PrepareFragmentForEncryption(bool enable_encryption) override
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)
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:35