roc

package
v0.0.0-...-692ba52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidArguments indicates that one or more arguments passed to the function
	// are invalid
	ErrInvalidArguments = errors.New("One or more arguments are invalid")

	// ErrInvalidApi should never happen and indicates that the API don't follow the
	// declared contract
	ErrInvalidApi = errors.New("Invalid return code from API")

	// ErrRuntime indicates a runtime error: memory allocation error etc
	ErrRuntime = errors.New("Runtime error")
)

Functions

func SetLogLevel

func SetLogLevel(level LogLevel)

func SetLogger

func SetLogger(logger Logger)

func SetLoggerFunc

func SetLoggerFunc(logFn LoggerFunc)

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

Address as declared in roc/address.h:59

func NewAddress

func NewAddress(family Family, ip string, port int) (*Address, error)

NewAddress parses the `ip`, `port` and `family` and initializes the Address object

func (*Address) Family

func (a *Address) Family() (Family, error)

func (*Address) IP

func (a *Address) IP() (string, error)

func (*Address) Port

func (a *Address) Port() (int, error)

type ChannelSet

type ChannelSet int32

ChannelSet as declared in roc/config.h:108

const (
	ChannelSetStereo ChannelSet = 2
)

ChannelSet enumeration from roc/config.h:108

type Context

type Context C.roc_context

Context as declared in roc/context.h:41

func OpenContext

func OpenContext(contextConfig *ContextConfig) (*Context, error)

func (*Context) Close

func (c *Context) Close() error

type ContextConfig

type ContextConfig struct {
	MaxPacketSize uint32
	MaxFrameSize  uint32
}

ContextConfig as declared in roc/config.h:147

type Family

type Family int32

Family as declared in roc/address.h:36

const (
	AfInvalid Family = -1
	AfAuto    Family = 0
	AfIpv4    Family = 1
	AfIpv6    Family = 2
)

Family enumeration from roc/address.h:36

type FecCode

type FecCode int32

FecCode as declared in roc/config.h:81

const (
	FecDisable       FecCode = -1
	FecDefault       FecCode = 0
	FecRs8m          FecCode = 1
	FecLdpcStaircase FecCode = 2
)

FecCode enumeration from roc/config.h:81

type FrameEncoding

type FrameEncoding int32

FrameEncoding as declared in roc/config.h:100

const (
	FrameEncodingPcmFloat FrameEncoding = 1
)

FrameEncoding enumeration from roc/config.h:100

type LogLevel

type LogLevel int
const (
	LogNone  LogLevel = 0
	LogError LogLevel = 1
	LogInfo  LogLevel = 2
	LogDebug LogLevel = 3
	LogTrace LogLevel = 4
)

type Logger

type Logger interface {
	Print(v ...interface{})
}

type LoggerFunc

type LoggerFunc func(level LogLevel, component string, message string)

type PacketEncoding

type PacketEncoding int32

PacketEncoding as declared in roc/config.h:91

const (
	PacketEncodingAvpL16 PacketEncoding = 2
)

PacketEncoding enumeration from roc/config.h:91

type PortType

type PortType int32

PortType as declared in roc/config.h:35

const (
	PortAudioSource PortType = 1
	PortAudioRepair PortType = 2
)

PortType enumeration from roc/config.h:35

type Protocol

type Protocol int32

Protocol as declared in roc/config.h:54

const (
	ProtoRtp           Protocol = 1
	ProtoRtpRs8mSource Protocol = 2
	ProtoRs8mRepair    Protocol = 3
	ProtoRtpLdpcSource Protocol = 4
	ProtoLdpcRepair    Protocol = 5
)

Protocol enumeration from roc/config.h:54

type Receiver

type Receiver C.roc_receiver

Receiver as declared in roc/receiver.h:117

func OpenReceiver

func OpenReceiver(rocContext *Context, receiverConfig *ReceiverConfig) (*Receiver, error)

func (*Receiver) Close

func (r *Receiver) Close() error

type ReceiverConfig

type ReceiverConfig struct {
	FrameSampleRate         uint32
	FrameChannels           ChannelSet
	FrameEncoding           FrameEncoding
	AutomaticTiming         uint32
	ResamplerProfile        ResamplerProfile
	TargetLatency           uint64
	MaxLatencyOverrun       uint64
	MaxLatencyUnderrun      uint64
	NoPlaybackTimeout       int64
	BrokenPlaybackTimeout   int64
	BreakageDetectionWindow uint64
}

ReceiverConfig as declared in roc/config.h:316

type ResamplerProfile

type ResamplerProfile int32

ResamplerProfile as declared in roc/config.h:128

const (
	ResamplerDisable ResamplerProfile = -1
	ResamplerDefault ResamplerProfile = 0
	ResamplerHigh    ResamplerProfile = 1
	ResamplerMedium  ResamplerProfile = 2
	ResamplerLow     ResamplerProfile = 3
)

ResamplerProfile enumeration from roc/config.h:128

type Sender

type Sender C.roc_sender

Sender as declared in roc/sender.h:96

type SenderConfig

type SenderConfig struct {
	FrameSampleRate       uint32
	FrameChannels         ChannelSet
	FrameEncoding         FrameEncoding
	PacketSampleRate      uint32
	PacketChannels        ChannelSet
	PacketEncoding        PacketEncoding
	PacketLength          uint64
	PacketInterleaving    uint32
	AutomaticTiming       uint32
	ResamplerProfile      ResamplerProfile
	FecCode               FecCode
	FecBlockSourcePackets uint32
	FecBlockRepairPackets uint32
}

SenderConfig as declared in roc/config.h:234

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL