Current broadcaster details admin api (#206)

* Add support for ending the inbound stream. Closes #191

* Add a simple success response to API requests

* Store inbound broadcast details for admin purposes

* Add /api/admin/broadcaster endpoint

* Reset broadcaster on disconnect

* Move controller to admin directory
This commit is contained in:
Gabe Kangas
2020-10-02 00:12:47 -07:00
committed by GitHub
parent 236f25b772
commit f4fdc6c951
7 changed files with 176 additions and 0 deletions

33
models/broadcaster.go Normal file
View File

@@ -0,0 +1,33 @@
package models
import "time"
// Broadcaster represents the details around the inbound broadcasting connection.
type Broadcaster struct {
RemoteAddr string `json:"remoteAddr"`
StreamDetails InboundStreamDetails `json:"streamDetails"`
Time time.Time `json:"time"`
}
type InboundStreamDetails struct {
Width int `json:"width"`
Height int `json:"height"`
VideoFramerate int `json:"framerate"`
VideoBitrate int `json:"videoBitrate"`
VideoCodec string `json:"videoCodec"`
AudioBitrate int `json:"audioBitrate"`
AudioCodec string `json:"audioCodec"`
Encoder string `json:"encoder"`
}
// RTMPStreamMetadata is the raw metadata that comes in with a RTMP connection
type RTMPStreamMetadata struct {
Width int `json:"width"`
Height int `json:"height"`
VideoBitrate float32 `json:"videodatarate"`
VideoCodec interface{} `json:"videocodecid"`
VideoFramerate int `json:"framerate"`
AudioBitrate float32 `json:"audiodatarate"`
AudioCodec interface{} `json:"audiocodecid"`
Encoder string `json:"encoder"`
}