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_MEDIA_STREAM_VIDEO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 enum { | 50 enum { |
51 // Default resolution. If no constraints are specified and the delegate | 51 // Default resolution. If no constraints are specified and the delegate |
52 // support it, this is the resolution that will be used. | 52 // support it, this is the resolution that will be used. |
53 kDefaultWidth = 640, | 53 kDefaultWidth = 640, |
54 kDefaultHeight = 480, | 54 kDefaultHeight = 480, |
55 | 55 |
56 kDefaultFrameRate = 30, | 56 kDefaultFrameRate = 30, |
57 kUnknownFrameRate = 0, | 57 kUnknownFrameRate = 0, |
58 }; | 58 }; |
59 | 59 |
| 60 static constexpr double kDefaultAspectRatio = |
| 61 static_cast<double>(kDefaultWidth) / static_cast<double>(kDefaultHeight); |
| 62 |
60 MediaStreamVideoSource(); | 63 MediaStreamVideoSource(); |
61 ~MediaStreamVideoSource() override; | 64 ~MediaStreamVideoSource() override; |
62 | 65 |
63 // Returns the MediaStreamVideoSource object owned by |source|. | 66 // Returns the MediaStreamVideoSource object owned by |source|. |
64 static MediaStreamVideoSource* GetVideoSource( | 67 static MediaStreamVideoSource* GetVideoSource( |
65 const blink::WebMediaStreamSource& source); | 68 const blink::WebMediaStreamSource& source); |
66 | 69 |
67 // Puts |track| in the registered tracks list. | 70 // Puts |track| in the registered tracks list. |
68 void AddTrack(MediaStreamVideoTrack* track, | 71 void AddTrack(MediaStreamVideoTrack* track, |
69 const VideoCaptureDeliverFrameCB& frame_callback, | 72 const VideoCaptureDeliverFrameCB& frame_callback, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 206 |
204 // NOTE: Weak pointers must be invalidated before all other member variables. | 207 // NOTE: Weak pointers must be invalidated before all other member variables. |
205 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; | 208 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; |
206 | 209 |
207 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); | 210 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); |
208 }; | 211 }; |
209 | 212 |
210 } // namespace content | 213 } // namespace content |
211 | 214 |
212 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 215 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
OLD | NEW |