Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions create-encoded-explainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Explainer - Create functions for encoded data

## Problem to be solved

In some use cases, we need to move encoded data beyond the confines of a single PeerConnection.

The use cases include:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Below use cases are closer to technical solutions than actual use cases.
It would be helpful to relate these technical solutions to NV document use cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have filed w3c/webrtc-nv-use-cases#81 and w3c/webrtc-nv-use-cases#82 in order to provide a discussion point for those use cases, before spending the time to write actual text for the use case.

w3c/webrtc-nv-use-cases#79 has been merged, so that's part of the NV-use-cases now.


* Relaying incoming encoded data to one or more other PeerConnections as outgoing data
* Sending data that has already been encoded (by a camera, from a file, or other sources)
* Receiving data in encoded form from a non-WebRTC source and processing it using WebRTC

Addressing these cases in the webrtc-encoded-transform API requires the ability to:

* Create encoded frames
* Clone encoded frames
* Manipulate encoded frame metadata to conform with the requirements of its destination

These are not the only functions that are needed to handle the use cases, but this explainer
focuses on the frame creation, cloning and manipulation functions.

## Approach

The approach proposed as a minimum viable API consists of 3 functions:

* A constructor that takes encoded data + metadata and creates an encoded frame
* A setter that is able to modify some of the values returned from the existing GetMetadata method
* A clone operator that takes an existing encoded frame and creates a new, independent encoded frame

The clone operator may be thought of as a convenient shorthand for the constructor:

```
frame.clone = constructor(frame.getMetadata(), frame.data)

```