<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>275829</bug_id>
          
          <creation_ts>2024-06-24 16:38:18 -0700</creation_ts>
          <short_desc>setCodecPreferences should accept or video codecs regardless of mimeType case</short_desc>
          <delta_ts>2026-03-11 06:28:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>307157</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2042839</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-06-24 16:38:18 -0700</bug_when>
    <thetext>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&amp;label=experimental&amp;aligned&amp;q=Safari%3Afail

This assert following error: &quot;InvalidModificationError: RTCRtpCodecCapability bad mimeType&quot;

Which stems from: https://searchfox.org/wubkat/rev/38fb2ecadd89df8d6d7114cc2b030188d744aeb0/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp#92

webrtc::RtpCodecCapability rtcCodec;
    if (codec.mimeType.startsWith(&quot;video/&quot;_s))
        rtcCodec.kind = cricket::MEDIA_TYPE_VIDEO;
    else if (codec.mimeType.startsWith(&quot;audio/&quot;_s))
        rtcCodec.kind = cricket::MEDIA_TYPE_AUDIO;
    else
        return Exception { ExceptionCode::InvalidModificationError, &quot;RTCRtpCodecCapability bad mimeType&quot;_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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044090</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-07-01 16:39:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/130928226&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2045519</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-10 04:19:56 -0700</bug_when>
    <thetext>Gecko is right here - https://github.com/w3c/webrtc-pc/pull/2975

Thanks Youenn for input. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2189094</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-03-11 06:27:29 -0700</bug_when>
    <thetext>I fixed it will find relevant commit and link, never realized, I filed this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2189095</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-03-11 06:28:12 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 307157 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>