-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathopen_cdm_mediaengine.h
73 lines (60 loc) · 2.05 KB
/
open_cdm_mediaengine.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
/*
* Copyright (c) 2017 Fraunhofer FOKUS
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MEDIA_CDM_PPAPI_EXTERNAL_OPEN_CDM_MEDIAENGINE_OPEN_CDM_MEDIAENGINE_H_
#define MEDIA_CDM_PPAPI_EXTERNAL_OPEN_CDM_MEDIAENGINE_OPEN_CDM_MEDIAENGINE_H_
#include "media/cdm/ppapi/external_open_cdm/cdm/open_cdm_platform_common.h"
namespace media {
struct MediaEngineSessionResponse : public PlatformResponse {
uint8_t *pbEncryptedSessionKey;
uint32_t cbEncryptedSessionKey;
};
struct DecryptResponse : public PlatformResponse {
uint8_t *pbResponseData;
uint32_t cbResponseData;
};
/*
* used for encrypting the DRM-decrypted content to ensure a secure
* transmission between CDMi and CDM mediaengine
*/
struct MediaEngineSessionKey {
uint8_t *key;
uint32_t keyLen;
};
struct MediaEngineSessionId {
char *id;
uint32_t idLen;
};
/* Extended EME: // REVIEW(ska): need better explanation for this
* MediaKeys
* 1*|
* |
* N*|
* MediaKeySession 1*----1* MediaEngineSession
*/
/* MediaEngineSession is interface only */
class OpenCdmMediaengine {
public:
OpenCdmMediaengine(char *session_id_val, uint32_t session_id_len,
uint8_t * auth_data_val, uint32_t auth_data_len);
virtual ~OpenCdmMediaengine() {
}
virtual DecryptResponse Decrypt(const uint8_t *pbIv, uint32_t cbIv,
const uint8_t *pbData, uint32_t cbData,
uint8_t *out, uint32_t &out_size) = 0;
protected:
OpenCdmMediaengine(char *session_id_val, uint32_t session_id_len);
OpenCdmMediaengine() {
}
};
} // namespace media
#endif // MEDIA_CDM_PPAPI_EXTERNAL_OPEN_CDM_MEDIAENGINE_OPEN_CDM_MEDIAENGINE_H_