mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-12-24 12:27:57 +08:00
32 lines
625 B
Go
32 lines
625 B
Go
package saferecoder
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/xaionaro-go/streamctl/pkg/streamserver/implementations/libav/recoder/types"
|
|
"github.com/xaionaro-go/streamctl/pkg/streamserver/implementations/libav/saferecoder/process/client"
|
|
)
|
|
|
|
type InputConfig = types.InputConfig
|
|
|
|
type InputID = client.InputID
|
|
type Input struct {
|
|
Process *Process
|
|
ID InputID
|
|
}
|
|
|
|
func (p *Process) NewInputFromURL(
|
|
ctx context.Context,
|
|
url string,
|
|
cfg InputConfig,
|
|
) (*Input, error) {
|
|
inputID, err := p.Client.NewInputFromURL(ctx, url, cfg)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &Input{
|
|
Process: p,
|
|
ID: inputID,
|
|
}, nil
|
|
}
|