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