mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-10-25 00:20:23 +08:00
Rename "recoder" to "encoder"
This commit is contained in:
35
pkg/encoder/libav/safeencoder/input.go
Normal file
35
pkg/encoder/libav/safeencoder/input.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user