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

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: Skip posting DecodeTask of resolution changing while resetting 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 RETURN_AND_NOTIFY_ON_FAILURE( 804 RETURN_AND_NOTIFY_ON_FAILURE(
805 picture->Allocate(output_format_), 805 picture->Allocate(output_format_),
806 "Failed to allocate memory for a VaapiPicture", PLATFORM_FAILURE, ); 806 "Failed to allocate memory for a VaapiPicture", PLATFORM_FAILURE, );
807 output_buffers_.push(buffers[i].id()); 807 output_buffers_.push(buffers[i].id());
808 } 808 }
809 809
810 available_va_surfaces_.push_back(va_surface_ids[i]); 810 available_va_surfaces_.push_back(va_surface_ids[i]);
811 surfaces_available_.Signal(); 811 surfaces_available_.Signal();
812 } 812 }
813 813
814 state_ = kDecoding; 814 // The resolution changing may happen while resetting or flushing. In this
815 decoder_thread_task_runner_->PostTask( 815 // case we do not change state and post DecodeTask().
816 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, 816 if (state_ != kResetting && state_ != kFlushing) {
johnylin1 2016/07/20 02:50:43 I ran overnight for AdaptivePlaybackTest#testH264_
Pawel Osciak 2016/07/20 04:28:34 Please also test with video_VideoSeek.
817 base::Unretained(this))); 817 state_ = kDecoding;
818 decoder_thread_task_runner_->PostTask(
819 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask,
820 base::Unretained(this)));
821 }
818 } 822 }
819 823
820 #if defined(USE_OZONE) 824 #if defined(USE_OZONE)
821 static void CloseGpuMemoryBufferHandle( 825 static void CloseGpuMemoryBufferHandle(
822 const gfx::GpuMemoryBufferHandle& handle) { 826 const gfx::GpuMemoryBufferHandle& handle) {
823 for (const auto& fd : handle.native_pixmap_handle.fds) { 827 for (const auto& fd : handle.native_pixmap_handle.fds) {
824 // Close the fd by wrapping it in a ScopedFD and letting 828 // Close the fd by wrapping it in a ScopedFD and letting
825 // it fall out of scope. 829 // it fall out of scope.
826 base::ScopedFD scoped_fd(fd.fd); 830 base::ScopedFD scoped_fd(fd.fd);
827 } 831 }
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 return vaapi_pic->dec_surface(); 1851 return vaapi_pic->dec_surface();
1848 } 1852 }
1849 1853
1850 // static 1854 // static
1851 VideoDecodeAccelerator::SupportedProfiles 1855 VideoDecodeAccelerator::SupportedProfiles
1852 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1856 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1853 return VaapiWrapper::GetSupportedDecodeProfiles(); 1857 return VaapiWrapper::GetSupportedDecodeProfiles();
1854 } 1858 }
1855 1859
1856 } // namespace media 1860 } // 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