Bug 275829

Summary: setCodecPreferences should accept or video codecs regardless of mimeType case
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Ahmad Saleem
Reported 2024-06-24 16:38:18 PDT
Hi Team, While investigating WPT failures, I noticed that Safari / WebKit (including Chrome due to relying on libwebrtc) fails following: Test Case: https://wpt.fyi/results/webrtc/RTCRtpTransceiver-setCodecPreferences.html?label=master&label=experimental&aligned&q=Safari%3Afail This assert following error: "InvalidModificationError: RTCRtpCodecCapability bad mimeType" Which stems from: https://searchfox.org/wubkat/rev/38fb2ecadd89df8d6d7114cc2b030188d744aeb0/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp#92 webrtc::RtpCodecCapability rtcCodec; if (codec.mimeType.startsWith("video/"_s)) rtcCodec.kind = cricket::MEDIA_TYPE_VIDEO; else if (codec.mimeType.startsWith("audio/"_s)) rtcCodec.kind = cricket::MEDIA_TYPE_AUDIO; else return Exception { ExceptionCode::InvalidModificationError, "RTCRtpCodecCapability bad mimeType"_s }; So this might need tweaking. Web-Spec: https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-setcodecpreferences While spec says in Step 7: For each codec in codecs, If codec does not match any codec in codecCapabilities, throw InvalidModificationError. _____ So if I am not mistaken Chrome and Safari are doing right thing while Firefox / Gecko is wrong here. Just wanted to get input before suggesting that we should update WPT or not. Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2024-07-01 16:39:11 PDT
Ahmad Saleem
Comment 2 2024-07-10 04:19:56 PDT
Gecko is right here - https://github.com/w3c/webrtc-pc/pull/2975 Thanks Youenn for input. :-)
Ahmad Saleem
Comment 3 2026-03-11 06:27:29 PDT
I fixed it will find relevant commit and link, never realized, I filed this.
Ahmad Saleem
Comment 4 2026-03-11 06:28:12 PDT
*** This bug has been marked as a duplicate of bug 307157 ***
Note You need to log in before you can comment on or make changes to this bug.