nativehost

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureState

type CaptureState struct {
	State           string                        `json:"state"`
	HardwareOnly    bool                          `json:"hardwareOnly"`
	Codec           string                        `json:"codec"`
	AdapterIndex    *uint32                       `json:"adapterIndex,omitempty"`
	AdapterName     string                        `json:"adapterName,omitempty"`
	AdapterIdentity string                        `json:"adapterIdentity,omitempty"`
	EncoderIndex    *uint32                       `json:"encoderIndex,omitempty"`
	EncoderName     string                        `json:"encoderName,omitempty"`
	EncoderIdentity string                        `json:"encoderIdentity,omitempty"`
	ProfileLevelID  string                        `json:"profileLevelId,omitempty"`
	Width           uint32                        `json:"width,omitempty"`
	Height          uint32                        `json:"height,omitempty"`
	FPS             uint32                        `json:"fps,omitempty"`
	RestoreToken    string                        `json:"restoreToken,omitempty"`
	Outputs         []nativecapture.OutputProfile `json:"outputs"`
	// contains filtered or unexported fields
}

type Event

type Event struct {
	Current               func() bool
	SourceAudio           bool
	Microphone            bool
	Failed                bool
	Type                  string
	ShareID               string
	ConnectionID          string
	PublicationGeneration string
	Candidate             *webrtc.ICECandidateInit
	State                 string
	LocalType             string
	RemoteType            string
	NatTraversalPath      string
	Quality               *mediaedge.QualitySample
	PublicationQuality    *mediaedge.PublicationQualitySample
}

type Options

type Options struct {
	ShareID          string
	CaptureProcess   string
	Video            nativecapture.VideoOptions
	Profile          QualityProfile
	AudioEnabled     bool
	ExcludeAudio     *nativecapture.CaptureTarget
	MicrophoneMixing bool
	EdgeCapacity     int
	BindAddress      string
	PortMapping      bool
	Events           func(context.Context, Event)
}

type QualityProfile

type QualityProfile struct {
	Video        nativecapture.VideoProfile
	AudioBitrate int
}

func (QualityProfile) Valid

func (profile QualityProfile) Valid() bool

type Session

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

func Start

func Start(parent context.Context, options Options) (*Session, error)

func (*Session) AddCandidate

func (session *Session) AddCandidate(
	connectionID string,
	candidate *webrtc.ICECandidateInit,
) error

func (*Session) Close

func (session *Session) Close() error

func (*Session) CloseEdge

func (session *Session) CloseEdge(connectionID string)

func (*Session) ClosePublication

func (session *Session) ClosePublication(generation, connectionID string)

func (*Session) Codec

func (session *Session) Codec() string

func (*Session) Done

func (session *Session) Done() <-chan error

func (*Session) HasAudio

func (session *Session) HasAudio() bool

func (*Session) PrepareEdge

func (session *Session) PrepareEdge(
	connectionID string,
	iceServers []webrtc.ICEServer,
) (webrtc.SessionDescription, error)

func (*Session) PrepareLocalEdge

func (session *Session) PrepareLocalEdge(
	connectionID string,
) (webrtc.SessionDescription, error)

func (*Session) PreparePublication

func (session *Session) PreparePublication(generation, connectionID string, servers []webrtc.ICEServer) (webrtc.SessionDescription, mediaedge.PublicationMedia, error)

func (*Session) Publication

func (session *Session) Publication(generation, connectionID string) (*mediaedge.Publication, error)

func (*Session) ReplaceSource

func (session *Session) ReplaceSource(
	options nativecapture.VideoOptions,
	audioEnabled bool,
	excludeAudio *nativecapture.CaptureTarget,
) error

func (*Session) SetAnswer

func (session *Session) SetAnswer(connectionID string, answer webrtc.SessionDescription) error

func (*Session) SetMicrophone added in v1.6.0

func (session *Session) SetMicrophone(enabled *bool, gain *float64, deviceID *string) error

func (*Session) SetPaused

func (session *Session) SetPaused(paused bool)

func (*Session) ShareID

func (session *Session) ShareID() string

func (*Session) SourceAudio added in v1.6.0

func (session *Session) SourceAudio() *bool

Optional facts are emitted only to a page which opted into mixed audio.

func (*Session) UpdateProfile

func (session *Session) UpdateProfile(profile QualityProfile) error

Jump to

Keyboard shortcuts

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