Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: content/renderer/media/media_stream_video_source.h

Issue 2972553002: Remove MediaStreamVideoSource::GetCurrentSupportedFormats() (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 19 matching lines...) Expand all
30 class VideoTrackAdapter; 30 class VideoTrackAdapter;
31 struct VideoTrackAdapterSettings; 31 struct VideoTrackAdapterSettings;
32 32
33 // MediaStreamVideoSource is an interface used for sending video frames to a 33 // MediaStreamVideoSource is an interface used for sending video frames to a
34 // MediaStreamVideoTrack. 34 // MediaStreamVideoTrack.
35 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html 35 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html
36 // The purpose of this base class is to be able to implement different 36 // The purpose of this base class is to be able to implement different
37 // MediaStreaVideoSources such as local video capture, video sources received 37 // MediaStreaVideoSources such as local video capture, video sources received
38 // on a PeerConnection or a source created in NaCl. 38 // on a PeerConnection or a source created in NaCl.
39 // All methods calls will be done from the main render thread. 39 // All methods calls will be done from the main render thread.
40 //
41 // When the first track is added to the source by calling AddTrack, the
42 // MediaStreamVideoSource implementation calls GetCurrentSupportedFormats.
43 // The source implementation must call OnSupportedFormats.
44 // MediaStreamVideoSource then match the constraints provided in AddTrack with
45 // the formats and call StartSourceImpl. The source implementation must call
46 // OnStartDone when the underlying source has been started or failed to start.
hbos_chromium 2017/07/04 14:06:34 OnStartDone is still used, was too much of this co
Guido Urdaneta 2017/07/04 14:30:28 I intentionally removed the part about OnStartDone
47 class CONTENT_EXPORT MediaStreamVideoSource : public MediaStreamSource { 40 class CONTENT_EXPORT MediaStreamVideoSource : public MediaStreamSource {
48 public: 41 public:
49 enum { 42 enum {
50 // Default resolution. If no constraints are specified and the delegate 43 // Default resolution. If no constraints are specified and the delegate
51 // support it, this is the resolution that will be used. 44 // support it, this is the resolution that will be used.
52 kDefaultWidth = 640, 45 kDefaultWidth = 640,
53 kDefaultHeight = 480, 46 kDefaultHeight = 480,
54 47
55 kDefaultFrameRate = 30, 48 kDefaultFrameRate = 30,
56 kUnknownFrameRate = 0, 49 kUnknownFrameRate = 0,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 86
94 protected: 87 protected:
95 void DoStopSource() override; 88 void DoStopSource() override;
96 89
97 // Sets ready state and notifies the ready state to all registered tracks. 90 // Sets ready state and notifies the ready state to all registered tracks.
98 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); 91 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state);
99 92
100 // Sets muted state and notifies it to all registered tracks. 93 // Sets muted state and notifies it to all registered tracks.
101 virtual void SetMutedState(bool state); 94 virtual void SetMutedState(bool state);
102 95
103 // An implementation must fetch the formats that can currently be used by
104 // the source and call OnSupportedFormats when done.
105 // |max_requested_height| and |max_requested_width| is the max height and
106 // width set as a mandatory constraint if set when calling
107 // MediaStreamVideoSource::AddTrack. If max height and max width is not set
108 // |max_requested_height| and |max_requested_width| are 0.
109 // TODO(guidou): Remove when the standard constraints code stabilizes.
110 // http://crbug.com/706408
111 virtual void GetCurrentSupportedFormats(
112 int max_requested_width,
113 int max_requested_height,
114 double max_requested_frame_rate,
115 const VideoCaptureDeviceFormatsCB& callback) = 0;
116
117 // TODO(guidou): Rename to GetCurrentFormat. http://crbug.com/706804 96 // TODO(guidou): Rename to GetCurrentFormat. http://crbug.com/706804
118 virtual base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl() 97 virtual base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl()
119 const; 98 const;
120 99
121 // An implementation must start capturing frames using the requested 100 // An implementation must start capturing frames using the requested
122 // |format|. The fulfilled |constraints| are provided as additional context, 101 // |format|. The fulfilled |constraints| are provided as additional context,
123 // and may be used to modify the behavior of the source. When the source has 102 // and may be used to modify the behavior of the source. When the source has
124 // started or the source failed to start OnStartDone must be called. An 103 // started or the source failed to start OnStartDone must be called. An
125 // implementation must call |frame_callback| on the IO thread with the 104 // implementation must call |frame_callback| on the IO thread with the
126 // captured frames. 105 // captured frames.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 181
203 // NOTE: Weak pointers must be invalidated before all other member variables. 182 // NOTE: Weak pointers must be invalidated before all other member variables.
204 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; 183 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_;
205 184
206 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); 185 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource);
207 }; 186 };
208 187
209 } // namespace content 188 } // namespace content
210 189
211 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ 190 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698