| 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 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void AddTrack(const MediaStreamVideoTrack* track, | 41 void AddTrack(const MediaStreamVideoTrack* track, |
| 42 VideoCaptureDeliverFrameCB frame_callback, | 42 VideoCaptureDeliverFrameCB frame_callback, |
| 43 int max_width, int max_height, | 43 int max_width, int max_height, |
| 44 double min_aspect_ratio, | 44 double min_aspect_ratio, |
| 45 double max_aspect_ratio, | 45 double max_aspect_ratio, |
| 46 double max_frame_rate); | 46 double max_frame_rate); |
| 47 void RemoveTrack(const MediaStreamVideoTrack* track); | 47 void RemoveTrack(const MediaStreamVideoTrack* track); |
| 48 | 48 |
| 49 // Delivers |frame| to all tracks that have registered a callback. | 49 // Delivers |frame| to all tracks that have registered a callback. |
| 50 // Must be called on the IO-thread. | 50 // Must be called on the IO-thread. |
| 51 void DeliverFrameOnIO( | 51 void DeliverFrameOnIO(const scoped_refptr<media::VideoFrame>& frame, |
| 52 const scoped_refptr<media::VideoFrame>& frame, | 52 base::TimeTicks estimated_capture_time); |
| 53 const base::TimeTicks& estimated_capture_time); | |
| 54 | 53 |
| 55 base::SingleThreadTaskRunner* io_task_runner() const { | 54 base::SingleThreadTaskRunner* io_task_runner() const { |
| 56 DCHECK(thread_checker_.CalledOnValidThread()); | 55 DCHECK(thread_checker_.CalledOnValidThread()); |
| 57 return io_task_runner_.get(); | 56 return io_task_runner_.get(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 // Start monitor that frames are delivered to this object. I.E, that | 59 // Start monitor that frames are delivered to this object. I.E, that |
| 61 // |DeliverFrameOnIO| is called with a frame rate of |source_frame_rate|. | 60 // |DeliverFrameOnIO| is called with a frame rate of |source_frame_rate|. |
| 62 // |on_muted_callback| is triggered on the main render thread. | 61 // |on_muted_callback| is triggered on the main render thread. |
| 63 void StartFrameMonitoring(double source_frame_rate, | 62 void StartFrameMonitoring(double source_frame_rate, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 116 |
| 118 // Frame rate configured on the video source, accessed on the IO-thread. | 117 // Frame rate configured on the video source, accessed on the IO-thread. |
| 119 float source_frame_rate_; | 118 float source_frame_rate_; |
| 120 | 119 |
| 121 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); | 120 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); |
| 122 }; | 121 }; |
| 123 | 122 |
| 124 } // namespace content | 123 } // namespace content |
| 125 | 124 |
| 126 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ | 125 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ |
| OLD | NEW |