OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 DCHECK(!decode_cb_.is_null()); | 217 DCHECK(!decode_cb_.is_null()); |
218 DCHECK(wait_for_pending_decode_cb_.is_null()); | 218 DCHECK(wait_for_pending_decode_cb_.is_null()); |
219 } | 219 } |
220 | 220 |
221 void SatisfyPendingRead() { | 221 void SatisfyPendingRead() { |
222 CHECK(!decode_cb_.is_null()); | 222 CHECK(!decode_cb_.is_null()); |
223 CHECK(!decode_results_.empty()); | 223 CHECK(!decode_results_.empty()); |
224 | 224 |
225 // Post tasks for OutputCB and DecodeCB. | 225 // Post tasks for OutputCB and DecodeCB. |
226 scoped_refptr<VideoFrame> frame = decode_results_.front().second; | 226 scoped_refptr<VideoFrame> frame = decode_results_.front().second; |
227 if (frame) | 227 if (frame.get()) |
228 message_loop_.PostTask(FROM_HERE, base::Bind(output_cb_, frame)); | 228 message_loop_.PostTask(FROM_HERE, base::Bind(output_cb_, frame)); |
229 message_loop_.PostTask( | 229 message_loop_.PostTask( |
230 FROM_HERE, base::Bind(base::ResetAndReturn(&decode_cb_), | 230 FROM_HERE, base::Bind(base::ResetAndReturn(&decode_cb_), |
231 decode_results_.front().first)); | 231 decode_results_.front().first)); |
232 decode_results_.pop_front(); | 232 decode_results_.pop_front(); |
233 } | 233 } |
234 | 234 |
235 void SatisfyPendingReadWithEndOfStream() { | 235 void SatisfyPendingReadWithEndOfStream() { |
236 DCHECK(!decode_cb_.is_null()); | 236 DCHECK(!decode_cb_.is_null()); |
237 | 237 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 .WillOnce(RunClosure(event.GetClosure())); | 554 .WillOnce(RunClosure(event.GetClosure())); |
555 SatisfyPendingReadWithEndOfStream(); | 555 SatisfyPendingReadWithEndOfStream(); |
556 event.RunAndWait(); | 556 event.RunAndWait(); |
557 } | 557 } |
558 | 558 |
559 WaitForEnded(); | 559 WaitForEnded(); |
560 Destroy(); | 560 Destroy(); |
561 } | 561 } |
562 | 562 |
563 } // namespace media | 563 } // namespace media |
OLD | NEW |