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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); | 426 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); |
427 } | 427 } |
428 | 428 |
429 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { | 429 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { |
430 client_ = NULL; | 430 client_ = NULL; |
431 } | 431 } |
432 | 432 |
433 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile) { | 433 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile) { |
434 DCHECK(CalledOnValidThread()); | 434 DCHECK(CalledOnValidThread()); |
435 | 435 |
| 436 // Not all versions of Windows 7 and later include Media Foundation DLLs. |
| 437 // Instead of crashing while delay loading the DLL when calling MFStartup() |
| 438 // below, probe whether we can successfully load the DLL now. |
| 439 // |
| 440 // See http://crbug.com/339678 for details. |
| 441 HMODULE mfplat_dll = ::LoadLibrary(L"MFPlat.dll"); |
| 442 RETURN_ON_FAILURE(mfplat_dll, "MFPlat.dll is required for decoding", false); |
| 443 |
436 // TODO(ananta) | 444 // TODO(ananta) |
437 // H264PROFILE_HIGH video decoding is janky at times. Needs more | 445 // H264PROFILE_HIGH video decoding is janky at times. Needs more |
438 // investigation. | 446 // investigation. |
439 if (profile != media::H264PROFILE_BASELINE && | 447 if (profile != media::H264PROFILE_BASELINE && |
440 profile != media::H264PROFILE_MAIN && | 448 profile != media::H264PROFILE_MAIN && |
441 profile != media::H264PROFILE_HIGH) { | 449 profile != media::H264PROFILE_HIGH) { |
442 RETURN_AND_NOTIFY_ON_FAILURE(false, | 450 RETURN_AND_NOTIFY_ON_FAILURE(false, |
443 "Unsupported h264 profile", PLATFORM_FAILURE, false); | 451 "Unsupported h264 profile", PLATFORM_FAILURE, false); |
444 } | 452 } |
445 | 453 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 | 1149 |
1142 for (index = picture_buffers.begin(); | 1150 for (index = picture_buffers.begin(); |
1143 index != picture_buffers.end(); | 1151 index != picture_buffers.end(); |
1144 ++index) { | 1152 ++index) { |
1145 DVLOG(1) << "Dismissing picture id: " << index->second->id(); | 1153 DVLOG(1) << "Dismissing picture id: " << index->second->id(); |
1146 client_->DismissPictureBuffer(index->second->id()); | 1154 client_->DismissPictureBuffer(index->second->id()); |
1147 } | 1155 } |
1148 } | 1156 } |
1149 | 1157 |
1150 } // namespace content | 1158 } // namespace content |
OLD | NEW |