-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcdmproxy.h
100 lines (71 loc) · 3.33 KB
/
cdmproxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#pragma once
#include <cstdio>
#include "extern/cdmapi.h"
using namespace cdm;
class CDMProxy_8 : ContentDecryptionModule_8 {
private:
ContentDecryptionModule_8 *orig_cdm;
FILE *dumpfile;
FILE *videodump;
DecryptedBlock *temp_block;
public:
explicit CDMProxy_8(ContentDecryptionModule_8 *passed_cdm);
~CDMProxy_8() override = default;
void Initialize(bool allow_distinctive_identifier,
bool allow_persistent_state) override;
void SetServerCertificate(uint32_t promise_id,
const uint8_t* server_certificate_data,
uint32_t server_certificate_data_size) override;
void CreateSessionAndGenerateRequest(uint32_t promise_id,
SessionType session_type,
InitDataType init_data_type,
const uint8_t* init_data,
uint32_t init_data_size) override;
void LoadSession(uint32_t promise_id,
SessionType session_type,
const char* session_id,
uint32_t session_id_size) override;
void UpdateSession(uint32_t promise_id,
const char* session_id,
uint32_t session_id_size,
const uint8_t* response,
uint32_t response_size) override;
void CloseSession(uint32_t promise_id,
const char* session_id,
uint32_t session_id_size) override;
void RemoveSession(uint32_t promise_id,
const char* session_id,
uint32_t session_id_size) override;
void TimerExpired(void* context) override;
Status Decrypt(const InputBuffer& encrypted_buffer,
DecryptedBlock* decrypted_buffer) override;
Status InitializeAudioDecoder(
const AudioDecoderConfig& audio_decoder_config) override;
Status InitializeVideoDecoder(
const VideoDecoderConfig& video_decoder_config) override;
void DeinitializeDecoder(StreamType decoder_type) override;
void ResetDecoder(StreamType decoder_type) override;
Status DecryptAndDecodeFrame(const InputBuffer& encrypted_buffer,
VideoFrame* video_frame) override;
Status DecryptAndDecodeSamples(const InputBuffer& encrypted_buffer,
AudioFrames* audio_frames) override;
void OnPlatformChallengeResponse(
const PlatformChallengeResponse& response) override;
void OnQueryOutputProtectionStatus(
QueryResult result,
uint32_t link_mask,
uint32_t output_protection_mask) override;
void Destroy() override;
};
class DecryptedProxyBlock : public DecryptedBlock {
public:
void SetDecryptedBuffer(Buffer* buffer) override;
Buffer* DecryptedBuffer() override;
void SetTimestamp(int64_t timestamp) override;
int64_t Timestamp() const override;
DecryptedProxyBlock() = default;
~DecryptedProxyBlock() override = default;
private:
int64_t ts = 0;
Buffer *buf = nullptr;
};