mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 15:42:52 +08:00
cleanup plugin examples
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=gobin
|
||||
// +element:Subclass=gst.ExtendsBin
|
||||
// +element:Interfaces=gst.InterfaceChildProxy
|
||||
//
|
||||
package main
|
||||
|
||||
|
@@ -26,9 +26,6 @@ var (
|
||||
defaultInsecureSkipVerify = false
|
||||
)
|
||||
|
||||
const defaultChunkSize = 1024 * 1024 * 5
|
||||
const defaultMaxMemChunks = 3
|
||||
|
||||
type settings struct {
|
||||
endpoint string
|
||||
useTLS bool
|
||||
@@ -39,8 +36,6 @@ type settings struct {
|
||||
secretAccessKey string
|
||||
insecureSkipVerify bool
|
||||
caCertFile string
|
||||
chunkSize int64
|
||||
maxMemChunks uint
|
||||
}
|
||||
|
||||
func (s *settings) safestring() string {
|
||||
@@ -52,8 +47,6 @@ func (s *settings) safestring() string {
|
||||
key: s.key,
|
||||
insecureSkipVerify: s.insecureSkipVerify,
|
||||
caCertFile: s.caCertFile,
|
||||
chunkSize: s.chunkSize,
|
||||
maxMemChunks: s.maxMemChunks,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -65,8 +58,6 @@ func defaultSettings() *settings {
|
||||
accessKeyID: os.Getenv(accessKeyIDEnvVar),
|
||||
secretAccessKey: os.Getenv(secretAccessKeyEnvVar),
|
||||
insecureSkipVerify: defaultInsecureSkipVerify,
|
||||
chunkSize: defaultChunkSize,
|
||||
maxMemChunks: defaultMaxMemChunks,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,10 +114,6 @@ func setProperty(elem *gst.Element, properties []*glib.ParamSpec, settings *sett
|
||||
settings.accessKeyID = val.(string)
|
||||
case "secret-access-key":
|
||||
settings.secretAccessKey = val.(string)
|
||||
case "chunk-size":
|
||||
settings.chunkSize = val.(int64)
|
||||
case "max-memory-chunks":
|
||||
settings.maxMemChunks = val.(uint)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,10 +141,6 @@ func getProperty(elem *gst.Element, properties []*glib.ParamSpec, settings *sett
|
||||
localVal = settings.accessKeyID
|
||||
case "secret-access-key":
|
||||
localVal = "<private>"
|
||||
case "chunk-size":
|
||||
localVal = settings.chunkSize
|
||||
case "max-memory-chunks":
|
||||
localVal = settings.maxMemChunks
|
||||
|
||||
default:
|
||||
elem.ErrorMessage(gst.DomainLibrary, gst.LibraryErrorSettings,
|
||||
|
@@ -4,6 +4,6 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/minio/minio-go/v7 v7.0.7
|
||||
github.com/tinyzimmer/go-glib v0.0.7
|
||||
github.com/tinyzimmer/go-gst v0.2.3
|
||||
github.com/tinyzimmer/go-glib v0.0.11
|
||||
github.com/tinyzimmer/go-gst v0.2.4
|
||||
)
|
||||
|
@@ -58,10 +58,14 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/tinyzimmer/go-glib v0.0.7 h1:09SIbhaL+E+5U/4qbZXiM7f6HEDvcxOBuEiSCkT9FNw=
|
||||
github.com/tinyzimmer/go-glib v0.0.7/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/tinyzimmer/go-glib v0.0.11 h1:+X15JtyglmBhiLu5KXHWxcxhypyc/CEqW+SIFmjZ110=
|
||||
github.com/tinyzimmer/go-glib v0.0.11/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/tinyzimmer/go-gst v0.2.2 h1:aTIHCj1bu7ZT4i4cxi246puWI2QOCR5yQ2Uw/SicOgM=
|
||||
github.com/tinyzimmer/go-gst v0.2.2/go.mod h1:HYNtv9Qs2jxNAkTF9VJmC+CKLaWKQkZY7hJHbxfLfFM=
|
||||
github.com/tinyzimmer/go-gst v0.2.3 h1:36NX7DqkUq7ehq+81Dmro8r9VEew9ZZ4K/Ic8oWpHck=
|
||||
github.com/tinyzimmer/go-gst v0.2.3/go.mod h1:atM89iP55Hwgc+zoCVWT15qgThdxQ7WZJ5sD/uANDRI=
|
||||
github.com/tinyzimmer/go-gst v0.2.4 h1:uDGTzObBmIhyukqjCE9Jw0/EmmNU47Ztd5lBrtXTmWU=
|
||||
github.com/tinyzimmer/go-gst v0.2.4/go.mod h1:aPV2CtdfNrtASAzj+DzrAISJr1Czfy25ihLJIh7f/tk=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
|
@@ -44,8 +44,6 @@ func (m *minioSink) New() glib.GoObjectSubclass {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *minioSink) TypeInit(*glib.TypeInstance) {}
|
||||
|
||||
func (m *minioSink) ClassInit(klass *glib.ObjectClass) {
|
||||
class := gst.ToElementClass(klass)
|
||||
sinkCAT.Log(gst.LevelLog, "Initializing miniosink class")
|
||||
|
@@ -42,8 +42,6 @@ func (m *minioSrc) New() glib.GoObjectSubclass {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *minioSrc) TypeInit(*glib.TypeInstance) {}
|
||||
|
||||
func (m *minioSrc) ClassInit(klass *glib.ObjectClass) {
|
||||
class := gst.ToElementClass(klass)
|
||||
srcCAT.Log(gst.LevelLog, "Initializing miniosrc class")
|
||||
|
@@ -72,20 +72,6 @@ var sinkProperties = []*glib.ParamSpec{
|
||||
nil,
|
||||
glib.ParameterReadWrite,
|
||||
),
|
||||
glib.NewInt64Param(
|
||||
"chunk-size",
|
||||
"Chunk size",
|
||||
"The size of each chunk uploaded to S3/MinIO in bytes. The final output cannot exceed this value * 10000. Note that buffers will be held in memory until they reach this size.",
|
||||
defaultChunkSize, 1024*1024*1024, defaultChunkSize, // Min: 5MB Max: 1GB Default: 5MB
|
||||
glib.ParameterReadWrite,
|
||||
),
|
||||
glib.NewUintParam(
|
||||
"max-memory-chunks",
|
||||
"Maximum Chunks in Memory",
|
||||
"The maximum number of chunks to keep in memory at any given point in time. Setting this to a higher value will reduce load on the destination at the expense of increased memory consumption. There needs to be room for the head chunk and at least one more at all times.",
|
||||
2, ^uint(0), defaultMaxMemChunks,
|
||||
glib.ParameterReadWrite,
|
||||
),
|
||||
}
|
||||
|
||||
var srcProperties = []*glib.ParamSpec{
|
||||
|
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/minio/minio-go/v7 v7.0.7
|
||||
github.com/tinyzimmer/go-glib v0.0.7
|
||||
github.com/tinyzimmer/go-gst v0.2.3
|
||||
github.com/tinyzimmer/go-glib v0.0.11
|
||||
github.com/tinyzimmer/go-gst v0.2.4
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381
|
||||
)
|
||||
|
@@ -39,8 +39,12 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/tinyzimmer/go-glib v0.0.7 h1:09SIbhaL+E+5U/4qbZXiM7f6HEDvcxOBuEiSCkT9FNw=
|
||||
github.com/tinyzimmer/go-glib v0.0.7/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/tinyzimmer/go-glib v0.0.11 h1:+X15JtyglmBhiLu5KXHWxcxhypyc/CEqW+SIFmjZ110=
|
||||
github.com/tinyzimmer/go-glib v0.0.11/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/tinyzimmer/go-gst v0.2.3 h1:36NX7DqkUq7ehq+81Dmro8r9VEew9ZZ4K/Ic8oWpHck=
|
||||
github.com/tinyzimmer/go-gst v0.2.3/go.mod h1:atM89iP55Hwgc+zoCVWT15qgThdxQ7WZJ5sD/uANDRI=
|
||||
github.com/tinyzimmer/go-gst v0.2.4 h1:uDGTzObBmIhyukqjCE9Jw0/EmmNU47Ztd5lBrtXTmWU=
|
||||
github.com/tinyzimmer/go-gst v0.2.4/go.mod h1:aPV2CtdfNrtASAzj+DzrAISJr1Czfy25ihLJIh7f/tk=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
|
@@ -405,8 +405,6 @@ func (w *websocketSrc) New() glib.GoObjectSubclass {
|
||||
}
|
||||
}
|
||||
|
||||
func (w *websocketSrc) TypeInit(instance *glib.TypeInstance) {}
|
||||
|
||||
func (w *websocketSrc) ClassInit(klass *glib.ObjectClass) {
|
||||
class := gst.ToElementClass(klass)
|
||||
class.SetMetadata(
|
||||
|
Reference in New Issue
Block a user