mirror of
https://github.com/go-gst/go-gst.git
synced 2025-11-02 04:22:41 +08:00
update gotk4 for fixed signal emit, add an example for rtpextension that serves as a test case
This commit is contained in:
21
examples/rtpextension/main.go
Normal file
21
examples/rtpextension/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/go-gst/go-gst/pkg/gst"
|
||||
"github.com/go-gst/go-gst/pkg/gstrtp"
|
||||
)
|
||||
|
||||
// twccURI is the URI for the Transport Wide Congestion Control (TWCC) extension
|
||||
const twccURI = "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
|
||||
|
||||
// this example demonstrates how to create a TWCC RTP header extension, also this is a test for the
|
||||
// typechecking of the signal emit function
|
||||
func main() {
|
||||
gst.Init()
|
||||
|
||||
payloader := gst.ElementFactoryMake("rtpopuspay", "").(gstrtp.RTPBasePayload)
|
||||
|
||||
twcc := gstrtp.RTPHeaderExtensionCreateFromURI(twccURI)
|
||||
twcc.SetID(1)
|
||||
payloader.EmitAddExtension(twcc)
|
||||
}
|
||||
2
go.mod
2
go.mod
@@ -13,4 +13,4 @@ require (
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/diamondburned/gotk4 => github.com/rswilli/gotk4 v0.0.0-20250805132851-57fee0b69e38
|
||||
replace github.com/diamondburned/gotk4 => github.com/rswilli/gotk4 v0.0.0-20250805143037-39bfddd6e243
|
||||
|
||||
4
go.sum
4
go.sum
@@ -2,8 +2,8 @@ github.com/go-gst/go-glib v1.4.1-0.20241209142714-f53cebf18559 h1:AK60n6W3FLZTp9
|
||||
github.com/go-gst/go-glib v1.4.1-0.20241209142714-f53cebf18559/go.mod h1:ZWT4LXOO2PH8lSNu/dR5O2yoNQJKEgmijNa2d7nByK8=
|
||||
github.com/go-gst/go-pointer v0.0.0-20241127163939-ba766f075b4c h1:x8kKRVDmz5BRlolmDZGcsuZ1l+js6TRL3QWBJjGVctM=
|
||||
github.com/go-gst/go-pointer v0.0.0-20241127163939-ba766f075b4c/go.mod h1:qKw5ZZ0U58W6PU/7F/Lopv+14nKYmdXlOd7VnAZ17Mk=
|
||||
github.com/rswilli/gotk4 v0.0.0-20250805132851-57fee0b69e38 h1:ptbPMpRsKXlgzALSI1Gjd8z4aRBjW65Di5oGh8v5Kmg=
|
||||
github.com/rswilli/gotk4 v0.0.0-20250805132851-57fee0b69e38/go.mod h1:alpfblIRIC6MejV4eBLjWx61VeJvfQ/6dHGQZUkzSYE=
|
||||
github.com/rswilli/gotk4 v0.0.0-20250805143037-39bfddd6e243 h1:21iiZKwTfM23uOXheAHO31S2dMOshEURs+o1W5puSBQ=
|
||||
github.com/rswilli/gotk4 v0.0.0-20250805143037-39bfddd6e243/go.mod h1:alpfblIRIC6MejV4eBLjWx61VeJvfQ/6dHGQZUkzSYE=
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
|
||||
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
|
||||
|
||||
Reference in New Issue
Block a user