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

Side by Side Diff: webrtc/api/rtpreceiver.cc

Issue 1861633002: Extended proxy abstraction, to call certain methods to the worker thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 uint32_t ssrc, 78 uint32_t ssrc,
79 VideoProviderInterface* provider) 79 VideoProviderInterface* provider)
80 : id_(track_id), 80 : id_(track_id),
81 ssrc_(ssrc), 81 ssrc_(ssrc),
82 provider_(provider), 82 provider_(provider),
83 source_(new RefCountedObject<VideoTrackSource>(&broadcaster_, 83 source_(new RefCountedObject<VideoTrackSource>(&broadcaster_,
84 worker_thread, 84 worker_thread,
85 true /* remote */)), 85 true /* remote */)),
86 track_(VideoTrackProxy::Create( 86 track_(VideoTrackProxy::Create(
87 rtc::Thread::Current(), 87 rtc::Thread::Current(),
88 worker_thread,
88 VideoTrack::Create(track_id, source_.get()))) { 89 VideoTrack::Create(track_id, source_.get()))) {
89 source_->SetState(MediaSourceInterface::kLive); 90 source_->SetState(MediaSourceInterface::kLive);
90 provider_->SetVideoPlayout(ssrc_, true, &broadcaster_); 91 provider_->SetVideoPlayout(ssrc_, true, &broadcaster_);
91 stream->AddTrack(track_); 92 stream->AddTrack(track_);
92 } 93 }
93 94
94 VideoRtpReceiver::~VideoRtpReceiver() { 95 VideoRtpReceiver::~VideoRtpReceiver() {
95 // Since cricket::VideoRenderer is not reference counted, 96 // Since cricket::VideoRenderer is not reference counted,
96 // we need to remove it from the provider before we are deleted. 97 // we need to remove it from the provider before we are deleted.
97 Stop(); 98 Stop();
98 } 99 }
99 100
100 void VideoRtpReceiver::Stop() { 101 void VideoRtpReceiver::Stop() {
101 // TODO(deadbeef): Need to do more here to fully stop receiving packets. 102 // TODO(deadbeef): Need to do more here to fully stop receiving packets.
102 if (!provider_) { 103 if (!provider_) {
103 return; 104 return;
104 } 105 }
105 source_->SetState(MediaSourceInterface::kEnded); 106 source_->SetState(MediaSourceInterface::kEnded);
106 source_->OnSourceDestroyed(); 107 source_->OnSourceDestroyed();
107 provider_->SetVideoPlayout(ssrc_, false, nullptr); 108 provider_->SetVideoPlayout(ssrc_, false, nullptr);
108 provider_ = nullptr; 109 provider_ = nullptr;
109 } 110 }
110 111
111 } // namespace webrtc 112 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698