OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/base/null_video_sink.h" | 5 #include "media/base/null_video_sink.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 task_runner_->PostDelayedTask(FROM_HERE, cancelable_worker_.callback(), | 87 task_runner_->PostDelayedTask(FROM_HERE, cancelable_worker_.callback(), |
88 delay); | 88 delay); |
89 } | 89 } |
90 | 90 |
91 void NullVideoSink::PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, | 91 void NullVideoSink::PaintSingleFrame(const scoped_refptr<VideoFrame>& frame, |
92 bool repaint_duplicate_frame) { | 92 bool repaint_duplicate_frame) { |
93 if (!repaint_duplicate_frame && frame == last_frame_) | 93 if (!repaint_duplicate_frame && frame == last_frame_) |
94 return; | 94 return; |
| 95 |
95 last_frame_ = frame; | 96 last_frame_ = frame; |
96 new_frame_cb_.Run(frame); | 97 if (!new_frame_cb_.is_null()) |
| 98 new_frame_cb_.Run(frame); |
97 } | 99 } |
98 | 100 |
99 } // namespace media | 101 } // namespace media |
OLD | NEW |