Index: webrtc/call/rtp_demuxer.h |
diff --git a/webrtc/call/rtp_demuxer.h b/webrtc/call/rtp_demuxer.h |
index 6a4370d73163573246b61f2b1179c12af1e2a4f0..c01d500a014bd24a8d91df816a3e0daf016f7a07 100644 |
--- a/webrtc/call/rtp_demuxer.h |
+++ b/webrtc/call/rtp_demuxer.h |
@@ -14,6 +14,9 @@ |
#include <map> |
#include <set> |
#include <string> |
+#include <vector> |
+ |
+#include "webrtc/call/rsid_resolution_observer.h" |
namespace webrtc { |
@@ -41,9 +44,18 @@ class RtpDemuxer { |
// Null pointer is not allowed. |
bool RemoveSink(const RtpPacketSinkInterface* sink); |
- // Returns true if at least one matching sink was found, otherwise false. |
+ // Returns true if at least one matching sink was found. |
bool OnRtpPacket(const RtpPacketReceived& packet); |
+ // Allows other objects to be notified when RSID-SSRC associations are |
+ // resolved by this object. |
+ // Notifications received from outside are *not* propagated. (The ability |
+ // to receive such notifications will be added later.) |
+ void RegisterRsidResolutionObserver(RsidResolutionObserver* observer); |
+ |
+ // Undo a previous RegisterRsidResolutionObserver(). |
+ void DeregisterRsidResolutionObserver(const RsidResolutionObserver* observer); |
+ |
private: |
// Records a sink<->SSRC association. This can happen by explicit |
// configuration by AddSink(ssrc...), or by inferred configuration from an |
@@ -51,9 +63,14 @@ class RtpDemuxer { |
// packet reception. |
void RecordSsrcToSinkAssociation(uint32_t ssrc, RtpPacketSinkInterface* sink); |
- // When a new packet arrives, we attempt to resolve extra associations, |
- // such as which RSIDs are associated with which SSRCs. |
- void FindSsrcAssociations(const RtpPacketReceived& packet); |
+ // When a new packet arrives, we attempt to resolve extra associations. |
+ void ResolveAssociations(const RtpPacketReceived& packet); |
+ |
+ // Find the associations of RSID to SSRCs. |
+ void ResolveRsidToSsrcAssociations(const RtpPacketReceived& packet); |
+ |
+ // Notify observers of the resolution of an RSID to an SSRC. |
+ void NotifyObserversOfRsidResolution(const std::string& rsid, uint32_t ssrc); |
// This records the association SSRCs to sinks. Other associations, such |
// as by RSID, also end up here once the RSID, etc., is resolved to an SSRC. |
@@ -73,6 +90,10 @@ class RtpDemuxer { |
// Avoid an attack that would create excessive logging. |
bool logged_max_processed_ssrcs_exceeded_ = false; |
+ |
+ // Observers which will be notified when an RSID association to an SSRC is |
+ // resolved by this object. |
+ std::vector<RsidResolutionObserver*> rsid_resolution_observers_; |
}; |
} // namespace webrtc |