diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index a9fb3b7..afb819f 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -1249,7 +1249,10 @@
   }
 }
 
-rtc::scoped_refptr<RTCStatsReport> CreateReportFilteredBySelector(
+}  // namespace
+
+rtc::scoped_refptr<RTCStatsReport>
+RTCStatsCollector::CreateReportFilteredBySelector(
     bool filter_by_sender_selector,
     rtc::scoped_refptr<const RTCStatsReport> report,
     rtc::scoped_refptr<RtpSenderInternal> sender_selector,
@@ -1258,40 +1261,40 @@
   if (filter_by_sender_selector) {
     // Filter mode: RTCStatsCollector::RequestInfo::kSenderSelector
     if (sender_selector) {
-      // Find outbound-rtp(s) of the sender, i.e. the outbound-rtp(s) that
-      // reference the sender stats.
-      // Because we do not implement sender stats, we look at outbound-rtp(s)
-      // that reference the track attachment stats for the sender instead.
-      std::string track_id =
-          DEPRECATED_RTCMediaStreamTrackStatsIDFromDirectionAndAttachment(
-              kDirectionOutbound, sender_selector->AttachmentId());
-      for (const auto& stats : *report) {
-        if (stats.type() != RTCOutboundRTPStreamStats::kType)
-          continue;
-        const auto& outbound_rtp = stats.cast_to<RTCOutboundRTPStreamStats>();
-        if (outbound_rtp.track_id.is_defined() &&
-            *outbound_rtp.track_id == track_id) {
-          rtpstream_ids.push_back(outbound_rtp.id());
+      // Find outbound-rtp(s) of the sender using ssrc lookup.
+      auto encodings = sender_selector->GetParametersInternal().encodings;
+      for (const auto* outbound_rtp :
+           report->GetStatsOfType<RTCOutboundRTPStreamStats>()) {
+        RTC_DCHECK(outbound_rtp->ssrc.is_defined());
+        auto it = std::find_if(
+            encodings.begin(), encodings.end(),
+            [ssrc =
+                 *outbound_rtp->ssrc](const RtpEncodingParameters& encoding) {
+              return encoding.ssrc.has_value() && encoding.ssrc.value() == ssrc;
+            });
+        if (it != encodings.end()) {
+          rtpstream_ids.push_back(outbound_rtp->id());
         }
       }
     }
   } else {
     // Filter mode: RTCStatsCollector::RequestInfo::kReceiverSelector
     if (receiver_selector) {
-      // Find inbound-rtp(s) of the receiver, i.e. the inbound-rtp(s) that
-      // reference the receiver stats.
-      // Because we do not implement receiver stats, we look at inbound-rtp(s)
-      // that reference the track attachment stats for the receiver instead.
-      std::string track_id =
-          DEPRECATED_RTCMediaStreamTrackStatsIDFromDirectionAndAttachment(
-              kDirectionInbound, receiver_selector->AttachmentId());
-      for (const auto& stats : *report) {
-        if (stats.type() != RTCInboundRTPStreamStats::kType)
-          continue;
-        const auto& inbound_rtp = stats.cast_to<RTCInboundRTPStreamStats>();
-        if (inbound_rtp.track_id.is_defined() &&
-            *inbound_rtp.track_id == track_id) {
-          rtpstream_ids.push_back(inbound_rtp.id());
+      // Find the inbound-rtp of the receiver using ssrc lookup.
+      absl::optional<uint32_t> ssrc;
+      worker_thread_->BlockingCall([&] {
+        auto encodings = receiver_selector->GetParameters().encodings;
+        if (!encodings.empty()) {
+          ssrc = encodings[0].ssrc;
+        }
+      });
+      if (ssrc.has_value()) {
+        for (const auto* inbound_rtp :
+             report->GetStatsOfType<RTCInboundRTPStreamStats>()) {
+          RTC_DCHECK(inbound_rtp->ssrc.is_defined());
+          if (*inbound_rtp->ssrc == *ssrc) {
+            rtpstream_ids.push_back(inbound_rtp->id());
+          }
         }
       }
     }
@@ -1301,8 +1304,6 @@
   return TakeReferencedStats(report->Copy(), rtpstream_ids);
 }
 
-}  // namespace
-
 RTCStatsCollector::CertificateStatsPair
 RTCStatsCollector::CertificateStatsPair::Copy() const {
   CertificateStatsPair copy;
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h
index 9117528..0f1cab1 100644
--- a/pc/rtc_stats_collector.h
+++ b/pc/rtc_stats_collector.h
@@ -244,6 +244,12 @@
   // This is a NO-OP if `network_report_` is null.
   void MergeNetworkReport_s();
 
+  rtc::scoped_refptr<RTCStatsReport> CreateReportFilteredBySelector(
+      bool filter_by_sender_selector,
+      rtc::scoped_refptr<const RTCStatsReport> report,
+      rtc::scoped_refptr<RtpSenderInternal> sender_selector,
+      rtc::scoped_refptr<RtpReceiverInternal> receiver_selector);
+
   // Slots for signals (sigslot) that are wired up to `pc_`.
   void OnSctpDataChannelCreated(SctpDataChannel* channel);
   // Slots for signals (sigslot) that are wired up to `channel`.
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc
index 5388355..31ccfed 100644
--- a/pc/rtc_stats_collector_unittest.cc
+++ b/pc/rtc_stats_collector_unittest.cc
@@ -388,7 +388,10 @@
   EXPECT_CALL(*sender, track()).WillRepeatedly(Return(track));
   EXPECT_CALL(*sender, ssrc()).WillRepeatedly(Return(ssrc));
   EXPECT_CALL(*sender, media_type()).WillRepeatedly(Return(media_type));
-  EXPECT_CALL(*sender, GetParameters()).WillRepeatedly(Invoke([ssrc]() {
+  EXPECT_CALL(*sender, GetParameters())
+      .WillRepeatedly(
+          Invoke([s = sender.get()]() { return s->GetParametersInternal(); }));
+  EXPECT_CALL(*sender, GetParametersInternal()).WillRepeatedly(Invoke([ssrc]() {
     RtpParameters params;
     params.encodings.push_back(RtpEncodingParameters());
     params.encodings[0].ssrc = ssrc;
