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

Side by Side Diff: content/common/gpu/media/vaapi_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: Moved constant to shared header, validate min_picture_size now in resource proxy as well as host co… Created 5 years, 4 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/vaapi_video_decode_accelerator.h" 5 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 const std::vector<media::PictureBuffer>& buffers) { 644 const std::vector<media::PictureBuffer>& buffers) {
645 DCHECK_EQ(message_loop_, base::MessageLoop::current()); 645 DCHECK_EQ(message_loop_, base::MessageLoop::current());
646 646
647 base::AutoLock auto_lock(lock_); 647 base::AutoLock auto_lock(lock_);
648 DCHECK(pictures_.empty()); 648 DCHECK(pictures_.empty());
649 649
650 while (!output_buffers_.empty()) 650 while (!output_buffers_.empty())
651 output_buffers_.pop(); 651 output_buffers_.pop();
652 652
653 RETURN_AND_NOTIFY_ON_FAILURE( 653 RETURN_AND_NOTIFY_ON_FAILURE(
654 buffers.size() == requested_num_pics_, 654 buffers.size() >= requested_num_pics_,
655 "Got an invalid number of picture buffers. (Got " << buffers.size() 655 "Got an invalid number of picture buffers. (Got " << buffers.size()
656 << ", requested " << requested_num_pics_ << ")", INVALID_ARGUMENT, ); 656 << ", requested " << requested_num_pics_ << ")", INVALID_ARGUMENT, );
657 DCHECK(requested_pic_size_ == buffers[0].size()); 657 DCHECK(requested_pic_size_ == buffers[0].size());
658 658
659 std::vector<VASurfaceID> va_surface_ids; 659 std::vector<VASurfaceID> va_surface_ids;
660 RETURN_AND_NOTIFY_ON_FAILURE( 660 RETURN_AND_NOTIFY_ON_FAILURE(
661 vaapi_wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, requested_pic_size_, 661 vaapi_wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, requested_pic_size_,
662 buffers.size(), &va_surface_ids), 662 buffers.size(), &va_surface_ids),
663 "Failed creating VA Surfaces", PLATFORM_FAILURE, ); 663 "Failed creating VA Surfaces", PLATFORM_FAILURE, );
664 DCHECK_EQ(va_surface_ids.size(), buffers.size()); 664 DCHECK_EQ(va_surface_ids.size(), buffers.size());
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 return vaapi_pic->dec_surface(); 1511 return vaapi_pic->dec_surface();
1512 } 1512 }
1513 1513
1514 // static 1514 // static
1515 media::VideoDecodeAccelerator::SupportedProfiles 1515 media::VideoDecodeAccelerator::SupportedProfiles
1516 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1516 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1517 return VaapiWrapper::GetSupportedDecodeProfiles(); 1517 return VaapiWrapper::GetSupportedDecodeProfiles();
1518 } 1518 }
1519 1519
1520 } // namespace content 1520 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698