Shaka Packager SDK
Loading...
Searching...
No Matches
decryptor_source.h
1// Copyright 2016 Google LLC. 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 PACKAGER_MEDIA_BASE_DECRYPTOR_SOURCE_H_
8#define PACKAGER_MEDIA_BASE_DECRYPTOR_SOURCE_H_
9
10#include <cstddef>
11#include <cstdint>
12#include <map>
13#include <memory>
14#include <vector>
15
16#include <packager/macros/classes.h>
17#include <packager/media/base/aes_cryptor.h>
18#include <packager/media/base/decrypt_config.h>
19#include <packager/media/base/key_source.h>
20
21namespace shaka {
22namespace media {
23
26 public:
29 explicit DecryptorSource(KeySource* key_source);
31
41 bool DecryptSampleBuffer(const DecryptConfig* decrypt_config,
42 const uint8_t* encrypted_buffer,
43 size_t buffer_size,
44 uint8_t* decrypted_buffer);
45
46 private:
47 KeySource* key_source_;
48 std::map<std::vector<uint8_t>, std::unique_ptr<AesCryptor>> decryptor_map_;
49
50 DISALLOW_COPY_AND_ASSIGN(DecryptorSource);
51};
52
53} // namespace media
54} // namespace shaka
55
56#endif // PACKAGER_MEDIA_BASE_DECRYPTOR_SOURCE_H_
DecryptorSource wraps KeySource and is responsible for decryptor management.
bool DecryptSampleBuffer(const DecryptConfig *decrypt_config, const uint8_t *encrypted_buffer, size_t buffer_size, uint8_t *decrypted_buffer)
KeySource is responsible for encryption key acquisition.
Definition key_source.h:56
All the methods that are virtual are virtual for mocking.