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

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

Issue 2308543002: Remove source->Stop() call from chromoting WebRTC video stream. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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_stream.h" 5 #include "remoting/protocol/webrtc_video_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 std::unique_ptr<VideoPacket> frame; 62 std::unique_ptr<VideoPacket> frame;
63 std::unique_ptr<FrameTimestamps> timestamps; 63 std::unique_ptr<FrameTimestamps> timestamps;
64 }; 64 };
65 65
66 WebrtcVideoStream::WebrtcVideoStream() 66 WebrtcVideoStream::WebrtcVideoStream()
67 : video_stats_dispatcher_(kStreamLabel), weak_factory_(this) {} 67 : video_stats_dispatcher_(kStreamLabel), weak_factory_(this) {}
68 68
69 WebrtcVideoStream::~WebrtcVideoStream() { 69 WebrtcVideoStream::~WebrtcVideoStream() {
70 if (stream_) { 70 if (stream_) {
71 for (const auto& track : stream_->GetVideoTracks()) { 71 for (const auto& track : stream_->GetVideoTracks()) {
72 track->GetSource()->Stop();
73 stream_->RemoveTrack(track.get()); 72 stream_->RemoveTrack(track.get());
74 } 73 }
75 peer_connection_->RemoveStream(stream_.get()); 74 peer_connection_->RemoveStream(stream_.get());
76 } 75 }
77 encode_task_runner_->DeleteSoon(FROM_HERE, encoder_.release()); 76 encode_task_runner_->DeleteSoon(FROM_HERE, encoder_.release());
78 } 77 }
79 78
80 bool WebrtcVideoStream::Start( 79 bool WebrtcVideoStream::Start(
81 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer, 80 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer,
82 WebrtcTransport* webrtc_transport, 81 WebrtcTransport* webrtc_transport,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 float encoded_bits = frame_size * 8.0; 364 float encoded_bits = frame_size * 8.0;
366 uint32_t next_sched_ms = std::max( 365 uint32_t next_sched_ms = std::max(
367 33, std::min(static_cast<int>(encoded_bits / target_bitrate_kbps_), 200)); 366 33, std::min(static_cast<int>(encoded_bits / target_bitrate_kbps_), 200));
368 capture_timer_.Start(FROM_HERE, 367 capture_timer_.Start(FROM_HERE,
369 base::TimeDelta::FromMilliseconds(next_sched_ms), this, 368 base::TimeDelta::FromMilliseconds(next_sched_ms), this,
370 &WebrtcVideoStream::CaptureNextFrame); 369 &WebrtcVideoStream::CaptureNextFrame);
371 } 370 }
372 371
373 } // namespace protocol 372 } // namespace protocol
374 } // namespace remoting 373 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698