streamcontrol

package
v0.0.0-...-56f78af Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStreamProfiles

func ConvertStreamProfiles[T StreamProfile](
	ctx context.Context,
	m map[ProfileName]AbstractStreamProfile,
) error

func GetPlatformSpecificConfig

func GetPlatformSpecificConfig[T any](
	ctx context.Context,
	platCfgCfg any,
) T

func InitConfig

func InitConfig[T any, S StreamProfile](cfg Config, id PlatformName, platCfg PlatformConfig[T, S])

func ToAbstractStreamProfiles

func ToAbstractStreamProfiles[S StreamProfile](in map[ProfileName]S) map[ProfileName]AbstractStreamProfile

Types

type AbstractPlatformConfig

type AbstractPlatformConfig = PlatformConfig[any, AbstractStreamProfile]

type AbstractStreamController

type AbstractStreamController interface {
	StreamController[AbstractStreamProfile]
	GetImplementation() StreamControllerCommons
	StreamProfileType() reflect.Type
}

type AbstractStreamProfile

type AbstractStreamProfile interface {
	GetParent() (ProfileName, bool)
	GetOrder() int
}

type Config

func (*Config) UnmarshalYAML

func (cfg *Config) UnmarshalYAML(b []byte) error

type ErrInvalidStreamProfileType

type ErrInvalidStreamProfileType struct {
	Received AbstractStreamProfile
	Expected AbstractStreamProfile
}

func (ErrInvalidStreamProfileType) Error

type ErrNoStreamControllerForProfile

type ErrNoStreamControllerForProfile struct {
	StreamProfile AbstractStreamProfile
}

func (ErrNoStreamControllerForProfile) Error

type PlatformConfig

type PlatformConfig[T any, S StreamProfile] struct {
	Config         T
	StreamProfiles StreamProfiles[S]
}

func ConvertPlatformConfig

func ConvertPlatformConfig[T any, S StreamProfile](
	ctx context.Context,
	platCfg *AbstractPlatformConfig,
) *PlatformConfig[T, S]

func GetPlatformConfig

func GetPlatformConfig[T any, S StreamProfile](
	ctx context.Context,
	cfg Config,
	id PlatformName,
) *PlatformConfig[T, S]

func (PlatformConfig[T, S]) GetStreamProfile

func (cfg PlatformConfig[T, S]) GetStreamProfile(name ProfileName) (S, bool)

type PlatformName

type PlatformName string

type ProfileName

type ProfileName string

type RawMessage

type RawMessage json.RawMessage

func (RawMessage) GetOrder

func (RawMessage) GetOrder() int

func (RawMessage) GetParent

func (RawMessage) GetParent() (ProfileName, bool)

func (RawMessage) MarshalJSON

func (m RawMessage) MarshalJSON() ([]byte, error)

func (RawMessage) MarshalYAML

func (m RawMessage) MarshalYAML() ([]byte, error)

func (*RawMessage) UnmarshalJSON

func (m *RawMessage) UnmarshalJSON(b []byte) error

func (*RawMessage) UnmarshalYAML

func (m *RawMessage) UnmarshalYAML(b []byte) error

type StreamController

type StreamController[ProfileType StreamProfile] interface {
	StreamControllerCommons

	ApplyProfile(ctx context.Context, profile ProfileType, customArgs ...any) error
	StartStream(ctx context.Context, title string, description string, profile ProfileType, customArgs ...any) error
}

type StreamControllerCommons

type StreamControllerCommons interface {
	SetTitle(ctx context.Context, title string) error
	SetDescription(ctx context.Context, description string) error
	InsertAdsCuePoint(ctx context.Context, ts time.Time, duration time.Duration) error
	Flush(ctx context.Context) error
	EndStream(ctx context.Context) error
}

type StreamControllers

type StreamControllers []AbstractStreamController

func (StreamControllers) ApplyProfiles

func (s StreamControllers) ApplyProfiles(
	ctx context.Context,
	profiles []AbstractStreamProfile,
) error

func (StreamControllers) EndStream

func (s StreamControllers) EndStream(
	ctx context.Context,
) error

func (StreamControllers) Flush

func (s StreamControllers) Flush(
	ctx context.Context,
) error

func (StreamControllers) InsertAdsCuePoint

func (s StreamControllers) InsertAdsCuePoint(
	ctx context.Context,
	ts time.Time,
	duration time.Duration,
) error

func (StreamControllers) SetDescription

func (s StreamControllers) SetDescription(
	ctx context.Context,
	description string,
) error

func (StreamControllers) SetTitle

func (s StreamControllers) SetTitle(
	ctx context.Context,
	title string,
) error

func (StreamControllers) StartStream

func (s StreamControllers) StartStream(
	ctx context.Context,
	title string,
	description string,
	profiles []AbstractStreamProfile,
	customArgs ...any,
) error

type StreamProfile

type StreamProfile interface {
	AbstractStreamProfile
}

type StreamProfileBase

type StreamProfileBase struct {
	Parent ProfileName
	Order  int
}

func (StreamProfileBase) GetOrder

func (profile StreamProfileBase) GetOrder() int

func (StreamProfileBase) GetParent

func (profile StreamProfileBase) GetParent() (ProfileName, bool)

func (*StreamProfileBase) SetOrder

func (profile *StreamProfileBase) SetOrder(v int)

type StreamProfiles

type StreamProfiles[S StreamProfile] map[ProfileName]S

func GetStreamProfiles

func GetStreamProfiles[S StreamProfile](streamProfiles map[ProfileName]AbstractStreamProfile) StreamProfiles[S]

func (StreamProfiles[S]) Get

func (profiles StreamProfiles[S]) Get(name ProfileName) (S, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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