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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 615 |
616 state_ = DXVAVideoDecodeAccelerator::kNormal; | 616 state_ = DXVAVideoDecodeAccelerator::kNormal; |
617 } | 617 } |
618 | 618 |
619 void DXVAVideoDecodeAccelerator::Destroy() { | 619 void DXVAVideoDecodeAccelerator::Destroy() { |
620 DCHECK(CalledOnValidThread()); | 620 DCHECK(CalledOnValidThread()); |
621 Invalidate(); | 621 Invalidate(); |
622 delete this; | 622 delete this; |
623 } | 623 } |
624 | 624 |
| 625 bool DXVAVideoDecodeAccelerator::CanDecodeOnIOThread() { |
| 626 return false; |
| 627 } |
| 628 |
625 bool DXVAVideoDecodeAccelerator::InitDecoder(media::VideoCodecProfile profile) { | 629 bool DXVAVideoDecodeAccelerator::InitDecoder(media::VideoCodecProfile profile) { |
626 if (profile < media::H264PROFILE_MIN || profile > media::H264PROFILE_MAX) | 630 if (profile < media::H264PROFILE_MIN || profile > media::H264PROFILE_MAX) |
627 return false; | 631 return false; |
628 | 632 |
629 // We mimic the steps CoCreateInstance uses to instantiate the object. This | 633 // We mimic the steps CoCreateInstance uses to instantiate the object. This |
630 // was previously done because it failed inside the sandbox, and now is done | 634 // was previously done because it failed inside the sandbox, and now is done |
631 // as a more minimal approach to avoid other side-effects CCI might have (as | 635 // as a more minimal approach to avoid other side-effects CCI might have (as |
632 // we are still in a reduced sandbox). | 636 // we are still in a reduced sandbox). |
633 HMODULE decoder_dll = ::LoadLibrary(L"msmpeg2vdec.dll"); | 637 HMODULE decoder_dll = ::LoadLibrary(L"msmpeg2vdec.dll"); |
634 RETURN_ON_FAILURE(decoder_dll, | 638 RETURN_ON_FAILURE(decoder_dll, |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1177 |
1174 for (index = picture_buffers.begin(); | 1178 for (index = picture_buffers.begin(); |
1175 index != picture_buffers.end(); | 1179 index != picture_buffers.end(); |
1176 ++index) { | 1180 ++index) { |
1177 DVLOG(1) << "Dismissing picture id: " << index->second->id(); | 1181 DVLOG(1) << "Dismissing picture id: " << index->second->id(); |
1178 client_->DismissPictureBuffer(index->second->id()); | 1182 client_->DismissPictureBuffer(index->second->id()); |
1179 } | 1183 } |
1180 } | 1184 } |
1181 | 1185 |
1182 } // namespace content | 1186 } // namespace content |
OLD | NEW |