mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 08:27:03 +08:00
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package customsrc
|
|
|
|
import (
|
|
"github.com/go-gst/go-glib/pkg/gobject/v2"
|
|
"github.com/go-gst/go-gst/pkg/gst"
|
|
)
|
|
|
|
// Register needs to be called after gst.Init() to make the gocustomsrc available in the standard
|
|
// gst element registry. After this call the element can be used like any other gstreamer element
|
|
func Register() bool {
|
|
registered := gst.RegisterBinSubClass[*customSrc](
|
|
"gocustomsrc",
|
|
classInit,
|
|
nil,
|
|
gst.BinOverrides[*customSrc]{
|
|
ElementOverrides: gst.ElementOverrides[*customSrc]{
|
|
ObjectOverrides: gst.ObjectOverrides[*customSrc]{
|
|
InitiallyUnownedOverrides: gobject.InitiallyUnownedOverrides[*customSrc]{
|
|
ObjectOverrides: gobject.ObjectOverrides[*customSrc]{
|
|
Constructed: (*customSrc).init,
|
|
SetProperty: (*customSrc).setProperty,
|
|
GetProperty: (*customSrc).getProperty,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
map[string]gobject.SignalDefinition{},
|
|
)
|
|
|
|
return gst.ElementRegister(
|
|
// no plugin:
|
|
nil,
|
|
// The name of the element
|
|
"gocustomsrc",
|
|
// The rank of the element
|
|
uint(gst.RankNone),
|
|
registered,
|
|
)
|
|
}
|