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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void StopFrameMonitoringOnIO(); | 83 void StopFrameMonitoringOnIO(); |
84 | 84 |
85 // Compare |frame_counter_snapshot| with the current |frame_counter_|, and | 85 // Compare |frame_counter_snapshot| with the current |frame_counter_|, and |
86 // inform of the situation (muted, not muted) via |set_muted_state_callback|. | 86 // inform of the situation (muted, not muted) via |set_muted_state_callback|. |
87 void CheckFramesReceivedOnIO(const OnMutedCallback& set_muted_state_callback, | 87 void CheckFramesReceivedOnIO(const OnMutedCallback& set_muted_state_callback, |
88 uint64 old_frame_counter_snapshot); | 88 uint64 old_frame_counter_snapshot); |
89 | 89 |
90 // |thread_checker_| is bound to the main render thread. | 90 // |thread_checker_| is bound to the main render thread. |
91 base::ThreadChecker thread_checker_; | 91 base::ThreadChecker thread_checker_; |
92 | 92 |
93 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 93 const scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
94 | 94 |
95 // |renderer_task_runner_| is used to ensure that | 95 // |renderer_task_runner_| is used to ensure that |
96 // VideoCaptureDeliverFrameCB is released on the main render thread. | 96 // VideoCaptureDeliverFrameCB is released on the main render thread. |
97 scoped_refptr<base::SingleThreadTaskRunner> renderer_task_runner_; | 97 const scoped_refptr<base::SingleThreadTaskRunner> renderer_task_runner_; |
98 | 98 |
99 // VideoFrameResolutionAdapter is an inner class that is created on the main | 99 // VideoFrameResolutionAdapter is an inner class that is created on the main |
100 // render thread but operates on the IO-thread. It does the resolution | 100 // render thread but operates on the IO-thread. It does the resolution |
101 // adaptation and delivers frames to all registered tracks on the IO-thread. | 101 // adaptation and delivers frames to all registered tracks on the IO-thread. |
102 class VideoFrameResolutionAdapter; | 102 class VideoFrameResolutionAdapter; |
103 typedef std::vector<scoped_refptr<VideoFrameResolutionAdapter> > | 103 typedef std::vector<scoped_refptr<VideoFrameResolutionAdapter> > |
104 FrameAdapters; | 104 FrameAdapters; |
105 FrameAdapters adapters_; | 105 FrameAdapters adapters_; |
106 | 106 |
107 // Set to true if frame monitoring has been started. It is only accessed on | 107 // Set to true if frame monitoring has been started. It is only accessed on |
108 // the IO-thread. | 108 // the IO-thread. |
109 bool monitoring_frame_rate_; | 109 bool monitoring_frame_rate_; |
110 | 110 |
111 // Keeps track of it frames have been received. It is only accessed on the | 111 // Keeps track of it frames have been received. It is only accessed on the |
112 // IO-thread. | 112 // IO-thread. |
113 bool muted_state_; | 113 bool muted_state_; |
114 | 114 |
115 // Running frame counter, accessed on the IO-thread. | 115 // Running frame counter, accessed on the IO-thread. |
116 uint64 frame_counter_; | 116 uint64 frame_counter_; |
117 | 117 |
118 // 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. |
119 float source_frame_rate_; | 119 float source_frame_rate_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); | 121 DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
125 | 125 |
126 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ | 126 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_ |
OLD | NEW |