Documentation ¶
Overview ¶
Package tuner implements an ATSC tuner that outputs WebRTC video and audio tracks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // VideoCodecCapability represents the RTP codec settings for the video signal // produced by the tuner. VideoCodecCapability = webrtc.RTPCodecCapability{ MimeType: webrtc.MimeTypeH264, ClockRate: 90_000, SDPFmtpLine: videoCodecFMTP, } // AudioCodecCapability represents the RTP codec settings for the audio signal // produced by the tuner. AudioCodecCapability = webrtc.RTPCodecCapability{ MimeType: webrtc.MimeTypeOpus, ClockRate: 48_000, Channels: 2, } )
var ErrChannelNotFound error = errors.New("channel not found")
ErrChannelNotFound is returned when tuning to a channel whose name is not in the tuner's channel list.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State int
State represents the current state of the tuner.
const ( // StateStopped means the tuner is switched off. StateStopped State = iota // StateStarting means that the tuner is trying to lock onto a signal and // start streaming. StateStarting // StatePlaying means that the tuner is locked onto a singal and is actively // streaming video. StatePlaying )
type Tracks ¶
type Tracks struct { Video webrtc.TrackLocal Audio webrtc.TrackLocal }
Tracks represents the current set of video and audio tracks for use by WebRTC clients.
type Tuner ¶
type Tuner struct {
// contains filtered or unexported fields
}
Tuner represents an ATSC tuner whose video and audio signals are encoded for use by WebRTC clients, and whose consumers are notified of ongoing state changes.
func NewTuner ¶
func NewTuner(channels []atsc.Channel, videoPipeline VideoPipeline) *Tuner
NewTuner creates a new Tuner that can tune to any of the provided channels.
func (*Tuner) ChannelNames ¶
ChannelNames returns an iterator over the names of channels that may be passed to Tuner.Tune.
func (*Tuner) Stop ¶
Stop ends any active stream and releases the DVB device associated with this tuner.
func (*Tuner) WatchStatus ¶
WatchStatus sets up a handler function to continuously receive the status of the tuner as it is updated. See the watch package documentation for details.
type VideoPipeline ¶
type VideoPipeline string
VideoPipeline controls which pipeline Hypcast uses to process video.
const ( // VideoPipelineDefault performs software-based video processing. It should // work on a wide variety of machines with little to no additional // configuration. VideoPipelineDefault VideoPipeline = "default" // VideoPipelineLowPower performs software-based video processing with limits // on bitrate, frame rate, and video size. This creates a smoother viewing // experience on servers with limited CPU power, but produces very // low-quality output. VideoPipelineLowPower VideoPipeline = "lowpower" // VideoPipelineVAAPI performs hardware accelerated video processing using // the Video Acceleration API (VA-API). It is more performant than the // default pipeline, but requires installation of gstreamer-vaapi plugins and // may require additional configuration to select an appropriate device and // driver. See GStreamer documentation for details. VideoPipelineVAAPI VideoPipeline = "vaapi" )
func ParseVideoPipeline ¶
func ParseVideoPipeline(name string) VideoPipeline
ParseVideoPipeline selects a VideoPipeline by name. Unknown names will return the default pipeline.