mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-26 20:11:18 +08:00
change module name and use new golang version
This commit is contained in:
15
README.md
15
README.md
@@ -2,12 +2,11 @@
|
||||
|
||||
Go bindings for the GStreamer C libraries
|
||||
|
||||
[](https://pkg.go.dev/github.com/tinyzimmer/go-gst)
|
||||
[](https://godoc.org/github.com/tinyzimmer/go-gst)
|
||||
[](https://goreportcard.com/report/github.com/tinyzimmer/go-gst)
|
||||

|
||||
[](https://godoc.org/github.com/go-gst/go-gst)
|
||||
[](https://goreportcard.com/report/github.com/go-gst/go-gst)
|
||||

|
||||
|
||||
See the [godoc.org](https://godoc.org/github.com/tinyzimmer/go-gst) or [pkg.go.dev](https://pkg.go.dev/github.com/tinyzimmer/go-gst) references for documentation and examples.
|
||||
See the [godoc.org](https://godoc.org/github.com/go-gst/go-gst) or [pkg.go.dev](https://pkg.go.dev/github.com/go-gst/go-gst) references for documentation and examples.
|
||||
As the latter requires published tags, see godoc.org for the latest documentation of master at any point in time.
|
||||
|
||||
**This library has not been thoroughly tested and as such is not recommended for mission critical applications yet. If you'd like to try it out and encounter any bugs, feel free to open an Issue or PR. For more information see the [Contributing](#contributing) section.**
|
||||
@@ -40,7 +39,7 @@ PS> $env:PKG_CONFIG_PATH='C:\gstreamer\1.0\mingw_x86_64\lib\pkgconfig'
|
||||
PS> go build .
|
||||
```
|
||||
|
||||
For more information, take a look at [this comment](https://github.com/tinyzimmer/go-gst/issues/3#issuecomment-760648278) with a good run down of the process from compilation to execution.
|
||||
For more information, take a look at [this comment](https://github.com/go-gst/go-gst/issues/3#issuecomment-760648278) with a good run down of the process from compilation to execution.
|
||||
|
||||
## Quickstart
|
||||
|
||||
@@ -56,8 +55,8 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -136,9 +136,9 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
{{- if (.Config.Element.Subclass | extendsFromBase) }}
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
|
@@ -8,9 +8,9 @@ import (
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/app"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/app"
|
||||
)
|
||||
|
||||
func createPipeline() (*gst.Pipeline, error) {
|
||||
|
@@ -7,11 +7,11 @@ import (
|
||||
"image/color"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/app"
|
||||
"github.com/tinyzimmer/go-gst/gst/video"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/app"
|
||||
"github.com/go-gst/go-gst/gst/video"
|
||||
)
|
||||
|
||||
const width = 320
|
||||
|
@@ -2,9 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
@@ -3,7 +3,7 @@ package examples
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Run is used to wrap the given function in a main loop and print any error
|
||||
|
@@ -6,9 +6,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// ExampleCustomEvent demonstrates a custom event structue. Currerntly nested structs
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Before the pipeline hasn't been prerolled, the decodebin can't possibly know what
|
||||
// format it gets as its input. So at first, the pipeline looks like this:
|
||||
//
|
||||
// {filesrc} - {decodebin}
|
||||
// {filesrc} - {decodebin}
|
||||
//
|
||||
// As soon as the decodebin has detected the stream format, it will try to decode every
|
||||
// contained stream to its raw format.
|
||||
@@ -18,9 +18,9 @@
|
||||
// So for a file that contains one audio and one video stream,
|
||||
// the pipeline looks like the following:
|
||||
//
|
||||
// /-[audio]-{audioconvert}-{audioresample}-{autoaudiosink}
|
||||
// {filesrc}-{decodebin}-|
|
||||
// \-[video]-{videoconvert}-{videoscale}-{autovideosink}
|
||||
// /-[audio]-{audioconvert}-{audioresample}-{autoaudiosink}
|
||||
// {filesrc}-{decodebin}-|
|
||||
// \-[video]-{videoconvert}-{videoscale}-{autovideosink}
|
||||
//
|
||||
// Both auto-sinks at the end automatically select the best available (actual) sink. Since the
|
||||
// selection of available actual sinks is platform specific
|
||||
@@ -38,9 +38,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var srcFile string
|
||||
|
@@ -15,8 +15,8 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/pbutils"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/pbutils"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -24,9 +24,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func runPipeline(loop *glib.MainLoop) error {
|
||||
|
@@ -13,11 +13,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/app"
|
||||
"github.com/tinyzimmer/go-gst/gst/video"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/app"
|
||||
"github.com/go-gst/go-gst/gst/video"
|
||||
)
|
||||
|
||||
var srcFile string
|
||||
|
@@ -9,9 +9,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func runPipeline(mainLoop *glib.MainLoop) error {
|
||||
|
@@ -4,9 +4,9 @@
|
||||
// the application about the states of the dataflow. Those are mostly used for
|
||||
// changing pipelines dynamically at runtime or for inspecting/modifying buffers or events
|
||||
//
|
||||
// |-[probe]
|
||||
// /
|
||||
// {audiotestsrc} - {fakesink}
|
||||
// |-[probe]
|
||||
// /
|
||||
// {audiotestsrc} - {fakesink}
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func padProbes(mainLoop *glib.MainLoop) error {
|
||||
|
@@ -16,9 +16,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var srcURI string
|
||||
|
@@ -1,12 +1,10 @@
|
||||
//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:Origin=https://github.com/go-gst/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-18
|
||||
//
|
||||
// +element:Name=myelement
|
||||
@@ -14,9 +12,10 @@
|
||||
// +element:Impl=myelement
|
||||
// +element:Subclass=gst.ExtendsElement
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
package main
|
||||
|
||||
import "github.com/tinyzimmer/go-glib/glib"
|
||||
import "github.com/go-gst/go-glib/glib"
|
||||
|
||||
func main() {}
|
||||
|
||||
|
@@ -1,12 +1,10 @@
|
||||
//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:Origin=https://github.com/go-gst/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-18
|
||||
//
|
||||
// +element:Name=gobin
|
||||
@@ -15,9 +13,10 @@
|
||||
// +element:Subclass=gst.ExtendsBin
|
||||
// +element:Interfaces=gst.InterfaceChildProxy
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
package main
|
||||
|
||||
import "github.com/tinyzimmer/go-glib/glib"
|
||||
import "github.com/go-gst/go-glib/glib"
|
||||
|
||||
func main() {}
|
||||
|
||||
|
@@ -10,11 +10,8 @@
|
||||
//
|
||||
// In order to build the plugin for use by GStreamer, you can do the following:
|
||||
//
|
||||
// $ go generate
|
||||
// $ go build -o libgstgofilesink.so -buildmode c-shared .
|
||||
//
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
// $ go generate
|
||||
// $ go build -o libgstgofilesink.so -buildmode c-shared .
|
||||
//
|
||||
// +plugin:Name=gofilesink
|
||||
// +plugin:Description=File plugins written in go
|
||||
@@ -22,7 +19,7 @@
|
||||
// +plugin:License=gst.LicenseLGPL
|
||||
// +plugin:Source=go-gst
|
||||
// +plugin:Package=examples
|
||||
// +plugin:Origin=https://github.com/tinyzimmer/go-gst
|
||||
// +plugin:Origin=https://github.com/go-gst/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-04
|
||||
//
|
||||
// +element:Name=gofilesink
|
||||
@@ -31,6 +28,7 @@
|
||||
// +element:Subclass=base.ExtendsBaseSink
|
||||
// +element:Interfaces=gst.InterfaceURIHandler
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -40,9 +38,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
// main is left unimplemented since these files are compiled to c-shared.
|
||||
|
@@ -10,11 +10,8 @@
|
||||
//
|
||||
// In order to build the plugin for use by GStreamer, you can do the following:
|
||||
//
|
||||
// $ go generate
|
||||
// $ go build -o libgstgofilesrc.so -buildmode c-shared .
|
||||
//
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
// $ go generate
|
||||
// $ go build -o libgstgofilesrc.so -buildmode c-shared .
|
||||
//
|
||||
// +plugin:Name=gofilesrc
|
||||
// +plugin:Description=File plugins written in go
|
||||
@@ -22,7 +19,7 @@
|
||||
// +plugin:License=gst.LicenseLGPL
|
||||
// +plugin:Source=go-gst
|
||||
// +plugin:Package=examples
|
||||
// +plugin:Origin=https://github.com/tinyzimmer/go-gst
|
||||
// +plugin:Origin=https://github.com/go-gst/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-04
|
||||
//
|
||||
// +element:Name=gofilesrc
|
||||
@@ -31,6 +28,7 @@
|
||||
// +element:Subclass=base.ExtendsBaseSrc
|
||||
// +element:Interfaces=gst.InterfaceURIHandler
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -40,9 +38,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
// main is left unimplemented since these files are compiled to c-shared.
|
||||
|
@@ -8,10 +8,10 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
minio "github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -1,9 +1,9 @@
|
||||
module github.com/tinyzimmer/go-gst/examples/plugins/minio
|
||||
module github.com/go-gst/go-gst/examples/plugins/minio
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/minio/minio-go/v7 v7.0.7
|
||||
github.com/tinyzimmer/go-glib v0.0.19
|
||||
github.com/tinyzimmer/go-gst v0.2.12
|
||||
github.com/go-gst/go-glib v0.0.19
|
||||
github.com/go-gst/go-gst v0.2.12
|
||||
)
|
||||
|
@@ -56,22 +56,22 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
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-glib v0.0.18 h1:zSlJK5NDcquHK4FFQ2cF6tRavo2Y+6jc3Qowj1sN+oQ=
|
||||
github.com/tinyzimmer/go-glib v0.0.18/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=
|
||||
github.com/tinyzimmer/go-gst v0.2.8 h1:l0O9IjxncP7TMeeDFfYeQjrmsDv4STE0j8gVU1N8J74=
|
||||
github.com/tinyzimmer/go-gst v0.2.8/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
github.com/tinyzimmer/go-gst v0.2.11 h1:Nfaz7k0L2stRrSGhdGyZbfbbCUMU6/zC0UBi8Ftt8S0=
|
||||
github.com/tinyzimmer/go-gst v0.2.11/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
github.com/go-gst/go-glib v0.0.7 h1:09SIbhaL+E+5U/4qbZXiM7f6HEDvcxOBuEiSCkT9FNw=
|
||||
github.com/go-gst/go-glib v0.0.7/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-glib v0.0.11 h1:+X15JtyglmBhiLu5KXHWxcxhypyc/CEqW+SIFmjZ110=
|
||||
github.com/go-gst/go-glib v0.0.11/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-glib v0.0.18 h1:zSlJK5NDcquHK4FFQ2cF6tRavo2Y+6jc3Qowj1sN+oQ=
|
||||
github.com/go-gst/go-glib v0.0.18/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-gst v0.2.2 h1:aTIHCj1bu7ZT4i4cxi246puWI2QOCR5yQ2Uw/SicOgM=
|
||||
github.com/go-gst/go-gst v0.2.2/go.mod h1:HYNtv9Qs2jxNAkTF9VJmC+CKLaWKQkZY7hJHbxfLfFM=
|
||||
github.com/go-gst/go-gst v0.2.3 h1:36NX7DqkUq7ehq+81Dmro8r9VEew9ZZ4K/Ic8oWpHck=
|
||||
github.com/go-gst/go-gst v0.2.3/go.mod h1:atM89iP55Hwgc+zoCVWT15qgThdxQ7WZJ5sD/uANDRI=
|
||||
github.com/go-gst/go-gst v0.2.4 h1:uDGTzObBmIhyukqjCE9Jw0/EmmNU47Ztd5lBrtXTmWU=
|
||||
github.com/go-gst/go-gst v0.2.4/go.mod h1:aPV2CtdfNrtASAzj+DzrAISJr1Czfy25ihLJIh7f/tk=
|
||||
github.com/go-gst/go-gst v0.2.8 h1:l0O9IjxncP7TMeeDFfYeQjrmsDv4STE0j8gVU1N8J74=
|
||||
github.com/go-gst/go-gst v0.2.8/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
github.com/go-gst/go-gst v0.2.11 h1:Nfaz7k0L2stRrSGhdGyZbfbbCUMU6/zC0UBi8Ftt8S0=
|
||||
github.com/go-gst/go-gst v0.2.11/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
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=
|
||||
|
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
var sinkCAT = gst.NewDebugCategory(
|
||||
|
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
minio "github.com/minio/minio-go/v7"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
var srcCAT = gst.NewDebugCategory(
|
||||
|
@@ -5,11 +5,9 @@
|
||||
// By default this plugin will use the credentials set in the environment at MINIO_ACCESS_KEY_ID
|
||||
// and MINIO_SECRET_ACCESS_KEY however these can also be set on the element directly.
|
||||
//
|
||||
//
|
||||
// In order to build the plugin for use by GStreamer, you can do the following:
|
||||
//
|
||||
// $ go build -o libgstminio.so -buildmode c-shared .
|
||||
//
|
||||
// $ go build -o libgstminio.so -buildmode c-shared .
|
||||
package main
|
||||
|
||||
import "C"
|
||||
@@ -17,8 +15,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
// The metadata for this plugin
|
||||
@@ -31,7 +29,7 @@ var pluginMeta = &gst.PluginMetadata{
|
||||
License: gst.LicenseLGPL,
|
||||
Source: "gst-pipeline-operator",
|
||||
Package: "plugins",
|
||||
Origin: "https://github.com/tinyzimmer/gst-pipeline-operator",
|
||||
Origin: "https://github.com/go-gst/gst-pipeline-operator",
|
||||
ReleaseDate: "2021-01-12",
|
||||
// The init function is called to register elements provided by the plugin.
|
||||
Init: func(plugin *gst.Plugin) bool {
|
||||
|
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Even though there is overlap in properties, they have to be declared twice.
|
||||
|
@@ -1,10 +1,10 @@
|
||||
module github.com/tinyzimmer/go-gst/examples/plugins/websocketsrc
|
||||
module github.com/go-gst/go-gst/examples/plugins/websocketsrc
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/minio/minio-go/v7 v7.0.7
|
||||
github.com/tinyzimmer/go-glib v0.0.18
|
||||
github.com/tinyzimmer/go-gst v0.2.8
|
||||
github.com/go-gst/go-glib v0.0.18
|
||||
github.com/go-gst/go-gst v0.2.8
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381
|
||||
)
|
||||
|
@@ -37,18 +37,18 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
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-glib v0.0.18 h1:zSlJK5NDcquHK4FFQ2cF6tRavo2Y+6jc3Qowj1sN+oQ=
|
||||
github.com/tinyzimmer/go-glib v0.0.18/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=
|
||||
github.com/tinyzimmer/go-gst v0.2.8 h1:l0O9IjxncP7TMeeDFfYeQjrmsDv4STE0j8gVU1N8J74=
|
||||
github.com/tinyzimmer/go-gst v0.2.8/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
github.com/go-gst/go-glib v0.0.7 h1:09SIbhaL+E+5U/4qbZXiM7f6HEDvcxOBuEiSCkT9FNw=
|
||||
github.com/go-gst/go-glib v0.0.7/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-glib v0.0.11 h1:+X15JtyglmBhiLu5KXHWxcxhypyc/CEqW+SIFmjZ110=
|
||||
github.com/go-gst/go-glib v0.0.11/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-glib v0.0.18 h1:zSlJK5NDcquHK4FFQ2cF6tRavo2Y+6jc3Qowj1sN+oQ=
|
||||
github.com/go-gst/go-glib v0.0.18/go.mod h1:zy2cs6eXSTtqqYrv9/UgYMDfr4pWKuYPSzwX87cBGX4=
|
||||
github.com/go-gst/go-gst v0.2.3 h1:36NX7DqkUq7ehq+81Dmro8r9VEew9ZZ4K/Ic8oWpHck=
|
||||
github.com/go-gst/go-gst v0.2.3/go.mod h1:atM89iP55Hwgc+zoCVWT15qgThdxQ7WZJ5sD/uANDRI=
|
||||
github.com/go-gst/go-gst v0.2.4 h1:uDGTzObBmIhyukqjCE9Jw0/EmmNU47Ztd5lBrtXTmWU=
|
||||
github.com/go-gst/go-gst v0.2.4/go.mod h1:aPV2CtdfNrtASAzj+DzrAISJr1Czfy25ihLJIh7f/tk=
|
||||
github.com/go-gst/go-gst v0.2.8 h1:l0O9IjxncP7TMeeDFfYeQjrmsDv4STE0j8gVU1N8J74=
|
||||
github.com/go-gst/go-gst v0.2.8/go.mod h1:C1yElEfXm8k0ddR4NdT1cJS4vFHv2wyVrIBSJCB6Nto=
|
||||
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=
|
||||
|
@@ -3,11 +3,8 @@
|
||||
//
|
||||
// In order to build the plugin for use by GStreamer, you can do the following:
|
||||
//
|
||||
// $ go generate
|
||||
// $ go build -o libgstwebsocketsrc.so -buildmode c-shared .
|
||||
//
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
// $ go generate
|
||||
// $ go build -o libgstwebsocketsrc.so -buildmode c-shared .
|
||||
//
|
||||
// +plugin:Name=websocketsrc
|
||||
// +plugin:Description=GStreamer Websocket Source
|
||||
@@ -15,13 +12,15 @@
|
||||
// +plugin:License=gst.LicenseLGPL
|
||||
// +plugin:Source=go-gst
|
||||
// +plugin:Package=examples
|
||||
// +plugin:Origin=https://github.com/tinyzimmer/go-gst
|
||||
// +plugin:Origin=https://github.com/go-gst/go-gst
|
||||
// +plugin:ReleaseDate=2021-01-10
|
||||
//
|
||||
// +element:Name=websocketsrc
|
||||
// +element:Rank=gst.RankNone
|
||||
// +element:Impl=websocketSrc
|
||||
// +element:Subclass=gst.ExtendsElement
|
||||
//
|
||||
//go:generate gst-plugin-gen
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -31,8 +30,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
||||
|
@@ -20,9 +20,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func queries(mainLoop *glib.MainLoop) error {
|
||||
|
@@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
@@ -10,7 +10,7 @@
|
||||
// that the example application will add tags to using GstTagsetter.
|
||||
// The operated pipeline looks like this:
|
||||
//
|
||||
// {audiotestsrc} - {flacenc} - {filesink}
|
||||
// {audiotestsrc} - {flacenc} - {filesink}
|
||||
//
|
||||
// For example for pipelines that transcode a multimedia file, the input
|
||||
// already has tags. For cases like this, the GstTagsetter has the merge
|
||||
@@ -25,8 +25,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func tagsetter() error {
|
||||
|
@@ -6,10 +6,9 @@
|
||||
// notify all elements in the pipeline when they encountered a ToC.
|
||||
// For this, the example operates the following pipeline:
|
||||
//
|
||||
// /-{queue} - {fakesink}
|
||||
// {filesrc} - {decodebin} - {queue} - {fakesink}
|
||||
// \- ...
|
||||
//
|
||||
// /-{queue} - {fakesink}
|
||||
// {filesrc} - {decodebin} - {queue} - {fakesink}
|
||||
// \- ...
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -18,9 +17,9 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/examples"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/examples"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func tagsetter(mainLoop *glib.MainLoop) error {
|
||||
|
11
go.mod
11
go.mod
@@ -1,8 +1,7 @@
|
||||
module github.com/tinyzimmer/go-gst
|
||||
module github.com/go-gst/go-gst
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/mattn/go-pointer v0.0.1
|
||||
github.com/tinyzimmer/go-glib v0.0.25
|
||||
)
|
||||
require github.com/mattn/go-pointer v0.0.1
|
||||
|
||||
require github.com/go-gst/go-glib v0.0.0-20230811085623-0abfebfabe3e
|
||||
|
4
go.sum
4
go.sum
@@ -1,4 +1,4 @@
|
||||
github.com/go-gst/go-glib v0.0.0-20230811085623-0abfebfabe3e h1:ZDMaEJsq1RFfqNQcFcdLbwHYc+quw9YihlwRPkVYeUA=
|
||||
github.com/go-gst/go-glib v0.0.0-20230811085623-0abfebfabe3e/go.mod h1:rXuKU+tCN7pN+b/7oIyWv6MpnlGy+QWd7jRhWUNstjU=
|
||||
github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0=
|
||||
github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=
|
||||
github.com/tinyzimmer/go-glib v0.0.24 h1:ktZZC22/9t88kGRgNEFV/SESgIWhGHE+q7Z7Qj++luw=
|
||||
github.com/tinyzimmer/go-glib v0.0.24/go.mod h1:ltV0gO6xNFzZhsIRbFXv8RTq9NGoNT2dmAER4YmZfaM=
|
||||
|
@@ -5,9 +5,9 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
)
|
||||
|
||||
func getSinkCbsFromPtr(userData C.gpointer) *SinkCallbacks {
|
||||
|
@@ -24,8 +24,8 @@ import (
|
||||
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
// SinkCallbacks represents callbacks that can be installed on an app sink when data is available.
|
||||
|
@@ -21,9 +21,9 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
)
|
||||
|
||||
// SourceCallbacks represents callbacks to configure on an AppSource.
|
||||
|
@@ -4,8 +4,8 @@ package app
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/tinyzimmer/go-gst/gst/base"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst/base"
|
||||
)
|
||||
|
||||
func wrapAppSink(elem *gst.Element) *Sink {
|
||||
|
@@ -18,7 +18,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// ClipBuffer will return a new buffer clipped to the given segment. The given buffer is no longer valid.
|
||||
|
@@ -5,6 +5,7 @@ package audio
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"math"
|
||||
"strings"
|
||||
"unsafe"
|
||||
)
|
||||
|
@@ -8,8 +8,8 @@ import (
|
||||
"math"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -14,7 +14,7 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// Flags contains extra audio flags
|
||||
|
@@ -16,8 +16,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// GstBaseSink represents a GstBaseSink.
|
||||
|
@@ -9,8 +9,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
//export goGstBaseSinkActivatePull
|
||||
|
@@ -58,8 +58,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -9,8 +9,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// GstBaseSrc represents a GstBaseSrc.
|
||||
|
@@ -7,8 +7,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
//export goGstBaseSrcGetCaps
|
||||
|
@@ -51,8 +51,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -25,8 +25,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// GstBaseTransformFlowDropped is a GstFlowReturn that can be returned from Transform() and TransformIP()
|
||||
|
@@ -8,8 +8,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
//export goGstBaseTransformAcceptCaps
|
||||
|
@@ -55,8 +55,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -62,7 +62,7 @@ import (
|
||||
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// CollectPadsBufferFunc is a function that will be called when a (considered oldest) buffer can be muxed.
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
//export goGstCollectPadsBufferFunc
|
||||
|
@@ -8,7 +8,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// FlowCombiner is a helper structure for aggregating flow returns. This struct
|
||||
|
@@ -6,8 +6,8 @@ package base
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// GstPushSrc represents a GstBaseSrc.
|
||||
|
@@ -8,8 +8,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
//export goGstPushSrcAlloc
|
||||
|
@@ -17,8 +17,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -10,7 +10,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
"github.com/go-gst/go-gst/gst"
|
||||
)
|
||||
|
||||
// TypeFindHelper tries to find what type of data is flowing from the given source GstPad.
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
func toGObject(data unsafe.Pointer) *glib.Object {
|
||||
|
@@ -13,8 +13,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
//export goElementCallAsync
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// AllocationParams wraps the GstAllocationParams.
|
||||
|
@@ -75,7 +75,7 @@ import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Bin is a go wrapper arounds a GstBin.
|
||||
|
@@ -7,7 +7,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
func cbWrapBin(bin *C.GstBin) *Bin {
|
||||
|
@@ -26,7 +26,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// ExtendsBin implements an Extendable object based on a GstBin.
|
||||
|
@@ -27,8 +27,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// GetMaxBufferMemory returns the maximum amount of memory a buffer can hold.
|
||||
@@ -120,16 +120,16 @@ func NewBufferFromReader(rdr io.Reader) (*Buffer, error) {
|
||||
//
|
||||
// The prefix/padding must be filled with 0 if flags contains MemoryFlagZeroPrefixed and MemoryFlagZeroPadded respectively.
|
||||
//
|
||||
// // Example
|
||||
// // Example
|
||||
//
|
||||
// buf := gst.NewBufferFull(0, []byte("hello-world"), 1024, 0, 1024, func() {
|
||||
// fmt.Println("buffer was destroyed")
|
||||
// })
|
||||
// if buf != nil {
|
||||
// buf.Unref()
|
||||
// }
|
||||
// buf := gst.NewBufferFull(0, []byte("hello-world"), 1024, 0, 1024, func() {
|
||||
// fmt.Println("buffer was destroyed")
|
||||
// })
|
||||
// if buf != nil {
|
||||
// buf.Unref()
|
||||
// }
|
||||
//
|
||||
// // > buffer was destroyed
|
||||
// // > buffer was destroyed
|
||||
func NewBufferFull(flags MemoryFlags, data []byte, maxSize, offset, size int64, notifyFunc func()) *Buffer {
|
||||
var notifyData unsafe.Pointer
|
||||
var gnotifyFunc C.GDestroyNotify
|
||||
@@ -228,27 +228,26 @@ func (b *Buffer) OffsetEnd() int64 { return int64(b.Instance().offset_end) }
|
||||
// parameters are passed to the MetaInfo's init function, and as such will only work
|
||||
// for MetaInfo objects created from the go runtime.
|
||||
//
|
||||
// // Example
|
||||
// // Example
|
||||
//
|
||||
// metaInfo := gst.RegisterMeta(glib.TypeFromName("MyObjectType"), "my-meta", 1024, &gst.MetaInfoCallbackFuncs{
|
||||
// InitFunc: func(params interface{}, buffer *gst.Buffer) bool {
|
||||
// paramStr := params.(string)
|
||||
// fmt.Println("Buffer initialized with params:", paramStr)
|
||||
// return true
|
||||
// },
|
||||
// FreeFunc: func(buffer *gst.Buffer) {
|
||||
// fmt.Println("Buffer was destroyed")
|
||||
// },
|
||||
// })
|
||||
// metaInfo := gst.RegisterMeta(glib.TypeFromName("MyObjectType"), "my-meta", 1024, &gst.MetaInfoCallbackFuncs{
|
||||
// InitFunc: func(params interface{}, buffer *gst.Buffer) bool {
|
||||
// paramStr := params.(string)
|
||||
// fmt.Println("Buffer initialized with params:", paramStr)
|
||||
// return true
|
||||
// },
|
||||
// FreeFunc: func(buffer *gst.Buffer) {
|
||||
// fmt.Println("Buffer was destroyed")
|
||||
// },
|
||||
// })
|
||||
//
|
||||
// buf := gst.NewEmptyBuffer()
|
||||
// buf.AddMeta(metaInfo, "hello world")
|
||||
// buf := gst.NewEmptyBuffer()
|
||||
// buf.AddMeta(metaInfo, "hello world")
|
||||
//
|
||||
// buf.Unref()
|
||||
//
|
||||
// // > Buffer initialized with params: hello world
|
||||
// // > Buffer was destroyed
|
||||
// buf.Unref()
|
||||
//
|
||||
// // > Buffer initialized with params: hello world
|
||||
// // > Buffer was destroyed
|
||||
func (b *Buffer) AddMeta(info *MetaInfo, params interface{}) *Meta {
|
||||
meta := C.gst_buffer_add_meta(b.Instance(), info.Instance(), (C.gpointer)(gopointer.Save(params)))
|
||||
if meta == nil {
|
||||
|
@@ -7,7 +7,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// BufferPool is a go wrapper around a GstBufferPool.
|
||||
|
@@ -24,8 +24,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// Bus is a Go wrapper around a GstBus. It provides convenience methods for
|
||||
@@ -36,38 +36,37 @@ type Bus struct {
|
||||
|
||||
// NewBus returns a new Bus instance.
|
||||
//
|
||||
// // Example of using the bus instance
|
||||
// // Example of using the bus instance
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "fmt"
|
||||
// import (
|
||||
// "fmt"
|
||||
//
|
||||
// "github.com/tinyzimmer/go-gst/gst"
|
||||
// )
|
||||
// "github.com/go-gst/go-gst/gst"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// gst.Init(nil)
|
||||
// func main() {
|
||||
// gst.Init(nil)
|
||||
//
|
||||
// bus := gst.NewBus()
|
||||
// defer bus.Unref()
|
||||
// bus := gst.NewBus()
|
||||
// defer bus.Unref()
|
||||
//
|
||||
// elem, err := gst.NewElement("fakesrc")
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// defer elem.Unref()
|
||||
// elem, err := gst.NewElement("fakesrc")
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// defer elem.Unref()
|
||||
//
|
||||
// bus.Post(gst.NewAsyncStartMessage(elem))
|
||||
// bus.Post(gst.NewAsyncStartMessage(elem))
|
||||
//
|
||||
// msg := bus.Pop()
|
||||
// defer msg.Unref()
|
||||
// msg := bus.Pop()
|
||||
// defer msg.Unref()
|
||||
//
|
||||
// fmt.Println(msg)
|
||||
// }
|
||||
//
|
||||
// // > [fakesrc0] ASYNC-START - Async task started
|
||||
// fmt.Println(msg)
|
||||
// }
|
||||
//
|
||||
// // > [fakesrc0] ASYNC-START - Async task started
|
||||
func NewBus() *Bus {
|
||||
return FromGstBusUnsafeFull(unsafe.Pointer(C.gst_bus_new()))
|
||||
}
|
||||
@@ -244,7 +243,9 @@ func (b *Bus) Peek() *Message {
|
||||
// on Gtk+ or Qt, but also for any other non-trivial application that uses the GLib main loop. As this function
|
||||
// runs a GLib main loop, any callback attached to the default GLib main context may be invoked. This could be
|
||||
// timeouts, GUI events, I/O events etc.; even if Poll is called with a 0 timeout. Any of these callbacks
|
||||
// may do things you do not expect, e.g. destroy the main application window or some other resource; change other
|
||||
//
|
||||
// may do things you do not expect, e.g. destroy the main application window or some other resource; change other
|
||||
//
|
||||
// application state; display a dialog and run another main loop until the user clicks it away. In short, using this
|
||||
// function may add a lot of complexity to your code through unexpected re-entrancy and unexpected changes to your
|
||||
// application's state.
|
||||
|
@@ -17,8 +17,8 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// TypeCaps is the static Glib Type for a GstCaps.
|
||||
@@ -67,27 +67,24 @@ type CapsMapFunc func(features *CapsFeatures, structure *Structure) bool
|
||||
|
||||
// NewAnyCaps creates a new caps that indicate compatibility with any format.
|
||||
//
|
||||
// caps := gst.NewAnyCaps()
|
||||
// fmt.Println(caps.IsAny())
|
||||
// // true
|
||||
//
|
||||
// caps := gst.NewAnyCaps()
|
||||
// fmt.Println(caps.IsAny())
|
||||
// // true
|
||||
func NewAnyCaps() *Caps { return FromGstCapsUnsafeFull(unsafe.Pointer(C.gst_caps_new_any())) }
|
||||
|
||||
// NewEmptyCaps creates a new empty caps object. This is essentially the opposite of
|
||||
// NewAnyCamps.
|
||||
//
|
||||
// caps := gst.NewEmptyCaps()
|
||||
// fmt.Println(caps.IsEmpty())
|
||||
// // true
|
||||
//
|
||||
// caps := gst.NewEmptyCaps()
|
||||
// fmt.Println(caps.IsEmpty())
|
||||
// // true
|
||||
func NewEmptyCaps() *Caps { return FromGstCapsUnsafeFull(unsafe.Pointer(C.gst_caps_new_empty())) }
|
||||
|
||||
// NewEmptySimpleCaps returns a new empty caps object with the given media format.
|
||||
//
|
||||
// caps := gst.NewEmptySimpleCaps("audio/x-raw")
|
||||
// fmt.Println(caps.String())
|
||||
// // audio/x-raw
|
||||
//
|
||||
// caps := gst.NewEmptySimpleCaps("audio/x-raw")
|
||||
// fmt.Println(caps.String())
|
||||
// // audio/x-raw
|
||||
func NewEmptySimpleCaps(mediaFormat string) *Caps {
|
||||
cFormat := C.CString(mediaFormat)
|
||||
defer C.free(unsafe.Pointer(cFormat))
|
||||
@@ -106,10 +103,9 @@ func NewFullCaps(structures ...*Structure) *Caps {
|
||||
|
||||
// NewCapsFromString creates a new Caps object from the given string.
|
||||
//
|
||||
// caps := gst.NewCapsFromString("audio/x-raw, channels=2")
|
||||
// fmt.Println(caps.String())
|
||||
// // audio/x-raw, channels=(int)2
|
||||
//
|
||||
// caps := gst.NewCapsFromString("audio/x-raw, channels=2")
|
||||
// fmt.Println(caps.String())
|
||||
// // audio/x-raw, channels=(int)2
|
||||
func NewCapsFromString(capsStr string) *Caps {
|
||||
cStr := C.CString(capsStr)
|
||||
defer C.free(unsafe.Pointer(cStr))
|
||||
@@ -206,21 +202,20 @@ func (c *Caps) CopyNth(n uint) *Caps {
|
||||
// In contrast to ForEach, the function may modify the structure and features. In contrast to MapInPlace,
|
||||
// the structure and features are removed from the caps if FALSE is returned from the function. The caps must be mutable.
|
||||
//
|
||||
// caps := gst.NewCapsFromString("audio/x-raw")
|
||||
// caps := gst.NewCapsFromString("audio/x-raw")
|
||||
//
|
||||
// caps.FilterAndMapInPlace(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
// if features.Contains(gst.CapsFeatureMemorySystemMemory) {
|
||||
// fmt.Println("Removing system memory feature")
|
||||
// return false
|
||||
// }
|
||||
// return true
|
||||
// })
|
||||
// caps.FilterAndMapInPlace(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
// if features.Contains(gst.CapsFeatureMemorySystemMemory) {
|
||||
// fmt.Println("Removing system memory feature")
|
||||
// return false
|
||||
// }
|
||||
// return true
|
||||
// })
|
||||
//
|
||||
// fmt.Println(caps.IsEmpty())
|
||||
//
|
||||
// // Removing system memory feature
|
||||
// // true
|
||||
// fmt.Println(caps.IsEmpty())
|
||||
//
|
||||
// // Removing system memory feature
|
||||
// // true
|
||||
func (c *Caps) FilterAndMapInPlace(f CapsMapFunc) {
|
||||
ptr := gopointer.Save(f)
|
||||
defer gopointer.Unref(ptr)
|
||||
@@ -248,15 +243,14 @@ func (c *Caps) Fixate() *Caps {
|
||||
// ForEach calls the provided function once for each structure and caps feature in the GstCaps. The function must not
|
||||
// modify the fields. There is an unresolved bug in this function currently and it is better to use MapInPlace instead.
|
||||
//
|
||||
// caps := gst.NewCapsFromString("audio/x-raw")
|
||||
// caps := gst.NewCapsFromString("audio/x-raw")
|
||||
//
|
||||
// caps.ForEach(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
// fmt.Println(structure)
|
||||
// return true
|
||||
// })
|
||||
//
|
||||
// // audio/x-raw;
|
||||
// caps.ForEach(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
// fmt.Println(structure)
|
||||
// return true
|
||||
// })
|
||||
//
|
||||
// // audio/x-raw;
|
||||
func (c *Caps) ForEach(f CapsMapFunc) bool {
|
||||
ptr := gopointer.Save(f)
|
||||
defer gopointer.Unref(ptr)
|
||||
|
@@ -6,7 +6,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Go casting of pre-baked caps features
|
||||
@@ -21,18 +21,16 @@ type CapsFeatures struct {
|
||||
|
||||
// NewCapsFeaturesEmpty returns a new empty CapsFeatures.
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesEmpty()
|
||||
// fmt.Println(feats.GetSize())
|
||||
// // 0
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesEmpty()
|
||||
// fmt.Println(feats.GetSize())
|
||||
// // 0
|
||||
func NewCapsFeaturesEmpty() *CapsFeatures { return wrapCapsFeatures(C.gst_caps_features_new_empty()) }
|
||||
|
||||
// NewCapsFeaturesAny returns a new ANY CapsFeatures.
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesAny()
|
||||
// fmt.Println(feats.IsAny())
|
||||
// // true
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesAny()
|
||||
// fmt.Println(feats.IsAny())
|
||||
// // true
|
||||
func NewCapsFeaturesAny() *CapsFeatures { return wrapCapsFeatures(C.gst_caps_features_new_any()) }
|
||||
|
||||
// NewCapsFeaturesFromString creates new CapsFeatures from the given string.
|
||||
@@ -71,31 +69,29 @@ func (c *CapsFeatures) Instance() *C.GstCapsFeatures {
|
||||
|
||||
// String implements a stringer on caps features.
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesAny()
|
||||
// fmt.Println(feats.String())
|
||||
// // ANY
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesAny()
|
||||
// fmt.Println(feats.String())
|
||||
// // ANY
|
||||
func (c *CapsFeatures) String() string {
|
||||
return C.GoString(C.gst_caps_features_to_string(c.Instance()))
|
||||
}
|
||||
|
||||
// Add adds the given feature to these.
|
||||
//
|
||||
// feats := gst.NewCapsFeaturesEmpty()
|
||||
// feats := gst.NewCapsFeaturesEmpty()
|
||||
//
|
||||
// fmt.Println(feats.GetSize())
|
||||
// fmt.Println(feats.GetSize())
|
||||
//
|
||||
// feats.Add(gst.CapsFeatureMemorySystemMemory)
|
||||
// feats.Add(gst.CapsFeatureMemorySystemMemory)
|
||||
//
|
||||
// fmt.Println(feats.GetSize())
|
||||
// fmt.Println(feats.Contains(gst.CapsFeatureMemorySystemMemory))
|
||||
// fmt.Println(feats.GetNth(0))
|
||||
//
|
||||
// // 0
|
||||
// // 1
|
||||
// // true
|
||||
// // memory:SystemMemory
|
||||
// fmt.Println(feats.GetSize())
|
||||
// fmt.Println(feats.Contains(gst.CapsFeatureMemorySystemMemory))
|
||||
// fmt.Println(feats.GetNth(0))
|
||||
//
|
||||
// // 0
|
||||
// // 1
|
||||
// // true
|
||||
// // memory:SystemMemory
|
||||
func (c *CapsFeatures) Add(feature string) {
|
||||
cStr := C.CString(feature)
|
||||
defer C.free(unsafe.Pointer(cStr))
|
||||
|
@@ -21,7 +21,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// InterfaceChildProxy represents the GstChildProxy interface. Use this when querying bins
|
||||
|
@@ -7,7 +7,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
func wrapParent(parent *C.GstChildProxy) *ChildProxy { return &ChildProxy{ptr: parent} }
|
||||
|
@@ -24,8 +24,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// ClockCallback is the prototype of a clock callback function.
|
||||
@@ -80,25 +80,25 @@ func (c *ClockID) Wait() (ret ClockReturn, jitter ClockTimeDiff) {
|
||||
//
|
||||
// The callback func can be invoked from any thread, either provided by the core or from a streaming thread. The application should be prepared for this.
|
||||
//
|
||||
// // Example
|
||||
// // Example
|
||||
//
|
||||
// pipeline, _ := gst.NewPipelineFromString("fakesrc ! fakesink")
|
||||
// defer pipeline.Unref()
|
||||
// pipeline, _ := gst.NewPipelineFromString("fakesrc ! fakesink")
|
||||
// defer pipeline.Unref()
|
||||
//
|
||||
// clock := pipeline.GetPipelineClock()
|
||||
// clock := pipeline.GetPipelineClock()
|
||||
//
|
||||
// id := clock.NewSingleShotID(gst.ClockTime(1000000000)) // 1 second
|
||||
// id := clock.NewSingleShotID(gst.ClockTime(1000000000)) // 1 second
|
||||
//
|
||||
// id.WaitAsync(func(clock *gst.Clock, clockTime time.Duration) bool {
|
||||
// fmt.Println("Single shot triggered at", clockTime.Nanoseconds())
|
||||
// pipeline.SetState(gst.StateNull)
|
||||
// return true
|
||||
// })
|
||||
// id.WaitAsync(func(clock *gst.Clock, clockTime time.Duration) bool {
|
||||
// fmt.Println("Single shot triggered at", clockTime.Nanoseconds())
|
||||
// pipeline.SetState(gst.StateNull)
|
||||
// return true
|
||||
// })
|
||||
//
|
||||
// pipeline.SetState(gst.StatePlaying)
|
||||
// gst.Wait(pipeline)
|
||||
// pipeline.SetState(gst.StatePlaying)
|
||||
// gst.Wait(pipeline)
|
||||
//
|
||||
// // Single shot triggered at 1000000000
|
||||
// // Single shot triggered at 1000000000
|
||||
func (c *ClockID) WaitAsync(f ClockCallback) ClockReturn {
|
||||
ptr := gopointer.Save(f)
|
||||
return ClockReturn(C.gst_clock_id_wait_async(
|
||||
@@ -272,7 +272,7 @@ func (c *Clock) NewSingleShotID(at time.Duration) *ClockID {
|
||||
}
|
||||
|
||||
// PeriodicIDReinit reinitializes the provided periodic id to the provided start time and interval. Does not
|
||||
/// modify the reference count.
|
||||
// / modify the reference count.
|
||||
func (c *Clock) PeriodicIDReinit(clockID *ClockID, startTime, interval time.Duration) bool {
|
||||
return gobool(C.gst_clock_periodic_id_reinit(
|
||||
c.Instance(),
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Device is a Go representation of a GstDevice.
|
||||
|
@@ -38,8 +38,8 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// Element is a Go wrapper around a GstElement.
|
||||
@@ -507,15 +507,16 @@ func (e *Element) RemovePad(pad *Pad) bool {
|
||||
// For example, audiomixer has sink template, 'sink_%u', which is used for creating multiple sink pads on demand so that it performs mixing of audio streams by linking multiple upstream elements on it's sink pads created on demand.
|
||||
// This returns the request pad created on demand. Otherwise, it returns null if failed to create.
|
||||
func (e *Element) GetRequestPad(name string) *Pad {
|
||||
cname := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cname))
|
||||
pad := C.gst_element_get_request_pad(e.Instance(), (*C.gchar)(unsafe.Pointer(cname)))
|
||||
if pad == nil {
|
||||
return nil
|
||||
}
|
||||
return FromGstPadUnsafeFull(unsafe.Pointer(pad))
|
||||
cname := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cname))
|
||||
pad := C.gst_element_get_request_pad(e.Instance(), (*C.gchar)(unsafe.Pointer(cname)))
|
||||
if pad == nil {
|
||||
return nil
|
||||
}
|
||||
return FromGstPadUnsafeFull(unsafe.Pointer(pad))
|
||||
}
|
||||
|
||||
// ReleaseRequestPad releases request pad
|
||||
func (e *Element) ReleaseRequestPad(pad *Pad) {
|
||||
C.gst_element_release_request_pad(e.Instance(), pad.Instance())
|
||||
C.gst_element_release_request_pad(e.Instance(), pad.Instance())
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// ElementClass represents the subclass of an element provided by a plugin.
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
//export goGstElementClassChangeState
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// NewElement creates a new element using the factory of the given name.
|
||||
|
@@ -43,7 +43,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// ExtendsElement implements an Extendable object based on a GstElement.
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// GhostPad is a go representation of a GstGhostPad.
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Memory is a go representation of GstMemory. This object is implemented in a read-only fashion
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Message is a Go wrapper around a GstMessage. It provides convenience methods for
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
func getMessageSourceObj(src interface{}) *C.GstObject {
|
||||
|
@@ -27,7 +27,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Meta is a go representation of GstMeta.
|
||||
|
@@ -6,7 +6,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// MiniObject is an opaque struct meant to form the base of gstreamer
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Object is a go representation of a GstObject.
|
||||
|
@@ -83,8 +83,8 @@ import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// PadFuncMap is an type of map for registering callbacks to a pad instance.
|
||||
|
@@ -7,8 +7,8 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
func getParent(parent *C.GstObject) *Object {
|
||||
|
@@ -5,7 +5,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// PadTemplate is a go representation of a GstPadTemplate
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Pipeline is a go implementation of a GstPipeline.
|
||||
|
@@ -53,8 +53,8 @@ import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// PluginMetadata represents the information to include when registering a new plugin
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Query is a go wrapper around a GstQuery.
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Registry is a go representation of a GstRegistry.
|
||||
|
@@ -6,7 +6,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// Stream is a Go representation of a GstStream.
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// StreamCollection is a Go representation of a GstStreamCollection.
|
||||
|
@@ -20,8 +20,8 @@ import (
|
||||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// Structure is a go implementation of a C GstStructure.
|
||||
|
@@ -18,8 +18,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
gopointer "github.com/mattn/go-pointer"
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
)
|
||||
|
||||
// TagList is a go wrapper around a GstTagList. For now, until the rest of the methods are
|
||||
@@ -47,10 +47,9 @@ func FromGstTagListUnsafeFull(tags unsafe.Pointer) *TagList {
|
||||
|
||||
// NewEmptyTagList returns a new empty tag list.
|
||||
//
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
// fmt.Println(tagList.IsEmpty())
|
||||
// // true
|
||||
//
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
// fmt.Println(tagList.IsEmpty())
|
||||
// // true
|
||||
func NewEmptyTagList() *TagList {
|
||||
return FromGstTagListUnsafeFull(unsafe.Pointer(C.gst_tag_list_new_empty()))
|
||||
}
|
||||
@@ -83,12 +82,11 @@ func (t *TagList) Unref() { C.gst_tag_list_unref(t.Instance()) }
|
||||
// AddValue adds a value to a given tag using the given merge mode. If the value provided
|
||||
// cannot be coerced to a GValue, nothing will happen.
|
||||
//
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbum, "MyNewAlbum")
|
||||
// myAlbum, _ := tagList.GetString(gst.TagAlbum)
|
||||
// fmt.Println(myAlbum)
|
||||
// // MyNewAlbum
|
||||
//
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbum, "MyNewAlbum")
|
||||
// myAlbum, _ := tagList.GetString(gst.TagAlbum)
|
||||
// fmt.Println(myAlbum)
|
||||
// // MyNewAlbum
|
||||
func (t *TagList) AddValue(mergeMode TagMergeMode, tag Tag, value interface{}) {
|
||||
ctag := C.CString(string(tag))
|
||||
defer C.free(unsafe.Pointer(ctag))
|
||||
@@ -129,19 +127,18 @@ type TagListForEachFunc func(tagList *TagList, tag Tag)
|
||||
// ForEach calls the given function for each tag inside the tag list. Note that if there is no tag,
|
||||
// the function won't be called at all.
|
||||
//
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
// tagList := gst.NewEmptyTagList()
|
||||
//
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbumArtist, "tinyzimmer")
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbum, "GstreamerInGo")
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbumArtist, "tinyzimmer")
|
||||
// tagList.AddValue(gst.TagMergeAppend, gst.TagAlbum, "GstreamerInGo")
|
||||
//
|
||||
// tagList.ForEach(func(_ *gst.TagList, tag gst.Tag) {
|
||||
// val, _ := tagList.GetString(tag)
|
||||
// fmt.Println(tag, ":", val)
|
||||
// })
|
||||
//
|
||||
// // album-artist : tinyzimmer
|
||||
// // album : GstreamerInGo
|
||||
// tagList.ForEach(func(_ *gst.TagList, tag gst.Tag) {
|
||||
// val, _ := tagList.GetString(tag)
|
||||
// fmt.Println(tag, ":", val)
|
||||
// })
|
||||
//
|
||||
// // album-artist : tinyzimmer
|
||||
// // album : GstreamerInGo
|
||||
func (t *TagList) ForEach(f TagListForEachFunc) {
|
||||
ptr := gopointer.Save(f)
|
||||
defer gopointer.Unref(ptr)
|
||||
|
@@ -5,7 +5,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// InterfaceTagSetter represents the GstTagsetter interface GType. Use this when querying bins
|
||||
|
@@ -5,7 +5,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
// InterfaceTOCSetter represents the GstTocSetter interface GType. Use this when querying bins
|
||||
|
@@ -23,7 +23,7 @@ import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
var globalURIHdlr URIHandler
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"math"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinyzimmer/go-glib/glib"
|
||||
"github.com/go-gst/go-glib/glib"
|
||||
)
|
||||
|
||||
//export goURIHdlrGetURIType
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user