mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-04 20:03:04 +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
|
@ -37,7 +37,7 @@ func init() {
|
|||
registry = C.gst_registry_get()
|
||||
}
|
||||
|
||||
func CreatePipeline(pipelineStr string, sampleChannel chan types.Sample) (*Pipeline, error) {
|
||||
func CreatePipeline(pipelineStr string) (*Pipeline, error) {
|
||||
id := atomic.AddInt32(&pSerial, 1)
|
||||
|
||||
pipelineStrUnsafe := C.CString(pipelineStr)
|
||||
|
@ -61,19 +61,20 @@ func CreatePipeline(pipelineStr string, sampleChannel chan types.Sample) (*Pipel
|
|||
Str("module", "capture").
|
||||
Str("submodule", "gstreamer").
|
||||
Int("pipeline_id", int(id)).Logger(),
|
||||
Src: pipelineStr,
|
||||
Ctx: ctx,
|
||||
Sample: sampleChannel,
|
||||
Src: pipelineStr,
|
||||
Ctx: ctx,
|
||||
}
|
||||
|
||||
pipelines[p.id] = p
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func (p *Pipeline) AttachAppsink(sinkName string) {
|
||||
func (p *Pipeline) AttachAppsink(sinkName string, sampleChannel chan types.Sample) {
|
||||
sinkNameUnsafe := C.CString(sinkName)
|
||||
defer C.free(unsafe.Pointer(sinkNameUnsafe))
|
||||
|
||||
p.Sample = sampleChannel
|
||||
|
||||
C.gstreamer_pipeline_attach_appsink(p.Ctx, sinkNameUnsafe)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue