Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 1243543002: Fix incorrect usage of the RETURN_ON_FAILURE and RETURN_ON_HR_FAILURE macros in the CreateCOMObject… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698