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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 weak_ptr_(weak_this_factory_.GetWeakPtr()), | 511 weak_ptr_(weak_this_factory_.GetWeakPtr()), |
512 pending_flush_(false) { | 512 pending_flush_(false) { |
513 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); | 513 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); |
514 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); | 514 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); |
515 } | 515 } |
516 | 516 |
517 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { | 517 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { |
518 client_ = NULL; | 518 client_ = NULL; |
519 } | 519 } |
520 | 520 |
521 // static | |
522 media::VideoDecodeAccelerator::SupportedResolution | |
523 DXVAVideoDecodeAccelerator::GetSupportedResolution() { | |
wuchengli
2014/12/26 09:37:07
Be consistent with the order in the header file. M
henryhsu
2014/12/26 10:25:18
Done.
| |
524 media::VideoDecodeAccelerator::SupportedResolution resolution; | |
525 // Windows Media Foundation H.264 decoding does not support decoding videos | |
526 // with any dimension smaller than 48 pixels: | |
527 // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815 | |
528 resolution.min.SetSize(48, 48); | |
529 // Use 1088 to account for 16x16 macroblocks. | |
530 resolution.max.SetSize(1920, 1088); | |
531 return resolution; | |
532 } | |
533 | |
521 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, | 534 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, |
522 Client* client) { | 535 Client* client) { |
523 client_ = client; | 536 client_ = client; |
524 | 537 |
525 main_thread_task_runner_ = base::MessageLoop::current()->task_runner(); | 538 main_thread_task_runner_ = base::MessageLoop::current()->task_runner(); |
526 | 539 |
527 // Not all versions of Windows 7 and later include Media Foundation DLLs. | 540 // Not all versions of Windows 7 and later include Media Foundation DLLs. |
528 // Instead of crashing while delay loading the DLL when calling MFStartup() | 541 // Instead of crashing while delay loading the DLL when calling MFStartup() |
529 // below, probe whether we can successfully load the DLL now. | 542 // below, probe whether we can successfully load the DLL now. |
530 // | 543 // |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1614 FROM_HERE, | 1627 FROM_HERE, |
1615 base::Bind(&DXVAVideoDecodeAccelerator::CopySurfaceComplete, | 1628 base::Bind(&DXVAVideoDecodeAccelerator::CopySurfaceComplete, |
1616 weak_this_factory_.GetWeakPtr(), | 1629 weak_this_factory_.GetWeakPtr(), |
1617 src_surface, | 1630 src_surface, |
1618 dest_surface, | 1631 dest_surface, |
1619 picture_buffer_id, | 1632 picture_buffer_id, |
1620 input_buffer_id)); | 1633 input_buffer_id)); |
1621 } | 1634 } |
1622 | 1635 |
1623 } // namespace content | 1636 } // namespace content |
OLD | NEW |