feat(streamserver): Allow hiding the stream key

This commit is contained in:
Dmitrii Okunev
2024-10-16 16:35:34 +01:00
parent e37a330a03
commit ce70093117
32 changed files with 2248 additions and 1888 deletions

View File

@@ -59,6 +59,7 @@ type InputID uint64
func (c *Client) NewInputFromURL(
ctx context.Context,
url string,
authKey string,
config InputConfig,
) (InputID, error) {
client, conn, err := c.grpcClient()
@@ -70,7 +71,10 @@ func (c *Client) NewInputFromURL(
resp, err := client.NewInput(ctx, &recoder_grpc.NewInputRequest{
Path: &recoder_grpc.ResourcePath{
ResourcePath: &recoder_grpc.ResourcePath_Url{
Url: url,
Url: &recoder_grpc.ResourcePathURL{
Url: url,
AuthKey: authKey,
},
},
},
Config: &recoder_grpc.InputConfig{},
@@ -108,6 +112,7 @@ type OutputConfig = recoder.OutputConfig
func (c *Client) NewOutputFromURL(
ctx context.Context,
url string,
streamKey string,
config OutputConfig,
) (OutputID, error) {
client, conn, err := c.grpcClient()
@@ -119,7 +124,10 @@ func (c *Client) NewOutputFromURL(
resp, err := client.NewOutput(ctx, &recoder_grpc.NewOutputRequest{
Path: &recoder_grpc.ResourcePath{
ResourcePath: &recoder_grpc.ResourcePath_Url{
Url: url,
Url: &recoder_grpc.ResourcePathURL{
Url: url,
AuthKey: streamKey,
},
},
},
Config: &recoder_grpc.OutputConfig{},

View File

@@ -38,6 +38,7 @@ type RecoderConfig = recoder.Config
func (c *Client) NewInputFromURL(
ctx context.Context,
url string,
authKey string,
config InputConfig,
) (InputID, error) {
return 0, fmt.Errorf("not compiled with libav support")
@@ -46,6 +47,7 @@ func (c *Client) NewInputFromURL(
func (c *Client) NewOutputFromURL(
ctx context.Context,
url string,
streamKey string,
config OutputConfig,
) (OutputID, error) {
return 0, fmt.Errorf("not compiled with libav support")

View File

@@ -107,7 +107,7 @@ func (srv *GRPCServer) newInputByURL(
_ *recoder_grpc.InputConfig,
) (*recoder_grpc.NewInputReply, error) {
config := recoder.InputConfig{}
input, err := recoder.NewInputFromURL(ctx, path.Url, config)
input, err := recoder.NewInputFromURL(ctx, path.Url.Url, path.Url.AuthKey, config)
if err != nil {
return nil, fmt.Errorf("unable to initialize an input using URL '%s' and config %#+v", path.Url, config)
}
@@ -161,7 +161,7 @@ func (srv *GRPCServer) newOutputByURL(
_ *recoder_grpc.OutputConfig,
) (*recoder_grpc.NewOutputReply, error) {
config := recoder.OutputConfig{}
output, err := recoder.NewOutputFromURL(ctx, path.Url, config)
output, err := recoder.NewOutputFromURL(ctx, path.Url.Url, path.Url.AuthKey, config)
if err != nil {
return nil, fmt.Errorf("unable to initialize an output using URL '%s' and config %#+v", path.Url, config)
}