Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 1207043002: Introduce a client minimum picture pool size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documented actual may be larger than requested count. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 base::Unretained(this), sample)); 770 base::Unretained(this), sample));
771 } 771 }
772 772
773 void DXVAVideoDecodeAccelerator::AssignPictureBuffers( 773 void DXVAVideoDecodeAccelerator::AssignPictureBuffers(
774 const std::vector<media::PictureBuffer>& buffers) { 774 const std::vector<media::PictureBuffer>& buffers) {
775 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 775 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
776 776
777 State state = GetState(); 777 State state = GetState();
778 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized), 778 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized),
779 "Invalid state: " << state, ILLEGAL_STATE,); 779 "Invalid state: " << state, ILLEGAL_STATE,);
780 RETURN_AND_NOTIFY_ON_FAILURE((kNumPictureBuffers == buffers.size()), 780 RETURN_AND_NOTIFY_ON_FAILURE((kNumPictureBuffers >= buffers.size()),
781 "Failed to provide requested picture buffers. (Got " << buffers.size() << 781 "Failed to provide requested picture buffers. (Got " << buffers.size() <<
782 ", requested " << kNumPictureBuffers << ")", INVALID_ARGUMENT,); 782 ", requested " << kNumPictureBuffers << ")", INVALID_ARGUMENT,);
783 783
784 // Copy the picture buffers provided by the client to the available list, 784 // Copy the picture buffers provided by the client to the available list,
785 // and mark these buffers as available for use. 785 // and mark these buffers as available for use.
786 for (size_t buffer_index = 0; buffer_index < buffers.size(); 786 for (size_t buffer_index = 0; buffer_index < buffers.size();
787 ++buffer_index) { 787 ++buffer_index) {
788 linked_ptr<DXVAPictureBuffer> picture_buffer = 788 linked_ptr<DXVAPictureBuffer> picture_buffer =
789 DXVAPictureBuffer::Create(*this, buffers[buffer_index], egl_config_); 789 DXVAPictureBuffer::Create(*this, buffers[buffer_index], egl_config_);
790 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(), 790 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(),
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 D3DSURFACE_DESC surface_desc; 2187 D3DSURFACE_DESC surface_desc;
2188 hr = surface->GetDesc(&surface_desc); 2188 hr = surface->GetDesc(&surface_desc);
2189 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); 2189 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false);
2190 *width = surface_desc.Width; 2190 *width = surface_desc.Width;
2191 *height = surface_desc.Height; 2191 *height = surface_desc.Height;
2192 } 2192 }
2193 return true; 2193 return true;
2194 } 2194 }
2195 2195
2196 } // namespace content 2196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698