OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/webrtc_connection_to_host.h" | 5 #include "remoting/protocol/webrtc_connection_to_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "jingle/glue/thread_wrapper.h" | 9 #include "jingle/glue/thread_wrapper.h" |
10 #include "remoting/protocol/client_control_dispatcher.h" | 10 #include "remoting/protocol/client_control_dispatcher.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 CloseChannels(); | 117 CloseChannels(); |
118 SetState(FAILED, error); | 118 SetState(FAILED, error); |
119 } | 119 } |
120 | 120 |
121 void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamAdded( | 121 void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamAdded( |
122 scoped_refptr<webrtc::MediaStreamInterface> stream) { | 122 scoped_refptr<webrtc::MediaStreamInterface> stream) { |
123 if (video_adapter_) { | 123 if (video_adapter_) { |
124 LOG(WARNING) | 124 LOG(WARNING) |
125 << "Received multiple media streams. Ignoring all except the last one."; | 125 << "Received multiple media streams. Ignoring all except the last one."; |
126 } | 126 } |
127 video_adapter_.reset(new WebrtcVideoRendererAdapter( | 127 video_adapter_.reset(new WebrtcVideoRendererAdapter(stream, video_renderer_)); |
128 stream, video_renderer_->GetFrameConsumer())); | |
129 } | 128 } |
130 | 129 |
131 void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamRemoved( | 130 void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamRemoved( |
132 scoped_refptr<webrtc::MediaStreamInterface> stream) { | 131 scoped_refptr<webrtc::MediaStreamInterface> stream) { |
133 if (video_adapter_ && video_adapter_->label() == stream->label()) | 132 if (video_adapter_ && video_adapter_->label() == stream->label()) |
134 video_adapter_.reset(); | 133 video_adapter_.reset(); |
135 } | 134 } |
136 | 135 |
137 void WebrtcConnectionToHost::OnChannelInitialized( | 136 void WebrtcConnectionToHost::OnChannelInitialized( |
138 ChannelDispatcherBase* channel_dispatcher) { | 137 ChannelDispatcherBase* channel_dispatcher) { |
(...skipping 29 matching lines...) Expand all Loading... |
168 | 167 |
169 if (state != state_) { | 168 if (state != state_) { |
170 state_ = state; | 169 state_ = state; |
171 error_ = error; | 170 error_ = error; |
172 event_callback_->OnConnectionState(state_, error_); | 171 event_callback_->OnConnectionState(state_, error_); |
173 } | 172 } |
174 } | 173 } |
175 | 174 |
176 } // namespace protocol | 175 } // namespace protocol |
177 } // namespace remoting | 176 } // namespace remoting |
OLD | NEW |