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 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
6 | 6 |
7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
10 | 10 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 void** object) { | 251 void** object) { |
252 if (!dll || !object) | 252 if (!dll || !object) |
253 return E_INVALIDARG; | 253 return E_INVALIDARG; |
254 | 254 |
255 using GetClassObject = HRESULT (WINAPI*)( | 255 using GetClassObject = HRESULT (WINAPI*)( |
256 const CLSID& clsid, const IID& iid, void** object); | 256 const CLSID& clsid, const IID& iid, void** object); |
257 | 257 |
258 GetClassObject get_class_object = reinterpret_cast<GetClassObject>( | 258 GetClassObject get_class_object = reinterpret_cast<GetClassObject>( |
259 GetProcAddress(dll, "DllGetClassObject")); | 259 GetProcAddress(dll, "DllGetClassObject")); |
260 RETURN_ON_FAILURE( | 260 RETURN_ON_FAILURE( |
261 get_class_object, "Failed to get DllGetClassObject pointer", false); | 261 get_class_object, "Failed to get DllGetClassObject pointer", E_FAIL); |
262 | 262 |
263 base::win::ScopedComPtr<IClassFactory> factory; | 263 base::win::ScopedComPtr<IClassFactory> factory; |
264 HRESULT hr = get_class_object( | 264 HRESULT hr = get_class_object( |
265 clsid, | 265 clsid, |
266 __uuidof(IClassFactory), | 266 __uuidof(IClassFactory), |
267 factory.ReceiveVoid()); | 267 factory.ReceiveVoid()); |
268 RETURN_ON_HR_FAILURE(hr, "DllGetClassObject failed", false); | 268 RETURN_ON_HR_FAILURE(hr, "DllGetClassObject failed", hr); |
269 | 269 |
270 hr = factory->CreateInstance(NULL, iid, object); | 270 hr = factory->CreateInstance(NULL, iid, object); |
271 return hr; | 271 return hr; |
272 } | 272 } |
273 | 273 |
274 // Maintains information about a DXVA picture buffer, i.e. whether it is | 274 // Maintains information about a DXVA picture buffer, i.e. whether it is |
275 // available for rendering, the texture information, etc. | 275 // available for rendering, the texture information, etc. |
276 struct DXVAVideoDecodeAccelerator::DXVAPictureBuffer { | 276 struct DXVAVideoDecodeAccelerator::DXVAPictureBuffer { |
277 public: | 277 public: |
278 static linked_ptr<DXVAPictureBuffer> Create( | 278 static linked_ptr<DXVAPictureBuffer> Create( |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2201 D3DSURFACE_DESC surface_desc; | 2201 D3DSURFACE_DESC surface_desc; |
2202 hr = surface->GetDesc(&surface_desc); | 2202 hr = surface->GetDesc(&surface_desc); |
2203 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); | 2203 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); |
2204 *width = surface_desc.Width; | 2204 *width = surface_desc.Width; |
2205 *height = surface_desc.Height; | 2205 *height = surface_desc.Height; |
2206 } | 2206 } |
2207 return true; | 2207 return true; |
2208 } | 2208 } |
2209 | 2209 |
2210 } // namespace content | 2210 } // namespace content |
OLD | NEW |