Example #1
0
func (v *RtmpPlayAgent) Write(m core.Message) (err error) {
	var ok bool
	var om *protocol.OryxRtmpMessage
	if om, ok = m.(*protocol.OryxRtmpMessage); !ok {
		return
	}

	// load the jitter algorithm.
	// TODO: FIXME: implements it.
	ag := Full

	// correct message timestamp.
	om.SetTimestamp(v.jitter.Correct(om.Timestamp(), ag))

	// cache message.
	if err = v.conn.CacheMessage(om.Payload()); err != nil {
		return
	}

	return
}