OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 vcm_.swap(*vcm); | 40 vcm_.swap(*vcm); |
41 frame_receiver_.swap(*frame_receiver); | 41 frame_receiver_.swap(*frame_receiver); |
42 vcm_->RegisterPacketRequestCallback(this); | 42 vcm_->RegisterPacketRequestCallback(this); |
43 vcm_->RegisterReceiveCallback(frame_receiver_.get()); | 43 vcm_->RegisterReceiveCallback(frame_receiver_.get()); |
44 } | 44 } |
45 | 45 |
46 virtual ~VcmPayloadSink() { factory_->Remove(this); } | 46 virtual ~VcmPayloadSink() { factory_->Remove(this); } |
47 | 47 |
48 // PayloadSinkInterface | 48 // PayloadSinkInterface |
49 int32_t OnReceivedPayloadData(const uint8_t* payload_data, | 49 int32_t OnReceivedPayloadData(const uint8_t* payload_data, |
50 const size_t payload_size, | 50 size_t payload_size, |
51 const WebRtcRTPHeader* rtp_header) override { | 51 const WebRtcRTPHeader* rtp_header) override { |
52 return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header); | 52 return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header); |
53 } | 53 } |
54 | 54 |
55 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override { | 55 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override { |
56 // We currently don't handle FEC. | 56 // We currently don't handle FEC. |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 // VCMPacketRequestCallback | 60 // VCMPacketRequestCallback |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void VcmPayloadSinkFactory::Remove(VcmPayloadSink* sink) { | 194 void VcmPayloadSinkFactory::Remove(VcmPayloadSink* sink) { |
195 assert(sink); | 195 assert(sink); |
196 CriticalSectionScoped cs(crit_sect_.get()); | 196 CriticalSectionScoped cs(crit_sect_.get()); |
197 Sinks::iterator it = std::find(sinks_.begin(), sinks_.end(), sink); | 197 Sinks::iterator it = std::find(sinks_.begin(), sinks_.end(), sink); |
198 assert(it != sinks_.end()); | 198 assert(it != sinks_.end()); |
199 sinks_.erase(it); | 199 sinks_.erase(it); |
200 } | 200 } |
201 | 201 |
202 } // namespace rtpplayer | 202 } // namespace rtpplayer |
203 } // namespace webrtc | 203 } // namespace webrtc |
OLD | NEW |