Documentation ¶
Overview ¶
Package mock provides mock Interceptor for testing.
Index ¶
- type Factory
- type Interceptor
- func (i *Interceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
- func (i *Interceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
- func (i *Interceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
- func (i *Interceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
- func (i *Interceptor) Close() error
- func (i *Interceptor) UnbindLocalStream(info *interceptor.StreamInfo)
- func (i *Interceptor) UnbindRemoteStream(info *interceptor.StreamInfo)
- type RTCPReader
- type RTCPWriter
- type RTPReader
- type RTPWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
NewInterceptorFn func(id string) (interceptor.Interceptor, error)
}
Factory is a mock Factory for testing.
func (*Factory) NewInterceptor ¶
func (f *Factory) NewInterceptor(id string) (interceptor.Interceptor, error)
NewInterceptor implements Interceptor
type Interceptor ¶
type Interceptor struct { BindRTCPReaderFn func(reader interceptor.RTCPReader) interceptor.RTCPReader BindRTCPWriterFn func(writer interceptor.RTCPWriter) interceptor.RTCPWriter BindLocalStreamFn func(i *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter UnbindLocalStreamFn func(i *interceptor.StreamInfo) BindRemoteStreamFn func(i *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader UnbindRemoteStreamFn func(i *interceptor.StreamInfo) CloseFn func() error }
Interceptor is an mock Interceptor fot testing.
func (*Interceptor) BindLocalStream ¶
func (i *Interceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
BindLocalStream implements Interceptor.
func (*Interceptor) BindRTCPReader ¶
func (i *Interceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
BindRTCPReader implements Interceptor.
func (*Interceptor) BindRTCPWriter ¶
func (i *Interceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
BindRTCPWriter implements Interceptor.
func (*Interceptor) BindRemoteStream ¶
func (i *Interceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
BindRemoteStream implements Interceptor.
func (*Interceptor) UnbindLocalStream ¶
func (i *Interceptor) UnbindLocalStream(info *interceptor.StreamInfo)
UnbindLocalStream implements Interceptor.
func (*Interceptor) UnbindRemoteStream ¶
func (i *Interceptor) UnbindRemoteStream(info *interceptor.StreamInfo)
UnbindRemoteStream implements Interceptor.
type RTCPReader ¶
type RTCPReader struct {
ReadFn func([]byte, interceptor.Attributes) (int, interceptor.Attributes, error)
}
RTCPReader is a mock RTCPReader.
func (*RTCPReader) Read ¶
func (r *RTCPReader) Read(b []byte, attributes interceptor.Attributes) (int, interceptor.Attributes, error)
Read implements RTCPReader.
type RTCPWriter ¶
type RTCPWriter struct {
WriteFn func([]rtcp.Packet, interceptor.Attributes) (int, error)
}
RTCPWriter is a mock RTCPWriter.
func (*RTCPWriter) Write ¶
func (w *RTCPWriter) Write(pkts []rtcp.Packet, attributes interceptor.Attributes) (int, error)
Write implements RTCPWriter.
type RTPReader ¶
type RTPReader struct {
ReadFn func([]byte, interceptor.Attributes) (int, interceptor.Attributes, error)
}
RTPReader is a mock RTPReader.
func (*RTPReader) Read ¶
func (r *RTPReader) Read(b []byte, attributes interceptor.Attributes) (int, interceptor.Attributes, error)
Read implements RTPReader.
type RTPWriter ¶
type RTPWriter struct {
WriteFn func(*rtp.Header, []byte, interceptor.Attributes) (int, error)
}
RTPWriter is a mock RTPWriter.
func (*RTPWriter) Write ¶
func (w *RTPWriter) Write(header *rtp.Header, payload []byte, attributes interceptor.Attributes) (int, error)
Write implements RTPWriter.