DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations 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 shaka {
16 namespace media {
17 namespace mp4 {
18 
19 struct MovieFragment;
20 
24  public:
45  std::shared_ptr<StreamInfo> info,
46  TrackFragment* traf,
47  KeySource* encryption_key_source,
48  KeySource::TrackType track_type,
49  int64_t crypto_period_duration,
50  int64_t clear_time,
51  FourCC protection_scheme,
52  uint8_t crypt_byte_block,
53  uint8_t skip_byte_block,
54  MuxerListener* muxer_listener);
55  ~KeyRotationFragmenter() override;
56 
57  protected:
60  Status PrepareFragmentForEncryption(bool enable_encryption) override;
62 
63  private:
64  MovieFragment* moof_;
65 
66  KeySource* encryption_key_source_;
67  KeySource::TrackType track_type_;
68  const int64_t crypto_period_duration_;
69  int64_t prev_crypto_period_index_;
70 
71  // For notifying new pssh boxes to the event handler.
72  MuxerListener* const muxer_listener_;
73 
74  DISALLOW_COPY_AND_ASSIGN(KeyRotationFragmenter);
75 };
76 
77 } // namespace mp4
78 } // namespace media
79 } // namespace shaka
80 
81 #endif // MEDIA_FORMATS_MP4_KEY_ROTATION_FRAGMENTER_H_
KeyRotationFragmenter(MovieFragment *moof, std::shared_ptr< StreamInfo > info, TrackFragment *traf, KeySource *encryption_key_source, KeySource::TrackType track_type, int64_t crypto_period_duration, int64_t clear_time, FourCC protection_scheme, uint8_t crypt_byte_block, uint8_t skip_byte_block, MuxerListener *muxer_listener)
EncryptingFragmenter generates MP4 fragments with sample encrypted.
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:30
Status PrepareFragmentForEncryption(bool enable_encryption) override