Interface NettyEncryptor

All Superinterfaces:
AutoCloseable, Encryptor

public interface NettyEncryptor extends Encryptor
An Encryptor that can also encrypt directly between Netty ByteBufs.

Both buffers must be direct. The frame is read from the readable bytes of frame, and the encrypted frame is written at the writer index of encryptedFrame, which is advanced on success.

See Also:
  • Method Details

    • encrypt

      int encrypt(MediaType mediaType, int ssrc, io.netty.buffer.ByteBuf frame, io.netty.buffer.ByteBuf encryptedFrame)
      Encrypts a media frame into Netty ByteBuf.
      Parameters:
      mediaType - The type of media.
      ssrc - The SSRC of the stream.
      frame - The input ByteBuf containing the plaintext frame.
      encryptedFrame - The output ByteBuf to write the encrypted frame into. Outside passthrough mode it must have room for Encryptor.getMaxCiphertextByteSize(MediaType, int) bytes, or encryption fails.
      Returns:
      The number of bytes written to encryptedFrame on success, or a negative error code on failure.