Rename "recoder" to "encoder"

This commit is contained in:
Dmitrii Okunev
2024-12-14 15:30:39 +00:00
parent 699b5847de
commit 8bc85e5dba
72 changed files with 1297 additions and 1279 deletions

View File

@@ -0,0 +1,35 @@
package safeencoder
import (
"context"
"github.com/xaionaro-go/streamctl/pkg/encoder/libav/safeencoder/process"
)
type InputID = process.InputID
type InputConfig = process.InputConfig
type Input struct {
Process *Process
ID InputID
}
func (p *Process) NewInputFromURL(
ctx context.Context,
url string,
streamKey string,
cfg InputConfig,
) (*Input, error) {
inputID, err := p.Client.NewInputFromURL(ctx, url, streamKey, cfg)
if err != nil {
return nil, err
}
return &Input{
Process: p,
ID: inputID,
}, nil
}
func (input *Input) Close() error {
return input.Process.Client.CloseInput(context.Background(), input.ID)
}