mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 23:52:55 +08:00
pull in upstream interface improvements and add a few more gstreamer interfaces
This commit is contained in:
27
examples/plugins/boilerplate/boilerplate.go
Normal file
27
examples/plugins/boilerplate/boilerplate.go
Normal file
@@ -0,0 +1,27 @@
|
||||
//go:generate gst-plugin-gen
|
||||
//
|
||||
// +plugin:Name=boilerplate
|
||||
// +plugin:Description=My plugin written in go
|
||||
// +plugin:Version=v0.0.1
|
||||
// +plugin:License=gst.LicenseLGPL
|
||||
// +plugin:Source=go-gst
|
||||
// +plugin:Package=examples
|
||||
// +plugin:Origin=https://github.com/tinyzimmer/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-18
|
||||
//
|
||||
// +element:Name=myelement
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=myelement
|
||||
// +element:Subclass=gst.ExtendsElement
|
||||
//
|
||||
package main
|
||||
|
||||
import "github.com/tinyzimmer/go-glib/glib"
|
||||
|
||||
func main() {}
|
||||
|
||||
type myelement struct{}
|
||||
|
||||
func (g *myelement) New() glib.GoObjectSubclass { return &myelement{} }
|
||||
|
||||
func (g *myelement) ClassInit(klass *glib.ObjectClass) {}
|
27
examples/plugins/gobin/gobin.go
Normal file
27
examples/plugins/gobin/gobin.go
Normal file
@@ -0,0 +1,27 @@
|
||||
//go:generate gst-plugin-gen
|
||||
//
|
||||
// +plugin:Name=gobin
|
||||
// +plugin:Description=A bin element written in go
|
||||
// +plugin:Version=v0.0.1
|
||||
// +plugin:License=gst.LicenseLGPL
|
||||
// +plugin:Source=go-gst
|
||||
// +plugin:Package=examples
|
||||
// +plugin:Origin=https://github.com/tinyzimmer/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-18
|
||||
//
|
||||
// +element:Name=gobin
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=gobin
|
||||
// +element:Subclass=gst.ExtendsBin
|
||||
//
|
||||
package main
|
||||
|
||||
import "github.com/tinyzimmer/go-glib/glib"
|
||||
|
||||
func main() {}
|
||||
|
||||
type gobin struct{}
|
||||
|
||||
func (g *gobin) New() glib.GoObjectSubclass { return &gobin{} }
|
||||
|
||||
func (g *gobin) ClassInit(klass *glib.ObjectClass) {}
|
@@ -29,6 +29,8 @@
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=fileSink
|
||||
// +element:Subclass=base.ExtendsBaseSink
|
||||
// +element:Interfaces=gst.InterfaceURIHandler
|
||||
//
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -119,13 +121,6 @@ func (f *fileSink) New() glib.GoObjectSubclass {
|
||||
}
|
||||
}
|
||||
|
||||
// The TypeInit method should register any additional interfaces provided by the element.
|
||||
// In this example we signal to the type system that we also implement the GstURIHandler interface.
|
||||
func (f *fileSink) TypeInit(instance *glib.TypeInstance) {
|
||||
CAT.Log(gst.LevelLog, "Adding URIHandler interface to type")
|
||||
instance.AddInterface(gst.InterfaceURIHandler)
|
||||
}
|
||||
|
||||
// The ClassInit method should specify the metadata for this element and add any pad templates
|
||||
// and properties.
|
||||
func (f *fileSink) ClassInit(klass *glib.ObjectClass) {
|
||||
|
@@ -29,6 +29,8 @@
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=fileSrc
|
||||
// +element:Subclass=base.ExtendsBaseSrc
|
||||
// +element:Interfaces=gst.InterfaceURIHandler
|
||||
//
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -123,13 +125,6 @@ func (f *fileSrc) New() glib.GoObjectSubclass {
|
||||
}
|
||||
}
|
||||
|
||||
// The TypeInit method should register any additional interfaces provided by the element.
|
||||
// In this example we signal to the type system that we also implement the GstURIHandler interface.
|
||||
func (f *fileSrc) TypeInit(instance *glib.TypeInstance) {
|
||||
CAT.Log(gst.LevelLog, "Adding URIHandler interface to type")
|
||||
instance.AddInterface(gst.InterfaceURIHandler)
|
||||
}
|
||||
|
||||
// The ClassInit method should specify the metadata for this element and add any pad templates
|
||||
// and properties.
|
||||
func (f *fileSrc) ClassInit(klass *glib.ObjectClass) {
|
||||
|
Reference in New Issue
Block a user