summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/transportbridge
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webrtc/transportbridge')
-rw-r--r--dom/media/webrtc/transportbridge/MediaPipelineFilter.cpp34
-rw-r--r--dom/media/webrtc/transportbridge/MediaPipelineFilter.h4
2 files changed, 21 insertions, 17 deletions
diff --git a/dom/media/webrtc/transportbridge/MediaPipelineFilter.cpp b/dom/media/webrtc/transportbridge/MediaPipelineFilter.cpp
index fc1a51dd0d..275e1bf45a 100644
--- a/dom/media/webrtc/transportbridge/MediaPipelineFilter.cpp
+++ b/dom/media/webrtc/transportbridge/MediaPipelineFilter.cpp
@@ -85,23 +85,27 @@ bool MediaPipelineFilter::Filter(const webrtc::RTPHeader& header) {
// Remote SSRC based filtering
//
- if (remote_ssrc_set_.count(header.ssrc)) {
+ if (!remote_ssrc_set_.empty()) {
+ if (remote_ssrc_set_.count(header.ssrc)) {
+ DEBUG_LOG(
+ ("MediaPipelineFilter SSRC: %u matched remote SSRC set."
+ " passing packet",
+ header.ssrc));
+ return true;
+ }
DEBUG_LOG(
- ("MediaPipelineFilter SSRC: %u matched remote SSRC set."
- " passing packet",
- header.ssrc));
- return true;
+ ("MediaPipelineFilter SSRC: %u did not match any of %zu"
+ " remote SSRCS.",
+ header.ssrc, remote_ssrc_set_.size()));
+ return false;
}
- DEBUG_LOG(
- ("MediaPipelineFilter SSRC: %u did not match any of %zu"
- " remote SSRCS.",
- header.ssrc, remote_ssrc_set_.size()));
//
- // PT, payload type, last ditch effort filtering
+ // PT, payload type, last ditch effort filtering. We only try this if we do
+ // not have any ssrcs configured (either by learning them, or negotiation).
//
- if (payload_type_set_.count(header.payloadType)) {
+ if (receive_payload_type_set_.count(header.payloadType)) {
DEBUG_LOG(
("MediaPipelineFilter payload-type: %u matched %zu"
" unique payload type. learning ssrc. passing packet",
@@ -114,7 +118,7 @@ bool MediaPipelineFilter::Filter(const webrtc::RTPHeader& header) {
DEBUG_LOG(
("MediaPipelineFilter payload-type: %u did not match any of %zu"
" unique payload-types.",
- header.payloadType, payload_type_set_.size()));
+ header.payloadType, receive_payload_type_set_.size()));
DEBUG_LOG(
("MediaPipelineFilter packet failed to match any criteria."
" ignoring packet"));
@@ -125,8 +129,8 @@ void MediaPipelineFilter::AddRemoteSSRC(uint32_t ssrc) {
remote_ssrc_set_.insert(ssrc);
}
-void MediaPipelineFilter::AddUniquePT(uint8_t payload_type) {
- payload_type_set_.insert(payload_type);
+void MediaPipelineFilter::AddUniqueReceivePT(uint8_t payload_type) {
+ receive_payload_type_set_.insert(payload_type);
}
void MediaPipelineFilter::Update(const MediaPipelineFilter& filter_update) {
@@ -143,7 +147,7 @@ void MediaPipelineFilter::Update(const MediaPipelineFilter& filter_update) {
mRemoteMid = filter_update.mRemoteMid;
mRemoteMidBindings = filter_update.mRemoteMidBindings;
}
- payload_type_set_ = filter_update.payload_type_set_;
+ receive_payload_type_set_ = filter_update.receive_payload_type_set_;
// Use extmapping from new filter
mExtMap = filter_update.mExtMap;
diff --git a/dom/media/webrtc/transportbridge/MediaPipelineFilter.h b/dom/media/webrtc/transportbridge/MediaPipelineFilter.h
index d6bb7abd43..62d4b63ab8 100644
--- a/dom/media/webrtc/transportbridge/MediaPipelineFilter.h
+++ b/dom/media/webrtc/transportbridge/MediaPipelineFilter.h
@@ -66,7 +66,7 @@ class MediaPipelineFilter {
void SetRemoteMediaStreamId(const Maybe<std::string>& aMid);
// When a payload type id is unique to our media section, add it here.
- void AddUniquePT(uint8_t payload_type);
+ void AddUniqueReceivePT(uint8_t payload_type);
void Update(const MediaPipelineFilter& filter_update);
@@ -76,7 +76,7 @@ class MediaPipelineFilter {
// The number of filters we manage here is quite small, so I am optimizing
// for readability.
std::set<uint32_t> remote_ssrc_set_;
- std::set<uint8_t> payload_type_set_;
+ std::set<uint8_t> receive_payload_type_set_;
Maybe<std::string> mRemoteMid;
std::set<uint32_t> mRemoteMidBindings;
// RID extension can be set by tests and is sticky, the rest of