| 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(const scoped_refptr<media::VideoFrame>& frame, | 51 void DeliverFrameOnIO( |
| 52 base::TimeTicks estimated_capture_time); | 52 const scoped_refptr<media::VideoFrame>& frame, |
| 53 const base::TimeTicks& estimated_capture_time); |
| 53 | 54 |
| 54 base::SingleThreadTaskRunner* io_task_runner() const { | 55 base::SingleThreadTaskRunner* io_task_runner() const { |
| 55 DCHECK(thread_checker_.CalledOnValidThread()); | 56 DCHECK(thread_checker_.CalledOnValidThread()); |
| 56 return io_task_runner_.get(); | 57 return io_task_runner_.get(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 // Start monitor that frames are delivered to this object. I.E, that | 60 // Start monitor that frames are delivered to this object. I.E, that |
| 60 // |DeliverFrameOnIO| is called with a frame rate of |source_frame_rate|. | 61 // |DeliverFrameOnIO| is called with a frame rate of |source_frame_rate|. |
| 61 // |on_muted_callback| is triggered on the main render thread. | 62 // |on_muted_callback| is triggered on the main render thread. |
| 62 void StartFrameMonitoring(double source_frame_rate, | 63 void StartFrameMonitoring(double source_frame_rate, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 117 |
| 117 // Frame rate configured on the video source, accessed on the IO-thread. | 118 // Frame rate configured on the video source, accessed on the IO-thread. |
| 118 float source_frame_rate_; | 119 float source_frame_rate_; |
| 119 | 120 |
| 120 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); | 121 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 } // namespace content | 124 } // namespace content |
| 124 | 125 |
| 125 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ | 126 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ |
| OLD | NEW |