dms

package
v0.0.0-...-9f5fb93 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: BSD-3-Clause Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MimeTypeByPath

func MimeTypeByPath(filePath string) (ret mimeType, err error)

MimeTypeByPath determines the MIME-type of file at the given path

Types

type Cache

type Cache interface {
	Set(key interface{}, value interface{})
	Get(key interface{}) (value interface{}, ok bool)
}

type FfprobeCacheItem

type FfprobeCacheItem struct {
	Key   ffmpegInfoCacheKey
	Value *ffprobe.Info
}

Public definition so that external modules can persist cache contents.

type Icon

type Icon struct {
	Width, Height, Depth int
	Mimetype             string
	Bytes                []byte
}

type Server

type Server struct {
	HTTPConn     net.Listener
	FriendlyName string
	Interfaces   []net.Interface

	RootObjectPath         string
	OnBrowseDirectChildren func(path string, rootObjectPath string, host, userAgent string) (ret []interface{}, err error)
	OnBrowseMetadata       func(path string, rootObjectPath string, host, userAgent string) (ret interface{}, err error)

	FFProbeCache Cache

	LogHeaders bool
	// Disable transcoding, and the resource elements implied in the CDS.
	NoTranscode bool
	// Force transcoding to certain format of the 'transcodes' map
	ForceTranscodeTo string
	// Disable media probing with ffprobe
	NoProbe bool
	Icons   []Icon
	// Stall event subscription requests until they drop. A workaround for
	// some bad clients.
	StallEventSubscribe bool
	// Time interval between SSPD announces
	NotifyInterval time.Duration
	// Ignore hidden files and directories
	IgnoreHidden bool
	// Ingnore unreadable files and directories
	IgnoreUnreadable bool
	// White list of clients
	AllowedIpNets []*net.IPNet
	// Activate support for dynamic streams configured via .dms.json metadata files
	// This feature is not enabled by default, since having write access to a shared media
	// folder allows executing arbitrary commands in the context of the DLNA server.
	AllowDynamicStreams bool
	// pattern where to write transcode logs to. The [tsname] placeholder is replaced with the name
	// of the item currently being played. The default is $HOME/.dms/log/[tsname]
	TranscodeLogPattern string
	Logger              log.Logger
	// contains filtered or unexported fields
}

func (*Server) Clients

func (srv *Server) Clients() []string

func (*Server) Close

func (srv *Server) Close() (err error)

func (*Server) IgnorePath

func (server *Server) IgnorePath(path string) (bool, error)

IgnorePath detects if a file/directory should be ignored.

func (*Server) Init

func (srv *Server) Init() (err error)

func (*Server) Run

func (srv *Server) Run() (err error)

func (*Server) Serve deprecated

func (srv *Server) Serve() (err error)

Deprecated: Use Init and then Run. There's a race calling Close on a Server that's had Serve called on it.

type UPnPService

type UPnPService interface {
	Handle(action string, argsXML []byte, r *http.Request) (respArgs [][2]string, err error)
	Subscribe(callback []*url.URL, timeoutSeconds int) (sid string, actualTimeout int, err error)
	Unsubscribe(sid string) error
}

UPnP SOAP service.

Jump to

Keyboard shortcuts

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