RELAND: Vaapi: Remove ConditionVariables and use PostTask
This CL relands the attached CL that got reverted due to scaling issues, i.e. when the decode bitstream changed resolution, there was the chance that before marking |awaiting_va_surfaces_recycle_|, we could get an "old" resolution frame, that would confuse |decoder_|. The solution is to move |awaiting_va_surfaces_recycle_| marking to DecodeTask(), and hold off any more Decode() operations until the "old" resolution frames are processed. This in turn makes InitiateSurfaceSetChange() superfluous, so it's moved into DecodeTask(). The rest is comment update :-) ** Changes can be found here: crrev.com/c/973684/3..9 TEST=http://crosvideo.appspot.com/?codec=vp9&cycle=true&loop=true&mute=true and letting it roll through many many many resolution changes. Original CL description ------------------------------------------------ This CL removes the use of the ConditionVariables inside VaVDA and uses instead PostTask()ing. This removes blocking the worker thread, which allows for moving other tasks there, e.g. the Surface Blit (as done in the follow up WIP CL crrev.com/c/947341) For all that goodness, this CL: - Refactors the waiting logic that on ToT is spread between GetCurrInputBuffer_Locked() and WaitForSurfaces_Locked() and simplifies it in DecodeTask() itself. - Moves the |curr_input_buffer_| filling logic in GetCurrInputBuffer_Locked() into DecodeTask() proper. - Reduces the scoped of the |lock_| in DecodeTask() (note that |curr_input_buffer_| and |decode_| are only used on the decoder thread -- added a .h comment). Minor stuff: This CL also moves together the declaration of the related member vars |input_buffers_|, |curr_input_buffer_| and |available_va_surfaces_| TEST=simplechrome+crosvideo (including seeks) on soraka, and v_d_a_unittest with h264, vp8, vp9 (with dcheck_always_on=true). Bug: 717265 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I86d179ac4d48c63b36787f5c7bdcb0da3839ed69 Reviewed-on: https://chromium-review.googlesource.com/949283 Commit-Queue: Miguel Casas <mcasas@chromium.org> Reviewed-by:Daniele Castagna <dcastagna@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#542955} Reviewed-on: https://chromium-review.googlesource.com/973684 Cr-Commit-Position: refs/heads/master@{#546827}
Showing
This diff is collapsed.
Please register or sign in to comment