Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecodedImage ¶
type DecodedImage interface { IsKeyFrame() bool Width() uint32 Height() uint32 Plane(n int) []byte Stride(n int) int ToBytes(format ColorFormat) []byte ToRGBA() *image.RGBA }
DecodedImage defines interface for images which decoded by encoded video frame.
type FrameBuilder ¶
type FrameBuilder struct {
// contains filtered or unexported fields
}
FrameBuilder contains all packets maxLate determines how long we should wait until we get a valid Frame The larger the value the less packet loss you will see, but higher latency
This is customized version of Pion's sample builder https://github.com/pion/webrtc/blob/master/pkg/media/samplebuilder/samplebuilder.go
func NewFrameBuilder ¶
func NewFrameBuilder(maxLate uint16, depacketizer rtp.Depacketizer, checker rtp.PartitionHeadChecker, opts ...Option) *FrameBuilder
NewFrameBuilder constructs a new FrameBuilder
func (*FrameBuilder) Pop ¶
func (s *FrameBuilder) Pop() *Frame
Pop scans buffer for valid samples, returns nil when no valid samples have been found
func (*FrameBuilder) PopWithTimestamp ¶
func (s *FrameBuilder) PopWithTimestamp() *Frame
PopWithTimestamp scans buffer for valid samples and its RTP timestamp, returns nil, 0 when no valid samples have been found
func (*FrameBuilder) Push ¶
func (s *FrameBuilder) Push(p *rtp.Packet)
Push adds a RTP Packet to the FrameBuilder
type VideoDecodeResult ¶ added in v0.3.0
type VideoDecodeResult struct { Image DecodedImage Err error }
VideoDecodeResult contains decoded image for each frame or error when decode failed.
type VideoDecoder ¶ added in v0.3.0
type VideoDecoder interface { NewFrameBuilder() *FrameBuilder Process(src <-chan *Frame) chan VideoDecodeResult Close() error }
VideoDecoder defines interfaces for video decoder.