BIG rewrite stream info

This commit is contained in:
Alex X
2024-06-15 16:46:03 +03:00
parent ecfe802065
commit 96504e2fb0
88 changed files with 1043 additions and 854 deletions
+20 -19
View File
@@ -12,26 +12,32 @@ import (
)
type Keyframe struct {
core.SuperConsumer
core.Connection
wr *core.WriteBuffer
}
// Deprecated: should be rewritten
func NewKeyframe() *Keyframe {
return &Keyframe{
core.SuperConsumer{
Medias: []*core.Media{
{
Kind: core.KindVideo,
Direction: core.DirectionSendonly,
Codecs: []*core.Codec{
{Name: core.CodecJPEG},
{Name: core.CodecH264},
{Name: core.CodecH265},
},
},
medias := []*core.Media{
{
Kind: core.KindVideo,
Direction: core.DirectionSendonly,
Codecs: []*core.Codec{
{Name: core.CodecJPEG},
{Name: core.CodecH264},
{Name: core.CodecH265},
},
},
core.NewWriteBuffer(nil),
}
wr := core.NewWriteBuffer(nil)
return &Keyframe{
Connection: core.Connection{
ID: core.NewID(),
FormatName: "keyframe",
Medias: medias,
Transport: wr,
},
wr: wr,
}
}
@@ -98,8 +104,3 @@ func (k *Keyframe) CodecName() string {
func (k *Keyframe) WriteTo(wr io.Writer) (int64, error) {
return k.wr.WriteTo(wr)
}
func (k *Keyframe) Stop() error {
_ = k.SuperConsumer.Close()
return k.wr.Close()
}