forked from q191201771/lal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7df4d9
commit f2fc9a7
Showing
22 changed files
with
509 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github.com/q191201771/naza v0.15.0 h1:HFyRrluqZhpnBu6YQ1soIk6cR9P8G/9sDMFLBhTTBRc= | ||
github.com/q191201771/naza v0.15.0/go.mod h1:SE14GBGO9mAn6JZl3NlfWGtNOT7xQjxOG7f3YOdBThM= | ||
github.com/q191201771/naza v0.15.1 h1:y9D7jbzHeD883PqBZTln+O47E40dFoRlQUrWYOA5GoM= | ||
github.com/q191201771/naza v0.15.1/go.mod h1:SE14GBGO9mAn6JZl3NlfWGtNOT7xQjxOG7f3YOdBThM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright 2020, Chef. All rights reserved. | ||
// https://github.com/q191201771/lal | ||
// | ||
// Use of this source code is governed by a MIT-style license | ||
// that can be found in the License file. | ||
// | ||
// Author: Chef (191201771@qq.com) | ||
|
||
package base | ||
|
||
const ( | ||
// StatGroup.AudioCodec | ||
AudioCodecAAC = "AAC" | ||
|
||
// StatGroup.VideoCodec | ||
VideoCodecAVC = "H264" | ||
VideoCodecHEVC = "H265" | ||
|
||
// StatSession.Protocol | ||
ProtocolRTMP = "RTMP" | ||
ProtocolRTSP = "RTSP" | ||
ProtocolHTTPFLV = "HTTP-FLV" | ||
ProtocolHTTPTS = "HTTP-TS" | ||
) | ||
|
||
type StatGroup struct { | ||
StreamName string `json:"stream_name"` | ||
AudioCodec string `json:"audio_codec"` | ||
VideoCodec string `json:"video_codec"` | ||
VideoWidth int `json:"video_width"` | ||
VideoHeight int `json:"video_height"` | ||
StatPub StatPub `json:"pub"` | ||
StatSubs []StatSub `json:"subs"` | ||
} | ||
|
||
type StatPub struct { | ||
StatSession | ||
} | ||
|
||
type StatSub struct { | ||
StatSession | ||
} | ||
|
||
type StatSession struct { | ||
Protocol string `json:"protocol"` | ||
StartTime string `json:"start_time"` | ||
RemoteAddr string `json:"remote_addr"` | ||
ReadBytesSum uint64 `json:"read_bytes_sum"` | ||
WroteBytesSum uint64 `json:"wrote_bytes_sum"` | ||
Bitrate int `json:"bitrate"` | ||
} | ||
|
||
func StatSession2Pub(ss StatSession) (ret StatPub) { | ||
ret.Protocol = ss.Protocol | ||
ret.StartTime = ss.StartTime | ||
ret.RemoteAddr = ss.RemoteAddr | ||
ret.ReadBytesSum = ss.ReadBytesSum | ||
ret.WroteBytesSum = ss.WroteBytesSum | ||
ret.Bitrate = ss.Bitrate | ||
return | ||
} | ||
|
||
func StatSession2Sub(ss StatSession) (ret StatSub) { | ||
ret.Protocol = ss.Protocol | ||
ret.StartTime = ss.StartTime | ||
ret.RemoteAddr = ss.RemoteAddr | ||
ret.ReadBytesSum = ss.ReadBytesSum | ||
ret.WroteBytesSum = ss.WroteBytesSum | ||
ret.Bitrate = ss.Bitrate | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.