Implement RTCRtpTransceiver.setCodecPreferences

SetCodecPreferences allows clients to filter and reorder codecs in their
SDP offer and answer.

Bug: webrtc:9777
Change-Id: I716bed9b06496629b45210883b286f599c875239
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129727
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27817}
diff --git a/api/rtp_transceiver_interface.cc b/api/rtp_transceiver_interface.cc
index 0504331..dc82fad 100644
--- a/api/rtp_transceiver_interface.cc
+++ b/api/rtp_transceiver_interface.cc
@@ -25,9 +25,15 @@
   return absl::nullopt;
 }
 
-void RtpTransceiverInterface::SetCodecPreferences(
+RTCError RtpTransceiverInterface::SetCodecPreferences(
     rtc::ArrayView<RtpCodecCapability>) {
   RTC_NOTREACHED() << "Not implemented";
+  return {};
+}
+
+std::vector<RtpCodecCapability> RtpTransceiverInterface::codec_preferences()
+    const {
+  return {};
 }
 
 }  // namespace webrtc
diff --git a/api/rtp_transceiver_interface.h b/api/rtp_transceiver_interface.h
index 9b052d1..4606632 100644
--- a/api/rtp_transceiver_interface.h
+++ b/api/rtp_transceiver_interface.h
@@ -129,8 +129,9 @@
   // The SetCodecPreferences method overrides the default codec preferences used
   // by WebRTC for this transceiver.
   // https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-setcodecpreferences
-  // TODO(steveanton): Not implemented.
-  virtual void SetCodecPreferences(rtc::ArrayView<RtpCodecCapability> codecs);
+  virtual RTCError SetCodecPreferences(
+      rtc::ArrayView<RtpCodecCapability> codecs);
+  virtual std::vector<RtpCodecCapability> codec_preferences() const;
 
  protected:
   ~RtpTransceiverInterface() override = default;