Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aboba committed Mar 26, 2024
1 parent 40e03e5 commit 37cef2e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions explainer-use-case-1.md
Expand Up @@ -168,12 +168,14 @@ const videoTrackProcessor = new MediaStreamTrackProcessor(videoTrack);
const videoFrameReader = videoTrackProcessor.readable.getReader();
const videoEncoder = new VideoEncoder({
output: (videoChunk, cfg) => {
const videoRtpPacket = packetizeVideoChunk(videoChunk, cfg); // Custom
videoRtpSendStream.sendRtp(videoRtpPacket);
const videoRtpPackets = packetizeVideoChunk(videoChunk, cfg);
for (const videoRtpPacket of videoRtpPackets) {
videoRtpSendStream.sendRtp(videoRtpPacket);
}
}
});
while (true) {
const { done, videoRrame } = await videoFrameReader.read();
const { done, videoFrame } = await videoFrameReader.read();
videoEncoder.configure({
latencyMode: "realtime",
codec: "vp8",
Expand Down Expand Up @@ -201,6 +203,7 @@ videoRtpReceiveStream.onrtpreceived = () => {
for (const videoRtpPacket of videoRtpPackets) {
const assembledVideoFrames = depacketizeVideoRtpPacketAndInjectIntoJitterBuffer(videoRtpPacket); // Custom
for (const assembledVideoFrame of assembledVideoFrames) {
// Question: can assembledVideoFrames be assumed to be decodable (e.g. no gaps)?
decoder.decode(assembledVideoFrame);
}
}
Expand Down

0 comments on commit 37cef2e

Please sign in to comment.