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

Side by Side Diff: remoting/protocol/webrtc_video_renderer_adapter.cc

Issue 2371323007: Add audio support in WebrtcConnectionToHost, audio unittest (Closed)
Patch Set: more reliable test Created 4 years, 2 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
« no previous file with comments | « remoting/protocol/webrtc_transport.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_video_renderer_adapter.h" 5 #include "remoting/protocol/webrtc_video_renderer_adapter.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 video_tracks[0]->RemoveSink(this); 71 video_tracks[0]->RemoveSink(this);
72 } 72 }
73 73
74 void WebrtcVideoRendererAdapter::SetMediaStream( 74 void WebrtcVideoRendererAdapter::SetMediaStream(
75 scoped_refptr<webrtc::MediaStreamInterface> media_stream) { 75 scoped_refptr<webrtc::MediaStreamInterface> media_stream) {
76 DCHECK_EQ(media_stream->label(), label()); 76 DCHECK_EQ(media_stream->label(), label());
77 77
78 media_stream_ = std::move(media_stream); 78 media_stream_ = std::move(media_stream);
79 79
80 webrtc::VideoTrackVector video_tracks = media_stream_->GetVideoTracks(); 80 webrtc::VideoTrackVector video_tracks = media_stream_->GetVideoTracks();
81 if (video_tracks.empty()) { 81
82 LOG(ERROR) << "Received media stream with no video tracks."; 82 // Caller must verify that the media stream contains video tracks.
83 return; 83 DCHECK(!video_tracks.empty());
84 }
85 84
86 if (video_tracks.size() > 1U) { 85 if (video_tracks.size() > 1U) {
87 LOG(WARNING) << "Received media stream with multiple video tracks."; 86 LOG(WARNING) << "Received media stream with multiple video tracks.";
88 } 87 }
89 88
90 video_tracks[0]->AddOrUpdateSink(this, rtc::VideoSinkWants()); 89 video_tracks[0]->AddOrUpdateSink(this, rtc::VideoSinkWants());
91 } 90 }
92 91
93 void WebrtcVideoRendererAdapter::SetVideoStatsChannel( 92 void WebrtcVideoRendererAdapter::SetVideoStatsChannel(
94 std::unique_ptr<MessagePipe> message_pipe) { 93 std::unique_ptr<MessagePipe> message_pipe) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 frame_stats.client_stats = *client_stats; 240 frame_stats.client_stats = *client_stats;
242 host_stats_queue_.pop_front(); 241 host_stats_queue_.pop_front();
243 FrameStatsConsumer* frame_stats_consumer = 242 FrameStatsConsumer* frame_stats_consumer =
244 video_renderer_->GetFrameStatsConsumer(); 243 video_renderer_->GetFrameStatsConsumer();
245 if (frame_stats_consumer) 244 if (frame_stats_consumer)
246 frame_stats_consumer->OnVideoFrameStats(frame_stats); 245 frame_stats_consumer->OnVideoFrameStats(frame_stats);
247 } 246 }
248 247
249 } // namespace protocol 248 } // namespace protocol
250 } // namespace remoting 249 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_transport.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698