| 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/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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(requested_pic_size_, |
| 662 buffers.size(), &va_surface_ids), | 662 buffers.size(), |
| 663 &va_surface_ids), |
| 663 "Failed creating VA Surfaces", PLATFORM_FAILURE, ); | 664 "Failed creating VA Surfaces", PLATFORM_FAILURE, ); |
| 664 DCHECK_EQ(va_surface_ids.size(), buffers.size()); | 665 DCHECK_EQ(va_surface_ids.size(), buffers.size()); |
| 665 | 666 |
| 666 for (size_t i = 0; i < buffers.size(); ++i) { | 667 for (size_t i = 0; i < buffers.size(); ++i) { |
| 667 DVLOG(2) << "Assigning picture id: " << buffers[i].id() | 668 DVLOG(2) << "Assigning picture id: " << buffers[i].id() |
| 668 << " to texture id: " << buffers[i].texture_id() | 669 << " to texture id: " << buffers[i].texture_id() |
| 669 << " VASurfaceID: " << va_surface_ids[i]; | 670 << " VASurfaceID: " << va_surface_ids[i]; |
| 670 | 671 |
| 671 linked_ptr<VaapiPicture> picture(VaapiPicture::CreatePicture( | 672 linked_ptr<VaapiPicture> picture(VaapiPicture::CreatePicture( |
| 672 vaapi_wrapper_.get(), make_context_current_, buffers[i].id(), | 673 vaapi_wrapper_.get(), make_context_current_, buffers[i].id(), |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 return vaapi_pic->dec_surface(); | 1512 return vaapi_pic->dec_surface(); |
| 1512 } | 1513 } |
| 1513 | 1514 |
| 1514 // static | 1515 // static |
| 1515 media::VideoDecodeAccelerator::SupportedProfiles | 1516 media::VideoDecodeAccelerator::SupportedProfiles |
| 1516 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { | 1517 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { |
| 1517 return VaapiWrapper::GetSupportedDecodeProfiles(); | 1518 return VaapiWrapper::GetSupportedDecodeProfiles(); |
| 1518 } | 1519 } |
| 1519 | 1520 |
| 1520 } // namespace content | 1521 } // namespace content |
| OLD | NEW |