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

Side by Side Diff: talk/app/webrtc/rtpreceiver.cc

Issue 1522903002: Add a 'remote' property to MediaSourceInterface. Also adding an implementation to the relevant sour… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years 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 | « talk/app/webrtc/remoteaudiotrack.cc ('k') | talk/app/webrtc/rtpsender.cc » ('j') | 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 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 21 matching lines...) Expand all
32 namespace webrtc { 32 namespace webrtc {
33 33
34 AudioRtpReceiver::AudioRtpReceiver(AudioTrackInterface* track, 34 AudioRtpReceiver::AudioRtpReceiver(AudioTrackInterface* track,
35 uint32_t ssrc, 35 uint32_t ssrc,
36 AudioProviderInterface* provider) 36 AudioProviderInterface* provider)
37 : id_(track->id()), 37 : id_(track->id()),
38 track_(track), 38 track_(track),
39 ssrc_(ssrc), 39 ssrc_(ssrc),
40 provider_(provider), 40 provider_(provider),
41 cached_track_enabled_(track->enabled()) { 41 cached_track_enabled_(track->enabled()) {
42 RTC_DCHECK(track_->GetSource()->remote());
42 track_->RegisterObserver(this); 43 track_->RegisterObserver(this);
43 track_->GetSource()->RegisterAudioObserver(this); 44 track_->GetSource()->RegisterAudioObserver(this);
44 Reconfigure(); 45 Reconfigure();
45 } 46 }
46 47
47 AudioRtpReceiver::~AudioRtpReceiver() { 48 AudioRtpReceiver::~AudioRtpReceiver() {
48 track_->GetSource()->UnregisterAudioObserver(this); 49 track_->GetSource()->UnregisterAudioObserver(this);
49 track_->UnregisterObserver(this); 50 track_->UnregisterObserver(this);
50 Stop(); 51 Stop();
51 } 52 }
(...skipping 26 matching lines...) Expand all
78 if (!provider_) { 79 if (!provider_) {
79 return; 80 return;
80 } 81 }
81 provider_->SetAudioPlayout(ssrc_, track_->enabled()); 82 provider_->SetAudioPlayout(ssrc_, track_->enabled());
82 } 83 }
83 84
84 VideoRtpReceiver::VideoRtpReceiver(VideoTrackInterface* track, 85 VideoRtpReceiver::VideoRtpReceiver(VideoTrackInterface* track,
85 uint32_t ssrc, 86 uint32_t ssrc,
86 VideoProviderInterface* provider) 87 VideoProviderInterface* provider)
87 : id_(track->id()), track_(track), ssrc_(ssrc), provider_(provider) { 88 : id_(track->id()), track_(track), ssrc_(ssrc), provider_(provider) {
89 RTC_DCHECK(track_->GetSource()->remote());
88 provider_->SetVideoPlayout(ssrc_, true, track_->GetSource()->FrameInput()); 90 provider_->SetVideoPlayout(ssrc_, true, track_->GetSource()->FrameInput());
89 } 91 }
90 92
91 VideoRtpReceiver::~VideoRtpReceiver() { 93 VideoRtpReceiver::~VideoRtpReceiver() {
92 // Since cricket::VideoRenderer is not reference counted, 94 // Since cricket::VideoRenderer is not reference counted,
93 // we need to remove it from the provider before we are deleted. 95 // we need to remove it from the provider before we are deleted.
94 Stop(); 96 Stop();
95 } 97 }
96 98
97 void VideoRtpReceiver::Stop() { 99 void VideoRtpReceiver::Stop() {
98 // TODO(deadbeef): Need to do more here to fully stop receiving packets. 100 // TODO(deadbeef): Need to do more here to fully stop receiving packets.
99 if (!provider_) { 101 if (!provider_) {
100 return; 102 return;
101 } 103 }
102 provider_->SetVideoPlayout(ssrc_, false, nullptr); 104 provider_->SetVideoPlayout(ssrc_, false, nullptr);
103 provider_ = nullptr; 105 provider_ = nullptr;
104 } 106 }
105 107
106 } // namespace webrtc 108 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/remoteaudiotrack.cc ('k') | talk/app/webrtc/rtpsender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698