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

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

Issue 366243003: VideoTrackAdapter: Add passing frames monitor, notify MSVCS -> MSVTrack(s) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 static const int kDefaultWidth; 81 static const int kDefaultWidth;
82 static const int kDefaultHeight; 82 static const int kDefaultHeight;
83 static const int kDefaultFrameRate; 83 static const int kDefaultFrameRate;
84 84
85 protected: 85 protected:
86 virtual void DoStopSource() OVERRIDE; 86 virtual void DoStopSource() OVERRIDE;
87 87
88 // Sets ready state and notifies the ready state to all registered tracks. 88 // Sets ready state and notifies the ready state to all registered tracks.
89 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); 89 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state);
90 90
91 // Sets muted state and notifies it to all registered tracks.
92 virtual void SetMutedState(bool state);
93
91 // An implementation must fetch the formats that can currently be used by 94 // An implementation must fetch the formats that can currently be used by
92 // the source and call OnSupportedFormats when done. 95 // the source and call OnSupportedFormats when done.
93 // |max_requested_height| and |max_requested_width| is the max height and 96 // |max_requested_height| and |max_requested_width| is the max height and
94 // width set as a mandatory constraint if set when calling 97 // width set as a mandatory constraint if set when calling
95 // MediaStreamVideoSource::AddTrack. If max height and max width is not set 98 // MediaStreamVideoSource::AddTrack. If max height and max width is not set
96 // |max_requested_height| and |max_requested_width| are 0. 99 // |max_requested_height| and |max_requested_width| are 0.
97 virtual void GetCurrentSupportedFormats( 100 virtual void GetCurrentSupportedFormats(
98 int max_requested_width, 101 int max_requested_width,
99 int max_requested_height, 102 int max_requested_height,
100 const VideoCaptureDeviceFormatsCB& callback) = 0; 103 const VideoCaptureDeviceFormatsCB& callback) = 0;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Trigger all cached callbacks from AddTrack. AddTrack is successful 140 // Trigger all cached callbacks from AddTrack. AddTrack is successful
138 // if the capture delegate has started and the constraints provided in 141 // if the capture delegate has started and the constraints provided in
139 // AddTrack match the format that was used to start the device. 142 // AddTrack match the format that was used to start the device.
140 // Note that it must be ok to delete the MediaStreamVideoSource object 143 // Note that it must be ok to delete the MediaStreamVideoSource object
141 // in the context of the callback. If gUM fail, the implementation will 144 // in the context of the callback. If gUM fail, the implementation will
142 // simply drop the references to the blink source and track which will lead 145 // simply drop the references to the blink source and track which will lead
143 // to that this object is deleted. 146 // to that this object is deleted.
144 void FinalizeAddTrack(); 147 void FinalizeAddTrack();
145 148
146 State state_; 149 State state_;
150 bool muted_state_;
147 151
148 media::VideoCaptureFormat current_format_; 152 media::VideoCaptureFormat current_format_;
149 153
150 struct RequestedConstraints { 154 struct RequestedConstraints {
151 RequestedConstraints(MediaStreamVideoTrack* track, 155 RequestedConstraints(MediaStreamVideoTrack* track,
152 const VideoCaptureDeliverFrameCB& frame_callback, 156 const VideoCaptureDeliverFrameCB& frame_callback,
153 const blink::WebMediaConstraints& constraints, 157 const blink::WebMediaConstraints& constraints,
154 const ConstraintsCallback& callback); 158 const ConstraintsCallback& callback);
155 ~RequestedConstraints(); 159 ~RequestedConstraints();
156 160
(...skipping 14 matching lines...) Expand all
171 175
172 // NOTE: Weak pointers must be invalidated before all other member variables. 176 // NOTE: Weak pointers must be invalidated before all other member variables.
173 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_; 177 base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_;
174 178
175 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); 179 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource);
176 }; 180 };
177 181
178 } // namespace content 182 } // namespace content
179 183
180 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ 184 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698