Chromium Code Reviews| 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 "media/gpu/vaapi_video_decode_accelerator.h" | 5 #include "media/gpu/vaapi_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 791 RETURN_AND_NOTIFY_ON_FAILURE( | 791 RETURN_AND_NOTIFY_ON_FAILURE( |
| 792 picture->Allocate(kOutputPictureFormat), | 792 picture->Allocate(kOutputPictureFormat), |
| 793 "Failed to allocate memory for a VaapiPicture", PLATFORM_FAILURE, ); | 793 "Failed to allocate memory for a VaapiPicture", PLATFORM_FAILURE, ); |
| 794 output_buffers_.push(buffers[i].id()); | 794 output_buffers_.push(buffers[i].id()); |
| 795 } | 795 } |
| 796 | 796 |
| 797 available_va_surfaces_.push_back(va_surface_ids[i]); | 797 available_va_surfaces_.push_back(va_surface_ids[i]); |
| 798 surfaces_available_.Signal(); | 798 surfaces_available_.Signal(); |
| 799 } | 799 } |
| 800 | 800 |
| 801 state_ = kDecoding; | 801 // The resolution changing may happen while resetting. In this case we do not |
| 802 decoder_thread_task_runner_->PostTask( | 802 // change state and post DeocdeTask(). The stream will be resumed in |
|
Pawel Osciak
2016/07/19 07:26:08
s/DeocdeTask/DecodeTask/
| |
| 803 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, | 803 // FinishReset(). |
| 804 base::Unretained(this))); | 804 if (state_ != kResetting) { |
|
Pawel Osciak
2016/07/19 07:26:08
Could we be in kFlushing? Should we also consider
johnylin1
2016/07/19 08:04:41
Yes, I found out that the same issue may be encoun
| |
| 805 state_ = kDecoding; | |
| 806 decoder_thread_task_runner_->PostTask( | |
| 807 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, | |
| 808 base::Unretained(this))); | |
| 809 } | |
| 805 } | 810 } |
| 806 | 811 |
| 807 #if defined(USE_OZONE) | 812 #if defined(USE_OZONE) |
| 808 static void CloseGpuMemoryBufferHandle( | 813 static void CloseGpuMemoryBufferHandle( |
| 809 const gfx::GpuMemoryBufferHandle& handle) { | 814 const gfx::GpuMemoryBufferHandle& handle) { |
| 810 for (const auto& fd : handle.native_pixmap_handle.fds) { | 815 for (const auto& fd : handle.native_pixmap_handle.fds) { |
| 811 // Close the fd by wrapping it in a ScopedFD and letting | 816 // Close the fd by wrapping it in a ScopedFD and letting |
| 812 // it fall out of scope. | 817 // it fall out of scope. |
| 813 base::ScopedFD scoped_fd(fd.fd); | 818 base::ScopedFD scoped_fd(fd.fd); |
| 814 } | 819 } |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1841 return vaapi_pic->dec_surface(); | 1846 return vaapi_pic->dec_surface(); |
| 1842 } | 1847 } |
| 1843 | 1848 |
| 1844 // static | 1849 // static |
| 1845 VideoDecodeAccelerator::SupportedProfiles | 1850 VideoDecodeAccelerator::SupportedProfiles |
| 1846 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { | 1851 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { |
| 1847 return VaapiWrapper::GetSupportedDecodeProfiles(); | 1852 return VaapiWrapper::GetSupportedDecodeProfiles(); |
| 1848 } | 1853 } |
| 1849 | 1854 |
| 1850 } // namespace media | 1855 } // namespace media |
| OLD | NEW |