OLD | NEW |
---|---|
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 if (!provider_) { | 79 if (!provider_) { |
80 return; | 80 return; |
81 } | 81 } |
82 provider_->SetAudioPlayout(ssrc_, track_->enabled()); | 82 provider_->SetAudioPlayout(ssrc_, track_->enabled()); |
83 } | 83 } |
84 | 84 |
85 VideoRtpReceiver::VideoRtpReceiver(VideoTrackInterface* track, | 85 VideoRtpReceiver::VideoRtpReceiver(VideoTrackInterface* track, |
86 uint32_t ssrc, | 86 uint32_t ssrc, |
87 VideoProviderInterface* provider) | 87 VideoProviderInterface* provider) |
88 : 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()); | 89 provider_->SetVideoPlayout(ssrc_, true, track_->GetSink()); |
pthatcher1
2016/02/03 16:24:29
As mentioned in the other CL, being able to just p
| |
90 provider_->SetVideoPlayout(ssrc_, true, track_->GetSource()->FrameInput()); | |
91 } | 90 } |
92 | 91 |
93 VideoRtpReceiver::~VideoRtpReceiver() { | 92 VideoRtpReceiver::~VideoRtpReceiver() { |
94 // Since cricket::VideoRenderer is not reference counted, | 93 // Since cricket::VideoRenderer is not reference counted, |
95 // we need to remove it from the provider before we are deleted. | 94 // we need to remove it from the provider before we are deleted. |
96 Stop(); | 95 Stop(); |
97 } | 96 } |
98 | 97 |
99 void VideoRtpReceiver::Stop() { | 98 void VideoRtpReceiver::Stop() { |
100 // TODO(deadbeef): Need to do more here to fully stop receiving packets. | 99 // TODO(deadbeef): Need to do more here to fully stop receiving packets. |
101 if (!provider_) { | 100 if (!provider_) { |
102 return; | 101 return; |
103 } | 102 } |
104 provider_->SetVideoPlayout(ssrc_, false, nullptr); | 103 provider_->SetVideoPlayout(ssrc_, false, nullptr); |
105 provider_ = nullptr; | 104 provider_ = nullptr; |
106 } | 105 } |
107 | 106 |
108 } // namespace webrtc | 107 } // namespace webrtc |
OLD | NEW |