| 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 CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <d3d11.h> | 8 #include <d3d11.h> |
| 9 #include <d3d9.h> | 9 #include <d3d9.h> |
| 10 #include <initguid.h> |
| 10 #include <stdint.h> | 11 #include <stdint.h> |
| 11 // Work around bug in this header by disabling the relevant warning for it. | 12 // Work around bug in this header by disabling the relevant warning for it. |
| 12 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h
-in-win8-sdk-triggers-c4201-with-w4 | 13 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h
-in-win8-sdk-triggers-c4201-with-w4 |
| 13 #pragma warning(push) | 14 #pragma warning(push) |
| 14 #pragma warning(disable:4201) | 15 #pragma warning(disable:4201) |
| 15 #include <dxva2api.h> | 16 #include <dxva2api.h> |
| 16 #pragma warning(pop) | 17 #pragma warning(pop) |
| 17 #include <mfidl.h> | 18 #include <mfidl.h> |
| 18 | 19 |
| 19 #include <list> | 20 #include <list> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 static media::VideoDecodeAccelerator::SupportedProfiles | 121 static media::VideoDecodeAccelerator::SupportedProfiles |
| 121 GetSupportedProfiles(); | 122 GetSupportedProfiles(); |
| 122 | 123 |
| 123 // Preload dlls required for decoding. | 124 // Preload dlls required for decoding. |
| 124 static void PreSandboxInitialization(); | 125 static void PreSandboxInitialization(); |
| 125 | 126 |
| 126 private: | 127 private: |
| 127 typedef void* EGLConfig; | 128 typedef void* EGLConfig; |
| 128 typedef void* EGLSurface; | 129 typedef void* EGLSurface; |
| 129 | 130 |
| 131 // Returns the minimum resolution for the |profile| passed in. |
| 132 static std::pair<int, int> GetMinResolution( |
| 133 const media::VideoCodecProfile profile); |
| 134 |
| 135 // Returns the maximum resolution for the |profile| passed in. |
| 136 static std::pair<int, int> GetMaxResolution( |
| 137 const media::VideoCodecProfile profile); |
| 138 |
| 139 // Returns the maximum resolution for H264 video. |
| 140 static std::pair<int, int> GetMaxH264Resolution(); |
| 141 |
| 130 // Creates and initializes an instance of the D3D device and the | 142 // Creates and initializes an instance of the D3D device and the |
| 131 // corresponding device manager. The device manager instance is eventually | 143 // corresponding device manager. The device manager instance is eventually |
| 132 // passed to the IMFTransform interface implemented by the decoder. | 144 // passed to the IMFTransform interface implemented by the decoder. |
| 133 bool CreateD3DDevManager(); | 145 bool CreateD3DDevManager(); |
| 134 | 146 |
| 135 // Creates and initializes an instance of the DX11 device and the | 147 // Creates and initializes an instance of the DX11 device and the |
| 136 // corresponding device manager. The device manager instance is eventually | 148 // corresponding device manager. The device manager instance is eventually |
| 137 // passed to the IMFTransform interface implemented by the decoder. | 149 // passed to the IMFTransform interface implemented by the decoder. |
| 138 bool CreateDX11DevManager(); | 150 bool CreateDX11DevManager(); |
| 139 | 151 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 471 |
| 460 // Function pointer for the MFCreateDXGIDeviceManager API. | 472 // Function pointer for the MFCreateDXGIDeviceManager API. |
| 461 static CreateDXGIDeviceManager create_dxgi_device_manager_; | 473 static CreateDXGIDeviceManager create_dxgi_device_manager_; |
| 462 | 474 |
| 463 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); | 475 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); |
| 464 }; | 476 }; |
| 465 | 477 |
| 466 } // namespace content | 478 } // namespace content |
| 467 | 479 |
| 468 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 480 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |