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