| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "content/renderer/media/native_handle_impl.h" | 9 #include "content/renderer/media/native_handle_impl.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 void MediaStreamRemoteVideoSource::StartSourceImpl( | 42 void MediaStreamRemoteVideoSource::StartSourceImpl( |
| 43 const media::VideoCaptureParams& params) { | 43 const media::VideoCaptureParams& params) { |
| 44 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 44 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 45 OnStartDone(true); | 45 OnStartDone(true); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void MediaStreamRemoteVideoSource::StopSourceImpl() { | 48 void MediaStreamRemoteVideoSource::StopSourceImpl() { |
| 49 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 49 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 50 remote_track_->RemoveRenderer(this); | 50 if (state() != MediaStreamVideoSource::ENDED) { |
| 51 remote_track_->UnregisterObserver(this); | 51 remote_track_->RemoveRenderer(this); |
| 52 remote_track_->UnregisterObserver(this); |
| 53 } |
| 52 } | 54 } |
| 53 | 55 |
| 54 webrtc::VideoSourceInterface* MediaStreamRemoteVideoSource::GetAdapter() { | 56 webrtc::VideoSourceInterface* MediaStreamRemoteVideoSource::GetAdapter() { |
| 55 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 57 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 56 return remote_track_->GetSource(); | 58 return remote_track_->GetSource(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void MediaStreamRemoteVideoSource::SetSize(int width, int height) { | 61 void MediaStreamRemoteVideoSource::SetSize(int width, int height) { |
| 60 } | 62 } |
| 61 | 63 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 150 } |
| 149 | 151 |
| 150 void MediaStreamRemoteVideoSource::DoRenderFrameOnMainThread( | 152 void MediaStreamRemoteVideoSource::DoRenderFrameOnMainThread( |
| 151 scoped_refptr<media::VideoFrame> video_frame) { | 153 scoped_refptr<media::VideoFrame> video_frame) { |
| 152 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 154 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 153 if (state() == STARTED) | 155 if (state() == STARTED) |
| 154 DeliverVideoFrame(video_frame); | 156 DeliverVideoFrame(video_frame); |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace content | 159 } // namespace content |
| OLD | NEW |