caps

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package caps builds neutral client capabilities from protocol profiles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct{ Learn, Rules Layer }

func (Builder) Build

func (b Builder) Build(ctx context.Context, device DeviceInfo, profile DeviceProfile, protocolInfo []string, userAgent string) (core.ClientCaps, error)

Build merges declarations, then applies learning followed by owner rules.

type CodecProfile

type CodecProfile struct {
	Type            string             `json:"Type"`
	Codec           string             `json:"Codec"`
	Container       string             `json:"Container"`
	SubContainer    string             `json:"SubContainer"`
	Conditions      []ProfileCondition `json:"Conditions"`
	ApplyConditions []ProfileCondition `json:"ApplyConditions"`
}

func (*CodecProfile) UnmarshalJSON

func (p *CodecProfile) UnmarshalJSON(data []byte) error

type ContainerProfile

type ContainerProfile struct {
	Type         string             `json:"Type"`
	Container    string             `json:"Container"`
	SubContainer string             `json:"SubContainer"`
	Conditions   []ProfileCondition `json:"Conditions"`
}

func (*ContainerProfile) UnmarshalJSON

func (p *ContainerProfile) UnmarshalJSON(data []byte) error

type DeviceInfo

type DeviceInfo struct {
	Protocol                                                 core.Protocol
	Product, Platform, Version, Device, DeviceName, ClientID string
	VideoCodecs, AudioCodecs, Containers                     []string
	SubtitleCodecs                                           []string
	DVProfiles                                               []int
	MaxHeight, MaxBitrateKbps                                int
	HDR10, DolbyVision                                       bool
	Remote, Download                                         bool
}

DeviceInfo is the neutral subset of a Silo or other client's declaration.

type DeviceProfile

type DeviceProfile struct {
	DirectPlayProfiles                        []DirectPlayProfile  `json:"DirectPlayProfiles"`
	TranscodingProfiles                       []TranscodingProfile `json:"TranscodingProfiles"`
	SubtitleProfiles                          []SubtitleProfile    `json:"SubtitleProfiles"`
	ContainerProfiles                         []ContainerProfile   `json:"ContainerProfiles"`
	CodecProfiles                             []CodecProfile       `json:"CodecProfiles"`
	MaxStreamingBitrate                       int                  `json:"MaxStreamingBitrate"`
	AlwaysUseMostCompatibleTranscodingProfile bool                 `json:"AlwaysUseMostCompatibleTranscodingProfile"`
	MaxStaticBitrate                          int                  `json:"MaxStaticBitrate"`
	MusicStreamingTranscodingBitrate          int                  `json:"MusicStreamingTranscodingBitrate"`
	MaxStaticMusicBitrate                     int                  `json:"MaxStaticMusicBitrate"`
}

func (*DeviceProfile) UnmarshalJSON

func (p *DeviceProfile) UnmarshalJSON(data []byte) error

type DirectPlayProfile

type DirectPlayProfile struct {
	Container  string `json:"Container"`
	VideoCodec string `json:"VideoCodec"`
	AudioCodec string `json:"AudioCodec"`
	Type       string `json:"Type"`
}

DirectPlayProfile is the common Jellyfin/Emby DeviceProfile direct-play shape.

func (*DirectPlayProfile) UnmarshalJSON

func (p *DirectPlayProfile) UnmarshalJSON(data []byte) error

type FlexBool

type FlexBool bool

FlexBool accepts a JSON bool, a "true"/"false"/"1"/"0" string, or a number (non-zero is true).

func (FlexBool) MarshalJSON

func (f FlexBool) MarshalJSON() ([]byte, error)

func (*FlexBool) UnmarshalJSON

func (f *FlexBool) UnmarshalJSON(data []byte) error

type FlexInt

type FlexInt int

FlexInt accepts a JSON number or a numeric string.

func (FlexInt) MarshalJSON

func (f FlexInt) MarshalJSON() ([]byte, error)

func (*FlexInt) UnmarshalJSON

func (f *FlexInt) UnmarshalJSON(data []byte) error

type FlexInt64

type FlexInt64 int64

FlexInt64 accepts a JSON number or a numeric string.

func (FlexInt64) MarshalJSON

func (f FlexInt64) MarshalJSON() ([]byte, error)

func (*FlexInt64) UnmarshalJSON

func (f *FlexInt64) UnmarshalJSON(data []byte) error

type FlexString

type FlexString string

FlexString accepts a JSON string, number or bool.

func (FlexString) MarshalJSON

func (f FlexString) MarshalJSON() ([]byte, error)

func (*FlexString) UnmarshalJSON

func (f *FlexString) UnmarshalJSON(data []byte) error

type Layer

Layer applies learned capabilities or owner rules after declared capabilities.

type ProfileCondition

type ProfileCondition struct {
	Condition  string `json:"Condition"`
	Property   string `json:"Property"`
	Value      string `json:"Value"`
	IsRequired *bool  `json:"IsRequired"`
}

func (*ProfileCondition) UnmarshalJSON

func (c *ProfileCondition) UnmarshalJSON(data []byte) error

type SubtitleProfile

type SubtitleProfile struct {
	Format    string `json:"Format"`
	Method    string `json:"Method"`
	DidlMode  string `json:"DidlMode"`
	Language  string `json:"Language"`
	Container string `json:"Container"`
}

func (*SubtitleProfile) UnmarshalJSON

func (p *SubtitleProfile) UnmarshalJSON(data []byte) error

type TranscodingProfile

type TranscodingProfile struct {
	Container                 string             `json:"Container"`
	Type                      string             `json:"Type"`
	VideoCodec                string             `json:"VideoCodec"`
	AudioCodec                string             `json:"AudioCodec"`
	Protocol                  string             `json:"Protocol"`
	Context                   string             `json:"Context"`
	EstimateContentLength     bool               `json:"EstimateContentLength"`
	EnableMpegtsM2TsMode      bool               `json:"EnableMpegtsM2TsMode"`
	CopyTimestamps            bool               `json:"CopyTimestamps"`
	EnableSubtitlesInManifest bool               `json:"EnableSubtitlesInManifest"`
	TranscodeSeekInfo         string             `json:"TranscodeSeekInfo"`
	MaxAudioChannels          string             `json:"MaxAudioChannels"`
	MinSegments               int                `json:"MinSegments"`
	SegmentLength             int                `json:"SegmentLength"`
	BreakOnNonKeyFrames       *bool              `json:"BreakOnNonKeyFrames"`
	EnableAudioVbrEncoding    *bool              `json:"EnableAudioVbrEncoding"`
	Conditions                []ProfileCondition `json:"Conditions"`
}

func (*TranscodingProfile) UnmarshalJSON

func (p *TranscodingProfile) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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