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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 base::Unretained(this), sample)); | 808 base::Unretained(this), sample)); |
809 } | 809 } |
810 | 810 |
811 void DXVAVideoDecodeAccelerator::AssignPictureBuffers( | 811 void DXVAVideoDecodeAccelerator::AssignPictureBuffers( |
812 const std::vector<media::PictureBuffer>& buffers) { | 812 const std::vector<media::PictureBuffer>& buffers) { |
813 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 813 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
814 | 814 |
815 State state = GetState(); | 815 State state = GetState(); |
816 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized), | 816 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized), |
817 "Invalid state: " << state, ILLEGAL_STATE,); | 817 "Invalid state: " << state, ILLEGAL_STATE,); |
818 RETURN_AND_NOTIFY_ON_FAILURE((kNumPictureBuffers == buffers.size()), | 818 RETURN_AND_NOTIFY_ON_FAILURE((kNumPictureBuffers >= buffers.size()), |
819 "Failed to provide requested picture buffers. (Got " << buffers.size() << | 819 "Failed to provide requested picture buffers. (Got " << buffers.size() << |
820 ", requested " << kNumPictureBuffers << ")", INVALID_ARGUMENT,); | 820 ", requested " << kNumPictureBuffers << ")", INVALID_ARGUMENT,); |
821 | 821 |
822 // Copy the picture buffers provided by the client to the available list, | 822 // Copy the picture buffers provided by the client to the available list, |
823 // and mark these buffers as available for use. | 823 // and mark these buffers as available for use. |
824 for (size_t buffer_index = 0; buffer_index < buffers.size(); | 824 for (size_t buffer_index = 0; buffer_index < buffers.size(); |
825 ++buffer_index) { | 825 ++buffer_index) { |
826 linked_ptr<DXVAPictureBuffer> picture_buffer = | 826 linked_ptr<DXVAPictureBuffer> picture_buffer = |
827 DXVAPictureBuffer::Create(*this, buffers[buffer_index], egl_config_); | 827 DXVAPictureBuffer::Create(*this, buffers[buffer_index], egl_config_); |
828 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(), | 828 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(), |
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 D3DSURFACE_DESC surface_desc; | 2206 D3DSURFACE_DESC surface_desc; |
2207 hr = surface->GetDesc(&surface_desc); | 2207 hr = surface->GetDesc(&surface_desc); |
2208 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); | 2208 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); |
2209 *width = surface_desc.Width; | 2209 *width = surface_desc.Width; |
2210 *height = surface_desc.Height; | 2210 *height = surface_desc.Height; |
2211 } | 2211 } |
2212 return true; | 2212 return true; |
2213 } | 2213 } |
2214 | 2214 |
2215 } // namespace content | 2215 } // namespace content |
OLD | NEW |