Because of the need to transmit both audio and video data in srt, it is
necessary to identify the type of packet, this encoder is used to packetize
specific types of data for transmission over the network.
Creates a BytesMut and copies from src to a buffer. The created buffer
contains the initial message header required for message encoding, which is
an optimization to reduce data copying in the process.
Creating a mixed channel is the opposite of separating channels, where the
data from all channels is mixed together, and the data received from the
receiver is mixed, and you need to process it yourself by data type.
Create a sender, the sender only sends data and does not receive data, and
no sender has a separate ID, you can get the ID of the current sender by
get_id.
Create channel-separated receivers where audio and video channels are
received independently, so that a channel can be easily processed separately
from different threads.
Create a BytesMut and initialize it according to the capacity. The created
buffer contains the initialization message header required for message
encoding, which is an optimization to reduce data copying in the process.