forked from External/mediamtx
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.
20 lines
466 B
Go
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
|
|
}
|