OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
6 #define CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
xhwang
2016/12/16 01:06:55
Adding this new API in a different file since this
| |
7 | |
8 #if defined(WIN32) | |
Haoming Chen
2017/01/04 22:23:39
s/WIN32/OS_WIN?
xhwang
2017/01/12 20:15:02
This interface is intended to be used independent
| |
9 #include <windows.h> | |
10 #endif | |
11 | |
12 #include "media/cdm/content_decryption_module_export.h" | |
13 | |
14 #if defined(_MSC_VER) | |
15 typedef unsigned int uint32_t; | |
16 #else | |
17 #include <stdint.h> | |
18 #endif | |
19 | |
20 #if defined(WIN32) | |
Haoming Chen
2017/01/04 22:23:39
ditto
xhwang
2017/01/12 20:15:02
Acknowledged.
| |
21 typedef wchar_t FilePathCharType; | |
22 typedef HANDLE CdmPlatformFile; | |
23 const CdmPlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE; | |
24 #elif defined(OS_POSIX) | |
jrummell
2016/12/16 20:21:30
Why not just #else? That way it should compile eve
xhwang
2017/01/12 20:15:02
I am not sure whether the file descriptor is an in
| |
25 typedef char FilePathCharType; | |
26 typedef int CdmPlatformFile; | |
27 const CdmPlatformFile kInvalidPlatformFile = -1; | |
28 #endif // defined(WIN32) | |
29 | |
30 namespace cdm { | |
31 | |
32 struct CdmHostFile { | |
33 CdmHostFile(const FilePathCharType* file_path, | |
34 CdmPlatformFile file, | |
35 CdmPlatformFile sig_file) | |
36 : file_path(file_path), file(file), sig_file(sig_file) {} | |
37 | |
38 const FilePathCharType* file_path = nullptr; | |
39 CdmPlatformFile file = kInvalidPlatformFile; | |
40 CdmPlatformFile sig_file = kInvalidPlatformFile; | |
41 }; | |
42 | |
43 } // namespace cdm | |
44 | |
45 extern "C" { | |
46 | |
47 // Verifies CDM host files, which are opened in read-only mode and passed in | |
48 // |cdm_host_files|. The CDM should return as soon as possible and process the | |
49 // files asynchronously. All files should be closed by the CDM after the | |
50 // processing is finished. | |
51 CDM_API void VerifyHostFiles(const cdm::CdmHostFile* cdm_host_files, | |
52 uint32_t num_files); | |
53 } | |
54 | |
55 #endif // CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
OLD | NEW |