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