Back to Diago

media

media/README.md

0.28.01.6 KB
Original Source

media

Implemented:

Everything is io.Reader and io.Writer

We follow GO std lib and providing interface for Reader/Writer when it comes reading and writing media.
This optimized and made easier usage of RTP framework, by providing end user standard library io.Reader io.Writer to pass his media.

In other words chaining reader or writer allows to build interceptors, encoders, decoders without introducing overhead of contention or many memory allocations

Features:

  • Simple SDP build with formats alaw,ulaw,dtmf
  • RTP/RTCP receiving and logging
  • Extendable MediaSession handling for RTP/RTCP handling (ex microphone,speaker)
  • DTMF encoder, decoder via RFC4733
  • Minimal SDP package for audio
  • Media Session, RTP Session handling
  • RTCP monitoring
  • SDP codec fields manipulating
  • ... who knows

Concepts

  • Media Session represents mapping between SDP media description and creates session based on local/remote addr
  • RTP Session is creating RTP/RTCP session. It is using media session underneath to add networking layer.
  • RTP Packet Reader is depackatizing RTP packets and providing payload as io.Reader. Normally it should be chained to RTP Session
  • RTP Packet Writer is packatizing payload to RTP packets as io.Writer. Normally it should be chained to RTP Session

IO flow

Reader: AudioDecoder<->RTPPacketReader<->RTPSession<->MediaSession

Writer: AudioEncoder<->RTPPackerWriter<->RTPSession<->MediaSession

more docs...