2018-05-31 21:03:04 +09:00
|
|
|
//
|
|
|
|
|
// Copyright (c) 2018- yutopp (yutopp@gmail.com)
|
|
|
|
|
//
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
|
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
package rtmp
|
|
|
|
|
|
2018-07-27 18:38:37 +09:00
|
|
|
import (
|
|
|
|
|
"github.com/yutopp/go-rtmp/message"
|
2018-10-05 20:59:56 +09:00
|
|
|
"io"
|
2018-07-27 18:38:37 +09:00
|
|
|
)
|
2018-06-11 00:12:29 +09:00
|
|
|
|
2018-05-31 21:03:04 +09:00
|
|
|
type Handler interface {
|
2018-09-27 06:11:04 +09:00
|
|
|
OnServe(conn *Conn)
|
2018-07-27 18:38:37 +09:00
|
|
|
OnConnect(timestamp uint32, cmd *message.NetConnectionConnect) error
|
|
|
|
|
OnCreateStream(timestamp uint32, cmd *message.NetConnectionCreateStream) error
|
2018-07-27 19:20:00 +09:00
|
|
|
OnReleaseStream(timestamp uint32, cmd *message.NetConnectionReleaseStream) error
|
2018-07-27 18:38:37 +09:00
|
|
|
OnDeleteStream(timestamp uint32, cmd *message.NetStreamDeleteStream) error
|
|
|
|
|
OnPublish(timestamp uint32, cmd *message.NetStreamPublish) error
|
2018-07-28 17:51:12 +09:00
|
|
|
OnPlay(timestamp uint32, cmd *message.NetStreamPlay) error
|
2018-07-27 19:20:00 +09:00
|
|
|
OnFCPublish(timestamp uint32, cmd *message.NetStreamFCPublish) error
|
|
|
|
|
OnFCUnpublish(timestamp uint32, cmd *message.NetStreamFCUnpublish) error
|
2018-07-27 18:38:37 +09:00
|
|
|
OnSetDataFrame(timestamp uint32, data *message.NetStreamSetDataFrame) error
|
2018-10-05 20:59:56 +09:00
|
|
|
OnAudio(timestamp uint32, payload io.Reader) error
|
|
|
|
|
OnVideo(timestamp uint32, payload io.Reader) error
|
2018-08-16 20:42:24 +09:00
|
|
|
OnUnknownMessage(timestamp uint32, msg message.Message) error
|
2018-08-16 20:06:06 +09:00
|
|
|
OnUnknownCommandMessage(timestamp uint32, cmd *message.CommandMessage) error
|
2018-08-16 20:42:24 +09:00
|
|
|
OnUnknownDataMessage(timestamp uint32, data *message.DataMessage) error
|
2018-07-02 19:53:32 +09:00
|
|
|
OnClose()
|
2018-05-31 21:03:04 +09:00
|
|
|
}
|