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

Side by Side Diff: webrtc/video/video_receive_stream.cc

Issue 2146883002: Avoid race in VideoReceiveStream shutdown (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Avoid race in VideoReceiveStream shutdown Created 4 years, 5 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 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // Register the channel to receive stats updates. 260 // Register the channel to receive stats updates.
261 call_stats_->RegisterStatsObserver(video_stream_decoder_.get()); 261 call_stats_->RegisterStatsObserver(video_stream_decoder_.get());
262 // Start the decode thread 262 // Start the decode thread
263 decode_thread_.Start(); 263 decode_thread_.Start();
264 decode_thread_.SetPriority(rtc::kHighestPriority); 264 decode_thread_.SetPriority(rtc::kHighestPriority);
265 rtp_stream_receiver_.StartReceive(); 265 rtp_stream_receiver_.StartReceive();
266 } 266 }
267 267
268 void VideoReceiveStream::Stop() { 268 void VideoReceiveStream::Stop() {
269 rtp_stream_receiver_.StopReceive(); 269 rtp_stream_receiver_.StopReceive();
270 decode_thread_.Stop();
pbos-webrtc 2016/07/13 13:06:35 That's harder than this. TriggerDecoderShutdown()
sprang_webrtc 2016/07/13 16:17:06 You're right. I've added a comment to that effect
270 video_receiver_.TriggerDecoderShutdown(); 271 video_receiver_.TriggerDecoderShutdown();
271 decode_thread_.Stop();
272 call_stats_->DeregisterStatsObserver(video_stream_decoder_.get()); 272 call_stats_->DeregisterStatsObserver(video_stream_decoder_.get());
273 video_stream_decoder_.reset(); 273 video_stream_decoder_.reset();
274 incoming_video_stream_.reset(); 274 incoming_video_stream_.reset();
275 transport_adapter_.Disable(); 275 transport_adapter_.Disable();
276 } 276 }
277 277
278 void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine, 278 void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine,
279 int audio_channel_id) { 279 int audio_channel_id) {
280 if (voice_engine && audio_channel_id != -1) { 280 if (voice_engine && audio_channel_id != -1) {
281 VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); 281 VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 const std::vector<uint16_t>& sequence_numbers) { 359 const std::vector<uint16_t>& sequence_numbers) {
360 rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers); 360 rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers);
361 } 361 }
362 362
363 void VideoReceiveStream::RequestKeyFrame() { 363 void VideoReceiveStream::RequestKeyFrame() {
364 rtp_stream_receiver_.RequestKeyFrame(); 364 rtp_stream_receiver_.RequestKeyFrame();
365 } 365 }
366 366
367 } // namespace internal 367 } // namespace internal
368 } // namespace webrtc 368 } // namespace webrtc
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