diff --git a/examples/custom_events/main.go b/examples/custom_events/main.go index d36a938..39354d6 100644 --- a/examples/custom_events/main.go +++ b/examples/custom_events/main.go @@ -2,11 +2,11 @@ package main import ( + "context" "fmt" "runtime" "time" - "github.com/diamondburned/gotk4/pkg/glib/v2" "github.com/go-gst/go-gst/pkg/gst" ) @@ -17,7 +17,7 @@ type ExampleCustomEvent struct { SendEOS bool } -func createPipeline() (*gst.Pipeline, error) { +func createPipeline() (gst.Pipeline, error) { gst.Init() // Create a new pipeline from a launch string @@ -29,15 +29,16 @@ func createPipeline() (*gst.Pipeline, error) { return nil, err } - pipeline := ret.(*gst.Pipeline) + pipeline := ret.(gst.Pipeline) - var sink *gst.Element - var sinkpad *gst.Pad + var sink gst.Element + var sinkpad gst.Pad // Retrieve the sink pad for v := range pipeline.IterateSinks().Values() { - sink = v.(*gst.Element) - sinkpad = sink.StaticPad("sink") + sink = v.(gst.Element) + + sinkpad = sink.GetStaticPad("sink") break } @@ -46,18 +47,18 @@ func createPipeline() (*gst.Pipeline, error) { } // Add a probe for out custom event - sinkpad.AddProbe(gst.PadProbeTypeEventDownstream, func(self *gst.Pad, info *gst.PadProbeInfo) gst.PadProbeReturn { + sinkpad.AddProbe(gst.PadProbeTypeEventDownstream, func(self gst.Pad, info *gst.PadProbeInfo) gst.PadProbeReturn { // Retrieve the event from the probe - ev := info.Event() + ev := info.GetEvent() // Extra check to make sure it is the right type. - if ev.Type() != gst.EventCustomDownstream { + if ev.GetType() != gst.EventCustomDownstream { return gst.PadProbeHandled } // Unmarshal the event into our custom one var customEvent ExampleCustomEvent - if err := ev.Structure().UnmarshalInto(&customEvent); err != nil { + if err := ev.GetStructure().UnmarshalInto(&customEvent); err != nil { fmt.Println("Could not parse the custom event!") return gst.PadProbeHandled } @@ -69,7 +70,7 @@ func createPipeline() (*gst.Pipeline, error) { // This is becaues the SendEvent method blocks and this could cause a dead lock sending the // event directly from the probe. This is the near equivalent of using go func() { ... }(), // however displayed this way for demonstration purposes. - sink.CallAsync(func(el gst.Elementer) { + sink.CallAsync(func(el gst.Element) { fmt.Println("Send EOS is true, sending eos") if !pipeline.SendEvent(gst.NewEventEos()) { fmt.Println("WARNING: Failed to send EOS to pipeline") @@ -85,18 +86,19 @@ func createPipeline() (*gst.Pipeline, error) { return pipeline, nil } -func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { - // Create a watch on the pipeline to kill the main loop when EOS is received - pipeline.Bus().AddWatch(0, func(bus *gst.Bus, msg *gst.Message) bool { - switch msg.Type() { - case gst.MessageEos: - fmt.Println("Got EOS message") - loop.Quit() - default: - fmt.Println(msg) +func runPipeline(pipeline gst.Pipeline) { + + go func() { + for msg := range pipeline.GetBus().Messages(context.Background()) { + switch msg.Type() { + case gst.MessageEos: + fmt.Println("Got EOS message") + return + default: + fmt.Println(msg) + } } - return true - }) + }() // Start the pipeline pipeline.SetState(gst.StatePlaying) @@ -104,6 +106,8 @@ func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { go func() { // Loop and on the third iteration send the custom event. ticker := time.NewTicker(time.Second * 2) + defer ticker.Stop() + count := 0 for range ticker.C { ev := ExampleCustomEvent{Count: count} @@ -129,8 +133,6 @@ func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { // you will be done with the object. This instructs the runtime to defer the finalizer // until after this point is passed in the code execution. - loop.Run() - runtime.KeepAlive(pipeline) } @@ -141,7 +143,5 @@ func main() { panic(err) } - mainloop := glib.NewMainLoop(glib.MainContextDefault(), false) - - runPipeline(mainloop, pipeline) + runPipeline(pipeline) } diff --git a/examples/decodebin/main.go b/examples/decodebin/main.go index 766bd15..0637238 100644 --- a/examples/decodebin/main.go +++ b/examples/decodebin/main.go @@ -32,27 +32,26 @@ package main import ( + "context" "errors" "flag" "fmt" "os" "strings" - "weak" - "github.com/diamondburned/gotk4/pkg/glib/v2" "github.com/go-gst/go-gst/pkg/gst" ) var srcFile string -func buildPipeline() (*gst.Pipeline, error) { +func buildPipeline() (gst.Pipeline, error) { gst.Init() - pipeline := gst.NewPipeline("") + pipeline := gst.NewPipeline("").(gst.Pipeline) src := gst.ElementFactoryMake("filesrc", "") - decodebin, ok := gst.ElementFactoryMake("decodebin", "").(*gst.Bin) // must cast since we need a weak reference + decodebin, ok := gst.ElementFactoryMake("decodebin", "").(gst.Bin) if !ok { return nil, fmt.Errorf("could not create decodebin") } @@ -62,23 +61,20 @@ func buildPipeline() (*gst.Pipeline, error) { pipeline.AddMany(src, decodebin) src.Link(decodebin) - // prevent reference cycles with the connect handler: - weakDecodeBin := weak.Make(decodebin) - // Connect to decodebin's pad-added signal, that is emitted whenever // it found another stream from the input file and found a way to decode it to its raw format. // decodebin automatically adds a src-pad for this raw stream, which // we can use to build the follow-up pipeline. - decodebin.ConnectPadAdded(func(srcPad *gst.Pad) { + decodebin.ConnectPadAdded(func(decodebin gst.Element, srcPad gst.Pad) { // Try to detect whether this is video or audio var isAudio, isVideo bool - caps := srcPad.CurrentCaps() - for i := 0; i < int(caps.Size()); i++ { - st := caps.Structure(uint(i)) - if strings.HasPrefix(st.Name(), "audio/") { + caps := srcPad.GetCurrentCaps() + for i := 0; i < int(caps.GetSize()); i++ { + st := caps.GetStructure(uint(i)) + if strings.HasPrefix(st.GetName(), "audio/") { isAudio = true } - if strings.HasPrefix(st.Name(), "video/") { + if strings.HasPrefix(st.GetName(), "video/") { isVideo = true } } @@ -89,8 +85,8 @@ func buildPipeline() (*gst.Pipeline, error) { err := errors.New("could not detect media stream type") // We can send errors directly to the pipeline bus if they occur. // These will be handled downstream. - msg := gst.NewMessageError(weakDecodeBin.Value(), err, fmt.Sprintf("Received caps: %s", caps.String())) - pipeline.Bus().Post(msg) + msg := gst.NewMessageError(decodebin, fmt.Sprintf("Received caps: %s", caps.String()), err) + pipeline.GetBus().Post(msg) return } @@ -99,8 +95,8 @@ func buildPipeline() (*gst.Pipeline, error) { // play it on the default audio playback device (using autoaudiosink). audiosink, err := gst.ParseBinFromDescription("queue ! audioconvert ! audioresample ! autoaudiosink", true) if err != nil { - msg := gst.NewMessageError(weakDecodeBin.Value(), err, "Could not create elements for audio pipeline") - pipeline.Bus().Post(msg) + msg := gst.NewMessageError(decodebin, "Could not create elements for audio pipeline", err) + pipeline.GetBus().Post(msg) return } pipeline.Add(audiosink) @@ -114,7 +110,7 @@ func buildPipeline() (*gst.Pipeline, error) { // Get the queue element's sink pad and link the decodebin's newly created // src pad for the audio stream to it. - sinkPad := audiosink.StaticPad("sink") + sinkPad := audiosink.GetStaticPad("sink") srcPad.Link(sinkPad) } else if isVideo { @@ -122,8 +118,8 @@ func buildPipeline() (*gst.Pipeline, error) { // display it using the autovideosink. videosink, err := gst.ParseBinFromDescription("queue ! videoconvert ! videoscale ! autovideosink", true) if err != nil { - msg := gst.NewMessageError(weakDecodeBin.Value(), err, "Could not create elements for video pipeline") - pipeline.Bus().Post(msg) + msg := gst.NewMessageError(decodebin, "Could not create elements for video pipeline", err) + pipeline.GetBus().Post(msg) return } pipeline.Add(videosink) @@ -132,19 +128,18 @@ func buildPipeline() (*gst.Pipeline, error) { // Get the queue element's sink pad and link the decodebin's newly created // src pad for the video stream to it. - sinkPad := videosink.StaticPad("sink") + sinkPad := videosink.GetStaticPad("sink") srcPad.Link(sinkPad) } }) return pipeline, nil } -func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { +func runPipeline(pipeline gst.Pipeline) { // Start the pipeline pipeline.SetState(gst.StatePlaying) - // Add a message watch to the bus to quit on any error - pipeline.Bus().AddWatch(0, func(bus *gst.Bus, msg *gst.Message) bool { + for msg := range pipeline.GetBus().Messages(context.Background()) { var err error // If the stream has ended or any element posts an error to the @@ -155,7 +150,7 @@ func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { case gst.MessageError: // The parsed error implements the error interface, but also // contains additional debug information. - gerr, debug := msg.ParseError() + debug, gerr := msg.ParseError() fmt.Println("go-gst-debug:", debug) err = gerr } @@ -163,15 +158,9 @@ func runPipeline(loop *glib.MainLoop, pipeline *gst.Pipeline) { // If either condition triggered an error, log and quit if err != nil { fmt.Println("ERROR:", err.Error()) - loop.Quit() - return false + return } - - return true - }) - - // Block on the main loop - loop.Run() + } } func main() { @@ -188,7 +177,5 @@ func main() { panic(err) } - mainloop := glib.NewMainLoop(glib.MainContextDefault(), false) - - runPipeline(mainloop, pipeline) + runPipeline(pipeline) } diff --git a/generator.go b/generator.go index 562c3cd..69a2545 100644 --- a/generator.go +++ b/generator.go @@ -126,6 +126,7 @@ var Data = genmain.Overlay( typesystem.IgnoreMatching("Message.new_property_notify"), typesystem.IgnoreMatching("Message.get_stream_status_object"), typesystem.IgnoreMatching("Structure.get_value"), + typesystem.IgnoreMatching("Structure.set_value"), typesystem.IgnoreMatching("Structure.id_get_value"), typesystem.IgnoreMatching("Structure.id_take_value"), typesystem.IgnoreMatching("Structure.take_value"), diff --git a/pkg/gst/bin_manual.go b/pkg/gst/bin_manual.go index 4ed7e2e..d3d1a18 100644 --- a/pkg/gst/bin_manual.go +++ b/pkg/gst/bin_manual.go @@ -52,6 +52,12 @@ type BinExtManual interface { // This works like gst_debug_bin_to_dot_file(), but adds the current timestamp // to the filename, so that it can be used to take multiple snapshots. DebugBinToDotFileWithTs(details DebugGraphDetails, fileName string) + + // AddMany adds many elements at once to the bin + AddMany(els ...Element) bool + + // RemoveMany removes many elements at once from the bin + RemoveMany(els ...Element) bool } // DebugBinToDotData wraps gst_debug_bin_to_dot_data @@ -106,3 +112,25 @@ func (bin *BinInstance) DebugBinToDotFile(details DebugGraphDetails, fileName st func (bin *BinInstance) DebugBinToDotFileWithTs(details DebugGraphDetails, fileName string) { DebugBinToDotFileWithTs(bin, details, fileName) } + +func (bin *BinInstance) AddMany(els ...Element) bool { + + for _, el := range els { + if !bin.Add(el) { + + return false + } + } + + return true +} + +func (bin *BinInstance) RemoveMany(els ...Element) bool { + for _, el := range els { + if !bin.Remove(el) { + return false + } + } + + return true +} diff --git a/pkg/gst/event.go b/pkg/gst/event.go new file mode 100644 index 0000000..8672682 --- /dev/null +++ b/pkg/gst/event.go @@ -0,0 +1,13 @@ +package gst + +func (r *Event) GetType() EventType { + return EventType(r.event.native._type) +} + +func (r *Event) GetTimestamp() uint64 { + return uint64(r.event.native.timestamp) +} + +func (r *Event) GetSeqNum() uint32 { + return uint32(r.event.native.seqnum) +} diff --git a/pkg/gst/gst.gen.go b/pkg/gst/gst.gen.go index bcaa78e..1f7f94e 100644 --- a/pkg/gst/gst.gen.go +++ b/pkg/gst/gst.gen.go @@ -32,14 +32,12 @@ import ( // extern gboolean _gotk4_gst1_StructureFilterMapFunc(GQuark, GValue*, gpointer); // extern gboolean _gotk4_gst1_StructureForEachFunc(GQuark, GValue*, gpointer); // extern gboolean _gotk4_gst1_StructureMapFunc(GQuark, GValue*, gpointer); -// extern gint _gotk4_glib2_CompareDataFunc(gconstpointer, gconstpointer, gpointer); // extern void _gotk4_gst1_ElementCallAsyncFunc(GstElement*, gpointer); // extern void _gotk4_gst1_IteratorForEachFunction(GValue*, gpointer); // extern void _gotk4_gst1_LogFunction(GstDebugCategory*, GstDebugLevel, gchar*, gchar*, gint, GObject*, GstDebugMessage*, gpointer); // extern void _gotk4_gst1_PromiseChangeFunc(GstPromise*, gpointer); // extern void _gotk4_gst1_TagForEachFunc(GstTagList*, gchar*, gpointer); // extern void _gotk4_gst1_TaskFunction(gpointer); -// extern void _gotk4_gst1_TaskPoolFunction(void*); // extern void destroyUserdata(gpointer); import "C" @@ -6720,17 +6718,6 @@ type CapsForEachFunc func(features *CapsFeatures, structure *Structure) (goret b // may modify @features and @structure. type CapsMapFunc func(features *CapsFeatures, structure *Structure) (goret bool) -// CustomMetaTransformFunction wraps GstCustomMetaTransformFunction -// -// Function called for each @meta in @buffer as a result of performing a -// transformation that yields @transbuf. Additional @type specific transform -// data is passed to the function as @data. -// -// Implementations should check the @type of the transform and parse -// additional type specific fields in @data that should be used to update -// the metadata on @transbuf. -type CustomMetaTransformFunction func(transbuf *Buffer, meta *CustomMeta, buffer *Buffer, typ glib.Quark, data unsafe.Pointer) (goret bool) - // IteratorFoldFunction wraps GstIteratorFoldFunction // // A function to be passed to gst_iterator_fold(). @@ -7175,65 +7162,6 @@ func DebugIsColored() bool { return goret } -// DebugLogDefault wraps gst_debug_log_default -// -// The function takes the following parameters: -// -// - category *DebugCategory: category to log -// - level DebugLevel: level of the message -// - file string: the file that emitted the message, usually the __FILE__ identifier -// - function string: the function that emitted the message -// - line int: the line from that the message was emitted, usually __LINE__ -// - object gobject.Object (nullable): the object this message relates to, -// or %NULL if none -// - message *DebugMessage: the actual message -// - userData unsafe.Pointer (nullable): the FILE* to log to -// -// The default logging handler used by GStreamer. Logging functions get called -// whenever a macro like GST_DEBUG or similar is used. By default this function -// is setup to output the message and additional info to stderr (or the log file -// specified via the GST_DEBUG_FILE environment variable) as received via -// @user_data. -// -// You can add other handlers by using gst_debug_add_log_function(). -// And you can remove this handler by calling -// gst_debug_remove_log_function(gst_debug_log_default); -func DebugLogDefault(category *DebugCategory, level DebugLevel, file string, function string, line int, object gobject.Object, message *DebugMessage, userData unsafe.Pointer) { - var carg1 *C.GstDebugCategory // in, none, converted - var carg2 C.GstDebugLevel // in, none, casted - var carg3 *C.gchar // in, none, string, casted *C.gchar - var carg4 *C.gchar // in, none, string, casted *C.gchar - var carg5 C.gint // in, none, casted - var carg6 *C.GObject // in, none, converted, nullable - var carg7 *C.GstDebugMessage // in, none, converted - var carg8 C.gpointer // in, none, casted, nullable - - carg1 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category)) - carg2 = C.GstDebugLevel(level) - carg3 = (*C.gchar)(unsafe.Pointer(C.CString(file))) - defer C.free(unsafe.Pointer(carg3)) - carg4 = (*C.gchar)(unsafe.Pointer(C.CString(function))) - defer C.free(unsafe.Pointer(carg4)) - carg5 = C.gint(line) - if object != nil { - carg6 = (*C.GObject)(gobject.UnsafeObjectToGlibNone(object)) - } - carg7 = (*C.GstDebugMessage)(UnsafeDebugMessageToGlibNone(message)) - if userData != nil { - carg8 = C.gpointer(userData) - } - - C.gst_debug_log_default(carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8) - runtime.KeepAlive(category) - runtime.KeepAlive(level) - runtime.KeepAlive(file) - runtime.KeepAlive(function) - runtime.KeepAlive(line) - runtime.KeepAlive(object) - runtime.KeepAlive(message) - runtime.KeepAlive(userData) -} - // DebugLogGetLine wraps gst_debug_log_get_line // // The function takes the following parameters: @@ -7397,35 +7325,6 @@ func DebugPrintStackTrace() { C.gst_debug_print_stack_trace() } -// DebugRemoveLogFunctionByData wraps gst_debug_remove_log_function_by_data -// -// The function takes the following parameters: -// -// - data unsafe.Pointer (nullable): user data of the log function to remove -// -// The function returns the following values: -// -// - goret uint -// -// Removes all registered instances of log functions with the given user data. -func DebugRemoveLogFunctionByData(data unsafe.Pointer) uint { - var carg1 C.gpointer // in, none, casted, nullable - var cret C.guint // return, none, casted - - if data != nil { - carg1 = C.gpointer(data) - } - - cret = C.gst_debug_remove_log_function_by_data(carg1) - runtime.KeepAlive(data) - - var goret uint - - goret = uint(cret) - - return goret -} - // DebugRemoveRingBufferLogger wraps gst_debug_remove_ring_buffer_logger // // Removes any previously added ring buffer logger with @@ -8604,66 +8503,6 @@ func UpdateRegistry() bool { return goret } -// UtilArrayBinarySearch wraps gst_util_array_binary_search -// -// The function takes the following parameters: -// -// - array unsafe.Pointer (nullable): the sorted input array -// - numElements uint: number of elements in the array -// - elementSize uint: size of every element in bytes -// - searchFunc glib.CompareDataFunc: function to compare two elements, @search_data will always be passed as second argument -// - mode SearchMode: search mode that should be used -// - searchData unsafe.Pointer (nullable): element that should be found -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Searches inside @array for @search_data by using the comparison function -// @search_func. @array must be sorted ascending. -// -// As @search_data is always passed as second argument to @search_func it's -// not required that @search_data has the same type as the array elements. -// -// The complexity of this search function is O(log (num_elements)). -func UtilArrayBinarySearch(array unsafe.Pointer, numElements uint, elementSize uint, searchFunc glib.CompareDataFunc, mode SearchMode, searchData unsafe.Pointer) unsafe.Pointer { - var carg1 C.gpointer // in, none, casted, nullable - var carg2 C.guint // in, none, casted - var carg3 C.gsize // in, none, casted - var carg4 C.GCompareDataFunc // callback, scope: call, closure: carg7 - var carg5 C.GstSearchMode // in, none, casted - var carg6 C.gconstpointer // in, none, casted, nullable - var carg7 C.gpointer // implicit - var cret C.gpointer // return, none, casted - - if array != nil { - carg1 = C.gpointer(array) - } - carg2 = C.guint(numElements) - carg3 = C.gsize(elementSize) - carg4 = (*[0]byte)(C._gotk4_glib2_CompareDataFunc) - carg7 = C.gpointer(userdata.Register(searchFunc)) - defer userdata.Delete(unsafe.Pointer(carg7)) - carg5 = C.GstSearchMode(mode) - if searchData != nil { - carg6 = C.gconstpointer(searchData) - } - - cret = C.gst_util_array_binary_search(carg1, carg2, carg3, carg4, carg5, carg6, carg7) - runtime.KeepAlive(array) - runtime.KeepAlive(numElements) - runtime.KeepAlive(elementSize) - runtime.KeepAlive(searchFunc) - runtime.KeepAlive(mode) - runtime.KeepAlive(searchData) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // UtilCeilLog2 wraps gst_util_ceil_log2 // // The function takes the following parameters: @@ -10933,7 +10772,7 @@ type ChildProxyInstance struct { var _ ChildProxy = (*ChildProxyInstance)(nil) -// ChildProxyInstance wraps GstChildProxy +// ChildProxy wraps GstChildProxy // // This interface abstracts handling of property sets for elements with // children. Imagine elements such as mixers or polyphonic generators. They all @@ -11024,6 +10863,14 @@ type ChildProxy interface { // // Gets the number of child objects this parent contains. GetChildrenCount() uint + // ConnectChildAdded connects the provided callback to the "child-added" signal + // + // Will be emitted after the @object was added to the @child_proxy. + ConnectChildAdded(func(ChildProxy, gobject.Object, string)) gobject.SignalHandle + // ConnectChildRemoved connects the provided callback to the "child-removed" signal + // + // Will be emitted after the @object was removed from the @child_proxy. + ConnectChildRemoved(func(ChildProxy, gobject.Object, string)) gobject.SignalHandle } var _ ChildProxy = (*ChildProxyInstance)(nil) @@ -11237,6 +11084,18 @@ func (parent *ChildProxyInstance) GetChildrenCount() uint { return goret } +// ConnectChildAdded connects the provided callback to the "child-added" signal +// +// Will be emitted after the @object was added to the @child_proxy. +func (o *ChildProxyInstance) ConnectChildAdded(fn func(ChildProxy, gobject.Object, string)) gobject.SignalHandle { + return o.Instance.Connect("child-added", fn) +} +// ConnectChildRemoved connects the provided callback to the "child-removed" signal +// +// Will be emitted after the @object was removed from the @child_proxy. +func (o *ChildProxyInstance) ConnectChildRemoved(fn func(ChildProxy, gobject.Object, string)) gobject.SignalHandle { + return o.Instance.Connect("child-removed", fn) +} // PresetInstance is the instance type used by all types implementing GstPreset. It is used internally by the bindings. Users should use the interface [Preset] instead. type PresetInstance struct { _ [0]func() // equal guard @@ -11245,7 +11104,7 @@ type PresetInstance struct { var _ Preset = (*PresetInstance)(nil) -// PresetInstance wraps GstPreset +// Preset wraps GstPreset // // This interface offers methods to query and manipulate parameter preset sets. // A preset is a bunch of property settings, together with meta data and a name. @@ -11777,7 +11636,7 @@ type URIHandlerInstance struct { var _ URIHandler = (*URIHandlerInstance)(nil) -// URIHandlerInstance wraps GstURIHandler +// URIHandler wraps GstURIHandler // // The #GstURIHandler is an interface that is implemented by Source and Sink // #GstElement to unify handling of URI. @@ -11982,7 +11841,7 @@ type TagSetterInstance struct { var _ TagSetter = (*TagSetterInstance)(nil) -// TagSetterInstance wraps GstTagSetter +// TagSetter wraps GstTagSetter // // Element interface that allows setting of media metadata. // @@ -12260,7 +12119,7 @@ type TocSetterInstance struct { var _ TocSetter = (*TocSetterInstance)(nil) -// TocSetterInstance wraps GstTocSetter +// TocSetter wraps GstTocSetter // // Element interface that allows setting of the TOC. // @@ -13613,14 +13472,6 @@ type Pad interface { // decided at construction time so this function does not take // the LOCK. GetDirection() PadDirection - // GetElementPrivate wraps gst_pad_get_element_private - // The function returns the following values: - // - // - goret unsafe.Pointer - // - // Gets the private data of a pad. - // No locking is performed in this function. - GetElementPrivate() unsafe.Pointer // GetLastFlowReturn wraps gst_pad_get_last_flow_return // The function returns the following values: // @@ -14333,16 +14184,6 @@ type Pad interface { // If not @active, calls gst_pad_activate_mode() with the pad's current mode // and a %FALSE argument. SetActive(bool) bool - // SetElementPrivate wraps gst_pad_set_element_private - // - // The function takes the following parameters: - // - // - priv unsafe.Pointer (nullable): The private data to attach to the pad. - // - // Set the given private data gpointer on the pad. - // This function can only be used by the element that owns the pad. - // No locking is performed in this function. - SetElementPrivate(unsafe.Pointer) // SetOffset wraps gst_pad_set_offset // // The function takes the following parameters: @@ -14416,6 +14257,14 @@ type Pad interface { // pad. Use this function on a pad that, once it negotiated to a CAPS, cannot // be renegotiated to something else. UseFixedCaps() + // ConnectLinked connects the provided callback to the "linked" signal + // + // Signals that a pad has been linked to the peer pad. + ConnectLinked(func(Pad, Pad)) gobject.SignalHandle + // ConnectUnlinked connects the provided callback to the "unlinked" signal + // + // Signals that a pad has been unlinked from the peer pad. + ConnectUnlinked(func(Pad, Pad)) gobject.SignalHandle } func unsafeWrapPad(base *gobject.ObjectInstance) *PadInstance { @@ -15040,29 +14889,6 @@ func (pad *PadInstance) GetDirection() PadDirection { return goret } -// GetElementPrivate wraps gst_pad_get_element_private -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Gets the private data of a pad. -// No locking is performed in this function. -func (pad *PadInstance) GetElementPrivate() unsafe.Pointer { - var carg0 *C.GstPad // in, none, converted - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad)) - - cret = C.gst_pad_get_element_private(carg0) - runtime.KeepAlive(pad) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // GetLastFlowReturn wraps gst_pad_get_last_flow_return // The function returns the following values: // @@ -16683,29 +16509,6 @@ func (pad *PadInstance) SetActive(active bool) bool { return goret } -// SetElementPrivate wraps gst_pad_set_element_private -// -// The function takes the following parameters: -// -// - priv unsafe.Pointer (nullable): The private data to attach to the pad. -// -// Set the given private data gpointer on the pad. -// This function can only be used by the element that owns the pad. -// No locking is performed in this function. -func (pad *PadInstance) SetElementPrivate(priv unsafe.Pointer) { - var carg0 *C.GstPad // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - - carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad)) - if priv != nil { - carg1 = C.gpointer(priv) - } - - C.gst_pad_set_element_private(carg0, carg1) - runtime.KeepAlive(pad) - runtime.KeepAlive(priv) -} - // SetOffset wraps gst_pad_set_offset // // The function takes the following parameters: @@ -16877,6 +16680,18 @@ func (pad *PadInstance) UseFixedCaps() { runtime.KeepAlive(pad) } +// ConnectLinked connects the provided callback to the "linked" signal +// +// Signals that a pad has been linked to the peer pad. +func (o *PadInstance) ConnectLinked(fn func(Pad, Pad)) gobject.SignalHandle { + return o.Connect("linked", fn) +} +// ConnectUnlinked connects the provided callback to the "unlinked" signal +// +// Signals that a pad has been unlinked from the peer pad. +func (o *PadInstance) ConnectUnlinked(fn func(Pad, Pad)) gobject.SignalHandle { + return o.Connect("unlinked", fn) +} // PadTemplateInstance is the instance type used by all types extending GstPadTemplate. It is used internally by the bindings. Users should use the interface [PadTemplate] instead. type PadTemplateInstance struct { _ [0]func() // equal guard @@ -16984,6 +16799,10 @@ type PadTemplate interface { // into the documentation, element authors should use this method to // expose "stable" caps to the reader. SetDocumentationCaps(*Caps) + // ConnectPadCreated connects the provided callback to the "pad-created" signal + // + // This signal is fired when an element creates a pad from this template. + ConnectPadCreated(func(PadTemplate, Pad)) gobject.SignalHandle } func unsafeWrapPadTemplate(base *gobject.ObjectInstance) *PadTemplateInstance { @@ -17226,6 +17045,12 @@ func (templ *PadTemplateInstance) SetDocumentationCaps(caps *Caps) { runtime.KeepAlive(caps) } +// ConnectPadCreated connects the provided callback to the "pad-created" signal +// +// This signal is fired when an element creates a pad from this template. +func (o *PadTemplateInstance) ConnectPadCreated(fn func(PadTemplate, Pad)) gobject.SignalHandle { + return o.Connect("pad-created", fn) +} // PluginInstance is the instance type used by all types extending GstPlugin. It is used internally by the bindings. Users should use the interface [Plugin] instead. type PluginInstance struct { _ [0]func() // equal guard @@ -18964,6 +18789,16 @@ type Registry interface { // Scan the given path for plugins to add to the registry. The syntax of the // path is specific to the registry. ScanPath(string) bool + // ConnectFeatureAdded connects the provided callback to the "feature-added" signal + // + // Signals that a feature has been added to the registry (possibly + // replacing a previously-added one by the same name) + ConnectFeatureAdded(func(Registry, PluginFeature)) gobject.SignalHandle + // ConnectPluginAdded connects the provided callback to the "plugin-added" signal + // + // Signals that a plugin has been added to the registry (possibly + // replacing a previously-added one by the same name) + ConnectPluginAdded(func(Registry, Plugin)) gobject.SignalHandle } func unsafeWrapRegistry(base *gobject.ObjectInstance) *RegistryInstance { @@ -19415,6 +19250,20 @@ func (registry *RegistryInstance) ScanPath(path string) bool { return goret } +// ConnectFeatureAdded connects the provided callback to the "feature-added" signal +// +// Signals that a feature has been added to the registry (possibly +// replacing a previously-added one by the same name) +func (o *RegistryInstance) ConnectFeatureAdded(fn func(Registry, PluginFeature)) gobject.SignalHandle { + return o.Connect("feature-added", fn) +} +// ConnectPluginAdded connects the provided callback to the "plugin-added" signal +// +// Signals that a plugin has been added to the registry (possibly +// replacing a previously-added one by the same name) +func (o *RegistryInstance) ConnectPluginAdded(fn func(Registry, Plugin)) gobject.SignalHandle { + return o.Connect("plugin-added", fn) +} // StreamInstance is the instance type used by all types extending GstStream. It is used internally by the bindings. Users should use the interface [Stream] instead. type StreamInstance struct { _ [0]func() // equal guard @@ -20540,35 +20389,6 @@ type TaskPool interface { // // MT safe. Cleanup() - // DisposeHandle wraps gst_task_pool_dispose_handle - // - // The function takes the following parameters: - // - // - id unsafe.Pointer (nullable): the id - // - // Dispose of the handle returned by gst_task_pool_push(). This does - // not need to be called with the default implementation as the default - // #GstTaskPoolClass::push implementation always returns %NULL. This does not need to be - // called either when calling gst_task_pool_join(), but should be called - // when joining is not necessary, but gst_task_pool_push() returned a - // non-%NULL value. - // - // This method should only be called with the same @pool instance that provided - // @id. - DisposeHandle(unsafe.Pointer) - // Join wraps gst_task_pool_join - // - // The function takes the following parameters: - // - // - id unsafe.Pointer (nullable): the id - // - // Join a task and/or return it to the pool. @id is the id obtained from - // gst_task_pool_push(). The default implementation does nothing, as the - // default #GstTaskPoolClass::push implementation always returns %NULL. - // - // This method should only be called with the same @pool instance that provided - // @id. - Join(unsafe.Pointer) // Prepare wraps gst_task_pool_prepare // The function returns the following values: // @@ -20578,19 +20398,6 @@ type TaskPool interface { // // MT safe. Prepare() error - // Push wraps gst_task_pool_push - // - // The function takes the following parameters: - // - // - fn TaskPoolFunction: the function to call - // - // The function returns the following values: - // - // - goret unsafe.Pointer - // - _goerr error (nullable): an error - // - // Start the execution of a new thread from @pool. - Push(TaskPoolFunction) (unsafe.Pointer, error) } func unsafeWrapTaskPool(base *gobject.ObjectInstance) *TaskPoolInstance { @@ -20665,61 +20472,6 @@ func (pool *TaskPoolInstance) Cleanup() { runtime.KeepAlive(pool) } -// DisposeHandle wraps gst_task_pool_dispose_handle -// -// The function takes the following parameters: -// -// - id unsafe.Pointer (nullable): the id -// -// Dispose of the handle returned by gst_task_pool_push(). This does -// not need to be called with the default implementation as the default -// #GstTaskPoolClass::push implementation always returns %NULL. This does not need to be -// called either when calling gst_task_pool_join(), but should be called -// when joining is not necessary, but gst_task_pool_push() returned a -// non-%NULL value. -// -// This method should only be called with the same @pool instance that provided -// @id. -func (pool *TaskPoolInstance) DisposeHandle(id unsafe.Pointer) { - var carg0 *C.GstTaskPool // in, none, converted - var carg1 C.gpointer // in, full, casted, nullable - - carg0 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool)) - if id != nil { - carg1 = C.gpointer(id) - } - - C.gst_task_pool_dispose_handle(carg0, carg1) - runtime.KeepAlive(pool) - runtime.KeepAlive(id) -} - -// Join wraps gst_task_pool_join -// -// The function takes the following parameters: -// -// - id unsafe.Pointer (nullable): the id -// -// Join a task and/or return it to the pool. @id is the id obtained from -// gst_task_pool_push(). The default implementation does nothing, as the -// default #GstTaskPoolClass::push implementation always returns %NULL. -// -// This method should only be called with the same @pool instance that provided -// @id. -func (pool *TaskPoolInstance) Join(id unsafe.Pointer) { - var carg0 *C.GstTaskPool // in, none, converted - var carg1 C.gpointer // in, full, casted, nullable - - carg0 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool)) - if id != nil { - carg1 = C.gpointer(id) - } - - C.gst_task_pool_join(carg0, carg1) - runtime.KeepAlive(pool) - runtime.KeepAlive(id) -} - // Prepare wraps gst_task_pool_prepare // The function returns the following values: // @@ -20746,44 +20498,6 @@ func (pool *TaskPoolInstance) Prepare() error { return _goerr } -// Push wraps gst_task_pool_push -// -// The function takes the following parameters: -// -// - fn TaskPoolFunction: the function to call -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// - _goerr error (nullable): an error -// -// Start the execution of a new thread from @pool. -func (pool *TaskPoolInstance) Push(fn TaskPoolFunction) (unsafe.Pointer, error) { - var carg0 *C.GstTaskPool // in, none, converted - var carg1 C.GstTaskPoolFunction // callback, scope: async, closure: carg2 - var carg2 C.gpointer // implicit - var cret C.gpointer // return, full, casted - var _cerr *C.GError // out, full, converted, nullable - - carg0 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool)) - carg1 = (*[0]byte)(C._gotk4_gst1_TaskPoolFunction) - carg2 = C.gpointer(userdata.RegisterOnce(fn)) - - cret = C.gst_task_pool_push(carg0, carg1, carg2, &_cerr) - runtime.KeepAlive(pool) - runtime.KeepAlive(fn) - - var goret unsafe.Pointer - var _goerr error - - goret = unsafe.Pointer(cret) - if _cerr != nil { - _goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr)) - } - - return goret, _goerr -} - // TracerInstance is the instance type used by all types extending GstTracer. It is used internally by the bindings. Users should use the interface [Tracer] instead. type TracerInstance struct { _ [0]func() // equal guard @@ -22470,20 +22184,6 @@ type Bus interface { // The bus watch will take its own reference to the @bus, so it is safe to unref // @bus using gst_object_unref() after setting the bus watch. AddWatchFull(int, BusFunc) uint - // AsyncSignalFunc wraps gst_bus_async_signal_func - // - // The function takes the following parameters: - // - // - message *Message: the #GstMessage received - // - data unsafe.Pointer (nullable): user data - // - // The function returns the following values: - // - // - goret bool - // - // A helper #GstBusFunc that can be used to convert all asynchronous messages - // into signals. - AsyncSignalFunc(*Message, unsafe.Pointer) bool // CreateWatch wraps gst_bus_create_watch // The function returns the following values: // @@ -22676,20 +22376,6 @@ type Bus interface { // Before 1.16.3 it was not possible to replace an existing handler and // clearing an existing handler with %NULL was not thread-safe. SetSyncHandler(BusSyncHandler) - // SyncSignalHandler wraps gst_bus_sync_signal_handler - // - // The function takes the following parameters: - // - // - message *Message: the #GstMessage received - // - data unsafe.Pointer (nullable): user data - // - // The function returns the following values: - // - // - goret BusSyncReply - // - // A helper #GstBusSyncHandler that can be used to convert all synchronous - // messages into signals. - SyncSignalHandler(*Message, unsafe.Pointer) BusSyncReply // TimedPop wraps gst_bus_timed_pop // // The function takes the following parameters: @@ -22725,6 +22411,20 @@ type Bus interface { // @timeout is #GST_CLOCK_TIME_NONE, this function will block forever until a // matching message was posted on the bus. TimedPopFiltered(ClockTime, MessageType) *Message + // ConnectMessage connects the provided callback to the "message" signal + // + // A message has been posted on the bus. This signal is emitted from a + // #GSource added to the mainloop. this signal will only be emitted when + // there is a #GMainLoop running. + ConnectMessage(func(Bus, Message)) gobject.SignalHandle + // ConnectSyncMessage connects the provided callback to the "sync-message" signal + // + // A message has been posted on the bus. This signal is emitted from the + // thread that posted the message so one has to be careful with locking. + // + // This signal will not be emitted by default, you have to call + // gst_bus_enable_sync_message_emission() before. + ConnectSyncMessage(func(Bus, Message)) gobject.SignalHandle } func unsafeWrapBus(base *gobject.ObjectInstance) *BusInstance { @@ -22897,45 +22597,6 @@ func (bus *BusInstance) AddWatchFull(priority int, fn BusFunc) uint { return goret } -// AsyncSignalFunc wraps gst_bus_async_signal_func -// -// The function takes the following parameters: -// -// - message *Message: the #GstMessage received -// - data unsafe.Pointer (nullable): user data -// -// The function returns the following values: -// -// - goret bool -// -// A helper #GstBusFunc that can be used to convert all asynchronous messages -// into signals. -func (bus *BusInstance) AsyncSignalFunc(message *Message, data unsafe.Pointer) bool { - var carg0 *C.GstBus // in, none, converted - var carg1 *C.GstMessage // in, none, converted - var carg2 C.gpointer // in, none, casted, nullable - var cret C.gboolean // return - - carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus)) - carg1 = (*C.GstMessage)(UnsafeMessageToGlibNone(message)) - if data != nil { - carg2 = C.gpointer(data) - } - - cret = C.gst_bus_async_signal_func(carg0, carg1, carg2) - runtime.KeepAlive(bus) - runtime.KeepAlive(message) - runtime.KeepAlive(data) - - var goret bool - - if cret != 0 { - goret = true - } - - return goret -} - // CreateWatch wraps gst_bus_create_watch // The function returns the following values: // @@ -23337,43 +22998,6 @@ func (bus *BusInstance) SetSyncHandler(fn BusSyncHandler) { runtime.KeepAlive(fn) } -// SyncSignalHandler wraps gst_bus_sync_signal_handler -// -// The function takes the following parameters: -// -// - message *Message: the #GstMessage received -// - data unsafe.Pointer (nullable): user data -// -// The function returns the following values: -// -// - goret BusSyncReply -// -// A helper #GstBusSyncHandler that can be used to convert all synchronous -// messages into signals. -func (bus *BusInstance) SyncSignalHandler(message *Message, data unsafe.Pointer) BusSyncReply { - var carg0 *C.GstBus // in, none, converted - var carg1 *C.GstMessage // in, none, converted - var carg2 C.gpointer // in, none, casted, nullable - var cret C.GstBusSyncReply // return, none, casted - - carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus)) - carg1 = (*C.GstMessage)(UnsafeMessageToGlibNone(message)) - if data != nil { - carg2 = C.gpointer(data) - } - - cret = C.gst_bus_sync_signal_handler(carg0, carg1, carg2) - runtime.KeepAlive(bus) - runtime.KeepAlive(message) - runtime.KeepAlive(data) - - var goret BusSyncReply - - goret = BusSyncReply(cret) - - return goret -} - // TimedPop wraps gst_bus_timed_pop // // The function takes the following parameters: @@ -23448,6 +23072,24 @@ func (bus *BusInstance) TimedPopFiltered(timeout ClockTime, types MessageType) * return goret } +// ConnectMessage connects the provided callback to the "message" signal +// +// A message has been posted on the bus. This signal is emitted from a +// #GSource added to the mainloop. this signal will only be emitted when +// there is a #GMainLoop running. +func (o *BusInstance) ConnectMessage(fn func(Bus, Message)) gobject.SignalHandle { + return o.Connect("message", fn) +} +// ConnectSyncMessage connects the provided callback to the "sync-message" signal +// +// A message has been posted on the bus. This signal is emitted from the +// thread that posted the message so one has to be careful with locking. +// +// This signal will not be emitted by default, you have to call +// gst_bus_enable_sync_message_emission() before. +func (o *BusInstance) ConnectSyncMessage(fn func(Bus, Message)) gobject.SignalHandle { + return o.Connect("sync-message", fn) +} // ClockInstance is the instance type used by all types extending GstClock. It is used internally by the bindings. Users should use the interface [Clock] instead. type ClockInstance struct { _ [0]func() // equal guard @@ -23887,6 +23529,15 @@ type Clock interface { // This returns immediately with %TRUE if %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC // is not set on the clock, or if the clock is already synced. WaitForSync(ClockTime) bool + // ConnectSynced connects the provided callback to the "synced" signal + // + // Signaled on clocks with %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC set once + // the clock is synchronized, or when it completely lost synchronization. + // This signal will not be emitted on clocks without the flag. + // + // This signal will be emitted from an arbitrary thread, most likely not + // the application's main thread. + ConnectSynced(func(Clock, bool)) gobject.SignalHandle } func unsafeWrapClock(base *gobject.ObjectInstance) *ClockInstance { @@ -25023,6 +24674,17 @@ func (clock *ClockInstance) WaitForSync(timeout ClockTime) bool { return goret } +// ConnectSynced connects the provided callback to the "synced" signal +// +// Signaled on clocks with %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC set once +// the clock is synchronized, or when it completely lost synchronization. +// This signal will not be emitted on clocks without the flag. +// +// This signal will be emitted from an arbitrary thread, most likely not +// the application's main thread. +func (o *ClockInstance) ConnectSynced(fn func(Clock, bool)) gobject.SignalHandle { + return o.Connect("synced", fn) +} // ControlBindingInstance is the instance type used by all types extending GstControlBinding. It is used internally by the bindings. Users should use the interface [ControlBinding] instead. type ControlBindingInstance struct { _ [0]func() // equal guard @@ -25490,6 +25152,8 @@ type Device interface { // Note: This should only be implemented for elements can change their // device in the PLAYING state. ReconfigureElement(Element) bool + // ConnectRemoved connects the provided callback to the "removed" signal + ConnectRemoved(func(Device)) gobject.SignalHandle } func unsafeWrapDevice(base *gobject.ObjectInstance) *DeviceInstance { @@ -25763,6 +25427,10 @@ func (device *DeviceInstance) ReconfigureElement(element Element) bool { return goret } +// ConnectRemoved connects the provided callback to the "removed" signal +func (o *DeviceInstance) ConnectRemoved(fn func(Device)) gobject.SignalHandle { + return o.Connect("removed", fn) +} // DeviceMonitorInstance is the instance type used by all types extending GstDeviceMonitor. It is used internally by the bindings. Users should use the interface [DeviceMonitor] instead. type DeviceMonitorInstance struct { _ [0]func() // equal guard @@ -26349,6 +26017,10 @@ type DeviceProvider interface { // monitoring the devices from provider factory @name in order to see // all devices again. UnhideProvider(string) + // ConnectProviderHidden connects the provided callback to the "provider-hidden" signal + ConnectProviderHidden(func(DeviceProvider, string)) gobject.SignalHandle + // ConnectProviderUnhidden connects the provided callback to the "provider-unhidden" signal + ConnectProviderUnhidden(func(DeviceProvider, string)) gobject.SignalHandle } func unsafeWrapDeviceProvider(base *gobject.ObjectInstance) *DeviceProviderInstance { @@ -26753,6 +26425,14 @@ func (provider *DeviceProviderInstance) UnhideProvider(name string) { runtime.KeepAlive(name) } +// ConnectProviderHidden connects the provided callback to the "provider-hidden" signal +func (o *DeviceProviderInstance) ConnectProviderHidden(fn func(DeviceProvider, string)) gobject.SignalHandle { + return o.Connect("provider-hidden", fn) +} +// ConnectProviderUnhidden connects the provided callback to the "provider-unhidden" signal +func (o *DeviceProviderInstance) ConnectProviderUnhidden(fn func(DeviceProvider, string)) gobject.SignalHandle { + return o.Connect("provider-unhidden", fn) +} // DeviceProviderFactoryInstance is the instance type used by all types extending GstDeviceProviderFactory. It is used internally by the bindings. Users should use the interface [DeviceProviderFactory] instead. type DeviceProviderFactoryInstance struct { _ [0]func() // equal guard @@ -28309,6 +27989,24 @@ type Element interface { // // This is a convenience function for gst_pad_unlink(). UnlinkPads(string, Element, string) + // ConnectNoMorePads connects the provided callback to the "no-more-pads" signal + // + // This signals that the element will not generate more dynamic pads. + // Note that this signal will usually be emitted from the context of + // the streaming thread. + ConnectNoMorePads(func(Element)) gobject.SignalHandle + // ConnectPadAdded connects the provided callback to the "pad-added" signal + // + // a new #GstPad has been added to the element. Note that this signal will + // usually be emitted from the context of the streaming thread. Also keep in + // mind that if you add new elements to the pipeline in the signal handler + // you will need to set them to the desired target state with + // gst_element_set_state() or gst_element_sync_state_with_parent(). + ConnectPadAdded(func(Element, Pad)) gobject.SignalHandle + // ConnectPadRemoved connects the provided callback to the "pad-removed" signal + // + // a #GstPad has been removed from the element + ConnectPadRemoved(func(Element, Pad)) gobject.SignalHandle } func unsafeWrapElement(base *gobject.ObjectInstance) *ElementInstance { @@ -30838,6 +30536,30 @@ func (src *ElementInstance) UnlinkPads(srcpadname string, dest Element, destpadn runtime.KeepAlive(destpadname) } +// ConnectNoMorePads connects the provided callback to the "no-more-pads" signal +// +// This signals that the element will not generate more dynamic pads. +// Note that this signal will usually be emitted from the context of +// the streaming thread. +func (o *ElementInstance) ConnectNoMorePads(fn func(Element)) gobject.SignalHandle { + return o.Connect("no-more-pads", fn) +} +// ConnectPadAdded connects the provided callback to the "pad-added" signal +// +// a new #GstPad has been added to the element. Note that this signal will +// usually be emitted from the context of the streaming thread. Also keep in +// mind that if you add new elements to the pipeline in the signal handler +// you will need to set them to the desired target state with +// gst_element_set_state() or gst_element_sync_state_with_parent(). +func (o *ElementInstance) ConnectPadAdded(fn func(Element, Pad)) gobject.SignalHandle { + return o.Connect("pad-added", fn) +} +// ConnectPadRemoved connects the provided callback to the "pad-removed" signal +// +// a #GstPad has been removed from the element +func (o *ElementInstance) ConnectPadRemoved(fn func(Element, Pad)) gobject.SignalHandle { + return o.Connect("pad-removed", fn) +} // ElementFactoryInstance is the instance type used by all types extending GstElementFactory. It is used internally by the bindings. Users should use the interface [ElementFactory] instead. type ElementFactoryInstance struct { _ [0]func() // equal guard @@ -32614,6 +32336,36 @@ type Bin interface { // Synchronizes the state of every child of @bin with the state // of @bin. See also gst_element_sync_state_with_parent(). SyncChildrenStates() bool + // ConnectDeepElementAdded connects the provided callback to the "deep-element-added" signal + // + // Will be emitted after the element was added to @sub_bin. + ConnectDeepElementAdded(func(Bin, Bin, Element)) gobject.SignalHandle + // ConnectDeepElementRemoved connects the provided callback to the "deep-element-removed" signal + // + // Will be emitted after the element was removed from @sub_bin. + ConnectDeepElementRemoved(func(Bin, Bin, Element)) gobject.SignalHandle + // ConnectDoLatency connects the provided callback to the "do-latency" signal + // + // Will be emitted when the bin needs to perform latency calculations. This + // signal is only emitted for toplevel bins or when #GstBin:async-handling is + // enabled. + // + // Only one signal handler is invoked. If no signals are connected, the + // default handler is invoked, which will query and distribute the lowest + // possible latency to all sinks. + // + // Connect to this signal if the default latency calculations are not + // sufficient, like when you need different latencies for different sinks in + // the same pipeline. + ConnectDoLatency(func(Bin) bool) gobject.SignalHandle + // ConnectElementAdded connects the provided callback to the "element-added" signal + // + // Will be emitted after the element was added to the bin. + ConnectElementAdded(func(Bin, Element)) gobject.SignalHandle + // ConnectElementRemoved connects the provided callback to the "element-removed" signal + // + // Will be emitted after the element was removed from the bin. + ConnectElementRemoved(func(Bin, Element)) gobject.SignalHandle } func unsafeWrapBin(base *gobject.ObjectInstance) *BinInstance { @@ -33185,6 +32937,46 @@ func (bin *BinInstance) SyncChildrenStates() bool { return goret } +// ConnectDeepElementAdded connects the provided callback to the "deep-element-added" signal +// +// Will be emitted after the element was added to @sub_bin. +func (o *BinInstance) ConnectDeepElementAdded(fn func(Bin, Bin, Element)) gobject.SignalHandle { + return o.Connect("deep-element-added", fn) +} +// ConnectDeepElementRemoved connects the provided callback to the "deep-element-removed" signal +// +// Will be emitted after the element was removed from @sub_bin. +func (o *BinInstance) ConnectDeepElementRemoved(fn func(Bin, Bin, Element)) gobject.SignalHandle { + return o.Connect("deep-element-removed", fn) +} +// ConnectDoLatency connects the provided callback to the "do-latency" signal +// +// Will be emitted when the bin needs to perform latency calculations. This +// signal is only emitted for toplevel bins or when #GstBin:async-handling is +// enabled. +// +// Only one signal handler is invoked. If no signals are connected, the +// default handler is invoked, which will query and distribute the lowest +// possible latency to all sinks. +// +// Connect to this signal if the default latency calculations are not +// sufficient, like when you need different latencies for different sinks in +// the same pipeline. +func (o *BinInstance) ConnectDoLatency(fn func(Bin) bool) gobject.SignalHandle { + return o.Connect("do-latency", fn) +} +// ConnectElementAdded connects the provided callback to the "element-added" signal +// +// Will be emitted after the element was added to the bin. +func (o *BinInstance) ConnectElementAdded(fn func(Bin, Element)) gobject.SignalHandle { + return o.Connect("element-added", fn) +} +// ConnectElementRemoved connects the provided callback to the "element-removed" signal +// +// Will be emitted after the element was removed from the bin. +func (o *BinInstance) ConnectElementRemoved(fn func(Bin, Element)) gobject.SignalHandle { + return o.Connect("element-removed", fn) +} // PipelineInstance is the instance type used by all types extending GstPipeline. It is used internally by the bindings. Users should use the interface [Pipeline] instead. type PipelineInstance struct { _ [0]func() // equal guard @@ -34084,71 +33876,6 @@ func (queue *AtomicQueue) Length() uint { return goret } -// Peek wraps gst_atomic_queue_peek -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Peek the head element of the queue without removing it from the queue. -func (queue *AtomicQueue) Peek() unsafe.Pointer { - var carg0 *C.GstAtomicQueue // in, none, converted - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstAtomicQueue)(UnsafeAtomicQueueToGlibNone(queue)) - - cret = C.gst_atomic_queue_peek(carg0) - runtime.KeepAlive(queue) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - -// Pop wraps gst_atomic_queue_pop -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Get the head element of the queue. -func (queue *AtomicQueue) Pop() unsafe.Pointer { - var carg0 *C.GstAtomicQueue // in, none, converted - var cret C.gpointer // return, full, casted - - carg0 = (*C.GstAtomicQueue)(UnsafeAtomicQueueToGlibNone(queue)) - - cret = C.gst_atomic_queue_pop(carg0) - runtime.KeepAlive(queue) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - -// Push wraps gst_atomic_queue_push -// -// The function takes the following parameters: -// -// - data unsafe.Pointer (nullable): the data -// -// Append @data to the tail of the queue. -func (queue *AtomicQueue) Push(data unsafe.Pointer) { - var carg0 *C.GstAtomicQueue // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - - carg0 = (*C.GstAtomicQueue)(UnsafeAtomicQueueToGlibNone(queue)) - if data != nil { - carg1 = C.gpointer(data) - } - - C.gst_atomic_queue_push(carg0, carg1) - runtime.KeepAlive(queue) - runtime.KeepAlive(data) -} - // BinClass wraps GstBinClass // // Subclasses can override #GstBinClass::add_element and #GstBinClass::remove_element @@ -34507,42 +34234,6 @@ func (buffer *Buffer) AddCustomMeta(name string) *CustomMeta { return goret } -// AddMeta wraps gst_buffer_add_meta -// -// The function takes the following parameters: -// -// - info *MetaInfo: a #GstMetaInfo -// - params unsafe.Pointer (nullable): params for @info -// -// The function returns the following values: -// -// - goret *Meta -// -// Adds metadata for @info to @buffer using the parameters in @params. -func (buffer *Buffer) AddMeta(info *MetaInfo, params unsafe.Pointer) *Meta { - var carg0 *C.GstBuffer // in, none, converted - var carg1 *C.GstMetaInfo // in, none, converted - var carg2 C.gpointer // in, none, casted, nullable - var cret *C.GstMeta // return, none, converted - - carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer)) - carg1 = (*C.GstMetaInfo)(UnsafeMetaInfoToGlibNone(info)) - if params != nil { - carg2 = C.gpointer(params) - } - - cret = C.gst_buffer_add_meta(carg0, carg1, carg2) - runtime.KeepAlive(buffer) - runtime.KeepAlive(info) - runtime.KeepAlive(params) - - var goret *Meta - - goret = UnsafeMetaFromGlibNone(unsafe.Pointer(cret)) - - return goret -} - // AddParentBufferMeta wraps gst_buffer_add_parent_buffer_meta // // The function takes the following parameters: @@ -48248,37 +47939,6 @@ func (object *MiniObject) AddParent(parent *MiniObject) { runtime.KeepAlive(parent) } -// GetQdata wraps gst_mini_object_get_qdata -// -// The function takes the following parameters: -// -// - quark glib.Quark: A #GQuark, naming the user data pointer -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// This function gets back user data pointers stored via -// gst_mini_object_set_qdata(). -func (object *MiniObject) GetQdata(quark glib.Quark) unsafe.Pointer { - var carg0 *C.GstMiniObject // in, none, converted - var carg1 C.GQuark // in, none, casted, alias - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object)) - carg1 = C.GQuark(quark) - - cret = C.gst_mini_object_get_qdata(carg0, carg1) - runtime.KeepAlive(object) - runtime.KeepAlive(quark) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // IsWritable wraps gst_mini_object_is_writable // The function returns the following values: // @@ -48364,38 +48024,6 @@ func (object *MiniObject) RemoveParent(parent *MiniObject) { runtime.KeepAlive(parent) } -// StealQdata wraps gst_mini_object_steal_qdata -// -// The function takes the following parameters: -// -// - quark glib.Quark: A #GQuark, naming the user data pointer -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// This function gets back user data pointers stored via gst_mini_object_set_qdata() -// and removes the data from @object without invoking its `destroy()` function (if -// any was set). -func (object *MiniObject) StealQdata(quark glib.Quark) unsafe.Pointer { - var carg0 *C.GstMiniObject // in, none, converted - var carg1 C.GQuark // in, none, casted, alias - var cret C.gpointer // return, full, casted - - carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object)) - carg1 = C.GQuark(quark) - - cret = C.gst_mini_object_steal_qdata(carg0, carg1) - runtime.KeepAlive(object) - runtime.KeepAlive(quark) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // Unlock wraps gst_mini_object_unlock // // The function takes the following parameters: @@ -56660,32 +56288,6 @@ func (structure *Structure) SetParentRefcount(refcount *int) bool { return goret } -// SetValue wraps gst_structure_set_value -// -// The function takes the following parameters: -// -// - fieldname string: the name of the field to set -// - value *gobject.Value: the new value of the field -// -// Sets the field with the given name @field to @value. If the field -// does not exist, it is created. If the field exists, the previous -// value is replaced and freed. -func (structure *Structure) SetValue(fieldname string, value *gobject.Value) { - var carg0 *C.GstStructure // in, none, converted - var carg1 *C.gchar // in, none, string, casted *C.gchar - var carg2 *C.GValue // in, none, converted - - carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure)) - carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname))) - defer C.free(unsafe.Pointer(carg1)) - carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value)) - - C.gst_structure_set_value(carg0, carg1, carg2) - runtime.KeepAlive(structure) - runtime.KeepAlive(fieldname) - runtime.KeepAlive(value) -} - // ToString wraps gst_structure_to_string // The function returns the following values: // @@ -57477,90 +57079,6 @@ func (list *TagList) GetIntIndex(tag string, index uint) (int, bool) { return value, goret } -// GetPointer wraps gst_tag_list_get_pointer -// -// The function takes the following parameters: -// -// - tag string: tag to read out -// -// The function returns the following values: -// -// - value unsafe.Pointer (nullable): location for the result -// - goret bool -// -// Copies the contents for the given tag into the value, merging multiple values -// into one if multiple values are associated with the tag. -func (list *TagList) GetPointer(tag string) (unsafe.Pointer, bool) { - var carg0 *C.GstTagList // in, none, converted - var carg1 *C.gchar // in, none, string, casted *C.gchar - var carg2 C.gpointer // out, none, casted, nullable - var cret C.gboolean // return - - carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list)) - carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag))) - defer C.free(unsafe.Pointer(carg1)) - - cret = C.gst_tag_list_get_pointer(carg0, carg1, &carg2) - runtime.KeepAlive(list) - runtime.KeepAlive(tag) - - var value unsafe.Pointer - var goret bool - - if carg2 != nil { - value = unsafe.Pointer(carg2) - } - if cret != 0 { - goret = true - } - - return value, goret -} - -// GetPointerIndex wraps gst_tag_list_get_pointer_index -// -// The function takes the following parameters: -// -// - tag string: tag to read out -// - index uint: number of entry to read out -// -// The function returns the following values: -// -// - value unsafe.Pointer (nullable): location for the result -// - goret bool -// -// Gets the value that is at the given index for the given tag in the given -// list. -func (list *TagList) GetPointerIndex(tag string, index uint) (unsafe.Pointer, bool) { - var carg0 *C.GstTagList // in, none, converted - var carg1 *C.gchar // in, none, string, casted *C.gchar - var carg2 C.guint // in, none, casted - var carg3 C.gpointer // out, none, casted, nullable - var cret C.gboolean // return - - carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list)) - carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag))) - defer C.free(unsafe.Pointer(carg1)) - carg2 = C.guint(index) - - cret = C.gst_tag_list_get_pointer_index(carg0, carg1, carg2, &carg3) - runtime.KeepAlive(list) - runtime.KeepAlive(tag) - runtime.KeepAlive(index) - - var value unsafe.Pointer - var goret bool - - if carg3 != nil { - value = unsafe.Pointer(carg3) - } - if cret != 0 { - goret = true - } - - return value, goret -} - // GetSample wraps gst_tag_list_get_sample // // The function takes the following parameters: diff --git a/pkg/gst/gst_export.gen.go b/pkg/gst/gst_export.gen.go index 8093797..583ee95 100644 --- a/pkg/gst/gst_export.gen.go +++ b/pkg/gst/gst_export.gen.go @@ -148,41 +148,6 @@ func _gotk4_gst1_CapsMapFunc(carg1 *C.GstCapsFeatures, carg2 *C.GstStructure, ca return cret } -//export _gotk4_gst1_CustomMetaTransformFunction -func _gotk4_gst1_CustomMetaTransformFunction(carg1 *C.GstBuffer, carg2 *C.GstCustomMeta, carg3 *C.GstBuffer, carg4 C.GQuark, carg5 C.gpointer, carg6 C.gpointer) (cret C.gboolean) { - var fn CustomMetaTransformFunction - { - v := userdata.Load(unsafe.Pointer(carg6)) - if v == nil { - panic(`callback not found`) - } - fn = v.(CustomMetaTransformFunction) - } - - var transbuf *Buffer // in, none, converted - var meta *CustomMeta // in, none, converted - var buffer *Buffer // in, none, converted - var typ glib.Quark // in, none, casted, alias - var data unsafe.Pointer // in, none, casted, nullable - var goret bool // return - - transbuf = UnsafeBufferFromGlibNone(unsafe.Pointer(carg1)) - meta = UnsafeCustomMetaFromGlibNone(unsafe.Pointer(carg2)) - buffer = UnsafeBufferFromGlibNone(unsafe.Pointer(carg3)) - typ = glib.Quark(carg4) - if carg5 != nil { - data = unsafe.Pointer(carg5) - } - - goret = fn(transbuf, meta, buffer, typ, data) - - if goret { - cret = C.TRUE - } - - return cret -} - //export _gotk4_gst1_IteratorFoldFunction func _gotk4_gst1_IteratorFoldFunction(carg1 *C.GValue, carg2 *C.GValue, carg3 C.gpointer) (cret C.gboolean) { var fn IteratorFoldFunction diff --git a/pkg/gst/structure.go b/pkg/gst/structure.go index 4d87551..f371da1 100644 --- a/pkg/gst/structure.go +++ b/pkg/gst/structure.go @@ -100,6 +100,33 @@ func (structure *Structure) GetValue(fieldname string) any { return goret } +// SetValue wraps gst_structure_set_value +// +// The function takes the following parameters: +// +// - fieldname string: the name of the field to set +// - value any: the new value of the field +// +// Sets the field with the given name @field to @value. If the field +// does not exist, it is created. If the field exists, the previous +// value is replaced and freed. +func (structure *Structure) SetValue(fieldname string, value any) { + var carg0 *C.GstStructure // in, none, converted + var carg1 *C.gchar // in, none, string, casted *C.gchar + var carg2 *C.GValue // in, none, converted + + carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure)) + carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname))) + defer C.free(unsafe.Pointer(carg1)) + v := gobject.NewValue(value) + carg2 = (*C.GValue)(gobject.UnsafeValueToGlibNone(v)) + + C.gst_structure_set_value(carg0, carg1, carg2) + runtime.KeepAlive(structure) + runtime.KeepAlive(fieldname) + runtime.KeepAlive(value) +} + // IDGetValue wraps gst_structure_id_get_value // // The function takes the following parameters: diff --git a/pkg/gst/structure_marshal.go b/pkg/gst/structure_marshal.go new file mode 100644 index 0000000..87164a7 --- /dev/null +++ b/pkg/gst/structure_marshal.go @@ -0,0 +1,52 @@ +package gst + +import ( + "errors" + "reflect" +) + +// MarshalStructure will convert the given go struct into a GstStructure. Currently nested +// structs are not supported. +func MarshalStructure(data interface{}) *Structure { + typeOf := reflect.TypeOf(data) + valsOf := reflect.ValueOf(data) + st := NewStructureEmpty(typeOf.Name()) + for i := 0; i < valsOf.NumField(); i++ { + gval := valsOf.Field(i).Interface() + + // TODO: if the value is a struct then recursively MarshalStructure + + fieldName := typeOf.Field(i).Name + st.SetValue(fieldName, gval) + } + return st +} + +// UnmarshalInto will unmarshal this structure into the given pointer. The object +// reflected by the pointer must be non-nil. +func (s *Structure) UnmarshalInto(data any) error { + rv := reflect.ValueOf(data) + if rv.Kind() != reflect.Ptr || rv.IsNil() { + return errors.New("data is invalid (nil or non-pointer)") + } + + val := reflect.ValueOf(data).Elem() + nVal := rv.Elem() + for i := 0; i < val.NumField(); i++ { + nvField := nVal.Field(i) + + fieldName, ok := val.Type().Field(i).Tag.Lookup("gst") + + if !ok { + fieldName = val.Type().Field(i).Name + } + + val := s.GetValue(fieldName) + + // TODO: if val is a structure do a recursive UnmarshalInto + + nvField.Set(reflect.ValueOf(val)) + } + + return nil +} diff --git a/pkg/gstallocators/gstallocators.gen.go b/pkg/gstallocators/gstallocators.gen.go index 4566c09..a09b5f5 100644 --- a/pkg/gstallocators/gstallocators.gen.go +++ b/pkg/gstallocators/gstallocators.gen.go @@ -310,31 +310,6 @@ func IsPhysMemory(mem *gst.Memory) bool { return goret } -// PhysMemoryGetPhysAddr wraps gst_phys_memory_get_phys_addr -// -// The function takes the following parameters: -// -// - mem *gst.Memory: a #GstMemory -// -// The function returns the following values: -// -// - goret uintptr -func PhysMemoryGetPhysAddr(mem *gst.Memory) uintptr { - var carg1 *C.GstMemory // in, none, converted - var cret C.guintptr // return, none, casted - - carg1 = (*C.GstMemory)(gst.UnsafeMemoryToGlibNone(mem)) - - cret = C.gst_phys_memory_get_phys_addr(carg1) - runtime.KeepAlive(mem) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - // PhysMemoryAllocatorInstance is the instance type used by all types implementing GstPhysMemoryAllocator. It is used internally by the bindings. Users should use the interface [PhysMemoryAllocator] instead. type PhysMemoryAllocatorInstance struct { _ [0]func() // equal guard @@ -343,7 +318,7 @@ type PhysMemoryAllocatorInstance struct { var _ PhysMemoryAllocator = (*PhysMemoryAllocatorInstance)(nil) -// PhysMemoryAllocatorInstance wraps GstPhysMemoryAllocator +// PhysMemoryAllocator wraps GstPhysMemoryAllocator type PhysMemoryAllocator interface { upcastToGstPhysMemoryAllocator() *PhysMemoryAllocatorInstance } diff --git a/pkg/gstapp/gstapp.gen.go b/pkg/gstapp/gstapp.gen.go index efe70ff..5ad4466 100644 --- a/pkg/gstapp/gstapp.gen.go +++ b/pkg/gstapp/gstapp.gen.go @@ -416,6 +416,169 @@ type AppSink interface { // this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS // condition. TryPullSample(gst.ClockTime) *gst.Sample + // ConnectEos connects the provided callback to the "eos" signal + // + // Signal that the end-of-stream has been reached. This signal is emitted from + // the streaming thread. + ConnectEos(func(AppSink)) gobject.SignalHandle + // ConnectNewPreroll connects the provided callback to the "new-preroll" signal + // + // Signal that a new preroll sample is available. + // + // This signal is emitted from the streaming thread and only when the + // "emit-signals" property is %TRUE. + // + // The new preroll sample can be retrieved with the "pull-preroll" action + // signal or gst_app_sink_pull_preroll() either from this signal callback + // or from any other thread. + // + // Note that this signal is only emitted when the "emit-signals" property is + // set to %TRUE, which it is not by default for performance reasons. + ConnectNewPreroll(func(AppSink) gst.FlowReturn) gobject.SignalHandle + // ConnectNewSample connects the provided callback to the "new-sample" signal + // + // Signal that a new sample is available. + // + // This signal is emitted from the streaming thread and only when the + // "emit-signals" property is %TRUE. + // + // The new sample can be retrieved with the "pull-sample" action + // signal or gst_app_sink_pull_sample() either from this signal callback + // or from any other thread. + // + // Note that this signal is only emitted when the "emit-signals" property is + // set to %TRUE, which it is not by default for performance reasons. + ConnectNewSample(func(AppSink) gst.FlowReturn) gobject.SignalHandle + // ConnectNewSerializedEvent connects the provided callback to the "new-serialized-event" signal + // + // Signal that a new downstream serialized event is available. + // + // This signal is emitted from the streaming thread and only when the + // "emit-signals" property is %TRUE. + // + // The new event can be retrieved with the "try-pull-object" action + // signal or gst_app_sink_pull_object() either from this signal callback + // or from any other thread. + // + // EOS will not be notified using this signal, use #GstAppSink::eos instead. + // EOS cannot be pulled either, use gst_app_sink_is_eos() to check for it. + // + // Note that this signal is only emitted when the "emit-signals" property is + // set to %TRUE, which it is not by default for performance reasons. + // + // The callback should return %TRUE if the event has been handled, which will + // skip basesink handling of the event, %FALSE otherwise. + ConnectNewSerializedEvent(func(AppSink) bool) gobject.SignalHandle + // ConnectProposeAllocation connects the provided callback to the "propose-allocation" signal + // + // Signal that a new propose_allocation query is available. + // + // This signal is emitted from the streaming thread and only when the + // "emit-signals" property is %TRUE. + ConnectProposeAllocation(func(AppSink, gst.Query) bool) gobject.SignalHandle + // EmitPullPreroll emits the "pull-preroll" signal + // + // Get the last preroll sample in @appsink. This was the sample that caused the + // appsink to preroll in the PAUSED state. + // + // This function is typically used when dealing with a pipeline in the PAUSED + // state. Calling this function after doing a seek will give the sample right + // after the seek position. + // + // Calling this function will clear the internal reference to the preroll + // buffer. + // + // Note that the preroll sample will also be returned as the first sample + // when calling gst_app_sink_pull_sample() or the "pull-sample" action signal. + // + // If an EOS event was received before any buffers, this function returns + // %NULL. Use gst_app_sink_is_eos () to check for the EOS condition. + // + // This function blocks until a preroll sample or EOS is received or the appsink + // element is set to the READY/NULL state. + EmitPullPreroll() gst.Sample + // EmitPullSample emits the "pull-sample" signal + // + // This function blocks until a sample or EOS becomes available or the appsink + // element is set to the READY/NULL state. + // + // This function will only return samples when the appsink is in the PLAYING + // state. All rendered samples will be put in a queue so that the application + // can pull samples at its own rate. + // + // Note that when the application does not pull samples fast enough, the + // queued samples could consume a lot of memory, especially when dealing with + // raw video frames. It's possible to control the behaviour of the queue with + // the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. + // + // If an EOS event was received before any buffers, this function returns + // %NULL. Use gst_app_sink_is_eos () to check for the EOS condition. + EmitPullSample() gst.Sample + // EmitTryPullObject emits the "try-pull-object" signal + // + // This function blocks until a sample or an event becomes available or the appsink + // element is set to the READY/NULL state or the timeout expires. + // + // This function will only return samples when the appsink is in the PLAYING + // state. All rendered samples and events will be put in a queue so that the application + // can pull them at its own rate. + // Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state. + // + // Note that when the application does not pull samples fast enough, the + // queued samples could consume a lot of memory, especially when dealing with + // raw video frames. It's possible to control the behaviour of the queue with + // the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. + // + // This function will only pull serialized events, excluding + // the EOS event for which this functions returns + // %NULL. Use gst_app_sink_is_eos() to check for the EOS condition. + // + // This signal is a variant of #GstAppSink::try-pull-sample: that can be used + // to handle incoming events as well as samples. + // + // Note that future releases may extend this API to return other object types + // so make sure that your code is checking for the actual type it is handling. + EmitTryPullObject(uint64) gst.MiniObject + // EmitTryPullPreroll emits the "try-pull-preroll" signal + // + // Get the last preroll sample in @appsink. This was the sample that caused the + // appsink to preroll in the PAUSED state. + // + // This function is typically used when dealing with a pipeline in the PAUSED + // state. Calling this function after doing a seek will give the sample right + // after the seek position. + // + // Calling this function will clear the internal reference to the preroll + // buffer. + // + // Note that the preroll sample will also be returned as the first sample + // when calling gst_app_sink_pull_sample() or the "pull-sample" action signal. + // + // If an EOS event was received before any buffers or the timeout expires, + // this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS + // condition. + // + // This function blocks until a preroll sample or EOS is received, the appsink + // element is set to the READY/NULL state, or the timeout expires. + EmitTryPullPreroll(uint64) gst.Sample + // EmitTryPullSample emits the "try-pull-sample" signal + // + // This function blocks until a sample or EOS becomes available or the appsink + // element is set to the READY/NULL state or the timeout expires. + // + // This function will only return samples when the appsink is in the PLAYING + // state. All rendered samples will be put in a queue so that the application + // can pull samples at its own rate. + // + // Note that when the application does not pull samples fast enough, the + // queued samples could consume a lot of memory, especially when dealing with + // raw video frames. It's possible to control the behaviour of the queue with + // the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. + // + // If an EOS event was received before any buffers or the timeout expires, + // this function returns %NULL. Use gst_app_sink_is_eos () to check + // for the EOS condition. + EmitTryPullSample(uint64) gst.Sample } func unsafeWrapAppSink(base *gobject.ObjectInstance) *AppSinkInstance { @@ -1017,6 +1180,194 @@ func (appsink *AppSinkInstance) TryPullSample(timeout gst.ClockTime) *gst.Sample return goret } +// ConnectEos connects the provided callback to the "eos" signal +// +// Signal that the end-of-stream has been reached. This signal is emitted from +// the streaming thread. +func (o *AppSinkInstance) ConnectEos(fn func(AppSink)) gobject.SignalHandle { + return o.Connect("eos", fn) +} +// ConnectNewPreroll connects the provided callback to the "new-preroll" signal +// +// Signal that a new preroll sample is available. +// +// This signal is emitted from the streaming thread and only when the +// "emit-signals" property is %TRUE. +// +// The new preroll sample can be retrieved with the "pull-preroll" action +// signal or gst_app_sink_pull_preroll() either from this signal callback +// or from any other thread. +// +// Note that this signal is only emitted when the "emit-signals" property is +// set to %TRUE, which it is not by default for performance reasons. +func (o *AppSinkInstance) ConnectNewPreroll(fn func(AppSink) gst.FlowReturn) gobject.SignalHandle { + return o.Connect("new-preroll", fn) +} +// ConnectNewSample connects the provided callback to the "new-sample" signal +// +// Signal that a new sample is available. +// +// This signal is emitted from the streaming thread and only when the +// "emit-signals" property is %TRUE. +// +// The new sample can be retrieved with the "pull-sample" action +// signal or gst_app_sink_pull_sample() either from this signal callback +// or from any other thread. +// +// Note that this signal is only emitted when the "emit-signals" property is +// set to %TRUE, which it is not by default for performance reasons. +func (o *AppSinkInstance) ConnectNewSample(fn func(AppSink) gst.FlowReturn) gobject.SignalHandle { + return o.Connect("new-sample", fn) +} +// ConnectNewSerializedEvent connects the provided callback to the "new-serialized-event" signal +// +// Signal that a new downstream serialized event is available. +// +// This signal is emitted from the streaming thread and only when the +// "emit-signals" property is %TRUE. +// +// The new event can be retrieved with the "try-pull-object" action +// signal or gst_app_sink_pull_object() either from this signal callback +// or from any other thread. +// +// EOS will not be notified using this signal, use #GstAppSink::eos instead. +// EOS cannot be pulled either, use gst_app_sink_is_eos() to check for it. +// +// Note that this signal is only emitted when the "emit-signals" property is +// set to %TRUE, which it is not by default for performance reasons. +// +// The callback should return %TRUE if the event has been handled, which will +// skip basesink handling of the event, %FALSE otherwise. +func (o *AppSinkInstance) ConnectNewSerializedEvent(fn func(AppSink) bool) gobject.SignalHandle { + return o.Connect("new-serialized-event", fn) +} +// ConnectProposeAllocation connects the provided callback to the "propose-allocation" signal +// +// Signal that a new propose_allocation query is available. +// +// This signal is emitted from the streaming thread and only when the +// "emit-signals" property is %TRUE. +func (o *AppSinkInstance) ConnectProposeAllocation(fn func(AppSink, gst.Query) bool) gobject.SignalHandle { + return o.Connect("propose-allocation", fn) +} +// EmitPullPreroll emits the "pull-preroll" signal +// +// Get the last preroll sample in @appsink. This was the sample that caused the +// appsink to preroll in the PAUSED state. +// +// This function is typically used when dealing with a pipeline in the PAUSED +// state. Calling this function after doing a seek will give the sample right +// after the seek position. +// +// Calling this function will clear the internal reference to the preroll +// buffer. +// +// Note that the preroll sample will also be returned as the first sample +// when calling gst_app_sink_pull_sample() or the "pull-sample" action signal. +// +// If an EOS event was received before any buffers, this function returns +// %NULL. Use gst_app_sink_is_eos () to check for the EOS condition. +// +// This function blocks until a preroll sample or EOS is received or the appsink +// element is set to the READY/NULL state. +func (o *AppSinkInstance) EmitPullPreroll() gst.Sample { + return + o.Emit("pull-preroll") +} +// EmitPullSample emits the "pull-sample" signal +// +// This function blocks until a sample or EOS becomes available or the appsink +// element is set to the READY/NULL state. +// +// This function will only return samples when the appsink is in the PLAYING +// state. All rendered samples will be put in a queue so that the application +// can pull samples at its own rate. +// +// Note that when the application does not pull samples fast enough, the +// queued samples could consume a lot of memory, especially when dealing with +// raw video frames. It's possible to control the behaviour of the queue with +// the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. +// +// If an EOS event was received before any buffers, this function returns +// %NULL. Use gst_app_sink_is_eos () to check for the EOS condition. +func (o *AppSinkInstance) EmitPullSample() gst.Sample { + return + o.Emit("pull-sample") +} +// EmitTryPullObject emits the "try-pull-object" signal +// +// This function blocks until a sample or an event becomes available or the appsink +// element is set to the READY/NULL state or the timeout expires. +// +// This function will only return samples when the appsink is in the PLAYING +// state. All rendered samples and events will be put in a queue so that the application +// can pull them at its own rate. +// Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state. +// +// Note that when the application does not pull samples fast enough, the +// queued samples could consume a lot of memory, especially when dealing with +// raw video frames. It's possible to control the behaviour of the queue with +// the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. +// +// This function will only pull serialized events, excluding +// the EOS event for which this functions returns +// %NULL. Use gst_app_sink_is_eos() to check for the EOS condition. +// +// This signal is a variant of #GstAppSink::try-pull-sample: that can be used +// to handle incoming events as well as samples. +// +// Note that future releases may extend this API to return other object types +// so make sure that your code is checking for the actual type it is handling. +func (o *AppSinkInstance) EmitTryPullObject(arg0 uint64) gst.MiniObject { + return + o.Emit("try-pull-object", arg0) +} +// EmitTryPullPreroll emits the "try-pull-preroll" signal +// +// Get the last preroll sample in @appsink. This was the sample that caused the +// appsink to preroll in the PAUSED state. +// +// This function is typically used when dealing with a pipeline in the PAUSED +// state. Calling this function after doing a seek will give the sample right +// after the seek position. +// +// Calling this function will clear the internal reference to the preroll +// buffer. +// +// Note that the preroll sample will also be returned as the first sample +// when calling gst_app_sink_pull_sample() or the "pull-sample" action signal. +// +// If an EOS event was received before any buffers or the timeout expires, +// this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS +// condition. +// +// This function blocks until a preroll sample or EOS is received, the appsink +// element is set to the READY/NULL state, or the timeout expires. +func (o *AppSinkInstance) EmitTryPullPreroll(arg0 uint64) gst.Sample { + return + o.Emit("try-pull-preroll", arg0) +} +// EmitTryPullSample emits the "try-pull-sample" signal +// +// This function blocks until a sample or EOS becomes available or the appsink +// element is set to the READY/NULL state or the timeout expires. +// +// This function will only return samples when the appsink is in the PLAYING +// state. All rendered samples will be put in a queue so that the application +// can pull samples at its own rate. +// +// Note that when the application does not pull samples fast enough, the +// queued samples could consume a lot of memory, especially when dealing with +// raw video frames. It's possible to control the behaviour of the queue with +// the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties. +// +// If an EOS event was received before any buffers or the timeout expires, +// this function returns %NULL. Use gst_app_sink_is_eos () to check +// for the EOS condition. +func (o *AppSinkInstance) EmitTryPullSample(arg0 uint64) gst.Sample { + return + o.Emit("try-pull-sample", arg0) +} // AppSrcInstance is the instance type used by all types extending GstAppSrc. It is used internally by the bindings. Users should use the interface [AppSrc] instead. type AppSrcInstance struct { _ [0]func() // equal guard @@ -1359,6 +1710,73 @@ type AppSrc interface { // // A stream_type stream SetStreamType(AppStreamType) + // EmitEndOfStream emits the "end-of-stream" signal + // + // Notify @appsrc that no more buffer are available. + EmitEndOfStream() gst.FlowReturn + // ConnectEnoughData connects the provided callback to the "enough-data" signal + // + // Signal that the source has enough data. It is recommended that the + // application stops calling push-buffer until the need-data signal is + // emitted again to avoid excessive buffer queueing. + ConnectEnoughData(func(AppSrc)) gobject.SignalHandle + // ConnectNeedData connects the provided callback to the "need-data" signal + // + // Signal that the source needs more data. In the callback or from another + // thread you should call push-buffer or end-of-stream. + // + // @length is just a hint and when it is set to -1, any number of bytes can be + // pushed into @appsrc. + // + // You can call push-buffer multiple times until the enough-data signal is + // fired. + ConnectNeedData(func(AppSrc, uint)) gobject.SignalHandle + // EmitPushBuffer emits the "push-buffer" signal + // + // Adds a buffer to the queue of buffers that the appsrc element will + // push to its source pad. + // + // This function does not take ownership of the buffer, but it takes a + // reference so the buffer can be unreffed at any time after calling this + // function. + // + // When the block property is TRUE, this function can block until free space + // becomes available in the queue. + EmitPushBuffer(gst.Buffer) gst.FlowReturn + // EmitPushBufferList emits the "push-buffer-list" signal + // + // Adds a buffer list to the queue of buffers and buffer lists that the + // appsrc element will push to its source pad. + // + // This function does not take ownership of the buffer list, but it takes a + // reference so the buffer list can be unreffed at any time after calling + // this function. + // + // When the block property is TRUE, this function can block until free space + // becomes available in the queue. + EmitPushBufferList(gst.BufferList) gst.FlowReturn + // EmitPushSample emits the "push-sample" signal + // + // Extract a buffer from the provided sample and adds the extracted buffer + // to the queue of buffers that the appsrc element will + // push to its source pad. This function set the appsrc caps based on the caps + // in the sample and reset the caps if they change. + // Only the caps and the buffer of the provided sample are used and not + // for example the segment in the sample. + // + // This function does not take ownership of the sample, but it takes a + // reference so the sample can be unreffed at any time after calling this + // function. + // + // When the block property is TRUE, this function can block until free space + // becomes available in the queue. + EmitPushSample(gst.Sample) gst.FlowReturn + // ConnectSeekData connects the provided callback to the "seek-data" signal + // + // Seek to the given offset. The next push-buffer should produce buffers from + // the new @offset. + // This callback is only called for seekable stream types. + ConnectSeekData(func(AppSrc, uint64) bool) gobject.SignalHandle } func unsafeWrapAppSrc(base *gobject.ObjectInstance) *AppSrcInstance { @@ -2052,6 +2470,91 @@ func (appsrc *AppSrcInstance) SetStreamType(typ AppStreamType) { runtime.KeepAlive(typ) } +// EmitEndOfStream emits the "end-of-stream" signal +// +// Notify @appsrc that no more buffer are available. +func (o *AppSrcInstance) EmitEndOfStream() gst.FlowReturn { + return + o.Emit("end-of-stream") +} +// ConnectEnoughData connects the provided callback to the "enough-data" signal +// +// Signal that the source has enough data. It is recommended that the +// application stops calling push-buffer until the need-data signal is +// emitted again to avoid excessive buffer queueing. +func (o *AppSrcInstance) ConnectEnoughData(fn func(AppSrc)) gobject.SignalHandle { + return o.Connect("enough-data", fn) +} +// ConnectNeedData connects the provided callback to the "need-data" signal +// +// Signal that the source needs more data. In the callback or from another +// thread you should call push-buffer or end-of-stream. +// +// @length is just a hint and when it is set to -1, any number of bytes can be +// pushed into @appsrc. +// +// You can call push-buffer multiple times until the enough-data signal is +// fired. +func (o *AppSrcInstance) ConnectNeedData(fn func(AppSrc, uint)) gobject.SignalHandle { + return o.Connect("need-data", fn) +} +// EmitPushBuffer emits the "push-buffer" signal +// +// Adds a buffer to the queue of buffers that the appsrc element will +// push to its source pad. +// +// This function does not take ownership of the buffer, but it takes a +// reference so the buffer can be unreffed at any time after calling this +// function. +// +// When the block property is TRUE, this function can block until free space +// becomes available in the queue. +func (o *AppSrcInstance) EmitPushBuffer(arg0 gst.Buffer) gst.FlowReturn { + return + o.Emit("push-buffer", arg0) +} +// EmitPushBufferList emits the "push-buffer-list" signal +// +// Adds a buffer list to the queue of buffers and buffer lists that the +// appsrc element will push to its source pad. +// +// This function does not take ownership of the buffer list, but it takes a +// reference so the buffer list can be unreffed at any time after calling +// this function. +// +// When the block property is TRUE, this function can block until free space +// becomes available in the queue. +func (o *AppSrcInstance) EmitPushBufferList(arg0 gst.BufferList) gst.FlowReturn { + return + o.Emit("push-buffer-list", arg0) +} +// EmitPushSample emits the "push-sample" signal +// +// Extract a buffer from the provided sample and adds the extracted buffer +// to the queue of buffers that the appsrc element will +// push to its source pad. This function set the appsrc caps based on the caps +// in the sample and reset the caps if they change. +// Only the caps and the buffer of the provided sample are used and not +// for example the segment in the sample. +// +// This function does not take ownership of the sample, but it takes a +// reference so the sample can be unreffed at any time after calling this +// function. +// +// When the block property is TRUE, this function can block until free space +// becomes available in the queue. +func (o *AppSrcInstance) EmitPushSample(arg0 gst.Sample) gst.FlowReturn { + return + o.Emit("push-sample", arg0) +} +// ConnectSeekData connects the provided callback to the "seek-data" signal +// +// Seek to the given offset. The next push-buffer should produce buffers from +// the new @offset. +// This callback is only called for seekable stream types. +func (o *AppSrcInstance) ConnectSeekData(fn func(AppSrc, uint64) bool) gobject.SignalHandle { + return o.Connect("seek-data", fn) +} // AppSinkClass wraps GstAppSinkClass type AppSinkClass struct { *appSinkClass diff --git a/pkg/gstaudio/gstaudio.gen.go b/pkg/gstaudio/gstaudio.gen.go index 7eee38e..6f74e3d 100644 --- a/pkg/gstaudio/gstaudio.gen.go +++ b/pkg/gstaudio/gstaudio.gen.go @@ -2655,7 +2655,7 @@ type StreamVolumeInstance struct { var _ StreamVolume = (*StreamVolumeInstance)(nil) -// StreamVolumeInstance wraps GstStreamVolume +// StreamVolume wraps GstStreamVolume // // This interface is implemented by elements that provide a stream volume. Examples for // such elements are #volume and #playbin. @@ -8651,48 +8651,6 @@ func (mix *AudioChannelMixer) IsPassthrough() bool { return goret } -// Samples wraps gst_audio_channel_mixer_samples -// -// The function takes the following parameters: -// -// - in *unsafe.Pointer (nullable): input samples -// - out *unsafe.Pointer (nullable): output samples -// - samples int: number of samples -// -// In case the samples are interleaved, @in and @out must point to an -// array with a single element pointing to a block of interleaved samples. -// -// If non-interleaved samples are used, @in and @out must point to an -// array with pointers to memory blocks, one for each channel. -// -// Perform channel mixing on @in_data and write the result to @out_data. -// @in_data and @out_data need to be in @format and @layout. -func (mix *AudioChannelMixer) Samples(in *unsafe.Pointer, out *unsafe.Pointer, samples int) { - var carg0 *C.GstAudioChannelMixer // in, none, converted - var carg1 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg2 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg3 C.gint // in, none, casted - - carg0 = (*C.GstAudioChannelMixer)(UnsafeAudioChannelMixerToGlibNone(mix)) - if in != nil { - _ = in - _ = carg1 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - if out != nil { - _ = out - _ = carg2 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg3 = C.gint(samples) - - C.gst_audio_channel_mixer_samples(carg0, carg1, carg2, carg3) - runtime.KeepAlive(mix) - runtime.KeepAlive(in) - runtime.KeepAlive(out) - runtime.KeepAlive(samples) -} - // AudioClippingMeta wraps GstAudioClippingMeta // // Extra buffer metadata describing how much audio has to be clipped from @@ -9104,77 +9062,6 @@ func (convert *AudioConverter) Reset() { runtime.KeepAlive(convert) } -// Samples wraps gst_audio_converter_samples -// -// The function takes the following parameters: -// -// - flags AudioConverterFlags: extra #GstAudioConverterFlags -// - in *unsafe.Pointer (nullable): input frames -// - inFrames uint: number of input frames -// - out *unsafe.Pointer (nullable): output frames -// - outFrames uint: number of output frames -// -// The function returns the following values: -// -// - goret bool -// -// Perform the conversion with @in_frames in @in to @out_frames in @out -// using @convert. -// -// In case the samples are interleaved, @in and @out must point to an -// array with a single element pointing to a block of interleaved samples. -// -// If non-interleaved samples are used, @in and @out must point to an -// array with pointers to memory blocks, one for each channel. -// -// @in may be %NULL, in which case @in_frames of silence samples are processed -// by the converter. -// -// This function always produces @out_frames of output and consumes @in_frames of -// input. Use gst_audio_converter_get_out_frames() and -// gst_audio_converter_get_in_frames() to make sure @in_frames and @out_frames -// are matching and @in and @out point to enough memory. -func (convert *AudioConverter) Samples(flags AudioConverterFlags, in *unsafe.Pointer, inFrames uint, out *unsafe.Pointer, outFrames uint) bool { - var carg0 *C.GstAudioConverter // in, none, converted - var carg1 C.GstAudioConverterFlags // in, none, casted - var carg2 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg3 C.gsize // in, none, casted - var carg4 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg5 C.gsize // in, none, casted - var cret C.gboolean // return - - carg0 = (*C.GstAudioConverter)(UnsafeAudioConverterToGlibNone(convert)) - carg1 = C.GstAudioConverterFlags(flags) - if in != nil { - _ = in - _ = carg2 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg3 = C.gsize(inFrames) - if out != nil { - _ = out - _ = carg4 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg5 = C.gsize(outFrames) - - cret = C.gst_audio_converter_samples(carg0, carg1, carg2, carg3, carg4, carg5) - runtime.KeepAlive(convert) - runtime.KeepAlive(flags) - runtime.KeepAlive(in) - runtime.KeepAlive(inFrames) - runtime.KeepAlive(out) - runtime.KeepAlive(outFrames) - - var goret bool - - if cret != 0 { - goret = true - } - - return goret -} - // SupportsInplace wraps gst_audio_converter_supports_inplace // The function returns the following values: // @@ -10091,50 +9978,6 @@ func (quant *AudioQuantize) Reset() { runtime.KeepAlive(quant) } -// Samples wraps gst_audio_quantize_samples -// -// The function takes the following parameters: -// -// - in *unsafe.Pointer (nullable): input samples -// - out *unsafe.Pointer (nullable): output samples -// - samples uint: number of samples -// -// Perform quantization on @samples in @in and write the result to @out. -// -// In case the samples are interleaved, @in and @out must point to an -// array with a single element pointing to a block of interleaved samples. -// -// If non-interleaved samples are used, @in and @out must point to an -// array with pointers to memory blocks, one for each channel. -// -// @in and @out may point to the same memory location, in which case samples will be -// modified in-place. -func (quant *AudioQuantize) Samples(in *unsafe.Pointer, out *unsafe.Pointer, samples uint) { - var carg0 *C.GstAudioQuantize // in, none, converted - var carg1 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg2 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg3 C.guint // in, none, casted - - carg0 = (*C.GstAudioQuantize)(UnsafeAudioQuantizeToGlibNone(quant)) - if in != nil { - _ = in - _ = carg1 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - if out != nil { - _ = out - _ = carg2 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg3 = C.guint(samples) - - C.gst_audio_quantize_samples(carg0, carg1, carg2, carg3) - runtime.KeepAlive(quant) - runtime.KeepAlive(in) - runtime.KeepAlive(out) - runtime.KeepAlive(samples) -} - // AudioResampler wraps GstAudioResampler // // #GstAudioResampler is a structure which holds the information @@ -10283,59 +10126,6 @@ func (resampler *AudioResampler) GetOutFrames(inFrames uint) uint { return goret } -// Resample wraps gst_audio_resampler_resample -// -// The function takes the following parameters: -// -// - in *unsafe.Pointer (nullable): input samples -// - inFrames uint: number of input frames -// - out *unsafe.Pointer (nullable): output samples -// - outFrames uint: number of output frames -// -// Perform resampling on @in_frames frames in @in and write @out_frames to @out. -// -// In case the samples are interleaved, @in and @out must point to an -// array with a single element pointing to a block of interleaved samples. -// -// If non-interleaved samples are used, @in and @out must point to an -// array with pointers to memory blocks, one for each channel. -// -// @in may be %NULL, in which case @in_frames of silence samples are pushed -// into the resampler. -// -// This function always produces @out_frames of output and consumes @in_frames of -// input. Use gst_audio_resampler_get_out_frames() and -// gst_audio_resampler_get_in_frames() to make sure @in_frames and @out_frames -// are matching and @in and @out point to enough memory. -func (resampler *AudioResampler) Resample(in *unsafe.Pointer, inFrames uint, out *unsafe.Pointer, outFrames uint) { - var carg0 *C.GstAudioResampler // in, none, converted - var carg1 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg2 C.gsize // in, none, casted - var carg3 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg4 C.gsize // in, none, casted - - carg0 = (*C.GstAudioResampler)(UnsafeAudioResamplerToGlibNone(resampler)) - if in != nil { - _ = in - _ = carg1 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg2 = C.gsize(inFrames) - if out != nil { - _ = out - _ = carg3 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - carg4 = C.gsize(outFrames) - - C.gst_audio_resampler_resample(carg0, carg1, carg2, carg3, carg4) - runtime.KeepAlive(resampler) - runtime.KeepAlive(in) - runtime.KeepAlive(inFrames) - runtime.KeepAlive(out) - runtime.KeepAlive(outFrames) -} - // Reset wraps gst_audio_resampler_reset // // Reset @resampler to the state it was when it was first created, discarding diff --git a/pkg/gstbase/gstbase.gen.go b/pkg/gstbase/gstbase.gen.go index 3a92cb0..99743d4 100644 --- a/pkg/gstbase/gstbase.gen.go +++ b/pkg/gstbase/gstbase.gen.go @@ -2321,6 +2321,12 @@ type Aggregator interface { // Subclasses MUST call this before gst_aggregator_selected_samples(), // if it is used at all. UpdateSegment(*gst.Segment) + // ConnectSamplesSelected connects the provided callback to the "samples-selected" signal + // + // Signals that the #GstAggregator subclass has selected the next set + // of input samples it will aggregate. Handlers may call + // gst_aggregator_peek_next_sample() at that point. + ConnectSamplesSelected(func(Aggregator, gst.Segment, uint64, uint64, uint64, gst.Structure)) gobject.SignalHandle } func unsafeWrapAggregator(base *gobject.ObjectInstance) *AggregatorInstance { @@ -2800,6 +2806,14 @@ func (self *AggregatorInstance) UpdateSegment(segment *gst.Segment) { runtime.KeepAlive(segment) } +// ConnectSamplesSelected connects the provided callback to the "samples-selected" signal +// +// Signals that the #GstAggregator subclass has selected the next set +// of input samples it will aggregate. Handlers may call +// gst_aggregator_peek_next_sample() at that point. +func (o *AggregatorInstance) ConnectSamplesSelected(fn func(Aggregator, gst.Segment, uint64, uint64, uint64, gst.Structure)) gobject.SignalHandle { + return o.Connect("samples-selected", fn) +} // AggregatorPadInstance is the instance type used by all types extending GstAggregatorPad. It is used internally by the bindings. Users should use the interface [AggregatorPad] instead. type AggregatorPadInstance struct { _ [0]func() // equal guard @@ -2857,6 +2871,8 @@ type AggregatorPad interface { // // Steal the ref to the buffer currently queued in @pad. PopBuffer() *gst.Buffer + // ConnectBufferConsumed connects the provided callback to the "buffer-consumed" signal + ConnectBufferConsumed(func(AggregatorPad, gst.Buffer)) gobject.SignalHandle } func unsafeWrapAggregatorPad(base *gobject.ObjectInstance) *AggregatorPadInstance { @@ -3037,6 +3053,10 @@ func (pad *AggregatorPadInstance) PopBuffer() *gst.Buffer { return goret } +// ConnectBufferConsumed connects the provided callback to the "buffer-consumed" signal +func (o *AggregatorPadInstance) ConnectBufferConsumed(fn func(AggregatorPad, gst.Buffer)) gobject.SignalHandle { + return o.Connect("buffer-consumed", fn) +} // BaseParseInstance is the instance type used by all types extending GstBaseParse. It is used internally by the bindings. Users should use the interface [BaseParse] instead. type BaseParseInstance struct { _ [0]func() // equal guard @@ -7270,26 +7290,6 @@ type CollectPads interface { // // MT safe. Available() uint - // ClipRunningTime wraps gst_collect_pads_clip_running_time - // - // The function takes the following parameters: - // - // - cdata *CollectData: collect data of corresponding pad - // - buf *gst.Buffer: buffer being clipped - // - userData unsafe.Pointer (nullable): user data (unused) - // - // The function returns the following values: - // - // - outbuf *gst.Buffer: output buffer with running time, or NULL if clipped - // - goret gst.FlowReturn - // - // Convenience clipping function that converts incoming buffer's timestamp - // to running time, or clips the buffer if outside configured segment. - // - // Since 1.6, this clipping function also sets the DTS parameter of the - // GstCollectData structure. This version of the running time DTS can be - // negative. G_MININT64 is used to indicate invalid value. - ClipRunningTime(*CollectData, *gst.Buffer, unsafe.Pointer) (*gst.Buffer, gst.FlowReturn) // EventDefault wraps gst_collect_pads_event_default // // The function takes the following parameters: @@ -7665,55 +7665,6 @@ func (pads *CollectPadsInstance) Available() uint { return goret } -// ClipRunningTime wraps gst_collect_pads_clip_running_time -// -// The function takes the following parameters: -// -// - cdata *CollectData: collect data of corresponding pad -// - buf *gst.Buffer: buffer being clipped -// - userData unsafe.Pointer (nullable): user data (unused) -// -// The function returns the following values: -// -// - outbuf *gst.Buffer: output buffer with running time, or NULL if clipped -// - goret gst.FlowReturn -// -// Convenience clipping function that converts incoming buffer's timestamp -// to running time, or clips the buffer if outside configured segment. -// -// Since 1.6, this clipping function also sets the DTS parameter of the -// GstCollectData structure. This version of the running time DTS can be -// negative. G_MININT64 is used to indicate invalid value. -func (pads *CollectPadsInstance) ClipRunningTime(cdata *CollectData, buf *gst.Buffer, userData unsafe.Pointer) (*gst.Buffer, gst.FlowReturn) { - var carg0 *C.GstCollectPads // in, none, converted - var carg1 *C.GstCollectData // in, none, converted - var carg2 *C.GstBuffer // in, none, converted - var carg4 C.gpointer // in, none, casted, nullable - var carg3 *C.GstBuffer // out, full, converted - var cret C.GstFlowReturn // return, none, casted - - carg0 = (*C.GstCollectPads)(UnsafeCollectPadsToGlibNone(pads)) - carg1 = (*C.GstCollectData)(UnsafeCollectDataToGlibNone(cdata)) - carg2 = (*C.GstBuffer)(gst.UnsafeBufferToGlibNone(buf)) - if userData != nil { - carg4 = C.gpointer(userData) - } - - cret = C.gst_collect_pads_clip_running_time(carg0, carg1, carg2, &carg3, carg4) - runtime.KeepAlive(pads) - runtime.KeepAlive(cdata) - runtime.KeepAlive(buf) - runtime.KeepAlive(userData) - - var outbuf *gst.Buffer - var goret gst.FlowReturn - - outbuf = gst.UnsafeBufferFromGlibFull(unsafe.Pointer(carg3)) - goret = gst.FlowReturn(cret) - - return outbuf, goret -} - // EventDefault wraps gst_collect_pads_event_default // // The function takes the following parameters: @@ -8357,6 +8308,21 @@ var _ DataQueue = (*DataQueueInstance)(nil) type DataQueue interface { gobject.Object upcastToGstDataQueue() *DataQueueInstance + + // ConnectEmpty connects the provided callback to the "empty" signal + // + // Reports that the queue became empty (empty). + // A queue is empty if the total amount of visible items inside it (num-visible, time, + // size) is lower than the boundary values which can be set through the GObject + // properties. + ConnectEmpty(func(DataQueue)) gobject.SignalHandle + // ConnectFull connects the provided callback to the "full" signal + // + // Reports that the queue became full (full). + // A queue is full if the total amount of data inside it (num-visible, time, + // size) is higher than the boundary values which can be set through the GObject + // properties. + ConnectFull(func(DataQueue)) gobject.SignalHandle } func unsafeWrapDataQueue(base *gobject.ObjectInstance) *DataQueueInstance { @@ -8393,6 +8359,24 @@ func UnsafeDataQueueToGlibFull(c DataQueue) unsafe.Pointer { return gobject.UnsafeObjectToGlibFull(c) } +// ConnectEmpty connects the provided callback to the "empty" signal +// +// Reports that the queue became empty (empty). +// A queue is empty if the total amount of visible items inside it (num-visible, time, +// size) is lower than the boundary values which can be set through the GObject +// properties. +func (o *DataQueueInstance) ConnectEmpty(fn func(DataQueue)) gobject.SignalHandle { + return o.Connect("empty", fn) +} +// ConnectFull connects the provided callback to the "full" signal +// +// Reports that the queue became full (full). +// A queue is full if the total amount of data inside it (num-visible, time, +// size) is higher than the boundary values which can be set through the GObject +// properties. +func (o *DataQueueInstance) ConnectFull(fn func(DataQueue)) gobject.SignalHandle { + return o.Connect("full", fn) +} // PushSrcInstance is the instance type used by all types extending GstPushSrc. It is used internally by the bindings. Users should use the interface [PushSrc] instead. type PushSrcInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstcheck/gstcheck.gen.go b/pkg/gstcheck/gstcheck.gen.go index 5411715..a361ee4 100644 --- a/pkg/gstcheck/gstcheck.gen.go +++ b/pkg/gstcheck/gstcheck.gen.go @@ -340,25 +340,6 @@ func CheckMessageError(message *gst.Message, typ gst.MessageType, domain glib.Qu runtime.KeepAlive(code) } -// CheckObjectDestroyedOnUnref wraps gst_check_object_destroyed_on_unref -// -// The function takes the following parameters: -// -// - objectToUnref unsafe.Pointer (nullable): The #GObject to unref -// -// Unrefs @object_to_unref and checks that is has properly been -// destroyed. -func CheckObjectDestroyedOnUnref(objectToUnref unsafe.Pointer) { - var carg1 C.gpointer // in, none, casted, nullable - - if objectToUnref != nil { - carg1 = C.gpointer(objectToUnref) - } - - C.gst_check_object_destroyed_on_unref(carg1) - runtime.KeepAlive(objectToUnref) -} - // CheckRemoveLogFilter wraps gst_check_remove_log_filter // // The function takes the following parameters: diff --git a/pkg/gstcontroller/gstcontroller.gen.go b/pkg/gstcontroller/gstcontroller.gen.go index 44f0b91..152e145 100644 --- a/pkg/gstcontroller/gstcontroller.gen.go +++ b/pkg/gstcontroller/gstcontroller.gen.go @@ -658,6 +658,18 @@ type TimedValueControlSource interface { // // Used to remove all time-stamped values of given controller-handled property UnsetAll() + // ConnectValueAdded connects the provided callback to the "value-added" signal + // + // Emitted right after the new value has been added to @self + ConnectValueAdded(func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle + // ConnectValueChanged connects the provided callback to the "value-changed" signal + // + // Emitted right after the new value has been set on @timed_signals + ConnectValueChanged(func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle + // ConnectValueRemoved connects the provided callback to the "value-removed" signal + // + // Emitted when @timed_value is removed from @self + ConnectValueRemoved(func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle } func unsafeWrapTimedValueControlSource(base *gobject.ObjectInstance) *TimedValueControlSourceInstance { @@ -837,6 +849,24 @@ func (self *TimedValueControlSourceInstance) UnsetAll() { runtime.KeepAlive(self) } +// ConnectValueAdded connects the provided callback to the "value-added" signal +// +// Emitted right after the new value has been added to @self +func (o *TimedValueControlSourceInstance) ConnectValueAdded(fn func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle { + return o.Connect("value-added", fn) +} +// ConnectValueChanged connects the provided callback to the "value-changed" signal +// +// Emitted right after the new value has been set on @timed_signals +func (o *TimedValueControlSourceInstance) ConnectValueChanged(fn func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle { + return o.Connect("value-changed", fn) +} +// ConnectValueRemoved connects the provided callback to the "value-removed" signal +// +// Emitted when @timed_value is removed from @self +func (o *TimedValueControlSourceInstance) ConnectValueRemoved(fn func(TimedValueControlSource, ControlPoint)) gobject.SignalHandle { + return o.Connect("value-removed", fn) +} // TriggerControlSourceInstance is the instance type used by all types extending GstTriggerControlSource. It is used internally by the bindings. Users should use the interface [TriggerControlSource] instead. type TriggerControlSourceInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstgl/gstgl.gen.go b/pkg/gstgl/gstgl.gen.go index 86018dc..ad9ec2b 100644 --- a/pkg/gstgl/gstgl.gen.go +++ b/pkg/gstgl/gstgl.gen.go @@ -1279,41 +1279,6 @@ func BufferAddGLSyncMeta(_context GLContext, buffer *gst.Buffer) *GLSyncMeta { return goret } -// BufferAddGLSyncMetaFull wraps gst_buffer_add_gl_sync_meta_full -// -// The function takes the following parameters: -// -// - _context GLContext: a #GstGLContext -// - buffer *gst.Buffer: a #GstBuffer -// - data unsafe.Pointer (nullable): sync data to hold -// -// The function returns the following values: -// -// - goret *GLSyncMeta -func BufferAddGLSyncMetaFull(_context GLContext, buffer *gst.Buffer, data unsafe.Pointer) *GLSyncMeta { - var carg1 *C.GstGLContext // in, none, converted - var carg2 *C.GstBuffer // in, none, converted - var carg3 C.gpointer // in, none, casted, nullable - var cret *C.GstGLSyncMeta // return, none, converted - - carg1 = (*C.GstGLContext)(UnsafeGLContextToGlibNone(_context)) - carg2 = (*C.GstBuffer)(gst.UnsafeBufferToGlibNone(buffer)) - if data != nil { - carg3 = C.gpointer(data) - } - - cret = C.gst_buffer_add_gl_sync_meta_full(carg1, carg2, carg3) - runtime.KeepAlive(_context) - runtime.KeepAlive(buffer) - runtime.KeepAlive(data) - - var goret *GLSyncMeta - - goret = UnsafeGLSyncMetaFromGlibNone(unsafe.Pointer(cret)) - - return goret -} - // BufferPoolConfigGetGLAllocationParams wraps gst_buffer_pool_config_get_gl_allocation_params // // The function takes the following parameters: @@ -3182,13 +3147,6 @@ type GLContext interface { // The currently available API may be limited by the #GstGLDisplay in use and/or // the #GstGLWindow chosen. GetGLApi() GLAPI - // GetGLContext wraps gst_gl_context_get_gl_context - // The function returns the following values: - // - // - goret uintptr - // - // Gets the backing OpenGL context used by @context. - GetGLContext() uintptr // GetGLPlatform wraps gst_gl_context_get_gl_platform // The function returns the following values: // @@ -3215,36 +3173,6 @@ type GLContext interface { // gst_gl_context_get_gl_api() for retrieving the OpenGL api implemented by // @context. GetGLVersion() (int, int) - // GetProcAddress wraps gst_gl_context_get_proc_address - // - // The function takes the following parameters: - // - // - name string: an opengl function name - // - // The function returns the following values: - // - // - goret unsafe.Pointer - // - // Get a function pointer to a specified opengl function, @name. If the the - // specific function does not exist, NULL is returned instead. - // - // Platform specific functions (names starting 'egl', 'glX', 'wgl', etc) can also - // be retrieved using this method. - // - // Note: This function may return valid function pointers that may not be valid - // to call in @context. The caller is responsible for ensuring that the - // returned function is a valid function to call in @context by either checking - // the OpenGL API and version or for an appropriate OpenGL extension. - // - // Note: On success, you need to cast the returned function pointer to the - // correct type to be able to call it correctly. On 32-bit Windows, this will - // include the `GSTGLAPI` identifier to use the correct calling convention. - // e.g. - // - // |[<!-- language="C" --> - // void (GSTGLAPI *PFN_glGetIntegerv) (GLenum name, GLint * ret) - // ]| - GetProcAddress(string) unsafe.Pointer // GetWindow wraps gst_gl_context_get_window // The function returns the following values: // @@ -3406,88 +3334,6 @@ func NewGLContext(display GLDisplay) GLContext { return goret } -// NewGLContextWrapped wraps gst_gl_context_new_wrapped -// -// The function takes the following parameters: -// -// - display GLDisplay: a #GstGLDisplay -// - handle uintptr: the OpenGL context to wrap -// - contextType GLPlatform: a #GstGLPlatform specifying the type of context in @handle -// - availableApis GLAPI: a #GstGLAPI containing the available OpenGL apis in @handle -// -// The function returns the following values: -// -// - goret GLContext -// -// Wraps an existing OpenGL context into a #GstGLContext. -// -// Note: The caller is responsible for ensuring that the OpenGL context -// represented by @handle stays alive while the returned #GstGLContext is -// active. -// -// @context_type must not be %GST_GL_PLATFORM_NONE or %GST_GL_PLATFORM_ANY -// -// @available_apis must not be %GST_GL_API_NONE or %GST_GL_API_ANY -func NewGLContextWrapped(display GLDisplay, handle uintptr, contextType GLPlatform, availableApis GLAPI) GLContext { - var carg1 *C.GstGLDisplay // in, none, converted - var carg2 C.guintptr // in, none, casted - var carg3 C.GstGLPlatform // in, none, casted - var carg4 C.GstGLAPI // in, none, casted - var cret *C.GstGLContext // return, full, converted - - carg1 = (*C.GstGLDisplay)(UnsafeGLDisplayToGlibNone(display)) - carg2 = C.guintptr(handle) - carg3 = C.GstGLPlatform(contextType) - carg4 = C.GstGLAPI(availableApis) - - cret = C.gst_gl_context_new_wrapped(carg1, carg2, carg3, carg4) - runtime.KeepAlive(display) - runtime.KeepAlive(handle) - runtime.KeepAlive(contextType) - runtime.KeepAlive(availableApis) - - var goret GLContext - - goret = UnsafeGLContextFromGlibFull(unsafe.Pointer(cret)) - - return goret -} - -// GLContextDefaultGetProcAddress wraps gst_gl_context_default_get_proc_address -// -// The function takes the following parameters: -// -// - glApi GLAPI: a #GstGLAPI -// - name string: then function to get the address of -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// A default implementation of the various GetProcAddress functions that looks -// for @name in the OpenGL shared libraries or in the current process. -// -// See also: gst_gl_context_get_proc_address() -func GLContextDefaultGetProcAddress(glApi GLAPI, name string) unsafe.Pointer { - var carg1 C.GstGLAPI // in, none, casted - var carg2 *C.gchar // in, none, string, casted *C.gchar - var cret C.gpointer // return, none, casted - - carg1 = C.GstGLAPI(glApi) - carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name))) - defer C.free(unsafe.Pointer(carg2)) - - cret = C.gst_gl_context_default_get_proc_address(carg1, carg2) - runtime.KeepAlive(glApi) - runtime.KeepAlive(name) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // GLContextGetCurrent wraps gst_gl_context_get_current // The function returns the following values: // @@ -3542,70 +3388,6 @@ func GLContextGetCurrentGLApi(platform GLPlatform) (uint, uint, GLAPI) { return major, minor, goret } -// GLContextGetCurrentGLContext wraps gst_gl_context_get_current_gl_context -// -// The function takes the following parameters: -// -// - contextType GLPlatform: a #GstGLPlatform specifying the type of context to retrieve -// -// The function returns the following values: -// -// - goret uintptr -func GLContextGetCurrentGLContext(contextType GLPlatform) uintptr { - var carg1 C.GstGLPlatform // in, none, casted - var cret C.guintptr // return, none, casted - - carg1 = C.GstGLPlatform(contextType) - - cret = C.gst_gl_context_get_current_gl_context(carg1) - runtime.KeepAlive(contextType) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - -// GLContextGetProcAddressWithPlatform wraps gst_gl_context_get_proc_address_with_platform -// -// The function takes the following parameters: -// -// - contextType GLPlatform: a #GstGLPlatform -// - glApi GLAPI: a #GstGLAPI -// - name string: the name of the function to retrieve -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Attempts to use the @context_type specific GetProcAddress implementations -// to retrieve @name. -// -// See also gst_gl_context_get_proc_address(). -func GLContextGetProcAddressWithPlatform(contextType GLPlatform, glApi GLAPI, name string) unsafe.Pointer { - var carg1 C.GstGLPlatform // in, none, casted - var carg2 C.GstGLAPI // in, none, casted - var carg3 *C.gchar // in, none, string, casted *C.gchar - var cret C.gpointer // return, none, casted - - carg1 = C.GstGLPlatform(contextType) - carg2 = C.GstGLAPI(glApi) - carg3 = (*C.gchar)(unsafe.Pointer(C.CString(name))) - defer C.free(unsafe.Pointer(carg3)) - - cret = C.gst_gl_context_get_proc_address_with_platform(carg1, carg2, carg3) - runtime.KeepAlive(contextType) - runtime.KeepAlive(glApi) - runtime.KeepAlive(name) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // Activate wraps gst_gl_context_activate // // The function takes the following parameters: @@ -3985,28 +3767,6 @@ func (_context *GLContextInstance) GetGLApi() GLAPI { return goret } -// GetGLContext wraps gst_gl_context_get_gl_context -// The function returns the following values: -// -// - goret uintptr -// -// Gets the backing OpenGL context used by @context. -func (_context *GLContextInstance) GetGLContext() uintptr { - var carg0 *C.GstGLContext // in, none, converted - var cret C.guintptr // return, none, casted - - carg0 = (*C.GstGLContext)(UnsafeGLContextToGlibNone(_context)) - - cret = C.gst_gl_context_get_gl_context(carg0) - runtime.KeepAlive(_context) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - // GetGLPlatform wraps gst_gl_context_get_gl_platform // The function returns the following values: // @@ -4084,55 +3844,6 @@ func (_context *GLContextInstance) GetGLVersion() (int, int) { return maj, min } -// GetProcAddress wraps gst_gl_context_get_proc_address -// -// The function takes the following parameters: -// -// - name string: an opengl function name -// -// The function returns the following values: -// -// - goret unsafe.Pointer -// -// Get a function pointer to a specified opengl function, @name. If the the -// specific function does not exist, NULL is returned instead. -// -// Platform specific functions (names starting 'egl', 'glX', 'wgl', etc) can also -// be retrieved using this method. -// -// Note: This function may return valid function pointers that may not be valid -// to call in @context. The caller is responsible for ensuring that the -// returned function is a valid function to call in @context by either checking -// the OpenGL API and version or for an appropriate OpenGL extension. -// -// Note: On success, you need to cast the returned function pointer to the -// correct type to be able to call it correctly. On 32-bit Windows, this will -// include the `GSTGLAPI` identifier to use the correct calling convention. -// e.g. -// -// |[<!-- language="C" --> -// void (GSTGLAPI *PFN_glGetIntegerv) (GLenum name, GLint * ret) -// ]| -func (_context *GLContextInstance) GetProcAddress(name string) unsafe.Pointer { - var carg0 *C.GstGLContext // in, none, converted - var carg1 *C.gchar // in, none, string, casted *C.gchar - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstGLContext)(UnsafeGLContextToGlibNone(_context)) - carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name))) - defer C.free(unsafe.Pointer(carg1)) - - cret = C.gst_gl_context_get_proc_address(carg0, carg1) - runtime.KeepAlive(_context) - runtime.KeepAlive(name) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // GetWindow wraps gst_gl_context_get_window // The function returns the following values: // @@ -4475,11 +4186,6 @@ type GLDisplay interface { // // - goret GLAPI GetGLApiUnlocked() GLAPI - // GetHandle wraps gst_gl_display_get_handle - // The function returns the following values: - // - // - goret uintptr - GetHandle() uintptr // GetHandleType wraps gst_gl_display_get_handle_type // The function returns the following values: // @@ -4503,6 +4209,12 @@ type GLDisplay interface { // // - goret bool RemoveWindow(GLWindow) bool + // ConnectCreateContext connects the provided callback to the "create-context" signal + // + // Overrides the @GstGLContext creation mechanism. + // It can be called in any thread and it is emitted with + // display's object lock held. + ConnectCreateContext(func(GLDisplay, GLContext) GLContextInstance) gobject.SignalHandle } func unsafeWrapGLDisplay(base *gobject.ObjectInstance) *GLDisplayInstance { @@ -4747,26 +4459,6 @@ func (display *GLDisplayInstance) GetGLApiUnlocked() GLAPI { return goret } -// GetHandle wraps gst_gl_display_get_handle -// The function returns the following values: -// -// - goret uintptr -func (display *GLDisplayInstance) GetHandle() uintptr { - var carg0 *C.GstGLDisplay // in, none, converted - var cret C.guintptr // return, none, casted - - carg0 = (*C.GstGLDisplay)(UnsafeGLDisplayToGlibNone(display)) - - cret = C.gst_gl_display_get_handle(carg0) - runtime.KeepAlive(display) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - // GetHandleType wraps gst_gl_display_get_handle_type // The function returns the following values: // @@ -4836,6 +4528,14 @@ func (display *GLDisplayInstance) RemoveWindow(window GLWindow) bool { return goret } +// ConnectCreateContext connects the provided callback to the "create-context" signal +// +// Overrides the @GstGLContext creation mechanism. +// It can be called in any thread and it is emitted with +// display's object lock held. +func (o *GLDisplayInstance) ConnectCreateContext(fn func(GLDisplay, GLContext) GLContextInstance) gobject.SignalHandle { + return o.Connect("create-context", fn) +} // GLFilterInstance is the instance type used by all types extending GstGLFilter. It is used internally by the bindings. Users should use the interface [GLFilter] instead. type GLFilterInstance struct { _ [0]func() // equal guard @@ -8862,22 +8562,12 @@ type GLWindow interface { // // - goret GLContext GetContext() GLContext - // GetDisplay wraps gst_gl_window_get_display - // The function returns the following values: - // - // - goret uintptr - GetDisplay() uintptr // GetSurfaceDimensions wraps gst_gl_window_get_surface_dimensions // The function returns the following values: // // - width uint: resulting surface width // - height uint: resulting surface height GetSurfaceDimensions() (uint, uint) - // GetWindowHandle wraps gst_gl_window_get_window_handle - // The function returns the following values: - // - // - goret uintptr - GetWindowHandle() uintptr // HandleEvents wraps gst_gl_window_handle_events // // The function takes the following parameters: @@ -8972,19 +8662,29 @@ type GLWindow interface { // Tell a @window that it should render into a specific region of the window // according to the #GstVideoOverlay interface. SetRenderRectangle(int, int, int, int) bool - // SetWindowHandle wraps gst_gl_window_set_window_handle - // - // The function takes the following parameters: - // - // - handle uintptr: handle to the window - // - // Sets the window that this @window should render into. Some implementations - // require this to be called with a valid handle before drawing can commence. - SetWindowHandle(uintptr) // Show wraps gst_gl_window_show // // Present the window to the screen. Show() + // ConnectKeyEvent connects the provided callback to the "key-event" signal + // + // Will be emitted when a key event is received by the GstGLwindow. + ConnectKeyEvent(func(GLWindow, string, string)) gobject.SignalHandle + // ConnectMouseEvent connects the provided callback to the "mouse-event" signal + // + // Will be emitted when a mouse event is received by the GstGLwindow. + ConnectMouseEvent(func(GLWindow, string, int, float64, float64)) gobject.SignalHandle + // ConnectScrollEvent connects the provided callback to the "scroll-event" signal + // + // Will be emitted when a mouse scroll event is received by the GstGLwindow. + ConnectScrollEvent(func(GLWindow, float64, float64, float64, float64)) gobject.SignalHandle + // ConnectWindowHandleChanged connects the provided callback to the "window-handle-changed" signal + // + // Will be emitted when the window handle has been set into the native + // implementation, but before the context is re-activated. By using this + // signal, elements can refresh associated resource without relying on + // direct handle comparision. + ConnectWindowHandleChanged(func(GLWindow)) gobject.SignalHandle } func unsafeWrapGLWindow(base *gobject.ObjectInstance) *GLWindowInstance { @@ -9106,26 +8806,6 @@ func (window *GLWindowInstance) GetContext() GLContext { return goret } -// GetDisplay wraps gst_gl_window_get_display -// The function returns the following values: -// -// - goret uintptr -func (window *GLWindowInstance) GetDisplay() uintptr { - var carg0 *C.GstGLWindow // in, none, converted - var cret C.guintptr // return, none, casted - - carg0 = (*C.GstGLWindow)(UnsafeGLWindowToGlibNone(window)) - - cret = C.gst_gl_window_get_display(carg0) - runtime.KeepAlive(window) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - // GetSurfaceDimensions wraps gst_gl_window_get_surface_dimensions // The function returns the following values: // @@ -9150,26 +8830,6 @@ func (window *GLWindowInstance) GetSurfaceDimensions() (uint, uint) { return width, height } -// GetWindowHandle wraps gst_gl_window_get_window_handle -// The function returns the following values: -// -// - goret uintptr -func (window *GLWindowInstance) GetWindowHandle() uintptr { - var carg0 *C.GstGLWindow // in, none, converted - var cret C.guintptr // return, none, casted - - carg0 = (*C.GstGLWindow)(UnsafeGLWindowToGlibNone(window)) - - cret = C.gst_gl_window_get_window_handle(carg0) - runtime.KeepAlive(window) - - var goret uintptr - - goret = uintptr(cret) - - return goret -} - // HandleEvents wraps gst_gl_window_handle_events // // The function takes the following parameters: @@ -9432,26 +9092,6 @@ func (window *GLWindowInstance) SetRenderRectangle(x int, y int, width int, heig return goret } -// SetWindowHandle wraps gst_gl_window_set_window_handle -// -// The function takes the following parameters: -// -// - handle uintptr: handle to the window -// -// Sets the window that this @window should render into. Some implementations -// require this to be called with a valid handle before drawing can commence. -func (window *GLWindowInstance) SetWindowHandle(handle uintptr) { - var carg0 *C.GstGLWindow // in, none, converted - var carg1 C.guintptr // in, none, casted - - carg0 = (*C.GstGLWindow)(UnsafeGLWindowToGlibNone(window)) - carg1 = C.guintptr(handle) - - C.gst_gl_window_set_window_handle(carg0, carg1) - runtime.KeepAlive(window) - runtime.KeepAlive(handle) -} - // Show wraps gst_gl_window_show // // Present the window to the screen. @@ -9464,6 +9104,33 @@ func (window *GLWindowInstance) Show() { runtime.KeepAlive(window) } +// ConnectKeyEvent connects the provided callback to the "key-event" signal +// +// Will be emitted when a key event is received by the GstGLwindow. +func (o *GLWindowInstance) ConnectKeyEvent(fn func(GLWindow, string, string)) gobject.SignalHandle { + return o.Connect("key-event", fn) +} +// ConnectMouseEvent connects the provided callback to the "mouse-event" signal +// +// Will be emitted when a mouse event is received by the GstGLwindow. +func (o *GLWindowInstance) ConnectMouseEvent(fn func(GLWindow, string, int, float64, float64)) gobject.SignalHandle { + return o.Connect("mouse-event", fn) +} +// ConnectScrollEvent connects the provided callback to the "scroll-event" signal +// +// Will be emitted when a mouse scroll event is received by the GstGLwindow. +func (o *GLWindowInstance) ConnectScrollEvent(fn func(GLWindow, float64, float64, float64, float64)) gobject.SignalHandle { + return o.Connect("scroll-event", fn) +} +// ConnectWindowHandleChanged connects the provided callback to the "window-handle-changed" signal +// +// Will be emitted when the window handle has been set into the native +// implementation, but before the context is re-activated. By using this +// signal, elements can refresh associated resource without relying on +// direct handle comparision. +func (o *GLWindowInstance) ConnectWindowHandleChanged(fn func(GLWindow)) gobject.SignalHandle { + return o.Connect("window-handle-changed", fn) +} // GLAllocationParams wraps GstGLAllocationParams type GLAllocationParams struct { *glAllocationParams @@ -11131,67 +10798,6 @@ func (glMem *GLMemory) GetTextureWidth() int { return goret } -// ReadPixels wraps gst_gl_memory_read_pixels -// -// The function takes the following parameters: -// -// - writePointer unsafe.Pointer (nullable): the data pointer to pass to glReadPixels -// -// The function returns the following values: -// -// - goret bool -// -// Reads the texture in #GstGLMemory into @write_pointer if no buffer is bound -// to `GL_PIXEL_PACK_BUFFER`. Otherwise @write_pointer is the byte offset into -// the currently bound `GL_PIXEL_PACK_BUFFER` buffer to store the result of -// glReadPixels. See the OpenGL specification for glReadPixels for more -// details. -func (glMem *GLMemory) ReadPixels(writePointer unsafe.Pointer) bool { - var carg0 *C.GstGLMemory // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - var cret C.gboolean // return - - carg0 = (*C.GstGLMemory)(UnsafeGLMemoryToGlibNone(glMem)) - if writePointer != nil { - carg1 = C.gpointer(writePointer) - } - - cret = C.gst_gl_memory_read_pixels(carg0, carg1) - runtime.KeepAlive(glMem) - runtime.KeepAlive(writePointer) - - var goret bool - - if cret != 0 { - goret = true - } - - return goret -} - -// Texsubimage wraps gst_gl_memory_texsubimage -// -// The function takes the following parameters: -// -// - readPointer unsafe.Pointer (nullable): the data pointer to pass to glTexSubImage -// -// Reads the texture in @read_pointer into @gl_mem. -// -// See gst_gl_memory_read_pixels() for what @read_pointer signifies. -func (glMem *GLMemory) Texsubimage(readPointer unsafe.Pointer) { - var carg0 *C.GstGLMemory // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - - carg0 = (*C.GstGLMemory)(UnsafeGLMemoryToGlibNone(glMem)) - if readPointer != nil { - carg1 = C.gpointer(readPointer) - } - - C.gst_gl_memory_texsubimage(carg0, carg1) - runtime.KeepAlive(glMem) - runtime.KeepAlive(readPointer) -} - // GLMemoryAllocatorClass wraps GstGLMemoryAllocatorClass type GLMemoryAllocatorClass struct { *glMemoryAllocatorClass diff --git a/pkg/gstpbutils/gstpbutils.gen.go b/pkg/gstpbutils/gstpbutils.gen.go index 69944a9..a89fb13 100644 --- a/pkg/gstpbutils/gstpbutils.gen.go +++ b/pkg/gstpbutils/gstpbutils.gen.go @@ -2411,6 +2411,38 @@ type Discoverer interface { // Stop the discovery of any pending URIs and clears the list of // pending URIS (if any). Stop() + // ConnectDiscovered connects the provided callback to the "discovered" signal + // + // Will be emitted in async mode when all information on a URI could be + // discovered, or an error occurred. + // + // When an error occurs, @info might still contain some partial information, + // depending on the circumstances of the error. + ConnectDiscovered(func(Discoverer, DiscovererInfo, error)) gobject.SignalHandle + // ConnectFinished connects the provided callback to the "finished" signal + // + // Will be emitted in async mode when all pending URIs have been processed. + ConnectFinished(func(Discoverer)) gobject.SignalHandle + // ConnectLoadSerializedInfo connects the provided callback to the "load-serialized-info" signal + // + // Retrieves information about a URI from and external source of information, + // like a cache file. This is used by the discoverer to speed up the + // discovery. + ConnectLoadSerializedInfo(func(Discoverer, string) DiscovererInfoInstance) gobject.SignalHandle + // ConnectSourceSetup connects the provided callback to the "source-setup" signal + // + // This signal is emitted after the source element has been created for, so + // the URI being discovered, so it can be configured by setting additional + // properties (e.g. set a proxy server for an http source, or set the device + // and read speed for an audio cd source). + // + // This signal is usually emitted from the context of a GStreamer streaming + // thread. + ConnectSourceSetup(func(Discoverer, gst.Element)) gobject.SignalHandle + // ConnectStarting connects the provided callback to the "starting" signal + // + // Will be emitted when the discover starts analyzing the pending URIs + ConnectStarting(func(Discoverer)) gobject.SignalHandle } func unsafeWrapDiscoverer(base *gobject.ObjectInstance) *DiscovererInstance { @@ -2586,6 +2618,48 @@ func (discoverer *DiscovererInstance) Stop() { runtime.KeepAlive(discoverer) } +// ConnectDiscovered connects the provided callback to the "discovered" signal +// +// Will be emitted in async mode when all information on a URI could be +// discovered, or an error occurred. +// +// When an error occurs, @info might still contain some partial information, +// depending on the circumstances of the error. +func (o *DiscovererInstance) ConnectDiscovered(fn func(Discoverer, DiscovererInfo, error)) gobject.SignalHandle { + return o.Connect("discovered", fn) +} +// ConnectFinished connects the provided callback to the "finished" signal +// +// Will be emitted in async mode when all pending URIs have been processed. +func (o *DiscovererInstance) ConnectFinished(fn func(Discoverer)) gobject.SignalHandle { + return o.Connect("finished", fn) +} +// ConnectLoadSerializedInfo connects the provided callback to the "load-serialized-info" signal +// +// Retrieves information about a URI from and external source of information, +// like a cache file. This is used by the discoverer to speed up the +// discovery. +func (o *DiscovererInstance) ConnectLoadSerializedInfo(fn func(Discoverer, string) DiscovererInfoInstance) gobject.SignalHandle { + return o.Connect("load-serialized-info", fn) +} +// ConnectSourceSetup connects the provided callback to the "source-setup" signal +// +// This signal is emitted after the source element has been created for, so +// the URI being discovered, so it can be configured by setting additional +// properties (e.g. set a proxy server for an http source, or set the device +// and read speed for an audio cd source). +// +// This signal is usually emitted from the context of a GStreamer streaming +// thread. +func (o *DiscovererInstance) ConnectSourceSetup(fn func(Discoverer, gst.Element)) gobject.SignalHandle { + return o.Connect("source-setup", fn) +} +// ConnectStarting connects the provided callback to the "starting" signal +// +// Will be emitted when the discover starts analyzing the pending URIs +func (o *DiscovererInstance) ConnectStarting(fn func(Discoverer)) gobject.SignalHandle { + return o.Connect("starting", fn) +} // DiscovererInfoInstance is the instance type used by all types extending GstDiscovererInfo. It is used internally by the bindings. Users should use the interface [DiscovererInfo] instead. type DiscovererInfoInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstplay/gstplay.gen.go b/pkg/gstplay/gstplay.gen.go index fb4a645..8934953 100644 --- a/pkg/gstplay/gstplay.gen.go +++ b/pkg/gstplay/gstplay.gen.go @@ -305,7 +305,7 @@ type PlayVideoRendererInstance struct { var _ PlayVideoRenderer = (*PlayVideoRendererInstance)(nil) -// PlayVideoRendererInstance wraps GstPlayVideoRenderer +// PlayVideoRenderer wraps GstPlayVideoRenderer type PlayVideoRenderer interface { upcastToGstPlayVideoRenderer() *PlayVideoRendererInstance } @@ -2494,6 +2494,36 @@ type PlaySignalAdapter interface { // // - goret Play GetPlay() Play + // ConnectBuffering connects the provided callback to the "buffering" signal + ConnectBuffering(func(PlaySignalAdapter, int)) gobject.SignalHandle + // ConnectDurationChanged connects the provided callback to the "duration-changed" signal + ConnectDurationChanged(func(PlaySignalAdapter, uint64)) gobject.SignalHandle + // ConnectEndOfStream connects the provided callback to the "end-of-stream" signal + ConnectEndOfStream(func(PlaySignalAdapter)) gobject.SignalHandle + // ConnectError connects the provided callback to the "error" signal + // + // Emitted on errors. + ConnectError(func(PlaySignalAdapter, error, gst.Structure)) gobject.SignalHandle + // ConnectMediaInfoUpdated connects the provided callback to the "media-info-updated" signal + ConnectMediaInfoUpdated(func(PlaySignalAdapter, PlayMediaInfo)) gobject.SignalHandle + // ConnectMuteChanged connects the provided callback to the "mute-changed" signal + ConnectMuteChanged(func(PlaySignalAdapter, bool)) gobject.SignalHandle + // ConnectPositionUpdated connects the provided callback to the "position-updated" signal + ConnectPositionUpdated(func(PlaySignalAdapter, uint64)) gobject.SignalHandle + // ConnectSeekDone connects the provided callback to the "seek-done" signal + ConnectSeekDone(func(PlaySignalAdapter, uint64)) gobject.SignalHandle + // ConnectStateChanged connects the provided callback to the "state-changed" signal + ConnectStateChanged(func(PlaySignalAdapter, PlayState)) gobject.SignalHandle + // ConnectURILoaded connects the provided callback to the "uri-loaded" signal + ConnectURILoaded(func(PlaySignalAdapter, string)) gobject.SignalHandle + // ConnectVideoDimensionsChanged connects the provided callback to the "video-dimensions-changed" signal + ConnectVideoDimensionsChanged(func(PlaySignalAdapter, uint, uint)) gobject.SignalHandle + // ConnectVolumeChanged connects the provided callback to the "volume-changed" signal + ConnectVolumeChanged(func(PlaySignalAdapter, float64)) gobject.SignalHandle + // ConnectWarning connects the provided callback to the "warning" signal + // + // Emitted on warnings. + ConnectWarning(func(PlaySignalAdapter, error, gst.Structure)) gobject.SignalHandle } func unsafeWrapPlaySignalAdapter(base *gobject.ObjectInstance) *PlaySignalAdapterInstance { @@ -2642,6 +2672,62 @@ func (adapter *PlaySignalAdapterInstance) GetPlay() Play { return goret } +// ConnectBuffering connects the provided callback to the "buffering" signal +func (o *PlaySignalAdapterInstance) ConnectBuffering(fn func(PlaySignalAdapter, int)) gobject.SignalHandle { + return o.Connect("buffering", fn) +} +// ConnectDurationChanged connects the provided callback to the "duration-changed" signal +func (o *PlaySignalAdapterInstance) ConnectDurationChanged(fn func(PlaySignalAdapter, uint64)) gobject.SignalHandle { + return o.Connect("duration-changed", fn) +} +// ConnectEndOfStream connects the provided callback to the "end-of-stream" signal +func (o *PlaySignalAdapterInstance) ConnectEndOfStream(fn func(PlaySignalAdapter)) gobject.SignalHandle { + return o.Connect("end-of-stream", fn) +} +// ConnectError connects the provided callback to the "error" signal +// +// Emitted on errors. +func (o *PlaySignalAdapterInstance) ConnectError(fn func(PlaySignalAdapter, error, gst.Structure)) gobject.SignalHandle { + return o.Connect("error", fn) +} +// ConnectMediaInfoUpdated connects the provided callback to the "media-info-updated" signal +func (o *PlaySignalAdapterInstance) ConnectMediaInfoUpdated(fn func(PlaySignalAdapter, PlayMediaInfo)) gobject.SignalHandle { + return o.Connect("media-info-updated", fn) +} +// ConnectMuteChanged connects the provided callback to the "mute-changed" signal +func (o *PlaySignalAdapterInstance) ConnectMuteChanged(fn func(PlaySignalAdapter, bool)) gobject.SignalHandle { + return o.Connect("mute-changed", fn) +} +// ConnectPositionUpdated connects the provided callback to the "position-updated" signal +func (o *PlaySignalAdapterInstance) ConnectPositionUpdated(fn func(PlaySignalAdapter, uint64)) gobject.SignalHandle { + return o.Connect("position-updated", fn) +} +// ConnectSeekDone connects the provided callback to the "seek-done" signal +func (o *PlaySignalAdapterInstance) ConnectSeekDone(fn func(PlaySignalAdapter, uint64)) gobject.SignalHandle { + return o.Connect("seek-done", fn) +} +// ConnectStateChanged connects the provided callback to the "state-changed" signal +func (o *PlaySignalAdapterInstance) ConnectStateChanged(fn func(PlaySignalAdapter, PlayState)) gobject.SignalHandle { + return o.Connect("state-changed", fn) +} +// ConnectURILoaded connects the provided callback to the "uri-loaded" signal +func (o *PlaySignalAdapterInstance) ConnectURILoaded(fn func(PlaySignalAdapter, string)) gobject.SignalHandle { + return o.Connect("uri-loaded", fn) +} +// ConnectVideoDimensionsChanged connects the provided callback to the "video-dimensions-changed" signal +func (o *PlaySignalAdapterInstance) ConnectVideoDimensionsChanged(fn func(PlaySignalAdapter, uint, uint)) gobject.SignalHandle { + return o.Connect("video-dimensions-changed", fn) +} +// ConnectVolumeChanged connects the provided callback to the "volume-changed" signal +func (o *PlaySignalAdapterInstance) ConnectVolumeChanged(fn func(PlaySignalAdapter, float64)) gobject.SignalHandle { + return o.Connect("volume-changed", fn) +} +// ConnectWarning connects the provided callback to the "warning" signal +// +// Emitted on warnings. +func (o *PlaySignalAdapterInstance) ConnectWarning(fn func(PlaySignalAdapter, error, gst.Structure)) gobject.SignalHandle { + return o.Connect("warning", fn) +} // PlayStreamInfoInstance is the instance type used by all types extending GstPlayStreamInfo. It is used internally by the bindings. Users should use the interface [PlayStreamInfo] instead. type PlayStreamInfoInstance struct { _ [0]func() // equal guard @@ -3160,11 +3246,6 @@ type PlayVideoOverlayVideoRenderer interface { // Return the currently configured render rectangle. See gst_play_video_overlay_video_renderer_set_render_rectangle() // for details. GetRenderRectangle() (int, int, int, int) - // GetWindowHandle wraps gst_play_video_overlay_video_renderer_get_window_handle - // The function returns the following values: - // - // - goret unsafe.Pointer - GetWindowHandle() unsafe.Pointer // SetRenderRectangle wraps gst_play_video_overlay_video_renderer_set_render_rectangle // // The function takes the following parameters: @@ -3185,15 +3266,6 @@ type PlayVideoOverlayVideoRenderer interface { // This method is needed for non fullscreen video overlay in UI toolkits that // do not support subwindows. SetRenderRectangle(int, int, int, int) - // SetWindowHandle wraps gst_play_video_overlay_video_renderer_set_window_handle - // - // The function takes the following parameters: - // - // - windowHandle unsafe.Pointer (nullable): handle referencing to the platform specific window - // - // Sets the platform specific window handle into which the video - // should be rendered - SetWindowHandle(unsafe.Pointer) } func unsafeWrapPlayVideoOverlayVideoRenderer(base *gobject.ObjectInstance) *PlayVideoOverlayVideoRendererInstance { @@ -3230,64 +3302,6 @@ func UnsafePlayVideoOverlayVideoRendererToGlibFull(c PlayVideoOverlayVideoRender return gobject.UnsafeObjectToGlibFull(c) } -// NewPlayVideoOverlayVideoRenderer wraps gst_play_video_overlay_video_renderer_new -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): Window handle to use or %NULL -// -// The function returns the following values: -// -// - goret PlayVideoRenderer -func NewPlayVideoOverlayVideoRenderer(windowHandle unsafe.Pointer) PlayVideoRenderer { - var carg1 C.gpointer // in, none, casted, nullable - var cret *C.GstPlayVideoRenderer // return, full, converted - - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - - cret = C.gst_play_video_overlay_video_renderer_new(carg1) - runtime.KeepAlive(windowHandle) - - var goret PlayVideoRenderer - - goret = UnsafePlayVideoRendererFromGlibFull(unsafe.Pointer(cret)) - - return goret -} - -// NewPlayVideoOverlayVideoRendererWithSink wraps gst_play_video_overlay_video_renderer_new_with_sink -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): Window handle to use or %NULL -// - videoSink gst.Element: the custom video_sink element to be set for the video renderer -// -// The function returns the following values: -// -// - goret PlayVideoRenderer -func NewPlayVideoOverlayVideoRendererWithSink(windowHandle unsafe.Pointer, videoSink gst.Element) PlayVideoRenderer { - var carg1 C.gpointer // in, none, casted, nullable - var carg2 *C.GstElement // in, none, converted - var cret *C.GstPlayVideoRenderer // return, full, converted - - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - carg2 = (*C.GstElement)(gst.UnsafeElementToGlibNone(videoSink)) - - cret = C.gst_play_video_overlay_video_renderer_new_with_sink(carg1, carg2) - runtime.KeepAlive(windowHandle) - runtime.KeepAlive(videoSink) - - var goret PlayVideoRenderer - - goret = UnsafePlayVideoRendererFromGlibFull(unsafe.Pointer(cret)) - - return goret -} - // Expose wraps gst_play_video_overlay_video_renderer_expose // // Tell an overlay that it has been exposed. This will redraw the current frame @@ -3336,26 +3350,6 @@ func (self *PlayVideoOverlayVideoRendererInstance) GetRenderRectangle() (int, in return x, y, width, height } -// GetWindowHandle wraps gst_play_video_overlay_video_renderer_get_window_handle -// The function returns the following values: -// -// - goret unsafe.Pointer -func (self *PlayVideoOverlayVideoRendererInstance) GetWindowHandle() unsafe.Pointer { - var carg0 *C.GstPlayVideoOverlayVideoRenderer // in, none, converted - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstPlayVideoOverlayVideoRenderer)(UnsafePlayVideoOverlayVideoRendererToGlibNone(self)) - - cret = C.gst_play_video_overlay_video_renderer_get_window_handle(carg0) - runtime.KeepAlive(self) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // SetRenderRectangle wraps gst_play_video_overlay_video_renderer_set_render_rectangle // // The function takes the following parameters: @@ -3396,28 +3390,6 @@ func (self *PlayVideoOverlayVideoRendererInstance) SetRenderRectangle(x int, y i runtime.KeepAlive(height) } -// SetWindowHandle wraps gst_play_video_overlay_video_renderer_set_window_handle -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): handle referencing to the platform specific window -// -// Sets the platform specific window handle into which the video -// should be rendered -func (self *PlayVideoOverlayVideoRendererInstance) SetWindowHandle(windowHandle unsafe.Pointer) { - var carg0 *C.GstPlayVideoOverlayVideoRenderer // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - - carg0 = (*C.GstPlayVideoOverlayVideoRenderer)(UnsafePlayVideoOverlayVideoRendererToGlibNone(self)) - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - - C.gst_play_video_overlay_video_renderer_set_window_handle(carg0, carg1) - runtime.KeepAlive(self) - runtime.KeepAlive(windowHandle) -} - // PlayAudioInfoInstance is the instance type used by all types extending GstPlayAudioInfo. It is used internally by the bindings. Users should use the interface [PlayAudioInfo] instead. type PlayAudioInfoInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstplayer/gstplayer.gen.go b/pkg/gstplayer/gstplayer.gen.go index 3da55eb..3f0920c 100644 --- a/pkg/gstplayer/gstplayer.gen.go +++ b/pkg/gstplayer/gstplayer.gen.go @@ -207,7 +207,7 @@ type PlayerSignalDispatcherInstance struct { var _ PlayerSignalDispatcher = (*PlayerSignalDispatcherInstance)(nil) -// PlayerSignalDispatcherInstance wraps GstPlayerSignalDispatcher +// PlayerSignalDispatcher wraps GstPlayerSignalDispatcher type PlayerSignalDispatcher interface { upcastToGstPlayerSignalDispatcher() *PlayerSignalDispatcherInstance } @@ -258,7 +258,7 @@ type PlayerVideoRendererInstance struct { var _ PlayerVideoRenderer = (*PlayerVideoRendererInstance)(nil) -// PlayerVideoRendererInstance wraps GstPlayerVideoRenderer +// PlayerVideoRenderer wraps GstPlayerVideoRenderer type PlayerVideoRenderer interface { upcastToGstPlayerVideoRenderer() *PlayerVideoRendererInstance } @@ -677,6 +677,32 @@ type Player interface { // Stops playing the current stream and resets to the first position // in the stream. Stop() + // ConnectBuffering connects the provided callback to the "buffering" signal + ConnectBuffering(func(Player, int)) gobject.SignalHandle + // ConnectDurationChanged connects the provided callback to the "duration-changed" signal + ConnectDurationChanged(func(Player, uint64)) gobject.SignalHandle + // ConnectEndOfStream connects the provided callback to the "end-of-stream" signal + ConnectEndOfStream(func(Player)) gobject.SignalHandle + // ConnectError connects the provided callback to the "error" signal + ConnectError(func(Player, error)) gobject.SignalHandle + // ConnectMediaInfoUpdated connects the provided callback to the "media-info-updated" signal + ConnectMediaInfoUpdated(func(Player, PlayerMediaInfo)) gobject.SignalHandle + // ConnectMuteChanged connects the provided callback to the "mute-changed" signal + ConnectMuteChanged(func(Player)) gobject.SignalHandle + // ConnectPositionUpdated connects the provided callback to the "position-updated" signal + ConnectPositionUpdated(func(Player, uint64)) gobject.SignalHandle + // ConnectSeekDone connects the provided callback to the "seek-done" signal + ConnectSeekDone(func(Player, uint64)) gobject.SignalHandle + // ConnectStateChanged connects the provided callback to the "state-changed" signal + ConnectStateChanged(func(Player, PlayerState)) gobject.SignalHandle + // ConnectURILoaded connects the provided callback to the "uri-loaded" signal + ConnectURILoaded(func(Player, string)) gobject.SignalHandle + // ConnectVideoDimensionsChanged connects the provided callback to the "video-dimensions-changed" signal + ConnectVideoDimensionsChanged(func(Player, int, int)) gobject.SignalHandle + // ConnectVolumeChanged connects the provided callback to the "volume-changed" signal + ConnectVolumeChanged(func(Player)) gobject.SignalHandle + // ConnectWarning connects the provided callback to the "warning" signal + ConnectWarning(func(Player, error)) gobject.SignalHandle } func unsafeWrapPlayer(base *gobject.ObjectInstance) *PlayerInstance { @@ -1922,6 +1948,58 @@ func (player *PlayerInstance) Stop() { runtime.KeepAlive(player) } +// ConnectBuffering connects the provided callback to the "buffering" signal +func (o *PlayerInstance) ConnectBuffering(fn func(Player, int)) gobject.SignalHandle { + return o.Connect("buffering", fn) +} +// ConnectDurationChanged connects the provided callback to the "duration-changed" signal +func (o *PlayerInstance) ConnectDurationChanged(fn func(Player, uint64)) gobject.SignalHandle { + return o.Connect("duration-changed", fn) +} +// ConnectEndOfStream connects the provided callback to the "end-of-stream" signal +func (o *PlayerInstance) ConnectEndOfStream(fn func(Player)) gobject.SignalHandle { + return o.Connect("end-of-stream", fn) +} +// ConnectError connects the provided callback to the "error" signal +func (o *PlayerInstance) ConnectError(fn func(Player, error)) gobject.SignalHandle { + return o.Connect("error", fn) +} +// ConnectMediaInfoUpdated connects the provided callback to the "media-info-updated" signal +func (o *PlayerInstance) ConnectMediaInfoUpdated(fn func(Player, PlayerMediaInfo)) gobject.SignalHandle { + return o.Connect("media-info-updated", fn) +} +// ConnectMuteChanged connects the provided callback to the "mute-changed" signal +func (o *PlayerInstance) ConnectMuteChanged(fn func(Player)) gobject.SignalHandle { + return o.Connect("mute-changed", fn) +} +// ConnectPositionUpdated connects the provided callback to the "position-updated" signal +func (o *PlayerInstance) ConnectPositionUpdated(fn func(Player, uint64)) gobject.SignalHandle { + return o.Connect("position-updated", fn) +} +// ConnectSeekDone connects the provided callback to the "seek-done" signal +func (o *PlayerInstance) ConnectSeekDone(fn func(Player, uint64)) gobject.SignalHandle { + return o.Connect("seek-done", fn) +} +// ConnectStateChanged connects the provided callback to the "state-changed" signal +func (o *PlayerInstance) ConnectStateChanged(fn func(Player, PlayerState)) gobject.SignalHandle { + return o.Connect("state-changed", fn) +} +// ConnectURILoaded connects the provided callback to the "uri-loaded" signal +func (o *PlayerInstance) ConnectURILoaded(fn func(Player, string)) gobject.SignalHandle { + return o.Connect("uri-loaded", fn) +} +// ConnectVideoDimensionsChanged connects the provided callback to the "video-dimensions-changed" signal +func (o *PlayerInstance) ConnectVideoDimensionsChanged(fn func(Player, int, int)) gobject.SignalHandle { + return o.Connect("video-dimensions-changed", fn) +} +// ConnectVolumeChanged connects the provided callback to the "volume-changed" signal +func (o *PlayerInstance) ConnectVolumeChanged(fn func(Player)) gobject.SignalHandle { + return o.Connect("volume-changed", fn) +} +// ConnectWarning connects the provided callback to the "warning" signal +func (o *PlayerInstance) ConnectWarning(fn func(Player, error)) gobject.SignalHandle { + return o.Connect("warning", fn) +} // PlayerGMainContextSignalDispatcherInstance is the instance type used by all types extending GstPlayerGMainContextSignalDispatcher. It is used internally by the bindings. Users should use the interface [PlayerGMainContextSignalDispatcher] instead. type PlayerGMainContextSignalDispatcherInstance struct { _ [0]func() // equal guard @@ -2879,11 +2957,6 @@ type PlayerVideoOverlayVideoRenderer interface { // Return the currently configured render rectangle. See gst_player_video_overlay_video_renderer_set_render_rectangle() // for details. GetRenderRectangle() (int, int, int, int) - // GetWindowHandle wraps gst_player_video_overlay_video_renderer_get_window_handle - // The function returns the following values: - // - // - goret unsafe.Pointer - GetWindowHandle() unsafe.Pointer // SetRenderRectangle wraps gst_player_video_overlay_video_renderer_set_render_rectangle // // The function takes the following parameters: @@ -2904,15 +2977,6 @@ type PlayerVideoOverlayVideoRenderer interface { // This method is needed for non fullscreen video overlay in UI toolkits that // do not support subwindows. SetRenderRectangle(int, int, int, int) - // SetWindowHandle wraps gst_player_video_overlay_video_renderer_set_window_handle - // - // The function takes the following parameters: - // - // - windowHandle unsafe.Pointer (nullable): handle referencing to the platform specific window - // - // Sets the platform specific window handle into which the video - // should be rendered - SetWindowHandle(unsafe.Pointer) } func unsafeWrapPlayerVideoOverlayVideoRenderer(base *gobject.ObjectInstance) *PlayerVideoOverlayVideoRendererInstance { @@ -2949,64 +3013,6 @@ func UnsafePlayerVideoOverlayVideoRendererToGlibFull(c PlayerVideoOverlayVideoRe return gobject.UnsafeObjectToGlibFull(c) } -// NewPlayerVideoOverlayVideoRenderer wraps gst_player_video_overlay_video_renderer_new -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): Window handle to use or %NULL -// -// The function returns the following values: -// -// - goret PlayerVideoRenderer -func NewPlayerVideoOverlayVideoRenderer(windowHandle unsafe.Pointer) PlayerVideoRenderer { - var carg1 C.gpointer // in, none, casted, nullable - var cret *C.GstPlayerVideoRenderer // return, full, converted - - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - - cret = C.gst_player_video_overlay_video_renderer_new(carg1) - runtime.KeepAlive(windowHandle) - - var goret PlayerVideoRenderer - - goret = UnsafePlayerVideoRendererFromGlibFull(unsafe.Pointer(cret)) - - return goret -} - -// NewPlayerVideoOverlayVideoRendererWithSink wraps gst_player_video_overlay_video_renderer_new_with_sink -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): Window handle to use or %NULL -// - videoSink gst.Element: the custom video_sink element to be set for the video renderer -// -// The function returns the following values: -// -// - goret PlayerVideoRenderer -func NewPlayerVideoOverlayVideoRendererWithSink(windowHandle unsafe.Pointer, videoSink gst.Element) PlayerVideoRenderer { - var carg1 C.gpointer // in, none, casted, nullable - var carg2 *C.GstElement // in, none, converted - var cret *C.GstPlayerVideoRenderer // return, full, converted - - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - carg2 = (*C.GstElement)(gst.UnsafeElementToGlibNone(videoSink)) - - cret = C.gst_player_video_overlay_video_renderer_new_with_sink(carg1, carg2) - runtime.KeepAlive(windowHandle) - runtime.KeepAlive(videoSink) - - var goret PlayerVideoRenderer - - goret = UnsafePlayerVideoRendererFromGlibFull(unsafe.Pointer(cret)) - - return goret -} - // Expose wraps gst_player_video_overlay_video_renderer_expose // // Tell an overlay that it has been exposed. This will redraw the current frame @@ -3055,26 +3061,6 @@ func (self *PlayerVideoOverlayVideoRendererInstance) GetRenderRectangle() (int, return x, y, width, height } -// GetWindowHandle wraps gst_player_video_overlay_video_renderer_get_window_handle -// The function returns the following values: -// -// - goret unsafe.Pointer -func (self *PlayerVideoOverlayVideoRendererInstance) GetWindowHandle() unsafe.Pointer { - var carg0 *C.GstPlayerVideoOverlayVideoRenderer // in, none, converted - var cret C.gpointer // return, none, casted - - carg0 = (*C.GstPlayerVideoOverlayVideoRenderer)(UnsafePlayerVideoOverlayVideoRendererToGlibNone(self)) - - cret = C.gst_player_video_overlay_video_renderer_get_window_handle(carg0) - runtime.KeepAlive(self) - - var goret unsafe.Pointer - - goret = unsafe.Pointer(cret) - - return goret -} - // SetRenderRectangle wraps gst_player_video_overlay_video_renderer_set_render_rectangle // // The function takes the following parameters: @@ -3115,28 +3101,6 @@ func (self *PlayerVideoOverlayVideoRendererInstance) SetRenderRectangle(x int, y runtime.KeepAlive(height) } -// SetWindowHandle wraps gst_player_video_overlay_video_renderer_set_window_handle -// -// The function takes the following parameters: -// -// - windowHandle unsafe.Pointer (nullable): handle referencing to the platform specific window -// -// Sets the platform specific window handle into which the video -// should be rendered -func (self *PlayerVideoOverlayVideoRendererInstance) SetWindowHandle(windowHandle unsafe.Pointer) { - var carg0 *C.GstPlayerVideoOverlayVideoRenderer // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - - carg0 = (*C.GstPlayerVideoOverlayVideoRenderer)(UnsafePlayerVideoOverlayVideoRendererToGlibNone(self)) - if windowHandle != nil { - carg1 = C.gpointer(windowHandle) - } - - C.gst_player_video_overlay_video_renderer_set_window_handle(carg0, carg1) - runtime.KeepAlive(self) - runtime.KeepAlive(windowHandle) -} - // PlayerAudioInfoInstance is the instance type used by all types extending GstPlayerAudioInfo. It is used internally by the bindings. Users should use the interface [PlayerAudioInfo] instead. type PlayerAudioInfoInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstrtp/gstrtp.gen.go b/pkg/gstrtp/gstrtp.gen.go index 5d5f874..70f663c 100644 --- a/pkg/gstrtp/gstrtp.gen.go +++ b/pkg/gstrtp/gstrtp.gen.go @@ -1077,86 +1077,6 @@ func RtcpUnixToNtp(unixtime uint64) uint64 { return goret } -// RtpHdrextSetNtp56 wraps gst_rtp_hdrext_set_ntp_56 -// -// The function takes the following parameters: -// -// - data unsafe.Pointer (nullable): the data to write to -// - size uint: the size of @data -// - ntptime uint64: the NTP time -// -// The function returns the following values: -// -// - goret bool -// -// Writes the NTP time in @ntptime to the format required for the NTP-56 header -// extension. @data must hold at least #GST_RTP_HDREXT_NTP_56_SIZE bytes. -func RtpHdrextSetNtp56(data unsafe.Pointer, size uint, ntptime uint64) bool { - var carg1 C.gpointer // in, none, casted, nullable - var carg2 C.guint // in, none, casted - var carg3 C.guint64 // in, none, casted - var cret C.gboolean // return - - if data != nil { - carg1 = C.gpointer(data) - } - carg2 = C.guint(size) - carg3 = C.guint64(ntptime) - - cret = C.gst_rtp_hdrext_set_ntp_56(carg1, carg2, carg3) - runtime.KeepAlive(data) - runtime.KeepAlive(size) - runtime.KeepAlive(ntptime) - - var goret bool - - if cret != 0 { - goret = true - } - - return goret -} - -// RtpHdrextSetNtp64 wraps gst_rtp_hdrext_set_ntp_64 -// -// The function takes the following parameters: -// -// - data unsafe.Pointer (nullable): the data to write to -// - size uint: the size of @data -// - ntptime uint64: the NTP time -// -// The function returns the following values: -// -// - goret bool -// -// Writes the NTP time in @ntptime to the format required for the NTP-64 header -// extension. @data must hold at least #GST_RTP_HDREXT_NTP_64_SIZE bytes. -func RtpHdrextSetNtp64(data unsafe.Pointer, size uint, ntptime uint64) bool { - var carg1 C.gpointer // in, none, casted, nullable - var carg2 C.guint // in, none, casted - var carg3 C.guint64 // in, none, casted - var cret C.gboolean // return - - if data != nil { - carg1 = C.gpointer(data) - } - carg2 = C.guint(size) - carg3 = C.guint64(ntptime) - - cret = C.gst_rtp_hdrext_set_ntp_64(carg1, carg2, carg3) - runtime.KeepAlive(data) - runtime.KeepAlive(size) - runtime.KeepAlive(ntptime) - - var goret bool - - if cret != 0 { - goret = true - } - - return goret -} - // RtpSourceMetaApiGetType wraps gst_rtp_source_meta_api_get_type // The function returns the following values: // @@ -1332,6 +1252,20 @@ type RTPBaseDepayload interface { // // Enable or disable adding #GstRTPSourceMeta to depayloaded buffers. SetSourceInfoEnabled(bool) + // EmitAddExtension emits the "add-extension" signal + // + // Add @ext as an extension for reading part of an RTP header extension from + // incoming RTP packets. + EmitAddExtension(RTPHeaderExtension) + // EmitClearExtensions emits the "clear-extensions" signal + // + // Clear all RTP header extensions used by this depayloader. + EmitClearExtensions() + // ConnectRequestExtension connects the provided callback to the "request-extension" signal + // + // The returned @ext must be configured with the correct @ext_id and with the + // necessary attributes as required by the extension implementation. + ConnectRequestExtension(func(RTPBaseDepayload, uint, string) RTPHeaderExtensionInstance) gobject.SignalHandle } func unsafeWrapRTPBaseDepayload(base *gobject.ObjectInstance) *RTPBaseDepayloadInstance { @@ -1611,6 +1545,26 @@ func (depayload *RTPBaseDepayloadInstance) SetSourceInfoEnabled(enable bool) { runtime.KeepAlive(enable) } +// EmitAddExtension emits the "add-extension" signal +// +// Add @ext as an extension for reading part of an RTP header extension from +// incoming RTP packets. +func (o *RTPBaseDepayloadInstance) EmitAddExtension(arg0 RTPHeaderExtension) { + o.Emit("add-extension", arg0) +} +// EmitClearExtensions emits the "clear-extensions" signal +// +// Clear all RTP header extensions used by this depayloader. +func (o *RTPBaseDepayloadInstance) EmitClearExtensions() { + o.Emit("clear-extensions") +} +// ConnectRequestExtension connects the provided callback to the "request-extension" signal +// +// The returned @ext must be configured with the correct @ext_id and with the +// necessary attributes as required by the extension implementation. +func (o *RTPBaseDepayloadInstance) ConnectRequestExtension(fn func(RTPBaseDepayload, uint, string) RTPHeaderExtensionInstance) gobject.SignalHandle { + return o.Connect("request-extension", fn) +} // RTPBasePayloadInstance is the instance type used by all types extending GstRTPBasePayload. It is used internally by the bindings. Users should use the interface [RTPBasePayload] instead. type RTPBasePayloadInstance struct { _ [0]func() // equal guard @@ -1743,6 +1697,20 @@ type RTPBasePayload interface { // Enable or disable adding contributing sources to RTP packets from // #GstRTPSourceMeta. SetSourceInfoEnabled(bool) + // EmitAddExtension emits the "add-extension" signal + // + // Add @ext as an extension for writing part of an RTP header extension onto + // outgoing RTP packets. + EmitAddExtension(RTPHeaderExtension) + // EmitClearExtensions emits the "clear-extensions" signal + // + // Clear all RTP header extensions used by this payloader. + EmitClearExtensions() + // ConnectRequestExtension connects the provided callback to the "request-extension" signal + // + // The returned @ext must be configured with the correct @ext_id and with the + // necessary attributes as required by the extension implementation. + ConnectRequestExtension(func(RTPBasePayload, uint, string) RTPHeaderExtensionInstance) gobject.SignalHandle } func unsafeWrapRTPBasePayload(base *gobject.ObjectInstance) *RTPBasePayloadInstance { @@ -2079,6 +2047,26 @@ func (payload *RTPBasePayloadInstance) SetSourceInfoEnabled(enable bool) { runtime.KeepAlive(enable) } +// EmitAddExtension emits the "add-extension" signal +// +// Add @ext as an extension for writing part of an RTP header extension onto +// outgoing RTP packets. +func (o *RTPBasePayloadInstance) EmitAddExtension(arg0 RTPHeaderExtension) { + o.Emit("add-extension", arg0) +} +// EmitClearExtensions emits the "clear-extensions" signal +// +// Clear all RTP header extensions used by this payloader. +func (o *RTPBasePayloadInstance) EmitClearExtensions() { + o.Emit("clear-extensions") +} +// ConnectRequestExtension connects the provided callback to the "request-extension" signal +// +// The returned @ext must be configured with the correct @ext_id and with the +// necessary attributes as required by the extension implementation. +func (o *RTPBasePayloadInstance) ConnectRequestExtension(fn func(RTPBasePayload, uint, string) RTPHeaderExtensionInstance) gobject.SignalHandle { + return o.Connect("request-extension", fn) +} // RTPHeaderExtensionInstance is the instance type used by all types extending GstRTPHeaderExtension. It is used internally by the bindings. Users should use the interface [RTPHeaderExtension] instead. type RTPHeaderExtensionInstance struct { _ [0]func() // equal guard diff --git a/pkg/gstrtsp/gstrtsp.gen.go b/pkg/gstrtsp/gstrtsp.gen.go index 455e3b6..5fabb68 100644 --- a/pkg/gstrtsp/gstrtsp.gen.go +++ b/pkg/gstrtsp/gstrtsp.gen.go @@ -1866,7 +1866,7 @@ type RTSPExtensionInstance struct { var _ RTSPExtension = (*RTSPExtensionInstance)(nil) -// RTSPExtensionInstance wraps GstRTSPExtension +// RTSPExtension wraps GstRTSPExtension // // This interface is implemented e.g. by the Windows Media Streaming RTSP // exentension (rtspwms) and the RealMedia RTSP extension (rtspreal). @@ -1977,6 +1977,8 @@ type RTSPExtension interface { // // - goret RTSPResult StreamSelect(*RTSPUrl) RTSPResult + // ConnectSend connects the provided callback to the "send" signal + ConnectSend(func(RTSPExtension, unsafe.Pointer, unsafe.Pointer) RTSPResult) gobject.SignalHandle } var _ RTSPExtension = (*RTSPExtensionInstance)(nil) @@ -2318,6 +2320,10 @@ func (ext *RTSPExtensionInstance) StreamSelect(url *RTSPUrl) RTSPResult { return goret } +// ConnectSend connects the provided callback to the "send" signal +func (o *RTSPExtensionInstance) ConnectSend(fn func(RTSPExtension, unsafe.Pointer, unsafe.Pointer) RTSPResult) gobject.SignalHandle { + return o.Instance.Connect("send", fn) +} // RTSPAuthCredential wraps GstRTSPAuthCredential // // RTSP Authentication credentials diff --git a/pkg/gsttag/gsttag.gen.go b/pkg/gsttag/gsttag.gen.go index 92a53b1..3220a07 100644 --- a/pkg/gsttag/gsttag.gen.go +++ b/pkg/gsttag/gsttag.gen.go @@ -1647,7 +1647,7 @@ type TagXmpWriterInstance struct { var _ TagXmpWriter = (*TagXmpWriterInstance)(nil) -// TagXmpWriterInstance wraps GstTagXmpWriter +// TagXmpWriter wraps GstTagXmpWriter // // This interface is implemented by elements that are able to do XMP serialization. Examples for // such elements are #jifmux and #qtmux. diff --git a/pkg/gstvideo/gstvideo.gen.go b/pkg/gstvideo/gstvideo.gen.go index cabb0ca..d979632 100644 --- a/pkg/gstvideo/gstvideo.gen.go +++ b/pkg/gstvideo/gstvideo.gen.go @@ -6570,7 +6570,7 @@ type ColorBalanceInstance struct { var _ ColorBalance = (*ColorBalanceInstance)(nil) -// ColorBalanceInstance wraps GstColorBalance +// ColorBalance wraps GstColorBalance // // This interface is implemented by elements which can perform some color // balance operation on video frames they process. For example, modifying @@ -6630,6 +6630,10 @@ type ColorBalance interface { // instance, and the #GstColorBalanceChannel::value-changed signal on the // channel object. ValueChanged(ColorBalanceChannel, int) + // ConnectValueChanged connects the provided callback to the "value-changed" signal + // + // Fired when the value of the indicated channel has changed. + ConnectValueChanged(func(ColorBalance, ColorBalanceChannel, int)) gobject.SignalHandle } var _ ColorBalance = (*ColorBalanceInstance)(nil) @@ -6781,6 +6785,12 @@ func (balance *ColorBalanceInstance) ValueChanged(channel ColorBalanceChannel, v runtime.KeepAlive(value) } +// ConnectValueChanged connects the provided callback to the "value-changed" signal +// +// Fired when the value of the indicated channel has changed. +func (o *ColorBalanceInstance) ConnectValueChanged(fn func(ColorBalance, ColorBalanceChannel, int)) gobject.SignalHandle { + return o.Instance.Connect("value-changed", fn) +} // NavigationInstance is the instance type used by all types implementing GstNavigation. It is used internally by the bindings. Users should use the interface [Navigation] instead. type NavigationInstance struct { _ [0]func() // equal guard @@ -6789,7 +6799,7 @@ type NavigationInstance struct { var _ Navigation = (*NavigationInstance)(nil) -// NavigationInstance wraps GstNavigation +// Navigation wraps GstNavigation // // The Navigation interface is used for creating and injecting navigation // related events such as mouse button presses, cursor motion and key presses. @@ -8441,7 +8451,7 @@ type VideoDirectionInstance struct { var _ VideoDirection = (*VideoDirectionInstance)(nil) -// VideoDirectionInstance wraps GstVideoDirection +// VideoDirection wraps GstVideoDirection // // The interface allows unified access to control flipping and rotation // operations of video-sources or operators. @@ -8495,7 +8505,7 @@ type VideoOrientationInstance struct { var _ VideoOrientation = (*VideoOrientationInstance)(nil) -// VideoOrientationInstance wraps GstVideoOrientation +// VideoOrientation wraps GstVideoOrientation // // The interface allows unified access to control flipping and autocenter // operation of video-sources or operators. @@ -8912,7 +8922,7 @@ type VideoOverlayInstance struct { var _ VideoOverlay = (*VideoOverlayInstance)(nil) -// VideoOverlayInstance wraps GstVideoOverlay +// VideoOverlay wraps GstVideoOverlay // // The #GstVideoOverlay interface is used for 2 main purposes : // @@ -9180,16 +9190,6 @@ type VideoOverlay interface { // Tell an overlay that it has been exposed. This will redraw the current frame // in the drawable even if the pipeline is PAUSED. Expose() - // GotWindowHandle wraps gst_video_overlay_got_window_handle - // - // The function takes the following parameters: - // - // - handle uintptr: a platform-specific handle referencing the window - // - // This will post a "have-window-handle" element message on the bus. - // - // This function should only be used by video overlay plugin developers. - GotWindowHandle(uintptr) // HandleEvents wraps gst_video_overlay_handle_events // // The function takes the following parameters: @@ -9235,17 +9235,6 @@ type VideoOverlay interface { // This method is needed for non fullscreen video overlay in UI toolkits that // do not support subwindows. SetRenderRectangle(int, int, int, int) bool - // SetWindowHandle wraps gst_video_overlay_set_window_handle - // - // The function takes the following parameters: - // - // - handle uintptr: a handle referencing the window. - // - // This will call the video overlay's set_window_handle method. You - // should use this method to tell to an overlay to display video output to a - // specific window (e.g. an XWindow on X11). Passing 0 as the @handle will - // tell the overlay to stop using that window and create an internal one. - SetWindowHandle(uintptr) } var _ VideoOverlay = (*VideoOverlayInstance)(nil) @@ -9343,27 +9332,6 @@ func (overlay *VideoOverlayInstance) Expose() { runtime.KeepAlive(overlay) } -// GotWindowHandle wraps gst_video_overlay_got_window_handle -// -// The function takes the following parameters: -// -// - handle uintptr: a platform-specific handle referencing the window -// -// This will post a "have-window-handle" element message on the bus. -// -// This function should only be used by video overlay plugin developers. -func (overlay *VideoOverlayInstance) GotWindowHandle(handle uintptr) { - var carg0 *C.GstVideoOverlay // in, none, converted - var carg1 C.guintptr // in, none, casted - - carg0 = (*C.GstVideoOverlay)(UnsafeVideoOverlayToGlibNone(overlay)) - carg1 = C.guintptr(handle) - - C.gst_video_overlay_got_window_handle(carg0, carg1) - runtime.KeepAlive(overlay) - runtime.KeepAlive(handle) -} - // HandleEvents wraps gst_video_overlay_handle_events // // The function takes the following parameters: @@ -9459,28 +9427,6 @@ func (overlay *VideoOverlayInstance) SetRenderRectangle(x int, y int, width int, return goret } -// SetWindowHandle wraps gst_video_overlay_set_window_handle -// -// The function takes the following parameters: -// -// - handle uintptr: a handle referencing the window. -// -// This will call the video overlay's set_window_handle method. You -// should use this method to tell to an overlay to display video output to a -// specific window (e.g. an XWindow on X11). Passing 0 as the @handle will -// tell the overlay to stop using that window and create an internal one. -func (overlay *VideoOverlayInstance) SetWindowHandle(handle uintptr) { - var carg0 *C.GstVideoOverlay // in, none, converted - var carg1 C.guintptr // in, none, casted - - carg0 = (*C.GstVideoOverlay)(UnsafeVideoOverlayToGlibNone(overlay)) - carg1 = C.guintptr(handle) - - C.gst_video_overlay_set_window_handle(carg0, carg1) - runtime.KeepAlive(overlay) - runtime.KeepAlive(handle) -} - // ColorBalanceChannelInstance is the instance type used by all types extending GstColorBalanceChannel. It is used internally by the bindings. Users should use the interface [ColorBalanceChannel] instead. type ColorBalanceChannelInstance struct { _ [0]func() // equal guard @@ -9497,6 +9443,11 @@ var _ ColorBalanceChannel = (*ColorBalanceChannelInstance)(nil) type ColorBalanceChannel interface { gobject.Object upcastToGstColorBalanceChannel() *ColorBalanceChannelInstance + + // ConnectValueChanged connects the provided callback to the "value-changed" signal + // + // Fired when the value of the indicated channel has changed. + ConnectValueChanged(func(ColorBalanceChannel, int)) gobject.SignalHandle } func unsafeWrapColorBalanceChannel(base *gobject.ObjectInstance) *ColorBalanceChannelInstance { @@ -9533,6 +9484,12 @@ func UnsafeColorBalanceChannelToGlibFull(c ColorBalanceChannel) unsafe.Pointer { return gobject.UnsafeObjectToGlibFull(c) } +// ConnectValueChanged connects the provided callback to the "value-changed" signal +// +// Fired when the value of the indicated channel has changed. +func (o *ColorBalanceChannelInstance) ConnectValueChanged(fn func(ColorBalanceChannel, int)) gobject.SignalHandle { + return o.Connect("value-changed", fn) +} // VideoAggregatorInstance is the instance type used by all types extending GstVideoAggregator. It is used internally by the bindings. Users should use the interface [VideoAggregator] instead. type VideoAggregatorInstance struct { _ [0]func() // equal guard @@ -15402,41 +15359,6 @@ func UnsafeVideoDitherToGlibFull(v *VideoDither) unsafe.Pointer { v.native = nil // VideoDither is invalid from here on return _p } -// Line wraps gst_video_dither_line -// -// The function takes the following parameters: -// -// - line unsafe.Pointer (nullable): pointer to the pixels of the line -// - x uint: x coordinate -// - y uint: y coordinate -// - width uint: the width -// -// Dither @width pixels starting from offset @x in @line using @dither. -// -// @y is the line number of @line in the output image. -func (dither *VideoDither) Line(line unsafe.Pointer, x uint, y uint, width uint) { - var carg0 *C.GstVideoDither // in, none, converted - var carg1 C.gpointer // in, none, casted, nullable - var carg2 C.guint // in, none, casted - var carg3 C.guint // in, none, casted - var carg4 C.guint // in, none, casted - - carg0 = (*C.GstVideoDither)(UnsafeVideoDitherToGlibNone(dither)) - if line != nil { - carg1 = C.gpointer(line) - } - carg2 = C.guint(x) - carg3 = C.guint(y) - carg4 = C.guint(width) - - C.gst_video_dither_line(carg0, carg1, carg2, carg3, carg4) - runtime.KeepAlive(dither) - runtime.KeepAlive(line) - runtime.KeepAlive(x) - runtime.KeepAlive(y) - runtime.KeepAlive(width) -} - // VideoEncoderClass wraps GstVideoEncoderClass // // Subclasses can override any of the available virtual methods or not, as @@ -16876,57 +16798,6 @@ func UnsafeVideoMetaToGlibFull(v *VideoMeta) unsafe.Pointer { v.native = nil // VideoMeta is invalid from here on return _p } -// Map wraps gst_video_meta_map -// -// The function takes the following parameters: -// -// - plane uint: a plane -// - info *gst.MapInfo: a #GstMapInfo -// - flags gst.MapFlags: @GstMapFlags -// -// The function returns the following values: -// -// - data unsafe.Pointer (nullable): the data of @plane -// - stride int: the stride of @plane -// - goret bool -// -// Map the video plane with index @plane in @meta and return a pointer to the -// first byte of the plane and the stride of the plane. -func (meta *VideoMeta) Map(plane uint, info *gst.MapInfo, flags gst.MapFlags) (unsafe.Pointer, int, bool) { - var carg0 *C.GstVideoMeta // in, none, converted - var carg1 C.guint // in, none, casted - var carg2 *C.GstMapInfo // in, none, converted - var carg5 C.GstMapFlags // in, none, casted - var carg3 C.gpointer // out, full, casted, nullable - var carg4 C.gint // out, full, casted - var cret C.gboolean // return - - carg0 = (*C.GstVideoMeta)(UnsafeVideoMetaToGlibNone(meta)) - carg1 = C.guint(plane) - carg2 = (*C.GstMapInfo)(gst.UnsafeMapInfoToGlibNone(info)) - carg5 = C.GstMapFlags(flags) - - cret = C.gst_video_meta_map(carg0, carg1, carg2, &carg3, &carg4, carg5) - runtime.KeepAlive(meta) - runtime.KeepAlive(plane) - runtime.KeepAlive(info) - runtime.KeepAlive(flags) - - var data unsafe.Pointer - var stride int - var goret bool - - if carg3 != nil { - data = unsafe.Pointer(carg3) - } - stride = int(carg4) - if cret != 0 { - goret = true - } - - return data, stride, goret -} - // SetAlignment wraps gst_video_meta_set_alignment // // The function takes the following parameters: @@ -18560,72 +18431,6 @@ func UnsafeVideoScalerToGlibFull(v *VideoScaler) unsafe.Pointer { v.native = nil // VideoScaler is invalid from here on return _p } -// Gotk2D wraps gst_video_scaler_2d -// -// The function takes the following parameters: -// -// - vscale *VideoScaler: a vertical #GstVideoScaler -// - format VideoFormat: a #GstVideoFormat for @srcs and @dest -// - src unsafe.Pointer (nullable): source pixels -// - srcStride int: source pixels stride -// - dest unsafe.Pointer (nullable): destination pixels -// - destStride int: destination pixels stride -// - x uint: the horizontal destination offset -// - y uint: the vertical destination offset -// - width uint: the number of output pixels to scale -// - height uint: the number of output lines to scale -// -// Scale a rectangle of pixels in @src with @src_stride to @dest with -// @dest_stride using the horizontal scaler @hscaler and the vertical -// scaler @vscale. -// -// One or both of @hscale and @vscale can be NULL to only perform scaling in -// one dimension or do a copy without scaling. -// -// @x and @y are the coordinates in the destination image to process. -func (hscale *VideoScaler) Gotk2D(vscale *VideoScaler, format VideoFormat, src unsafe.Pointer, srcStride int, dest unsafe.Pointer, destStride int, x uint, y uint, width uint, height uint) { - var carg0 *C.GstVideoScaler // in, none, converted - var carg1 *C.GstVideoScaler // in, none, converted - var carg2 C.GstVideoFormat // in, none, casted - var carg3 C.gpointer // in, none, casted, nullable - var carg4 C.gint // in, none, casted - var carg5 C.gpointer // in, none, casted, nullable - var carg6 C.gint // in, none, casted - var carg7 C.guint // in, none, casted - var carg8 C.guint // in, none, casted - var carg9 C.guint // in, none, casted - var carg10 C.guint // in, none, casted - - carg0 = (*C.GstVideoScaler)(UnsafeVideoScalerToGlibNone(hscale)) - carg1 = (*C.GstVideoScaler)(UnsafeVideoScalerToGlibNone(vscale)) - carg2 = C.GstVideoFormat(format) - if src != nil { - carg3 = C.gpointer(src) - } - carg4 = C.gint(srcStride) - if dest != nil { - carg5 = C.gpointer(dest) - } - carg6 = C.gint(destStride) - carg7 = C.guint(x) - carg8 = C.guint(y) - carg9 = C.guint(width) - carg10 = C.guint(height) - - C.gst_video_scaler_2d(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8, carg9, carg10) - runtime.KeepAlive(hscale) - runtime.KeepAlive(vscale) - runtime.KeepAlive(format) - runtime.KeepAlive(src) - runtime.KeepAlive(srcStride) - runtime.KeepAlive(dest) - runtime.KeepAlive(destStride) - runtime.KeepAlive(x) - runtime.KeepAlive(y) - runtime.KeepAlive(width) - runtime.KeepAlive(height) -} - // GetCoeff wraps gst_video_scaler_get_coeff // // The function takes the following parameters: @@ -18692,89 +18497,6 @@ func (scale *VideoScaler) GetMaxTaps() uint { return goret } -// Horizontal wraps gst_video_scaler_horizontal -// -// The function takes the following parameters: -// -// - format VideoFormat: a #GstVideoFormat for @src and @dest -// - src unsafe.Pointer (nullable): source pixels -// - dest unsafe.Pointer (nullable): destination pixels -// - destOffset uint: the horizontal destination offset -// - width uint: the number of pixels to scale -// -// Horizontally scale the pixels in @src to @dest, starting from @dest_offset -// for @width samples. -func (scale *VideoScaler) Horizontal(format VideoFormat, src unsafe.Pointer, dest unsafe.Pointer, destOffset uint, width uint) { - var carg0 *C.GstVideoScaler // in, none, converted - var carg1 C.GstVideoFormat // in, none, casted - var carg2 C.gpointer // in, none, casted, nullable - var carg3 C.gpointer // in, none, casted, nullable - var carg4 C.guint // in, none, casted - var carg5 C.guint // in, none, casted - - carg0 = (*C.GstVideoScaler)(UnsafeVideoScalerToGlibNone(scale)) - carg1 = C.GstVideoFormat(format) - if src != nil { - carg2 = C.gpointer(src) - } - if dest != nil { - carg3 = C.gpointer(dest) - } - carg4 = C.guint(destOffset) - carg5 = C.guint(width) - - C.gst_video_scaler_horizontal(carg0, carg1, carg2, carg3, carg4, carg5) - runtime.KeepAlive(scale) - runtime.KeepAlive(format) - runtime.KeepAlive(src) - runtime.KeepAlive(dest) - runtime.KeepAlive(destOffset) - runtime.KeepAlive(width) -} - -// Vertical wraps gst_video_scaler_vertical -// -// The function takes the following parameters: -// -// - format VideoFormat: a #GstVideoFormat for @srcs and @dest -// - srcLines *unsafe.Pointer (nullable): source pixels lines -// - dest unsafe.Pointer (nullable): destination pixels -// - destOffset uint: the vertical destination offset -// - width uint: the number of pixels to scale -// -// Vertically combine @width pixels in the lines in @src_lines to @dest. -// @dest is the location of the target line at @dest_offset and -// @srcs are the input lines for @dest_offset. -func (scale *VideoScaler) Vertical(format VideoFormat, srcLines *unsafe.Pointer, dest unsafe.Pointer, destOffset uint, width uint) { - var carg0 *C.GstVideoScaler // in, none, converted - var carg1 C.GstVideoFormat // in, none, casted - var carg2 *C.gpointer // in, transfer: none, C Pointers: 1, Name: gpointer, nullable, nullable - var carg3 C.gpointer // in, none, casted, nullable - var carg4 C.guint // in, none, casted - var carg5 C.guint // in, none, casted - - carg0 = (*C.GstVideoScaler)(UnsafeVideoScalerToGlibNone(scale)) - carg1 = C.GstVideoFormat(format) - if srcLines != nil { - _ = srcLines - _ = carg2 - panic("unimplemented conversion of *unsafe.Pointer (gpointer*)") - } - if dest != nil { - carg3 = C.gpointer(dest) - } - carg4 = C.guint(destOffset) - carg5 = C.guint(width) - - C.gst_video_scaler_vertical(carg0, carg1, carg2, carg3, carg4, carg5) - runtime.KeepAlive(scale) - runtime.KeepAlive(format) - runtime.KeepAlive(srcLines) - runtime.KeepAlive(dest) - runtime.KeepAlive(destOffset) - runtime.KeepAlive(width) -} - // VideoSinkClass wraps GstVideoSinkClass // // The video sink class structure. Derived classes should override the diff --git a/pkg/gstwebrtc/gstwebrtc.gen.go b/pkg/gstwebrtc/gstwebrtc.gen.go index ddfd543..54e63cc 100644 --- a/pkg/gstwebrtc/gstwebrtc.gen.go +++ b/pkg/gstwebrtc/gstwebrtc.gen.go @@ -1134,6 +1134,26 @@ type WebRTCDataChannel interface { // // Send @str as a string message over @channel. SendStringFull(string) (bool, error) + // EmitClose emits the "close" signal + // + // Close the data channel + EmitClose() + // ConnectOnBufferedAmountLow connects the provided callback to the "on-buffered-amount-low" signal + ConnectOnBufferedAmountLow(func(WebRTCDataChannel)) gobject.SignalHandle + // ConnectOnClose connects the provided callback to the "on-close" signal + ConnectOnClose(func(WebRTCDataChannel)) gobject.SignalHandle + // ConnectOnError connects the provided callback to the "on-error" signal + ConnectOnError(func(WebRTCDataChannel, error)) gobject.SignalHandle + // ConnectOnMessageData connects the provided callback to the "on-message-data" signal + ConnectOnMessageData(func(WebRTCDataChannel, glib.Bytes)) gobject.SignalHandle + // ConnectOnMessageString connects the provided callback to the "on-message-string" signal + ConnectOnMessageString(func(WebRTCDataChannel, string)) gobject.SignalHandle + // ConnectOnOpen connects the provided callback to the "on-open" signal + ConnectOnOpen(func(WebRTCDataChannel)) gobject.SignalHandle + // EmitSendData emits the "send-data" signal + EmitSendData(glib.Bytes) + // EmitSendString emits the "send-string" signal + EmitSendString(string) } func unsafeWrapWebRTCDataChannel(base *gobject.ObjectInstance) *WebRTCDataChannelInstance { @@ -1306,6 +1326,44 @@ func (channel *WebRTCDataChannelInstance) SendStringFull(str string) (bool, erro return goret, _goerr } +// EmitClose emits the "close" signal +// +// Close the data channel +func (o *WebRTCDataChannelInstance) EmitClose() { + o.Emit("close") +} +// ConnectOnBufferedAmountLow connects the provided callback to the "on-buffered-amount-low" signal +func (o *WebRTCDataChannelInstance) ConnectOnBufferedAmountLow(fn func(WebRTCDataChannel)) gobject.SignalHandle { + return o.Connect("on-buffered-amount-low", fn) +} +// ConnectOnClose connects the provided callback to the "on-close" signal +func (o *WebRTCDataChannelInstance) ConnectOnClose(fn func(WebRTCDataChannel)) gobject.SignalHandle { + return o.Connect("on-close", fn) +} +// ConnectOnError connects the provided callback to the "on-error" signal +func (o *WebRTCDataChannelInstance) ConnectOnError(fn func(WebRTCDataChannel, error)) gobject.SignalHandle { + return o.Connect("on-error", fn) +} +// ConnectOnMessageData connects the provided callback to the "on-message-data" signal +func (o *WebRTCDataChannelInstance) ConnectOnMessageData(fn func(WebRTCDataChannel, glib.Bytes)) gobject.SignalHandle { + return o.Connect("on-message-data", fn) +} +// ConnectOnMessageString connects the provided callback to the "on-message-string" signal +func (o *WebRTCDataChannelInstance) ConnectOnMessageString(fn func(WebRTCDataChannel, string)) gobject.SignalHandle { + return o.Connect("on-message-string", fn) +} +// ConnectOnOpen connects the provided callback to the "on-open" signal +func (o *WebRTCDataChannelInstance) ConnectOnOpen(fn func(WebRTCDataChannel)) gobject.SignalHandle { + return o.Connect("on-open", fn) +} +// EmitSendData emits the "send-data" signal +func (o *WebRTCDataChannelInstance) EmitSendData(arg0 glib.Bytes) { + o.Emit("send-data", arg0) +} +// EmitSendString emits the "send-string" signal +func (o *WebRTCDataChannelInstance) EmitSendString(arg0 string) { + o.Emit("send-string", arg0) +} // WebRTCICEInstance is the instance type used by all types extending GstWebRTCICE. It is used internally by the bindings. Users should use the interface [WebRTCICE] instead. type WebRTCICEInstance struct { _ [0]func() // equal guard @@ -1490,6 +1548,12 @@ type WebRTCICE interface { // // - uri string (nullable): URI of the TURN sever SetTurnServer(string) + // EmitAddLocalIPAddress emits the "add-local-ip-address" signal + // + // Add a local IP address to use for ICE candidate gathering. If none + // are supplied, they will be discovered automatically. Calling this signal + // stops automatic ICE gathering. + EmitAddLocalIPAddress(string) bool } func unsafeWrapWebRTCICE(base *gobject.ObjectInstance) *WebRTCICEInstance { @@ -2083,6 +2147,15 @@ func (ice *WebRTCICEInstance) SetTurnServer(uri string) { runtime.KeepAlive(uri) } +// EmitAddLocalIPAddress emits the "add-local-ip-address" signal +// +// Add a local IP address to use for ICE candidate gathering. If none +// are supplied, they will be discovered automatically. Calling this signal +// stops automatic ICE gathering. +func (o *WebRTCICEInstance) EmitAddLocalIPAddress(arg0 string) bool { + return + o.Emit("add-local-ip-address", arg0) +} // WebRTCICEStreamInstance is the instance type used by all types extending GstWebRTCICEStream. It is used internally by the bindings. Users should use the interface [WebRTCICEStream] instead. type WebRTCICEStreamInstance struct { _ [0]func() // equal guard @@ -2236,6 +2309,10 @@ type WebRTCICETransport interface { NewCandidate(uint, WebRTCICEComponent, string) // SelectedPairChange wraps gst_webrtc_ice_transport_selected_pair_change SelectedPairChange() + // ConnectOnNewCandidate connects the provided callback to the "on-new-candidate" signal + ConnectOnNewCandidate(func(WebRTCICETransport, string)) gobject.SignalHandle + // ConnectOnSelectedCandidatePairChange connects the provided callback to the "on-selected-candidate-pair-change" signal + ConnectOnSelectedCandidatePairChange(func(WebRTCICETransport)) gobject.SignalHandle } func unsafeWrapWebRTCICETransport(base *gobject.ObjectInstance) *WebRTCICETransportInstance { @@ -2346,6 +2423,14 @@ func (ice *WebRTCICETransportInstance) SelectedPairChange() { runtime.KeepAlive(ice) } +// ConnectOnNewCandidate connects the provided callback to the "on-new-candidate" signal +func (o *WebRTCICETransportInstance) ConnectOnNewCandidate(fn func(WebRTCICETransport, string)) gobject.SignalHandle { + return o.Connect("on-new-candidate", fn) +} +// ConnectOnSelectedCandidatePairChange connects the provided callback to the "on-selected-candidate-pair-change" signal +func (o *WebRTCICETransportInstance) ConnectOnSelectedCandidatePairChange(fn func(WebRTCICETransport)) gobject.SignalHandle { + return o.Connect("on-selected-candidate-pair-change", fn) +} // WebRTCRTPReceiverInstance is the instance type used by all types extending GstWebRTCRTPReceiver. It is used internally by the bindings. Users should use the interface [WebRTCRTPReceiver] instead. type WebRTCRTPReceiverInstance struct { _ [0]func() // equal guard