v2l

package
v0.0.0-...-c0ee475 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAssetPaths

func AddAssetPaths(server string, assetPaths []AssetPath) error

AddAssetPaths - add all directories containing a content_info.json file

func DeleteAllAssetPaths

func DeleteAllAssetPaths(server string) error

DeleteAllAssetPaths - delete all asset paths from server

func DeleteChannel

func DeleteChannel(server, channelName string) error

func UpdateSchedule

func UpdateSchedule(server string, channel *Channel, assetPaths []AssetPath, now time.Time) error

updateSchedule - update schedule by removing old entries and adding new for old ones, the limit is now - sliding window for new ones, a new asset or ad will be added if within 30s of end of schedule. GopNrAtScheduleStart and GopNrAfterLastAd must have consistent values.

Types

type AssetPath

type AssetPath struct {
	ID   string `json:"id"`
	Path string `json:"path"`
}

AssetPath - minimal information about an asset

func DiscoverAssetPaths

func DiscoverAssetPaths(dir string) ([]AssetPath, error)

DiscoverAssetPaths - add all directories containing a content_info.json file

type Channel

type Channel struct {
	// Unique name
	Name string `json:"name"`
	// Exact millisecond duration of all video GoPs in all assets
	GopDurMS int64 `json:"gopDurMS"`
	// How many GoPs to include in an average output segment
	NrGopsPerSeg int64 `json:"nrGopsPerSegment"`
	// ID of asset defining the valid tracks, bitrates etc
	MasterAssetID string `json:"masterAssetID"`
	// Path to content template
	ContentTemplatePath string `json:"contentTemplatePath"`
	// Start time relative epoch (1970-01-01) in seconds
	StartTimeS int64 `json:"startTimeS"`
	// Loop schedule or not
	DoLoop bool `json:"doLoop"`
	// The current scedule of the channel
	Schedule *Schedule `json:"schedule"`
	// LastSCTEEventID - internal book keeping for incrementing SCTE Event ID
	LastSCTEEventID int64 `json:"-"`
	// SlidingWindowNrGops - internal constant for how long sliding window to use
	SlidingWindowNrGops int64 `json:"-"`
	// FutureScheduleNrGops - threshold for when to add future entries to schedule
	FutureScheduleNrGops int64 `json:"-"`
}

func CreateChannel

func CreateChannel(server, chName, contentTemplatePath string, gopDurMS, nrGopsPerSegment, slidingWindowNrGops, futureScheduleNrGops int64,
	assetPaths []AssetPath) (*Channel, error)

CreateChannel - create a channel with two assets and an ad in between

type Entry

type Entry struct {
	// Name to include in EPG
	Name string `json:"name"`
	// Asset identifier
	AssetID string `json:"assetID"`
	// Zero-based GoP nr to start in asset. Negative value means from end
	Offset int64 `json:"offset"`
	// How many GoPs to play in asset. 0 is until end of asset. Beyond end results in wrap to start
	Len int64 `json:"length"`
	// SCTE-35 Event ID in SCTE message. A non-zero value signals an ad
	SCTEEventID int64 `json:"scteEventID"`
}

Entry is a specific entry based on an asset. Negative offsets (counting from end) are replaced with positive during config parsing Zero Len is replaced with length in Gops until end of asset during config parsing.

type Schedule

type Schedule struct {
	GopNrAtScheduleStart int64   `json:"gopNrAtScheduleStart"`
	GopNrAfterLastAd     int64   `json:"gopNrAfterLastAd"`
	Entries              []Entry `json:"entries"` // list of programs or other entries
}

Jump to

Keyboard shortcuts

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