forked from psivasubramanian/open-content-decryption-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen_cdm_platform_common.h
More file actions
98 lines (83 loc) · 2.54 KB
/
Copy pathopen_cdm_platform_common.h
File metadata and controls
98 lines (83 loc) · 2.54 KB
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
/*
* Copyright 2014 Fraunhofer FOKUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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_CDM_OPEN_CDM_PLATFORM_COMMON_H_
#define MEDIA_CDM_PPAPI_EXTERNAL_OPEN_CDM_CDM_OPEN_CDM_PLATFORM_COMMON_H_
#include <string>
#ifdef WPE
#include <stddef.h>
#include <limits.h>
#include <stdint.h>
typedef unsigned char uint8;
typedef unsigned int uint32;
#else // Chrome
#include "base/basictypes.h"
#endif
namespace media {
// TODO(sph): PLATFORM_CALL_STATE should not be CDMi, but EME-specific
enum PLATFORM_CALL_STATE {
PLATFORM_CALL_SUCCESS = 0,
PLATFORM_CALL_FAIL = 1,
PLATFORM_CALL_NOACTION = 2,
PLATFORM_CALL_NEEDKEY = 3
};
struct PlatformResponse {
PLATFORM_CALL_STATE platform_response;
#ifdef WPE
uint32_t sys_err;
#else // Chrome
int32 sys_err;
#endif
};
struct OpenCdmPlatformSessionId {
char *session_id; // TODO(ska): uint16_t oder uint8_t ? CDMi: 16
uint32_t session_id_len;
};
struct MediaKeysResponse : public PlatformResponse {
};
struct MediaKeySetServerCertificateResponse : public PlatformResponse {
};
struct MediaKeyTypeResponse : public PlatformResponse {
};
struct MediaKeysCreateSessionResponse : public PlatformResponse {
OpenCdmPlatformSessionId session_id;
std::string licence_req;
};
struct MediaKeySessionRemoveResponse : public PlatformResponse {
};
struct MediaKeySessionCloseResponse : public PlatformResponse {
};
struct MediaKeysLoadSessionResponse : public PlatformResponse {
};
struct MediaKeySessionUpdateResponse : public PlatformResponse {
};
struct MediaKeySessionReleaseResponse : public PlatformResponse {
};
class DecryptReadyStateKeeper {
public:
virtual ~DecryptReadyStateKeeper();
static DecryptReadyStateKeeper *getInstance();
void lockDecryptSem();
void unlockDecryptSem();
void lockInitSem();
void unlockInitSem();
private:
DecryptReadyStateKeeper();
static DecryptReadyStateKeeper *instance;
int idDecryptReadySem;
int _instance_id;
};
} // namespace media
#endif // MEDIA_CDM_PPAPI_EXTERNAL_OPEN_CDM_CDM_OPEN_CDM_PLATFORM_COMMON_H_