io

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShellReader

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

ShellReader spawns a ffmpeg subprocess, exposes its stdout as a Reader, captures the tail of stderr in a fixed-size ring, and cleans up when the context is canceled or the process exits.

ShellReader is safe to use across goroutines for Close and Err. Read must be serialized by a single consumer (the convention for io.Reader).

func NewShellReader

func NewShellReader(parent context.Context, program string, args []string, log *slog.Logger) (*ShellReader, error)

NewShellReader spawns program with args and starts the process. The returned reader streams stdout. If the program cannot be started, ErrFFmpegSpawn is returned wrapped.

func (*ShellReader) Close

func (r *ShellReader) Close() error

Close terminates the subprocess and waits for the reaper.

func (*ShellReader) Done

func (r *ShellReader) Done() <-chan struct{}

Done is closed when the subprocess exits.

func (*ShellReader) Err

func (r *ShellReader) Err() error

Err returns the process exit error (after Done is closed).

func (*ShellReader) Read

func (r *ShellReader) Read(p []byte) (int, error)

Read pulls bytes from the subprocess stdout.

Jump to

Keyboard shortcuts

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