Skip to content

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Oct 14, 2025

FF145 makes RTCEncodedAudioFrame and RTCEncodeVideoFrame be serializeable, which essentially means adding constructors.

This updates the getMetadata() for for both interfaces with the correct properties in returned object according to tests. It also creates constructor docs. These don't duplicate the properties but link to the getMetadata doc.

Related docs work can be tracked in #41508

@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Oct 14, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Preview URLs (6 pages)
External URLs (4)

URL: /en-US/docs/Web/API/RTCEncodedAudioFrame/getMetadata
Title: RTCEncodedAudioFrame: getMetadata() method

(comment last updated: 2025-10-20 22:29:01)

@hamishwillee hamishwillee changed the title FF145 RTCEncodedVideo/Audio constructors - draft FF145 RTCEncodedVideoFrame/RTCEncodedAudioFrame constructors Oct 20, 2025
@hamishwillee hamishwillee force-pushed the ff145_rtcencodedvideoframe_serialize branch from 067d91f to 75d79ed Compare October 20, 2025 22:21
@hamishwillee hamishwillee marked this pull request as ready for review October 20, 2025 22:23
@hamishwillee hamishwillee requested a review from a team as a code owner October 20, 2025 22:23
@hamishwillee hamishwillee requested review from sideshowbarker and removed request for a team October 20, 2025 22:23
@hamishwillee hamishwillee force-pushed the ff145_rtcencodedvideoframe_serialize branch from 75d79ed to 397c1ac Compare October 20, 2025 22:27
- `receiveTime`
- : A {{domxref("DOMHighResTimeStamp")}} indicating the timestamp of the last received packet of an incoming frame (from an {{domxref("RTCRtpReceiver")}}) used to produce this media frame, relative to {{domxref("Performance.timeOrigin")}}.
- `rtpTimestamp`
- : A positive integer that that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A positive integer that that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).
- : A positive integer that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).

Note that while numbers are allocated sequentially when sent, they will overflow at 32767 and restart back at 0.
Therefore to compare two frame sequence numbers, in order to determine whether one is assumed to be after another, you must use [serial number arithmetic](https://en.wikipedia.org/wiki/Serial_number_arithmetic). <!-- [RFC1982] -->
- `synchronizationSource`
- : A positive integer value indicating synchronization source ("ssrc") of the stream of RTP packets that are described by this frame.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A positive integer value indicating synchronization source ("ssrc") of the stream of RTP packets that are described by this frame.
- : A positive integer value indicating the synchronization source ("ssrc") of the stream of RTP packets that are described by this frame.

- : This is an object with the following property:
- `metadata` {{optional_inline}}
- : An object setting the frame metadata.
This is object has the same properties as the object returned by {{DOMxRef("RTCEncodedAudioFrame.getMetadata()")}}.
Copy link
Member

@sideshowbarker sideshowbarker Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is object has the same properties as the object returned by {{DOMxRef("RTCEncodedAudioFrame.getMetadata()")}}.
This is an object with the same properties as the object returned by {{DOMxRef("RTCEncodedAudioFrame.getMetadata()")}}.

});
```

This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame, for example in order to relay media to another peer on the network.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame, for example in order to relay media to another peer on the network.
This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame; for example in order to relay media to another peer on the network.

- `receiveTime`
- : A {{domxref("DOMHighResTimeStamp")}} indicating the timestamp of the last received packet of an incoming frame (from an {{domxref("RTCRtpReceiver")}}) used to produce this media frame, relative to {{domxref("Performance.timeOrigin")}}.
- `rtpTimestamp`
- : A positive integer that that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A positive integer that that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).
- : A positive integer that reflects the sampling instant of the first octet in the RTP data packet (see {{rfc("3550")}}).

- : This is an object with the following property:
- `metadata` {{optional_inline}}
- : An object setting the frame metadata.
This is object has the same properties as the object returned by {{DOMxRef("RTCEncodedVideoFrame.getMetadata()")}}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is object has the same properties as the object returned by {{DOMxRef("RTCEncodedVideoFrame.getMetadata()")}}.
This is an object with the same properties as the object returned by {{DOMxRef("RTCEncodedVideoFrame.getMetadata()")}}.

});
```

This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame, for example in order to relay media to another peer on the network.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame, for example in order to relay media to another peer on the network.
This kind of modification might be useful if you need to create multiple outgoing frames from a single incoming frame; for example in order to relay media to another peer on the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants