Documentation ¶
Index ¶
- type AAC
- type Audio
- func (a *Audio) Attach()
- func (a *Audio) CompleteAVCC(value *AVFrame[[]byte])
- func (a *Audio) CompleteRTP(value *AVFrame[[]byte])
- func (a *Audio) Detach()
- 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)
- func (av *Audio) WriteRaw(pts uint32, raw []byte)
- type Data
- type G711
- type H264
- type H265
- type Media
- 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 ...[][]byte)
- 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]) SetSpeedLimit(value int)
- func (av *Media[T]) SetStuff(stuff ...any)
- 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]) WriteRTP(raw []byte)
- func (av *Media[T]) WriteRTPPack(p *rtp.Packet)
- type RTPDemuxer
- type RTPMuxer
- type SpesificTrack
- type Video
- func (vt *Video) Attach()
- func (vt *Video) CompleteAVCC(rv *AVFrame[NALUSlice])
- 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) SetLostFlag()
- func (vt *Video) SnapForJson()
- func (vt *Video) WriteAVCC(ts uint32, frame AVCCFrame)
- func (vt *Video) WriteAnnexB(pts uint32, dts uint32, frame AnnexBFrame)
- func (vt *Video) WriteRawBytes(slice []byte)
- func (vt *Video) WriteSliceByte(b ...byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AAC ¶
func (*AAC) CompleteRTP ¶ added in v4.10.0
func (*AAC) WriteRTPFrame ¶ added in v4.10.0
func (aac *AAC) WriteRTPFrame(frame *RTPFrame)
type Audio ¶
type Audio struct { Media[[]byte] 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) CompleteAVCC ¶ added in v4.10.0
func (*Audio) CompleteRTP ¶ added in v4.10.0
func (*Audio) GetDecConfSeq ¶
type Data ¶
func (*Data) LastWriteTime ¶
type G711 ¶
type G711 struct {
Audio
}
func (*G711) WriteRTPFrame ¶ added in v4.10.0
func (g711 *G711) WriteRTPFrame(frame *RTPFrame)
type H264 ¶
type H264 struct {
Video
}
func (*H264) CompleteRTP ¶ added in v4.10.0
func (vt *H264) CompleteRTP(value *AVFrame[NALUSlice])
RTP格式补完
func (*H264) WriteRTPFrame ¶ added in v4.10.0
func (vt *H264) WriteRTPFrame(frame *RTPFrame)
func (*H264) WriteSliceBytes ¶ added in v4.10.0
type H265 ¶
type H265 struct {
Video
}
func (*H265) CompleteRTP ¶ added in v4.10.0
func (vt *H265) CompleteRTP(value *AVFrame[NALUSlice])
RTP格式补完
func (*H265) WriteRTPFrame ¶ added in v4.10.0
func (vt *H265) WriteRTPFrame(frame *RTPFrame)
func (*H265) WriteSliceBytes ¶ added in v4.10.0
type Media ¶
type Media[T RawSlice] struct { Base AVRing[T] SampleRate uint32 SSRC uint32 DecoderConfiguration DecoderConfiguration[T] `json:"-"` //H264(SPS、PPS) H265(VPS、SPS、PPS) AAC(config) RTPMuxer RTPDemuxer SpesificTrack[T] `json:"-"` // contains filtered or unexported fields }
Media 基础媒体Track类
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]) SetSpeedLimit ¶ added in v4.8.6
func (*Media[T]) UnmarshalRTP ¶
func (*Media[T]) UnmarshalRTPPacket ¶
func (*Media[T]) WriteRTPPack ¶ added in v4.9.5
WriteRTPPack 写入已反序列化的RTP包
type RTPDemuxer ¶ added in v4.8.2
type RTPDemuxer struct {
// contains filtered or unexported fields
}
type SpesificTrack ¶ added in v4.10.0
type SpesificTrack[T RawSlice] interface { CompleteRTP(*AVFrame[T]) CompleteAVCC(*AVFrame[T]) WriteSliceBytes([]byte) WriteRTPFrame(*RTPFrame) Flush() // contains filtered or unexported methods }
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) CompleteAVCC ¶ added in v4.10.0
func (vt *Video) CompleteAVCC(rv *AVFrame[NALUSlice])
func (*Video) GetDecConfSeq ¶
func (*Video) PlayFullAnnexB ¶ added in v4.7.0
PlayFullAnnexB 订阅annex-b格式的流数据,每一个I帧增加sps、pps头
func (*Video) SetLostFlag ¶ added in v4.8.6
func (vt *Video) SetLostFlag()
func (*Video) SnapForJson ¶ added in v4.5.1
func (vt *Video) SnapForJson()
func (*Video) WriteAnnexB ¶
func (*Video) WriteRawBytes ¶ added in v4.10.0
func (*Video) WriteSliceByte ¶ added in v4.10.0
Click to show internal directories.
Click to hide internal directories.