Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/guide/advanced/encoded-transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ RTCEncodedVideoFrameInjector injector = transceiver.getSender()
injector.injectFrame(frameData, rtpTimestamp, keyFrame, width, height);
```

The frames must be in the codec the sender negotiated, which `setCodecPreferences` on the transceiver can make sure of, and the RTP timestamp runs on the 90 kHz video clock. An audio sender takes an `RTCEncodedAudioFrameInjector` the same way, whose frames carry the payload type of their codec, from the sender's `getParameters().codecs`. Do not inject audio through a factory that sends audio captured by its audio device module, as WebRTC feeds captured audio to every audio sender.
The frames must be in the codec the sender negotiated, which `setCodecPreferences` on the transceiver can make sure of, and the RTP timestamp runs on the 90 kHz video clock. VP9 cannot be injected: WebRTC sends injected frames without the scalability structure a VP9 receiver needs with every key frame, so the receiver drops them. H.264, H.265 and AV1 frames arrive. An audio sender takes an `RTCEncodedAudioFrameInjector` the same way, whose frames carry the payload type of their codec, from the sender's `getParameters().codecs`. Do not inject audio through a factory that sends audio captured by its audio device module, as WebRTC feeds captured audio to every audio sender.

Giving the sender a track through `replaceTrack` ends the injection, and `dispose()` releases the injector. The observer runs on a callback thread shared with other WebRTC observers, so it may call back into WebRTC but should not block.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
* {@link RTCRtpSender#replaceTrack(dev.onvoid.webrtc.media.MediaStreamTrack)
* giving the sender a track} ends the injection.
* <p>
* VP9 cannot be injected: WebRTC sends injected frames without the
* scalability structure a VP9 receiver needs with every key frame, so the
* receiver drops them. H.264, H.265 and AV1 frames arrive.
* <p>
* Frames can be injected from any thread.
*
* @author Alex Andres
Expand Down
Loading