| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 last_input_buffer_id_(-1), | 502 last_input_buffer_id_(-1), |
| 503 inputs_before_decode_(0) { | 503 inputs_before_decode_(0) { |
| 504 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); | 504 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); |
| 505 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); | 505 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); |
| 506 } | 506 } |
| 507 | 507 |
| 508 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { | 508 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { |
| 509 client_ = NULL; | 509 client_ = NULL; |
| 510 } | 510 } |
| 511 | 511 |
| 512 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile) { | 512 bool DXVAVideoDecodeAccelerator::Initialize( |
| 513 media::VideoCodecProfile profile, |
| 514 const gfx::Size& frame_size, |
| 515 const std::vector<uint8_t>& extra_data) { |
| 513 DCHECK(CalledOnValidThread()); | 516 DCHECK(CalledOnValidThread()); |
| 514 | 517 |
| 515 RETURN_AND_NOTIFY_ON_FAILURE(pre_sandbox_init_done_, | 518 RETURN_AND_NOTIFY_ON_FAILURE(pre_sandbox_init_done_, |
| 516 "PreSandbox initialization not completed", PLATFORM_FAILURE, false); | 519 "PreSandbox initialization not completed", PLATFORM_FAILURE, false); |
| 517 | 520 |
| 518 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kUninitialized), | 521 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kUninitialized), |
| 519 "Initialize: invalid state: " << state_, ILLEGAL_STATE, false); | 522 "Initialize: invalid state: " << state_, ILLEGAL_STATE, false); |
| 520 | 523 |
| 521 HRESULT hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); | 524 HRESULT hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); |
| 522 RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "MFStartup failed.", PLATFORM_FAILURE, | 525 RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "MFStartup failed.", PLATFORM_FAILURE, |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 gfx::Size(width, height)); | 1021 gfx::Size(width, height)); |
| 1019 } | 1022 } |
| 1020 } | 1023 } |
| 1021 | 1024 |
| 1022 void DXVAVideoDecodeAccelerator::NotifyPictureReady( | 1025 void DXVAVideoDecodeAccelerator::NotifyPictureReady( |
| 1023 const media::Picture& picture) { | 1026 const media::Picture& picture) { |
| 1024 // This task could execute after the decoder has been torn down. | 1027 // This task could execute after the decoder has been torn down. |
| 1025 if (state_ != kUninitialized && client_) | 1028 if (state_ != kUninitialized && client_) |
| 1026 client_->PictureReady(picture); | 1029 client_->PictureReady(picture); |
| 1027 } | 1030 } |
| OLD | NEW |