mirror of
https://github.com/flavioribeiro/donut.git
synced 2025-10-05 23:16:53 +08:00
fix mappers
This commit is contained in:
@@ -3,5 +3,5 @@ package probers
|
||||
import "github.com/flavioribeiro/donut/internal/entities"
|
||||
|
||||
type Prober interface {
|
||||
StreamInfo(req *entities.RequestParams) (map[entities.Codec]entities.Stream, error)
|
||||
StreamInfo(req *entities.RequestParams) (*entities.StreamInfo, error)
|
||||
}
|
||||
|
@@ -103,22 +103,22 @@ func (m *Mapper) FromWebRTCSessionDescriptionToStreamInfo(desc webrtc.SessionDes
|
||||
Type: mediaType,
|
||||
}
|
||||
} else if strings.Contains(a.Value, "H265") {
|
||||
unique[entities.H264] = entities.Stream{
|
||||
unique[entities.H265] = entities.Stream{
|
||||
Codec: entities.H265,
|
||||
Type: mediaType,
|
||||
}
|
||||
} else if strings.Contains(a.Value, "VP9") {
|
||||
unique[entities.H264] = entities.Stream{
|
||||
unique[entities.VP9] = entities.Stream{
|
||||
Codec: entities.VP9,
|
||||
Type: mediaType,
|
||||
}
|
||||
} else if strings.Contains(a.Value, "AV1") {
|
||||
unique[entities.H264] = entities.Stream{
|
||||
unique[entities.AV1] = entities.Stream{
|
||||
Codec: entities.AV1,
|
||||
Type: mediaType,
|
||||
}
|
||||
} else if strings.Contains(a.Value, "opus") {
|
||||
unique[entities.H264] = entities.Stream{
|
||||
unique[entities.Opus] = entities.Stream{
|
||||
Codec: entities.Opus,
|
||||
Type: mediaType,
|
||||
}
|
||||
|
@@ -131,6 +131,12 @@ const formattedNow = () => {
|
||||
|
||||
const log = (msg, level = "info") => {
|
||||
const el = document.createElement("p")
|
||||
|
||||
if (typeof(msg) !== "string") {
|
||||
msg = "unknown log msg type " + typeof(msg)
|
||||
level = "error"
|
||||
}
|
||||
|
||||
if (level === "error" || msg.includes("failed") || msg.includes("error")) {
|
||||
el.style = "color: red;background-color: yellow;";
|
||||
level = "error"
|
||||
|
Reference in New Issue
Block a user