| 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/webrtc_video_track_adapter.h" | 5 #include "content/renderer/media/webrtc/webrtc_video_track_adapter.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/common/media/media_stream_options.h" | 8 #include "content/common/media/media_stream_options.h" |
| 9 #include "content/renderer/media/media_stream_video_source.h" | 9 #include "content/renderer/media/media_stream_video_source.h" |
| 10 #include "content/renderer/media/media_stream_video_track.h" | 10 #include "content/renderer/media/media_stream_video_track.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 void | 102 void |
| 103 WebRtcVideoTrackAdapter::WebRtcVideoSourceAdapter::OnVideoFrameOnWorkerThread( | 103 WebRtcVideoTrackAdapter::WebRtcVideoSourceAdapter::OnVideoFrameOnWorkerThread( |
| 104 const scoped_refptr<media::VideoFrame>& frame, | 104 const scoped_refptr<media::VideoFrame>& frame, |
| 105 const media::VideoCaptureFormat& format) { | 105 const media::VideoCaptureFormat& format) { |
| 106 DCHECK(libjingle_worker_thread_->BelongsToCurrentThread()); | 106 DCHECK(libjingle_worker_thread_->BelongsToCurrentThread()); |
| 107 capture_adapter_->OnFrameCaptured(frame); | 107 capture_adapter_->OnFrameCaptured(frame); |
| 108 } | 108 } |
| 109 | 109 |
| 110 WebRtcVideoTrackAdapter::WebRtcVideoTrackAdapter( | 110 WebRtcVideoTrackAdapter::WebRtcVideoTrackAdapter( |
| 111 const blink::WebMediaStreamTrack& track, | 111 const blink::WebMediaStreamTrack& track, |
| 112 MediaStreamDependencyFactory* factory) | 112 PeerConnectionDependencyFactory* factory) |
| 113 : web_track_(track) { | 113 : web_track_(track) { |
| 114 const blink::WebMediaConstraints& constraints = | 114 const blink::WebMediaConstraints& constraints = |
| 115 MediaStreamVideoTrack::GetVideoTrack(track)->constraints(); | 115 MediaStreamVideoTrack::GetVideoTrack(track)->constraints(); |
| 116 | 116 |
| 117 bool is_screencast = ConstraintKeyExists( | 117 bool is_screencast = ConstraintKeyExists( |
| 118 constraints, base::UTF8ToUTF16(kMediaStreamSource)); | 118 constraints, base::UTF8ToUTF16(kMediaStreamSource)); |
| 119 WebRtcVideoCapturerAdapter* capture_adapter = | 119 WebRtcVideoCapturerAdapter* capture_adapter = |
| 120 factory->CreateVideoCapturer(is_screencast); | 120 factory->CreateVideoCapturer(is_screencast); |
| 121 | 121 |
| 122 // |video_source| owns |capture_adapter| | 122 // |video_source| owns |capture_adapter| |
| (...skipping 26 matching lines...) Expand all Loading... |
| 149 DVLOG(3) << "WebRtcVideoTrackAdapter dtor()."; | 149 DVLOG(3) << "WebRtcVideoTrackAdapter dtor()."; |
| 150 RemoveFromVideoTrack(this, web_track_); | 150 RemoveFromVideoTrack(this, web_track_); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void WebRtcVideoTrackAdapter::OnEnabledChanged(bool enabled) { | 153 void WebRtcVideoTrackAdapter::OnEnabledChanged(bool enabled) { |
| 154 DCHECK(thread_checker_.CalledOnValidThread()); | 154 DCHECK(thread_checker_.CalledOnValidThread()); |
| 155 video_track_->set_enabled(enabled); | 155 video_track_->set_enabled(enabled); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace content | 158 } // namespace content |
| OLD | NEW |