You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Structure clone frame with passing frame.data as transferables and send frame's clone to packetizer or decoder. (#152)
* Structure clone frame with passing frame.data as transferables and send frame's clone to packetizer or decoder.
* Use structuredSerialize/Deserialize links
Copy file name to clipboardExpand all lines: index.bs
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -115,10 +115,13 @@ The <dfn>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter an
115
115
1. If |frame|.`[[owner]]` is not equal to |rtcObject|, abort these steps and return [=a promise resolved with=] undefined. A processor cannot create frames, or move frames between streams.
116
116
1. If |frame|.`[[counter]]` is equal or smaller than |rtcObject|.`[[lastReceivedFrameCounter]]`, abort these steps and return [=a promise resolved with=] undefined. A processor cannot reorder frames, although it may delay them or drop them.
117
117
1. Set |rtcObject|.`[[lastReceivedFrameCounter]]` to |frame|`[[counter]]`.
118
-
4. Enqueue the frame for processing as if it came directly from the encoded data source, by running one of the following steps:
119
-
* If |rtcObject| is a {{RTCRtpSender}}, enqueue it to |rtcObject|'s packetizer, to be processed [=in parallel=].
120
-
* If |rtcObject| is a {{RTCRtpReceiver}}, enqueue it to |rtcObject|'s decoder, to be processed [=in parallel=].
121
-
5. Return [=a promise resolved with=] undefined.
118
+
1. Let |data| be |frame|.`[[data]]`.
119
+
1. Let |serializedFrame| be [$StructuredSerializeWithTransfer$](|frame|, « |data| »).
120
+
1. Let |frameCopy| be [$StructuredDeserialize$](|serializedFrame|, |frame|'s [=relevant realm=]).
121
+
1. Enqueue |frameCopy| for processing as if it came directly from the encoded data source, by running one of the following steps:
122
+
* If |rtcObject| is a {{RTCRtpSender}}, enqueue |frameCopy| to |rtcObject|'s packetizer, to be processed [=in parallel=].
123
+
* If |rtcObject| is a {{RTCRtpReceiver}}, enqueue |frameCopy| it to |rtcObject|'s decoder, to be processed [=in parallel=].
124
+
1. Return [=a promise resolved with=] undefined.
122
125
123
126
On sender side, as part of [=readEncodedData=], frames produced by |rtcObject|'s encoder MUST be enqueued in |rtcObject|.`[[readable]]` in the encoder's output order.
124
127
As [=writeEncodedData=] ensures that the transform cannot reorder frames, the encoder's output order is also the order followed by packetizers to generate RTP packets and assign RTP packet sequence numbers.
0 commit comments