manager

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Media

type Media struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...Opt) (_ *Media, err error)

New creates a new media object

func (*Media) EncodeAudio added in v1.9.2

EncodeAudio re-encodes an audio stream read from req.Reader into req.Profile, writing the result to a temporary file (see AudioEncodeMediaResponse). The encode runs as a task tracked by the Media's task manager, so it's cancelled along with any other running task if ctx is cancelled while the encode is in flight.

func (*Media) Metadata added in v1.9.2

Metadata runs the metadata-extraction task on the new task manager (m.opt.taskManager) and waits for it to complete.

func (*Media) ProbeMedia added in v1.9.2

func (m *Media) ProbeMedia(ctx context.Context, req task.ProbeMediaRequest) (_ *task.ProbeResponse, err error)

Probe a media stream from any reader and return information about its container format and streams. The probe runs as a task tracked by the Media's task manager, so it's cancelled along with any other running task if Run's context is cancelled while the probe is in flight.

func (*Media) ProbeSource added in v1.9.2

func (m *Media) ProbeSource(ctx context.Context, req task.ProbeSourceRequest) (_ *task.ProbeResponse, err error)

ProbeSource probes a URL - a device (see ProbeSourceTask's doc comment for the "device://" scheme), or a network source FFmpeg can read directly (http, https, rtmp, ...) - rather than an already-open reader. Like Probe, this runs as a task tracked by the Media's task manager.

func (*Media) Run added in v1.9.2

func (m *Media) Run(ctx context.Context, _ *slog.Logger) (err error)

Run blocks until the context is canceled, then cancels any tasks still running on the Media's task manager and waits (up to shutdownTimeout) for them to stop before returning.

type Opt

type Opt func(*opt) error

Opt is a functional option for filer manager configuration.

func WithChromaprintKey added in v1.9.2

func WithChromaprintKey(key string, opts ...client.ClientOpt) Opt

WithChromaprintKey creates and stores a Chromaprint client.

func WithProfileManager added in v1.9.2

func WithProfileManager(profiles *profilemanager.Profile) Opt

WithProfileManager sets the profile manager used to resolve encoding profiles.

func WithTaskManager added in v1.9.2

func WithTaskManager(tasks *taskmanager.Manager) Opt

WithTaskManager sets the task manager used to track tasks.

func WithTracer

func WithTracer(tracer trace.Tracer) Opt

WithTracer sets the tracer used for tracing operations.

Jump to

Keyboard shortcuts

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