Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_H_ | 5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_H_ |
| 6 #define CDM_CONTENT_DECRYPTION_MODULE_H_ | 6 #define CDM_CONTENT_DECRYPTION_MODULE_H_ |
| 7 | 7 |
| 8 #include "content_decryption_module_export.h" | |
|
xhwang
2017/01/12 20:07:05
We had the discussion about include path issue in
| |
| 9 | |
| 8 #if defined(_MSC_VER) | 10 #if defined(_MSC_VER) |
| 9 typedef unsigned char uint8_t; | 11 typedef unsigned char uint8_t; |
| 10 typedef unsigned int uint32_t; | 12 typedef unsigned int uint32_t; |
| 11 typedef int int32_t; | 13 typedef int int32_t; |
| 12 typedef __int64 int64_t; | 14 typedef __int64 int64_t; |
| 13 #else | 15 #else |
| 14 #include <stdint.h> | 16 #include <stdint.h> |
| 15 #endif | 17 #endif |
| 16 | 18 |
| 17 // Define CDM_API so that functionality implemented by the CDM module | 19 // Define CDM_CLASS_API to export class types. We have to add visibility |
| 18 // can be exported to consumers. Note: the implementation lives in | 20 // attributes to make sure virtual tables in CDM consumer and CDM implementation |
| 19 // a dynamic library even in a non-component build. | 21 // are the same. Generally, it was always a good idea, as there're no guarantees |
| 20 // Also define CDM_CLASS_API to export class types. We have to add | 22 // about that for the internal symbols, but it has only become a practical issue |
| 21 // visibility attributes to make sure virtual tables in CDM consumer | 23 // after introduction of LTO devirtualization. See more details on |
| 22 // and CDM implementation are the same. Generally, it was always a | |
| 23 // good idea, as there're no guarantees about that for the internal | |
| 24 // symbols, but it has only become a practical issue after | |
| 25 // introduction of LTO devirtualization. See more details on | |
| 26 // https://crbug.com/609564#c35 | 24 // https://crbug.com/609564#c35 |
| 27 #if defined(WIN32) | 25 #if defined(WIN32) |
| 28 | |
| 29 #if defined(__clang__) | 26 #if defined(__clang__) |
| 30 #define CDM_CLASS_API [[clang::lto_visibility_public]] | 27 #define CDM_CLASS_API [[clang::lto_visibility_public]] |
| 31 #else | 28 #else |
| 32 #define CDM_CLASS_API | 29 #define CDM_CLASS_API |
| 33 #endif | 30 #endif |
| 34 | |
| 35 #if defined(CDM_IMPLEMENTATION) | |
| 36 #define CDM_API __declspec(dllexport) | |
| 37 #else | |
| 38 #define CDM_API __declspec(dllimport) | |
| 39 #endif // defined(CDM_IMPLEMENTATION) | |
| 40 | |
| 41 #else // defined(WIN32) | 31 #else // defined(WIN32) |
| 42 #define CDM_API __attribute__((visibility("default"))) | |
| 43 #define CDM_CLASS_API __attribute__((visibility("default"))) | 32 #define CDM_CLASS_API __attribute__((visibility("default"))) |
| 44 #endif // defined(WIN32) | 33 #endif // defined(WIN32) |
| 45 | 34 |
| 46 // The version number must be rolled when the exported functions are updated! | 35 // The version number must be rolled when the exported functions are updated! |
| 47 // If the CDM and the adapter use different versions of these functions, the | 36 // If the CDM and the adapter use different versions of these functions, the |
| 48 // adapter will fail to load or crash! | 37 // adapter will fail to load or crash! |
| 49 #define CDM_MODULE_VERSION 4 | 38 #define CDM_MODULE_VERSION 4 |
| 50 | 39 |
| 51 // Build the versioned entrypoint name. | 40 // Build the versioned entrypoint name. |
| 52 // The extra macros are necessary to expand version to an actual value. | 41 // The extra macros are necessary to expand version to an actual value. |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 885 virtual AudioFormat Format() const = 0; | 874 virtual AudioFormat Format() const = 0; |
| 886 | 875 |
| 887 protected: | 876 protected: |
| 888 AudioFrames() {} | 877 AudioFrames() {} |
| 889 virtual ~AudioFrames() {} | 878 virtual ~AudioFrames() {} |
| 890 }; | 879 }; |
| 891 | 880 |
| 892 } // namespace cdm | 881 } // namespace cdm |
| 893 | 882 |
| 894 #endif // CDM_CONTENT_DECRYPTION_MODULE_H_ | 883 #endif // CDM_CONTENT_DECRYPTION_MODULE_H_ |
| OLD | NEW |