mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-17 11:07:12 +02:00
gst: move sample channel to AttachAppsink.
This commit is contained in:
parent
fdf17cfe77
commit
009ceddbd3
3 changed files with 15 additions and 16 deletions
|
@ -13,9 +13,9 @@ import (
|
|||
)
|
||||
|
||||
type StreamSinkManagerCtx struct {
|
||||
logger zerolog.Logger
|
||||
mu sync.Mutex
|
||||
sampleChannel chan types.Sample
|
||||
logger zerolog.Logger
|
||||
mu sync.Mutex
|
||||
sampleChannel chan types.Sample
|
||||
|
||||
codec codec.RTPCodec
|
||||
pipeline *gst.Pipeline
|
||||
|
@ -33,9 +33,9 @@ func streamSinkNew(codec codec.RTPCodec, pipelineFn func() (string, error), vide
|
|||
Str("video_id", video_id).Logger()
|
||||
|
||||
manager := &StreamSinkManagerCtx{
|
||||
logger: logger,
|
||||
codec: codec,
|
||||
pipelineFn: pipelineFn,
|
||||
logger: logger,
|
||||
codec: codec,
|
||||
pipelineFn: pipelineFn,
|
||||
sampleChannel: make(chan types.Sample),
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ func (manager *StreamSinkManagerCtx) createPipeline() error {
|
|||
Str("src", pipelineStr).
|
||||
Msgf("creating pipeline")
|
||||
|
||||
manager.pipeline, err = gst.CreatePipeline(pipelineStr, manager.sampleChannel)
|
||||
manager.pipeline, err = gst.CreatePipeline(pipelineStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ func (manager *StreamSinkManagerCtx) createPipeline() error {
|
|||
appsinkSubfix = "video"
|
||||
}
|
||||
|
||||
manager.pipeline.AttachAppsink("appsink" + appsinkSubfix)
|
||||
manager.pipeline.AttachAppsink("appsink"+appsinkSubfix, manager.sampleChannel)
|
||||
manager.pipeline.Play()
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue