1
0
Fork 0
forked from External/mediamtx
mediamtx/internal/protocols/webrtc/tracks_to_medias.go
Alessandro Ros a1dc9f45f5
webrtc: support publishing H265 tracks (#3435) (#3492)
IMPORTANT NOTE: this doesn't allow to read H265 tracks with WebRTC,
just to publish them. The inability to read H265 tracks with WebRTC is
not in any way related to the server but depends on browsers and on the
fact that they are not legally entitled to embed a H265 decoder inside
them.
2024-06-19 21:02:08 +02:00

20 lines
466 B
Go

package webrtc
import (
"github.com/bluenviron/gortsplib/v4/pkg/description"
"github.com/bluenviron/gortsplib/v4/pkg/format"
)
// TracksToMedias converts WebRTC tracks into a media description.
func TracksToMedias(tracks []*IncomingTrack) []*description.Media {
ret := make([]*description.Media, len(tracks))
for i, track := range tracks {
ret[i] = &description.Media{
Type: track.typ,
Formats: []format.Format{track.format},
}
}
return ret
}