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

Side by Side Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 1124263004: New resolution change policies for desktop and tab capture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from mcasas. Created 5 years, 7 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 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 const VideoCaptureDeviceFormatsCB& callback) { 132 const VideoCaptureDeviceFormatsCB& callback) {
133 DCHECK(CalledOnValidThread()); 133 DCHECK(CalledOnValidThread());
134 media::VideoCaptureFormats formats; 134 media::VideoCaptureFormats formats;
135 // Since the remote end is free to change the resolution at any point in time 135 // Since the remote end is free to change the resolution at any point in time
136 // the supported formats are unknown. 136 // the supported formats are unknown.
137 callback.Run(formats); 137 callback.Run(formats);
138 } 138 }
139 139
140 void MediaStreamRemoteVideoSource::StartSourceImpl( 140 void MediaStreamRemoteVideoSource::StartSourceImpl(
141 const media::VideoCaptureFormat& format, 141 const media::VideoCaptureFormat& format,
142 const blink::WebMediaConstraints& constraints,
142 const VideoCaptureDeliverFrameCB& frame_callback) { 143 const VideoCaptureDeliverFrameCB& frame_callback) {
143 DCHECK(CalledOnValidThread()); 144 DCHECK(CalledOnValidThread());
144 DCHECK(!delegate_.get()); 145 DCHECK(!delegate_.get());
145 delegate_ = new RemoteVideoSourceDelegate(io_message_loop(), frame_callback); 146 delegate_ = new RemoteVideoSourceDelegate(io_message_loop(), frame_callback);
146 scoped_refptr<webrtc::VideoTrackInterface> video_track( 147 scoped_refptr<webrtc::VideoTrackInterface> video_track(
147 static_cast<webrtc::VideoTrackInterface*>(observer_->track().get())); 148 static_cast<webrtc::VideoTrackInterface*>(observer_->track().get()));
148 video_track->AddRenderer(delegate_.get()); 149 video_track->AddRenderer(delegate_.get());
149 OnStartDone(MEDIA_DEVICE_OK); 150 OnStartDone(MEDIA_DEVICE_OK);
150 } 151 }
151 152
(...skipping 24 matching lines...) Expand all
176 case webrtc::MediaStreamTrackInterface::kEnded: 177 case webrtc::MediaStreamTrackInterface::kEnded:
177 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); 178 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded);
178 break; 179 break;
179 default: 180 default:
180 NOTREACHED(); 181 NOTREACHED();
181 break; 182 break;
182 } 183 }
183 } 184 }
184 185
185 } // namespace content 186 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698