Documentation ¶
Index ¶
- type AAC
- type Audio
- func (a *Audio) Attach()
- func (a *Audio) Detach()
- func (a *Audio) Flush()
- func (a *Audio) GetDecConfSeq() int
- func (a *Audio) GetInfo() *Audio
- func (a *Audio) GetName() string
- func (a *Audio) IsAAC() bool
- func (a *Audio) SnapForJson()
- func (a *Audio) WriteADTS(adts []byte)
- func (av *Audio) WriteAVCC(ts uint32, frame AVCCFrame)
- type Data
- type G711
- type H264
- type H265
- type Media
- func (av *Media[T]) ComplementAVCC() bool
- func (av *Media[T]) ComplementRTP() bool
- func (av *Media[T]) CurrentFrame() *AVFrame[T]
- func (av *Media[T]) Flush()
- func (av *Media[T]) GetDecoderConfiguration() DecoderConfiguration[T]
- func (av *Media[T]) LastWriteTime() time.Time
- func (av *Media[T]) PacketizeRTP(payloads ...net.Buffers)
- func (av *Media[T]) Play(ctx context.Context, onMedia func(*AVFrame[T]) error) error
- func (av *Media[T]) PreFrame() *AVFrame[T]
- func (av *Media[T]) ReadRing() *AVRing[T]
- func (av *Media[T]) UnmarshalRTP(raw []byte) (frame *RTPFrame)
- func (av *Media[T]) UnmarshalRTPPacket(p *rtp.Packet) (frame *RTPFrame)
- func (av *Media[T]) WriteAVCC(ts uint32, frame AVCCFrame)
- func (av *Media[T]) WriteSlice(slice T)
- type RTPDemuxer
- type RTPMuxer
- type Video
- func (vt *Video) Attach()
- func (vt *Video) ComputeGOP()
- func (vt *Video) Detach()
- func (vt *Video) Flush()
- func (vt *Video) GetDecConfSeq() int
- func (vt *Video) GetName() string
- func (vt *Video) PlayFullAnnexB(ctx context.Context, onMedia func(net.Buffers) error) error
- func (vt *Video) ReadRing() *AVRing[NALUSlice]
- func (vt *Video) SnapForJson()
- func (vt *Video) WriteAVCC(ts uint32, frame AVCCFrame)
- func (vt *Video) WriteAnnexB(frame AnnexBFrame) (s []NALUSlice)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct { Media[AudioSlice] CodecID codec.AudioCodecID Channels byte SampleSize byte AVCCHead []byte // 音频包在AVCC格式中,AAC会有两个字节,其他的只有一个字节 // Profile: // 0: Main profile // 1: Low Complexity profile(LC) // 2: Scalable Sampling Rate profile(SSR) // 3: Reserved Profile byte }
func (*Audio) GetDecConfSeq ¶
type Data ¶
func (*Data) LastWriteTime ¶
type H264 ¶
type H264 struct {
Video
}
func (*H264) WriteAnnexB ¶
func (*H264) WriteSlice ¶
func (vt *H264) WriteSlice(slice NALUSlice)
type H265 ¶
type H265 struct {
Video
}
func (*H265) WriteAnnexB ¶
func (*H265) WriteSlice ¶
func (vt *H265) WriteSlice(slice NALUSlice)
type Media ¶
type Media[T RawSlice] struct { Base AVRing[T] SampleRate uint32 DecoderConfiguration DecoderConfiguration[T] `json:"-"` //H264(SPS、PPS) H265(VPS、SPS、PPS) AAC(config) // util.BytesPool //无锁内存池,用于发布者(在同一个协程中)复用小块的内存,通常是解包时需要临时使用 RTPMuxer RTPDemuxer // contains filtered or unexported fields }
Media 基础媒体Track类
func (*Media[T]) ComplementAVCC ¶ added in v4.8.2
func (*Media[T]) ComplementRTP ¶ added in v4.8.2
是否需要补完RTP格式
func (*Media[T]) CurrentFrame ¶
func (av *Media[T]) CurrentFrame() *AVFrame[T]
func (*Media[T]) GetDecoderConfiguration ¶
func (av *Media[T]) GetDecoderConfiguration() DecoderConfiguration[T]
func (*Media[T]) LastWriteTime ¶
func (*Media[T]) PacketizeRTP ¶
https://www.cnblogs.com/moonwalk/p/15903760.html Packetize packetizes the payload of an RTP packet and returns one or more RTP packets
func (*Media[T]) UnmarshalRTP ¶
func (*Media[T]) UnmarshalRTPPacket ¶
func (*Media[T]) WriteSlice ¶
func (av *Media[T]) WriteSlice(slice T)
type RTPDemuxer ¶ added in v4.8.2
type RTPDemuxer struct {
// contains filtered or unexported fields
}
type Video ¶
type Video struct { Media[NALUSlice] CodecID codec.VideoCodecID IDRing *util.Ring[AVFrame[NALUSlice]] `json:"-"` //最近的关键帧位置,首屏渲染 SPSInfo codec.SPSInfo GOP int //关键帧间隔 // contains filtered or unexported fields }
func (*Video) ComputeGOP ¶
func (vt *Video) ComputeGOP()
func (*Video) GetDecConfSeq ¶
func (*Video) PlayFullAnnexB ¶ added in v4.7.0
PlayFullAnnexB 订阅annex-b格式的流数据,每一个I帧增加sps、pps头
func (*Video) SnapForJson ¶ added in v4.5.1
func (vt *Video) SnapForJson()
func (*Video) WriteAnnexB ¶
func (vt *Video) WriteAnnexB(frame AnnexBFrame) (s []NALUSlice)
Click to show internal directories.
Click to hide internal directories.