DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
decryptor_source.h
1 // Copyright 2016 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_BASE_DECRYPTOR_SOURCE_H_
8 #define MEDIA_BASE_DECRYPTOR_SOURCE_H_
9 
10 #include <map>
11 #include <memory>
12 #include <vector>
13 
14 #include "packager/media/base/aes_decryptor.h"
15 #include "packager/media/base/decrypt_config.h"
16 #include "packager/media/base/key_source.h"
17 
18 namespace shaka {
19 namespace media {
20 
23  public:
24  explicit DecryptorSource(KeySource* key_source);
25  ~DecryptorSource();
26 
27  bool DecryptSampleBuffer(const DecryptConfig* decrypt_config,
28  uint8_t* buffer,
29  size_t buffer_size);
30 
31  private:
32  KeySource* key_source_;
33  std::map<std::vector<uint8_t>, std::unique_ptr<AesCryptor>> decryptor_map_;
34 
35  DISALLOW_COPY_AND_ASSIGN(DecryptorSource);
36 };
37 
38 } // namespace media
39 } // namespace shaka
40 
41 #endif // MEDIA_BASE_DECRYPTOR_SOURCE_H_
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:30
DecryptorSource wraps KeySource and is responsible for decryptor management.