| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 weak_this_factory_(this) { | 625 weak_this_factory_(this) { |
| 626 weak_ptr_ = weak_this_factory_.GetWeakPtr(); | 626 weak_ptr_ = weak_this_factory_.GetWeakPtr(); |
| 627 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); | 627 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); |
| 628 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); | 628 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); |
| 629 } | 629 } |
| 630 | 630 |
| 631 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { | 631 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { |
| 632 client_ = NULL; | 632 client_ = NULL; |
| 633 } | 633 } |
| 634 | 634 |
| 635 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, | 635 bool DXVAVideoDecodeAccelerator::Initialize( |
| 636 Client* client) { | 636 const media::VideoDecodeAccelerator::InitParams& params, |
| 637 Client* client) { |
| 637 client_ = client; | 638 client_ = client; |
| 638 | 639 |
| 639 main_thread_task_runner_ = base::MessageLoop::current()->task_runner(); | 640 main_thread_task_runner_ = base::MessageLoop::current()->task_runner(); |
| 640 | 641 |
| 641 bool profile_supported = false; | 642 bool profile_supported = false; |
| 642 for (const auto& supported_profile : kSupportedProfiles) { | 643 for (const auto& supported_profile : kSupportedProfiles) { |
| 643 if (profile == supported_profile) { | 644 if (params.profile == supported_profile) { |
| 644 profile_supported = true; | 645 profile_supported = true; |
| 645 break; | 646 break; |
| 646 } | 647 } |
| 647 } | 648 } |
| 648 if (!profile_supported) { | 649 if (!profile_supported) { |
| 649 RETURN_AND_NOTIFY_ON_FAILURE(false, | 650 RETURN_AND_NOTIFY_ON_FAILURE(false, |
| 650 "Unsupported h.264, vp8, or vp9 profile", PLATFORM_FAILURE, false); | 651 "Unsupported h.264, vp8, or vp9 profile", PLATFORM_FAILURE, false); |
| 651 } | 652 } |
| 652 | 653 |
| 653 // Not all versions of Windows 7 and later include Media Foundation DLLs. | 654 // Not all versions of Windows 7 and later include Media Foundation DLLs. |
| (...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 D3DSURFACE_DESC surface_desc; | 2285 D3DSURFACE_DESC surface_desc; |
| 2285 hr = surface->GetDesc(&surface_desc); | 2286 hr = surface->GetDesc(&surface_desc); |
| 2286 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); | 2287 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); |
| 2287 *width = surface_desc.Width; | 2288 *width = surface_desc.Width; |
| 2288 *height = surface_desc.Height; | 2289 *height = surface_desc.Height; |
| 2289 } | 2290 } |
| 2290 return true; | 2291 return true; |
| 2291 } | 2292 } |
| 2292 | 2293 |
| 2293 } // namespace content | 2294 } // namespace content |
| OLD | NEW |