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

Side by Side Diff: media/gpu/vaapi_video_decode_accelerator.cc

Issue 2151183002: Skip posting DecodeTask of resolution changing while resetting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698