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 "content/renderer/media/media_stream_video_track.h" | 5 #include "content/renderer/media/media_stream_video_track.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/renderer/media/video_frame_deliverer.h" | 8 #include "content/renderer/media/video_frame_deliverer.h" |
9 #include "media/base/bind_to_current_loop.h" | 9 #include "media/base/bind_to_current_loop.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void SetEnabled(bool enabled) { | 46 void SetEnabled(bool enabled) { |
47 DCHECK(thread_checker().CalledOnValidThread()); | 47 DCHECK(thread_checker().CalledOnValidThread()); |
48 io_message_loop()->PostTask( | 48 io_message_loop()->PostTask( |
49 FROM_HERE, | 49 FROM_HERE, |
50 base::Bind(&MediaStreamVideoTrack::FrameDeliverer::SetEnabledOnIO, | 50 base::Bind(&MediaStreamVideoTrack::FrameDeliverer::SetEnabledOnIO, |
51 this, enabled)); | 51 this, enabled)); |
52 } | 52 } |
53 | 53 |
54 virtual void DeliverFrameOnIO( | 54 virtual void DeliverFrameOnIO( |
55 const scoped_refptr<media::VideoFrame>& frame, | 55 const scoped_refptr<media::VideoFrame>& frame, |
56 const media::VideoCaptureFormat& format) OVERRIDE { | 56 const media::VideoCaptureFormat& format, |
| 57 const base::TimeTicks& estimated_capture_time) OVERRIDE { |
57 DCHECK(io_message_loop()->BelongsToCurrentThread()); | 58 DCHECK(io_message_loop()->BelongsToCurrentThread()); |
58 if (!enabled_) | 59 if (!enabled_) |
59 return; | 60 return; |
60 VideoFrameDeliverer::DeliverFrameOnIO(frame, format); | 61 VideoFrameDeliverer::DeliverFrameOnIO(frame, format, |
| 62 estimated_capture_time); |
61 } | 63 } |
62 | 64 |
63 const std::vector<MediaStreamVideoSink*>& sinks() const { return sinks_; } | 65 const std::vector<MediaStreamVideoSink*>& sinks() const { return sinks_; } |
64 | 66 |
65 protected: | 67 protected: |
66 virtual ~FrameDeliverer() { | 68 virtual ~FrameDeliverer() { |
67 DCHECK(sinks_.empty()); | 69 DCHECK(sinks_.empty()); |
68 } | 70 } |
69 | 71 |
70 void SetEnabledOnIO(bool enabled) { | 72 void SetEnabledOnIO(bool enabled) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 blink::WebMediaStreamSource::ReadyState state) { | 166 blink::WebMediaStreamSource::ReadyState state) { |
165 DCHECK(thread_checker_.CalledOnValidThread()); | 167 DCHECK(thread_checker_.CalledOnValidThread()); |
166 const std::vector<MediaStreamVideoSink*>& sinks = frame_deliverer_->sinks(); | 168 const std::vector<MediaStreamVideoSink*>& sinks = frame_deliverer_->sinks(); |
167 for (std::vector<MediaStreamVideoSink*>::const_iterator it = sinks.begin(); | 169 for (std::vector<MediaStreamVideoSink*>::const_iterator it = sinks.begin(); |
168 it != sinks.end(); ++it) { | 170 it != sinks.end(); ++it) { |
169 (*it)->OnReadyStateChanged(state); | 171 (*it)->OnReadyStateChanged(state); |
170 } | 172 } |
171 } | 173 } |
172 | 174 |
173 } // namespace content | 175 } // namespace content |
OLD | NEW |