Total rework FLV client

This commit is contained in:
Alexey Khit
2023-08-13 15:42:42 +03:00
parent e9795e7521
commit 0b6fda2af5
11 changed files with 703 additions and 8 deletions
+1
View File
@@ -13,6 +13,7 @@ import (
const (
ConnDialTimeout = time.Second * 3
ConnDeadline = time.Second * 3
ProbeTimeout = time.Second * 3
)
// Now90000 - timestamp for Video (clock rate = 90000 samples per second)
+15 -1
View File
@@ -4,9 +4,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/pion/rtp"
"strconv"
"sync"
"github.com/pion/rtp"
)
var ErrCantGetTrack = errors.New("can't get track")
@@ -181,3 +182,16 @@ func (s *Sender) String() string {
func (s *Sender) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
}
// VA - helper, for extract video and audio receivers from list
func VA(receivers []*Receiver) (video, audio *Receiver) {
for _, receiver := range receivers {
switch GetKind(receiver.Codec.Name) {
case KindVideo:
video = receiver
case KindAudio:
audio = receiver
}
}
return
}