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:
42  TrackFragment* traf,
43  KeySource* encryption_key_source,
44  KeySource::TrackType track_type,
45  int64_t crypto_period_duration,
46  int64_t clear_time,
47  VideoCodec video_codec,
48  uint8_t nalu_length_size,
49  MuxerListener* muxer_listener);
50  ~KeyRotationFragmenter() override;
51 
52  protected:
55  Status PrepareFragmentForEncryption(bool enable_encryption) override;
56  void FinalizeFragmentForEncryption() override;
58 
59  private:
60  MovieFragment* moof_;
61 
62  KeySource* encryption_key_source_;
63  KeySource::TrackType track_type_;
64  const int64_t crypto_period_duration_;
65  size_t prev_crypto_period_index_;
66 
67  // For notifying new pssh boxes to the event handler.
68  MuxerListener* const muxer_listener_;
69 
70  DISALLOW_COPY_AND_ASSIGN(KeyRotationFragmenter);
71 };
72 
73 } // namespace mp4
74 } // namespace media
75 } // namespace edash_packager
76 
77 #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
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:29
KeyRotationFragmenter(MovieFragment *moof, TrackFragment *traf, KeySource *encryption_key_source, KeySource::TrackType track_type, int64_t crypto_period_duration, int64_t clear_time, VideoCodec video_codec, uint8_t nalu_length_size, MuxerListener *muxer_listener)