mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-05 16:06:55 +08:00
add example which registers and uses go custom elements
this example has an assert that checks wether or nor the finalizers ran correctly. If they don't then a mem leak will happen
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package custombin
|
||||
|
||||
import (
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// Register needs to be called after gst.Init() to make the gocustombin available in the standard
|
||||
// gst element registry. After this call the element can be used like any other gstreamer element
|
||||
func Register() bool {
|
||||
return gst.RegisterElement(
|
||||
// no plugin:
|
||||
nil,
|
||||
// The name of the element
|
||||
"gocustombin",
|
||||
// The rank of the element
|
||||
gst.RankNone,
|
||||
// The GoElement implementation for the element
|
||||
&customBin{},
|
||||
// The base subclass this element extends
|
||||
gst.ExtendsBin,
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user