| 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 #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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 MediaStreamRemoteVideoSource::~MediaStreamRemoteVideoSource() { | 179 MediaStreamRemoteVideoSource::~MediaStreamRemoteVideoSource() { |
| 180 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 180 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 181 DCHECK(!observer_); | 181 DCHECK(!observer_); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void MediaStreamRemoteVideoSource::OnSourceTerminated() { | 184 void MediaStreamRemoteVideoSource::OnSourceTerminated() { |
| 185 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 185 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 186 StopSourceImpl(); | 186 StopSourceImpl(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void MediaStreamRemoteVideoSource::GetCurrentSupportedFormats( | |
| 190 int max_requested_width, | |
| 191 int max_requested_height, | |
| 192 double max_requested_frame_rate, | |
| 193 const VideoCaptureDeviceFormatsCB& callback) { | |
| 194 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | |
| 195 media::VideoCaptureFormats formats; | |
| 196 // Since the remote end is free to change the resolution at any point in time | |
| 197 // the supported formats are unknown. | |
| 198 callback.Run(formats); | |
| 199 } | |
| 200 | |
| 201 void MediaStreamRemoteVideoSource::StartSourceImpl( | 189 void MediaStreamRemoteVideoSource::StartSourceImpl( |
| 202 const media::VideoCaptureFormat& format, | 190 const media::VideoCaptureFormat& format, |
| 203 const blink::WebMediaConstraints& constraints, | 191 const blink::WebMediaConstraints& constraints, |
| 204 const VideoCaptureDeliverFrameCB& frame_callback) { | 192 const VideoCaptureDeliverFrameCB& frame_callback) { |
| 205 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 193 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 206 DCHECK(!delegate_.get()); | 194 DCHECK(!delegate_.get()); |
| 207 delegate_ = new RemoteVideoSourceDelegate(io_task_runner(), frame_callback); | 195 delegate_ = new RemoteVideoSourceDelegate(io_task_runner(), frame_callback); |
| 208 scoped_refptr<webrtc::VideoTrackInterface> video_track( | 196 scoped_refptr<webrtc::VideoTrackInterface> video_track( |
| 209 static_cast<webrtc::VideoTrackInterface*>(observer_->track().get())); | 197 static_cast<webrtc::VideoTrackInterface*>(observer_->track().get())); |
| 210 video_track->AddOrUpdateSink(delegate_.get(), rtc::VideoSinkWants()); | 198 video_track->AddOrUpdateSink(delegate_.get(), rtc::VideoSinkWants()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 case webrtc::MediaStreamTrackInterface::kEnded: | 230 case webrtc::MediaStreamTrackInterface::kEnded: |
| 243 SetReadyState(blink::WebMediaStreamSource::kReadyStateEnded); | 231 SetReadyState(blink::WebMediaStreamSource::kReadyStateEnded); |
| 244 break; | 232 break; |
| 245 default: | 233 default: |
| 246 NOTREACHED(); | 234 NOTREACHED(); |
| 247 break; | 235 break; |
| 248 } | 236 } |
| 249 } | 237 } |
| 250 | 238 |
| 251 } // namespace content | 239 } // namespace content |
| OLD | NEW |