| 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/filters/vpx_video_decoder.h" | 5 #include "media/filters/vpx_video_decoder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (!offload_thread_.IsRunning()) | 63 if (!offload_thread_.IsRunning()) |
| 64 offload_thread_.Start(); | 64 offload_thread_.Start(); |
| 65 | 65 |
| 66 return offload_thread_.task_runner(); | 66 return offload_thread_.task_runner(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WaitForOutstandingTasks() { | 69 void WaitForOutstandingTasks() { |
| 70 DCHECK(thread_checker_.CalledOnValidThread()); | 70 DCHECK(thread_checker_.CalledOnValidThread()); |
| 71 DCHECK(offload_thread_users_); | 71 DCHECK(offload_thread_users_); |
| 72 DCHECK(offload_thread_.IsRunning()); | 72 DCHECK(offload_thread_.IsRunning()); |
| 73 base::WaitableEvent waiter(false, false); | 73 base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 74 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 74 offload_thread_.task_runner()->PostTask( | 75 offload_thread_.task_runner()->PostTask( |
| 75 FROM_HERE, | 76 FROM_HERE, |
| 76 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter))); | 77 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter))); |
| 77 waiter.Wait(); | 78 waiter.Wait(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void WaitForOutstandingTasksAndReleaseOffloadThread() { | 81 void WaitForOutstandingTasksAndReleaseOffloadThread() { |
| 81 DCHECK(thread_checker_.CalledOnValidThread()); | 82 DCHECK(thread_checker_.CalledOnValidThread()); |
| 82 DCHECK(offload_thread_users_); | 83 DCHECK(offload_thread_users_); |
| 83 DCHECK(offload_thread_.IsRunning()); | 84 DCHECK(offload_thread_.IsRunning()); |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 (*video_frame)->visible_data(VideoFrame::kUPlane), | 697 (*video_frame)->visible_data(VideoFrame::kUPlane), |
| 697 (*video_frame)->stride(VideoFrame::kUPlane), | 698 (*video_frame)->stride(VideoFrame::kUPlane), |
| 698 (*video_frame)->visible_data(VideoFrame::kVPlane), | 699 (*video_frame)->visible_data(VideoFrame::kVPlane), |
| 699 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), | 700 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
| 700 coded_size.height()); | 701 coded_size.height()); |
| 701 | 702 |
| 702 return true; | 703 return true; |
| 703 } | 704 } |
| 704 | 705 |
| 705 } // namespace media | 706 } // namespace media |
| OLD | NEW |