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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 DCHECK(!IsOldVideoConstraints()); | 106 DCHECK(!IsOldVideoConstraints()); |
107 return min_frame_rate_; | 107 return min_frame_rate_; |
108 } | 108 } |
109 const VideoTrackAdapterSettings& adapter_settings() const { | 109 const VideoTrackAdapterSettings& adapter_settings() const { |
110 DCHECK(!IsOldVideoConstraints()); | 110 DCHECK(!IsOldVideoConstraints()); |
111 return *adapter_settings_; | 111 return *adapter_settings_; |
112 } | 112 } |
113 | 113 |
114 // Setting information about the track size. | 114 // Setting information about the track size. |
115 // Called from MediaStreamVideoSource at track initialization. | 115 // Called from MediaStreamVideoSource at track initialization. |
116 void SetTargetSize(int width, int height) { | 116 void SetTargetSizeAndFrameRate(int width, int height, double frame_rate) { |
117 width_ = width; | 117 width_ = width; |
118 height_ = height; | 118 height_ = height; |
| 119 frame_rate_ = frame_rate; |
119 } | 120 } |
120 | 121 |
121 private: | 122 private: |
122 // MediaStreamVideoSink is a friend to allow it to call AddSink() and | 123 // MediaStreamVideoSink is a friend to allow it to call AddSink() and |
123 // RemoveSink(). | 124 // RemoveSink(). |
124 friend class MediaStreamVideoSink; | 125 friend class MediaStreamVideoSink; |
125 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, StartTrack); | 126 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, StartTrack); |
126 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop); | 127 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop); |
127 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame); | 128 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame); |
128 | 129 |
(...skipping 23 matching lines...) Expand all Loading... |
152 base::Optional<bool> noise_reduction_; | 153 base::Optional<bool> noise_reduction_; |
153 bool is_screencast_; | 154 bool is_screencast_; |
154 double min_frame_rate_; | 155 double min_frame_rate_; |
155 | 156 |
156 // Weak ref to the source this tracks is connected to. | 157 // Weak ref to the source this tracks is connected to. |
157 base::WeakPtr<MediaStreamVideoSource> source_; | 158 base::WeakPtr<MediaStreamVideoSource> source_; |
158 | 159 |
159 // This is used for tracking if all connected video sinks are secure. | 160 // This is used for tracking if all connected video sinks are secure. |
160 SecureDisplayLinkTracker<MediaStreamVideoSink> secure_tracker_; | 161 SecureDisplayLinkTracker<MediaStreamVideoSink> secure_tracker_; |
161 | 162 |
162 // Remembering our desired video size. | 163 // Remembering our desired video size and frame rate. |
163 int width_ = 0; | 164 int width_ = 0; |
164 int height_ = 0; | 165 int height_ = 0; |
| 166 double frame_rate_ = 0.0; |
165 | 167 |
166 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack); | 168 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack); |
167 }; | 169 }; |
168 | 170 |
169 } // namespace content | 171 } // namespace content |
170 | 172 |
171 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ | 173 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ |
OLD | NEW |