Bug 276445 - Sync `direction` as per `RTCRtpTransceiver` specification
Summary: Sync `direction` as per `RTCRtpTransceiver` specification
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-07-10 13:12 PDT by Ahmad Saleem
Modified: 2024-07-17 13:13 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2024-07-10 13:12:23 PDT
Hi Team,

While going through WebRTC browser specific failures, I noticed that we fail bunch of tests, which are due to out of sync alignment with spec.

Web-Spec: https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver

> In 'Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl', we have:

 attribute RtpTransceiverDirection direction;

we have to change to:

attribute RTCRtpTransceiverDirection direction;

> In 'Source/WebCore/Modules/mediastream/RTCRtpTransceiverDirection.idl':

We have to add following:

[
    Conditional=WEB_RTC,
    EnabledBySetting=PeerConnectionEnabled
] enum RTCRtpTransceiverDirection {
    "sendrecv",
    "sendonly",
    "recvonly",
    "inactive",
    "stopped"
};

as per - https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection

> In 'Source/WebCore/platform/mediastream/RTCRtpTransceiverDirection.h':

Update enum class to:

enum class RTCRtpTransceiverDirection {
    Sendrecv,
    Sendonly,
    Recvonly,
    Inactive,
    Stopped
};

> In 'Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp':

Update 'toRTCRtpTransceiverDirection' function to:

RTCRtpTransceiverDirection toRTCRtpTransceiverDirection(webrtc::RtpTransceiverDirection rtcDirection)
{
    switch (rtcDirection) {
    case webrtc::RtpTransceiverDirection::kSendRecv:
        return RTCRtpTransceiverDirection::Sendrecv;
    case webrtc::RtpTransceiverDirection::kSendOnly:
        return RTCRtpTransceiverDirection::Sendonly;
    case webrtc::RtpTransceiverDirection::kRecvOnly:
        return RTCRtpTransceiverDirection::Recvonly;
    case webrtc::RtpTransceiverDirection::kInactive:

        return RTCRtpTransceiverDirection::Inactive;
    case webrtc::RtpTransceiverDirection::kStopped:
        return RTCRtpTransceiverDirection::Stopped;
    };

    RELEASE_ASSERT_NOT_REACHED();
}

and update 'fromRTCRtpTransceiverDirection' function to:

webrtc::RtpTransceiverDirection fromRTCRtpTransceiverDirection(RTCRtpTransceiverDirection direction)
{
    switch (direction) {
    case RTCRtpTransceiverDirection::Sendrecv:
        return webrtc::RtpTransceiverDirection::kSendRecv;
    case RTCRtpTransceiverDirection::Sendonly:
        return webrtc::RtpTransceiverDirection::kSendOnly;
    case RTCRtpTransceiverDirection::Recvonly:
        return webrtc::RtpTransceiverDirection::kRecvOnly;
    case RTCRtpTransceiverDirection::Inactive:
        return webrtc::RtpTransceiverDirection::kInactive;
    case RTCRtpTransceiverDirection::Stopped:
        return webrtc::RtpTransceiverDirection::kStopped;
    };

    RELEASE_ASSERT_NOT_REACHED();
}

-_

We might need to update 'GSstream' as well but it does progress few test cases but it leads to following being beginning to timeout - 'RTCRtpTransceiver.https.html'.

Just wanted to raise so we can track it.

Thanks!
Comment 1 Radar WebKit Bug Importer 2024-07-17 13:13:18 PDT
<rdar://problem/131948356>