Documentation ¶
Index ¶
- Variables
- func AddDestination[SRC FrameSource, DEST FrameDestination](src SRC, dest DEST) error
- type Attributes
- type AudioFrameSpecificInfo
- type AudioMetadata
- type CodecType
- type Context
- type DataMetadata
- type DestinationInfo
- type EnableClose
- type EnableMetaData
- type FeedbackCmd
- type FeedbackMsg
- type FeedbackType
- type FormatSettings
- type Frame
- type FrameDestination
- type FrameDestinationDeliver
- type FrameDestinationImpl
- func (fd *FrameDestinationImpl) Close()
- func (fd *FrameDestinationImpl) Context() context.Context
- func (fd *FrameDestinationImpl) DeliverFeedback(fb FeedbackMsg) error
- func (fd *FrameDestinationImpl) Format() string
- func (fd *FrameDestinationImpl) FormatSettings() FormatSettings
- func (fd *FrameDestinationImpl) ID() string
- func (fd *FrameDestinationImpl) Metadata() *Metadata
- func (fd *FrameDestinationImpl) OnFrame(frame Frame, attr Attributes)
- func (fd *FrameDestinationImpl) OnMetaData(metadata *Metadata)
- func (fd *FrameDestinationImpl) OnSource(src FrameSource) error
- type FrameDestinationReceiver
- type FrameFormat
- type FrameSource
- type FrameSourceDeliver
- type FrameSourceImpl
- func (fs *FrameSourceImpl) AddDestination(dest FrameDestination) error
- func (fs *FrameSourceImpl) Close()
- func (fs *FrameSourceImpl) Context() context.Context
- func (fs *FrameSourceImpl) DeliverFrame(frame Frame, attr Attributes) error
- func (fs *FrameSourceImpl) DeliverMetaData(metadata Metadata) error
- func (fs *FrameSourceImpl) DestinationCount() int
- func (fs *FrameSourceImpl) Format() string
- func (fs *FrameSourceImpl) FormatSettings() FormatSettings
- func (fs *FrameSourceImpl) ID() string
- func (fs *FrameSourceImpl) Metadata() *Metadata
- func (fs *FrameSourceImpl) OnFeedback(fb FeedbackMsg)
- func (fs *FrameSourceImpl) RemoveDestination(dest FrameDestination) error
- type FrameSourceReceiver
- type FrameSpecificInfo
- type MediaFramePipe
- type MediaFramePipeImpl
- func (m *MediaFramePipeImpl) AddDestination(dest FrameDestination) error
- func (m *MediaFramePipeImpl) Close()
- func (m *MediaFramePipeImpl) Context() context.Context
- func (m *MediaFramePipeImpl) Format() string
- func (m *MediaFramePipeImpl) FormatSettings() FormatSettings
- func (m *MediaFramePipeImpl) ID() string
- func (m *MediaFramePipeImpl) Metadata() *Metadata
- func (m *MediaFramePipeImpl) OnFeedback(fb FeedbackMsg)
- func (m *MediaFramePipeImpl) OnFrame(frame Frame, attr Attributes)
- func (m *MediaFramePipeImpl) OnMetaData(metadata *Metadata)
- type Metadata
- func (md *Metadata) EqualAudioCodec(md2 *Metadata) bool
- func (md *Metadata) EqualVideoCodec(md2 *Metadata) bool
- func (md *Metadata) FormatName() string
- func (md *Metadata) HasAudio() bool
- func (md *Metadata) HasData() bool
- func (md *Metadata) HasVideo() bool
- func (md *Metadata) MatchFormat(md2 *Metadata) bool
- func (md *Metadata) String() string
- func (md *Metadata) ToFormatSettings() FormatSettings
- type PacketType
- type VideoFrameSpecificInfo
- type VideoMetadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFrameSourceClosed = errors.New("frame source closed") ErrFrameDestinationClosed = errors.New("frame destination closed") ErrFrameDestinationExists = errors.New("frame destination exists") ErrCodecNotSupported = errors.New("codec not supported") ErrFrameSourceAudioNotSupport = errors.New("audio not support") ErrFrameSourceVideoNotSupport = errors.New("video not support") )
Functions ¶
func AddDestination ¶
func AddDestination[SRC FrameSource, DEST FrameDestination](src SRC, dest DEST) error
Types ¶
type Attributes ¶
type Attributes map[interface{}]interface{}
func (Attributes) Get ¶
func (a Attributes) Get(key interface{}) interface{}
Get returns the attribute associated with key.
func (Attributes) Set ¶
func (a Attributes) Set(key interface{}, val interface{})
Set sets the attribute associated with key to the given value.
type AudioFrameSpecificInfo ¶
type AudioFrameSpecificInfo struct { NbSamples uint32 `json:"nbSamples"` SampleRate uint32 `json:"sampleRate"` Channels uint8 `json:"channels"` Voice uint8 `json:"voice"` AudioLevel uint8 `json:"audioLevel"` }
func (*AudioFrameSpecificInfo) String ¶
func (afsi *AudioFrameSpecificInfo) String() string
type AudioMetadata ¶
type CodecType ¶
type CodecType int
const ( CodecTypeNone CodecType = 0 + iota CodecTypeI420 CodecTypeVP8 CodecTypeVP9 CodecTypeH264 CodecTypeH265 CodecTypeAV1 CodecTypeMSDK CodecTypePCM_48000_2 CodecTypePCMU CodecTypePCMA CodecTypeOpus CodecTypeISAC16 CodecTypeISAC32 CodecTypeILBC CodecTypeG722_16000_1 CodecTypeG722_16000_2 CodecTypeAAC CodecTypeAAC_48000_2 CodecTypeAC3 CodecTypeNellymoser )
func ConvCodecType ¶
type DataMetadata ¶
type DataMetadata struct { Codec string `json:"codec"` Type PacketType `json:"type"` }
type DestinationInfo ¶
type EnableClose ¶
type EnableClose interface {
Close()
}
type EnableMetaData ¶
type EnableMetaData interface {
Metadata() *Metadata
}
type FeedbackCmd ¶
type FeedbackCmd int
const ( FeedbackCmdUnknown FeedbackCmd = 0 + iota FeedbackCmdKeyFrame FeedbackCmdNack FeedbackCmdPLI FeedbackCmdFIR FeedbackCmdSLI FeedbackCmdRPSI )
type FeedbackMsg ¶
type FeedbackMsg struct { Type FeedbackType Cmd FeedbackCmd }
type FeedbackType ¶
type FeedbackType int
const ( FeedbackTypeUnknown FeedbackType = 0 + iota FeedbackTypeAudio FeedbackTypeVideo FeedbackTypeData )
type FormatSettings ¶
type FormatSettings struct { AudioCandidates []AudioMetadata `json:"audioCandidates"` VideoCandidates []VideoMetadata `json:"videoCandidates"` DataCandidates []DataMetadata `json:"dataCandidates"` PacketType PacketType `json:"packetType"` }
type Frame ¶
type Frame struct { Codec CodecType PacketType PacketType Payload []byte RawPacket interface{} Length int TimeStamp uint32 AdditionalInfo FrameSpecificInfo }
type FrameDestination ¶
type FrameDestination interface { Context FrameDestinationReceiver FrameDestinationDeliver EnableClose EnableMetaData FrameFormat }
func NewFrameDestinationImpl ¶
func NewFrameDestinationImpl(ctx context.Context, settings FormatSettings) FrameDestination
type FrameDestinationDeliver ¶
type FrameDestinationDeliver interface { DeliverFeedback(fb FeedbackMsg) error OnSource(src FrameSource) error // contains filtered or unexported methods }
type FrameDestinationImpl ¶
type FrameDestinationImpl struct {
// contains filtered or unexported fields
}
func (*FrameDestinationImpl) Close ¶
func (fd *FrameDestinationImpl) Close()
func (*FrameDestinationImpl) Context ¶
func (fd *FrameDestinationImpl) Context() context.Context
func (*FrameDestinationImpl) DeliverFeedback ¶
func (fd *FrameDestinationImpl) DeliverFeedback(fb FeedbackMsg) error
func (*FrameDestinationImpl) Format ¶
func (fd *FrameDestinationImpl) Format() string
func (*FrameDestinationImpl) FormatSettings ¶
func (fd *FrameDestinationImpl) FormatSettings() FormatSettings
func (*FrameDestinationImpl) ID ¶
func (fd *FrameDestinationImpl) ID() string
func (*FrameDestinationImpl) Metadata ¶
func (fd *FrameDestinationImpl) Metadata() *Metadata
func (*FrameDestinationImpl) OnFrame ¶
func (fd *FrameDestinationImpl) OnFrame(frame Frame, attr Attributes)
func (*FrameDestinationImpl) OnMetaData ¶
func (fd *FrameDestinationImpl) OnMetaData(metadata *Metadata)
func (*FrameDestinationImpl) OnSource ¶
func (fd *FrameDestinationImpl) OnSource(src FrameSource) error
type FrameDestinationReceiver ¶
type FrameDestinationReceiver interface { OnFrame(frame Frame, attr Attributes) OnMetaData(metadata *Metadata) }
type FrameFormat ¶
type FrameFormat interface { Format() string FormatSettings() FormatSettings }
type FrameSource ¶
type FrameSource interface { Context FrameSourceDeliver FrameSourceReceiver EnableClose EnableMetaData FrameFormat }
func NewFrameSourceImpl ¶
func NewFrameSourceImpl(ctx context.Context, metadata Metadata) FrameSource
type FrameSourceDeliver ¶
type FrameSourceDeliver interface { DeliverFrame(frame Frame, attr Attributes) error DeliverMetaData(metadata Metadata) error DestinationCount() int AddDestination(dest FrameDestination) error RemoveDestination(dest FrameDestination) error // contains filtered or unexported methods }
type FrameSourceImpl ¶
type FrameSourceImpl struct {
// contains filtered or unexported fields
}
func (*FrameSourceImpl) AddDestination ¶
func (fs *FrameSourceImpl) AddDestination(dest FrameDestination) error
func (*FrameSourceImpl) Close ¶
func (fs *FrameSourceImpl) Close()
func (*FrameSourceImpl) Context ¶
func (fs *FrameSourceImpl) Context() context.Context
func (*FrameSourceImpl) DeliverFrame ¶
func (fs *FrameSourceImpl) DeliverFrame(frame Frame, attr Attributes) error
func (*FrameSourceImpl) DeliverMetaData ¶
func (fs *FrameSourceImpl) DeliverMetaData(metadata Metadata) error
func (*FrameSourceImpl) DestinationCount ¶
func (fs *FrameSourceImpl) DestinationCount() int
func (*FrameSourceImpl) Format ¶
func (fs *FrameSourceImpl) Format() string
func (*FrameSourceImpl) FormatSettings ¶
func (fs *FrameSourceImpl) FormatSettings() FormatSettings
func (*FrameSourceImpl) ID ¶
func (fs *FrameSourceImpl) ID() string
func (*FrameSourceImpl) Metadata ¶
func (fs *FrameSourceImpl) Metadata() *Metadata
func (*FrameSourceImpl) OnFeedback ¶
func (fs *FrameSourceImpl) OnFeedback(fb FeedbackMsg)
func (*FrameSourceImpl) RemoveDestination ¶
func (fs *FrameSourceImpl) RemoveDestination(dest FrameDestination) error
type FrameSourceReceiver ¶
type FrameSourceReceiver interface {
OnFeedback(fb FeedbackMsg)
}
type FrameSpecificInfo ¶
type FrameSpecificInfo interface {
String() string
}
type MediaFramePipe ¶
type MediaFramePipe interface { Context FrameDestinationReceiver FrameDestinationDeliver FrameSourceDeliver FrameSourceReceiver EnableClose EnableMetaData FrameFormat }
func NewMediaFramePipe ¶
func NewMediaFramePipe(ctx context.Context, fmtSettings FormatSettings) MediaFramePipe
type MediaFramePipeImpl ¶
type MediaFramePipeImpl struct { FrameDestination FrameSource // contains filtered or unexported fields }
func (*MediaFramePipeImpl) AddDestination ¶
func (m *MediaFramePipeImpl) AddDestination(dest FrameDestination) error
func (*MediaFramePipeImpl) Close ¶
func (m *MediaFramePipeImpl) Close()
func (*MediaFramePipeImpl) Context ¶
func (m *MediaFramePipeImpl) Context() context.Context
func (*MediaFramePipeImpl) Format ¶
func (m *MediaFramePipeImpl) Format() string
func (*MediaFramePipeImpl) FormatSettings ¶
func (m *MediaFramePipeImpl) FormatSettings() FormatSettings
func (*MediaFramePipeImpl) ID ¶
func (m *MediaFramePipeImpl) ID() string
func (*MediaFramePipeImpl) Metadata ¶
func (m *MediaFramePipeImpl) Metadata() *Metadata
func (*MediaFramePipeImpl) OnFeedback ¶
func (m *MediaFramePipeImpl) OnFeedback(fb FeedbackMsg)
func (*MediaFramePipeImpl) OnFrame ¶
func (m *MediaFramePipeImpl) OnFrame(frame Frame, attr Attributes)
func (*MediaFramePipeImpl) OnMetaData ¶
func (m *MediaFramePipeImpl) OnMetaData(metadata *Metadata)
type Metadata ¶
type Metadata struct { Audio *AudioMetadata `json:"audio"` Video *VideoMetadata `json:"video"` Data *DataMetadata `json:"data"` PacketType PacketType `json:"packetType"` }
func (*Metadata) EqualAudioCodec ¶
func (*Metadata) EqualVideoCodec ¶
func (*Metadata) FormatName ¶
func (*Metadata) MatchFormat ¶
func (*Metadata) ToFormatSettings ¶
func (md *Metadata) ToFormatSettings() FormatSettings
type PacketType ¶
type PacketType int
const ( PacketTypeUnknown PacketType = 0 + iota PacketTypeRtp PacketTypeRaw PacketTypeFlv PacketTypeRtmp PacketTypeTs )
func (PacketType) String ¶
func (pt PacketType) String() string
type VideoFrameSpecificInfo ¶
type VideoFrameSpecificInfo struct { Width uint16 `json:"width"` Height uint16 `json:"height"` IsKeyFrame bool `json:"isKeyFrame"` }
func (*VideoFrameSpecificInfo) String ¶
func (vfsi *VideoFrameSpecificInfo) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.