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 <cstdint>
11#include <map>
12#include <memory>
13#include <vector>
14
15#include <packager/macros/classes.h>
16#include <packager/media/base/aes_decryptor.h>
17#include <packager/media/base/decrypt_config.h>
18#include <packager/media/base/key_source.h>
19
20namespace shaka {
21namespace media {
22
25 public:
28 explicit DecryptorSource(KeySource* key_source);
30
40 bool DecryptSampleBuffer(const DecryptConfig* decrypt_config,
41 const uint8_t* encrypted_buffer,
42 size_t buffer_size,
43 uint8_t* decrypted_buffer);
44
45 private:
46 KeySource* key_source_;
47 std::map<std::vector<uint8_t>, std::unique_ptr<AesCryptor>> decryptor_map_;
48
49 DISALLOW_COPY_AND_ASSIGN(DecryptorSource);
50};
51
52} // namespace media
53} // namespace shaka
54
55#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:53
All the methods that are virtual are virtual for mocking.