Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 #ifndef WEBRTC_CALL_RTP_DEMUXER_H_ | |
| 11 #define WEBRTC_CALL_RTP_DEMUXER_H_ | |
| 12 | |
| 13 #include <map> | |
| 14 | |
| 15 namespace webrtc { | |
| 16 | |
| 17 class RtpPacketReceived; | |
| 18 | |
| 19 // This class represents a receiver of an already parsed RTP packets. | |
| 20 class RtpPacketSinkInterface { | |
| 21 public: | |
| 22 virtual ~RtpPacketSinkInterface() {} | |
| 23 virtual void OnRtpPacket(const RtpPacketReceived& packet) = 0; | |
| 24 }; | |
| 25 | |
| 26 // This class represents the RTP demuxing, for a single transport. It | |
| 27 // isn't thread aware, leaving responsibility of multithreading issues | |
| 28 // to the user of this class. | |
|
Taylor Brandstetter
2017/05/10 20:59:43
Could you mention in a comment that this should al
nisse-webrtc
2017/05/12 08:50:08
I'm adding a TODO. Have I got this right, that pay
Taylor Brandstetter
2017/05/12 16:36:17
Correct. Though JSEP no longer requires SSRC signa
| |
| 29 class RtpDemuxer { | |
| 30 public: | |
| 31 RtpDemuxer(); | |
| 32 ~RtpDemuxer(); | |
| 33 | |
| 34 // Registers a sink. The same sink can be registered for multiple ssrcs. | |
| 35 void AddSink(uint32_t ssrc, RtpPacketSinkInterface* sink); | |
| 36 // Removes a sink. Returns deletion count (a sink may be registered | |
| 37 // for multiple ssrcs). | |
| 38 size_t RemoveSink(const RtpPacketSinkInterface* sink); | |
| 39 | |
| 40 // Returns true if at least one matching sink was found, otherwise false. | |
| 41 bool OnRtpPacket(const RtpPacketReceived& packet); | |
| 42 | |
| 43 private: | |
| 44 std::multimap<uint32_t, RtpPacketSinkInterface*> sinks_; | |
| 45 }; | |
| 46 | |
| 47 } // namespace webrtc | |
| 48 | |
| 49 #endif // WEBRTC_CALL_RTP_DEMUXER_H_ | |
| OLD | NEW |