| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/media/mock_media_stream_video_source.h" | 5 #include "content/renderer/media/mock_media_stream_video_source.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 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 attempted_to_start_ = true; | 98 attempted_to_start_ = true; |
| 99 frame_callback_ = frame_callback; | 99 frame_callback_ = frame_callback; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void MockMediaStreamVideoSource::StopSourceImpl() { | 102 void MockMediaStreamVideoSource::StopSourceImpl() { |
| 103 } | 103 } |
| 104 | 104 |
| 105 base::Optional<media::VideoCaptureFormat> | 105 base::Optional<media::VideoCaptureFormat> |
| 106 MockMediaStreamVideoSource::GetCurrentFormatImpl() const { | 106 MockMediaStreamVideoSource::GetCurrentFormatImpl() const { |
| 107 return format_; | 107 return base::Optional<media::VideoCaptureFormat>(format_); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void MockMediaStreamVideoSource::DeliverVideoFrame( | 110 void MockMediaStreamVideoSource::DeliverVideoFrame( |
| 111 const scoped_refptr<media::VideoFrame>& frame) { | 111 const scoped_refptr<media::VideoFrame>& frame) { |
| 112 DCHECK(!frame_callback_.is_null()); | 112 DCHECK(!frame_callback_.is_null()); |
| 113 io_task_runner()->PostTask( | 113 io_task_runner()->PostTask( |
| 114 FROM_HERE, base::Bind(frame_callback_, frame, base::TimeTicks())); | 114 FROM_HERE, base::Bind(frame_callback_, frame, base::TimeTicks())); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace content | 117 } // namespace content |
| OLD | NEW |