Files
go-gst/pkg/gst/gst.gen.go

60973 lines
1.9 MiB

// Code generated by girgen. DO NOT EDIT.
package gst
import (
"fmt"
"runtime"
"strings"
"unsafe"
"github.com/diamondburned/gotk4/pkg/core/userdata"
"github.com/diamondburned/gotk4/pkg/glib/v2"
"github.com/diamondburned/gotk4/pkg/gobject/v2"
)
// #cgo pkg-config: gstreamer-1.0
// #cgo CFLAGS: -Wno-deprecated-declarations
// #include <gst/gst.h>
// extern GstBusSyncReply _gotk4_gst1_BusSyncHandler(GstBus*, GstMessage*, gpointer);
// extern GstPadProbeReturn _gotk4_gst1_PadProbeCallback(GstPad*, GstPadProbeInfo*, gpointer);
// extern gboolean _gotk4_gst1_BufferForEachMetaFunc(GstBuffer*, GstMeta*, gpointer);
// extern gboolean _gotk4_gst1_BufferListFunc(GstBuffer*, guint, gpointer);
// extern gboolean _gotk4_gst1_BusFunc(GstBus*, GstMessage*, gpointer);
// extern gboolean _gotk4_gst1_CapsFilterMapFunc(GstCapsFeatures*, GstStructure*, gpointer);
// extern gboolean _gotk4_gst1_CapsForEachFunc(GstCapsFeatures*, GstStructure*, gpointer);
// extern gboolean _gotk4_gst1_CapsMapFunc(GstCapsFeatures*, GstStructure*, gpointer);
// extern gboolean _gotk4_gst1_ClockCallback(GstClock*, GstClockTime, GstClockID, gpointer);
// extern gboolean _gotk4_gst1_ElementForEachPadFunc(GstElement*, GstPad*, gpointer);
// extern gboolean _gotk4_gst1_IteratorFoldFunction(GValue*, GValue*, gpointer);
// extern gboolean _gotk4_gst1_PadForwardFunction(GstPad*, gpointer);
// extern gboolean _gotk4_gst1_PluginInitFullFunc(GstPlugin*, gpointer);
// 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"
// GType values.
var (
TypeBufferingMode = gobject.Type(C.gst_buffering_mode_get_type())
TypeBusSyncReply = gobject.Type(C.gst_bus_sync_reply_get_type())
TypeCapsIntersectMode = gobject.Type(C.gst_caps_intersect_mode_get_type())
TypeClockEntryType = gobject.Type(C.gst_clock_entry_type_get_type())
TypeClockReturn = gobject.Type(C.gst_clock_return_get_type())
TypeClockType = gobject.Type(C.gst_clock_type_get_type())
TypeCoreError = gobject.Type(C.gst_core_error_get_type())
TypeDebugColorMode = gobject.Type(C.gst_debug_color_mode_get_type())
TypeDebugLevel = gobject.Type(C.gst_debug_level_get_type())
TypeEventType = gobject.Type(C.gst_event_type_get_type())
TypeFlowReturn = gobject.Type(C.gst_flow_return_get_type())
TypeFormat = gobject.Type(C.gst_format_get_type())
TypeIteratorItem = gobject.Type(C.gst_iterator_item_get_type())
TypeIteratorResult = gobject.Type(C.gst_iterator_result_get_type())
TypeLibraryError = gobject.Type(C.gst_library_error_get_type())
TypePadDirection = gobject.Type(C.gst_pad_direction_get_type())
TypePadLinkReturn = gobject.Type(C.gst_pad_link_return_get_type())
TypePadMode = gobject.Type(C.gst_pad_mode_get_type())
TypePadPresence = gobject.Type(C.gst_pad_presence_get_type())
TypePadProbeReturn = gobject.Type(C.gst_pad_probe_return_get_type())
TypeParseError = gobject.Type(C.gst_parse_error_get_type())
TypePluginError = gobject.Type(C.gst_plugin_error_get_type())
TypeProgressType = gobject.Type(C.gst_progress_type_get_type())
TypePromiseResult = gobject.Type(C.gst_promise_result_get_type())
TypeQOSType = gobject.Type(C.gst_qos_type_get_type())
TypeQueryType = gobject.Type(C.gst_query_type_get_type())
TypeRank = gobject.Type(C.gst_rank_get_type())
TypeResourceError = gobject.Type(C.gst_resource_error_get_type())
TypeSearchMode = gobject.Type(C.gst_search_mode_get_type())
TypeSeekType = gobject.Type(C.gst_seek_type_get_type())
TypeState = gobject.Type(C.gst_state_get_type())
TypeStateChange = gobject.Type(C.gst_state_change_get_type())
TypeStateChangeReturn = gobject.Type(C.gst_state_change_return_get_type())
TypeStreamError = gobject.Type(C.gst_stream_error_get_type())
TypeStreamStatusType = gobject.Type(C.gst_stream_status_type_get_type())
TypeStructureChangeType = gobject.Type(C.gst_structure_change_type_get_type())
TypeTagFlag = gobject.Type(C.gst_tag_flag_get_type())
TypeTagMergeMode = gobject.Type(C.gst_tag_merge_mode_get_type())
TypeTagScope = gobject.Type(C.gst_tag_scope_get_type())
TypeTaskState = gobject.Type(C.gst_task_state_get_type())
TypeTocEntryType = gobject.Type(C.gst_toc_entry_type_get_type())
TypeTocLoopType = gobject.Type(C.gst_toc_loop_type_get_type())
TypeTocScope = gobject.Type(C.gst_toc_scope_get_type())
TypeTracerValueScope = gobject.Type(C.gst_tracer_value_scope_get_type())
TypeTypeFindProbability = gobject.Type(C.gst_type_find_probability_get_type())
TypeURIError = gobject.Type(C.gst_uri_error_get_type())
TypeURIType = gobject.Type(C.gst_uri_type_get_type())
TypeAllocatorFlags = gobject.Type(C.gst_allocator_flags_get_type())
TypeBinFlags = gobject.Type(C.gst_bin_flags_get_type())
TypeBufferCopyFlagsType = gobject.Type(C.gst_buffer_copy_flags_get_type())
TypeBufferFlags = gobject.Type(C.gst_buffer_flags_get_type())
TypeBufferPoolAcquireFlags = gobject.Type(C.gst_buffer_pool_acquire_flags_get_type())
TypeBusFlags = gobject.Type(C.gst_bus_flags_get_type())
TypeCapsFlags = gobject.Type(C.gst_caps_flags_get_type())
TypeClockFlags = gobject.Type(C.gst_clock_flags_get_type())
TypeDebugColorFlags = gobject.Type(C.gst_debug_color_flags_get_type())
TypeDebugGraphDetails = gobject.Type(C.gst_debug_graph_details_get_type())
TypeElementFlags = gobject.Type(C.gst_element_flags_get_type())
TypeEventTypeFlags = gobject.Type(C.gst_event_type_flags_get_type())
TypeGapFlags = gobject.Type(C.gst_gap_flags_get_type())
TypeLockFlags = gobject.Type(C.gst_lock_flags_get_type())
TypeMapFlags = gobject.Type(C.gst_map_flags_get_type())
TypeMemoryFlags = gobject.Type(C.gst_memory_flags_get_type())
TypeMessageType = gobject.Type(C.gst_message_type_get_type())
TypeMetaFlags = gobject.Type(C.gst_meta_flags_get_type())
TypeMiniObjectFlags = gobject.Type(C.gst_mini_object_flags_get_type())
TypeObjectFlags = gobject.Type(C.gst_object_flags_get_type())
TypePadFlags = gobject.Type(C.gst_pad_flags_get_type())
TypePadLinkCheck = gobject.Type(C.gst_pad_link_check_get_type())
TypePadProbeType = gobject.Type(C.gst_pad_probe_type_get_type())
TypePadTemplateFlags = gobject.Type(C.gst_pad_template_flags_get_type())
TypeParseFlags = gobject.Type(C.gst_parse_flags_get_type())
TypePipelineFlags = gobject.Type(C.gst_pipeline_flags_get_type())
TypePluginAPIFlags = gobject.Type(C.gst_plugin_api_flags_get_type())
TypePluginDependencyFlags = gobject.Type(C.gst_plugin_dependency_flags_get_type())
TypePluginFlags = gobject.Type(C.gst_plugin_flags_get_type())
TypeQueryTypeFlags = gobject.Type(C.gst_query_type_flags_get_type())
TypeSchedulingFlags = gobject.Type(C.gst_scheduling_flags_get_type())
TypeSeekFlags = gobject.Type(C.gst_seek_flags_get_type())
TypeSegmentFlags = gobject.Type(C.gst_segment_flags_get_type())
TypeSerializeFlags = gobject.Type(C.gst_serialize_flags_get_type())
TypeStackTraceFlags = gobject.Type(C.gst_stack_trace_flags_get_type())
TypeStreamFlags = gobject.Type(C.gst_stream_flags_get_type())
TypeStreamType = gobject.Type(C.gst_stream_type_get_type())
TypeTracerValueFlags = gobject.Type(C.gst_tracer_value_flags_get_type())
TypeChildProxy = gobject.Type(C.gst_child_proxy_get_type())
TypePreset = gobject.Type(C.gst_preset_get_type())
TypeURIHandler = gobject.Type(C.gst_uri_handler_get_type())
TypeTagSetter = gobject.Type(C.gst_tag_setter_get_type())
TypeTocSetter = gobject.Type(C.gst_toc_setter_get_type())
TypeObject = gobject.Type(C.gst_object_get_type())
TypePad = gobject.Type(C.gst_pad_get_type())
TypePadTemplate = gobject.Type(C.gst_pad_template_get_type())
TypePlugin = gobject.Type(C.gst_plugin_get_type())
TypePluginFeature = gobject.Type(C.gst_plugin_feature_get_type())
TypeProxyPad = gobject.Type(C.gst_proxy_pad_get_type())
TypeRegistry = gobject.Type(C.gst_registry_get_type())
TypeStream = gobject.Type(C.gst_stream_get_type())
TypeStreamCollection = gobject.Type(C.gst_stream_collection_get_type())
TypeTask = gobject.Type(C.gst_task_get_type())
TypeTaskPool = gobject.Type(C.gst_task_pool_get_type())
TypeTracer = gobject.Type(C.gst_tracer_get_type())
TypeTracerFactory = gobject.Type(C.gst_tracer_factory_get_type())
TypeTracerRecord = gobject.Type(C.gst_tracer_record_get_type())
TypeTypeFindFactory = gobject.Type(C.gst_type_find_factory_get_type())
TypeAllocator = gobject.Type(C.gst_allocator_get_type())
TypeBufferPool = gobject.Type(C.gst_buffer_pool_get_type())
TypeBus = gobject.Type(C.gst_bus_get_type())
TypeClock = gobject.Type(C.gst_clock_get_type())
TypeControlBinding = gobject.Type(C.gst_control_binding_get_type())
TypeControlSource = gobject.Type(C.gst_control_source_get_type())
TypeDevice = gobject.Type(C.gst_device_get_type())
TypeDeviceMonitor = gobject.Type(C.gst_device_monitor_get_type())
TypeDeviceProvider = gobject.Type(C.gst_device_provider_get_type())
TypeDeviceProviderFactory = gobject.Type(C.gst_device_provider_factory_get_type())
TypeDynamicTypeFactory = gobject.Type(C.gst_dynamic_type_factory_get_type())
TypeElement = gobject.Type(C.gst_element_get_type())
TypeElementFactory = gobject.Type(C.gst_element_factory_get_type())
TypeGhostPad = gobject.Type(C.gst_ghost_pad_get_type())
TypeSharedTaskPool = gobject.Type(C.gst_shared_task_pool_get_type())
TypeSystemClock = gobject.Type(C.gst_system_clock_get_type())
TypeBin = gobject.Type(C.gst_bin_get_type())
TypePipeline = gobject.Type(C.gst_pipeline_get_type())
TypeAllocationParams = gobject.Type(C.gst_allocation_params_get_type())
TypeAtomicQueue = gobject.Type(C.gst_atomic_queue_get_type())
TypeBuffer = gobject.Type(C.gst_buffer_get_type())
TypeBufferList = gobject.Type(C.gst_buffer_list_get_type())
TypeCaps = gobject.Type(C.gst_caps_get_type())
TypeCapsFeatures = gobject.Type(C.gst_caps_features_get_type())
TypeContext = gobject.Type(C.gst_context_get_type())
TypeDateTime = gobject.Type(C.gst_date_time_get_type())
TypeEvent = gobject.Type(C.gst_event_get_type())
TypeIterator = gobject.Type(C.gst_iterator_get_type())
TypeMemory = gobject.Type(C.gst_memory_get_type())
TypeMessage = gobject.Type(C.gst_message_get_type())
TypeMiniObject = gobject.Type(C.gst_mini_object_get_type())
TypeParseContext = gobject.Type(C.gst_parse_context_get_type())
TypePromise = gobject.Type(C.gst_promise_get_type())
TypeQuery = gobject.Type(C.gst_query_get_type())
TypeSample = gobject.Type(C.gst_sample_get_type())
TypeSegment = gobject.Type(C.gst_segment_get_type())
TypeStaticCaps = gobject.Type(C.gst_static_caps_get_type())
TypeStaticPadTemplate = gobject.Type(C.gst_static_pad_template_get_type())
TypeStructure = gobject.Type(C.gst_structure_get_type())
TypeTagList = gobject.Type(C.gst_tag_list_get_type())
TypeToc = gobject.Type(C.gst_toc_get_type())
TypeTocEntry = gobject.Type(C.gst_toc_entry_get_type())
TypeTypeFind = gobject.Type(C.gst_type_find_get_type())
TypeUri = gobject.Type(C.gst_uri_get_type())
)
func init() {
gobject.RegisterGValueMarshalers([]gobject.TypeMarshaler{
gobject.TypeMarshaler{T: TypeBufferingMode, F: marshalBufferingMode},
gobject.TypeMarshaler{T: TypeBusSyncReply, F: marshalBusSyncReply},
gobject.TypeMarshaler{T: TypeCapsIntersectMode, F: marshalCapsIntersectMode},
gobject.TypeMarshaler{T: TypeClockEntryType, F: marshalClockEntryType},
gobject.TypeMarshaler{T: TypeClockReturn, F: marshalClockReturn},
gobject.TypeMarshaler{T: TypeClockType, F: marshalClockType},
gobject.TypeMarshaler{T: TypeCoreError, F: marshalCoreError},
gobject.TypeMarshaler{T: TypeDebugColorMode, F: marshalDebugColorMode},
gobject.TypeMarshaler{T: TypeDebugLevel, F: marshalDebugLevel},
gobject.TypeMarshaler{T: TypeEventType, F: marshalEventType},
gobject.TypeMarshaler{T: TypeFlowReturn, F: marshalFlowReturn},
gobject.TypeMarshaler{T: TypeFormat, F: marshalFormat},
gobject.TypeMarshaler{T: TypeIteratorItem, F: marshalIteratorItem},
gobject.TypeMarshaler{T: TypeIteratorResult, F: marshalIteratorResult},
gobject.TypeMarshaler{T: TypeLibraryError, F: marshalLibraryError},
gobject.TypeMarshaler{T: TypePadDirection, F: marshalPadDirection},
gobject.TypeMarshaler{T: TypePadLinkReturn, F: marshalPadLinkReturn},
gobject.TypeMarshaler{T: TypePadMode, F: marshalPadMode},
gobject.TypeMarshaler{T: TypePadPresence, F: marshalPadPresence},
gobject.TypeMarshaler{T: TypePadProbeReturn, F: marshalPadProbeReturn},
gobject.TypeMarshaler{T: TypeParseError, F: marshalParseError},
gobject.TypeMarshaler{T: TypePluginError, F: marshalPluginError},
gobject.TypeMarshaler{T: TypeProgressType, F: marshalProgressType},
gobject.TypeMarshaler{T: TypePromiseResult, F: marshalPromiseResult},
gobject.TypeMarshaler{T: TypeQOSType, F: marshalQOSType},
gobject.TypeMarshaler{T: TypeQueryType, F: marshalQueryType},
gobject.TypeMarshaler{T: TypeRank, F: marshalRank},
gobject.TypeMarshaler{T: TypeResourceError, F: marshalResourceError},
gobject.TypeMarshaler{T: TypeSearchMode, F: marshalSearchMode},
gobject.TypeMarshaler{T: TypeSeekType, F: marshalSeekType},
gobject.TypeMarshaler{T: TypeState, F: marshalState},
gobject.TypeMarshaler{T: TypeStateChange, F: marshalStateChange},
gobject.TypeMarshaler{T: TypeStateChangeReturn, F: marshalStateChangeReturn},
gobject.TypeMarshaler{T: TypeStreamError, F: marshalStreamError},
gobject.TypeMarshaler{T: TypeStreamStatusType, F: marshalStreamStatusType},
gobject.TypeMarshaler{T: TypeStructureChangeType, F: marshalStructureChangeType},
gobject.TypeMarshaler{T: TypeTagFlag, F: marshalTagFlag},
gobject.TypeMarshaler{T: TypeTagMergeMode, F: marshalTagMergeMode},
gobject.TypeMarshaler{T: TypeTagScope, F: marshalTagScope},
gobject.TypeMarshaler{T: TypeTaskState, F: marshalTaskState},
gobject.TypeMarshaler{T: TypeTocEntryType, F: marshalTocEntryType},
gobject.TypeMarshaler{T: TypeTocLoopType, F: marshalTocLoopType},
gobject.TypeMarshaler{T: TypeTocScope, F: marshalTocScope},
gobject.TypeMarshaler{T: TypeTracerValueScope, F: marshalTracerValueScope},
gobject.TypeMarshaler{T: TypeTypeFindProbability, F: marshalTypeFindProbability},
gobject.TypeMarshaler{T: TypeURIError, F: marshalURIError},
gobject.TypeMarshaler{T: TypeURIType, F: marshalURIType},
gobject.TypeMarshaler{T: TypeAllocatorFlags, F: marshalAllocatorFlags},
gobject.TypeMarshaler{T: TypeBinFlags, F: marshalBinFlags},
gobject.TypeMarshaler{T: TypeBufferCopyFlagsType, F: marshalBufferCopyFlagsType},
gobject.TypeMarshaler{T: TypeBufferFlags, F: marshalBufferFlags},
gobject.TypeMarshaler{T: TypeBufferPoolAcquireFlags, F: marshalBufferPoolAcquireFlags},
gobject.TypeMarshaler{T: TypeBusFlags, F: marshalBusFlags},
gobject.TypeMarshaler{T: TypeCapsFlags, F: marshalCapsFlags},
gobject.TypeMarshaler{T: TypeClockFlags, F: marshalClockFlags},
gobject.TypeMarshaler{T: TypeDebugColorFlags, F: marshalDebugColorFlags},
gobject.TypeMarshaler{T: TypeDebugGraphDetails, F: marshalDebugGraphDetails},
gobject.TypeMarshaler{T: TypeElementFlags, F: marshalElementFlags},
gobject.TypeMarshaler{T: TypeEventTypeFlags, F: marshalEventTypeFlags},
gobject.TypeMarshaler{T: TypeGapFlags, F: marshalGapFlags},
gobject.TypeMarshaler{T: TypeLockFlags, F: marshalLockFlags},
gobject.TypeMarshaler{T: TypeMapFlags, F: marshalMapFlags},
gobject.TypeMarshaler{T: TypeMemoryFlags, F: marshalMemoryFlags},
gobject.TypeMarshaler{T: TypeMessageType, F: marshalMessageType},
gobject.TypeMarshaler{T: TypeMetaFlags, F: marshalMetaFlags},
gobject.TypeMarshaler{T: TypeMiniObjectFlags, F: marshalMiniObjectFlags},
gobject.TypeMarshaler{T: TypeObjectFlags, F: marshalObjectFlags},
gobject.TypeMarshaler{T: TypePadFlags, F: marshalPadFlags},
gobject.TypeMarshaler{T: TypePadLinkCheck, F: marshalPadLinkCheck},
gobject.TypeMarshaler{T: TypePadProbeType, F: marshalPadProbeType},
gobject.TypeMarshaler{T: TypePadTemplateFlags, F: marshalPadTemplateFlags},
gobject.TypeMarshaler{T: TypeParseFlags, F: marshalParseFlags},
gobject.TypeMarshaler{T: TypePipelineFlags, F: marshalPipelineFlags},
gobject.TypeMarshaler{T: TypePluginAPIFlags, F: marshalPluginAPIFlags},
gobject.TypeMarshaler{T: TypePluginDependencyFlags, F: marshalPluginDependencyFlags},
gobject.TypeMarshaler{T: TypePluginFlags, F: marshalPluginFlags},
gobject.TypeMarshaler{T: TypeQueryTypeFlags, F: marshalQueryTypeFlags},
gobject.TypeMarshaler{T: TypeSchedulingFlags, F: marshalSchedulingFlags},
gobject.TypeMarshaler{T: TypeSeekFlags, F: marshalSeekFlags},
gobject.TypeMarshaler{T: TypeSegmentFlags, F: marshalSegmentFlags},
gobject.TypeMarshaler{T: TypeSerializeFlags, F: marshalSerializeFlags},
gobject.TypeMarshaler{T: TypeStackTraceFlags, F: marshalStackTraceFlags},
gobject.TypeMarshaler{T: TypeStreamFlags, F: marshalStreamFlags},
gobject.TypeMarshaler{T: TypeStreamType, F: marshalStreamType},
gobject.TypeMarshaler{T: TypeTracerValueFlags, F: marshalTracerValueFlags},
gobject.TypeMarshaler{T: TypeChildProxy, F: marshalChildProxyInstance},
gobject.TypeMarshaler{T: TypePreset, F: marshalPresetInstance},
gobject.TypeMarshaler{T: TypeURIHandler, F: marshalURIHandlerInstance},
gobject.TypeMarshaler{T: TypeTagSetter, F: marshalTagSetterInstance},
gobject.TypeMarshaler{T: TypeTocSetter, F: marshalTocSetterInstance},
gobject.TypeMarshaler{T: TypeObject, F: marshalObjectInstance},
gobject.TypeMarshaler{T: TypePad, F: marshalPadInstance},
gobject.TypeMarshaler{T: TypePadTemplate, F: marshalPadTemplateInstance},
gobject.TypeMarshaler{T: TypePlugin, F: marshalPluginInstance},
gobject.TypeMarshaler{T: TypePluginFeature, F: marshalPluginFeatureInstance},
gobject.TypeMarshaler{T: TypeProxyPad, F: marshalProxyPadInstance},
gobject.TypeMarshaler{T: TypeRegistry, F: marshalRegistryInstance},
gobject.TypeMarshaler{T: TypeStream, F: marshalStreamInstance},
gobject.TypeMarshaler{T: TypeStreamCollection, F: marshalStreamCollectionInstance},
gobject.TypeMarshaler{T: TypeTask, F: marshalTaskInstance},
gobject.TypeMarshaler{T: TypeTaskPool, F: marshalTaskPoolInstance},
gobject.TypeMarshaler{T: TypeTracer, F: marshalTracerInstance},
gobject.TypeMarshaler{T: TypeTracerFactory, F: marshalTracerFactoryInstance},
gobject.TypeMarshaler{T: TypeTracerRecord, F: marshalTracerRecordInstance},
gobject.TypeMarshaler{T: TypeTypeFindFactory, F: marshalTypeFindFactoryInstance},
gobject.TypeMarshaler{T: TypeAllocator, F: marshalAllocatorInstance},
gobject.TypeMarshaler{T: TypeBufferPool, F: marshalBufferPoolInstance},
gobject.TypeMarshaler{T: TypeBus, F: marshalBusInstance},
gobject.TypeMarshaler{T: TypeClock, F: marshalClockInstance},
gobject.TypeMarshaler{T: TypeControlBinding, F: marshalControlBindingInstance},
gobject.TypeMarshaler{T: TypeControlSource, F: marshalControlSourceInstance},
gobject.TypeMarshaler{T: TypeDevice, F: marshalDeviceInstance},
gobject.TypeMarshaler{T: TypeDeviceMonitor, F: marshalDeviceMonitorInstance},
gobject.TypeMarshaler{T: TypeDeviceProvider, F: marshalDeviceProviderInstance},
gobject.TypeMarshaler{T: TypeDeviceProviderFactory, F: marshalDeviceProviderFactoryInstance},
gobject.TypeMarshaler{T: TypeDynamicTypeFactory, F: marshalDynamicTypeFactoryInstance},
gobject.TypeMarshaler{T: TypeElement, F: marshalElementInstance},
gobject.TypeMarshaler{T: TypeElementFactory, F: marshalElementFactoryInstance},
gobject.TypeMarshaler{T: TypeGhostPad, F: marshalGhostPadInstance},
gobject.TypeMarshaler{T: TypeSharedTaskPool, F: marshalSharedTaskPoolInstance},
gobject.TypeMarshaler{T: TypeSystemClock, F: marshalSystemClockInstance},
gobject.TypeMarshaler{T: TypeBin, F: marshalBinInstance},
gobject.TypeMarshaler{T: TypePipeline, F: marshalPipelineInstance},
gobject.TypeMarshaler{T: TypeAllocationParams, F: marshalAllocationParams},
gobject.TypeMarshaler{T: TypeAtomicQueue, F: marshalAtomicQueue},
gobject.TypeMarshaler{T: TypeBuffer, F: marshalBuffer},
gobject.TypeMarshaler{T: TypeBufferList, F: marshalBufferList},
gobject.TypeMarshaler{T: TypeCaps, F: marshalCaps},
gobject.TypeMarshaler{T: TypeCapsFeatures, F: marshalCapsFeatures},
gobject.TypeMarshaler{T: TypeContext, F: marshalContext},
gobject.TypeMarshaler{T: TypeDateTime, F: marshalDateTime},
gobject.TypeMarshaler{T: TypeEvent, F: marshalEvent},
gobject.TypeMarshaler{T: TypeIterator, F: marshalIterator},
gobject.TypeMarshaler{T: TypeMemory, F: marshalMemory},
gobject.TypeMarshaler{T: TypeMessage, F: marshalMessage},
gobject.TypeMarshaler{T: TypeMiniObject, F: marshalMiniObject},
gobject.TypeMarshaler{T: TypeParseContext, F: marshalParseContext},
gobject.TypeMarshaler{T: TypePromise, F: marshalPromise},
gobject.TypeMarshaler{T: TypeQuery, F: marshalQuery},
gobject.TypeMarshaler{T: TypeSample, F: marshalSample},
gobject.TypeMarshaler{T: TypeSegment, F: marshalSegment},
gobject.TypeMarshaler{T: TypeStaticCaps, F: marshalStaticCaps},
gobject.TypeMarshaler{T: TypeStaticPadTemplate, F: marshalStaticPadTemplate},
gobject.TypeMarshaler{T: TypeStructure, F: marshalStructure},
gobject.TypeMarshaler{T: TypeTagList, F: marshalTagList},
gobject.TypeMarshaler{T: TypeToc, F: marshalToc},
gobject.TypeMarshaler{T: TypeTocEntry, F: marshalTocEntry},
gobject.TypeMarshaler{T: TypeTypeFind, F: marshalTypeFind},
gobject.TypeMarshaler{T: TypeUri, F: marshalUri},
})
}
// BUFFER_OFFSET_NONE wraps GST_BUFFER_OFFSET_NONE
//
// Constant for no-offset return results.
const BUFFER_OFFSET_NONE = 18446744073709551615
// CAN_INLINE wraps GST_CAN_INLINE
const CAN_INLINE = 1
// DEBUG_BG_MASK wraps GST_DEBUG_BG_MASK
const DEBUG_BG_MASK = 240
// DEBUG_FG_MASK wraps GST_DEBUG_FG_MASK
const DEBUG_FG_MASK = 15
// DEBUG_FORMAT_MASK wraps GST_DEBUG_FORMAT_MASK
const DEBUG_FORMAT_MASK = 65280
// EVENT_NUM_SHIFT wraps GST_EVENT_NUM_SHIFT
const EVENT_NUM_SHIFT = 8
// FLAG_SET_MASK_EXACT wraps GST_FLAG_SET_MASK_EXACT
//
// A mask value with all bits set, for use as a
// GstFlagSet mask where all flag bits must match
// exactly
const FLAG_SET_MASK_EXACT = 4294967295
// FORMAT_PERCENT_MAX wraps GST_FORMAT_PERCENT_MAX
//
// The PERCENT format is between 0 and this value
const FORMAT_PERCENT_MAX = 1000000
// FORMAT_PERCENT_SCALE wraps GST_FORMAT_PERCENT_SCALE
//
// The value used to scale down the reported PERCENT format value to
// its real value.
const FORMAT_PERCENT_SCALE = 10000
// GROUP_ID_INVALID wraps GST_GROUP_ID_INVALID
//
// A value which is guaranteed to never be returned by
// gst_util_group_id_next().
//
// Can be used as a default value in variables used to store group_id.
const GROUP_ID_INVALID = 0
// PARAM_CONDITIONALLY_AVAILABLE wraps GST_PARAM_CONDITIONALLY_AVAILABLE
//
// Use this flag on GObject properties of GstObject to indicate that
// they might not be available depending on environment such as OS, device, etc,
// so such properties will be installed conditionally only if the GstObject is
// able to support it.
const PARAM_CONDITIONALLY_AVAILABLE = 16384
// PARAM_CONTROLLABLE wraps GST_PARAM_CONTROLLABLE
//
// Use this flag on GObject properties to signal they can make sense to be.
// controlled over time. This hint is used by the GstController.
const PARAM_CONTROLLABLE = 512
// PARAM_DOC_SHOW_DEFAULT wraps GST_PARAM_DOC_SHOW_DEFAULT
//
// Use this flag on GObject properties of GstObject to indicate that
// during `gst-inspect` and friends, the default value should be used
// as default instead of the current value.
const PARAM_DOC_SHOW_DEFAULT = 8192
// PARAM_MUTABLE_PAUSED wraps GST_PARAM_MUTABLE_PAUSED
//
// Use this flag on GObject properties of GstElements to indicate that
// they can be changed when the element is in the PAUSED or lower state.
// This flag implies GST_PARAM_MUTABLE_READY.
const PARAM_MUTABLE_PAUSED = 2048
// PARAM_MUTABLE_PLAYING wraps GST_PARAM_MUTABLE_PLAYING
//
// Use this flag on GObject properties of GstElements to indicate that
// they can be changed when the element is in the PLAYING or lower state.
// This flag implies GST_PARAM_MUTABLE_PAUSED.
const PARAM_MUTABLE_PLAYING = 4096
// PARAM_MUTABLE_READY wraps GST_PARAM_MUTABLE_READY
//
// Use this flag on GObject properties of GstElements to indicate that
// they can be changed when the element is in the READY or lower state.
const PARAM_MUTABLE_READY = 1024
// PARAM_USER_SHIFT wraps GST_PARAM_USER_SHIFT
//
// Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.
const PARAM_USER_SHIFT = 65536
// QUERY_NUM_SHIFT wraps GST_QUERY_NUM_SHIFT
const QUERY_NUM_SHIFT = 8
// SEGMENT_INSTANT_FLAGS wraps GST_SEGMENT_INSTANT_FLAGS
const SEGMENT_INSTANT_FLAGS = 912
// SEQNUM_INVALID wraps GST_SEQNUM_INVALID
//
// A value which is guaranteed to never be returned by
// gst_util_seqnum_next().
//
// Can be used as a default value in variables used to store seqnum.
const SEQNUM_INVALID = 0
// TOC_REPEAT_COUNT_INFINITE wraps GST_TOC_REPEAT_COUNT_INFINITE
//
// Special value for the repeat_count set in gst_toc_entry_set_loop() or
// returned by gst_toc_entry_set_loop() to indicate infinite looping.
const TOC_REPEAT_COUNT_INFINITE = -1
// URI_NO_PORT wraps GST_URI_NO_PORT
//
// Value for #GstUri&lt;!-- --&gt;.port to indicate no port number.
const URI_NO_PORT = 0
// VALUE_EQUAL wraps GST_VALUE_EQUAL
//
// Indicates that the first value provided to a comparison function
// (gst_value_compare()) is equal to the second one.
const VALUE_EQUAL = 0
// VALUE_GREATER_THAN wraps GST_VALUE_GREATER_THAN
//
// Indicates that the first value provided to a comparison function
// (gst_value_compare()) is greater than the second one.
const VALUE_GREATER_THAN = 1
// VALUE_LESS_THAN wraps GST_VALUE_LESS_THAN
//
// Indicates that the first value provided to a comparison function
// (gst_value_compare()) is lesser than the second one.
const VALUE_LESS_THAN = -1
// VALUE_UNORDERED wraps GST_VALUE_UNORDERED
//
// Indicates that the comparison function (gst_value_compare()) can not
// determine a order for the two provided values.
const VALUE_UNORDERED = 2
// VERSION_MAJOR wraps GST_VERSION_MAJOR
//
// The major version of GStreamer at compile time:
const VERSION_MAJOR = 1
// VERSION_MICRO wraps GST_VERSION_MICRO
//
// The micro version of GStreamer at compile time:
const VERSION_MICRO = 10
// VERSION_MINOR wraps GST_VERSION_MINOR
//
// The minor version of GStreamer at compile time:
const VERSION_MINOR = 24
// VERSION_NANO wraps GST_VERSION_NANO
//
// The nano version of GStreamer at compile time:
// Actual releases have 0, GIT versions have 1, prerelease versions have 2-...
const VERSION_NANO = 0
// ClockID wraps GstClockID
//
// A datatype to hold the handle to an outstanding sync or async clock callback.
type ClockID = unsafe.Pointer
// ClockTimeDiff wraps GstClockTimeDiff
//
// A datatype to hold a time difference, measured in nanoseconds.
type ClockTimeDiff = int64
// ElementFactoryListType wraps GstElementFactoryListType
//
// A type defining the type of an element factory.
type ElementFactoryListType = uint64
// BufferingMode wraps GstBufferingMode
//
// The different types of buffering methods.
type BufferingMode C.int
const (
// BufferingStream wraps GST_BUFFERING_STREAM
//
// a small amount of data is buffered
BufferingStream BufferingMode = 0
// BufferingDownload wraps GST_BUFFERING_DOWNLOAD
//
// the stream is being downloaded
BufferingDownload BufferingMode = 1
// BufferingTimeshift wraps GST_BUFFERING_TIMESHIFT
//
// the stream is being downloaded in a ringbuffer
BufferingTimeshift BufferingMode = 2
// BufferingLive wraps GST_BUFFERING_LIVE
//
// the stream is a live stream
BufferingLive BufferingMode = 3
)
func marshalBufferingMode(p unsafe.Pointer) (any, error) {
return BufferingMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = BufferingMode(0)
func (e BufferingMode) InitGoValue(v *gobject.Value) {
v.Init(TypeBufferingMode)
v.SetEnum(int(e))
}
func (e BufferingMode) String() string {
switch e {
case BufferingDownload: return "BufferingDownload"
case BufferingLive: return "BufferingLive"
case BufferingStream: return "BufferingStream"
case BufferingTimeshift: return "BufferingTimeshift"
default: return fmt.Sprintf("BufferingMode(%d)", e)
}
}
// BusSyncReply wraps GstBusSyncReply
//
// The result values for a GstBusSyncHandler.
type BusSyncReply C.int
const (
// BusDrop wraps GST_BUS_DROP
//
// drop the message
BusDrop BusSyncReply = 0
// BusPass wraps GST_BUS_PASS
//
// pass the message to the async queue
BusPass BusSyncReply = 1
// BusAsync wraps GST_BUS_ASYNC
//
// pass message to async queue, continue if message is handled
BusAsync BusSyncReply = 2
)
func marshalBusSyncReply(p unsafe.Pointer) (any, error) {
return BusSyncReply(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = BusSyncReply(0)
func (e BusSyncReply) InitGoValue(v *gobject.Value) {
v.Init(TypeBusSyncReply)
v.SetEnum(int(e))
}
func (e BusSyncReply) String() string {
switch e {
case BusAsync: return "BusAsync"
case BusDrop: return "BusDrop"
case BusPass: return "BusPass"
default: return fmt.Sprintf("BusSyncReply(%d)", e)
}
}
// CapsIntersectMode wraps GstCapsIntersectMode
//
// Modes of caps intersection
//
// %GST_CAPS_INTERSECT_ZIG_ZAG tries to preserve overall order of both caps
// by iterating on the caps' structures as the following matrix shows:
//
// ```
// caps1
// +-------------
// | 1 2 4 7
// caps2 | 3 5 8 10
// | 6 9 11 12
// ```
//
// Used when there is no explicit precedence of one caps over the other. e.g.
// tee's sink pad getcaps function, it will probe its src pad peers' for their
// caps and intersect them with this mode.
//
// %GST_CAPS_INTERSECT_FIRST is useful when an element wants to preserve
// another element's caps priority order when intersecting with its own caps.
// Example: If caps1 is `[A, B, C]` and caps2 is `[E, B, D, A]`, the result
// would be `[A, B]`, maintaining the first caps priority on the intersection.
type CapsIntersectMode C.int
const (
// CapsIntersectZigZag wraps GST_CAPS_INTERSECT_ZIG_ZAG
//
// Zig-zags over both caps.
CapsIntersectZigZag CapsIntersectMode = 0
// CapsIntersectFirst wraps GST_CAPS_INTERSECT_FIRST
//
// Keeps the first caps order.
CapsIntersectFirst CapsIntersectMode = 1
)
func marshalCapsIntersectMode(p unsafe.Pointer) (any, error) {
return CapsIntersectMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = CapsIntersectMode(0)
func (e CapsIntersectMode) InitGoValue(v *gobject.Value) {
v.Init(TypeCapsIntersectMode)
v.SetEnum(int(e))
}
func (e CapsIntersectMode) String() string {
switch e {
case CapsIntersectFirst: return "CapsIntersectFirst"
case CapsIntersectZigZag: return "CapsIntersectZigZag"
default: return fmt.Sprintf("CapsIntersectMode(%d)", e)
}
}
// ClockEntryType wraps GstClockEntryType
//
// The type of the clock entry
type ClockEntryType C.int
const (
// ClockEntrySingle wraps GST_CLOCK_ENTRY_SINGLE
//
// a single shot timeout
ClockEntrySingle ClockEntryType = 0
// ClockEntryPeriodic wraps GST_CLOCK_ENTRY_PERIODIC
//
// a periodic timeout request
ClockEntryPeriodic ClockEntryType = 1
)
func marshalClockEntryType(p unsafe.Pointer) (any, error) {
return ClockEntryType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ClockEntryType(0)
func (e ClockEntryType) InitGoValue(v *gobject.Value) {
v.Init(TypeClockEntryType)
v.SetEnum(int(e))
}
func (e ClockEntryType) String() string {
switch e {
case ClockEntryPeriodic: return "ClockEntryPeriodic"
case ClockEntrySingle: return "ClockEntrySingle"
default: return fmt.Sprintf("ClockEntryType(%d)", e)
}
}
// ClockReturn wraps GstClockReturn
//
// The return value of a clock operation.
type ClockReturn C.int
const (
// ClockOK wraps GST_CLOCK_OK
//
// The operation succeeded.
ClockOK ClockReturn = 0
// ClockEarly wraps GST_CLOCK_EARLY
//
// The operation was scheduled too late.
ClockEarly ClockReturn = 1
// ClockUnscheduled wraps GST_CLOCK_UNSCHEDULED
//
// The clockID was unscheduled
ClockUnscheduled ClockReturn = 2
// ClockBusy wraps GST_CLOCK_BUSY
//
// The ClockID is busy
ClockBusy ClockReturn = 3
// ClockBadtime wraps GST_CLOCK_BADTIME
//
// A bad time was provided to a function.
ClockBadtime ClockReturn = 4
// ClockError wraps GST_CLOCK_ERROR
//
// An error occurred
ClockError ClockReturn = 5
// ClockUnsupported wraps GST_CLOCK_UNSUPPORTED
//
// Operation is not supported
ClockUnsupported ClockReturn = 6
// ClockDone wraps GST_CLOCK_DONE
//
// The ClockID is done waiting
ClockDone ClockReturn = 7
)
func marshalClockReturn(p unsafe.Pointer) (any, error) {
return ClockReturn(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ClockReturn(0)
func (e ClockReturn) InitGoValue(v *gobject.Value) {
v.Init(TypeClockReturn)
v.SetEnum(int(e))
}
func (e ClockReturn) String() string {
switch e {
case ClockBadtime: return "ClockBadtime"
case ClockBusy: return "ClockBusy"
case ClockDone: return "ClockDone"
case ClockEarly: return "ClockEarly"
case ClockError: return "ClockError"
case ClockOK: return "ClockOK"
case ClockUnscheduled: return "ClockUnscheduled"
case ClockUnsupported: return "ClockUnsupported"
default: return fmt.Sprintf("ClockReturn(%d)", e)
}
}
// ClockType wraps GstClockType
//
// The different kind of clocks.
type ClockType C.int
const (
// ClockTypeRealtime wraps GST_CLOCK_TYPE_REALTIME
//
// time since Epoch
ClockTypeRealtime ClockType = 0
// ClockTypeMonotonic wraps GST_CLOCK_TYPE_MONOTONIC
//
// monotonic time since some unspecified starting
// point
ClockTypeMonotonic ClockType = 1
// ClockTypeOther wraps GST_CLOCK_TYPE_OTHER
//
// some other time source is used (Since: 1.0.5)
ClockTypeOther ClockType = 2
// ClockTypeTai wraps GST_CLOCK_TYPE_TAI
//
// time since Epoch, but using International Atomic Time
// as reference (Since: 1.18)
ClockTypeTai ClockType = 3
)
func marshalClockType(p unsafe.Pointer) (any, error) {
return ClockType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ClockType(0)
func (e ClockType) InitGoValue(v *gobject.Value) {
v.Init(TypeClockType)
v.SetEnum(int(e))
}
func (e ClockType) String() string {
switch e {
case ClockTypeMonotonic: return "ClockTypeMonotonic"
case ClockTypeOther: return "ClockTypeOther"
case ClockTypeRealtime: return "ClockTypeRealtime"
case ClockTypeTai: return "ClockTypeTai"
default: return fmt.Sprintf("ClockType(%d)", e)
}
}
// CoreError wraps GstCoreError
//
// Core errors are errors inside the core GStreamer library.
type CoreError C.int
const (
// CoreErrorFailed wraps GST_CORE_ERROR_FAILED
//
// a general error which doesn't fit in any other
// category. Make sure you add a custom message to the error call.
CoreErrorFailed CoreError = 1
// CoreErrorTooLaZY wraps GST_CORE_ERROR_TOO_LAZY
//
// do not use this except as a placeholder for
// deciding where to go while developing code.
CoreErrorTooLaZY CoreError = 2
// CoreErrorNotImplemented wraps GST_CORE_ERROR_NOT_IMPLEMENTED
//
// use this when you do not want to implement
// this functionality yet.
CoreErrorNotImplemented CoreError = 3
// CoreErrorStateChange wraps GST_CORE_ERROR_STATE_CHANGE
//
// used for state change errors.
CoreErrorStateChange CoreError = 4
// CoreErrorPad wraps GST_CORE_ERROR_PAD
//
// used for pad-related errors.
CoreErrorPad CoreError = 5
// CoreErrorThread wraps GST_CORE_ERROR_THREAD
//
// used for thread-related errors.
CoreErrorThread CoreError = 6
// CoreErrorNegotiation wraps GST_CORE_ERROR_NEGOTIATION
//
// used for negotiation-related errors.
CoreErrorNegotiation CoreError = 7
// CoreErrorEvent wraps GST_CORE_ERROR_EVENT
//
// used for event-related errors.
CoreErrorEvent CoreError = 8
// CoreErrorSeek wraps GST_CORE_ERROR_SEEK
//
// used for seek-related errors.
CoreErrorSeek CoreError = 9
// CoreErrorCaps wraps GST_CORE_ERROR_CAPS
//
// used for caps-related errors.
CoreErrorCaps CoreError = 10
// CoreErrorTag wraps GST_CORE_ERROR_TAG
//
// used for negotiation-related errors.
CoreErrorTag CoreError = 11
// CoreErrorMissingPlugin wraps GST_CORE_ERROR_MISSING_PLUGIN
//
// used if a plugin is missing.
CoreErrorMissingPlugin CoreError = 12
// CoreErrorClock wraps GST_CORE_ERROR_CLOCK
//
// used for clock related errors.
CoreErrorClock CoreError = 13
// CoreErrorDisabled wraps GST_CORE_ERROR_DISABLED
//
// used if functionality has been disabled at
// compile time.
CoreErrorDisabled CoreError = 14
// CoreErrorNumErrors wraps GST_CORE_ERROR_NUM_ERRORS
//
// the number of core error types.
CoreErrorNumErrors CoreError = 15
)
func marshalCoreError(p unsafe.Pointer) (any, error) {
return CoreError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = CoreError(0)
func (e CoreError) InitGoValue(v *gobject.Value) {
v.Init(TypeCoreError)
v.SetEnum(int(e))
}
func (e CoreError) String() string {
switch e {
case CoreErrorCaps: return "CoreErrorCaps"
case CoreErrorClock: return "CoreErrorClock"
case CoreErrorDisabled: return "CoreErrorDisabled"
case CoreErrorEvent: return "CoreErrorEvent"
case CoreErrorFailed: return "CoreErrorFailed"
case CoreErrorMissingPlugin: return "CoreErrorMissingPlugin"
case CoreErrorNegotiation: return "CoreErrorNegotiation"
case CoreErrorNotImplemented: return "CoreErrorNotImplemented"
case CoreErrorNumErrors: return "CoreErrorNumErrors"
case CoreErrorPad: return "CoreErrorPad"
case CoreErrorSeek: return "CoreErrorSeek"
case CoreErrorStateChange: return "CoreErrorStateChange"
case CoreErrorTag: return "CoreErrorTag"
case CoreErrorThread: return "CoreErrorThread"
case CoreErrorTooLaZY: return "CoreErrorTooLaZY"
default: return fmt.Sprintf("CoreError(%d)", e)
}
}
// DebugColorMode wraps GstDebugColorMode
type DebugColorMode C.int
const (
// DebugColorModeOff wraps GST_DEBUG_COLOR_MODE_OFF
//
// Do not use colors in logs.
DebugColorModeOff DebugColorMode = 0
// DebugColorModeOn wraps GST_DEBUG_COLOR_MODE_ON
//
// Paint logs in a platform-specific way.
DebugColorModeOn DebugColorMode = 1
// DebugColorModeUnix wraps GST_DEBUG_COLOR_MODE_UNIX
//
// Paint logs with UNIX terminal color codes
// no matter what platform GStreamer is running on.
DebugColorModeUnix DebugColorMode = 2
)
func marshalDebugColorMode(p unsafe.Pointer) (any, error) {
return DebugColorMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = DebugColorMode(0)
func (e DebugColorMode) InitGoValue(v *gobject.Value) {
v.Init(TypeDebugColorMode)
v.SetEnum(int(e))
}
func (e DebugColorMode) String() string {
switch e {
case DebugColorModeOff: return "DebugColorModeOff"
case DebugColorModeOn: return "DebugColorModeOn"
case DebugColorModeUnix: return "DebugColorModeUnix"
default: return fmt.Sprintf("DebugColorMode(%d)", e)
}
}
// DebugLevel wraps GstDebugLevel
//
// The level defines the importance of a debugging message. The more important a
// message is, the greater the probability that the debugging system outputs it.
type DebugLevel C.int
const (
// LevelNone wraps GST_LEVEL_NONE
//
// No debugging level specified or desired. Used to deactivate
// debugging output.
LevelNone DebugLevel = 0
// LevelError wraps GST_LEVEL_ERROR
//
// Error messages are to be used only when an error occurred
// that stops the application from keeping working correctly.
// An examples is gst_element_error, which outputs a message with this priority.
// It does not mean that the application is terminating as with g_error.
LevelError DebugLevel = 1
// LevelWarning wraps GST_LEVEL_WARNING
//
// Warning messages are to inform about abnormal behaviour
// that could lead to problems or weird behaviour later on. An example of this
// would be clocking issues ("your computer is pretty slow") or broken input
// data ("Can't synchronize to stream.")
LevelWarning DebugLevel = 2
// LevelFixme wraps GST_LEVEL_FIXME
//
// Fixme messages are messages that indicate that something
// in the executed code path is not fully implemented or handled yet. Note
// that this does not replace proper error handling in any way, the purpose
// of this message is to make it easier to spot incomplete/unfinished pieces
// of code when reading the debug log.
LevelFixme DebugLevel = 3
// LevelInfo wraps GST_LEVEL_INFO
//
// Informational messages should be used to keep the developer
// updated about what is happening.
// Examples where this should be used are when a typefind function has
// successfully determined the type of the stream or when an mp3 plugin detects
// the format to be used. ("This file has mono sound.")
LevelInfo DebugLevel = 4
// LevelDebug wraps GST_LEVEL_DEBUG
//
// Debugging messages should be used when something common
// happens that is not the expected default behavior, or something that's
// useful to know but doesn't happen all the time (ie. per loop iteration or
// buffer processed or event handled).
// An example would be notifications about state changes or receiving/sending
// of events.
LevelDebug DebugLevel = 5
// LevelLog wraps GST_LEVEL_LOG
//
// Log messages are messages that are very common but might be
// useful to know. As a rule of thumb a pipeline that is running as expected
// should never output anything else but LOG messages whilst processing data.
// Use this log level to log recurring information in chain functions and
// loop functions, for example.
LevelLog DebugLevel = 6
// LevelTrace wraps GST_LEVEL_TRACE
//
// Tracing-related messages.
// Examples for this are referencing/dereferencing of objects.
LevelTrace DebugLevel = 7
// LevelMemdump wraps GST_LEVEL_MEMDUMP
//
// memory dump messages are used to log (small) chunks of
// data as memory dumps in the log. They will be displayed as hexdump with
// ASCII characters.
LevelMemdump DebugLevel = 9
// LevelCount wraps GST_LEVEL_COUNT
//
// The number of defined debugging levels.
LevelCount DebugLevel = 10
)
func marshalDebugLevel(p unsafe.Pointer) (any, error) {
return DebugLevel(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = DebugLevel(0)
func (e DebugLevel) InitGoValue(v *gobject.Value) {
v.Init(TypeDebugLevel)
v.SetEnum(int(e))
}
func (e DebugLevel) String() string {
switch e {
case LevelCount: return "LevelCount"
case LevelDebug: return "LevelDebug"
case LevelError: return "LevelError"
case LevelFixme: return "LevelFixme"
case LevelInfo: return "LevelInfo"
case LevelLog: return "LevelLog"
case LevelMemdump: return "LevelMemdump"
case LevelNone: return "LevelNone"
case LevelTrace: return "LevelTrace"
case LevelWarning: return "LevelWarning"
default: return fmt.Sprintf("DebugLevel(%d)", e)
}
}
// EventType wraps GstEventType
//
// #GstEventType lists the standard event types that can be sent in a pipeline.
//
// The custom event types can be used for private messages between elements
// that can't be expressed using normal
// GStreamer buffer passing semantics. Custom events carry an arbitrary
// #GstStructure.
// Specific custom events are distinguished by the name of the structure.
type EventType C.int
const (
// EventUnknown wraps GST_EVENT_UNKNOWN
//
// unknown event.
EventUnknown EventType = 0
// EventFlushStart wraps GST_EVENT_FLUSH_START
//
// Start a flush operation. This event clears all data
// from the pipeline and unblock all streaming threads.
EventFlushStart EventType = 2563
// EventFlushStop wraps GST_EVENT_FLUSH_STOP
//
// Stop a flush operation. This event resets the
// running-time of the pipeline.
EventFlushStop EventType = 5127
// EventStreamStart wraps GST_EVENT_STREAM_START
//
// Event to mark the start of a new stream. Sent before any
// other serialized event and only sent at the start of a new stream,
// not after flushing seeks.
EventStreamStart EventType = 10254
// EventCaps wraps GST_EVENT_CAPS
//
// #GstCaps event. Notify the pad of a new media type.
EventCaps EventType = 12814
// EventSegment wraps GST_EVENT_SEGMENT
//
// A new media segment follows in the dataflow. The
// segment events contains information for clipping buffers and
// converting buffer timestamps to running-time and
// stream-time.
EventSegment EventType = 17934
// EventStreamCollection wraps GST_EVENT_STREAM_COLLECTION
//
// A new #GstStreamCollection is available (Since: 1.10)
EventStreamCollection EventType = 19230
// EventTag wraps GST_EVENT_TAG
//
// A new set of metadata tags has been found in the stream.
EventTag EventType = 20510
// EventBuffersize wraps GST_EVENT_BUFFERSIZE
//
// Notification of buffering requirements. Currently not
// used yet.
EventBuffersize EventType = 23054
// EventSinkMessage wraps GST_EVENT_SINK_MESSAGE
//
// An event that sinks turn into a message. Used to
// send messages that should be emitted in sync with
// rendering.
EventSinkMessage EventType = 25630
// EventStreamGroupDone wraps GST_EVENT_STREAM_GROUP_DONE
//
// Indicates that there is no more data for
// the stream group ID in the message. Sent before EOS
// in some instances and should be handled mostly the same. (Since: 1.10)
EventStreamGroupDone EventType = 26894
// EventEos wraps GST_EVENT_EOS
//
// End-Of-Stream. No more data is to be expected to follow
// without either a STREAM_START event, or a FLUSH_STOP and a SEGMENT
// event.
EventEos EventType = 28174
// EventToc wraps GST_EVENT_TOC
//
// An event which indicates that a new table of contents (TOC)
// was found or updated.
EventToc EventType = 30750
// EventProtection wraps GST_EVENT_PROTECTION
//
// An event which indicates that new or updated
// encryption information has been found in the stream.
EventProtection EventType = 33310
// EventSegmentDone wraps GST_EVENT_SEGMENT_DONE
//
// Marks the end of a segment playback.
EventSegmentDone EventType = 38406
// EventGap wraps GST_EVENT_GAP
//
// Marks a gap in the datastream.
EventGap EventType = 40966
// EventInstantRateChange wraps GST_EVENT_INSTANT_RATE_CHANGE
//
// Notify downstream that a playback rate override
// should be applied as soon as possible. (Since: 1.18)
EventInstantRateChange EventType = 46090
// EventQos wraps GST_EVENT_QOS
//
// A quality message. Used to indicate to upstream elements
// that the downstream elements should adjust their processing
// rate.
EventQos EventType = 48641
// EventSeek wraps GST_EVENT_SEEK
//
// A request for a new playback position and rate.
EventSeek EventType = 51201
// EventNavigation wraps GST_EVENT_NAVIGATION
//
// Navigation events are usually used for communicating
// user requests, such as mouse or keyboard movements,
// to upstream elements.
EventNavigation EventType = 53761
// EventLatency wraps GST_EVENT_LATENCY
//
// Notification of new latency adjustment. Sinks will use
// the latency information to adjust their synchronisation.
EventLatency EventType = 56321
// EventStep wraps GST_EVENT_STEP
//
// A request for stepping through the media. Sinks will usually
// execute the step operation.
EventStep EventType = 58881
// EventReconfigure wraps GST_EVENT_RECONFIGURE
//
// A request for upstream renegotiating caps and reconfiguring.
EventReconfigure EventType = 61441
// EventTocSelect wraps GST_EVENT_TOC_SELECT
//
// A request for a new playback position based on TOC
// entry's UID.
EventTocSelect EventType = 64001
// EventSelectStreams wraps GST_EVENT_SELECT_STREAMS
//
// A request to select one or more streams (Since: 1.10)
EventSelectStreams EventType = 66561
// EventInstantRateSyncTime wraps GST_EVENT_INSTANT_RATE_SYNC_TIME
//
// Sent by the pipeline to notify elements that handle the
// instant-rate-change event about the running-time when
// the rate multiplier should be applied (or was applied). (Since: 1.18)
EventInstantRateSyncTime EventType = 66817
// EventCustomUpstream wraps GST_EVENT_CUSTOM_UPSTREAM
//
// Upstream custom event
EventCustomUpstream EventType = 69121
// EventCustomDownstream wraps GST_EVENT_CUSTOM_DOWNSTREAM
//
// Downstream custom event that travels in the
// data flow.
EventCustomDownstream EventType = 71686
// EventCustomDownstreamOob wraps GST_EVENT_CUSTOM_DOWNSTREAM_OOB
//
// Custom out-of-band downstream event.
EventCustomDownstreamOob EventType = 74242
// EventCustomDownstreamSticky wraps GST_EVENT_CUSTOM_DOWNSTREAM_STICKY
//
// Custom sticky downstream event.
EventCustomDownstreamSticky EventType = 76830
// EventCustomBoth wraps GST_EVENT_CUSTOM_BOTH
//
// Custom upstream or downstream event.
// In-band when travelling downstream.
EventCustomBoth EventType = 79367
// EventCustomBothOob wraps GST_EVENT_CUSTOM_BOTH_OOB
//
// Custom upstream or downstream out-of-band event.
EventCustomBothOob EventType = 81923
)
func marshalEventType(p unsafe.Pointer) (any, error) {
return EventType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = EventType(0)
func (e EventType) InitGoValue(v *gobject.Value) {
v.Init(TypeEventType)
v.SetEnum(int(e))
}
func (e EventType) String() string {
switch e {
case EventBuffersize: return "EventBuffersize"
case EventCaps: return "EventCaps"
case EventCustomBoth: return "EventCustomBoth"
case EventCustomBothOob: return "EventCustomBothOob"
case EventCustomDownstream: return "EventCustomDownstream"
case EventCustomDownstreamOob: return "EventCustomDownstreamOob"
case EventCustomDownstreamSticky: return "EventCustomDownstreamSticky"
case EventCustomUpstream: return "EventCustomUpstream"
case EventEos: return "EventEos"
case EventFlushStart: return "EventFlushStart"
case EventFlushStop: return "EventFlushStop"
case EventGap: return "EventGap"
case EventInstantRateChange: return "EventInstantRateChange"
case EventInstantRateSyncTime: return "EventInstantRateSyncTime"
case EventLatency: return "EventLatency"
case EventNavigation: return "EventNavigation"
case EventProtection: return "EventProtection"
case EventQos: return "EventQos"
case EventReconfigure: return "EventReconfigure"
case EventSeek: return "EventSeek"
case EventSegment: return "EventSegment"
case EventSegmentDone: return "EventSegmentDone"
case EventSelectStreams: return "EventSelectStreams"
case EventSinkMessage: return "EventSinkMessage"
case EventStep: return "EventStep"
case EventStreamCollection: return "EventStreamCollection"
case EventStreamGroupDone: return "EventStreamGroupDone"
case EventStreamStart: return "EventStreamStart"
case EventTag: return "EventTag"
case EventToc: return "EventToc"
case EventTocSelect: return "EventTocSelect"
case EventUnknown: return "EventUnknown"
default: return fmt.Sprintf("EventType(%d)", e)
}
}
// FlowReturn wraps GstFlowReturn
//
// The result of passing data to a pad.
//
// Note that the custom return values should not be exposed outside of the
// element scope.
type FlowReturn C.int
const (
// FlowCustomSuccess2 wraps GST_FLOW_CUSTOM_SUCCESS_2
//
// Pre-defined custom success code.
FlowCustomSuccess2 FlowReturn = 102
// FlowCustomSuccess1 wraps GST_FLOW_CUSTOM_SUCCESS_1
//
// Pre-defined custom success code (define your
// custom success code to this to avoid compiler
// warnings).
FlowCustomSuccess1 FlowReturn = 101
// FlowCustomSuccess wraps GST_FLOW_CUSTOM_SUCCESS
//
// Elements can use values starting from
// this (and higher) to define custom success
// codes.
FlowCustomSuccess FlowReturn = 100
// FlowOK wraps GST_FLOW_OK
//
// Data passing was ok.
FlowOK FlowReturn = 0
// FlowNotLinked wraps GST_FLOW_NOT_LINKED
//
// Pad is not linked.
FlowNotLinked FlowReturn = -1
// FlowFlushing wraps GST_FLOW_FLUSHING
//
// Pad is flushing.
FlowFlushing FlowReturn = -2
// FlowEos wraps GST_FLOW_EOS
//
// Pad is EOS.
FlowEos FlowReturn = -3
// FlowNotNegotiated wraps GST_FLOW_NOT_NEGOTIATED
//
// Pad is not negotiated.
FlowNotNegotiated FlowReturn = -4
// FlowError wraps GST_FLOW_ERROR
//
// Some (fatal) error occurred. Element generating
// this error should post an error message using
// GST_ELEMENT_ERROR() with more details.
FlowError FlowReturn = -5
// FlowNotSupported wraps GST_FLOW_NOT_SUPPORTED
//
// This operation is not supported.
FlowNotSupported FlowReturn = -6
// FlowCustomError wraps GST_FLOW_CUSTOM_ERROR
//
// Elements can use values starting from
// this (and lower) to define custom error codes.
FlowCustomError FlowReturn = -100
// FlowCustomError1 wraps GST_FLOW_CUSTOM_ERROR_1
//
// Pre-defined custom error code (define your
// custom error code to this to avoid compiler
// warnings).
FlowCustomError1 FlowReturn = -101
// FlowCustomError2 wraps GST_FLOW_CUSTOM_ERROR_2
//
// Pre-defined custom error code.
FlowCustomError2 FlowReturn = -102
)
func marshalFlowReturn(p unsafe.Pointer) (any, error) {
return FlowReturn(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = FlowReturn(0)
func (e FlowReturn) InitGoValue(v *gobject.Value) {
v.Init(TypeFlowReturn)
v.SetEnum(int(e))
}
func (e FlowReturn) String() string {
switch e {
case FlowCustomError: return "FlowCustomError"
case FlowCustomError1: return "FlowCustomError1"
case FlowCustomError2: return "FlowCustomError2"
case FlowCustomSuccess: return "FlowCustomSuccess"
case FlowCustomSuccess1: return "FlowCustomSuccess1"
case FlowCustomSuccess2: return "FlowCustomSuccess2"
case FlowEos: return "FlowEos"
case FlowError: return "FlowError"
case FlowFlushing: return "FlowFlushing"
case FlowNotLinked: return "FlowNotLinked"
case FlowNotNegotiated: return "FlowNotNegotiated"
case FlowNotSupported: return "FlowNotSupported"
case FlowOK: return "FlowOK"
default: return fmt.Sprintf("FlowReturn(%d)", e)
}
}
// Format wraps GstFormat
//
// Standard predefined formats
type Format C.int
const (
// FormatUndefined wraps GST_FORMAT_UNDEFINED
//
// undefined format
FormatUndefined Format = 0
// FormatDefault wraps GST_FORMAT_DEFAULT
//
// the default format of the pad/element. This can be
// samples for raw audio, frames/fields for raw video (some, but not all,
// elements support this; use @GST_FORMAT_TIME if you don't have a good
// reason to query for samples/frames)
FormatDefault Format = 1
// FormatBytes wraps GST_FORMAT_BYTES
//
// bytes
FormatBytes Format = 2
// FormatTime wraps GST_FORMAT_TIME
//
// time in nanoseconds
FormatTime Format = 3
// FormatBuffers wraps GST_FORMAT_BUFFERS
//
// buffers (few, if any, elements implement this as of
// May 2009)
FormatBuffers Format = 4
// FormatPercent wraps GST_FORMAT_PERCENT
//
// percentage of stream (few, if any, elements implement
// this as of May 2009)
FormatPercent Format = 5
)
func marshalFormat(p unsafe.Pointer) (any, error) {
return Format(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = Format(0)
func (e Format) InitGoValue(v *gobject.Value) {
v.Init(TypeFormat)
v.SetEnum(int(e))
}
func (e Format) String() string {
switch e {
case FormatBuffers: return "FormatBuffers"
case FormatBytes: return "FormatBytes"
case FormatDefault: return "FormatDefault"
case FormatPercent: return "FormatPercent"
case FormatTime: return "FormatTime"
case FormatUndefined: return "FormatUndefined"
default: return fmt.Sprintf("Format(%d)", e)
}
}
// IteratorItem wraps GstIteratorItem
//
// The result of a #GstIteratorItemFunction.
type IteratorItem C.int
const (
// IteratorItemSkip wraps GST_ITERATOR_ITEM_SKIP
//
// Skip this item
IteratorItemSkip IteratorItem = 0
// IteratorItemPass wraps GST_ITERATOR_ITEM_PASS
//
// Return item
IteratorItemPass IteratorItem = 1
// IteratorItemEnd wraps GST_ITERATOR_ITEM_END
//
// Stop after this item.
IteratorItemEnd IteratorItem = 2
)
func marshalIteratorItem(p unsafe.Pointer) (any, error) {
return IteratorItem(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = IteratorItem(0)
func (e IteratorItem) InitGoValue(v *gobject.Value) {
v.Init(TypeIteratorItem)
v.SetEnum(int(e))
}
func (e IteratorItem) String() string {
switch e {
case IteratorItemEnd: return "IteratorItemEnd"
case IteratorItemPass: return "IteratorItemPass"
case IteratorItemSkip: return "IteratorItemSkip"
default: return fmt.Sprintf("IteratorItem(%d)", e)
}
}
// IteratorResult wraps GstIteratorResult
//
// The result of gst_iterator_next().
type IteratorResult C.int
const (
// IteratorDone wraps GST_ITERATOR_DONE
//
// No more items in the iterator
IteratorDone IteratorResult = 0
// IteratorOK wraps GST_ITERATOR_OK
//
// An item was retrieved
IteratorOK IteratorResult = 1
// IteratorResync wraps GST_ITERATOR_RESYNC
//
// Datastructure changed while iterating
IteratorResync IteratorResult = 2
// IteratorError wraps GST_ITERATOR_ERROR
//
// An error happened
IteratorError IteratorResult = 3
)
func marshalIteratorResult(p unsafe.Pointer) (any, error) {
return IteratorResult(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = IteratorResult(0)
func (e IteratorResult) InitGoValue(v *gobject.Value) {
v.Init(TypeIteratorResult)
v.SetEnum(int(e))
}
func (e IteratorResult) String() string {
switch e {
case IteratorDone: return "IteratorDone"
case IteratorError: return "IteratorError"
case IteratorOK: return "IteratorOK"
case IteratorResync: return "IteratorResync"
default: return fmt.Sprintf("IteratorResult(%d)", e)
}
}
// LibraryError wraps GstLibraryError
//
// Library errors are for errors from the library being used by elements
// (initializing, finalizing, settings, ...)
type LibraryError C.int
const (
// LibraryErrorFailed wraps GST_LIBRARY_ERROR_FAILED
//
// a general error which doesn't fit in any other
// category. Make sure you add a custom message to the error call.
LibraryErrorFailed LibraryError = 1
// LibraryErrorTooLaZY wraps GST_LIBRARY_ERROR_TOO_LAZY
//
// do not use this except as a placeholder for
// deciding where to go while developing code.
LibraryErrorTooLaZY LibraryError = 2
// LibraryErrorInit wraps GST_LIBRARY_ERROR_INIT
//
// used when the library could not be opened.
LibraryErrorInit LibraryError = 3
// LibraryErrorShutdown wraps GST_LIBRARY_ERROR_SHUTDOWN
//
// used when the library could not be closed.
LibraryErrorShutdown LibraryError = 4
// LibraryErrorSettings wraps GST_LIBRARY_ERROR_SETTINGS
//
// used when the library doesn't accept settings.
LibraryErrorSettings LibraryError = 5
// LibraryErrorEncode wraps GST_LIBRARY_ERROR_ENCODE
//
// used when the library generated an encoding error.
LibraryErrorEncode LibraryError = 6
// LibraryErrorNumErrors wraps GST_LIBRARY_ERROR_NUM_ERRORS
//
// the number of library error types.
LibraryErrorNumErrors LibraryError = 7
)
func marshalLibraryError(p unsafe.Pointer) (any, error) {
return LibraryError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = LibraryError(0)
func (e LibraryError) InitGoValue(v *gobject.Value) {
v.Init(TypeLibraryError)
v.SetEnum(int(e))
}
func (e LibraryError) String() string {
switch e {
case LibraryErrorEncode: return "LibraryErrorEncode"
case LibraryErrorFailed: return "LibraryErrorFailed"
case LibraryErrorInit: return "LibraryErrorInit"
case LibraryErrorNumErrors: return "LibraryErrorNumErrors"
case LibraryErrorSettings: return "LibraryErrorSettings"
case LibraryErrorShutdown: return "LibraryErrorShutdown"
case LibraryErrorTooLaZY: return "LibraryErrorTooLaZY"
default: return fmt.Sprintf("LibraryError(%d)", e)
}
}
// PadDirection wraps GstPadDirection
//
// The direction of a pad.
type PadDirection C.int
const (
// PadUnknown wraps GST_PAD_UNKNOWN
//
// direction is unknown.
PadUnknown PadDirection = 0
// PadSrc wraps GST_PAD_SRC
//
// the pad is a source pad.
PadSrc PadDirection = 1
// PadSink wraps GST_PAD_SINK
//
// the pad is a sink pad.
PadSink PadDirection = 2
)
func marshalPadDirection(p unsafe.Pointer) (any, error) {
return PadDirection(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PadDirection(0)
func (e PadDirection) InitGoValue(v *gobject.Value) {
v.Init(TypePadDirection)
v.SetEnum(int(e))
}
func (e PadDirection) String() string {
switch e {
case PadSink: return "PadSink"
case PadSrc: return "PadSrc"
case PadUnknown: return "PadUnknown"
default: return fmt.Sprintf("PadDirection(%d)", e)
}
}
// PadLinkReturn wraps GstPadLinkReturn
//
// Result values from gst_pad_link and friends.
type PadLinkReturn C.int
const (
// PadLinkOK wraps GST_PAD_LINK_OK
//
// link succeeded
PadLinkOK PadLinkReturn = 0
// PadLinkWrongHierarchy wraps GST_PAD_LINK_WRONG_HIERARCHY
//
// pads have no common grandparent
PadLinkWrongHierarchy PadLinkReturn = -1
// PadLinkWasLinked wraps GST_PAD_LINK_WAS_LINKED
//
// pad was already linked
PadLinkWasLinked PadLinkReturn = -2
// PadLinkWrongDirection wraps GST_PAD_LINK_WRONG_DIRECTION
//
// pads have wrong direction
PadLinkWrongDirection PadLinkReturn = -3
// PadLinkNoformat wraps GST_PAD_LINK_NOFORMAT
//
// pads do not have common format
PadLinkNoformat PadLinkReturn = -4
// PadLinkNosched wraps GST_PAD_LINK_NOSCHED
//
// pads cannot cooperate in scheduling
PadLinkNosched PadLinkReturn = -5
// PadLinkRefused wraps GST_PAD_LINK_REFUSED
//
// refused for some reason
PadLinkRefused PadLinkReturn = -6
)
func marshalPadLinkReturn(p unsafe.Pointer) (any, error) {
return PadLinkReturn(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PadLinkReturn(0)
func (e PadLinkReturn) InitGoValue(v *gobject.Value) {
v.Init(TypePadLinkReturn)
v.SetEnum(int(e))
}
func (e PadLinkReturn) String() string {
switch e {
case PadLinkNoformat: return "PadLinkNoformat"
case PadLinkNosched: return "PadLinkNosched"
case PadLinkOK: return "PadLinkOK"
case PadLinkRefused: return "PadLinkRefused"
case PadLinkWasLinked: return "PadLinkWasLinked"
case PadLinkWrongDirection: return "PadLinkWrongDirection"
case PadLinkWrongHierarchy: return "PadLinkWrongHierarchy"
default: return fmt.Sprintf("PadLinkReturn(%d)", e)
}
}
// PadMode wraps GstPadMode
//
// The status of a GstPad. After activating a pad, which usually happens when the
// parent element goes from READY to PAUSED, the GstPadMode defines if the
// pad operates in push or pull mode.
type PadMode C.int
const (
// PadModeNone wraps GST_PAD_MODE_NONE
//
// Pad will not handle dataflow
PadModeNone PadMode = 0
// PadModePush wraps GST_PAD_MODE_PUSH
//
// Pad handles dataflow in downstream push mode
PadModePush PadMode = 1
// PadModePull wraps GST_PAD_MODE_PULL
//
// Pad handles dataflow in upstream pull mode
PadModePull PadMode = 2
)
func marshalPadMode(p unsafe.Pointer) (any, error) {
return PadMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PadMode(0)
func (e PadMode) InitGoValue(v *gobject.Value) {
v.Init(TypePadMode)
v.SetEnum(int(e))
}
func (e PadMode) String() string {
switch e {
case PadModeNone: return "PadModeNone"
case PadModePull: return "PadModePull"
case PadModePush: return "PadModePush"
default: return fmt.Sprintf("PadMode(%d)", e)
}
}
// PadPresence wraps GstPadPresence
//
// Indicates when this pad will become available.
type PadPresence C.int
const (
// PadAlways wraps GST_PAD_ALWAYS
//
// the pad is always available
PadAlways PadPresence = 0
// PadSometimes wraps GST_PAD_SOMETIMES
//
// the pad will become available depending on the media stream
PadSometimes PadPresence = 1
// PadRequest wraps GST_PAD_REQUEST
//
// the pad is only available on request with
// gst_element_request_pad().
PadRequest PadPresence = 2
)
func marshalPadPresence(p unsafe.Pointer) (any, error) {
return PadPresence(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PadPresence(0)
func (e PadPresence) InitGoValue(v *gobject.Value) {
v.Init(TypePadPresence)
v.SetEnum(int(e))
}
func (e PadPresence) String() string {
switch e {
case PadAlways: return "PadAlways"
case PadRequest: return "PadRequest"
case PadSometimes: return "PadSometimes"
default: return fmt.Sprintf("PadPresence(%d)", e)
}
}
// PadProbeReturn wraps GstPadProbeReturn
//
// Different return values for the #GstPadProbeCallback.
type PadProbeReturn C.int
const (
// PadProbeDrop wraps GST_PAD_PROBE_DROP
//
// drop data in data probes. For push mode this means that
// the data item is not sent downstream. For pull mode, it means that
// the data item is not passed upstream. In both cases, no other probes
// are called for this item and %GST_FLOW_OK or %TRUE is returned to the
// caller.
PadProbeDrop PadProbeReturn = 0
// PadProbeOK wraps GST_PAD_PROBE_OK
//
// normal probe return value. This leaves the probe in
// place, and defers decisions about dropping or passing data to other
// probes, if any. If there are no other probes, the default behaviour
// for the probe type applies ('block' for blocking probes,
// and 'pass' for non-blocking probes).
PadProbeOK PadProbeReturn = 1
// PadProbeRemove wraps GST_PAD_PROBE_REMOVE
//
// remove this probe, passing the data. For blocking probes
// this will cause data flow to unblock, unless there are also other
// blocking probes installed.
PadProbeRemove PadProbeReturn = 2
// PadProbePass wraps GST_PAD_PROBE_PASS
//
// pass the data item in the block probe and block on the
// next item. Note, that if there are multiple pad probes installed and
// any probe returns PASS, the data will be passed.
PadProbePass PadProbeReturn = 3
// PadProbeHandled wraps GST_PAD_PROBE_HANDLED
//
// Data has been handled in the probe and will not be
// forwarded further. For events and buffers this is the same behaviour as
// %GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer
// or event yourself). For queries it will also return %TRUE to the caller.
// The probe can also modify the #GstFlowReturn value by using the
// #GST_PAD_PROBE_INFO_FLOW_RETURN() accessor.
// Note that the resulting query must contain valid entries.
// Since: 1.6
PadProbeHandled PadProbeReturn = 4
)
func marshalPadProbeReturn(p unsafe.Pointer) (any, error) {
return PadProbeReturn(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PadProbeReturn(0)
func (e PadProbeReturn) InitGoValue(v *gobject.Value) {
v.Init(TypePadProbeReturn)
v.SetEnum(int(e))
}
func (e PadProbeReturn) String() string {
switch e {
case PadProbeDrop: return "PadProbeDrop"
case PadProbeHandled: return "PadProbeHandled"
case PadProbeOK: return "PadProbeOK"
case PadProbePass: return "PadProbePass"
case PadProbeRemove: return "PadProbeRemove"
default: return fmt.Sprintf("PadProbeReturn(%d)", e)
}
}
// ParseError wraps GstParseError
//
// The different parsing errors that can occur.
type ParseError C.int
const (
// ParseErrorSyntax wraps GST_PARSE_ERROR_SYNTAX
//
// A syntax error occurred.
ParseErrorSyntax ParseError = 0
// ParseErrorNoSuchElement wraps GST_PARSE_ERROR_NO_SUCH_ELEMENT
//
// The description contained an unknown element
ParseErrorNoSuchElement ParseError = 1
// ParseErrorNoSuchProperty wraps GST_PARSE_ERROR_NO_SUCH_PROPERTY
//
// An element did not have a specified property
ParseErrorNoSuchProperty ParseError = 2
// ParseErrorLink wraps GST_PARSE_ERROR_LINK
//
// There was an error linking two pads.
ParseErrorLink ParseError = 3
// ParseErrorCouldNotSetProperty wraps GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY
//
// There was an error setting a property
ParseErrorCouldNotSetProperty ParseError = 4
// ParseErrorEmptyBin wraps GST_PARSE_ERROR_EMPTY_BIN
//
// An empty bin was specified.
ParseErrorEmptyBin ParseError = 5
// ParseErrorEmpty wraps GST_PARSE_ERROR_EMPTY
//
// An empty description was specified
ParseErrorEmpty ParseError = 6
// ParseErrorDelayedLink wraps GST_PARSE_ERROR_DELAYED_LINK
//
// A delayed link did not get resolved.
ParseErrorDelayedLink ParseError = 7
)
func marshalParseError(p unsafe.Pointer) (any, error) {
return ParseError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ParseError(0)
func (e ParseError) InitGoValue(v *gobject.Value) {
v.Init(TypeParseError)
v.SetEnum(int(e))
}
func (e ParseError) String() string {
switch e {
case ParseErrorCouldNotSetProperty: return "ParseErrorCouldNotSetProperty"
case ParseErrorDelayedLink: return "ParseErrorDelayedLink"
case ParseErrorEmpty: return "ParseErrorEmpty"
case ParseErrorEmptyBin: return "ParseErrorEmptyBin"
case ParseErrorLink: return "ParseErrorLink"
case ParseErrorNoSuchElement: return "ParseErrorNoSuchElement"
case ParseErrorNoSuchProperty: return "ParseErrorNoSuchProperty"
case ParseErrorSyntax: return "ParseErrorSyntax"
default: return fmt.Sprintf("ParseError(%d)", e)
}
}
// PluginError wraps GstPluginError
//
// The plugin loading errors
type PluginError C.int
const (
// PluginErrorModule wraps GST_PLUGIN_ERROR_MODULE
//
// The plugin could not be loaded
PluginErrorModule PluginError = 0
// PluginErrorDependencies wraps GST_PLUGIN_ERROR_DEPENDENCIES
//
// The plugin has unresolved dependencies
PluginErrorDependencies PluginError = 1
// PluginErrorNameMismatch wraps GST_PLUGIN_ERROR_NAME_MISMATCH
//
// The plugin has already be loaded from a different file
PluginErrorNameMismatch PluginError = 2
)
func marshalPluginError(p unsafe.Pointer) (any, error) {
return PluginError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PluginError(0)
func (e PluginError) InitGoValue(v *gobject.Value) {
v.Init(TypePluginError)
v.SetEnum(int(e))
}
func (e PluginError) String() string {
switch e {
case PluginErrorDependencies: return "PluginErrorDependencies"
case PluginErrorModule: return "PluginErrorModule"
case PluginErrorNameMismatch: return "PluginErrorNameMismatch"
default: return fmt.Sprintf("PluginError(%d)", e)
}
}
// ProgressType wraps GstProgressType
//
// The type of a %GST_MESSAGE_PROGRESS. The progress messages inform the
// application of the status of asynchronous tasks.
type ProgressType C.int
const (
// ProgressTypeStart wraps GST_PROGRESS_TYPE_START
//
// A new task started.
ProgressTypeStart ProgressType = 0
// ProgressTypeContinue wraps GST_PROGRESS_TYPE_CONTINUE
//
// A task completed and a new one continues.
ProgressTypeContinue ProgressType = 1
// ProgressTypeComplete wraps GST_PROGRESS_TYPE_COMPLETE
//
// A task completed.
ProgressTypeComplete ProgressType = 2
// ProgressTypeCanceled wraps GST_PROGRESS_TYPE_CANCELED
//
// A task was canceled.
ProgressTypeCanceled ProgressType = 3
// ProgressTypeError wraps GST_PROGRESS_TYPE_ERROR
//
// A task caused an error. An error message is also
// posted on the bus.
ProgressTypeError ProgressType = 4
)
func marshalProgressType(p unsafe.Pointer) (any, error) {
return ProgressType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ProgressType(0)
func (e ProgressType) InitGoValue(v *gobject.Value) {
v.Init(TypeProgressType)
v.SetEnum(int(e))
}
func (e ProgressType) String() string {
switch e {
case ProgressTypeCanceled: return "ProgressTypeCanceled"
case ProgressTypeComplete: return "ProgressTypeComplete"
case ProgressTypeContinue: return "ProgressTypeContinue"
case ProgressTypeError: return "ProgressTypeError"
case ProgressTypeStart: return "ProgressTypeStart"
default: return fmt.Sprintf("ProgressType(%d)", e)
}
}
// PromiseResult wraps GstPromiseResult
//
// The result of a #GstPromise
type PromiseResult C.int
const (
// PromiseResultPending wraps GST_PROMISE_RESULT_PENDING
//
// Initial state. Waiting for transition to any
// other state.
PromiseResultPending PromiseResult = 0
// PromiseResultInterrupted wraps GST_PROMISE_RESULT_INTERRUPTED
//
// Interrupted by the consumer as it doesn't
// want the value anymore.
PromiseResultInterrupted PromiseResult = 1
// PromiseResultReplied wraps GST_PROMISE_RESULT_REPLIED
//
// A producer marked a reply
PromiseResultReplied PromiseResult = 2
// PromiseResultExpired wraps GST_PROMISE_RESULT_EXPIRED
//
// The promise expired (the carrying object
// lost all refs) and the promise will never be fulfilled.
PromiseResultExpired PromiseResult = 3
)
func marshalPromiseResult(p unsafe.Pointer) (any, error) {
return PromiseResult(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = PromiseResult(0)
func (e PromiseResult) InitGoValue(v *gobject.Value) {
v.Init(TypePromiseResult)
v.SetEnum(int(e))
}
func (e PromiseResult) String() string {
switch e {
case PromiseResultExpired: return "PromiseResultExpired"
case PromiseResultInterrupted: return "PromiseResultInterrupted"
case PromiseResultPending: return "PromiseResultPending"
case PromiseResultReplied: return "PromiseResultReplied"
default: return fmt.Sprintf("PromiseResult(%d)", e)
}
}
// QOSType wraps GstQOSType
//
// The different types of QoS events that can be given to the
// gst_event_new_qos() method.
type QOSType C.int
const (
// QosTypeOverflow wraps GST_QOS_TYPE_OVERFLOW
//
// The QoS event type that is produced when upstream
// elements are producing data too quickly and the element can't keep up
// processing the data. Upstream should reduce their production rate. This
// type is also used when buffers arrive early or in time.
QosTypeOverflow QOSType = 0
// QosTypeUnderflow wraps GST_QOS_TYPE_UNDERFLOW
//
// The QoS event type that is produced when upstream
// elements are producing data too slowly and need to speed up their
// production rate.
QosTypeUnderflow QOSType = 1
// QosTypeThrottle wraps GST_QOS_TYPE_THROTTLE
//
// The QoS event type that is produced when the
// application enabled throttling to limit the data rate.
QosTypeThrottle QOSType = 2
)
func marshalQOSType(p unsafe.Pointer) (any, error) {
return QOSType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = QOSType(0)
func (e QOSType) InitGoValue(v *gobject.Value) {
v.Init(TypeQOSType)
v.SetEnum(int(e))
}
func (e QOSType) String() string {
switch e {
case QosTypeOverflow: return "QosTypeOverflow"
case QosTypeThrottle: return "QosTypeThrottle"
case QosTypeUnderflow: return "QosTypeUnderflow"
default: return fmt.Sprintf("QOSType(%d)", e)
}
}
// QueryType wraps GstQueryType
//
// Standard predefined Query types
type QueryType C.int
const (
// QueryUnknown wraps GST_QUERY_UNKNOWN
//
// unknown query type
QueryUnknown QueryType = 0
// QueryPosition wraps GST_QUERY_POSITION
//
// current position in stream
QueryPosition QueryType = 2563
// QueryDuration wraps GST_QUERY_DURATION
//
// total duration of the stream
QueryDuration QueryType = 5123
// QueryLatency wraps GST_QUERY_LATENCY
//
// latency of stream
QueryLatency QueryType = 7683
// QueryJitter wraps GST_QUERY_JITTER
//
// current jitter of stream
QueryJitter QueryType = 10243
// QueryRate wraps GST_QUERY_RATE
//
// current rate of the stream
QueryRate QueryType = 12803
// QuerySeeking wraps GST_QUERY_SEEKING
//
// seeking capabilities
QuerySeeking QueryType = 15363
// QuerySegment wraps GST_QUERY_SEGMENT
//
// segment start/stop positions
QuerySegment QueryType = 17923
// QueryConvert wraps GST_QUERY_CONVERT
//
// convert values between formats
QueryConvert QueryType = 20483
// QueryFormats wraps GST_QUERY_FORMATS
//
// query supported formats for convert
QueryFormats QueryType = 23043
// QueryBuffering wraps GST_QUERY_BUFFERING
//
// query available media for efficient seeking.
QueryBuffering QueryType = 28163
// QueryCustom wraps GST_QUERY_CUSTOM
//
// a custom application or element defined query.
QueryCustom QueryType = 30723
// QueryURI wraps GST_QUERY_URI
//
// query the URI of the source or sink.
QueryURI QueryType = 33283
// QueryAllocation wraps GST_QUERY_ALLOCATION
//
// the buffer allocation properties
QueryAllocation QueryType = 35846
// QueryScheduling wraps GST_QUERY_SCHEDULING
//
// the scheduling properties
QueryScheduling QueryType = 38401
// QueryAcceptCaps wraps GST_QUERY_ACCEPT_CAPS
//
// the accept caps query
QueryAcceptCaps QueryType = 40963
// QueryCaps wraps GST_QUERY_CAPS
//
// the caps query
QueryCaps QueryType = 43523
// QueryDrain wraps GST_QUERY_DRAIN
//
// wait till all serialized data is consumed downstream
QueryDrain QueryType = 46086
// QueryContext wraps GST_QUERY_CONTEXT
//
// query the pipeline-local context from
// downstream or upstream (since 1.2)
QueryContext QueryType = 48643
// QueryBitrate wraps GST_QUERY_BITRATE
//
// the bitrate query (since 1.16)
QueryBitrate QueryType = 51202
// QuerySelectable wraps GST_QUERY_SELECTABLE
//
// Query stream selection capability.
QuerySelectable QueryType = 53763
)
func marshalQueryType(p unsafe.Pointer) (any, error) {
return QueryType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = QueryType(0)
func (e QueryType) InitGoValue(v *gobject.Value) {
v.Init(TypeQueryType)
v.SetEnum(int(e))
}
func (e QueryType) String() string {
switch e {
case QueryAcceptCaps: return "QueryAcceptCaps"
case QueryAllocation: return "QueryAllocation"
case QueryBitrate: return "QueryBitrate"
case QueryBuffering: return "QueryBuffering"
case QueryCaps: return "QueryCaps"
case QueryContext: return "QueryContext"
case QueryConvert: return "QueryConvert"
case QueryCustom: return "QueryCustom"
case QueryDrain: return "QueryDrain"
case QueryDuration: return "QueryDuration"
case QueryFormats: return "QueryFormats"
case QueryJitter: return "QueryJitter"
case QueryLatency: return "QueryLatency"
case QueryPosition: return "QueryPosition"
case QueryRate: return "QueryRate"
case QueryScheduling: return "QueryScheduling"
case QuerySeeking: return "QuerySeeking"
case QuerySegment: return "QuerySegment"
case QuerySelectable: return "QuerySelectable"
case QueryURI: return "QueryURI"
case QueryUnknown: return "QueryUnknown"
default: return fmt.Sprintf("QueryType(%d)", e)
}
}
// Rank wraps GstRank
//
// Element priority ranks. Defines the order in which the autoplugger (or
// similar rank-picking mechanisms, such as e.g. gst_element_make_from_uri())
// will choose this element over an alternative one with the same function.
//
// These constants serve as a rough guidance for defining the rank of a
// #GstPluginFeature. Any value is valid, including values bigger than
// @GST_RANK_PRIMARY.
type Rank C.int
const (
// RankNone wraps GST_RANK_NONE
//
// will be chosen last or not at all
RankNone Rank = 0
// RankMarginal wraps GST_RANK_MARGINAL
//
// unlikely to be chosen
RankMarginal Rank = 64
// RankSecondary wraps GST_RANK_SECONDARY
//
// likely to be chosen
RankSecondary Rank = 128
// RankPrimary wraps GST_RANK_PRIMARY
//
// will be chosen first
RankPrimary Rank = 256
)
func marshalRank(p unsafe.Pointer) (any, error) {
return Rank(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = Rank(0)
func (e Rank) InitGoValue(v *gobject.Value) {
v.Init(TypeRank)
v.SetEnum(int(e))
}
func (e Rank) String() string {
switch e {
case RankMarginal: return "RankMarginal"
case RankNone: return "RankNone"
case RankPrimary: return "RankPrimary"
case RankSecondary: return "RankSecondary"
default: return fmt.Sprintf("Rank(%d)", e)
}
}
// ResourceError wraps GstResourceError
//
// Resource errors are for any resource used by an element:
// memory, files, network connections, process space, ...
// They're typically used by source and sink elements.
type ResourceError C.int
const (
// ResourceErrorFailed wraps GST_RESOURCE_ERROR_FAILED
//
// a general error which doesn't fit in any other
// category. Make sure you add a custom message to the error call.
ResourceErrorFailed ResourceError = 1
// ResourceErrorTooLaZY wraps GST_RESOURCE_ERROR_TOO_LAZY
//
// do not use this except as a placeholder for
// deciding where to go while developing code.
ResourceErrorTooLaZY ResourceError = 2
// ResourceErrorNotFound wraps GST_RESOURCE_ERROR_NOT_FOUND
//
// used when the resource could not be found.
ResourceErrorNotFound ResourceError = 3
// ResourceErrorBusy wraps GST_RESOURCE_ERROR_BUSY
//
// used when resource is busy.
ResourceErrorBusy ResourceError = 4
// ResourceErrorOpenRead wraps GST_RESOURCE_ERROR_OPEN_READ
//
// used when resource fails to open for reading.
ResourceErrorOpenRead ResourceError = 5
// ResourceErrorOpenWrite wraps GST_RESOURCE_ERROR_OPEN_WRITE
//
// used when resource fails to open for writing.
ResourceErrorOpenWrite ResourceError = 6
// ResourceErrorOpenReadWrite wraps GST_RESOURCE_ERROR_OPEN_READ_WRITE
//
// used when resource cannot be opened for
// both reading and writing, or either (but unspecified which).
ResourceErrorOpenReadWrite ResourceError = 7
// ResourceErrorClose wraps GST_RESOURCE_ERROR_CLOSE
//
// used when the resource can't be closed.
ResourceErrorClose ResourceError = 8
// ResourceErrorRead wraps GST_RESOURCE_ERROR_READ
//
// used when the resource can't be read from.
ResourceErrorRead ResourceError = 9
// ResourceErrorWrite wraps GST_RESOURCE_ERROR_WRITE
//
// used when the resource can't be written to.
ResourceErrorWrite ResourceError = 10
// ResourceErrorSeek wraps GST_RESOURCE_ERROR_SEEK
//
// used when a seek on the resource fails.
ResourceErrorSeek ResourceError = 11
// ResourceErrorSync wraps GST_RESOURCE_ERROR_SYNC
//
// used when a synchronize on the resource fails.
ResourceErrorSync ResourceError = 12
// ResourceErrorSettings wraps GST_RESOURCE_ERROR_SETTINGS
//
// used when settings can't be manipulated on.
ResourceErrorSettings ResourceError = 13
// ResourceErrorNoSpaceLeft wraps GST_RESOURCE_ERROR_NO_SPACE_LEFT
//
// used when the resource has no space left.
ResourceErrorNoSpaceLeft ResourceError = 14
// ResourceErrorNotAuthorized wraps GST_RESOURCE_ERROR_NOT_AUTHORIZED
//
// used when the resource can't be opened
// due to missing authorization.
// (Since: 1.2.4)
ResourceErrorNotAuthorized ResourceError = 15
// ResourceErrorNumErrors wraps GST_RESOURCE_ERROR_NUM_ERRORS
//
// the number of resource error types.
ResourceErrorNumErrors ResourceError = 16
)
func marshalResourceError(p unsafe.Pointer) (any, error) {
return ResourceError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = ResourceError(0)
func (e ResourceError) InitGoValue(v *gobject.Value) {
v.Init(TypeResourceError)
v.SetEnum(int(e))
}
func (e ResourceError) String() string {
switch e {
case ResourceErrorBusy: return "ResourceErrorBusy"
case ResourceErrorClose: return "ResourceErrorClose"
case ResourceErrorFailed: return "ResourceErrorFailed"
case ResourceErrorNoSpaceLeft: return "ResourceErrorNoSpaceLeft"
case ResourceErrorNotAuthorized: return "ResourceErrorNotAuthorized"
case ResourceErrorNotFound: return "ResourceErrorNotFound"
case ResourceErrorNumErrors: return "ResourceErrorNumErrors"
case ResourceErrorOpenRead: return "ResourceErrorOpenRead"
case ResourceErrorOpenReadWrite: return "ResourceErrorOpenReadWrite"
case ResourceErrorOpenWrite: return "ResourceErrorOpenWrite"
case ResourceErrorRead: return "ResourceErrorRead"
case ResourceErrorSeek: return "ResourceErrorSeek"
case ResourceErrorSettings: return "ResourceErrorSettings"
case ResourceErrorSync: return "ResourceErrorSync"
case ResourceErrorTooLaZY: return "ResourceErrorTooLaZY"
case ResourceErrorWrite: return "ResourceErrorWrite"
default: return fmt.Sprintf("ResourceError(%d)", e)
}
}
// SearchMode wraps GstSearchMode
//
// The different search modes.
type SearchMode C.int
const (
// SearchModeExact wraps GST_SEARCH_MODE_EXACT
//
// Only search for exact matches.
SearchModeExact SearchMode = 0
// SearchModeBefore wraps GST_SEARCH_MODE_BEFORE
//
// Search for an exact match or the element just before.
SearchModeBefore SearchMode = 1
// SearchModeAfter wraps GST_SEARCH_MODE_AFTER
//
// Search for an exact match or the element just after.
SearchModeAfter SearchMode = 2
)
func marshalSearchMode(p unsafe.Pointer) (any, error) {
return SearchMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = SearchMode(0)
func (e SearchMode) InitGoValue(v *gobject.Value) {
v.Init(TypeSearchMode)
v.SetEnum(int(e))
}
func (e SearchMode) String() string {
switch e {
case SearchModeAfter: return "SearchModeAfter"
case SearchModeBefore: return "SearchModeBefore"
case SearchModeExact: return "SearchModeExact"
default: return fmt.Sprintf("SearchMode(%d)", e)
}
}
// SeekType wraps GstSeekType
//
// The different types of seek events. When constructing a seek event with
// gst_event_new_seek() or when doing gst_segment_do_seek ().
type SeekType C.int
const (
// SeekTypeNone wraps GST_SEEK_TYPE_NONE
//
// no change in position is required
SeekTypeNone SeekType = 0
// SeekTypeSet wraps GST_SEEK_TYPE_SET
//
// absolute position is requested
SeekTypeSet SeekType = 1
// SeekTypeEnd wraps GST_SEEK_TYPE_END
//
// relative position to duration is requested
SeekTypeEnd SeekType = 2
)
func marshalSeekType(p unsafe.Pointer) (any, error) {
return SeekType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = SeekType(0)
func (e SeekType) InitGoValue(v *gobject.Value) {
v.Init(TypeSeekType)
v.SetEnum(int(e))
}
func (e SeekType) String() string {
switch e {
case SeekTypeEnd: return "SeekTypeEnd"
case SeekTypeNone: return "SeekTypeNone"
case SeekTypeSet: return "SeekTypeSet"
default: return fmt.Sprintf("SeekType(%d)", e)
}
}
// State wraps GstState
//
// The possible states an element can be in. States can be changed using
// gst_element_set_state() and checked using gst_element_get_state().
type State C.int
const (
// StateVoidPending wraps GST_STATE_VOID_PENDING
//
// no pending state.
StateVoidPending State = 0
// StateNull wraps GST_STATE_NULL
//
// the NULL state or initial state of an element.
StateNull State = 1
// StateReady wraps GST_STATE_READY
//
// the element is ready to go to PAUSED.
StateReady State = 2
// StatePaused wraps GST_STATE_PAUSED
//
// the element is PAUSED, it is ready to accept and
// process data. Sink elements however only accept one
// buffer and then block.
StatePaused State = 3
// StatePlaying wraps GST_STATE_PLAYING
//
// the element is PLAYING, the #GstClock is running and
// the data is flowing.
StatePlaying State = 4
)
func marshalState(p unsafe.Pointer) (any, error) {
return State(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = State(0)
func (e State) InitGoValue(v *gobject.Value) {
v.Init(TypeState)
v.SetEnum(int(e))
}
func (e State) String() string {
switch e {
case StateNull: return "StateNull"
case StatePaused: return "StatePaused"
case StatePlaying: return "StatePlaying"
case StateReady: return "StateReady"
case StateVoidPending: return "StateVoidPending"
default: return fmt.Sprintf("State(%d)", e)
}
}
// StateChange wraps GstStateChange
//
// These are the different state changes an element goes through.
// %GST_STATE_NULL &amp;rArr; %GST_STATE_PLAYING is called an upwards state change
// and %GST_STATE_PLAYING &amp;rArr; %GST_STATE_NULL a downwards state change.
type StateChange C.int
const (
// StateChangeNullToReady wraps GST_STATE_CHANGE_NULL_TO_READY
//
// state change from NULL to READY.
// * The element must check if the resources it needs are available. Device
// sinks and -sources typically try to probe the device to constrain their
// caps.
// * The element opens the device (in case feature need to be probed).
StateChangeNullToReady StateChange = 10
// StateChangeReadyToPaused wraps GST_STATE_CHANGE_READY_TO_PAUSED
//
// state change from READY to PAUSED.
// * The element pads are activated in order to receive data in PAUSED.
// Streaming threads are started.
// * Some elements might need to return %GST_STATE_CHANGE_ASYNC and complete
// the state change when they have enough information. It is a requirement
// for sinks to return %GST_STATE_CHANGE_ASYNC and complete the state change
// when they receive the first buffer or %GST_EVENT_EOS (preroll).
// Sinks also block the dataflow when in PAUSED.
// * A pipeline resets the running_time to 0.
// * Live sources return %GST_STATE_CHANGE_NO_PREROLL and don't generate data.
StateChangeReadyToPaused StateChange = 19
// StateChangePausedToPlaying wraps GST_STATE_CHANGE_PAUSED_TO_PLAYING
//
// state change from PAUSED to PLAYING.
// * Most elements ignore this state change.
// * The pipeline selects a #GstClock and distributes this to all the children
// before setting them to PLAYING. This means that it is only allowed to
// synchronize on the #GstClock in the PLAYING state.
// * The pipeline uses the #GstClock and the running_time to calculate the
// base_time. The base_time is distributed to all children when performing
// the state change.
// * Sink elements stop blocking on the preroll buffer or event and start
// rendering the data.
// * Sinks can post %GST_MESSAGE_EOS in the PLAYING state. It is not allowed
// to post %GST_MESSAGE_EOS when not in the PLAYING state.
// * While streaming in PAUSED or PLAYING elements can create and remove
// sometimes pads.
// * Live sources start generating data and return %GST_STATE_CHANGE_SUCCESS.
StateChangePausedToPlaying StateChange = 28
// StateChangePlayingToPaused wraps GST_STATE_CHANGE_PLAYING_TO_PAUSED
//
// state change from PLAYING to PAUSED.
// * Most elements ignore this state change.
// * The pipeline calculates the running_time based on the last selected
// #GstClock and the base_time. It stores this information to continue
// playback when going back to the PLAYING state.
// * Sinks unblock any #GstClock wait calls.
// * When a sink does not have a pending buffer to play, it returns
// #GST_STATE_CHANGE_ASYNC from this state change and completes the state
// change when it receives a new buffer or an %GST_EVENT_EOS.
// * Any queued %GST_MESSAGE_EOS items are removed since they will be reposted
// when going back to the PLAYING state. The EOS messages are queued in
// #GstBin containers.
// * Live sources stop generating data and return %GST_STATE_CHANGE_NO_PREROLL.
StateChangePlayingToPaused StateChange = 35
// StateChangePausedToReady wraps GST_STATE_CHANGE_PAUSED_TO_READY
//
// state change from PAUSED to READY.
// * Sinks unblock any waits in the preroll.
// * Elements unblock any waits on devices
// * Chain or get_range functions return %GST_FLOW_FLUSHING.
// * The element pads are deactivated so that streaming becomes impossible and
// all streaming threads are stopped.
// * The sink forgets all negotiated formats
// * Elements remove all sometimes pads
StateChangePausedToReady StateChange = 26
// StateChangeReadyToNull wraps GST_STATE_CHANGE_READY_TO_NULL
//
// state change from READY to NULL.
// * Elements close devices
// * Elements reset any internal state.
StateChangeReadyToNull StateChange = 17
// StateChangeNullToNull wraps GST_STATE_CHANGE_NULL_TO_NULL
//
// state change from NULL to NULL. (Since: 1.14)
StateChangeNullToNull StateChange = 9
// StateChangeReadyToReady wraps GST_STATE_CHANGE_READY_TO_READY
//
// state change from READY to READY,
// This might happen when going to PAUSED asynchronously failed, in that case
// elements should make sure they are in a proper, coherent READY state. (Since: 1.14)
StateChangeReadyToReady StateChange = 18
// StateChangePausedToPaused wraps GST_STATE_CHANGE_PAUSED_TO_PAUSED
//
// state change from PAUSED to PAUSED.
// This might happen when elements were in PLAYING state and 'lost state',
// they should make sure to go back to real 'PAUSED' state (prerolling for example). (Since: 1.14)
StateChangePausedToPaused StateChange = 27
// StateChangePlayingToPlaying wraps GST_STATE_CHANGE_PLAYING_TO_PLAYING
//
// state change from PLAYING to PLAYING. (Since: 1.14)
StateChangePlayingToPlaying StateChange = 36
)
func marshalStateChange(p unsafe.Pointer) (any, error) {
return StateChange(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = StateChange(0)
func (e StateChange) InitGoValue(v *gobject.Value) {
v.Init(TypeStateChange)
v.SetEnum(int(e))
}
func (e StateChange) String() string {
switch e {
case StateChangeNullToNull: return "StateChangeNullToNull"
case StateChangeNullToReady: return "StateChangeNullToReady"
case StateChangePausedToPaused: return "StateChangePausedToPaused"
case StateChangePausedToPlaying: return "StateChangePausedToPlaying"
case StateChangePausedToReady: return "StateChangePausedToReady"
case StateChangePlayingToPaused: return "StateChangePlayingToPaused"
case StateChangePlayingToPlaying: return "StateChangePlayingToPlaying"
case StateChangeReadyToNull: return "StateChangeReadyToNull"
case StateChangeReadyToPaused: return "StateChangeReadyToPaused"
case StateChangeReadyToReady: return "StateChangeReadyToReady"
default: return fmt.Sprintf("StateChange(%d)", e)
}
}
// StateChangeReturn wraps GstStateChangeReturn
//
// The possible return values from a state change function such as
// gst_element_set_state(). Only @GST_STATE_CHANGE_FAILURE is a real failure.
type StateChangeReturn C.int
const (
// StateChangeFailure wraps GST_STATE_CHANGE_FAILURE
//
// the state change failed
StateChangeFailure StateChangeReturn = 0
// StateChangeSuccess wraps GST_STATE_CHANGE_SUCCESS
//
// the state change succeeded
StateChangeSuccess StateChangeReturn = 1
// StateChangeAsync wraps GST_STATE_CHANGE_ASYNC
//
// the state change will happen asynchronously
StateChangeAsync StateChangeReturn = 2
// StateChangeNoPreroll wraps GST_STATE_CHANGE_NO_PREROLL
//
// the state change succeeded but the element
// cannot produce data in %GST_STATE_PAUSED.
// This typically happens with live sources.
StateChangeNoPreroll StateChangeReturn = 3
)
func marshalStateChangeReturn(p unsafe.Pointer) (any, error) {
return StateChangeReturn(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = StateChangeReturn(0)
func (e StateChangeReturn) InitGoValue(v *gobject.Value) {
v.Init(TypeStateChangeReturn)
v.SetEnum(int(e))
}
func (e StateChangeReturn) String() string {
switch e {
case StateChangeAsync: return "StateChangeAsync"
case StateChangeFailure: return "StateChangeFailure"
case StateChangeNoPreroll: return "StateChangeNoPreroll"
case StateChangeSuccess: return "StateChangeSuccess"
default: return fmt.Sprintf("StateChangeReturn(%d)", e)
}
}
// StreamError wraps GstStreamError
//
// Stream errors are for anything related to the stream being processed:
// format errors, media type errors, ...
// They're typically used by decoders, demuxers, converters, ...
type StreamError C.int
const (
// StreamErrorFailed wraps GST_STREAM_ERROR_FAILED
//
// a general error which doesn't fit in any other
// category. Make sure you add a custom message to the error call.
StreamErrorFailed StreamError = 1
// StreamErrorTooLaZY wraps GST_STREAM_ERROR_TOO_LAZY
//
// do not use this except as a placeholder for
// deciding where to go while developing code.
StreamErrorTooLaZY StreamError = 2
// StreamErrorNotImplemented wraps GST_STREAM_ERROR_NOT_IMPLEMENTED
//
// use this when you do not want to implement
// this functionality yet.
StreamErrorNotImplemented StreamError = 3
// StreamErrorTypeNotFound wraps GST_STREAM_ERROR_TYPE_NOT_FOUND
//
// used when the element doesn't know the
// stream's type.
StreamErrorTypeNotFound StreamError = 4
// StreamErrorWrongType wraps GST_STREAM_ERROR_WRONG_TYPE
//
// used when the element doesn't handle this type
// of stream.
StreamErrorWrongType StreamError = 5
// StreamErrorCodecNotFound wraps GST_STREAM_ERROR_CODEC_NOT_FOUND
//
// used when there's no codec to handle the
// stream's type.
StreamErrorCodecNotFound StreamError = 6
// StreamErrorDecode wraps GST_STREAM_ERROR_DECODE
//
// used when decoding fails.
StreamErrorDecode StreamError = 7
// StreamErrorEncode wraps GST_STREAM_ERROR_ENCODE
//
// used when encoding fails.
StreamErrorEncode StreamError = 8
// StreamErrorDemux wraps GST_STREAM_ERROR_DEMUX
//
// used when demuxing fails.
StreamErrorDemux StreamError = 9
// StreamErrorMux wraps GST_STREAM_ERROR_MUX
//
// used when muxing fails.
StreamErrorMux StreamError = 10
// StreamErrorFormat wraps GST_STREAM_ERROR_FORMAT
//
// used when the stream is of the wrong format
// (for example, wrong caps).
StreamErrorFormat StreamError = 11
// StreamErrorDecrypt wraps GST_STREAM_ERROR_DECRYPT
//
// used when the stream is encrypted and can't be
// decrypted because this is not supported by the element.
StreamErrorDecrypt StreamError = 12
// StreamErrorDecryptNokey wraps GST_STREAM_ERROR_DECRYPT_NOKEY
//
// used when the stream is encrypted and
// can't be decrypted because no suitable key is available.
StreamErrorDecryptNokey StreamError = 13
// StreamErrorNumErrors wraps GST_STREAM_ERROR_NUM_ERRORS
//
// the number of stream error types.
StreamErrorNumErrors StreamError = 14
)
func marshalStreamError(p unsafe.Pointer) (any, error) {
return StreamError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = StreamError(0)
func (e StreamError) InitGoValue(v *gobject.Value) {
v.Init(TypeStreamError)
v.SetEnum(int(e))
}
func (e StreamError) String() string {
switch e {
case StreamErrorCodecNotFound: return "StreamErrorCodecNotFound"
case StreamErrorDecode: return "StreamErrorDecode"
case StreamErrorDecrypt: return "StreamErrorDecrypt"
case StreamErrorDecryptNokey: return "StreamErrorDecryptNokey"
case StreamErrorDemux: return "StreamErrorDemux"
case StreamErrorEncode: return "StreamErrorEncode"
case StreamErrorFailed: return "StreamErrorFailed"
case StreamErrorFormat: return "StreamErrorFormat"
case StreamErrorMux: return "StreamErrorMux"
case StreamErrorNotImplemented: return "StreamErrorNotImplemented"
case StreamErrorNumErrors: return "StreamErrorNumErrors"
case StreamErrorTooLaZY: return "StreamErrorTooLaZY"
case StreamErrorTypeNotFound: return "StreamErrorTypeNotFound"
case StreamErrorWrongType: return "StreamErrorWrongType"
default: return fmt.Sprintf("StreamError(%d)", e)
}
}
// StreamStatusType wraps GstStreamStatusType
//
// The type of a %GST_MESSAGE_STREAM_STATUS. The stream status messages inform the
// application of new streaming threads and their status.
type StreamStatusType C.int
const (
// StreamStatusTypeCreate wraps GST_STREAM_STATUS_TYPE_CREATE
//
// A new thread need to be created.
StreamStatusTypeCreate StreamStatusType = 0
// StreamStatusTypeEnter wraps GST_STREAM_STATUS_TYPE_ENTER
//
// a thread entered its loop function
StreamStatusTypeEnter StreamStatusType = 1
// StreamStatusTypeLeave wraps GST_STREAM_STATUS_TYPE_LEAVE
//
// a thread left its loop function
StreamStatusTypeLeave StreamStatusType = 2
// StreamStatusTypeDestroy wraps GST_STREAM_STATUS_TYPE_DESTROY
//
// a thread is destroyed
StreamStatusTypeDestroy StreamStatusType = 3
// StreamStatusTypeStart wraps GST_STREAM_STATUS_TYPE_START
//
// a thread is started
StreamStatusTypeStart StreamStatusType = 8
// StreamStatusTypePause wraps GST_STREAM_STATUS_TYPE_PAUSE
//
// a thread is paused
StreamStatusTypePause StreamStatusType = 9
// StreamStatusTypeStop wraps GST_STREAM_STATUS_TYPE_STOP
//
// a thread is stopped
StreamStatusTypeStop StreamStatusType = 10
)
func marshalStreamStatusType(p unsafe.Pointer) (any, error) {
return StreamStatusType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = StreamStatusType(0)
func (e StreamStatusType) InitGoValue(v *gobject.Value) {
v.Init(TypeStreamStatusType)
v.SetEnum(int(e))
}
func (e StreamStatusType) String() string {
switch e {
case StreamStatusTypeCreate: return "StreamStatusTypeCreate"
case StreamStatusTypeDestroy: return "StreamStatusTypeDestroy"
case StreamStatusTypeEnter: return "StreamStatusTypeEnter"
case StreamStatusTypeLeave: return "StreamStatusTypeLeave"
case StreamStatusTypePause: return "StreamStatusTypePause"
case StreamStatusTypeStart: return "StreamStatusTypeStart"
case StreamStatusTypeStop: return "StreamStatusTypeStop"
default: return fmt.Sprintf("StreamStatusType(%d)", e)
}
}
// StructureChangeType wraps GstStructureChangeType
//
// The type of a %GST_MESSAGE_STRUCTURE_CHANGE.
type StructureChangeType C.int
const (
// StructureChangeTypePadLink wraps GST_STRUCTURE_CHANGE_TYPE_PAD_LINK
//
// Pad linking is starting or done.
StructureChangeTypePadLink StructureChangeType = 0
// StructureChangeTypePadUnlink wraps GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK
//
// Pad unlinking is starting or done.
StructureChangeTypePadUnlink StructureChangeType = 1
)
func marshalStructureChangeType(p unsafe.Pointer) (any, error) {
return StructureChangeType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = StructureChangeType(0)
func (e StructureChangeType) InitGoValue(v *gobject.Value) {
v.Init(TypeStructureChangeType)
v.SetEnum(int(e))
}
func (e StructureChangeType) String() string {
switch e {
case StructureChangeTypePadLink: return "StructureChangeTypePadLink"
case StructureChangeTypePadUnlink: return "StructureChangeTypePadUnlink"
default: return fmt.Sprintf("StructureChangeType(%d)", e)
}
}
// TagFlag wraps GstTagFlag
//
// Extra tag flags used when registering tags.
type TagFlag C.int
const (
// TagFlagUndefined wraps GST_TAG_FLAG_UNDEFINED
//
// undefined flag
TagFlagUndefined TagFlag = 0
// TagFlagMeta wraps GST_TAG_FLAG_META
//
// tag is meta data
TagFlagMeta TagFlag = 1
// TagFlagEncoded wraps GST_TAG_FLAG_ENCODED
//
// tag is encoded
TagFlagEncoded TagFlag = 2
// TagFlagDecoded wraps GST_TAG_FLAG_DECODED
//
// tag is decoded
TagFlagDecoded TagFlag = 3
// TagFlagCount wraps GST_TAG_FLAG_COUNT
//
// number of tag flags
TagFlagCount TagFlag = 4
)
func marshalTagFlag(p unsafe.Pointer) (any, error) {
return TagFlag(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TagFlag(0)
func (e TagFlag) InitGoValue(v *gobject.Value) {
v.Init(TypeTagFlag)
v.SetEnum(int(e))
}
func (e TagFlag) String() string {
switch e {
case TagFlagCount: return "TagFlagCount"
case TagFlagDecoded: return "TagFlagDecoded"
case TagFlagEncoded: return "TagFlagEncoded"
case TagFlagMeta: return "TagFlagMeta"
case TagFlagUndefined: return "TagFlagUndefined"
default: return fmt.Sprintf("TagFlag(%d)", e)
}
}
// TagMergeMode wraps GstTagMergeMode
//
// The different tag merging modes are basically replace, overwrite and append,
// but they can be seen from two directions. Given two taglists: (A) the tags
// already in the element and (B) the ones that are supplied to the element (
// e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a
// %GST_EVENT_TAG), how are these tags merged?
// In the table below this is shown for the cases that a tag exists in the list
// (A) or does not exists (!A) and combinations thereof.
//
// | merge mode | A + B | A + !B | !A + B | !A + !B |
// | ----------- | ----- | ------ | ------ | ------- |
// | REPLACE_ALL | B | ø | B | ø |
// | REPLACE | B | A | B | ø |
// | APPEND | A, B | A | B | ø |
// | PREPEND | B, A | A | B | ø |
// | KEEP | A | A | B | ø |
// | KEEP_ALL | A | A | ø | ø |
type TagMergeMode C.int
const (
// TagMergeUndefined wraps GST_TAG_MERGE_UNDEFINED
//
// undefined merge mode
TagMergeUndefined TagMergeMode = 0
// TagMergeReplaceAll wraps GST_TAG_MERGE_REPLACE_ALL
//
// replace all tags (clear list and append)
TagMergeReplaceAll TagMergeMode = 1
// TagMergeReplace wraps GST_TAG_MERGE_REPLACE
//
// replace tags
TagMergeReplace TagMergeMode = 2
// TagMergeAppend wraps GST_TAG_MERGE_APPEND
//
// append tags
TagMergeAppend TagMergeMode = 3
// TagMergePrepend wraps GST_TAG_MERGE_PREPEND
//
// prepend tags
TagMergePrepend TagMergeMode = 4
// TagMergeKeep wraps GST_TAG_MERGE_KEEP
//
// keep existing tags
TagMergeKeep TagMergeMode = 5
// TagMergeKeepAll wraps GST_TAG_MERGE_KEEP_ALL
//
// keep all existing tags
TagMergeKeepAll TagMergeMode = 6
// TagMergeCount wraps GST_TAG_MERGE_COUNT
//
// the number of merge modes
TagMergeCount TagMergeMode = 7
)
func marshalTagMergeMode(p unsafe.Pointer) (any, error) {
return TagMergeMode(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TagMergeMode(0)
func (e TagMergeMode) InitGoValue(v *gobject.Value) {
v.Init(TypeTagMergeMode)
v.SetEnum(int(e))
}
func (e TagMergeMode) String() string {
switch e {
case TagMergeAppend: return "TagMergeAppend"
case TagMergeCount: return "TagMergeCount"
case TagMergeKeep: return "TagMergeKeep"
case TagMergeKeepAll: return "TagMergeKeepAll"
case TagMergePrepend: return "TagMergePrepend"
case TagMergeReplace: return "TagMergeReplace"
case TagMergeReplaceAll: return "TagMergeReplaceAll"
case TagMergeUndefined: return "TagMergeUndefined"
default: return fmt.Sprintf("TagMergeMode(%d)", e)
}
}
// TagScope wraps GstTagScope
//
// GstTagScope specifies if a taglist applies to the complete
// medium or only to one single stream.
type TagScope C.int
const (
// TagScopeStream wraps GST_TAG_SCOPE_STREAM
//
// tags specific to this single stream
TagScopeStream TagScope = 0
// TagScopeGlobal wraps GST_TAG_SCOPE_GLOBAL
//
// global tags for the complete medium
TagScopeGlobal TagScope = 1
)
func marshalTagScope(p unsafe.Pointer) (any, error) {
return TagScope(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TagScope(0)
func (e TagScope) InitGoValue(v *gobject.Value) {
v.Init(TypeTagScope)
v.SetEnum(int(e))
}
func (e TagScope) String() string {
switch e {
case TagScopeGlobal: return "TagScopeGlobal"
case TagScopeStream: return "TagScopeStream"
default: return fmt.Sprintf("TagScope(%d)", e)
}
}
// TaskState wraps GstTaskState
//
// The different states a task can be in
type TaskState C.int
const (
// TaskStarted wraps GST_TASK_STARTED
//
// the task is started and running
TaskStarted TaskState = 0
// TaskStopped wraps GST_TASK_STOPPED
//
// the task is stopped
TaskStopped TaskState = 1
// TaskPaused wraps GST_TASK_PAUSED
//
// the task is paused
TaskPaused TaskState = 2
)
func marshalTaskState(p unsafe.Pointer) (any, error) {
return TaskState(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TaskState(0)
func (e TaskState) InitGoValue(v *gobject.Value) {
v.Init(TypeTaskState)
v.SetEnum(int(e))
}
func (e TaskState) String() string {
switch e {
case TaskPaused: return "TaskPaused"
case TaskStarted: return "TaskStarted"
case TaskStopped: return "TaskStopped"
default: return fmt.Sprintf("TaskState(%d)", e)
}
}
// TocEntryType wraps GstTocEntryType
//
// The different types of TOC entries (see #GstTocEntry).
//
// There are two types of TOC entries: alternatives or parts in a sequence.
type TocEntryType C.int
const (
// TocEntryTypeAngle wraps GST_TOC_ENTRY_TYPE_ANGLE
//
// entry is an angle (i.e. an alternative)
TocEntryTypeAngle TocEntryType = -3
// TocEntryTypeVersion wraps GST_TOC_ENTRY_TYPE_VERSION
//
// entry is a version (i.e. alternative)
TocEntryTypeVersion TocEntryType = -2
// TocEntryTypeEdition wraps GST_TOC_ENTRY_TYPE_EDITION
//
// entry is an edition (i.e. alternative)
TocEntryTypeEdition TocEntryType = -1
// TocEntryTypeInvalid wraps GST_TOC_ENTRY_TYPE_INVALID
//
// invalid entry type value
TocEntryTypeInvalid TocEntryType = 0
// TocEntryTypeTitle wraps GST_TOC_ENTRY_TYPE_TITLE
//
// entry is a title (i.e. a part of a sequence)
TocEntryTypeTitle TocEntryType = 1
// TocEntryTypeTrack wraps GST_TOC_ENTRY_TYPE_TRACK
//
// entry is a track (i.e. a part of a sequence)
TocEntryTypeTrack TocEntryType = 2
// TocEntryTypeChapter wraps GST_TOC_ENTRY_TYPE_CHAPTER
//
// entry is a chapter (i.e. a part of a sequence)
TocEntryTypeChapter TocEntryType = 3
)
func marshalTocEntryType(p unsafe.Pointer) (any, error) {
return TocEntryType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TocEntryType(0)
func (e TocEntryType) InitGoValue(v *gobject.Value) {
v.Init(TypeTocEntryType)
v.SetEnum(int(e))
}
func (e TocEntryType) String() string {
switch e {
case TocEntryTypeAngle: return "TocEntryTypeAngle"
case TocEntryTypeChapter: return "TocEntryTypeChapter"
case TocEntryTypeEdition: return "TocEntryTypeEdition"
case TocEntryTypeInvalid: return "TocEntryTypeInvalid"
case TocEntryTypeTitle: return "TocEntryTypeTitle"
case TocEntryTypeTrack: return "TocEntryTypeTrack"
case TocEntryTypeVersion: return "TocEntryTypeVersion"
default: return fmt.Sprintf("TocEntryType(%d)", e)
}
}
// TocLoopType wraps GstTocLoopType
//
// How a #GstTocEntry should be repeated. By default, entries are played a
// single time.
type TocLoopType C.int
const (
// TocLoopNone wraps GST_TOC_LOOP_NONE
//
// single forward playback
TocLoopNone TocLoopType = 0
// TocLoopForward wraps GST_TOC_LOOP_FORWARD
//
// repeat forward
TocLoopForward TocLoopType = 1
// TocLoopReverse wraps GST_TOC_LOOP_REVERSE
//
// repeat backward
TocLoopReverse TocLoopType = 2
// TocLoopPingPong wraps GST_TOC_LOOP_PING_PONG
//
// repeat forward and backward
TocLoopPingPong TocLoopType = 3
)
func marshalTocLoopType(p unsafe.Pointer) (any, error) {
return TocLoopType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TocLoopType(0)
func (e TocLoopType) InitGoValue(v *gobject.Value) {
v.Init(TypeTocLoopType)
v.SetEnum(int(e))
}
func (e TocLoopType) String() string {
switch e {
case TocLoopForward: return "TocLoopForward"
case TocLoopNone: return "TocLoopNone"
case TocLoopPingPong: return "TocLoopPingPong"
case TocLoopReverse: return "TocLoopReverse"
default: return fmt.Sprintf("TocLoopType(%d)", e)
}
}
// TocScope wraps GstTocScope
//
// The scope of a TOC.
type TocScope C.int
const (
// TocScopeGlobal wraps GST_TOC_SCOPE_GLOBAL
//
// global TOC representing all selectable options
// (this is what applications are usually interested in)
TocScopeGlobal TocScope = 1
// TocScopeCurrent wraps GST_TOC_SCOPE_CURRENT
//
// TOC for the currently active/selected stream
// (this is a TOC representing the current stream from start to EOS,
// and is what a TOC writer / muxer is usually interested in; it will
// usually be a subset of the global TOC, e.g. just the chapters of
// the current title, or the chapters selected for playback from the
// current title)
TocScopeCurrent TocScope = 2
)
func marshalTocScope(p unsafe.Pointer) (any, error) {
return TocScope(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TocScope(0)
func (e TocScope) InitGoValue(v *gobject.Value) {
v.Init(TypeTocScope)
v.SetEnum(int(e))
}
func (e TocScope) String() string {
switch e {
case TocScopeCurrent: return "TocScopeCurrent"
case TocScopeGlobal: return "TocScopeGlobal"
default: return fmt.Sprintf("TocScope(%d)", e)
}
}
// TracerValueScope wraps GstTracerValueScope
//
// Tracing record will contain fields that contain a measured value or extra
// meta-data. One such meta data are values that tell where a measurement was
// taken. This enumerating declares to which scope such a meta data field
// relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
// events may contain values for different #GstPads.
type TracerValueScope C.int
const (
// TracerValueScopeProcess wraps GST_TRACER_VALUE_SCOPE_PROCESS
//
// the value is related to the process
TracerValueScopeProcess TracerValueScope = 0
// TracerValueScopeThread wraps GST_TRACER_VALUE_SCOPE_THREAD
//
// the value is related to a thread
TracerValueScopeThread TracerValueScope = 1
// TracerValueScopeElement wraps GST_TRACER_VALUE_SCOPE_ELEMENT
//
// the value is related to an #GstElement
TracerValueScopeElement TracerValueScope = 2
// TracerValueScopePad wraps GST_TRACER_VALUE_SCOPE_PAD
//
// the value is related to a #GstPad
TracerValueScopePad TracerValueScope = 3
)
func marshalTracerValueScope(p unsafe.Pointer) (any, error) {
return TracerValueScope(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TracerValueScope(0)
func (e TracerValueScope) InitGoValue(v *gobject.Value) {
v.Init(TypeTracerValueScope)
v.SetEnum(int(e))
}
func (e TracerValueScope) String() string {
switch e {
case TracerValueScopeElement: return "TracerValueScopeElement"
case TracerValueScopePad: return "TracerValueScopePad"
case TracerValueScopeProcess: return "TracerValueScopeProcess"
case TracerValueScopeThread: return "TracerValueScopeThread"
default: return fmt.Sprintf("TracerValueScope(%d)", e)
}
}
// TypeFindProbability wraps GstTypeFindProbability
//
// The probability of the typefind function. Higher values have more certainty
// in doing a reliable typefind.
type TypeFindProbability C.int
const (
// TypeFindNone wraps GST_TYPE_FIND_NONE
//
// type undetected.
TypeFindNone TypeFindProbability = 0
// TypeFindMinimum wraps GST_TYPE_FIND_MINIMUM
//
// unlikely typefind.
TypeFindMinimum TypeFindProbability = 1
// TypeFindPossible wraps GST_TYPE_FIND_POSSIBLE
//
// possible type detected.
TypeFindPossible TypeFindProbability = 50
// TypeFindLikely wraps GST_TYPE_FIND_LIKELY
//
// likely a type was detected.
TypeFindLikely TypeFindProbability = 80
// TypeFindNearlyCertain wraps GST_TYPE_FIND_NEARLY_CERTAIN
//
// nearly certain that a type was detected.
TypeFindNearlyCertain TypeFindProbability = 99
// TypeFindMaximum wraps GST_TYPE_FIND_MAXIMUM
//
// very certain a type was detected.
TypeFindMaximum TypeFindProbability = 100
)
func marshalTypeFindProbability(p unsafe.Pointer) (any, error) {
return TypeFindProbability(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = TypeFindProbability(0)
func (e TypeFindProbability) InitGoValue(v *gobject.Value) {
v.Init(TypeTypeFindProbability)
v.SetEnum(int(e))
}
func (e TypeFindProbability) String() string {
switch e {
case TypeFindLikely: return "TypeFindLikely"
case TypeFindMaximum: return "TypeFindMaximum"
case TypeFindMinimum: return "TypeFindMinimum"
case TypeFindNearlyCertain: return "TypeFindNearlyCertain"
case TypeFindNone: return "TypeFindNone"
case TypeFindPossible: return "TypeFindPossible"
default: return fmt.Sprintf("TypeFindProbability(%d)", e)
}
}
// URIError wraps GstURIError
//
// Different URI-related errors that can occur.
type URIError C.int
const (
// URIErrorUnsupportedProtocol wraps GST_URI_ERROR_UNSUPPORTED_PROTOCOL
//
// The protocol is not supported
URIErrorUnsupportedProtocol URIError = 0
// URIErrorBadURI wraps GST_URI_ERROR_BAD_URI
//
// There was a problem with the URI
URIErrorBadURI URIError = 1
// URIErrorBadState wraps GST_URI_ERROR_BAD_STATE
//
// Could not set or change the URI because the
// URI handler was in a state where that is not possible or not permitted
URIErrorBadState URIError = 2
// URIErrorBadReference wraps GST_URI_ERROR_BAD_REFERENCE
//
// There was a problem with the entity that
// the URI references
URIErrorBadReference URIError = 3
)
func marshalURIError(p unsafe.Pointer) (any, error) {
return URIError(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = URIError(0)
func (e URIError) InitGoValue(v *gobject.Value) {
v.Init(TypeURIError)
v.SetEnum(int(e))
}
func (e URIError) String() string {
switch e {
case URIErrorBadReference: return "URIErrorBadReference"
case URIErrorBadState: return "URIErrorBadState"
case URIErrorBadURI: return "URIErrorBadURI"
case URIErrorUnsupportedProtocol: return "URIErrorUnsupportedProtocol"
default: return fmt.Sprintf("URIError(%d)", e)
}
}
// URIType wraps GstURIType
//
// The different types of URI direction.
type URIType C.int
const (
// URIUnknown wraps GST_URI_UNKNOWN
//
// The URI direction is unknown
URIUnknown URIType = 0
// URISink wraps GST_URI_SINK
//
// The URI is a consumer.
URISink URIType = 1
// URISrc wraps GST_URI_SRC
//
// The URI is a producer.
URISrc URIType = 2
)
func marshalURIType(p unsafe.Pointer) (any, error) {
return URIType(gobject.ValueFromNative(p).Enum()), nil
}
var _ gobject.GoValueInitializer = URIType(0)
func (e URIType) InitGoValue(v *gobject.Value) {
v.Init(TypeURIType)
v.SetEnum(int(e))
}
func (e URIType) String() string {
switch e {
case URISink: return "URISink"
case URISrc: return "URISrc"
case URIUnknown: return "URIUnknown"
default: return fmt.Sprintf("URIType(%d)", e)
}
}
// AllocatorFlags wraps GstAllocatorFlags
//
// Flags for allocators.
type AllocatorFlags C.gint
const (
// AllocatorFlagCustomAlloc wraps GST_ALLOCATOR_FLAG_CUSTOM_ALLOC
//
// The allocator has a custom alloc function.
// Only elements designed to work with this allocator should be using it,
// other elements should ignore it from allocation propositions.
// This implies %GST_ALLOCATOR_FLAG_NO_COPY.
AllocatorFlagCustomAlloc AllocatorFlags = 16
// AllocatorFlagNoCopy wraps GST_ALLOCATOR_FLAG_NO_COPY
//
// When copying a #GstMemory allocated with this allocator, the copy will
// instead be allocated using the default allocator. Use this when allocating a
// new memory is an heavy opperation that should only be done with a
// #GstBufferPool for example.
AllocatorFlagNoCopy AllocatorFlags = 32
// AllocatorFlagLast wraps GST_ALLOCATOR_FLAG_LAST
//
// first flag that can be used for custom purposes
AllocatorFlagLast AllocatorFlags = 1048576
)
func marshalAllocatorFlags(p unsafe.Pointer) (any, error) {
return AllocatorFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if a contains other
func (a AllocatorFlags) Has(other AllocatorFlags) bool {
return (a & other) == other
}
var _ gobject.GoValueInitializer = AllocatorFlags(0)
func (f AllocatorFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeAllocatorFlags)
v.SetFlags(int(f))
}
func (f AllocatorFlags) String() string {
if f == 0 {
return "AllocatorFlags(0)"
}
var parts []string
if (f & AllocatorFlagCustomAlloc) != 0 {
parts = append(parts, "AllocatorFlagCustomAlloc")
}
if (f & AllocatorFlagNoCopy) != 0 {
parts = append(parts, "AllocatorFlagNoCopy")
}
if (f & AllocatorFlagLast) != 0 {
parts = append(parts, "AllocatorFlagLast")
}
return "AllocatorFlags(" + strings.Join(parts, "|") + ")"
}
// BinFlags wraps GstBinFlags
//
// GstBinFlags are a set of flags specific to bins. Most are set/used
// internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
// and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
type BinFlags C.gint
const (
// BinFlagNoResync wraps GST_BIN_FLAG_NO_RESYNC
//
// Don't resync a state change when elements are added or linked in the bin
BinFlagNoResync BinFlags = 16384
// BinFlagStreamsAware wraps GST_BIN_FLAG_STREAMS_AWARE
//
// Indicates whether the bin can handle elements that add/remove source pads
// at any point in time without first posting a no-more-pads signal.
BinFlagStreamsAware BinFlags = 32768
// BinFlagLast wraps GST_BIN_FLAG_LAST
//
// The last enum in the series of flags for bins. Derived classes can use this
// as first value in a list of flags.
BinFlagLast BinFlags = 524288
)
func marshalBinFlags(p unsafe.Pointer) (any, error) {
return BinFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if b contains other
func (b BinFlags) Has(other BinFlags) bool {
return (b & other) == other
}
var _ gobject.GoValueInitializer = BinFlags(0)
func (f BinFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeBinFlags)
v.SetFlags(int(f))
}
func (f BinFlags) String() string {
if f == 0 {
return "BinFlags(0)"
}
var parts []string
if (f & BinFlagNoResync) != 0 {
parts = append(parts, "BinFlagNoResync")
}
if (f & BinFlagStreamsAware) != 0 {
parts = append(parts, "BinFlagStreamsAware")
}
if (f & BinFlagLast) != 0 {
parts = append(parts, "BinFlagLast")
}
return "BinFlags(" + strings.Join(parts, "|") + ")"
}
// BufferCopyFlagsType wraps GstBufferCopyFlags
//
// A set of flags that can be provided to the gst_buffer_copy_into()
// function to specify which items should be copied.
//
// This type has been renamed from BufferCopyFlags.
type BufferCopyFlagsType C.gint
const (
// BufferCopyNone wraps GST_BUFFER_COPY_NONE
//
// copy nothing
BufferCopyNone BufferCopyFlagsType = 0
// BufferCopyFlags wraps GST_BUFFER_COPY_FLAGS
//
// flag indicating that buffer flags should be copied
BufferCopyFlags BufferCopyFlagsType = 1
// BufferCopyTimestamps wraps GST_BUFFER_COPY_TIMESTAMPS
//
// flag indicating that buffer pts, dts,
// duration, offset and offset_end should be copied
BufferCopyTimestamps BufferCopyFlagsType = 2
// BufferCopyMeta wraps GST_BUFFER_COPY_META
//
// flag indicating that buffer meta should be
// copied
BufferCopyMeta BufferCopyFlagsType = 4
// BufferCopyMemory wraps GST_BUFFER_COPY_MEMORY
//
// flag indicating that buffer memory should be reffed
// and appended to already existing memory. Unless the memory is marked as
// NO_SHARE, no actual copy of the memory is made but it is simply reffed.
// Add @GST_BUFFER_COPY_DEEP to force a real copy.
BufferCopyMemory BufferCopyFlagsType = 8
// BufferCopyMerge wraps GST_BUFFER_COPY_MERGE
//
// flag indicating that buffer memory should be
// merged
BufferCopyMerge BufferCopyFlagsType = 16
// BufferCopyDeep wraps GST_BUFFER_COPY_DEEP
//
// flag indicating that memory should always be copied instead of reffed
BufferCopyDeep BufferCopyFlagsType = 32
)
func marshalBufferCopyFlagsType(p unsafe.Pointer) (any, error) {
return BufferCopyFlagsType(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if b contains other
func (b BufferCopyFlagsType) Has(other BufferCopyFlagsType) bool {
return (b & other) == other
}
var _ gobject.GoValueInitializer = BufferCopyFlagsType(0)
func (f BufferCopyFlagsType) InitGoValue(v *gobject.Value) {
v.Init(TypeBufferCopyFlagsType)
v.SetFlags(int(f))
}
func (f BufferCopyFlagsType) String() string {
if f == 0 {
return "BufferCopyFlagsType(0)"
}
var parts []string
if (f & BufferCopyNone) != 0 {
parts = append(parts, "BufferCopyNone")
}
if (f & BufferCopyFlags) != 0 {
parts = append(parts, "BufferCopyFlags")
}
if (f & BufferCopyTimestamps) != 0 {
parts = append(parts, "BufferCopyTimestamps")
}
if (f & BufferCopyMeta) != 0 {
parts = append(parts, "BufferCopyMeta")
}
if (f & BufferCopyMemory) != 0 {
parts = append(parts, "BufferCopyMemory")
}
if (f & BufferCopyMerge) != 0 {
parts = append(parts, "BufferCopyMerge")
}
if (f & BufferCopyDeep) != 0 {
parts = append(parts, "BufferCopyDeep")
}
return "BufferCopyFlagsType(" + strings.Join(parts, "|") + ")"
}
// BufferFlags wraps GstBufferFlags
//
// A set of buffer flags used to describe properties of a #GstBuffer.
type BufferFlags C.gint
const (
// BufferFlagLive wraps GST_BUFFER_FLAG_LIVE
//
// the buffer is live data and should be discarded in
// the PAUSED state.
BufferFlagLive BufferFlags = 16
// BufferFlagDecodeOnly wraps GST_BUFFER_FLAG_DECODE_ONLY
//
// the buffer contains data that should be dropped
// because it will be clipped against the segment
// boundaries or because it does not contain data
// that should be shown to the user.
BufferFlagDecodeOnly BufferFlags = 32
// BufferFlagDiscont wraps GST_BUFFER_FLAG_DISCONT
//
// the buffer marks a data discontinuity in the stream.
// This typically occurs after a seek or a dropped buffer
// from a live or network source.
BufferFlagDiscont BufferFlags = 64
// BufferFlagResync wraps GST_BUFFER_FLAG_RESYNC
//
// the buffer timestamps might have a discontinuity
// and this buffer is a good point to resynchronize.
BufferFlagResync BufferFlags = 128
// BufferFlagCorrupted wraps GST_BUFFER_FLAG_CORRUPTED
//
// the buffer data is corrupted.
BufferFlagCorrupted BufferFlags = 256
// BufferFlagMarker wraps GST_BUFFER_FLAG_MARKER
//
// the buffer contains a media specific marker. for
// video this is the end of a frame boundary, for audio
// this is the start of a talkspurt. for RTP
// packets this matches the marker flag in the
// RTP packet header.
BufferFlagMarker BufferFlags = 512
// BufferFlagHeader wraps GST_BUFFER_FLAG_HEADER
//
// the buffer contains header information that is
// needed to decode the following data.
BufferFlagHeader BufferFlags = 1024
// BufferFlagGap wraps GST_BUFFER_FLAG_GAP
//
// the buffer has been created to fill a gap in the
// stream and contains media neutral data (elements can
// switch to optimized code path that ignores the buffer
// content).
BufferFlagGap BufferFlags = 2048
// BufferFlagDroppable wraps GST_BUFFER_FLAG_DROPPABLE
//
// the buffer can be dropped without breaking the
// stream, for example to reduce bandwidth.
BufferFlagDroppable BufferFlags = 4096
// BufferFlagDeltaUnit wraps GST_BUFFER_FLAG_DELTA_UNIT
//
// this unit cannot be decoded independently.
BufferFlagDeltaUnit BufferFlags = 8192
// BufferFlagTagMemory wraps GST_BUFFER_FLAG_TAG_MEMORY
//
// this flag is set when memory of the buffer
// is added/removed
BufferFlagTagMemory BufferFlags = 16384
// BufferFlagSyncAfter wraps GST_BUFFER_FLAG_SYNC_AFTER
//
// Elements which write to disk or permanent storage should ensure the data
// is synced after writing the contents of this buffer.
BufferFlagSyncAfter BufferFlags = 32768
// BufferFlagNonDroppable wraps GST_BUFFER_FLAG_NON_DROPPABLE
//
// This buffer is important and should not be dropped.
//
// This can be used to mark important buffers, e.g. to flag RTP packets
// carrying keyframes or codec setup data for RTP Forward Error Correction
// purposes, or to prevent still video frames from being dropped by elements
// due to QoS.
BufferFlagNonDroppable BufferFlags = 65536
// BufferFlagLast wraps GST_BUFFER_FLAG_LAST
//
// additional media specific flags can be added starting from
// this flag.
BufferFlagLast BufferFlags = 1048576
)
func marshalBufferFlags(p unsafe.Pointer) (any, error) {
return BufferFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if b contains other
func (b BufferFlags) Has(other BufferFlags) bool {
return (b & other) == other
}
var _ gobject.GoValueInitializer = BufferFlags(0)
func (f BufferFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeBufferFlags)
v.SetFlags(int(f))
}
func (f BufferFlags) String() string {
if f == 0 {
return "BufferFlags(0)"
}
var parts []string
if (f & BufferFlagLive) != 0 {
parts = append(parts, "BufferFlagLive")
}
if (f & BufferFlagDecodeOnly) != 0 {
parts = append(parts, "BufferFlagDecodeOnly")
}
if (f & BufferFlagDiscont) != 0 {
parts = append(parts, "BufferFlagDiscont")
}
if (f & BufferFlagResync) != 0 {
parts = append(parts, "BufferFlagResync")
}
if (f & BufferFlagCorrupted) != 0 {
parts = append(parts, "BufferFlagCorrupted")
}
if (f & BufferFlagMarker) != 0 {
parts = append(parts, "BufferFlagMarker")
}
if (f & BufferFlagHeader) != 0 {
parts = append(parts, "BufferFlagHeader")
}
if (f & BufferFlagGap) != 0 {
parts = append(parts, "BufferFlagGap")
}
if (f & BufferFlagDroppable) != 0 {
parts = append(parts, "BufferFlagDroppable")
}
if (f & BufferFlagDeltaUnit) != 0 {
parts = append(parts, "BufferFlagDeltaUnit")
}
if (f & BufferFlagTagMemory) != 0 {
parts = append(parts, "BufferFlagTagMemory")
}
if (f & BufferFlagSyncAfter) != 0 {
parts = append(parts, "BufferFlagSyncAfter")
}
if (f & BufferFlagNonDroppable) != 0 {
parts = append(parts, "BufferFlagNonDroppable")
}
if (f & BufferFlagLast) != 0 {
parts = append(parts, "BufferFlagLast")
}
return "BufferFlags(" + strings.Join(parts, "|") + ")"
}
// BufferPoolAcquireFlags wraps GstBufferPoolAcquireFlags
//
// Additional flags to control the allocation of a buffer
type BufferPoolAcquireFlags C.gint
const (
// BufferPoolAcquireFlagNone wraps GST_BUFFER_POOL_ACQUIRE_FLAG_NONE
//
// no flags
BufferPoolAcquireFlagNone BufferPoolAcquireFlags = 0
// BufferPoolAcquireFlagKeyUnit wraps GST_BUFFER_POOL_ACQUIRE_FLAG_KEY_UNIT
//
// buffer is keyframe
BufferPoolAcquireFlagKeyUnit BufferPoolAcquireFlags = 1
// BufferPoolAcquireFlagDontwait wraps GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
//
// when the bufferpool is empty, acquire_buffer
// will by default block until a buffer is released into the pool again. Setting
// this flag makes acquire_buffer return #GST_FLOW_EOS instead of blocking.
BufferPoolAcquireFlagDontwait BufferPoolAcquireFlags = 2
// BufferPoolAcquireFlagDiscont wraps GST_BUFFER_POOL_ACQUIRE_FLAG_DISCONT
//
// buffer is discont
BufferPoolAcquireFlagDiscont BufferPoolAcquireFlags = 4
// BufferPoolAcquireFlagLast wraps GST_BUFFER_POOL_ACQUIRE_FLAG_LAST
//
// last flag, subclasses can use private flags
// starting from this value.
BufferPoolAcquireFlagLast BufferPoolAcquireFlags = 65536
)
func marshalBufferPoolAcquireFlags(p unsafe.Pointer) (any, error) {
return BufferPoolAcquireFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if b contains other
func (b BufferPoolAcquireFlags) Has(other BufferPoolAcquireFlags) bool {
return (b & other) == other
}
var _ gobject.GoValueInitializer = BufferPoolAcquireFlags(0)
func (f BufferPoolAcquireFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeBufferPoolAcquireFlags)
v.SetFlags(int(f))
}
func (f BufferPoolAcquireFlags) String() string {
if f == 0 {
return "BufferPoolAcquireFlags(0)"
}
var parts []string
if (f & BufferPoolAcquireFlagNone) != 0 {
parts = append(parts, "BufferPoolAcquireFlagNone")
}
if (f & BufferPoolAcquireFlagKeyUnit) != 0 {
parts = append(parts, "BufferPoolAcquireFlagKeyUnit")
}
if (f & BufferPoolAcquireFlagDontwait) != 0 {
parts = append(parts, "BufferPoolAcquireFlagDontwait")
}
if (f & BufferPoolAcquireFlagDiscont) != 0 {
parts = append(parts, "BufferPoolAcquireFlagDiscont")
}
if (f & BufferPoolAcquireFlagLast) != 0 {
parts = append(parts, "BufferPoolAcquireFlagLast")
}
return "BufferPoolAcquireFlags(" + strings.Join(parts, "|") + ")"
}
// BusFlags wraps GstBusFlags
//
// The standard flags that a bus may have.
type BusFlags C.gint
const (
// BusFlushing wraps GST_BUS_FLUSHING
//
// The bus is currently dropping all messages
BusFlushing BusFlags = 16
// BusFlagLast wraps GST_BUS_FLAG_LAST
//
// offset to define more flags
BusFlagLast BusFlags = 32
)
func marshalBusFlags(p unsafe.Pointer) (any, error) {
return BusFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if b contains other
func (b BusFlags) Has(other BusFlags) bool {
return (b & other) == other
}
var _ gobject.GoValueInitializer = BusFlags(0)
func (f BusFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeBusFlags)
v.SetFlags(int(f))
}
func (f BusFlags) String() string {
if f == 0 {
return "BusFlags(0)"
}
var parts []string
if (f & BusFlushing) != 0 {
parts = append(parts, "BusFlushing")
}
if (f & BusFlagLast) != 0 {
parts = append(parts, "BusFlagLast")
}
return "BusFlags(" + strings.Join(parts, "|") + ")"
}
// CapsFlags wraps GstCapsFlags
//
// Extra flags for a caps.
type CapsFlags C.gint
const (
// CapsFlagAny wraps GST_CAPS_FLAG_ANY
//
// Caps has no specific content, but can contain
// anything.
CapsFlagAny CapsFlags = 16
)
func marshalCapsFlags(p unsafe.Pointer) (any, error) {
return CapsFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if c contains other
func (c CapsFlags) Has(other CapsFlags) bool {
return (c & other) == other
}
var _ gobject.GoValueInitializer = CapsFlags(0)
func (f CapsFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeCapsFlags)
v.SetFlags(int(f))
}
func (f CapsFlags) String() string {
if f == 0 {
return "CapsFlags(0)"
}
var parts []string
if (f & CapsFlagAny) != 0 {
parts = append(parts, "CapsFlagAny")
}
return "CapsFlags(" + strings.Join(parts, "|") + ")"
}
// ClockFlags wraps GstClockFlags
//
// The capabilities of this clock
type ClockFlags C.gint
const (
// ClockFlagCanDoSingleSync wraps GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC
//
// clock can do a single sync timeout request
ClockFlagCanDoSingleSync ClockFlags = 16
// ClockFlagCanDoSingleAsync wraps GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC
//
// clock can do a single async timeout request
ClockFlagCanDoSingleAsync ClockFlags = 32
// ClockFlagCanDoPeriodicSync wraps GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC
//
// clock can do sync periodic timeout requests
ClockFlagCanDoPeriodicSync ClockFlags = 64
// ClockFlagCanDoPeriodicAsync wraps GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC
//
// clock can do async periodic timeout callbacks
ClockFlagCanDoPeriodicAsync ClockFlags = 128
// ClockFlagCanSetResolution wraps GST_CLOCK_FLAG_CAN_SET_RESOLUTION
//
// clock's resolution can be changed
ClockFlagCanSetResolution ClockFlags = 256
// ClockFlagCanSetMaster wraps GST_CLOCK_FLAG_CAN_SET_MASTER
//
// clock can be slaved to a master clock
ClockFlagCanSetMaster ClockFlags = 512
// ClockFlagNeedsStartupSync wraps GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC
//
// clock needs to be synced before it can be used
ClockFlagNeedsStartupSync ClockFlags = 1024
// ClockFlagLast wraps GST_CLOCK_FLAG_LAST
//
// subclasses can add additional flags starting from this flag
ClockFlagLast ClockFlags = 4096
)
func marshalClockFlags(p unsafe.Pointer) (any, error) {
return ClockFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if c contains other
func (c ClockFlags) Has(other ClockFlags) bool {
return (c & other) == other
}
var _ gobject.GoValueInitializer = ClockFlags(0)
func (f ClockFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeClockFlags)
v.SetFlags(int(f))
}
func (f ClockFlags) String() string {
if f == 0 {
return "ClockFlags(0)"
}
var parts []string
if (f & ClockFlagCanDoSingleSync) != 0 {
parts = append(parts, "ClockFlagCanDoSingleSync")
}
if (f & ClockFlagCanDoSingleAsync) != 0 {
parts = append(parts, "ClockFlagCanDoSingleAsync")
}
if (f & ClockFlagCanDoPeriodicSync) != 0 {
parts = append(parts, "ClockFlagCanDoPeriodicSync")
}
if (f & ClockFlagCanDoPeriodicAsync) != 0 {
parts = append(parts, "ClockFlagCanDoPeriodicAsync")
}
if (f & ClockFlagCanSetResolution) != 0 {
parts = append(parts, "ClockFlagCanSetResolution")
}
if (f & ClockFlagCanSetMaster) != 0 {
parts = append(parts, "ClockFlagCanSetMaster")
}
if (f & ClockFlagNeedsStartupSync) != 0 {
parts = append(parts, "ClockFlagNeedsStartupSync")
}
if (f & ClockFlagLast) != 0 {
parts = append(parts, "ClockFlagLast")
}
return "ClockFlags(" + strings.Join(parts, "|") + ")"
}
// DebugColorFlags wraps GstDebugColorFlags
//
// These are some terminal style flags you can use when creating your
// debugging categories to make them stand out in debugging output.
type DebugColorFlags C.gint
const (
// DebugFgBlack wraps GST_DEBUG_FG_BLACK
//
// Use black as foreground color.
DebugFgBlack DebugColorFlags = 0
// DebugFgRed wraps GST_DEBUG_FG_RED
//
// Use red as foreground color.
DebugFgRed DebugColorFlags = 1
// DebugFgGreen wraps GST_DEBUG_FG_GREEN
//
// Use green as foreground color.
DebugFgGreen DebugColorFlags = 2
// DebugFgYellow wraps GST_DEBUG_FG_YELLOW
//
// Use yellow as foreground color.
DebugFgYellow DebugColorFlags = 3
// DebugFgBlue wraps GST_DEBUG_FG_BLUE
//
// Use blue as foreground color.
DebugFgBlue DebugColorFlags = 4
// DebugFgMagenta wraps GST_DEBUG_FG_MAGENTA
//
// Use magenta as foreground color.
DebugFgMagenta DebugColorFlags = 5
// DebugFgCyan wraps GST_DEBUG_FG_CYAN
//
// Use cyan as foreground color.
DebugFgCyan DebugColorFlags = 6
// DebugFgWhite wraps GST_DEBUG_FG_WHITE
//
// Use white as foreground color.
DebugFgWhite DebugColorFlags = 7
// DebugBgBlack wraps GST_DEBUG_BG_BLACK
//
// Use black as background color.
DebugBgBlack DebugColorFlags = 0
// DebugBgRed wraps GST_DEBUG_BG_RED
//
// Use red as background color.
DebugBgRed DebugColorFlags = 16
// DebugBgGreen wraps GST_DEBUG_BG_GREEN
//
// Use green as background color.
DebugBgGreen DebugColorFlags = 32
// DebugBgYellow wraps GST_DEBUG_BG_YELLOW
//
// Use yellow as background color.
DebugBgYellow DebugColorFlags = 48
// DebugBgBlue wraps GST_DEBUG_BG_BLUE
//
// Use blue as background color.
DebugBgBlue DebugColorFlags = 64
// DebugBgMagenta wraps GST_DEBUG_BG_MAGENTA
//
// Use magenta as background color.
DebugBgMagenta DebugColorFlags = 80
// DebugBgCyan wraps GST_DEBUG_BG_CYAN
//
// Use cyan as background color.
DebugBgCyan DebugColorFlags = 96
// DebugBgWhite wraps GST_DEBUG_BG_WHITE
//
// Use white as background color.
DebugBgWhite DebugColorFlags = 112
// DebugBold wraps GST_DEBUG_BOLD
//
// Make the output bold.
DebugBold DebugColorFlags = 256
// DebugUnderline wraps GST_DEBUG_UNDERLINE
//
// Underline the output.
DebugUnderline DebugColorFlags = 512
)
func marshalDebugColorFlags(p unsafe.Pointer) (any, error) {
return DebugColorFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if d contains other
func (d DebugColorFlags) Has(other DebugColorFlags) bool {
return (d & other) == other
}
var _ gobject.GoValueInitializer = DebugColorFlags(0)
func (f DebugColorFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeDebugColorFlags)
v.SetFlags(int(f))
}
func (f DebugColorFlags) String() string {
if f == 0 {
return "DebugColorFlags(0)"
}
var parts []string
if (f & DebugFgBlack) != 0 {
parts = append(parts, "DebugFgBlack")
}
if (f & DebugFgRed) != 0 {
parts = append(parts, "DebugFgRed")
}
if (f & DebugFgGreen) != 0 {
parts = append(parts, "DebugFgGreen")
}
if (f & DebugFgYellow) != 0 {
parts = append(parts, "DebugFgYellow")
}
if (f & DebugFgBlue) != 0 {
parts = append(parts, "DebugFgBlue")
}
if (f & DebugFgMagenta) != 0 {
parts = append(parts, "DebugFgMagenta")
}
if (f & DebugFgCyan) != 0 {
parts = append(parts, "DebugFgCyan")
}
if (f & DebugFgWhite) != 0 {
parts = append(parts, "DebugFgWhite")
}
if (f & DebugBgBlack) != 0 {
parts = append(parts, "DebugBgBlack")
}
if (f & DebugBgRed) != 0 {
parts = append(parts, "DebugBgRed")
}
if (f & DebugBgGreen) != 0 {
parts = append(parts, "DebugBgGreen")
}
if (f & DebugBgYellow) != 0 {
parts = append(parts, "DebugBgYellow")
}
if (f & DebugBgBlue) != 0 {
parts = append(parts, "DebugBgBlue")
}
if (f & DebugBgMagenta) != 0 {
parts = append(parts, "DebugBgMagenta")
}
if (f & DebugBgCyan) != 0 {
parts = append(parts, "DebugBgCyan")
}
if (f & DebugBgWhite) != 0 {
parts = append(parts, "DebugBgWhite")
}
if (f & DebugBold) != 0 {
parts = append(parts, "DebugBold")
}
if (f & DebugUnderline) != 0 {
parts = append(parts, "DebugUnderline")
}
return "DebugColorFlags(" + strings.Join(parts, "|") + ")"
}
// DebugGraphDetails wraps GstDebugGraphDetails
//
// Available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE()
// and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().
type DebugGraphDetails C.gint
const (
// DebugGraphShowMediaType wraps GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE
//
// show caps-name on edges
DebugGraphShowMediaType DebugGraphDetails = 1
// DebugGraphShowCapsDetails wraps GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS
//
// show caps-details on edges
DebugGraphShowCapsDetails DebugGraphDetails = 2
// DebugGraphShowNonDefaultParams wraps GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS
//
// show modified parameters on
// elements
DebugGraphShowNonDefaultParams DebugGraphDetails = 4
// DebugGraphShowStates wraps GST_DEBUG_GRAPH_SHOW_STATES
//
// show element states
DebugGraphShowStates DebugGraphDetails = 8
// DebugGraphShowFullParams wraps GST_DEBUG_GRAPH_SHOW_FULL_PARAMS
//
// show full element parameter values even
// if they are very long
DebugGraphShowFullParams DebugGraphDetails = 16
// DebugGraphShowAll wraps GST_DEBUG_GRAPH_SHOW_ALL
//
// show all the typical details that one might want
DebugGraphShowAll DebugGraphDetails = 15
// DebugGraphShowVerbose wraps GST_DEBUG_GRAPH_SHOW_VERBOSE
//
// show all details regardless of how large or
// verbose they make the resulting output
DebugGraphShowVerbose DebugGraphDetails = -1
)
func marshalDebugGraphDetails(p unsafe.Pointer) (any, error) {
return DebugGraphDetails(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if d contains other
func (d DebugGraphDetails) Has(other DebugGraphDetails) bool {
return (d & other) == other
}
var _ gobject.GoValueInitializer = DebugGraphDetails(0)
func (f DebugGraphDetails) InitGoValue(v *gobject.Value) {
v.Init(TypeDebugGraphDetails)
v.SetFlags(int(f))
}
func (f DebugGraphDetails) String() string {
if f == 0 {
return "DebugGraphDetails(0)"
}
var parts []string
if (f & DebugGraphShowMediaType) != 0 {
parts = append(parts, "DebugGraphShowMediaType")
}
if (f & DebugGraphShowCapsDetails) != 0 {
parts = append(parts, "DebugGraphShowCapsDetails")
}
if (f & DebugGraphShowNonDefaultParams) != 0 {
parts = append(parts, "DebugGraphShowNonDefaultParams")
}
if (f & DebugGraphShowStates) != 0 {
parts = append(parts, "DebugGraphShowStates")
}
if (f & DebugGraphShowFullParams) != 0 {
parts = append(parts, "DebugGraphShowFullParams")
}
if (f & DebugGraphShowAll) != 0 {
parts = append(parts, "DebugGraphShowAll")
}
if (f & DebugGraphShowVerbose) != 0 {
parts = append(parts, "DebugGraphShowVerbose")
}
return "DebugGraphDetails(" + strings.Join(parts, "|") + ")"
}
// ElementFlags wraps GstElementFlags
//
// The standard flags that an element may have.
type ElementFlags C.gint
const (
// ElementFlagLockedState wraps GST_ELEMENT_FLAG_LOCKED_STATE
//
// ignore state changes from parent
ElementFlagLockedState ElementFlags = 16
// ElementFlagSink wraps GST_ELEMENT_FLAG_SINK
//
// the element is a sink
ElementFlagSink ElementFlags = 32
// ElementFlagSource wraps GST_ELEMENT_FLAG_SOURCE
//
// the element is a source.
ElementFlagSource ElementFlags = 64
// ElementFlagProvideClock wraps GST_ELEMENT_FLAG_PROVIDE_CLOCK
//
// the element can provide a clock
ElementFlagProvideClock ElementFlags = 128
// ElementFlagRequireClock wraps GST_ELEMENT_FLAG_REQUIRE_CLOCK
//
// the element requires a clock
ElementFlagRequireClock ElementFlags = 256
// ElementFlagIndexable wraps GST_ELEMENT_FLAG_INDEXABLE
//
// the element can use an index
ElementFlagIndexable ElementFlags = 512
// ElementFlagLast wraps GST_ELEMENT_FLAG_LAST
//
// offset to define more flags
ElementFlagLast ElementFlags = 16384
)
func marshalElementFlags(p unsafe.Pointer) (any, error) {
return ElementFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if e contains other
func (e ElementFlags) Has(other ElementFlags) bool {
return (e & other) == other
}
var _ gobject.GoValueInitializer = ElementFlags(0)
func (f ElementFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeElementFlags)
v.SetFlags(int(f))
}
func (f ElementFlags) String() string {
if f == 0 {
return "ElementFlags(0)"
}
var parts []string
if (f & ElementFlagLockedState) != 0 {
parts = append(parts, "ElementFlagLockedState")
}
if (f & ElementFlagSink) != 0 {
parts = append(parts, "ElementFlagSink")
}
if (f & ElementFlagSource) != 0 {
parts = append(parts, "ElementFlagSource")
}
if (f & ElementFlagProvideClock) != 0 {
parts = append(parts, "ElementFlagProvideClock")
}
if (f & ElementFlagRequireClock) != 0 {
parts = append(parts, "ElementFlagRequireClock")
}
if (f & ElementFlagIndexable) != 0 {
parts = append(parts, "ElementFlagIndexable")
}
if (f & ElementFlagLast) != 0 {
parts = append(parts, "ElementFlagLast")
}
return "ElementFlags(" + strings.Join(parts, "|") + ")"
}
// EventTypeFlags wraps GstEventTypeFlags
//
// #GstEventTypeFlags indicate the aspects of the different #GstEventType
// values. You can get the type flags of a #GstEventType with the
// gst_event_type_get_flags() function.
type EventTypeFlags C.gint
const (
// EventTypeUpstream wraps GST_EVENT_TYPE_UPSTREAM
//
// Set if the event can travel upstream.
EventTypeUpstream EventTypeFlags = 1
// EventTypeDownstream wraps GST_EVENT_TYPE_DOWNSTREAM
//
// Set if the event can travel downstream.
EventTypeDownstream EventTypeFlags = 2
// EventTypeSerialized wraps GST_EVENT_TYPE_SERIALIZED
//
// Set if the event should be serialized with data
// flow.
EventTypeSerialized EventTypeFlags = 4
// EventTypeSticky wraps GST_EVENT_TYPE_STICKY
//
// Set if the event is sticky on the pads.
EventTypeSticky EventTypeFlags = 8
// EventTypeStickyMulti wraps GST_EVENT_TYPE_STICKY_MULTI
//
// Multiple sticky events can be on a pad, each
// identified by the event name.
EventTypeStickyMulti EventTypeFlags = 16
)
func marshalEventTypeFlags(p unsafe.Pointer) (any, error) {
return EventTypeFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if e contains other
func (e EventTypeFlags) Has(other EventTypeFlags) bool {
return (e & other) == other
}
var _ gobject.GoValueInitializer = EventTypeFlags(0)
func (f EventTypeFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeEventTypeFlags)
v.SetFlags(int(f))
}
func (f EventTypeFlags) String() string {
if f == 0 {
return "EventTypeFlags(0)"
}
var parts []string
if (f & EventTypeUpstream) != 0 {
parts = append(parts, "EventTypeUpstream")
}
if (f & EventTypeDownstream) != 0 {
parts = append(parts, "EventTypeDownstream")
}
if (f & EventTypeSerialized) != 0 {
parts = append(parts, "EventTypeSerialized")
}
if (f & EventTypeSticky) != 0 {
parts = append(parts, "EventTypeSticky")
}
if (f & EventTypeStickyMulti) != 0 {
parts = append(parts, "EventTypeStickyMulti")
}
return "EventTypeFlags(" + strings.Join(parts, "|") + ")"
}
// GapFlags wraps GstGapFlags
//
// The different flags that can be set on #GST_EVENT_GAP events. See
// gst_event_set_gap_flags() for details.
type GapFlags C.gint
const (
// GapFlagMissingData wraps GST_GAP_FLAG_MISSING_DATA
//
// The #GST_EVENT_GAP signals missing data,
// for example because of packet loss.
GapFlagMissingData GapFlags = 1
)
func marshalGapFlags(p unsafe.Pointer) (any, error) {
return GapFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if g contains other
func (g GapFlags) Has(other GapFlags) bool {
return (g & other) == other
}
var _ gobject.GoValueInitializer = GapFlags(0)
func (f GapFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeGapFlags)
v.SetFlags(int(f))
}
func (f GapFlags) String() string {
if f == 0 {
return "GapFlags(0)"
}
var parts []string
if (f & GapFlagMissingData) != 0 {
parts = append(parts, "GapFlagMissingData")
}
return "GapFlags(" + strings.Join(parts, "|") + ")"
}
// LockFlags wraps GstLockFlags
//
// Flags used when locking miniobjects
type LockFlags C.gint
const (
// LockFlagRead wraps GST_LOCK_FLAG_READ
//
// lock for read access
LockFlagRead LockFlags = 1
// LockFlagWrite wraps GST_LOCK_FLAG_WRITE
//
// lock for write access
LockFlagWrite LockFlags = 2
// LockFlagExclusive wraps GST_LOCK_FLAG_EXCLUSIVE
//
// lock for exclusive access
LockFlagExclusive LockFlags = 4
// LockFlagLast wraps GST_LOCK_FLAG_LAST
//
// first flag that can be used for custom purposes
LockFlagLast LockFlags = 256
)
func marshalLockFlags(p unsafe.Pointer) (any, error) {
return LockFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if l contains other
func (l LockFlags) Has(other LockFlags) bool {
return (l & other) == other
}
var _ gobject.GoValueInitializer = LockFlags(0)
func (f LockFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeLockFlags)
v.SetFlags(int(f))
}
func (f LockFlags) String() string {
if f == 0 {
return "LockFlags(0)"
}
var parts []string
if (f & LockFlagRead) != 0 {
parts = append(parts, "LockFlagRead")
}
if (f & LockFlagWrite) != 0 {
parts = append(parts, "LockFlagWrite")
}
if (f & LockFlagExclusive) != 0 {
parts = append(parts, "LockFlagExclusive")
}
if (f & LockFlagLast) != 0 {
parts = append(parts, "LockFlagLast")
}
return "LockFlags(" + strings.Join(parts, "|") + ")"
}
// MapFlags wraps GstMapFlags
//
// Flags used when mapping memory
type MapFlags C.gint
const (
// MapRead wraps GST_MAP_READ
//
// map for read access
MapRead MapFlags = 1
// MapWrite wraps GST_MAP_WRITE
//
// map for write access
MapWrite MapFlags = 2
// MapFlagLast wraps GST_MAP_FLAG_LAST
//
// first flag that can be used for custom purposes
MapFlagLast MapFlags = 65536
)
func marshalMapFlags(p unsafe.Pointer) (any, error) {
return MapFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if m contains other
func (m MapFlags) Has(other MapFlags) bool {
return (m & other) == other
}
var _ gobject.GoValueInitializer = MapFlags(0)
func (f MapFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeMapFlags)
v.SetFlags(int(f))
}
func (f MapFlags) String() string {
if f == 0 {
return "MapFlags(0)"
}
var parts []string
if (f & MapRead) != 0 {
parts = append(parts, "MapRead")
}
if (f & MapWrite) != 0 {
parts = append(parts, "MapWrite")
}
if (f & MapFlagLast) != 0 {
parts = append(parts, "MapFlagLast")
}
return "MapFlags(" + strings.Join(parts, "|") + ")"
}
// MemoryFlags wraps GstMemoryFlags
//
// Flags for wrapped memory.
type MemoryFlags C.gint
const (
// MemoryFlagReadonly wraps GST_MEMORY_FLAG_READONLY
//
// memory is readonly. It is not allowed to map the
// memory with #GST_MAP_WRITE.
MemoryFlagReadonly MemoryFlags = 2
// MemoryFlagNoShare wraps GST_MEMORY_FLAG_NO_SHARE
//
// memory must not be shared. Copies will have to be
// made when this memory needs to be shared between buffers. (DEPRECATED:
// do not use in new code, instead you should create a custom GstAllocator for
// memory pooling instead of relying on the GstBuffer they were originally
// attached to.)
MemoryFlagNoShare MemoryFlags = 16
// MemoryFlagZeroPrefixed wraps GST_MEMORY_FLAG_ZERO_PREFIXED
//
// the memory prefix is filled with 0 bytes
MemoryFlagZeroPrefixed MemoryFlags = 32
// MemoryFlagZeroPadded wraps GST_MEMORY_FLAG_ZERO_PADDED
//
// the memory padding is filled with 0 bytes
MemoryFlagZeroPadded MemoryFlags = 64
// MemoryFlagPhysicallyContiguous wraps GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS
//
// the memory is physically
// contiguous. (Since: 1.2)
MemoryFlagPhysicallyContiguous MemoryFlags = 128
// MemoryFlagNotMappable wraps GST_MEMORY_FLAG_NOT_MAPPABLE
//
// the memory can't be mapped via
// gst_memory_map() without any preconditions. (Since: 1.2)
MemoryFlagNotMappable MemoryFlags = 256
// MemoryFlagLast wraps GST_MEMORY_FLAG_LAST
//
// first flag that can be used for custom purposes
MemoryFlagLast MemoryFlags = 1048576
)
func marshalMemoryFlags(p unsafe.Pointer) (any, error) {
return MemoryFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if m contains other
func (m MemoryFlags) Has(other MemoryFlags) bool {
return (m & other) == other
}
var _ gobject.GoValueInitializer = MemoryFlags(0)
func (f MemoryFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeMemoryFlags)
v.SetFlags(int(f))
}
func (f MemoryFlags) String() string {
if f == 0 {
return "MemoryFlags(0)"
}
var parts []string
if (f & MemoryFlagReadonly) != 0 {
parts = append(parts, "MemoryFlagReadonly")
}
if (f & MemoryFlagNoShare) != 0 {
parts = append(parts, "MemoryFlagNoShare")
}
if (f & MemoryFlagZeroPrefixed) != 0 {
parts = append(parts, "MemoryFlagZeroPrefixed")
}
if (f & MemoryFlagZeroPadded) != 0 {
parts = append(parts, "MemoryFlagZeroPadded")
}
if (f & MemoryFlagPhysicallyContiguous) != 0 {
parts = append(parts, "MemoryFlagPhysicallyContiguous")
}
if (f & MemoryFlagNotMappable) != 0 {
parts = append(parts, "MemoryFlagNotMappable")
}
if (f & MemoryFlagLast) != 0 {
parts = append(parts, "MemoryFlagLast")
}
return "MemoryFlags(" + strings.Join(parts, "|") + ")"
}
// MessageType wraps GstMessageType
//
// The different message types that are available.
type MessageType C.gint
const (
// MessageUnknown wraps GST_MESSAGE_UNKNOWN
//
// an undefined message
MessageUnknown MessageType = 0
// MessageEos wraps GST_MESSAGE_EOS
//
// end-of-stream reached in a pipeline. The application will
// only receive this message in the PLAYING state and every time it sets a
// pipeline to PLAYING that is in the EOS state. The application can perform a
// flushing seek in the pipeline, which will undo the EOS state again.
MessageEos MessageType = 1
// MessageError wraps GST_MESSAGE_ERROR
//
// an error occurred. When the application receives an error
// message it should stop playback of the pipeline and not assume that more
// data will be played. It is possible to specify a redirection url to the error
// messages by setting a `redirect-location` field into the error message, application
// or high level bins might use the information as required.
MessageError MessageType = 2
// MessageWarning wraps GST_MESSAGE_WARNING
//
// a warning occurred.
MessageWarning MessageType = 4
// MessageInfo wraps GST_MESSAGE_INFO
//
// an info message occurred
MessageInfo MessageType = 8
// MessageTag wraps GST_MESSAGE_TAG
//
// a tag was found.
MessageTag MessageType = 16
// MessageBuffering wraps GST_MESSAGE_BUFFERING
//
// the pipeline is buffering. When the application
// receives a buffering message in the PLAYING state for a non-live pipeline it
// must PAUSE the pipeline until the buffering completes, when the percentage
// field in the message is 100%. For live pipelines, no action must be
// performed and the buffering percentage can be used to inform the user about
// the progress.
MessageBuffering MessageType = 32
// MessageStateChanged wraps GST_MESSAGE_STATE_CHANGED
//
// a state change happened
MessageStateChanged MessageType = 64
// MessageStateDirty wraps GST_MESSAGE_STATE_DIRTY
//
// an element changed state in a streaming thread.
// This message is deprecated.
MessageStateDirty MessageType = 128
// MessageStepDone wraps GST_MESSAGE_STEP_DONE
//
// a stepping operation finished.
MessageStepDone MessageType = 256
// MessageClockProvide wraps GST_MESSAGE_CLOCK_PROVIDE
//
// an element notifies its capability of providing
// a clock. This message is used internally and
// never forwarded to the application.
MessageClockProvide MessageType = 512
// MessageClockLost wraps GST_MESSAGE_CLOCK_LOST
//
// The current clock as selected by the pipeline became
// unusable. The pipeline will select a new clock on
// the next PLAYING state change. The application
// should set the pipeline to PAUSED and back to
// PLAYING when this message is received.
MessageClockLost MessageType = 1024
// MessageNewClock wraps GST_MESSAGE_NEW_CLOCK
//
// a new clock was selected in the pipeline.
MessageNewClock MessageType = 2048
// MessageStructureChange wraps GST_MESSAGE_STRUCTURE_CHANGE
//
// the structure of the pipeline changed. This
// message is used internally and never forwarded to the application.
MessageStructureChange MessageType = 4096
// MessageStreamStatus wraps GST_MESSAGE_STREAM_STATUS
//
// status about a stream, emitted when it starts,
// stops, errors, etc..
MessageStreamStatus MessageType = 8192
// MessageApplication wraps GST_MESSAGE_APPLICATION
//
// message posted by the application, possibly
// via an application-specific element.
MessageApplication MessageType = 16384
// MessageElement wraps GST_MESSAGE_ELEMENT
//
// element-specific message, see the specific element's
// documentation
MessageElement MessageType = 32768
// MessageSegmentStart wraps GST_MESSAGE_SEGMENT_START
//
// pipeline started playback of a segment. This
// message is used internally and never forwarded to the application.
MessageSegmentStart MessageType = 65536
// MessageSegmentDone wraps GST_MESSAGE_SEGMENT_DONE
//
// pipeline completed playback of a segment. This
// message is forwarded to the application after all elements that posted
// @GST_MESSAGE_SEGMENT_START posted a GST_MESSAGE_SEGMENT_DONE message.
MessageSegmentDone MessageType = 131072
// MessageDurationChanged wraps GST_MESSAGE_DURATION_CHANGED
//
// The duration of a pipeline changed. The
// application can get the new duration with a duration query.
MessageDurationChanged MessageType = 262144
// MessageLatency wraps GST_MESSAGE_LATENCY
//
// Posted by elements when their latency changes. The
// application should recalculate and distribute a new latency.
MessageLatency MessageType = 524288
// MessageAsyncStart wraps GST_MESSAGE_ASYNC_START
//
// Posted by elements when they start an ASYNC
// #GstStateChange. This message is not forwarded to the application but is used
// internally.
MessageAsyncStart MessageType = 1048576
// MessageAsyncDone wraps GST_MESSAGE_ASYNC_DONE
//
// Posted by elements when they complete an ASYNC
// #GstStateChange. The application will only receive this message from the toplevel
// pipeline.
MessageAsyncDone MessageType = 2097152
// MessageRequestState wraps GST_MESSAGE_REQUEST_STATE
//
// Posted by elements when they want the pipeline to
// change state. This message is a suggestion to the application which can
// decide to perform the state change on (part of) the pipeline.
MessageRequestState MessageType = 4194304
// MessageStepStart wraps GST_MESSAGE_STEP_START
//
// A stepping operation was started.
MessageStepStart MessageType = 8388608
// MessageQos wraps GST_MESSAGE_QOS
//
// A buffer was dropped or an element changed its processing
// strategy for Quality of Service reasons.
MessageQos MessageType = 16777216
// MessageProgress wraps GST_MESSAGE_PROGRESS
//
// A progress message.
MessageProgress MessageType = 33554432
// MessageToc wraps GST_MESSAGE_TOC
//
// A new table of contents (TOC) was found or previously found TOC
// was updated.
MessageToc MessageType = 67108864
// MessageResetTime wraps GST_MESSAGE_RESET_TIME
//
// Message to request resetting the pipeline's
// running time from the pipeline. This is an internal message which
// applications will likely never receive.
MessageResetTime MessageType = 134217728
// MessageStreamStart wraps GST_MESSAGE_STREAM_START
//
// Message indicating start of a new stream. Useful
// e.g. when using playbin in gapless playback mode, to get notified when
// the next title actually starts playing (which will be some time after
// the URI for the next title has been set).
MessageStreamStart MessageType = 268435456
// MessageNeedContext wraps GST_MESSAGE_NEED_CONTEXT
//
// Message indicating that an element wants a specific context (Since: 1.2)
MessageNeedContext MessageType = 536870912
// MessageHaveContext wraps GST_MESSAGE_HAVE_CONTEXT
//
// Message indicating that an element created a context (Since: 1.2)
MessageHaveContext MessageType = 1073741824
// MessageExtended wraps GST_MESSAGE_EXTENDED
//
// Message is an extended message type (see below).
// These extended message IDs can't be used directly with mask-based API
// like gst_bus_poll() or gst_bus_timed_pop_filtered(), but you can still
// filter for GST_MESSAGE_EXTENDED and then check the result for the
// specific type. (Since: 1.4)
MessageExtended MessageType = -2147483648
// MessageDeviceAdded wraps GST_MESSAGE_DEVICE_ADDED
//
// Message indicating a #GstDevice was added to
// a #GstDeviceProvider (Since: 1.4)
MessageDeviceAdded MessageType = -2147483647
// MessageDeviceRemoved wraps GST_MESSAGE_DEVICE_REMOVED
//
// Message indicating a #GstDevice was removed
// from a #GstDeviceProvider (Since: 1.4)
MessageDeviceRemoved MessageType = -2147483646
// MessagePropertyNotify wraps GST_MESSAGE_PROPERTY_NOTIFY
//
// Message indicating a #GObject property has
// changed (Since: 1.10)
MessagePropertyNotify MessageType = -2147483645
// MessageStreamCollection wraps GST_MESSAGE_STREAM_COLLECTION
//
// Message indicating a new #GstStreamCollection
// is available (Since: 1.10)
MessageStreamCollection MessageType = -2147483644
// MessageStreamsSelected wraps GST_MESSAGE_STREAMS_SELECTED
//
// Message indicating the active selection of
// #GstStreams has changed (Since: 1.10)
MessageStreamsSelected MessageType = -2147483643
// MessageRedirect wraps GST_MESSAGE_REDIRECT
//
// Message indicating to request the application to
// try to play the given URL(s). Useful if for example a HTTP 302/303
// response is received with a non-HTTP URL inside. (Since: 1.10)
MessageRedirect MessageType = -2147483642
// MessageDeviceChanged wraps GST_MESSAGE_DEVICE_CHANGED
//
// Message indicating a #GstDevice was changed
// a #GstDeviceProvider (Since: 1.16)
MessageDeviceChanged MessageType = -2147483641
// MessageInstantRateRequest wraps GST_MESSAGE_INSTANT_RATE_REQUEST
//
// Message sent by elements to request the
// running time from the pipeline when an instant rate change should
// be applied (which may be in the past when the answer arrives). (Since: 1.18)
MessageInstantRateRequest MessageType = -2147483640
// MessageAny wraps GST_MESSAGE_ANY
//
// mask for all of the above messages.
MessageAny MessageType = -1
)
func marshalMessageType(p unsafe.Pointer) (any, error) {
return MessageType(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if m contains other
func (m MessageType) Has(other MessageType) bool {
return (m & other) == other
}
var _ gobject.GoValueInitializer = MessageType(0)
func (f MessageType) InitGoValue(v *gobject.Value) {
v.Init(TypeMessageType)
v.SetFlags(int(f))
}
func (f MessageType) String() string {
if f == 0 {
return "MessageType(0)"
}
var parts []string
if (f & MessageUnknown) != 0 {
parts = append(parts, "MessageUnknown")
}
if (f & MessageEos) != 0 {
parts = append(parts, "MessageEos")
}
if (f & MessageError) != 0 {
parts = append(parts, "MessageError")
}
if (f & MessageWarning) != 0 {
parts = append(parts, "MessageWarning")
}
if (f & MessageInfo) != 0 {
parts = append(parts, "MessageInfo")
}
if (f & MessageTag) != 0 {
parts = append(parts, "MessageTag")
}
if (f & MessageBuffering) != 0 {
parts = append(parts, "MessageBuffering")
}
if (f & MessageStateChanged) != 0 {
parts = append(parts, "MessageStateChanged")
}
if (f & MessageStateDirty) != 0 {
parts = append(parts, "MessageStateDirty")
}
if (f & MessageStepDone) != 0 {
parts = append(parts, "MessageStepDone")
}
if (f & MessageClockProvide) != 0 {
parts = append(parts, "MessageClockProvide")
}
if (f & MessageClockLost) != 0 {
parts = append(parts, "MessageClockLost")
}
if (f & MessageNewClock) != 0 {
parts = append(parts, "MessageNewClock")
}
if (f & MessageStructureChange) != 0 {
parts = append(parts, "MessageStructureChange")
}
if (f & MessageStreamStatus) != 0 {
parts = append(parts, "MessageStreamStatus")
}
if (f & MessageApplication) != 0 {
parts = append(parts, "MessageApplication")
}
if (f & MessageElement) != 0 {
parts = append(parts, "MessageElement")
}
if (f & MessageSegmentStart) != 0 {
parts = append(parts, "MessageSegmentStart")
}
if (f & MessageSegmentDone) != 0 {
parts = append(parts, "MessageSegmentDone")
}
if (f & MessageDurationChanged) != 0 {
parts = append(parts, "MessageDurationChanged")
}
if (f & MessageLatency) != 0 {
parts = append(parts, "MessageLatency")
}
if (f & MessageAsyncStart) != 0 {
parts = append(parts, "MessageAsyncStart")
}
if (f & MessageAsyncDone) != 0 {
parts = append(parts, "MessageAsyncDone")
}
if (f & MessageRequestState) != 0 {
parts = append(parts, "MessageRequestState")
}
if (f & MessageStepStart) != 0 {
parts = append(parts, "MessageStepStart")
}
if (f & MessageQos) != 0 {
parts = append(parts, "MessageQos")
}
if (f & MessageProgress) != 0 {
parts = append(parts, "MessageProgress")
}
if (f & MessageToc) != 0 {
parts = append(parts, "MessageToc")
}
if (f & MessageResetTime) != 0 {
parts = append(parts, "MessageResetTime")
}
if (f & MessageStreamStart) != 0 {
parts = append(parts, "MessageStreamStart")
}
if (f & MessageNeedContext) != 0 {
parts = append(parts, "MessageNeedContext")
}
if (f & MessageHaveContext) != 0 {
parts = append(parts, "MessageHaveContext")
}
if (f & MessageExtended) != 0 {
parts = append(parts, "MessageExtended")
}
if (f & MessageDeviceAdded) != 0 {
parts = append(parts, "MessageDeviceAdded")
}
if (f & MessageDeviceRemoved) != 0 {
parts = append(parts, "MessageDeviceRemoved")
}
if (f & MessagePropertyNotify) != 0 {
parts = append(parts, "MessagePropertyNotify")
}
if (f & MessageStreamCollection) != 0 {
parts = append(parts, "MessageStreamCollection")
}
if (f & MessageStreamsSelected) != 0 {
parts = append(parts, "MessageStreamsSelected")
}
if (f & MessageRedirect) != 0 {
parts = append(parts, "MessageRedirect")
}
if (f & MessageDeviceChanged) != 0 {
parts = append(parts, "MessageDeviceChanged")
}
if (f & MessageInstantRateRequest) != 0 {
parts = append(parts, "MessageInstantRateRequest")
}
if (f & MessageAny) != 0 {
parts = append(parts, "MessageAny")
}
return "MessageType(" + strings.Join(parts, "|") + ")"
}
// MetaFlags wraps GstMetaFlags
//
// Extra metadata flags.
type MetaFlags C.gint
const (
// MetaFlagNone wraps GST_META_FLAG_NONE
//
// no flags
MetaFlagNone MetaFlags = 0
// MetaFlagReadonly wraps GST_META_FLAG_READONLY
//
// metadata should not be modified
MetaFlagReadonly MetaFlags = 1
// MetaFlagPooled wraps GST_META_FLAG_POOLED
//
// metadata is managed by a bufferpool
MetaFlagPooled MetaFlags = 2
// MetaFlagLocked wraps GST_META_FLAG_LOCKED
//
// metadata should not be removed
MetaFlagLocked MetaFlags = 4
// MetaFlagLast wraps GST_META_FLAG_LAST
//
// additional flags can be added starting from this flag.
MetaFlagLast MetaFlags = 65536
)
func marshalMetaFlags(p unsafe.Pointer) (any, error) {
return MetaFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if m contains other
func (m MetaFlags) Has(other MetaFlags) bool {
return (m & other) == other
}
var _ gobject.GoValueInitializer = MetaFlags(0)
func (f MetaFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeMetaFlags)
v.SetFlags(int(f))
}
func (f MetaFlags) String() string {
if f == 0 {
return "MetaFlags(0)"
}
var parts []string
if (f & MetaFlagNone) != 0 {
parts = append(parts, "MetaFlagNone")
}
if (f & MetaFlagReadonly) != 0 {
parts = append(parts, "MetaFlagReadonly")
}
if (f & MetaFlagPooled) != 0 {
parts = append(parts, "MetaFlagPooled")
}
if (f & MetaFlagLocked) != 0 {
parts = append(parts, "MetaFlagLocked")
}
if (f & MetaFlagLast) != 0 {
parts = append(parts, "MetaFlagLast")
}
return "MetaFlags(" + strings.Join(parts, "|") + ")"
}
// MiniObjectFlags wraps GstMiniObjectFlags
//
// Flags for the mini object
type MiniObjectFlags C.gint
const (
// MiniObjectFlagLockable wraps GST_MINI_OBJECT_FLAG_LOCKABLE
//
// the object can be locked and unlocked with
// gst_mini_object_lock() and gst_mini_object_unlock().
MiniObjectFlagLockable MiniObjectFlags = 1
// MiniObjectFlagLockReadonly wraps GST_MINI_OBJECT_FLAG_LOCK_READONLY
//
// the object is permanently locked in
// READONLY mode. Only read locks can be performed on the object.
MiniObjectFlagLockReadonly MiniObjectFlags = 2
// MiniObjectFlagMayBeLeaked wraps GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED
//
// the object is expected to stay alive
// even after gst_deinit() has been called and so should be ignored by leak
// detection tools. (Since: 1.10)
MiniObjectFlagMayBeLeaked MiniObjectFlags = 4
// MiniObjectFlagLast wraps GST_MINI_OBJECT_FLAG_LAST
//
// first flag that can be used by subclasses.
MiniObjectFlagLast MiniObjectFlags = 16
)
func marshalMiniObjectFlags(p unsafe.Pointer) (any, error) {
return MiniObjectFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if m contains other
func (m MiniObjectFlags) Has(other MiniObjectFlags) bool {
return (m & other) == other
}
var _ gobject.GoValueInitializer = MiniObjectFlags(0)
func (f MiniObjectFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeMiniObjectFlags)
v.SetFlags(int(f))
}
func (f MiniObjectFlags) String() string {
if f == 0 {
return "MiniObjectFlags(0)"
}
var parts []string
if (f & MiniObjectFlagLockable) != 0 {
parts = append(parts, "MiniObjectFlagLockable")
}
if (f & MiniObjectFlagLockReadonly) != 0 {
parts = append(parts, "MiniObjectFlagLockReadonly")
}
if (f & MiniObjectFlagMayBeLeaked) != 0 {
parts = append(parts, "MiniObjectFlagMayBeLeaked")
}
if (f & MiniObjectFlagLast) != 0 {
parts = append(parts, "MiniObjectFlagLast")
}
return "MiniObjectFlags(" + strings.Join(parts, "|") + ")"
}
// ObjectFlags wraps GstObjectFlags
//
// The standard flags that an gstobject may have.
type ObjectFlags C.gint
const (
// ObjectFlagMayBeLeaked wraps GST_OBJECT_FLAG_MAY_BE_LEAKED
//
// the object is expected to stay alive even
// after gst_deinit() has been called and so should be ignored by leak
// detection tools. (Since: 1.10)
ObjectFlagMayBeLeaked ObjectFlags = 1
// ObjectFlagConstructed wraps GST_OBJECT_FLAG_CONSTRUCTED
//
// Flag that's set when the object has been constructed. This can be used by
// API such as base class setters to differentiate between the case where
// they're called from a subclass's instance init function (and where the
// object isn't fully constructed yet, and so one shouldn't do anything but
// set values in the instance structure), and the case where the object is
// constructed.
ObjectFlagConstructed ObjectFlags = 2
// ObjectFlagLast wraps GST_OBJECT_FLAG_LAST
//
// subclasses can add additional flags starting from this flag
ObjectFlagLast ObjectFlags = 16
)
func marshalObjectFlags(p unsafe.Pointer) (any, error) {
return ObjectFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if o contains other
func (o ObjectFlags) Has(other ObjectFlags) bool {
return (o & other) == other
}
var _ gobject.GoValueInitializer = ObjectFlags(0)
func (f ObjectFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeObjectFlags)
v.SetFlags(int(f))
}
func (f ObjectFlags) String() string {
if f == 0 {
return "ObjectFlags(0)"
}
var parts []string
if (f & ObjectFlagMayBeLeaked) != 0 {
parts = append(parts, "ObjectFlagMayBeLeaked")
}
if (f & ObjectFlagConstructed) != 0 {
parts = append(parts, "ObjectFlagConstructed")
}
if (f & ObjectFlagLast) != 0 {
parts = append(parts, "ObjectFlagLast")
}
return "ObjectFlags(" + strings.Join(parts, "|") + ")"
}
// PadFlags wraps GstPadFlags
//
// Pad state flags
type PadFlags C.gint
const (
// PadFlagBlocked wraps GST_PAD_FLAG_BLOCKED
//
// is dataflow on a pad blocked
PadFlagBlocked PadFlags = 16
// PadFlagFlushing wraps GST_PAD_FLAG_FLUSHING
//
// is pad flushing
PadFlagFlushing PadFlags = 32
// PadFlagEos wraps GST_PAD_FLAG_EOS
//
// is pad in EOS state
PadFlagEos PadFlags = 64
// PadFlagBlocking wraps GST_PAD_FLAG_BLOCKING
//
// is pad currently blocking on a buffer or event
PadFlagBlocking PadFlags = 128
// PadFlagNeedParent wraps GST_PAD_FLAG_NEED_PARENT
//
// ensure that there is a parent object before calling
// into the pad callbacks.
PadFlagNeedParent PadFlags = 256
// PadFlagNeedReconfigure wraps GST_PAD_FLAG_NEED_RECONFIGURE
//
// the pad should be reconfigured/renegotiated.
// The flag has to be unset manually after
// reconfiguration happened.
PadFlagNeedReconfigure PadFlags = 512
// PadFlagPendingEvents wraps GST_PAD_FLAG_PENDING_EVENTS
//
// the pad has pending events
PadFlagPendingEvents PadFlags = 1024
// PadFlagFixedCaps wraps GST_PAD_FLAG_FIXED_CAPS
//
// the pad is using fixed caps. This means that
// once the caps are set on the pad, the default caps query function
// will only return those caps.
PadFlagFixedCaps PadFlags = 2048
// PadFlagProxyCaps wraps GST_PAD_FLAG_PROXY_CAPS
//
// the default event and query handler will forward
// all events and queries to the internally linked pads
// instead of discarding them.
PadFlagProxyCaps PadFlags = 4096
// PadFlagProxyAllocation wraps GST_PAD_FLAG_PROXY_ALLOCATION
//
// the default query handler will forward
// allocation queries to the internally linked pads
// instead of discarding them.
PadFlagProxyAllocation PadFlags = 8192
// PadFlagProxyScheduling wraps GST_PAD_FLAG_PROXY_SCHEDULING
//
// the default query handler will forward
// scheduling queries to the internally linked pads
// instead of discarding them.
PadFlagProxyScheduling PadFlags = 16384
// PadFlagAcceptIntersect wraps GST_PAD_FLAG_ACCEPT_INTERSECT
//
// the default accept-caps handler will check
// it the caps intersect the query-caps result instead
// of checking for a subset. This is interesting for
// parsers that can accept incompletely specified caps.
PadFlagAcceptIntersect PadFlags = 32768
// PadFlagAcceptTemplate wraps GST_PAD_FLAG_ACCEPT_TEMPLATE
//
// the default accept-caps handler will use
// the template pad caps instead of query caps to
// compare with the accept caps. Use this in combination
// with %GST_PAD_FLAG_ACCEPT_INTERSECT. (Since: 1.6)
PadFlagAcceptTemplate PadFlags = 65536
// PadFlagLast wraps GST_PAD_FLAG_LAST
//
// offset to define more flags
PadFlagLast PadFlags = 1048576
)
func marshalPadFlags(p unsafe.Pointer) (any, error) {
return PadFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PadFlags) Has(other PadFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PadFlags(0)
func (f PadFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePadFlags)
v.SetFlags(int(f))
}
func (f PadFlags) String() string {
if f == 0 {
return "PadFlags(0)"
}
var parts []string
if (f & PadFlagBlocked) != 0 {
parts = append(parts, "PadFlagBlocked")
}
if (f & PadFlagFlushing) != 0 {
parts = append(parts, "PadFlagFlushing")
}
if (f & PadFlagEos) != 0 {
parts = append(parts, "PadFlagEos")
}
if (f & PadFlagBlocking) != 0 {
parts = append(parts, "PadFlagBlocking")
}
if (f & PadFlagNeedParent) != 0 {
parts = append(parts, "PadFlagNeedParent")
}
if (f & PadFlagNeedReconfigure) != 0 {
parts = append(parts, "PadFlagNeedReconfigure")
}
if (f & PadFlagPendingEvents) != 0 {
parts = append(parts, "PadFlagPendingEvents")
}
if (f & PadFlagFixedCaps) != 0 {
parts = append(parts, "PadFlagFixedCaps")
}
if (f & PadFlagProxyCaps) != 0 {
parts = append(parts, "PadFlagProxyCaps")
}
if (f & PadFlagProxyAllocation) != 0 {
parts = append(parts, "PadFlagProxyAllocation")
}
if (f & PadFlagProxyScheduling) != 0 {
parts = append(parts, "PadFlagProxyScheduling")
}
if (f & PadFlagAcceptIntersect) != 0 {
parts = append(parts, "PadFlagAcceptIntersect")
}
if (f & PadFlagAcceptTemplate) != 0 {
parts = append(parts, "PadFlagAcceptTemplate")
}
if (f & PadFlagLast) != 0 {
parts = append(parts, "PadFlagLast")
}
return "PadFlags(" + strings.Join(parts, "|") + ")"
}
// PadLinkCheck wraps GstPadLinkCheck
//
// The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS
// and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are
// specified, expensive but safe @GST_PAD_LINK_CHECK_CAPS are performed.
//
// &gt; Only disable some of the checks if you are 100% certain you know the link
// &gt; will not fail because of hierarchy/caps compatibility failures. If uncertain,
// &gt; use the default checks (%GST_PAD_LINK_CHECK_DEFAULT) or the regular methods
// &gt; for linking the pads.
type PadLinkCheck C.gint
const (
// PadLinkCheckNothing wraps GST_PAD_LINK_CHECK_NOTHING
//
// Don't check hierarchy or caps compatibility.
PadLinkCheckNothing PadLinkCheck = 0
// PadLinkCheckHierarchy wraps GST_PAD_LINK_CHECK_HIERARCHY
//
// Check the pads have same parents/grandparents.
// Could be omitted if it is already known that the two elements that own the
// pads are in the same bin.
PadLinkCheckHierarchy PadLinkCheck = 1
// PadLinkCheckTemplateCaps wraps GST_PAD_LINK_CHECK_TEMPLATE_CAPS
//
// Check if the pads are compatible by using
// their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
// would be unsafe e.g. if one pad has %GST_CAPS_ANY.
PadLinkCheckTemplateCaps PadLinkCheck = 2
// PadLinkCheckCaps wraps GST_PAD_LINK_CHECK_CAPS
//
// Check if the pads are compatible by comparing the
// caps returned by gst_pad_query_caps().
PadLinkCheckCaps PadLinkCheck = 4
// PadLinkCheckNoReconfigure wraps GST_PAD_LINK_CHECK_NO_RECONFIGURE
//
// Disables pushing a reconfigure event when pads are
// linked.
PadLinkCheckNoReconfigure PadLinkCheck = 8
// PadLinkCheckDefault wraps GST_PAD_LINK_CHECK_DEFAULT
//
// The default checks done when linking
// pads (i.e. the ones used by gst_pad_link()).
PadLinkCheckDefault PadLinkCheck = 5
)
func marshalPadLinkCheck(p unsafe.Pointer) (any, error) {
return PadLinkCheck(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PadLinkCheck) Has(other PadLinkCheck) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PadLinkCheck(0)
func (f PadLinkCheck) InitGoValue(v *gobject.Value) {
v.Init(TypePadLinkCheck)
v.SetFlags(int(f))
}
func (f PadLinkCheck) String() string {
if f == 0 {
return "PadLinkCheck(0)"
}
var parts []string
if (f & PadLinkCheckNothing) != 0 {
parts = append(parts, "PadLinkCheckNothing")
}
if (f & PadLinkCheckHierarchy) != 0 {
parts = append(parts, "PadLinkCheckHierarchy")
}
if (f & PadLinkCheckTemplateCaps) != 0 {
parts = append(parts, "PadLinkCheckTemplateCaps")
}
if (f & PadLinkCheckCaps) != 0 {
parts = append(parts, "PadLinkCheckCaps")
}
if (f & PadLinkCheckNoReconfigure) != 0 {
parts = append(parts, "PadLinkCheckNoReconfigure")
}
if (f & PadLinkCheckDefault) != 0 {
parts = append(parts, "PadLinkCheckDefault")
}
return "PadLinkCheck(" + strings.Join(parts, "|") + ")"
}
// PadProbeType wraps GstPadProbeType
//
// The different probing types that can occur. When either one of
// @GST_PAD_PROBE_TYPE_IDLE or @GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a
// blocking probe.
type PadProbeType C.gint
const (
// PadProbeTypeInvalid wraps GST_PAD_PROBE_TYPE_INVALID
//
// invalid probe type
PadProbeTypeInvalid PadProbeType = 0
// PadProbeTypeIdle wraps GST_PAD_PROBE_TYPE_IDLE
//
// probe idle pads and block while the callback is called
PadProbeTypeIdle PadProbeType = 1
// PadProbeTypeBlock wraps GST_PAD_PROBE_TYPE_BLOCK
//
// probe and block pads
PadProbeTypeBlock PadProbeType = 2
// PadProbeTypeBuffer wraps GST_PAD_PROBE_TYPE_BUFFER
//
// probe buffers
PadProbeTypeBuffer PadProbeType = 16
// PadProbeTypeBufferList wraps GST_PAD_PROBE_TYPE_BUFFER_LIST
//
// probe buffer lists
PadProbeTypeBufferList PadProbeType = 32
// PadProbeTypeEventDownstream wraps GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM
//
// probe downstream events
PadProbeTypeEventDownstream PadProbeType = 64
// PadProbeTypeEventUpstream wraps GST_PAD_PROBE_TYPE_EVENT_UPSTREAM
//
// probe upstream events
PadProbeTypeEventUpstream PadProbeType = 128
// PadProbeTypeEventFlush wraps GST_PAD_PROBE_TYPE_EVENT_FLUSH
//
// probe flush events. This probe has to be
// explicitly enabled and is not included in the
// @@GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM or
// @@GST_PAD_PROBE_TYPE_EVENT_UPSTREAM probe types.
PadProbeTypeEventFlush PadProbeType = 256
// PadProbeTypeQueryDownstream wraps GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM
//
// probe downstream queries
PadProbeTypeQueryDownstream PadProbeType = 512
// PadProbeTypeQueryUpstream wraps GST_PAD_PROBE_TYPE_QUERY_UPSTREAM
//
// probe upstream queries
PadProbeTypeQueryUpstream PadProbeType = 1024
// PadProbeTypePush wraps GST_PAD_PROBE_TYPE_PUSH
//
// probe push
PadProbeTypePush PadProbeType = 4096
// PadProbeTypePull wraps GST_PAD_PROBE_TYPE_PULL
//
// probe pull
PadProbeTypePull PadProbeType = 8192
// PadProbeTypeBlocking wraps GST_PAD_PROBE_TYPE_BLOCKING
//
// probe and block at the next opportunity, at data flow or when idle
PadProbeTypeBlocking PadProbeType = 3
// PadProbeTypeDataDownstream wraps GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM
//
// probe downstream data (buffers, buffer lists, and events)
PadProbeTypeDataDownstream PadProbeType = 112
// PadProbeTypeDataUpstream wraps GST_PAD_PROBE_TYPE_DATA_UPSTREAM
//
// probe upstream data (events)
PadProbeTypeDataUpstream PadProbeType = 128
// PadProbeTypeDataBoth wraps GST_PAD_PROBE_TYPE_DATA_BOTH
//
// probe upstream and downstream data (buffers, buffer lists, and events)
PadProbeTypeDataBoth PadProbeType = 240
// PadProbeTypeBlockDownstream wraps GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM
//
// probe and block downstream data (buffers, buffer lists, and events)
PadProbeTypeBlockDownstream PadProbeType = 114
// PadProbeTypeBlockUpstream wraps GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM
//
// probe and block upstream data (events)
PadProbeTypeBlockUpstream PadProbeType = 130
// PadProbeTypeEventBoth wraps GST_PAD_PROBE_TYPE_EVENT_BOTH
//
// probe upstream and downstream events
PadProbeTypeEventBoth PadProbeType = 192
// PadProbeTypeQueryBoth wraps GST_PAD_PROBE_TYPE_QUERY_BOTH
//
// probe upstream and downstream queries
PadProbeTypeQueryBoth PadProbeType = 1536
// PadProbeTypeAllBoth wraps GST_PAD_PROBE_TYPE_ALL_BOTH
//
// probe upstream events and queries and downstream buffers, buffer lists, events and queries
PadProbeTypeAllBoth PadProbeType = 1776
// PadProbeTypeScheduling wraps GST_PAD_PROBE_TYPE_SCHEDULING
//
// probe push and pull
PadProbeTypeScheduling PadProbeType = 12288
)
func marshalPadProbeType(p unsafe.Pointer) (any, error) {
return PadProbeType(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PadProbeType) Has(other PadProbeType) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PadProbeType(0)
func (f PadProbeType) InitGoValue(v *gobject.Value) {
v.Init(TypePadProbeType)
v.SetFlags(int(f))
}
func (f PadProbeType) String() string {
if f == 0 {
return "PadProbeType(0)"
}
var parts []string
if (f & PadProbeTypeInvalid) != 0 {
parts = append(parts, "PadProbeTypeInvalid")
}
if (f & PadProbeTypeIdle) != 0 {
parts = append(parts, "PadProbeTypeIdle")
}
if (f & PadProbeTypeBlock) != 0 {
parts = append(parts, "PadProbeTypeBlock")
}
if (f & PadProbeTypeBuffer) != 0 {
parts = append(parts, "PadProbeTypeBuffer")
}
if (f & PadProbeTypeBufferList) != 0 {
parts = append(parts, "PadProbeTypeBufferList")
}
if (f & PadProbeTypeEventDownstream) != 0 {
parts = append(parts, "PadProbeTypeEventDownstream")
}
if (f & PadProbeTypeEventUpstream) != 0 {
parts = append(parts, "PadProbeTypeEventUpstream")
}
if (f & PadProbeTypeEventFlush) != 0 {
parts = append(parts, "PadProbeTypeEventFlush")
}
if (f & PadProbeTypeQueryDownstream) != 0 {
parts = append(parts, "PadProbeTypeQueryDownstream")
}
if (f & PadProbeTypeQueryUpstream) != 0 {
parts = append(parts, "PadProbeTypeQueryUpstream")
}
if (f & PadProbeTypePush) != 0 {
parts = append(parts, "PadProbeTypePush")
}
if (f & PadProbeTypePull) != 0 {
parts = append(parts, "PadProbeTypePull")
}
if (f & PadProbeTypeBlocking) != 0 {
parts = append(parts, "PadProbeTypeBlocking")
}
if (f & PadProbeTypeDataDownstream) != 0 {
parts = append(parts, "PadProbeTypeDataDownstream")
}
if (f & PadProbeTypeDataUpstream) != 0 {
parts = append(parts, "PadProbeTypeDataUpstream")
}
if (f & PadProbeTypeDataBoth) != 0 {
parts = append(parts, "PadProbeTypeDataBoth")
}
if (f & PadProbeTypeBlockDownstream) != 0 {
parts = append(parts, "PadProbeTypeBlockDownstream")
}
if (f & PadProbeTypeBlockUpstream) != 0 {
parts = append(parts, "PadProbeTypeBlockUpstream")
}
if (f & PadProbeTypeEventBoth) != 0 {
parts = append(parts, "PadProbeTypeEventBoth")
}
if (f & PadProbeTypeQueryBoth) != 0 {
parts = append(parts, "PadProbeTypeQueryBoth")
}
if (f & PadProbeTypeAllBoth) != 0 {
parts = append(parts, "PadProbeTypeAllBoth")
}
if (f & PadProbeTypeScheduling) != 0 {
parts = append(parts, "PadProbeTypeScheduling")
}
return "PadProbeType(" + strings.Join(parts, "|") + ")"
}
// PadTemplateFlags wraps GstPadTemplateFlags
//
// Flags for the padtemplate
type PadTemplateFlags C.gint
const (
// PadTemplateFlagLast wraps GST_PAD_TEMPLATE_FLAG_LAST
//
// first flag that can be used by subclasses.
PadTemplateFlagLast PadTemplateFlags = 256
)
func marshalPadTemplateFlags(p unsafe.Pointer) (any, error) {
return PadTemplateFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PadTemplateFlags) Has(other PadTemplateFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PadTemplateFlags(0)
func (f PadTemplateFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePadTemplateFlags)
v.SetFlags(int(f))
}
func (f PadTemplateFlags) String() string {
if f == 0 {
return "PadTemplateFlags(0)"
}
var parts []string
if (f & PadTemplateFlagLast) != 0 {
parts = append(parts, "PadTemplateFlagLast")
}
return "PadTemplateFlags(" + strings.Join(parts, "|") + ")"
}
// ParseFlags wraps GstParseFlags
//
// Parsing options.
type ParseFlags C.gint
const (
// ParseFlagNone wraps GST_PARSE_FLAG_NONE
//
// Do not use any special parsing options.
ParseFlagNone ParseFlags = 0
// ParseFlagFatalErrors wraps GST_PARSE_FLAG_FATAL_ERRORS
//
// Always return %NULL when an error occurs
// (default behaviour is to return partially constructed bins or elements
// in some cases)
ParseFlagFatalErrors ParseFlags = 1
// ParseFlagNoSingleElementBins wraps GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS
//
// If a bin only has a single element,
// just return the element.
ParseFlagNoSingleElementBins ParseFlags = 2
// ParseFlagPlaceInBin wraps GST_PARSE_FLAG_PLACE_IN_BIN
//
// If more than one toplevel element is described
// by the pipeline description string, put them in a #GstBin instead of a
// #GstPipeline. (Since: 1.10)
ParseFlagPlaceInBin ParseFlags = 4
)
func marshalParseFlags(p unsafe.Pointer) (any, error) {
return ParseFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p ParseFlags) Has(other ParseFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = ParseFlags(0)
func (f ParseFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeParseFlags)
v.SetFlags(int(f))
}
func (f ParseFlags) String() string {
if f == 0 {
return "ParseFlags(0)"
}
var parts []string
if (f & ParseFlagNone) != 0 {
parts = append(parts, "ParseFlagNone")
}
if (f & ParseFlagFatalErrors) != 0 {
parts = append(parts, "ParseFlagFatalErrors")
}
if (f & ParseFlagNoSingleElementBins) != 0 {
parts = append(parts, "ParseFlagNoSingleElementBins")
}
if (f & ParseFlagPlaceInBin) != 0 {
parts = append(parts, "ParseFlagPlaceInBin")
}
return "ParseFlags(" + strings.Join(parts, "|") + ")"
}
// PipelineFlags wraps GstPipelineFlags
//
// Pipeline flags
type PipelineFlags C.gint
const (
// PipelineFlagFixedClock wraps GST_PIPELINE_FLAG_FIXED_CLOCK
//
// this pipeline works with a fixed clock
PipelineFlagFixedClock PipelineFlags = 524288
// PipelineFlagLast wraps GST_PIPELINE_FLAG_LAST
//
// offset to define more flags
PipelineFlagLast PipelineFlags = 8388608
)
func marshalPipelineFlags(p unsafe.Pointer) (any, error) {
return PipelineFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PipelineFlags) Has(other PipelineFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PipelineFlags(0)
func (f PipelineFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePipelineFlags)
v.SetFlags(int(f))
}
func (f PipelineFlags) String() string {
if f == 0 {
return "PipelineFlags(0)"
}
var parts []string
if (f & PipelineFlagFixedClock) != 0 {
parts = append(parts, "PipelineFlagFixedClock")
}
if (f & PipelineFlagLast) != 0 {
parts = append(parts, "PipelineFlagLast")
}
return "PipelineFlags(" + strings.Join(parts, "|") + ")"
}
// PluginAPIFlags wraps GstPluginAPIFlags
type PluginAPIFlags C.gint
const (
// PluginApiFlagIgnoreEnumMembers wraps GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS
//
// Ignore enum members when generating
// the plugins cache. This is useful if the members of the enum are generated
// dynamically, in order not to expose incorrect documentation to the end user.
PluginApiFlagIgnoreEnumMembers PluginAPIFlags = 1
)
func marshalPluginAPIFlags(p unsafe.Pointer) (any, error) {
return PluginAPIFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PluginAPIFlags) Has(other PluginAPIFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PluginAPIFlags(0)
func (f PluginAPIFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePluginAPIFlags)
v.SetFlags(int(f))
}
func (f PluginAPIFlags) String() string {
if f == 0 {
return "PluginAPIFlags(0)"
}
var parts []string
if (f & PluginApiFlagIgnoreEnumMembers) != 0 {
parts = append(parts, "PluginApiFlagIgnoreEnumMembers")
}
return "PluginAPIFlags(" + strings.Join(parts, "|") + ")"
}
// PluginDependencyFlags wraps GstPluginDependencyFlags
//
// Flags used in connection with gst_plugin_add_dependency().
type PluginDependencyFlags C.gint
const (
// PluginDependencyFlagNone wraps GST_PLUGIN_DEPENDENCY_FLAG_NONE
//
// no special flags
PluginDependencyFlagNone PluginDependencyFlags = 0
// PluginDependencyFlagRecurse wraps GST_PLUGIN_DEPENDENCY_FLAG_RECURSE
//
// recurse into subdirectories
PluginDependencyFlagRecurse PluginDependencyFlags = 1
// PluginDependencyFlagPathsAreDefaultOnly wraps GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY
//
// use paths
// argument only if none of the environment variables is set
PluginDependencyFlagPathsAreDefaultOnly PluginDependencyFlags = 2
// PluginDependencyFlagFileNameIsSuffix wraps GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX
//
// interpret
// filename argument as filter suffix and check all matching files in
// the directory
PluginDependencyFlagFileNameIsSuffix PluginDependencyFlags = 4
// PluginDependencyFlagFileNameIsPrefix wraps GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX
//
// interpret
// filename argument as filter prefix and check all matching files in
// the directory. Since: 1.8.
PluginDependencyFlagFileNameIsPrefix PluginDependencyFlags = 8
// PluginDependencyFlagPathsAreRelativeToExe wraps GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE
//
// interpret
// non-absolute paths as relative to the main executable directory. Since
// 1.14.
PluginDependencyFlagPathsAreRelativeToExe PluginDependencyFlags = 16
)
func marshalPluginDependencyFlags(p unsafe.Pointer) (any, error) {
return PluginDependencyFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PluginDependencyFlags) Has(other PluginDependencyFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PluginDependencyFlags(0)
func (f PluginDependencyFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePluginDependencyFlags)
v.SetFlags(int(f))
}
func (f PluginDependencyFlags) String() string {
if f == 0 {
return "PluginDependencyFlags(0)"
}
var parts []string
if (f & PluginDependencyFlagNone) != 0 {
parts = append(parts, "PluginDependencyFlagNone")
}
if (f & PluginDependencyFlagRecurse) != 0 {
parts = append(parts, "PluginDependencyFlagRecurse")
}
if (f & PluginDependencyFlagPathsAreDefaultOnly) != 0 {
parts = append(parts, "PluginDependencyFlagPathsAreDefaultOnly")
}
if (f & PluginDependencyFlagFileNameIsSuffix) != 0 {
parts = append(parts, "PluginDependencyFlagFileNameIsSuffix")
}
if (f & PluginDependencyFlagFileNameIsPrefix) != 0 {
parts = append(parts, "PluginDependencyFlagFileNameIsPrefix")
}
if (f & PluginDependencyFlagPathsAreRelativeToExe) != 0 {
parts = append(parts, "PluginDependencyFlagPathsAreRelativeToExe")
}
return "PluginDependencyFlags(" + strings.Join(parts, "|") + ")"
}
// PluginFlags wraps GstPluginFlags
//
// The plugin loading state
type PluginFlags C.gint
const (
// PluginFlagCached wraps GST_PLUGIN_FLAG_CACHED
//
// Temporarily loaded plugins
PluginFlagCached PluginFlags = 16
// PluginFlagBlacklisted wraps GST_PLUGIN_FLAG_BLACKLISTED
//
// The plugin won't be scanned (again)
PluginFlagBlacklisted PluginFlags = 32
)
func marshalPluginFlags(p unsafe.Pointer) (any, error) {
return PluginFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if p contains other
func (p PluginFlags) Has(other PluginFlags) bool {
return (p & other) == other
}
var _ gobject.GoValueInitializer = PluginFlags(0)
func (f PluginFlags) InitGoValue(v *gobject.Value) {
v.Init(TypePluginFlags)
v.SetFlags(int(f))
}
func (f PluginFlags) String() string {
if f == 0 {
return "PluginFlags(0)"
}
var parts []string
if (f & PluginFlagCached) != 0 {
parts = append(parts, "PluginFlagCached")
}
if (f & PluginFlagBlacklisted) != 0 {
parts = append(parts, "PluginFlagBlacklisted")
}
return "PluginFlags(" + strings.Join(parts, "|") + ")"
}
// QueryTypeFlags wraps GstQueryTypeFlags
//
// #GstQueryTypeFlags indicate the aspects of the different #GstQueryType
// values. You can get the type flags of a #GstQueryType with the
// gst_query_type_get_flags() function.
type QueryTypeFlags C.gint
const (
// QueryTypeUpstream wraps GST_QUERY_TYPE_UPSTREAM
//
// Set if the query can travel upstream.
QueryTypeUpstream QueryTypeFlags = 1
// QueryTypeDownstream wraps GST_QUERY_TYPE_DOWNSTREAM
//
// Set if the query can travel downstream.
QueryTypeDownstream QueryTypeFlags = 2
// QueryTypeSerialized wraps GST_QUERY_TYPE_SERIALIZED
//
// Set if the query should be serialized with data
// flow.
QueryTypeSerialized QueryTypeFlags = 4
)
func marshalQueryTypeFlags(p unsafe.Pointer) (any, error) {
return QueryTypeFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if q contains other
func (q QueryTypeFlags) Has(other QueryTypeFlags) bool {
return (q & other) == other
}
var _ gobject.GoValueInitializer = QueryTypeFlags(0)
func (f QueryTypeFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeQueryTypeFlags)
v.SetFlags(int(f))
}
func (f QueryTypeFlags) String() string {
if f == 0 {
return "QueryTypeFlags(0)"
}
var parts []string
if (f & QueryTypeUpstream) != 0 {
parts = append(parts, "QueryTypeUpstream")
}
if (f & QueryTypeDownstream) != 0 {
parts = append(parts, "QueryTypeDownstream")
}
if (f & QueryTypeSerialized) != 0 {
parts = append(parts, "QueryTypeSerialized")
}
return "QueryTypeFlags(" + strings.Join(parts, "|") + ")"
}
// SchedulingFlags wraps GstSchedulingFlags
//
// The different scheduling flags.
type SchedulingFlags C.gint
const (
// SchedulingFlagSeekable wraps GST_SCHEDULING_FLAG_SEEKABLE
//
// if seeking is possible
SchedulingFlagSeekable SchedulingFlags = 1
// SchedulingFlagSequential wraps GST_SCHEDULING_FLAG_SEQUENTIAL
//
// if sequential access is recommended
SchedulingFlagSequential SchedulingFlags = 2
// SchedulingFlagBandwidthLimited wraps GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED
//
// if bandwidth is limited and buffering possible (since 1.2)
SchedulingFlagBandwidthLimited SchedulingFlags = 4
)
func marshalSchedulingFlags(p unsafe.Pointer) (any, error) {
return SchedulingFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s SchedulingFlags) Has(other SchedulingFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = SchedulingFlags(0)
func (f SchedulingFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeSchedulingFlags)
v.SetFlags(int(f))
}
func (f SchedulingFlags) String() string {
if f == 0 {
return "SchedulingFlags(0)"
}
var parts []string
if (f & SchedulingFlagSeekable) != 0 {
parts = append(parts, "SchedulingFlagSeekable")
}
if (f & SchedulingFlagSequential) != 0 {
parts = append(parts, "SchedulingFlagSequential")
}
if (f & SchedulingFlagBandwidthLimited) != 0 {
parts = append(parts, "SchedulingFlagBandwidthLimited")
}
return "SchedulingFlags(" + strings.Join(parts, "|") + ")"
}
// SeekFlags wraps GstSeekFlags
//
// Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags
// can be used together.
//
// A non flushing seek might take some time to perform as the currently
// playing data in the pipeline will not be cleared.
//
// An accurate seek might be slower for formats that don't have any indexes
// or timestamp markers in the stream. Specifying this flag might require a
// complete scan of the file in those cases.
//
// When performing a segment seek: after the playback of the segment completes,
// no EOS will be emitted by the element that performed the seek, but a
// %GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element.
// When this message is posted, it is possible to send a new seek event to
// continue playback. With this seek method it is possible to perform seamless
// looping or simple linear editing.
//
// When only changing the playback rate and not the direction, the
// %GST_SEEK_FLAG_INSTANT_RATE_CHANGE flag can be used for a non-flushing seek
// to signal that the rate change should be applied immediately. This requires
// special support in the seek handlers (e.g. demuxers) and any elements
// synchronizing to the clock, and in general can't work in all cases (for example
// UDP streaming where the delivery rate is controlled by a remote server). The
// instant-rate-change mode supports changing the trickmode-related GST_SEEK_ flags,
// but can't be used in conjunction with other seek flags that affect the new
// playback position - as the playback position will not be changing.
//
// When doing fast forward (rate &gt; 1.0) or fast reverse (rate &lt; -1.0) trickmode
// playback, the %GST_SEEK_FLAG_TRICKMODE flag can be used to instruct decoders
// and demuxers to adjust the playback rate by skipping frames. This can improve
// performance and decrease CPU usage because not all frames need to be decoded.
//
// Beyond that, the %GST_SEEK_FLAG_TRICKMODE_KEY_UNITS flag can be used to
// request that decoders skip all frames except key units, and
// %GST_SEEK_FLAG_TRICKMODE_NO_AUDIO flags can be used to request that audio
// decoders do no decoding at all, and simple output silence.
//
// The %GST_SEEK_FLAG_SNAP_BEFORE flag can be used to snap to the previous
// relevant location, and the %GST_SEEK_FLAG_SNAP_AFTER flag can be used to
// select the next relevant location. If %GST_SEEK_FLAG_KEY_UNIT is specified,
// the relevant location is a keyframe. If both flags are specified, the nearest
// of these locations will be selected. If none are specified, the implementation is
// free to select whichever it wants.
//
// The before and after here are in running time, so when playing backwards,
// the next location refers to the one that will played in next, and not the
// one that is located after in the actual source stream.
//
// Also see part-seeking.txt in the GStreamer design documentation for more
// details on the meaning of these flags and the behaviour expected of
// elements that handle them.
type SeekFlags C.gint
const (
// SeekFlagNone wraps GST_SEEK_FLAG_NONE
//
// no flag
SeekFlagNone SeekFlags = 0
// SeekFlagFlush wraps GST_SEEK_FLAG_FLUSH
//
// flush pipeline
SeekFlagFlush SeekFlags = 1
// SeekFlagAccurate wraps GST_SEEK_FLAG_ACCURATE
//
// accurate position is requested, this might
// be considerably slower for some formats.
SeekFlagAccurate SeekFlags = 2
// SeekFlagKeyUnit wraps GST_SEEK_FLAG_KEY_UNIT
//
// seek to the nearest keyframe. This might be
// faster but less accurate.
SeekFlagKeyUnit SeekFlags = 4
// SeekFlagSegment wraps GST_SEEK_FLAG_SEGMENT
//
// perform a segment seek.
SeekFlagSegment SeekFlags = 8
// SeekFlagTrickmode wraps GST_SEEK_FLAG_TRICKMODE
//
// when doing fast forward or fast reverse playback, allow
// elements to skip frames instead of generating all
// frames. (Since: 1.6)
SeekFlagTrickmode SeekFlags = 16
// SeekFlagSkip wraps GST_SEEK_FLAG_SKIP
//
// Deprecated backward compatibility flag, replaced
// by %GST_SEEK_FLAG_TRICKMODE
SeekFlagSkip SeekFlags = 16
// SeekFlagSnapBefore wraps GST_SEEK_FLAG_SNAP_BEFORE
//
// go to a location before the requested position,
// if %GST_SEEK_FLAG_KEY_UNIT this means the keyframe at or before
// the requested position the one at or before the seek target.
SeekFlagSnapBefore SeekFlags = 32
// SeekFlagSnapAfter wraps GST_SEEK_FLAG_SNAP_AFTER
//
// go to a location after the requested position,
// if %GST_SEEK_FLAG_KEY_UNIT this means the keyframe at of after the
// requested position.
SeekFlagSnapAfter SeekFlags = 64
// SeekFlagSnapNearest wraps GST_SEEK_FLAG_SNAP_NEAREST
//
// go to a position near the requested position,
// if %GST_SEEK_FLAG_KEY_UNIT this means the keyframe closest
// to the requested position, if both keyframes are at an equal
// distance, behaves like %GST_SEEK_FLAG_SNAP_BEFORE.
SeekFlagSnapNearest SeekFlags = 96
// SeekFlagTrickmodeKeyUnits wraps GST_SEEK_FLAG_TRICKMODE_KEY_UNITS
//
// when doing fast forward or fast reverse
// playback, request that elements only decode keyframes
// and skip all other content, for formats that have
// keyframes. (Since: 1.6)
SeekFlagTrickmodeKeyUnits SeekFlags = 128
// SeekFlagTrickmodeNoAudio wraps GST_SEEK_FLAG_TRICKMODE_NO_AUDIO
//
// when doing fast forward or fast reverse
// playback, request that audio decoder elements skip
// decoding and output only gap events or silence. (Since: 1.6)
SeekFlagTrickmodeNoAudio SeekFlags = 256
// SeekFlagTrickmodeForwardPredicted wraps GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED
//
// When doing fast forward or fast reverse
// playback, request that elements only decode keyframes and
// forward predicted frames and skip all other content (for example
// B-Frames), for formats that have keyframes and forward predicted
// frames. (Since: 1.18)
SeekFlagTrickmodeForwardPredicted SeekFlags = 512
// SeekFlagInstantRateChange wraps GST_SEEK_FLAG_INSTANT_RATE_CHANGE
//
// Signals that a rate change should be
// applied immediately. Only valid if start/stop position
// are GST_CLOCK_TIME_NONE, the playback direction does not change
// and the seek is not flushing. (Since: 1.18)
SeekFlagInstantRateChange SeekFlags = 1024
)
func marshalSeekFlags(p unsafe.Pointer) (any, error) {
return SeekFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s SeekFlags) Has(other SeekFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = SeekFlags(0)
func (f SeekFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeSeekFlags)
v.SetFlags(int(f))
}
func (f SeekFlags) String() string {
if f == 0 {
return "SeekFlags(0)"
}
var parts []string
if (f & SeekFlagNone) != 0 {
parts = append(parts, "SeekFlagNone")
}
if (f & SeekFlagFlush) != 0 {
parts = append(parts, "SeekFlagFlush")
}
if (f & SeekFlagAccurate) != 0 {
parts = append(parts, "SeekFlagAccurate")
}
if (f & SeekFlagKeyUnit) != 0 {
parts = append(parts, "SeekFlagKeyUnit")
}
if (f & SeekFlagSegment) != 0 {
parts = append(parts, "SeekFlagSegment")
}
if (f & SeekFlagTrickmode) != 0 {
parts = append(parts, "SeekFlagTrickmode")
}
if (f & SeekFlagSkip) != 0 {
parts = append(parts, "SeekFlagSkip")
}
if (f & SeekFlagSnapBefore) != 0 {
parts = append(parts, "SeekFlagSnapBefore")
}
if (f & SeekFlagSnapAfter) != 0 {
parts = append(parts, "SeekFlagSnapAfter")
}
if (f & SeekFlagSnapNearest) != 0 {
parts = append(parts, "SeekFlagSnapNearest")
}
if (f & SeekFlagTrickmodeKeyUnits) != 0 {
parts = append(parts, "SeekFlagTrickmodeKeyUnits")
}
if (f & SeekFlagTrickmodeNoAudio) != 0 {
parts = append(parts, "SeekFlagTrickmodeNoAudio")
}
if (f & SeekFlagTrickmodeForwardPredicted) != 0 {
parts = append(parts, "SeekFlagTrickmodeForwardPredicted")
}
if (f & SeekFlagInstantRateChange) != 0 {
parts = append(parts, "SeekFlagInstantRateChange")
}
return "SeekFlags(" + strings.Join(parts, "|") + ")"
}
// SegmentFlags wraps GstSegmentFlags
//
// Flags for the GstSegment structure. Currently mapped to the corresponding
// values of the seek flags.
type SegmentFlags C.gint
const (
// SegmentFlagNone wraps GST_SEGMENT_FLAG_NONE
//
// no flags
SegmentFlagNone SegmentFlags = 0
// SegmentFlagReset wraps GST_SEGMENT_FLAG_RESET
//
// reset the pipeline running_time to the segment
// running_time
SegmentFlagReset SegmentFlags = 1
// SegmentFlagTrickmode wraps GST_SEGMENT_FLAG_TRICKMODE
//
// perform skip playback (Since: 1.6)
SegmentFlagTrickmode SegmentFlags = 16
// SegmentFlagSkip wraps GST_SEGMENT_FLAG_SKIP
//
// Deprecated backward compatibility flag, replaced
// by @GST_SEGMENT_FLAG_TRICKMODE
SegmentFlagSkip SegmentFlags = 16
// SegmentFlagSegment wraps GST_SEGMENT_FLAG_SEGMENT
//
// send SEGMENT_DONE instead of EOS
SegmentFlagSegment SegmentFlags = 8
// SegmentFlagTrickmodeKeyUnits wraps GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS
//
// Decode only keyframes, where
// possible (Since: 1.6)
SegmentFlagTrickmodeKeyUnits SegmentFlags = 128
// SegmentFlagTrickmodeForwardPredicted wraps GST_SEGMENT_FLAG_TRICKMODE_FORWARD_PREDICTED
//
// Decode only keyframes or forward
// predicted frames, where possible (Since: 1.18)
SegmentFlagTrickmodeForwardPredicted SegmentFlags = 512
// SegmentFlagTrickmodeNoAudio wraps GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO
//
// Do not decode any audio, where
// possible (Since: 1.6)
SegmentFlagTrickmodeNoAudio SegmentFlags = 256
)
func marshalSegmentFlags(p unsafe.Pointer) (any, error) {
return SegmentFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s SegmentFlags) Has(other SegmentFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = SegmentFlags(0)
func (f SegmentFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeSegmentFlags)
v.SetFlags(int(f))
}
func (f SegmentFlags) String() string {
if f == 0 {
return "SegmentFlags(0)"
}
var parts []string
if (f & SegmentFlagNone) != 0 {
parts = append(parts, "SegmentFlagNone")
}
if (f & SegmentFlagReset) != 0 {
parts = append(parts, "SegmentFlagReset")
}
if (f & SegmentFlagTrickmode) != 0 {
parts = append(parts, "SegmentFlagTrickmode")
}
if (f & SegmentFlagSkip) != 0 {
parts = append(parts, "SegmentFlagSkip")
}
if (f & SegmentFlagSegment) != 0 {
parts = append(parts, "SegmentFlagSegment")
}
if (f & SegmentFlagTrickmodeKeyUnits) != 0 {
parts = append(parts, "SegmentFlagTrickmodeKeyUnits")
}
if (f & SegmentFlagTrickmodeForwardPredicted) != 0 {
parts = append(parts, "SegmentFlagTrickmodeForwardPredicted")
}
if (f & SegmentFlagTrickmodeNoAudio) != 0 {
parts = append(parts, "SegmentFlagTrickmodeNoAudio")
}
return "SegmentFlags(" + strings.Join(parts, "|") + ")"
}
// SerializeFlags wraps GstSerializeFlags
type SerializeFlags C.gint
const (
// SerializeFlagNone wraps GST_SERIALIZE_FLAG_NONE
//
// No special flags specified.
SerializeFlagNone SerializeFlags = 0
// SerializeFlagBackwardCompat wraps GST_SERIALIZE_FLAG_BACKWARD_COMPAT
//
// Serialize using the old format for
// nested structures.
SerializeFlagBackwardCompat SerializeFlags = 1
// SerializeFlagStrict wraps GST_SERIALIZE_FLAG_STRICT
//
// Serialization fails if a value cannot be serialized instead of using
// placeholder "NULL" value (e.g. pointers, objects).
SerializeFlagStrict SerializeFlags = 2
)
func marshalSerializeFlags(p unsafe.Pointer) (any, error) {
return SerializeFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s SerializeFlags) Has(other SerializeFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = SerializeFlags(0)
func (f SerializeFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeSerializeFlags)
v.SetFlags(int(f))
}
func (f SerializeFlags) String() string {
if f == 0 {
return "SerializeFlags(0)"
}
var parts []string
if (f & SerializeFlagNone) != 0 {
parts = append(parts, "SerializeFlagNone")
}
if (f & SerializeFlagBackwardCompat) != 0 {
parts = append(parts, "SerializeFlagBackwardCompat")
}
if (f & SerializeFlagStrict) != 0 {
parts = append(parts, "SerializeFlagStrict")
}
return "SerializeFlags(" + strings.Join(parts, "|") + ")"
}
// StackTraceFlags wraps GstStackTraceFlags
type StackTraceFlags C.gint
const (
// StackTraceShowNone wraps GST_STACK_TRACE_SHOW_NONE
//
// Try to retrieve the minimum information
// available, which may be none on some platforms
// (Since: 1.18)
StackTraceShowNone StackTraceFlags = 0
// StackTraceShowFull wraps GST_STACK_TRACE_SHOW_FULL
//
// Try to retrieve as much information as possible,
// including source information when getting the
// stack trace
StackTraceShowFull StackTraceFlags = 1
)
func marshalStackTraceFlags(p unsafe.Pointer) (any, error) {
return StackTraceFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s StackTraceFlags) Has(other StackTraceFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = StackTraceFlags(0)
func (f StackTraceFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeStackTraceFlags)
v.SetFlags(int(f))
}
func (f StackTraceFlags) String() string {
if f == 0 {
return "StackTraceFlags(0)"
}
var parts []string
if (f & StackTraceShowNone) != 0 {
parts = append(parts, "StackTraceShowNone")
}
if (f & StackTraceShowFull) != 0 {
parts = append(parts, "StackTraceShowFull")
}
return "StackTraceFlags(" + strings.Join(parts, "|") + ")"
}
// StreamFlags wraps GstStreamFlags
type StreamFlags C.gint
const (
// StreamFlagNone wraps GST_STREAM_FLAG_NONE
//
// This stream has no special attributes
StreamFlagNone StreamFlags = 0
// StreamFlagSparse wraps GST_STREAM_FLAG_SPARSE
//
// This stream is a sparse stream (e.g. a subtitle
// stream), data may flow only in irregular intervals with large gaps in
// between.
StreamFlagSparse StreamFlags = 1
// StreamFlagSelect wraps GST_STREAM_FLAG_SELECT
//
// This stream should be selected by default. This
// flag may be used by demuxers to signal that a stream should be selected
// by default in a playback scenario.
StreamFlagSelect StreamFlags = 2
// StreamFlagUnselect wraps GST_STREAM_FLAG_UNSELECT
//
// This stream should not be selected by default.
// This flag may be used by demuxers to signal that a stream should not
// be selected by default in a playback scenario, but only if explicitly
// selected by the user (e.g. an audio track for the hard of hearing or
// a director's commentary track).
StreamFlagUnselect StreamFlags = 4
)
func marshalStreamFlags(p unsafe.Pointer) (any, error) {
return StreamFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s StreamFlags) Has(other StreamFlags) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = StreamFlags(0)
func (f StreamFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeStreamFlags)
v.SetFlags(int(f))
}
func (f StreamFlags) String() string {
if f == 0 {
return "StreamFlags(0)"
}
var parts []string
if (f & StreamFlagNone) != 0 {
parts = append(parts, "StreamFlagNone")
}
if (f & StreamFlagSparse) != 0 {
parts = append(parts, "StreamFlagSparse")
}
if (f & StreamFlagSelect) != 0 {
parts = append(parts, "StreamFlagSelect")
}
if (f & StreamFlagUnselect) != 0 {
parts = append(parts, "StreamFlagUnselect")
}
return "StreamFlags(" + strings.Join(parts, "|") + ")"
}
// StreamType wraps GstStreamType
//
// #GstStreamType describes a high level classification set for
// flows of data in #GstStream objects.
//
// Note that this is a flag, and therefore users should not assume it
// will be a single value. Do not use the equality operator for checking
// whether a stream is of a certain type.
type StreamType C.gint
const (
// StreamTypeUnknown wraps GST_STREAM_TYPE_UNKNOWN
//
// The stream is of unknown (unclassified) type.
StreamTypeUnknown StreamType = 1
// StreamTypeAudio wraps GST_STREAM_TYPE_AUDIO
//
// The stream is of audio data
StreamTypeAudio StreamType = 2
// StreamTypeVideo wraps GST_STREAM_TYPE_VIDEO
//
// The stream carries video data
StreamTypeVideo StreamType = 4
// StreamTypeContainer wraps GST_STREAM_TYPE_CONTAINER
//
// The stream is a muxed container type
StreamTypeContainer StreamType = 8
// StreamTypeText wraps GST_STREAM_TYPE_TEXT
//
// The stream contains subtitle / subpicture data.
StreamTypeText StreamType = 16
)
func marshalStreamType(p unsafe.Pointer) (any, error) {
return StreamType(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if s contains other
func (s StreamType) Has(other StreamType) bool {
return (s & other) == other
}
var _ gobject.GoValueInitializer = StreamType(0)
func (f StreamType) InitGoValue(v *gobject.Value) {
v.Init(TypeStreamType)
v.SetFlags(int(f))
}
func (f StreamType) String() string {
if f == 0 {
return "StreamType(0)"
}
var parts []string
if (f & StreamTypeUnknown) != 0 {
parts = append(parts, "StreamTypeUnknown")
}
if (f & StreamTypeAudio) != 0 {
parts = append(parts, "StreamTypeAudio")
}
if (f & StreamTypeVideo) != 0 {
parts = append(parts, "StreamTypeVideo")
}
if (f & StreamTypeContainer) != 0 {
parts = append(parts, "StreamTypeContainer")
}
if (f & StreamTypeText) != 0 {
parts = append(parts, "StreamTypeText")
}
return "StreamType(" + strings.Join(parts, "|") + ")"
}
// TracerValueFlags wraps GstTracerValueFlags
//
// Flag that describe the value. These flags help applications processing the
// logs to understand the values.
type TracerValueFlags C.gint
const (
// TracerValueFlagsNone wraps GST_TRACER_VALUE_FLAGS_NONE
//
// no flags
TracerValueFlagsNone TracerValueFlags = 0
// TracerValueFlagsOptional wraps GST_TRACER_VALUE_FLAGS_OPTIONAL
//
// the value is optional. When using this flag
// one need to have an additional boolean arg before this value in the
// var-args list passed to gst_tracer_record_log().
TracerValueFlagsOptional TracerValueFlags = 1
// TracerValueFlagsAggregated wraps GST_TRACER_VALUE_FLAGS_AGGREGATED
//
// the value is a combined figure, since the
// start of tracing. Examples are averages or timestamps.
TracerValueFlagsAggregated TracerValueFlags = 2
)
func marshalTracerValueFlags(p unsafe.Pointer) (any, error) {
return TracerValueFlags(gobject.ValueFromNative(p).Flags()), nil
}
// Has returns true if t contains other
func (t TracerValueFlags) Has(other TracerValueFlags) bool {
return (t & other) == other
}
var _ gobject.GoValueInitializer = TracerValueFlags(0)
func (f TracerValueFlags) InitGoValue(v *gobject.Value) {
v.Init(TypeTracerValueFlags)
v.SetFlags(int(f))
}
func (f TracerValueFlags) String() string {
if f == 0 {
return "TracerValueFlags(0)"
}
var parts []string
if (f & TracerValueFlagsNone) != 0 {
parts = append(parts, "TracerValueFlagsNone")
}
if (f & TracerValueFlagsOptional) != 0 {
parts = append(parts, "TracerValueFlagsOptional")
}
if (f & TracerValueFlagsAggregated) != 0 {
parts = append(parts, "TracerValueFlagsAggregated")
}
return "TracerValueFlags(" + strings.Join(parts, "|") + ")"
}
// BufferForEachMetaFunc wraps GstBufferForeachMetaFunc
//
// A function that will be called from gst_buffer_foreach_meta(). The @meta
// field will point to a the reference of the meta.
//
// @buffer should not be modified from this callback.
//
// When this function returns %TRUE, the next meta will be
// returned. When %FALSE is returned, gst_buffer_foreach_meta() will return.
//
// When @meta is set to %NULL, the item will be removed from the buffer.
type BufferForEachMetaFunc func(buffer *Buffer) (meta *Meta, goret bool)
// BufferListFunc wraps GstBufferListFunc
//
// A function that will be called from gst_buffer_list_foreach(). The @buffer
// field will point to a the reference of the buffer at @idx.
//
// When this function returns %TRUE, the next buffer will be
// returned. When %FALSE is returned, gst_buffer_list_foreach() will return.
//
// When @buffer is set to %NULL, the item will be removed from the bufferlist.
// When @buffer has been made writable, the new buffer reference can be assigned
// to @buffer. This function is responsible for unreffing the old buffer when
// removing or modifying.
type BufferListFunc func(idx uint) (buffer *Buffer, goret bool)
// CapsFilterMapFunc wraps GstCapsFilterMapFunc
//
// A function that will be called in gst_caps_filter_and_map_in_place().
// The function may modify @features and @structure, and both will be
// removed from the caps if %FALSE is returned.
type CapsFilterMapFunc func(features *CapsFeatures, structure *Structure) (goret bool)
// CapsForEachFunc wraps GstCapsForeachFunc
//
// A function that will be called in gst_caps_foreach(). The function may
// not modify @features or @structure.
type CapsForEachFunc func(features *CapsFeatures, structure *Structure) (goret bool)
// CapsMapFunc wraps GstCapsMapFunc
//
// A function that will be called in gst_caps_map_in_place(). The function
// 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().
type IteratorFoldFunction func(item *gobject.Value, ret *gobject.Value) (goret bool)
// IteratorForEachFunction wraps GstIteratorForeachFunction
//
// A function that is called by gst_iterator_foreach() for every element.
type IteratorForEachFunction func(item *gobject.Value)
// LogFunction wraps GstLogFunction
//
// Function prototype for a logging function that can be registered with
// gst_debug_add_log_function().
// Use G_GNUC_NO_INSTRUMENT on that function.
type LogFunction func(category *DebugCategory, level DebugLevel, file string, function string, line int, object gobject.Object, message *DebugMessage)
// MiniObjectNotify wraps GstMiniObjectNotify
//
// A #GstMiniObjectNotify function can be added to a mini object as a
// callback that gets triggered when gst_mini_object_unref() drops the
// last ref and @obj is about to be freed.
type MiniObjectNotify func(obj *MiniObject)
// PadForwardFunction wraps GstPadForwardFunction
//
// A forward function is called for all internally linked pads, see
// gst_pad_forward().
type PadForwardFunction func(pad Pad) (goret bool)
// PadProbeCallback wraps GstPadProbeCallback
//
// Callback used by gst_pad_add_probe(). Gets called to notify about the current
// blocking type.
//
// The callback is allowed to modify the data pointer in @info.
type PadProbeCallback func(pad Pad, info *PadProbeInfo) (goret PadProbeReturn)
// PluginFeatureFilter wraps GstPluginFeatureFilter
//
// A function that can be used with e.g. gst_registry_feature_filter()
// to get a list of pluginfeature that match certain criteria.
type PluginFeatureFilter func(feature PluginFeature) (goret bool)
// PluginFilter wraps GstPluginFilter
//
// A function that can be used with e.g. gst_registry_plugin_filter()
// to get a list of plugins that match certain criteria.
type PluginFilter func(plugin Plugin) (goret bool)
// PluginInitFullFunc wraps GstPluginInitFullFunc
//
// A plugin should provide a pointer to a function of either #GstPluginInitFunc
// or this type in the plugin_desc struct.
// The function will be called by the loader at startup. One would then
// register each #GstPluginFeature. This version allows
// user data to be passed to init function (useful for bindings).
type PluginInitFullFunc func(plugin Plugin) (goret bool)
// PromiseChangeFunc wraps GstPromiseChangeFunc
type PromiseChangeFunc func(promise *Promise)
// StructureFilterMapFunc wraps GstStructureFilterMapFunc
//
// A function that will be called in gst_structure_filter_and_map_in_place().
// The function may modify @value, and the value will be removed from
// the structure if %FALSE is returned.
type StructureFilterMapFunc func(fieldId glib.Quark, value *gobject.Value) (goret bool)
// StructureForEachFunc wraps GstStructureForeachFunc
//
// A function that will be called in gst_structure_foreach(). The function may
// not modify @value.
type StructureForEachFunc func(fieldId glib.Quark, value *gobject.Value) (goret bool)
// StructureMapFunc wraps GstStructureMapFunc
//
// A function that will be called in gst_structure_map_in_place(). The function
// may modify @value.
type StructureMapFunc func(fieldId glib.Quark, value *gobject.Value) (goret bool)
// TagForEachFunc wraps GstTagForeachFunc
//
// A function that will be called in gst_tag_list_foreach(). The function may
// not modify the tag list.
type TagForEachFunc func(list *TagList, tag string)
// TaskFunction wraps GstTaskFunction
//
// A function that will repeatedly be called in the thread created by
// a #GstTask.
type TaskFunction func()
// TaskPoolFunction wraps GstTaskPoolFunction
//
// Task function, see gst_task_pool_push().
type TaskPoolFunction func()
// TypeFindFunction wraps GstTypeFindFunction
//
// A function that will be called by typefinding.
type TypeFindFunction func(find *TypeFind)
// BusFunc wraps GstBusFunc
//
// Specifies the type of function passed to gst_bus_add_watch() or
// gst_bus_add_watch_full(), which is called from the mainloop when a message
// is available on the bus.
//
// The message passed to the function will be unreffed after execution of this
// function so it should not be freed in the function.
//
// Note that this function is used as a #GSourceFunc which means that returning
// %FALSE will remove the #GSource from the mainloop.
type BusFunc func(bus Bus, message *Message) (goret bool)
// BusSyncHandler wraps GstBusSyncHandler
//
// Handler will be invoked synchronously, when a new message has been injected
// into the bus. This function is mostly used internally. Only one sync handler
// can be attached to a given bus.
//
// If the handler returns %GST_BUS_DROP, it should unref the message, else the
// message should not be unreffed by the sync handler.
type BusSyncHandler func(bus Bus, message *Message) (goret BusSyncReply)
// ClockCallback wraps GstClockCallback
//
// The function prototype of the callback.
type ClockCallback func(clock Clock, time ClockTime, id ClockID) (goret bool)
// ElementCallAsyncFunc wraps GstElementCallAsyncFunc
//
// Callback prototype used in #gst_element_call_async
type ElementCallAsyncFunc func(element Element)
// ElementForEachPadFunc wraps GstElementForeachPadFunc
//
// Function called for each pad when using gst_element_foreach_sink_pad(),
// gst_element_foreach_src_pad(), or gst_element_foreach_pad().
type ElementForEachPadFunc func(element Element, pad Pad) (goret bool)
// DebugAddLogFunction wraps gst_debug_add_log_function
//
// The function takes the following parameters:
//
// - fn LogFunction: the function to use
//
// Adds the logging function to the list of logging functions.
// Be sure to use #G_GNUC_NO_INSTRUMENT on that function, it is needed.
func DebugAddLogFunction(fn LogFunction) {
var carg1 C.GstLogFunction // callback, scope: notified, closure: carg2, destroy: carg3
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
carg1 = (*[0]byte)(C._gotk4_gst1_LogFunction)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
C.gst_debug_add_log_function(carg1, carg2, carg3)
runtime.KeepAlive(fn)
}
// DebugAddRingBufferLogger wraps gst_debug_add_ring_buffer_logger
//
// The function takes the following parameters:
//
// - maxSizePerThread uint: Maximum size of log per thread in bytes
// - threadTimeout uint: Timeout for threads in seconds
//
// Adds a memory ringbuffer based debug logger that stores up to
// @max_size_per_thread bytes of logs per thread and times out threads after
// @thread_timeout seconds of inactivity.
//
// Logs can be fetched with gst_debug_ring_buffer_logger_get_logs() and the
// logger can be removed again with gst_debug_remove_ring_buffer_logger().
// Only one logger at a time is possible.
func DebugAddRingBufferLogger(maxSizePerThread uint, threadTimeout uint) {
var carg1 C.guint // in, none, casted
var carg2 C.guint // in, none, casted
carg1 = C.guint(maxSizePerThread)
carg2 = C.guint(threadTimeout)
C.gst_debug_add_ring_buffer_logger(carg1, carg2)
runtime.KeepAlive(maxSizePerThread)
runtime.KeepAlive(threadTimeout)
}
// DebugBinToDotData wraps gst_debug_bin_to_dot_data
//
// The function takes the following parameters:
//
// - bin Bin: the top-level pipeline that should be analyzed
// - details DebugGraphDetails: type of #GstDebugGraphDetails to use
//
// The function returns the following values:
//
// - goret string
//
// To aid debugging applications one can use this method to obtain the whole
// network of gstreamer elements that form the pipeline into a dot file.
// This data can be processed with graphviz to get an image.
func DebugBinToDotData(bin Bin, details DebugGraphDetails) string {
var carg1 *C.GstBin // in, none, converted
var carg2 C.GstDebugGraphDetails // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg1 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg2 = C.GstDebugGraphDetails(details)
cret = C.gst_debug_bin_to_dot_data(carg1, carg2)
runtime.KeepAlive(bin)
runtime.KeepAlive(details)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// DebugBinToDotFile wraps gst_debug_bin_to_dot_file
//
// The function takes the following parameters:
//
// - bin Bin: the top-level pipeline that should be analyzed
// - details DebugGraphDetails: type of #GstDebugGraphDetails to use
// - fileName string: output base filename (e.g. "myplayer")
//
// To aid debugging applications one can use this method to write out the whole
// network of gstreamer elements that form the pipeline into a dot file.
// This file can be processed with graphviz to get an image.
//
// ``` shell
// dot -Tpng -oimage.png graph_lowlevel.dot
// ```
func DebugBinToDotFile(bin Bin, details DebugGraphDetails, fileName string) {
var carg1 *C.GstBin // in, none, converted
var carg2 C.GstDebugGraphDetails // in, none, casted
var carg3 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg2 = C.GstDebugGraphDetails(details)
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(fileName)))
defer C.free(unsafe.Pointer(carg3))
C.gst_debug_bin_to_dot_file(carg1, carg2, carg3)
runtime.KeepAlive(bin)
runtime.KeepAlive(details)
runtime.KeepAlive(fileName)
}
// DebugBinToDotFileWithTs wraps gst_debug_bin_to_dot_file_with_ts
//
// The function takes the following parameters:
//
// - bin Bin: the top-level pipeline that should be analyzed
// - details DebugGraphDetails: type of #GstDebugGraphDetails to use
// - fileName string: output base filename (e.g. "myplayer")
//
// 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.
func DebugBinToDotFileWithTs(bin Bin, details DebugGraphDetails, fileName string) {
var carg1 *C.GstBin // in, none, converted
var carg2 C.GstDebugGraphDetails // in, none, casted
var carg3 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg2 = C.GstDebugGraphDetails(details)
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(fileName)))
defer C.free(unsafe.Pointer(carg3))
C.gst_debug_bin_to_dot_file_with_ts(carg1, carg2, carg3)
runtime.KeepAlive(bin)
runtime.KeepAlive(details)
runtime.KeepAlive(fileName)
}
// DebugConstructTermColor wraps gst_debug_construct_term_color
//
// The function takes the following parameters:
//
// - colorinfo uint: the color info
//
// The function returns the following values:
//
// - goret string
//
// Constructs a string that can be used for getting the desired color in color
// terminals.
// You need to free the string after use.
func DebugConstructTermColor(colorinfo uint) string {
var carg1 C.guint // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg1 = C.guint(colorinfo)
cret = C.gst_debug_construct_term_color(carg1)
runtime.KeepAlive(colorinfo)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// DebugConstructWinColor wraps gst_debug_construct_win_color
//
// The function takes the following parameters:
//
// - colorinfo uint: the color info
//
// The function returns the following values:
//
// - goret int
//
// Constructs an integer that can be used for getting the desired color in
// windows' terminals (cmd.exe). As there is no mean to underline, we simply
// ignore this attribute.
//
// This function returns 0 on non-windows machines.
func DebugConstructWinColor(colorinfo uint) int {
var carg1 C.guint // in, none, casted
var cret C.gint // return, none, casted
carg1 = C.guint(colorinfo)
cret = C.gst_debug_construct_win_color(carg1)
runtime.KeepAlive(colorinfo)
var goret int
goret = int(cret)
return goret
}
// DebugGetColorMode wraps gst_debug_get_color_mode
// The function returns the following values:
//
// - goret DebugColorMode
//
// Changes the coloring mode for debug output.
func DebugGetColorMode() DebugColorMode {
var cret C.GstDebugColorMode // return, none, casted
cret = C.gst_debug_get_color_mode()
var goret DebugColorMode
goret = DebugColorMode(cret)
return goret
}
// DebugGetDefaultThreshold wraps gst_debug_get_default_threshold
// The function returns the following values:
//
// - goret DebugLevel
//
// Returns the default threshold that is used for new categories.
func DebugGetDefaultThreshold() DebugLevel {
var cret C.GstDebugLevel // return, none, casted
cret = C.gst_debug_get_default_threshold()
var goret DebugLevel
goret = DebugLevel(cret)
return goret
}
// DebugGetStackTrace wraps gst_debug_get_stack_trace
//
// The function takes the following parameters:
//
// - flags StackTraceFlags: A set of #GstStackTraceFlags to determine how the stack trace should
// look like. Pass #GST_STACK_TRACE_SHOW_NONE to retrieve a minimal backtrace.
//
// The function returns the following values:
//
// - goret string
func DebugGetStackTrace(flags StackTraceFlags) string {
var carg1 C.GstStackTraceFlags // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg1 = C.GstStackTraceFlags(flags)
cret = C.gst_debug_get_stack_trace(carg1)
runtime.KeepAlive(flags)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// DebugIsActive wraps gst_debug_is_active
// The function returns the following values:
//
// - goret bool
//
// Checks if debugging output is activated.
func DebugIsActive() bool {
var cret C.gboolean // return
cret = C.gst_debug_is_active()
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DebugIsColored wraps gst_debug_is_colored
// The function returns the following values:
//
// - goret bool
//
// Checks if the debugging output should be colored.
func DebugIsColored() bool {
var cret C.gboolean // return
cret = C.gst_debug_is_colored()
var goret bool
if cret != 0 {
goret = true
}
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:
//
// - 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
//
// The function returns the following values:
//
// - goret string
//
// Returns the string representation for the specified debug log message
// formatted in the same way as gst_debug_log_default() (the default handler),
// without color. The purpose is to make it easy for custom log output
// handlers to get a log output that is identical to what the default handler
// would write out.
func DebugLogGetLine(category *DebugCategory, level DebugLevel, file string, function string, line int, object gobject.Object, message *DebugMessage) string {
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 cret *C.gchar // return, full, string, casted *C.gchar
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))
cret = C.gst_debug_log_get_line(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(category)
runtime.KeepAlive(level)
runtime.KeepAlive(file)
runtime.KeepAlive(function)
runtime.KeepAlive(line)
runtime.KeepAlive(object)
runtime.KeepAlive(message)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// DebugLogIDLiteral wraps gst_debug_log_id_literal
//
// The function takes the following parameters:
//
// - category *DebugCategory: category to log
// - level DebugLevel: level of the message is in
// - 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__
// - id string (nullable): the identifier of the object this message relates to
// or %NULL if none
// - messageString string: a message string
//
// Logs the given message using the currently registered debugging handlers.
func DebugLogIDLiteral(category *DebugCategory, level DebugLevel, file string, function string, line int, id string, messageString string) {
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.gchar // in, none, string, nullable-string
var carg7 *C.gchar // in, none, string, casted *C.gchar
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 id != "" {
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(id)))
defer C.free(unsafe.Pointer(carg6))
}
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(messageString)))
defer C.free(unsafe.Pointer(carg7))
C.gst_debug_log_id_literal(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(category)
runtime.KeepAlive(level)
runtime.KeepAlive(file)
runtime.KeepAlive(function)
runtime.KeepAlive(line)
runtime.KeepAlive(id)
runtime.KeepAlive(messageString)
}
// DebugLogLiteral wraps gst_debug_log_literal
//
// The function takes the following parameters:
//
// - category *DebugCategory: category to log
// - level DebugLevel: level of the message is in
// - 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
// - messageString string: a message string
//
// Logs the given message using the currently registered debugging handlers.
func DebugLogLiteral(category *DebugCategory, level DebugLevel, file string, function string, line int, object gobject.Object, messageString string) {
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.gchar // in, none, string, casted *C.gchar
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.gchar)(unsafe.Pointer(C.CString(messageString)))
defer C.free(unsafe.Pointer(carg7))
C.gst_debug_log_literal(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(category)
runtime.KeepAlive(level)
runtime.KeepAlive(file)
runtime.KeepAlive(function)
runtime.KeepAlive(line)
runtime.KeepAlive(object)
runtime.KeepAlive(messageString)
}
// DebugPrintStackTrace wraps gst_debug_print_stack_trace
//
// If libunwind, glibc backtrace or DbgHelp are present
// a stack trace is printed.
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
// gst_debug_add_ring_buffer_logger().
func DebugRemoveRingBufferLogger() {
C.gst_debug_remove_ring_buffer_logger()
}
// DebugRingBufferLoggerGetLogs wraps gst_debug_ring_buffer_logger_get_logs
// The function returns the following values:
//
// - goret []string
//
// Fetches the current logs per thread from the ring buffer logger. See
// gst_debug_add_ring_buffer_logger() for details.
func DebugRingBufferLoggerGetLogs() []string {
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
cret = C.gst_debug_ring_buffer_logger_get_logs()
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// DebugSetActive wraps gst_debug_set_active
//
// The function takes the following parameters:
//
// - active bool: Whether to use debugging output or not
//
// If activated, debugging messages are sent to the debugging
// handlers.
// It makes sense to deactivate it for speed issues.
// &gt; This function is not threadsafe. It makes sense to only call it
// during initialization.
func DebugSetActive(active bool) {
var carg1 C.gboolean // in
if active {
carg1 = C.TRUE
}
C.gst_debug_set_active(carg1)
runtime.KeepAlive(active)
}
// DebugSetColorMode wraps gst_debug_set_color_mode
//
// The function takes the following parameters:
//
// - mode DebugColorMode: The coloring mode for debug output. See @GstDebugColorMode.
//
// Changes the coloring mode for debug output.
//
// This function may be called before gst_init().
func DebugSetColorMode(mode DebugColorMode) {
var carg1 C.GstDebugColorMode // in, none, casted
carg1 = C.GstDebugColorMode(mode)
C.gst_debug_set_color_mode(carg1)
runtime.KeepAlive(mode)
}
// DebugSetColorModeFromString wraps gst_debug_set_color_mode_from_string
//
// The function takes the following parameters:
//
// - mode string: The coloring mode for debug output. One of the following:
// "on", "auto", "off", "disable", "unix".
//
// Changes the coloring mode for debug output.
//
// This function may be called before gst_init().
func DebugSetColorModeFromString(mode string) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(mode)))
defer C.free(unsafe.Pointer(carg1))
C.gst_debug_set_color_mode_from_string(carg1)
runtime.KeepAlive(mode)
}
// DebugSetColored wraps gst_debug_set_colored
//
// The function takes the following parameters:
//
// - colored bool: Whether to use colored output or not
//
// Sets or unsets the use of coloured debugging output.
// Same as gst_debug_set_color_mode () with the argument being
// being GST_DEBUG_COLOR_MODE_ON or GST_DEBUG_COLOR_MODE_OFF.
//
// This function may be called before gst_init().
func DebugSetColored(colored bool) {
var carg1 C.gboolean // in
if colored {
carg1 = C.TRUE
}
C.gst_debug_set_colored(carg1)
runtime.KeepAlive(colored)
}
// DebugSetDefaultThreshold wraps gst_debug_set_default_threshold
//
// The function takes the following parameters:
//
// - level DebugLevel: level to set
//
// Sets the default threshold to the given level and updates all categories to
// use this threshold.
//
// This function may be called before gst_init().
func DebugSetDefaultThreshold(level DebugLevel) {
var carg1 C.GstDebugLevel // in, none, casted
carg1 = C.GstDebugLevel(level)
C.gst_debug_set_default_threshold(carg1)
runtime.KeepAlive(level)
}
// DebugSetThresholdForName wraps gst_debug_set_threshold_for_name
//
// The function takes the following parameters:
//
// - name string: name of the categories to set
// - level DebugLevel: level to set them to
//
// Sets all categories which match the given glob style pattern to the given
// level.
func DebugSetThresholdForName(name string, level DebugLevel) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GstDebugLevel // in, none, casted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GstDebugLevel(level)
C.gst_debug_set_threshold_for_name(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(level)
}
// DebugSetThresholdFromString wraps gst_debug_set_threshold_from_string
//
// The function takes the following parameters:
//
// - list string: comma-separated list of "category:level" pairs to be used
// as debug logging levels
// - reset bool: %TRUE to clear all previously-set debug levels before setting
// new thresholds
// %FALSE if adding the threshold described by @list to the one already set.
//
// Sets the debug logging wanted in the same form as with the GST_DEBUG
// environment variable. You can use wildcards such as `*`, but note that
// the order matters when you use wild cards, e.g. `foosrc:6,*src:3,*:2` sets
// everything to log level 2.
func DebugSetThresholdFromString(list string, reset bool) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(list)))
defer C.free(unsafe.Pointer(carg1))
if reset {
carg2 = C.TRUE
}
C.gst_debug_set_threshold_from_string(carg1, carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(reset)
}
// DebugUnsetThresholdForName wraps gst_debug_unset_threshold_for_name
//
// The function takes the following parameters:
//
// - name string: name of the categories to set
//
// Resets all categories with the given name back to the default level.
func DebugUnsetThresholdForName(name string) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
C.gst_debug_unset_threshold_for_name(carg1)
runtime.KeepAlive(name)
}
// Deinit wraps gst_deinit
//
// Clean up any resources created by GStreamer in gst_init().
//
// It is normally not needed to call this function in a normal application
// as the resources will automatically be freed when the program terminates.
// This function is therefore mostly used by testsuites and other memory
// profiling tools.
//
// After this call GStreamer (including this method) should not be used anymore.
func Deinit() {
C.gst_deinit()
}
// DynamicTypeRegister wraps gst_dynamic_type_register
//
// The function takes the following parameters:
//
// - plugin Plugin: The #GstPlugin to register @dyn_type for
// - typ gobject.Type: The #GType to register dynamically
//
// The function returns the following values:
//
// - goret bool
//
// Registers a new #GstDynamicTypeFactory in the registry
func DynamicTypeRegister(plugin Plugin, typ gobject.Type) bool {
var carg1 *C.GstPlugin // in, none, converted
var carg2 C.GType // in, none, casted, alias
var cret C.gboolean // return
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
carg2 = C.GType(typ)
cret = C.gst_dynamic_type_register(carg1, carg2)
runtime.KeepAlive(plugin)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ErrorGetMessage wraps gst_error_get_message
//
// The function takes the following parameters:
//
// - domain glib.Quark: the GStreamer error domain this error belongs to.
// - code int: the error code belonging to the domain.
//
// The function returns the following values:
//
// - goret string
//
// Get a string describing the error message in the current locale.
func ErrorGetMessage(domain glib.Quark, code int) string {
var carg1 C.GQuark // in, none, casted, alias
var carg2 C.gint // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg1 = C.GQuark(domain)
carg2 = C.gint(code)
cret = C.gst_error_get_message(carg1, carg2)
runtime.KeepAlive(domain)
runtime.KeepAlive(code)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// FilenameToURI wraps gst_filename_to_uri
//
// The function takes the following parameters:
//
// - filename string: absolute or relative file name path
//
// The function returns the following values:
//
// - goret string
// - _goerr error (nullable): an error
//
// Similar to g_filename_to_uri(), but attempts to handle relative file paths
// as well. Before converting @filename into an URI, it will be prefixed by
// the current working directory if it is a relative path, and then the path
// will be canonicalised so that it doesn't contain any './' or '../' segments.
//
// On Windows @filename should be in UTF-8 encoding.
func FilenameToURI(filename string) (string, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, full, string, casted *C.gchar
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(filename)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_filename_to_uri(carg1, &_cerr)
runtime.KeepAlive(filename)
var goret string
var _goerr error
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// FlowGetName wraps gst_flow_get_name
//
// The function takes the following parameters:
//
// - ret FlowReturn: a #GstFlowReturn to get the name of.
//
// The function returns the following values:
//
// - goret string
//
// Gets a string representing the given flow return.
func FlowGetName(ret FlowReturn) string {
var carg1 C.GstFlowReturn // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = C.GstFlowReturn(ret)
cret = C.gst_flow_get_name(carg1)
runtime.KeepAlive(ret)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// FlowToQuark wraps gst_flow_to_quark
//
// The function takes the following parameters:
//
// - ret FlowReturn: a #GstFlowReturn to get the quark of.
//
// The function returns the following values:
//
// - goret glib.Quark
//
// Get the unique quark for the given GstFlowReturn.
func FlowToQuark(ret FlowReturn) glib.Quark {
var carg1 C.GstFlowReturn // in, none, casted
var cret C.GQuark // return, none, casted, alias
carg1 = C.GstFlowReturn(ret)
cret = C.gst_flow_to_quark(carg1)
runtime.KeepAlive(ret)
var goret glib.Quark
goret = glib.Quark(cret)
return goret
}
// FormatsContains wraps gst_formats_contains
//
// The function takes the following parameters:
//
// - formats []Format: The format array to search
// - format Format: the format to find
//
// The function returns the following values:
//
// - goret bool
//
// See if the given format is inside the format array.
func FormatsContains(formats []Format, format Format) bool {
var carg1 *C.GstFormat // in, transfer: none, C Pointers: 1, Name: array[Format], array (inner: *typesystem.Enum, zero-terminated)
var carg2 C.GstFormat // in, none, casted
var cret C.gboolean // return
_ = formats
_ = carg1
panic("unimplemented conversion of []Format (const GstFormat*)")
carg2 = C.GstFormat(format)
cret = C.gst_formats_contains(carg1, carg2)
runtime.KeepAlive(formats)
runtime.KeepAlive(format)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetMainExecutablePath wraps gst_get_main_executable_path
// The function returns the following values:
//
// - goret string
//
// This helper is mostly helpful for plugins that need to
// inspect the folder of the main executable to determine
// their set of features.
//
// When a plugin is initialized from the gst-plugin-scanner
// external process, the returned path will be the same as from the
// parent process.
func GetMainExecutablePath() string {
var cret *C.gchar // return, none, string, casted *C.gchar
cret = C.gst_get_main_executable_path()
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// IsCapsFeatures wraps gst_is_caps_features
//
// The function takes the following parameters:
//
// - obj unsafe.Pointer (nullable)
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @obj is a #GstCapsFeatures
func IsCapsFeatures(obj unsafe.Pointer) bool {
var carg1 C.gconstpointer // in, none, casted, nullable
var cret C.gboolean // return
if obj != nil {
carg1 = C.gconstpointer(obj)
}
cret = C.gst_is_caps_features(carg1)
runtime.KeepAlive(obj)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsInitialized wraps gst_is_initialized
// The function returns the following values:
//
// - goret bool
//
// Use this function to check if GStreamer has been initialized with gst_init()
// or gst_init_check().
func IsInitialized() bool {
var cret C.gboolean // return
cret = C.gst_is_initialized()
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ParentBufferMetaApiGetType wraps gst_parent_buffer_meta_api_get_type
// The function returns the following values:
//
// - goret gobject.Type
func ParentBufferMetaApiGetType() gobject.Type {
var cret C.GType // return, none, casted, alias
cret = C.gst_parent_buffer_meta_api_get_type()
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// ParseBinFromDescription wraps gst_parse_bin_from_description
//
// The function takes the following parameters:
//
// - binDescription string: command line describing the bin
// - ghostUnlinkedPads bool: whether to automatically create ghost pads
// for unlinked source or sink pads within the bin
//
// The function returns the following values:
//
// - goret Bin
// - _goerr error (nullable): an error
//
// This is a convenience wrapper around gst_parse_launch() to create a
// #GstBin from a gst-launch-style pipeline description. See
// gst_parse_launch() and the gst-launch man page for details about the
// syntax. Ghost pads on the bin for unlinked source or sink pads
// within the bin can automatically be created (but only a maximum of
// one ghost pad for each direction will be created; if you expect
// multiple unlinked source pads or multiple unlinked sink pads
// and want them all ghosted, you will have to create the ghost pads
// yourself).
func ParseBinFromDescription(binDescription string, ghostUnlinkedPads bool) (Bin, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
var cret *C.GstElement // return, none, converted, casted *C.GstBin
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(binDescription)))
defer C.free(unsafe.Pointer(carg1))
if ghostUnlinkedPads {
carg2 = C.TRUE
}
cret = C.gst_parse_bin_from_description(carg1, carg2, &_cerr)
runtime.KeepAlive(binDescription)
runtime.KeepAlive(ghostUnlinkedPads)
var goret Bin
var _goerr error
goret = UnsafeBinFromGlibNone(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// ParseBinFromDescriptionFull wraps gst_parse_bin_from_description_full
//
// The function takes the following parameters:
//
// - binDescription string: command line describing the bin
// - ghostUnlinkedPads bool: whether to automatically create ghost pads
// for unlinked source or sink pads within the bin
// - _context *ParseContext (nullable): a parse context allocated with
// gst_parse_context_new(), or %NULL
// - flags ParseFlags: parsing options, or #GST_PARSE_FLAG_NONE
//
// The function returns the following values:
//
// - goret Element
// - _goerr error (nullable): an error
//
// This is a convenience wrapper around gst_parse_launch() to create a
// #GstBin from a gst-launch-style pipeline description. See
// gst_parse_launch() and the gst-launch man page for details about the
// syntax. Ghost pads on the bin for unlinked source or sink pads
// within the bin can automatically be created (but only a maximum of
// one ghost pad for each direction will be created; if you expect
// multiple unlinked source pads or multiple unlinked sink pads
// and want them all ghosted, you will have to create the ghost pads
// yourself).
func ParseBinFromDescriptionFull(binDescription string, ghostUnlinkedPads bool, _context *ParseContext, flags ParseFlags) (Element, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
var carg3 *C.GstParseContext // in, none, converted, nullable
var carg4 C.GstParseFlags // in, none, casted
var cret *C.GstElement // return, none, converted
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(binDescription)))
defer C.free(unsafe.Pointer(carg1))
if ghostUnlinkedPads {
carg2 = C.TRUE
}
if _context != nil {
carg3 = (*C.GstParseContext)(UnsafeParseContextToGlibNone(_context))
}
carg4 = C.GstParseFlags(flags)
cret = C.gst_parse_bin_from_description_full(carg1, carg2, carg3, carg4, &_cerr)
runtime.KeepAlive(binDescription)
runtime.KeepAlive(ghostUnlinkedPads)
runtime.KeepAlive(_context)
runtime.KeepAlive(flags)
var goret Element
var _goerr error
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// ParseLaunch wraps gst_parse_launch
//
// The function takes the following parameters:
//
// - pipelineDescription string: the command line describing the pipeline
//
// The function returns the following values:
//
// - goret Element
// - _goerr error (nullable): an error
//
// Create a new pipeline based on command line syntax.
// Please note that you might get a return value that is not %NULL even though
// the @error is set. In this case there was a recoverable parsing error and you
// can try to play the pipeline.
//
// To create a sub-pipeline (bin) for embedding into an existing pipeline
// use gst_parse_bin_from_description().
func ParseLaunch(pipelineDescription string) (Element, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstElement // return, none, converted
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(pipelineDescription)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_parse_launch(carg1, &_cerr)
runtime.KeepAlive(pipelineDescription)
var goret Element
var _goerr error
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// ParseLaunchFull wraps gst_parse_launch_full
//
// The function takes the following parameters:
//
// - pipelineDescription string: the command line describing the pipeline
// - _context *ParseContext (nullable): a parse context allocated with
// gst_parse_context_new(), or %NULL
// - flags ParseFlags: parsing options, or #GST_PARSE_FLAG_NONE
//
// The function returns the following values:
//
// - goret Element
// - _goerr error (nullable): an error
//
// Create a new pipeline based on command line syntax.
// Please note that you might get a return value that is not %NULL even though
// the @error is set. In this case there was a recoverable parsing error and you
// can try to play the pipeline.
//
// To create a sub-pipeline (bin) for embedding into an existing pipeline
// use gst_parse_bin_from_description_full().
func ParseLaunchFull(pipelineDescription string, _context *ParseContext, flags ParseFlags) (Element, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstParseContext // in, none, converted, nullable
var carg3 C.GstParseFlags // in, none, casted
var cret *C.GstElement // return, none, converted
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(pipelineDescription)))
defer C.free(unsafe.Pointer(carg1))
if _context != nil {
carg2 = (*C.GstParseContext)(UnsafeParseContextToGlibNone(_context))
}
carg3 = C.GstParseFlags(flags)
cret = C.gst_parse_launch_full(carg1, carg2, carg3, &_cerr)
runtime.KeepAlive(pipelineDescription)
runtime.KeepAlive(_context)
runtime.KeepAlive(flags)
var goret Element
var _goerr error
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// ProtectionFilterSystemsByAvailableDecryptors wraps gst_protection_filter_systems_by_available_decryptors
//
// The function takes the following parameters:
//
// - systemIdentifiers []string:
// A null terminated array of strings that contains the UUID values of each
// protection system that is to be checked.
//
// The function returns the following values:
//
// - goret []string
//
// Iterates the supplied list of UUIDs and checks the GstRegistry for
// all the decryptors supporting one of the supplied UUIDs.
func ProtectionFilterSystemsByAvailableDecryptors(systemIdentifiers []string) []string {
var carg1 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], array (inner: *typesystem.StringPrimitive, zero-terminated)
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
_ = systemIdentifiers
_ = carg1
panic("unimplemented conversion of []string (const gchar**)")
cret = C.gst_protection_filter_systems_by_available_decryptors(carg1)
runtime.KeepAlive(systemIdentifiers)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// ProtectionMetaApiGetType wraps gst_protection_meta_api_get_type
// The function returns the following values:
//
// - goret gobject.Type
func ProtectionMetaApiGetType() gobject.Type {
var cret C.GType // return, none, casted, alias
cret = C.gst_protection_meta_api_get_type()
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// ProtectionSelectSystem wraps gst_protection_select_system
//
// The function takes the following parameters:
//
// - systemIdentifiers []string: A null terminated array of strings
// that contains the UUID values of each protection system that is to be
// checked.
//
// The function returns the following values:
//
// - goret string
//
// Iterates the supplied list of UUIDs and checks the GstRegistry for
// an element that supports one of the supplied UUIDs. If more than one
// element matches, the system ID of the highest ranked element is selected.
func ProtectionSelectSystem(systemIdentifiers []string) string {
var carg1 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], array (inner: *typesystem.StringPrimitive, zero-terminated)
var cret *C.gchar // return, none, string, casted *C.gchar
_ = systemIdentifiers
_ = carg1
panic("unimplemented conversion of []string (const gchar**)")
cret = C.gst_protection_select_system(carg1)
runtime.KeepAlive(systemIdentifiers)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// ReferenceTimestampMetaApiGetType wraps gst_reference_timestamp_meta_api_get_type
// The function returns the following values:
//
// - goret gobject.Type
func ReferenceTimestampMetaApiGetType() gobject.Type {
var cret C.GType // return, none, casted, alias
cret = C.gst_reference_timestamp_meta_api_get_type()
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// SegtrapIsEnabled wraps gst_segtrap_is_enabled
// The function returns the following values:
//
// - goret bool
//
// Some functions in the GStreamer core might install a custom SIGSEGV handler
// to better catch and report errors to the application. Currently this feature
// is enabled by default when loading plugins.
//
// Applications might want to disable this behaviour with the
// gst_segtrap_set_enabled() function. This is typically done if the application
// wants to install its own handler without GStreamer interfering.
func SegtrapIsEnabled() bool {
var cret C.gboolean // return
cret = C.gst_segtrap_is_enabled()
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SegtrapSetEnabled wraps gst_segtrap_set_enabled
//
// The function takes the following parameters:
//
// - enabled bool: whether a custom SIGSEGV handler should be installed.
//
// Applications might want to disable/enable the SIGSEGV handling of
// the GStreamer core. See gst_segtrap_is_enabled() for more information.
func SegtrapSetEnabled(enabled bool) {
var carg1 C.gboolean // in
if enabled {
carg1 = C.TRUE
}
C.gst_segtrap_set_enabled(carg1)
runtime.KeepAlive(enabled)
}
// TagExists wraps gst_tag_exists
//
// The function takes the following parameters:
//
// - tag string: name of the tag
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the given type is already registered.
func TagExists(tag string) bool {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_exists(carg1)
runtime.KeepAlive(tag)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// TagGetDescription wraps gst_tag_get_description
//
// The function takes the following parameters:
//
// - tag string: the tag
//
// The function returns the following values:
//
// - goret string
//
// Returns the human-readable description of this tag, You must not change or
// free this string.
func TagGetDescription(tag string) string {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_get_description(carg1)
runtime.KeepAlive(tag)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// TagGetFlag wraps gst_tag_get_flag
//
// The function takes the following parameters:
//
// - tag string: the tag
//
// The function returns the following values:
//
// - goret TagFlag
//
// Gets the flag of @tag.
func TagGetFlag(tag string) TagFlag {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.GstTagFlag // return, none, casted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_get_flag(carg1)
runtime.KeepAlive(tag)
var goret TagFlag
goret = TagFlag(cret)
return goret
}
// TagGetNick wraps gst_tag_get_nick
//
// The function takes the following parameters:
//
// - tag string: the tag
//
// The function returns the following values:
//
// - goret string
//
// Returns the human-readable name of this tag, You must not change or free
// this string.
func TagGetNick(tag string) string {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_get_nick(carg1)
runtime.KeepAlive(tag)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// TagGetType wraps gst_tag_get_type
//
// The function takes the following parameters:
//
// - tag string: the tag
//
// The function returns the following values:
//
// - goret gobject.Type
//
// Gets the #GType used for this tag.
func TagGetType(tag string) gobject.Type {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.GType // return, none, casted, alias
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_get_type(carg1)
runtime.KeepAlive(tag)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// TagIsFixed wraps gst_tag_is_fixed
//
// The function takes the following parameters:
//
// - tag string: tag to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the given tag is fixed. A fixed tag can only contain one value.
// Unfixed tags can contain lists of values.
func TagIsFixed(tag string) bool {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_is_fixed(carg1)
runtime.KeepAlive(tag)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// TagMergeStringsWithComma wraps gst_tag_merge_strings_with_comma
//
// The function takes the following parameters:
//
// - src *gobject.Value: GValue to copy from
//
// The function returns the following values:
//
// - dest gobject.Value: uninitialized GValue to store result in
//
// This is a convenience function for the func argument of gst_tag_register().
// It concatenates all given strings using a comma. The tag must be registered
// as a G_TYPE_STRING or this function will fail.
func TagMergeStringsWithComma(src *gobject.Value) gobject.Value {
var carg2 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, caller-allocates
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(src))
C.gst_tag_merge_strings_with_comma(&carg1, carg2)
runtime.KeepAlive(src)
var dest gobject.Value
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
return dest
}
// TagMergeUseFirst wraps gst_tag_merge_use_first
//
// The function takes the following parameters:
//
// - src *gobject.Value: GValue to copy from
//
// The function returns the following values:
//
// - dest gobject.Value: uninitialized GValue to store result in
//
// This is a convenience function for the func argument of gst_tag_register().
// It creates a copy of the first value from the list.
func TagMergeUseFirst(src *gobject.Value) gobject.Value {
var carg2 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, caller-allocates
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(src))
C.gst_tag_merge_use_first(&carg1, carg2)
runtime.KeepAlive(src)
var dest gobject.Value
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
return dest
}
// TypeIsPluginApi wraps gst_type_is_plugin_api
//
// The function takes the following parameters:
//
// - typ gobject.Type: a GType
//
// The function returns the following values:
//
// - flags PluginAPIFlags: What #GstPluginAPIFlags the plugin was marked with
// - goret bool
//
// Checks if @type is plugin API. See gst_type_mark_as_plugin_api() for
// details.
func TypeIsPluginApi(typ gobject.Type) (PluginAPIFlags, bool) {
var carg1 C.GType // in, none, casted, alias
var carg2 C.GstPluginAPIFlags // out, full, casted
var cret C.gboolean // return
carg1 = C.GType(typ)
cret = C.gst_type_is_plugin_api(carg1, &carg2)
runtime.KeepAlive(typ)
var flags PluginAPIFlags
var goret bool
flags = PluginAPIFlags(carg2)
if cret != 0 {
goret = true
}
return flags, goret
}
// TypeMarkAsPluginApi wraps gst_type_mark_as_plugin_api
//
// The function takes the following parameters:
//
// - typ gobject.Type: a GType
// - flags PluginAPIFlags: a set of #GstPluginAPIFlags to further inform cache generation.
//
// Marks @type as plugin API. This should be called in `class_init` of
// elements that expose new types (i.e. enums, flags or internal GObjects) via
// properties, signals or pad templates.
//
// Types exposed by plugins are not automatically added to the documentation
// as they might originate from another library and should in that case be
// documented via that library instead.
//
// By marking a type as plugin API it will be included in the documentation of
// the plugin that defines it.
func TypeMarkAsPluginApi(typ gobject.Type, flags PluginAPIFlags) {
var carg1 C.GType // in, none, casted, alias
var carg2 C.GstPluginAPIFlags // in, none, casted
carg1 = C.GType(typ)
carg2 = C.GstPluginAPIFlags(flags)
C.gst_type_mark_as_plugin_api(carg1, carg2)
runtime.KeepAlive(typ)
runtime.KeepAlive(flags)
}
// UpdateRegistry wraps gst_update_registry
// The function returns the following values:
//
// - goret bool
//
// Forces GStreamer to re-scan its plugin paths and update the default
// plugin registry.
//
// Applications will almost never need to call this function, it is only
// useful if the application knows new plugins have been installed (or old
// ones removed) since the start of the application (or, to be precise, the
// first call to gst_init()) and the application wants to make use of any
// newly-installed plugins without restarting the application.
//
// Applications should assume that the registry update is neither atomic nor
// thread-safe and should therefore not have any dynamic pipelines running
// (including the playbin and decodebin elements) and should also not create
// any elements or access the GStreamer registry while the update is in
// progress.
//
// Note that this function may block for a significant amount of time.
func UpdateRegistry() bool {
var cret C.gboolean // return
cret = C.gst_update_registry()
var goret bool
if cret != 0 {
goret = true
}
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:
//
// - v uint32: a #guint32 value.
//
// The function returns the following values:
//
// - goret uint
//
// Returns smallest integral value not less than log2(v).
func UtilCeilLog2(v uint32) uint {
var carg1 C.guint32 // in, none, casted
var cret C.guint // return, none, casted
carg1 = C.guint32(v)
cret = C.gst_util_ceil_log2(carg1)
runtime.KeepAlive(v)
var goret uint
goret = uint(cret)
return goret
}
// UtilDoubleToFraction wraps gst_util_double_to_fraction
//
// The function takes the following parameters:
//
// - src float64: #gdouble to transform
//
// The function returns the following values:
//
// - destN int: pointer to a #gint to hold the result numerator
// - destD int: pointer to a #gint to hold the result denominator
//
// Transforms a #gdouble to a fraction and simplifies
// the result.
func UtilDoubleToFraction(src float64) (int, int) {
var carg1 C.gdouble // in, none, casted
var carg2 C.gint // out, full, casted
var carg3 C.gint // out, full, casted
carg1 = C.gdouble(src)
C.gst_util_double_to_fraction(carg1, &carg2, &carg3)
runtime.KeepAlive(src)
var destN int
var destD int
destN = int(carg2)
destD = int(carg3)
return destN, destD
}
// UtilDumpBuffer wraps gst_util_dump_buffer
//
// The function takes the following parameters:
//
// - buf *Buffer: a #GstBuffer whose memory to dump
//
// Dumps the buffer memory into a hex representation. Useful for debugging.
func UtilDumpBuffer(buf *Buffer) {
var carg1 *C.GstBuffer // in, none, converted
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buf))
C.gst_util_dump_buffer(carg1)
runtime.KeepAlive(buf)
}
// UtilDumpMem wraps gst_util_dump_mem
//
// The function takes the following parameters:
//
// - mem []byte: a pointer to the memory to dump
//
// Dumps the memory block into a hex representation. Useful for debugging.
func UtilDumpMem(mem []byte) {
var carg1 *C.guchar // in, transfer: none, C Pointers: 1, Name: array[guchar], array (inner: *typesystem.CastablePrimitive, length-by: carg2)
var carg2 C.guint // implicit
_ = mem
_ = carg1
_ = carg2
panic("unimplemented conversion of []byte (const guchar*)")
C.gst_util_dump_mem(carg1, carg2)
runtime.KeepAlive(mem)
}
// UtilFilenameCompare wraps gst_util_filename_compare
//
// The function takes the following parameters:
//
// - a string: a filename to compare with @b
// - b string: a filename to compare with @a
//
// The function returns the following values:
//
// - goret int
//
// Compares the given filenames using natural ordering.
func UtilFilenameCompare(a string, b string) int {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret C.gint // return, none, casted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(a)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(b)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_util_filename_compare(carg1, carg2)
runtime.KeepAlive(a)
runtime.KeepAlive(b)
var goret int
goret = int(cret)
return goret
}
// UtilFractionAdd wraps gst_util_fraction_add
//
// The function takes the following parameters:
//
// - aN int: Numerator of first value
// - aD int: Denominator of first value
// - bN int: Numerator of second value
// - bD int: Denominator of second value
//
// The function returns the following values:
//
// - resN int: Pointer to #gint to hold the result numerator
// - resD int: Pointer to #gint to hold the result denominator
// - goret bool
//
// Adds the fractions @a_n/@a_d and @b_n/@b_d and stores
// the result in @res_n and @res_d.
func UtilFractionAdd(aN int, aD int, bN int, bD int) (int, int, bool) {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var carg5 C.gint // out, full, casted
var carg6 C.gint // out, full, casted
var cret C.gboolean // return
carg1 = C.gint(aN)
carg2 = C.gint(aD)
carg3 = C.gint(bN)
carg4 = C.gint(bD)
cret = C.gst_util_fraction_add(carg1, carg2, carg3, carg4, &carg5, &carg6)
runtime.KeepAlive(aN)
runtime.KeepAlive(aD)
runtime.KeepAlive(bN)
runtime.KeepAlive(bD)
var resN int
var resD int
var goret bool
resN = int(carg5)
resD = int(carg6)
if cret != 0 {
goret = true
}
return resN, resD, goret
}
// UtilFractionCompare wraps gst_util_fraction_compare
//
// The function takes the following parameters:
//
// - aN int: Numerator of first value
// - aD int: Denominator of first value
// - bN int: Numerator of second value
// - bD int: Denominator of second value
//
// The function returns the following values:
//
// - goret int
//
// Compares the fractions @a_n/@a_d and @b_n/@b_d and returns
// -1 if a &lt; b, 0 if a = b and 1 if a &gt; b.
func UtilFractionCompare(aN int, aD int, bN int, bD int) int {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var cret C.gint // return, none, casted
carg1 = C.gint(aN)
carg2 = C.gint(aD)
carg3 = C.gint(bN)
carg4 = C.gint(bD)
cret = C.gst_util_fraction_compare(carg1, carg2, carg3, carg4)
runtime.KeepAlive(aN)
runtime.KeepAlive(aD)
runtime.KeepAlive(bN)
runtime.KeepAlive(bD)
var goret int
goret = int(cret)
return goret
}
// UtilFractionMultiply wraps gst_util_fraction_multiply
//
// The function takes the following parameters:
//
// - aN int: Numerator of first value
// - aD int: Denominator of first value
// - bN int: Numerator of second value
// - bD int: Denominator of second value
//
// The function returns the following values:
//
// - resN int: Pointer to #gint to hold the result numerator
// - resD int: Pointer to #gint to hold the result denominator
// - goret bool
//
// Multiplies the fractions @a_n/@a_d and @b_n/@b_d and stores
// the result in @res_n and @res_d.
func UtilFractionMultiply(aN int, aD int, bN int, bD int) (int, int, bool) {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var carg5 C.gint // out, full, casted
var carg6 C.gint // out, full, casted
var cret C.gboolean // return
carg1 = C.gint(aN)
carg2 = C.gint(aD)
carg3 = C.gint(bN)
carg4 = C.gint(bD)
cret = C.gst_util_fraction_multiply(carg1, carg2, carg3, carg4, &carg5, &carg6)
runtime.KeepAlive(aN)
runtime.KeepAlive(aD)
runtime.KeepAlive(bN)
runtime.KeepAlive(bD)
var resN int
var resD int
var goret bool
resN = int(carg5)
resD = int(carg6)
if cret != 0 {
goret = true
}
return resN, resD, goret
}
// UtilFractionToDouble wraps gst_util_fraction_to_double
//
// The function takes the following parameters:
//
// - srcN int: Fraction numerator as #gint
// - srcD int: Fraction denominator #gint
//
// The function returns the following values:
//
// - dest float64: pointer to a #gdouble for the result
//
// Transforms a fraction to a #gdouble.
func UtilFractionToDouble(srcN int, srcD int) float64 {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gdouble // out, full, casted
carg1 = C.gint(srcN)
carg2 = C.gint(srcD)
C.gst_util_fraction_to_double(carg1, carg2, &carg3)
runtime.KeepAlive(srcN)
runtime.KeepAlive(srcD)
var dest float64
dest = float64(carg3)
return dest
}
// UtilGdoubleToGuint64 wraps gst_util_gdouble_to_guint64
//
// The function takes the following parameters:
//
// - value float64: The #gdouble value to convert guint64 double
//
// The function returns the following values:
//
// - goret uint64
func UtilGdoubleToGuint64(value float64) uint64 {
var carg1 C.gdouble // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.gdouble(value)
cret = C.gst_util_gdouble_to_guint64(carg1)
runtime.KeepAlive(value)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilGetTimestamp wraps gst_util_get_timestamp
// The function returns the following values:
//
// - goret ClockTime
//
// Get a timestamp as GstClockTime to be used for interval measurements.
// The timestamp should not be interpreted in any other way.
func UtilGetTimestamp() ClockTime {
var cret C.GstClockTime // return, none, casted, alias
cret = C.gst_util_get_timestamp()
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// UtilGreatestCommonDivisor wraps gst_util_greatest_common_divisor
//
// The function takes the following parameters:
//
// - a int: First value as #gint
// - b int: Second value as #gint
//
// The function returns the following values:
//
// - goret int
//
// Calculates the greatest common divisor of @a
// and @b.
func UtilGreatestCommonDivisor(a int, b int) int {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var cret C.gint // return, none, casted
carg1 = C.gint(a)
carg2 = C.gint(b)
cret = C.gst_util_greatest_common_divisor(carg1, carg2)
runtime.KeepAlive(a)
runtime.KeepAlive(b)
var goret int
goret = int(cret)
return goret
}
// UtilGreatestCommonDivisorInt64 wraps gst_util_greatest_common_divisor_int64
//
// The function takes the following parameters:
//
// - a int64: First value as #gint64
// - b int64: Second value as #gint64
//
// The function returns the following values:
//
// - goret int64
//
// Calculates the greatest common divisor of @a
// and @b.
func UtilGreatestCommonDivisorInt64(a int64, b int64) int64 {
var carg1 C.gint64 // in, none, casted
var carg2 C.gint64 // in, none, casted
var cret C.gint64 // return, none, casted
carg1 = C.gint64(a)
carg2 = C.gint64(b)
cret = C.gst_util_greatest_common_divisor_int64(carg1, carg2)
runtime.KeepAlive(a)
runtime.KeepAlive(b)
var goret int64
goret = int64(cret)
return goret
}
// UtilGroupIDNext wraps gst_util_group_id_next
// The function returns the following values:
//
// - goret uint
//
// Return a constantly incrementing group id.
//
// This function is used to generate a new group-id for the
// stream-start event.
//
// This function never returns %GST_GROUP_ID_INVALID (which is 0)
func UtilGroupIDNext() uint {
var cret C.guint // return, none, casted
cret = C.gst_util_group_id_next()
var goret uint
goret = uint(cret)
return goret
}
// UtilGuint64ToGdouble wraps gst_util_guint64_to_gdouble
//
// The function takes the following parameters:
//
// - value uint64: The #guint64 value to convert to double
//
// The function returns the following values:
//
// - goret float64
func UtilGuint64ToGdouble(value uint64) float64 {
var carg1 C.guint64 // in, none, casted
var cret C.gdouble // return, none, casted
carg1 = C.guint64(value)
cret = C.gst_util_guint64_to_gdouble(carg1)
runtime.KeepAlive(value)
var goret float64
goret = float64(cret)
return goret
}
// UtilSeqnumCompare wraps gst_util_seqnum_compare
//
// The function takes the following parameters:
//
// - s1 uint32: A sequence number.
// - s2 uint32: Another sequence number.
//
// The function returns the following values:
//
// - goret int32
//
// Compare two sequence numbers, handling wraparound.
//
// The current implementation just returns (gint32)(@s1 - @s2).
func UtilSeqnumCompare(s1 uint32, s2 uint32) int32 {
var carg1 C.guint32 // in, none, casted
var carg2 C.guint32 // in, none, casted
var cret C.gint32 // return, none, casted
carg1 = C.guint32(s1)
carg2 = C.guint32(s2)
cret = C.gst_util_seqnum_compare(carg1, carg2)
runtime.KeepAlive(s1)
runtime.KeepAlive(s2)
var goret int32
goret = int32(cret)
return goret
}
// UtilSeqnumNext wraps gst_util_seqnum_next
// The function returns the following values:
//
// - goret uint32
//
// Return a constantly incrementing sequence number.
//
// This function is used internally to GStreamer to be able to determine which
// events and messages are "the same". For example, elements may set the seqnum
// on a segment-done message to be the same as that of the last seek event, to
// indicate that event and the message correspond to the same segment.
//
// This function never returns %GST_SEQNUM_INVALID (which is 0).
func UtilSeqnumNext() uint32 {
var cret C.guint32 // return, none, casted
cret = C.gst_util_seqnum_next()
var goret uint32
goret = uint32(cret)
return goret
}
// UtilSetObjectArg wraps gst_util_set_object_arg
//
// The function takes the following parameters:
//
// - object gobject.Object: the object to set the argument of
// - name string: the name of the argument to set
// - value string: the string value to set
//
// Converts the string value to the type of the objects argument and
// sets the argument with it.
//
// Note that this function silently returns if @object has no property named
// @name or when @value cannot be converted to the type of the property.
func UtilSetObjectArg(object gobject.Object, name string, value string) {
var carg1 *C.GObject // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.GObject)(gobject.UnsafeObjectToGlibNone(object))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
defer C.free(unsafe.Pointer(carg3))
C.gst_util_set_object_arg(carg1, carg2, carg3)
runtime.KeepAlive(object)
runtime.KeepAlive(name)
runtime.KeepAlive(value)
}
// UtilSimplifyFraction wraps gst_util_simplify_fraction
//
// The function takes the following parameters:
//
// - numerator *int: First value as #gint
// - denominator *int: Second value as #gint
// - nTerms uint: non-significative terms (typical value: 8)
// - threshold uint: threshold (typical value: 333)
//
// Calculates the simpler representation of @numerator and @denominator and
// update both values with the resulting simplified fraction.
//
// Simplify a fraction using a simple continued fraction decomposition.
// The idea here is to convert fractions such as 333333/10000000 to 1/30
// using 32 bit arithmetic only. The algorithm is not perfect and relies
// upon two arbitrary parameters to remove non-significative terms from
// the simple continued fraction decomposition. Using 8 and 333 for
// @n_terms and @threshold respectively seems to give nice results.
func UtilSimplifyFraction(numerator *int, denominator *int, nTerms uint, threshold uint) {
var carg1 *C.gint // in, transfer: none, C Pointers: 1, Name: gint
var carg2 *C.gint // in, transfer: none, C Pointers: 1, Name: gint
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
_ = numerator
_ = carg1
panic("unimplemented conversion of *int (gint*)")
_ = denominator
_ = carg2
panic("unimplemented conversion of *int (gint*)")
carg3 = C.guint(nTerms)
carg4 = C.guint(threshold)
C.gst_util_simplify_fraction(carg1, carg2, carg3, carg4)
runtime.KeepAlive(numerator)
runtime.KeepAlive(denominator)
runtime.KeepAlive(nTerms)
runtime.KeepAlive(threshold)
}
// UtilUint64Scale wraps gst_util_uint64_scale
//
// The function takes the following parameters:
//
// - val uint64: the number to scale
// - num uint64: the numerator of the scale ratio
// - denom uint64: the denominator of the scale ratio
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision.
//
// This function can potentially be very slow if val and num are both
// greater than G_MAXUINT32.
func UtilUint64Scale(val uint64, num uint64, denom uint64) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.guint64(num)
carg3 = C.guint64(denom)
cret = C.gst_util_uint64_scale(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilUint64ScaleCeil wraps gst_util_uint64_scale_ceil
//
// The function takes the following parameters:
//
// - val uint64: the number to scale
// - num uint64: the numerator of the scale ratio
// - denom uint64: the denominator of the scale ratio
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision.
//
// This function can potentially be very slow if val and num are both
// greater than G_MAXUINT32.
func UtilUint64ScaleCeil(val uint64, num uint64, denom uint64) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.guint64(num)
carg3 = C.guint64(denom)
cret = C.gst_util_uint64_scale_ceil(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilUint64ScaleInt wraps gst_util_uint64_scale_int
//
// The function takes the following parameters:
//
// - val uint64: guint64 (such as a #GstClockTime) to scale.
// - num int: numerator of the scale factor.
// - denom int: denominator of the scale factor.
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision. @num must be non-negative and
// @denom must be positive.
func UtilUint64ScaleInt(val uint64, num int, denom int) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.gint(num)
carg3 = C.gint(denom)
cret = C.gst_util_uint64_scale_int(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilUint64ScaleIntCeil wraps gst_util_uint64_scale_int_ceil
//
// The function takes the following parameters:
//
// - val uint64: guint64 (such as a #GstClockTime) to scale.
// - num int: numerator of the scale factor.
// - denom int: denominator of the scale factor.
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision. @num must be non-negative and
// @denom must be positive.
func UtilUint64ScaleIntCeil(val uint64, num int, denom int) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.gint(num)
carg3 = C.gint(denom)
cret = C.gst_util_uint64_scale_int_ceil(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilUint64ScaleIntRound wraps gst_util_uint64_scale_int_round
//
// The function takes the following parameters:
//
// - val uint64: guint64 (such as a #GstClockTime) to scale.
// - num int: numerator of the scale factor.
// - denom int: denominator of the scale factor.
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision. @num must be non-negative and
// @denom must be positive.
func UtilUint64ScaleIntRound(val uint64, num int, denom int) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.gint(num)
carg3 = C.gint(denom)
cret = C.gst_util_uint64_scale_int_round(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// UtilUint64ScaleRound wraps gst_util_uint64_scale_round
//
// The function takes the following parameters:
//
// - val uint64: the number to scale
// - num uint64: the numerator of the scale ratio
// - denom uint64: the denominator of the scale ratio
//
// The function returns the following values:
//
// - goret uint64
//
// Scale @val by the rational number @num / @denom, avoiding overflows and
// underflows and without loss of precision.
//
// This function can potentially be very slow if val and num are both
// greater than G_MAXUINT32.
func UtilUint64ScaleRound(val uint64, num uint64, denom uint64) uint64 {
var carg1 C.guint64 // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg1 = C.guint64(val)
carg2 = C.guint64(num)
carg3 = C.guint64(denom)
cret = C.gst_util_uint64_scale_round(carg1, carg2, carg3)
runtime.KeepAlive(val)
runtime.KeepAlive(num)
runtime.KeepAlive(denom)
var goret uint64
goret = uint64(cret)
return goret
}
// ValueCanCompare wraps gst_value_can_compare
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to compare
// - value2 *gobject.Value: another value to compare
//
// The function returns the following values:
//
// - goret bool
//
// Determines if @value1 and @value2 can be compared.
func ValueCanCompare(value1 *gobject.Value, value2 *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_can_compare(carg1, carg2)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueCanIntersect wraps gst_value_can_intersect
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to intersect
// - value2 *gobject.Value: another value to intersect
//
// The function returns the following values:
//
// - goret bool
//
// Determines if intersecting two values will produce a valid result.
// Two values will produce a valid intersection if they have the same
// type.
func ValueCanIntersect(value1 *gobject.Value, value2 *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_can_intersect(carg1, carg2)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueCanSubtract wraps gst_value_can_subtract
//
// The function takes the following parameters:
//
// - minuend *gobject.Value: the value to subtract from
// - subtrahend *gobject.Value: the value to subtract
//
// The function returns the following values:
//
// - goret bool
//
// Checks if it's possible to subtract @subtrahend from @minuend.
func ValueCanSubtract(minuend *gobject.Value, subtrahend *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(minuend))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(subtrahend))
cret = C.gst_value_can_subtract(carg1, carg2)
runtime.KeepAlive(minuend)
runtime.KeepAlive(subtrahend)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueCanUnion wraps gst_value_can_union
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to union
// - value2 *gobject.Value: another value to union
//
// The function returns the following values:
//
// - goret bool
//
// Determines if @value1 and @value2 can be non-trivially unioned.
// Any two values can be trivially unioned by adding both of them
// to a GstValueList. However, certain types have the possibility
// to be unioned in a simpler way. For example, an integer range
// and an integer can be unioned if the integer is a subset of the
// integer range. If there is the possibility that two values can
// be unioned, this function returns %TRUE.
func ValueCanUnion(value1 *gobject.Value, value2 *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_can_union(carg1, carg2)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueCompare wraps gst_value_compare
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to compare
// - value2 *gobject.Value: another value to compare
//
// The function returns the following values:
//
// - goret int
//
// Compares @value1 and @value2. If @value1 and @value2 cannot be
// compared, the function returns GST_VALUE_UNORDERED. Otherwise,
// if @value1 is greater than @value2, GST_VALUE_GREATER_THAN is returned.
// If @value1 is less than @value2, GST_VALUE_LESS_THAN is returned.
// If the values are equal, GST_VALUE_EQUAL is returned.
func ValueCompare(value1 *gobject.Value, value2 *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_compare(carg1, carg2)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var goret int
goret = int(cret)
return goret
}
// ValueDeserialize wraps gst_value_deserialize
//
// The function takes the following parameters:
//
// - src string: string to deserialize
//
// The function returns the following values:
//
// - dest gobject.Value: #GValue to fill with contents of
// deserialization
// - goret bool
//
// Tries to deserialize a string into the type specified by the given GValue.
// If the operation succeeds, %TRUE is returned, %FALSE otherwise.
func ValueDeserialize(src string) (gobject.Value, bool) {
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, caller-allocates
var cret C.gboolean // return
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(src)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_value_deserialize(&carg1, carg2)
runtime.KeepAlive(src)
var dest gobject.Value
var goret bool
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
if cret != 0 {
goret = true
}
return dest, goret
}
// ValueFixate wraps gst_value_fixate
//
// The function takes the following parameters:
//
// - dest *gobject.Value: the #GValue destination
// - src *gobject.Value: the #GValue to fixate
//
// The function returns the following values:
//
// - goret bool
//
// Fixate @src into a new value @dest.
// For ranges, the first element is taken. For lists and arrays, the
// first item is fixated and returned.
// If @src is already fixed, this function returns %FALSE.
func ValueFixate(dest *gobject.Value, src *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(dest))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(src))
cret = C.gst_value_fixate(carg1, carg2)
runtime.KeepAlive(dest)
runtime.KeepAlive(src)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueFractionMultiply wraps gst_value_fraction_multiply
//
// The function takes the following parameters:
//
// - product *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
// - factor1 *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
// - factor2 *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
//
// The function returns the following values:
//
// - goret bool
//
// Multiplies the two #GValue items containing a #GST_TYPE_FRACTION and sets
// @product to the product of the two fractions.
func ValueFractionMultiply(product *gobject.Value, factor1 *gobject.Value, factor2 *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(product))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(factor1))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(factor2))
cret = C.gst_value_fraction_multiply(carg1, carg2, carg3)
runtime.KeepAlive(product)
runtime.KeepAlive(factor1)
runtime.KeepAlive(factor2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueFractionSubtract wraps gst_value_fraction_subtract
//
// The function takes the following parameters:
//
// - dest *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
// - minuend *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
// - subtrahend *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
//
// The function returns the following values:
//
// - goret bool
//
// Subtracts the @subtrahend from the @minuend and sets @dest to the result.
func ValueFractionSubtract(dest *gobject.Value, minuend *gobject.Value, subtrahend *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(dest))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(minuend))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(subtrahend))
cret = C.gst_value_fraction_subtract(carg1, carg2, carg3)
runtime.KeepAlive(dest)
runtime.KeepAlive(minuend)
runtime.KeepAlive(subtrahend)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueGetBitmask wraps gst_value_get_bitmask
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_BITMASK
//
// The function returns the following values:
//
// - goret uint64
//
// Gets the bitmask specified by @value.
func ValueGetBitmask(value *gobject.Value) uint64 {
var carg1 *C.GValue // in, none, converted
var cret C.guint64 // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_bitmask(carg1)
runtime.KeepAlive(value)
var goret uint64
goret = uint64(cret)
return goret
}
// ValueGetCaps wraps gst_value_get_caps
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_CAPS
//
// The function returns the following values:
//
// - goret *Caps
//
// Gets the contents of @value. The reference count of the returned
// #GstCaps will not be modified, therefore the caller must take one
// before getting rid of the @value.
func ValueGetCaps(value *gobject.Value) *Caps {
var carg1 *C.GValue // in, none, converted
var cret *C.GstCaps // return, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_caps(carg1)
runtime.KeepAlive(value)
var goret *Caps
goret = UnsafeCapsFromGlibNone(unsafe.Pointer(cret))
return goret
}
// ValueGetCapsFeatures wraps gst_value_get_caps_features
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_CAPS_FEATURES
//
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Gets the contents of @value.
func ValueGetCapsFeatures(value *gobject.Value) *CapsFeatures {
var carg1 *C.GValue // in, none, converted
var cret *C.GstCapsFeatures // return, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_caps_features(carg1)
runtime.KeepAlive(value)
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibNone(unsafe.Pointer(cret))
return goret
}
// ValueGetDoubleRangeMax wraps gst_value_get_double_range_max
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_DOUBLE_RANGE
//
// The function returns the following values:
//
// - goret float64
//
// Gets the maximum of the range specified by @value.
func ValueGetDoubleRangeMax(value *gobject.Value) float64 {
var carg1 *C.GValue // in, none, converted
var cret C.gdouble // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_double_range_max(carg1)
runtime.KeepAlive(value)
var goret float64
goret = float64(cret)
return goret
}
// ValueGetDoubleRangeMin wraps gst_value_get_double_range_min
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_DOUBLE_RANGE
//
// The function returns the following values:
//
// - goret float64
//
// Gets the minimum of the range specified by @value.
func ValueGetDoubleRangeMin(value *gobject.Value) float64 {
var carg1 *C.GValue // in, none, converted
var cret C.gdouble // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_double_range_min(carg1)
runtime.KeepAlive(value)
var goret float64
goret = float64(cret)
return goret
}
// ValueGetFlagsetFlags wraps gst_value_get_flagset_flags
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_FLAG_SET
//
// The function returns the following values:
//
// - goret uint
//
// Retrieve the flags field of a GstFlagSet @value.
func ValueGetFlagsetFlags(value *gobject.Value) uint {
var carg1 *C.GValue // in, none, converted
var cret C.guint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_flagset_flags(carg1)
runtime.KeepAlive(value)
var goret uint
goret = uint(cret)
return goret
}
// ValueGetFlagsetMask wraps gst_value_get_flagset_mask
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_FLAG_SET
//
// The function returns the following values:
//
// - goret uint
//
// Retrieve the mask field of a GstFlagSet @value.
func ValueGetFlagsetMask(value *gobject.Value) uint {
var carg1 *C.GValue // in, none, converted
var cret C.guint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_flagset_mask(carg1)
runtime.KeepAlive(value)
var goret uint
goret = uint(cret)
return goret
}
// ValueGetFractionDenominator wraps gst_value_get_fraction_denominator
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
//
// The function returns the following values:
//
// - goret int
//
// Gets the denominator of the fraction specified by @value.
func ValueGetFractionDenominator(value *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_fraction_denominator(carg1)
runtime.KeepAlive(value)
var goret int
goret = int(cret)
return goret
}
// ValueGetFractionNumerator wraps gst_value_get_fraction_numerator
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
//
// The function returns the following values:
//
// - goret int
//
// Gets the numerator of the fraction specified by @value.
func ValueGetFractionNumerator(value *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_fraction_numerator(carg1)
runtime.KeepAlive(value)
var goret int
goret = int(cret)
return goret
}
// ValueGetFractionRangeMax wraps gst_value_get_fraction_range_max
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_FRACTION_RANGE
//
// The function returns the following values:
//
// - goret *gobject.Value
//
// Gets the maximum of the range specified by @value.
func ValueGetFractionRangeMax(value *gobject.Value) *gobject.Value {
var carg1 *C.GValue // in, none, converted
var cret *C.GValue // return, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_fraction_range_max(carg1)
runtime.KeepAlive(value)
var goret *gobject.Value
goret = gobject.UnsafeValueFromGlibUseAnyInstead(unsafe.Pointer(cret))
return goret
}
// ValueGetFractionRangeMin wraps gst_value_get_fraction_range_min
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_FRACTION_RANGE
//
// The function returns the following values:
//
// - goret *gobject.Value
//
// Gets the minimum of the range specified by @value.
func ValueGetFractionRangeMin(value *gobject.Value) *gobject.Value {
var carg1 *C.GValue // in, none, converted
var cret *C.GValue // return, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_fraction_range_min(carg1)
runtime.KeepAlive(value)
var goret *gobject.Value
goret = gobject.UnsafeValueFromGlibUseAnyInstead(unsafe.Pointer(cret))
return goret
}
// ValueGetInt64RangeMax wraps gst_value_get_int64_range_max
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT64_RANGE
//
// The function returns the following values:
//
// - goret int64
//
// Gets the maximum of the range specified by @value.
func ValueGetInt64RangeMax(value *gobject.Value) int64 {
var carg1 *C.GValue // in, none, converted
var cret C.gint64 // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int64_range_max(carg1)
runtime.KeepAlive(value)
var goret int64
goret = int64(cret)
return goret
}
// ValueGetInt64RangeMin wraps gst_value_get_int64_range_min
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT64_RANGE
//
// The function returns the following values:
//
// - goret int64
//
// Gets the minimum of the range specified by @value.
func ValueGetInt64RangeMin(value *gobject.Value) int64 {
var carg1 *C.GValue // in, none, converted
var cret C.gint64 // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int64_range_min(carg1)
runtime.KeepAlive(value)
var goret int64
goret = int64(cret)
return goret
}
// ValueGetInt64RangeStep wraps gst_value_get_int64_range_step
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT64_RANGE
//
// The function returns the following values:
//
// - goret int64
//
// Gets the step of the range specified by @value.
func ValueGetInt64RangeStep(value *gobject.Value) int64 {
var carg1 *C.GValue // in, none, converted
var cret C.gint64 // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int64_range_step(carg1)
runtime.KeepAlive(value)
var goret int64
goret = int64(cret)
return goret
}
// ValueGetIntRangeMax wraps gst_value_get_int_range_max
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT_RANGE
//
// The function returns the following values:
//
// - goret int
//
// Gets the maximum of the range specified by @value.
func ValueGetIntRangeMax(value *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int_range_max(carg1)
runtime.KeepAlive(value)
var goret int
goret = int(cret)
return goret
}
// ValueGetIntRangeMin wraps gst_value_get_int_range_min
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT_RANGE
//
// The function returns the following values:
//
// - goret int
//
// Gets the minimum of the range specified by @value.
func ValueGetIntRangeMin(value *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int_range_min(carg1)
runtime.KeepAlive(value)
var goret int
goret = int(cret)
return goret
}
// ValueGetIntRangeStep wraps gst_value_get_int_range_step
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT_RANGE
//
// The function returns the following values:
//
// - goret int
//
// Gets the step of the range specified by @value.
func ValueGetIntRangeStep(value *gobject.Value) int {
var carg1 *C.GValue // in, none, converted
var cret C.gint // return, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_int_range_step(carg1)
runtime.KeepAlive(value)
var goret int
goret = int(cret)
return goret
}
// ValueGetStructure wraps gst_value_get_structure
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_STRUCTURE
//
// The function returns the following values:
//
// - goret *Structure
//
// Gets the contents of @value.
func ValueGetStructure(value *gobject.Value) *Structure {
var carg1 *C.GValue // in, none, converted
var cret *C.GstStructure // return, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_get_structure(carg1)
runtime.KeepAlive(value)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// ValueInitAndCopy wraps gst_value_init_and_copy
//
// The function takes the following parameters:
//
// - src *gobject.Value: the source value
//
// The function returns the following values:
//
// - dest gobject.Value: the target value
//
// Initialises the target value to be of the same type as source and then copies
// the contents from source to target.
func ValueInitAndCopy(src *gobject.Value) gobject.Value {
var carg2 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, caller-allocates
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(src))
C.gst_value_init_and_copy(&carg1, carg2)
runtime.KeepAlive(src)
var dest gobject.Value
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
return dest
}
// ValueIntersect wraps gst_value_intersect
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to intersect
// - value2 *gobject.Value: another value to intersect
//
// The function returns the following values:
//
// - dest gobject.Value:
// a uninitialized #GValue that will hold the calculated
// intersection value. May be %NULL if the resulting set if not
// needed.
// - goret bool
//
// Calculates the intersection of two values. If the values have
// a non-empty intersection, the value representing the intersection
// is placed in @dest, unless %NULL. If the intersection is non-empty,
// @dest is not modified.
func ValueIntersect(value1 *gobject.Value, value2 *gobject.Value) (gobject.Value, bool) {
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: full, C Pointers: 0, Name: Value, optional, caller-allocates
var cret C.gboolean // return
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_intersect(&carg1, carg2, carg3)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var dest gobject.Value
var goret bool
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
if cret != 0 {
goret = true
}
return dest, goret
}
// ValueIsFixed wraps gst_value_is_fixed
//
// The function takes the following parameters:
//
// - value *gobject.Value: the #GValue to check
//
// The function returns the following values:
//
// - goret bool
//
// Tests if the given GValue, if available in a GstStructure (or any other
// container) contains a "fixed" (which means: one value) or an "unfixed"
// (which means: multiple possible values, such as data lists or data
// ranges) value.
func ValueIsFixed(value *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_is_fixed(carg1)
runtime.KeepAlive(value)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueIsSubset wraps gst_value_is_subset
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a #GValue
// - value2 *gobject.Value: a #GValue
//
// The function returns the following values:
//
// - goret bool
//
// Check that @value1 is a subset of @value2.
func ValueIsSubset(value1 *gobject.Value, value2 *gobject.Value) bool {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var cret C.gboolean // return
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_is_subset(carg1, carg2)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ValueRegister wraps gst_value_register
//
// The function takes the following parameters:
//
// - table *ValueTable: structure containing functions to register
//
// Registers functions to perform calculations on #GValue items of a given
// type. Each type can only be added once.
func ValueRegister(table *ValueTable) {
var carg1 *C.GstValueTable // in, none, converted
carg1 = (*C.GstValueTable)(UnsafeValueTableToGlibNone(table))
C.gst_value_register(carg1)
runtime.KeepAlive(table)
}
// ValueSerialize wraps gst_value_serialize
//
// The function takes the following parameters:
//
// - value *gobject.Value: a #GValue to serialize
//
// The function returns the following values:
//
// - goret string
//
// tries to transform the given @value into a string representation that allows
// getting back this string later on using gst_value_deserialize().
//
// Free-function: g_free
func ValueSerialize(value *gobject.Value) string {
var carg1 *C.GValue // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
cret = C.gst_value_serialize(carg1)
runtime.KeepAlive(value)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// ValueSetBitmask wraps gst_value_set_bitmask
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_BITMASK
// - bitmask uint64: the bitmask
//
// Sets @value to the bitmask specified by @bitmask.
func ValueSetBitmask(value *gobject.Value, bitmask uint64) {
var carg1 *C.GValue // in, none, converted
var carg2 C.guint64 // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.guint64(bitmask)
C.gst_value_set_bitmask(carg1, carg2)
runtime.KeepAlive(value)
runtime.KeepAlive(bitmask)
}
// ValueSetCaps wraps gst_value_set_caps
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_CAPS
// - caps *Caps: the caps to set the value to
//
// Sets the contents of @value to @caps. A reference to the
// provided @caps will be taken by the @value.
func ValueSetCaps(value *gobject.Value, caps *Caps) {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GstCaps // in, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
C.gst_value_set_caps(carg1, carg2)
runtime.KeepAlive(value)
runtime.KeepAlive(caps)
}
// ValueSetCapsFeatures wraps gst_value_set_caps_features
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_CAPS_FEATURES
// - features *CapsFeatures: the features to set the value to
//
// Sets the contents of @value to @features.
func ValueSetCapsFeatures(value *gobject.Value, features *CapsFeatures) {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GstCapsFeatures // in, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
C.gst_value_set_caps_features(carg1, carg2)
runtime.KeepAlive(value)
runtime.KeepAlive(features)
}
// ValueSetDoubleRange wraps gst_value_set_double_range
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_DOUBLE_RANGE
// - start float64: the start of the range
// - end float64: the end of the range
//
// Sets @value to the range specified by @start and @end.
func ValueSetDoubleRange(value *gobject.Value, start float64, end float64) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gdouble // in, none, casted
var carg3 C.gdouble // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gdouble(start)
carg3 = C.gdouble(end)
C.gst_value_set_double_range(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
}
// ValueSetFlagset wraps gst_value_set_flagset
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to %GST_TYPE_FLAG_SET
// - flags uint: The value of the flags set or unset
// - mask uint: The mask indicate which flags bits must match for comparisons
//
// Sets @value to the flags and mask values provided in @flags and @mask.
// The @flags value indicates the values of flags, the @mask represents
// which bits in the flag value have been set, and which are "don't care"
func ValueSetFlagset(value *gobject.Value, flags uint, mask uint) {
var carg1 *C.GValue // in, none, converted
var carg2 C.guint // in, none, casted
var carg3 C.guint // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.guint(flags)
carg3 = C.guint(mask)
C.gst_value_set_flagset(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(flags)
runtime.KeepAlive(mask)
}
// ValueSetFraction wraps gst_value_set_fraction
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to #GST_TYPE_FRACTION
// - numerator int: the numerator of the fraction
// - denominator int: the denominator of the fraction
//
// Sets @value to the fraction specified by @numerator over @denominator.
// The fraction gets reduced to the smallest numerator and denominator,
// and if necessary the sign is moved to the numerator.
func ValueSetFraction(value *gobject.Value, numerator int, denominator int) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint(numerator)
carg3 = C.gint(denominator)
C.gst_value_set_fraction(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(numerator)
runtime.KeepAlive(denominator)
}
// ValueSetFractionRange wraps gst_value_set_fraction_range
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_FRACTION_RANGE
// - start *gobject.Value: the start of the range (a GST_TYPE_FRACTION GValue)
// - end *gobject.Value: the end of the range (a GST_TYPE_FRACTION GValue)
//
// Sets @value to the range specified by @start and @end.
func ValueSetFractionRange(value *gobject.Value, start *gobject.Value, end *gobject.Value) {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(start))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(end))
C.gst_value_set_fraction_range(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
}
// ValueSetFractionRangeFull wraps gst_value_set_fraction_range_full
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_FRACTION_RANGE
// - numeratorStart int: the numerator start of the range
// - denominatorStart int: the denominator start of the range
// - numeratorEnd int: the numerator end of the range
// - denominatorEnd int: the denominator end of the range
//
// Sets @value to the range specified by @numerator_start/@denominator_start
// and @numerator_end/@denominator_end.
func ValueSetFractionRangeFull(value *gobject.Value, numeratorStart int, denominatorStart int, numeratorEnd int, denominatorEnd int) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var carg5 C.gint // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint(numeratorStart)
carg3 = C.gint(denominatorStart)
carg4 = C.gint(numeratorEnd)
carg5 = C.gint(denominatorEnd)
C.gst_value_set_fraction_range_full(carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(value)
runtime.KeepAlive(numeratorStart)
runtime.KeepAlive(denominatorStart)
runtime.KeepAlive(numeratorEnd)
runtime.KeepAlive(denominatorEnd)
}
// ValueSetInt64Range wraps gst_value_set_int64_range
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT64_RANGE
// - start int64: the start of the range
// - end int64: the end of the range
//
// Sets @value to the range specified by @start and @end.
func ValueSetInt64Range(value *gobject.Value, start int64, end int64) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint64 // in, none, casted
var carg3 C.gint64 // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint64(start)
carg3 = C.gint64(end)
C.gst_value_set_int64_range(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
}
// ValueSetInt64RangeStep wraps gst_value_set_int64_range_step
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT64_RANGE
// - start int64: the start of the range
// - end int64: the end of the range
// - step int64: the step of the range
//
// Sets @value to the range specified by @start, @end and @step.
func ValueSetInt64RangeStep(value *gobject.Value, start int64, end int64, step int64) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint64 // in, none, casted
var carg3 C.gint64 // in, none, casted
var carg4 C.gint64 // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint64(start)
carg3 = C.gint64(end)
carg4 = C.gint64(step)
C.gst_value_set_int64_range_step(carg1, carg2, carg3, carg4)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
runtime.KeepAlive(step)
}
// ValueSetIntRange wraps gst_value_set_int_range
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT_RANGE
// - start int: the start of the range
// - end int: the end of the range
//
// Sets @value to the range specified by @start and @end.
func ValueSetIntRange(value *gobject.Value, start int, end int) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint(start)
carg3 = C.gint(end)
C.gst_value_set_int_range(carg1, carg2, carg3)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
}
// ValueSetIntRangeStep wraps gst_value_set_int_range_step
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_INT_RANGE
// - start int: the start of the range
// - end int: the end of the range
// - step int: the step of the range
//
// Sets @value to the range specified by @start, @end and @step.
func ValueSetIntRangeStep(value *gobject.Value, start int, end int, step int) {
var carg1 *C.GValue // in, none, converted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = C.gint(start)
carg3 = C.gint(end)
carg4 = C.gint(step)
C.gst_value_set_int_range_step(carg1, carg2, carg3, carg4)
runtime.KeepAlive(value)
runtime.KeepAlive(start)
runtime.KeepAlive(end)
runtime.KeepAlive(step)
}
// ValueSetStructure wraps gst_value_set_structure
//
// The function takes the following parameters:
//
// - value *gobject.Value: a GValue initialized to GST_TYPE_STRUCTURE
// - structure *Structure: the structure to set the value to
//
// Sets the contents of @value to @structure.
func ValueSetStructure(value *gobject.Value, structure *Structure) {
var carg1 *C.GValue // in, none, converted
var carg2 *C.GstStructure // in, none, converted
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
carg2 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
C.gst_value_set_structure(carg1, carg2)
runtime.KeepAlive(value)
runtime.KeepAlive(structure)
}
// ValueSubtract wraps gst_value_subtract
//
// The function takes the following parameters:
//
// - minuend *gobject.Value: the value to subtract from
// - subtrahend *gobject.Value: the value to subtract
//
// The function returns the following values:
//
// - dest gobject.Value: the destination value
// for the result if the subtraction is not empty. May be %NULL,
// in which case the resulting set will not be computed, which can
// give a fair speedup.
// - goret bool
//
// Subtracts @subtrahend from @minuend and stores the result in @dest.
// Note that this means subtraction as in sets, not as in mathematics.
func ValueSubtract(minuend *gobject.Value, subtrahend *gobject.Value) (gobject.Value, bool) {
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, optional, caller-allocates
var cret C.gboolean // return
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(minuend))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(subtrahend))
cret = C.gst_value_subtract(&carg1, carg2, carg3)
runtime.KeepAlive(minuend)
runtime.KeepAlive(subtrahend)
var dest gobject.Value
var goret bool
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
if cret != 0 {
goret = true
}
return dest, goret
}
// ValueUnion wraps gst_value_union
//
// The function takes the following parameters:
//
// - value1 *gobject.Value: a value to union
// - value2 *gobject.Value: another value to union
//
// The function returns the following values:
//
// - dest gobject.Value: the destination value
// - goret bool
//
// Creates a GValue corresponding to the union of @value1 and @value2.
func ValueUnion(value1 *gobject.Value, value2 *gobject.Value) (gobject.Value, bool) {
var carg2 *C.GValue // in, none, converted
var carg3 *C.GValue // in, none, converted
var carg1 C.GValue // out, transfer: none, C Pointers: 0, Name: Value, caller-allocates
var cret C.gboolean // return
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value1))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value2))
cret = C.gst_value_union(&carg1, carg2, carg3)
runtime.KeepAlive(value1)
runtime.KeepAlive(value2)
var dest gobject.Value
var goret bool
_ = dest
_ = carg1
panic("unimplemented conversion of gobject.Value (GValue)")
if cret != 0 {
goret = true
}
return dest, goret
}
// Version wraps gst_version
// The function returns the following values:
//
// - major uint: pointer to a guint to store the major version number
// - minor uint: pointer to a guint to store the minor version number
// - micro uint: pointer to a guint to store the micro version number
// - nano uint: pointer to a guint to store the nano version number
//
// Gets the version number of the GStreamer library.
func Version() (uint, uint, uint, uint) {
var carg1 C.guint // out, full, casted
var carg2 C.guint // out, full, casted
var carg3 C.guint // out, full, casted
var carg4 C.guint // out, full, casted
C.gst_version(&carg1, &carg2, &carg3, &carg4)
var major uint
var minor uint
var micro uint
var nano uint
major = uint(carg1)
minor = uint(carg2)
micro = uint(carg3)
nano = uint(carg4)
return major, minor, micro, nano
}
// VersionString wraps gst_version_string
// The function returns the following values:
//
// - goret string
//
// This function returns a string that is useful for describing this version
// of GStreamer to the outside world: user agent strings, logging, ...
func VersionString() string {
var cret *C.gchar // return, full, string, casted *C.gchar
cret = C.gst_version_string()
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// ChildProxyInstance is the instance type used by all types implementing GstChildProxy. It is used internally by the bindings. Users should use the interface [ChildProxy] instead.
type ChildProxyInstance struct {
_ [0]func() // equal guard
Instance gobject.ObjectInstance
}
var _ ChildProxy = (*ChildProxyInstance)(nil)
// ChildProxyInstance wraps GstChildProxy
//
// This interface abstracts handling of property sets for elements with
// children. Imagine elements such as mixers or polyphonic generators. They all
// have multiple #GstPad or some kind of voice objects. Another use case are
// container elements like #GstBin.
// The element implementing the interface acts as a parent for those child
// objects.
//
// By implementing this interface the child properties can be accessed from the
// parent element by using gst_child_proxy_get() and gst_child_proxy_set().
//
// Property names are written as `child-name::property-name`. The whole naming
// scheme is recursive. Thus `child1::child2::property` is valid too, if
// `child1` and `child2` implement the #GstChildProxy interface.
type ChildProxy interface {
ChildProxyExtManual // handwritten functions
upcastToGstChildProxy() *ChildProxyInstance
// ChildAdded wraps gst_child_proxy_child_added
//
// The function takes the following parameters:
//
// - child gobject.Object: the newly added child
// - name string: the name of the new child
//
// Emits the #GstChildProxy::child-added signal.
ChildAdded(gobject.Object, string)
// ChildRemoved wraps gst_child_proxy_child_removed
//
// The function takes the following parameters:
//
// - child gobject.Object: the removed child
// - name string: the name of the old child
//
// Emits the #GstChildProxy::child-removed signal.
ChildRemoved(gobject.Object, string)
// GetChildByIndex wraps gst_child_proxy_get_child_by_index
//
// The function takes the following parameters:
//
// - index uint: the child's position in the child list
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Fetches a child by its number.
GetChildByIndex(uint) gobject.Object
// GetChildByName wraps gst_child_proxy_get_child_by_name
//
// The function takes the following parameters:
//
// - name string: the child's name
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Looks up a child element by the given name.
//
// This virtual method has a default implementation that uses #GstObject
// together with gst_object_get_name(). If the interface is to be used with
// #GObjects, this methods needs to be overridden.
GetChildByName(string) gobject.Object
// GetChildByNameRecurse wraps gst_child_proxy_get_child_by_name_recurse
//
// The function takes the following parameters:
//
// - name string: the full-path child's name
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Looks up a child element by the given full-path name.
//
// Similar to gst_child_proxy_get_child_by_name(), this method
// searches and returns a child given a name. The difference is that
// this method allows a hierarchical path in the form of
// child1::child2::child3. In the later example this method would
// return a reference to child3, if found. The name should be made of
// element names only and should not contain any property names.
GetChildByNameRecurse(string) gobject.Object
// GetChildrenCount wraps gst_child_proxy_get_children_count
// The function returns the following values:
//
// - goret uint
//
// Gets the number of child objects this parent contains.
GetChildrenCount() uint
}
var _ ChildProxy = (*ChildProxyInstance)(nil)
func unsafeWrapChildProxy(base *gobject.ObjectInstance) *ChildProxyInstance {
return &ChildProxyInstance{
Instance: *base,
}
}
func marshalChildProxyInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapChildProxy(gobject.ValueFromNative(p).Object()), nil
}
func (c *ChildProxyInstance) upcastToGstChildProxy() *ChildProxyInstance {
return c
}
// UnsafeChildProxyFromGlibNone is used to convert raw GstChildProxy pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeChildProxyFromGlibNone(c unsafe.Pointer) ChildProxy {
return gobject.UnsafeObjectFromGlibNone(c).(ChildProxy)
}
// UnsafeChildProxyFromGlibFull is used to convert raw GstChildProxy pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeChildProxyFromGlibFull(c unsafe.Pointer) ChildProxy {
return gobject.UnsafeObjectFromGlibFull(c).(ChildProxy)
}
// UnsafeChildProxyToGlibNone is used to convert the instance to it's C value GstChildProxy. This is used by the bindings internally.
func UnsafeChildProxyToGlibNone(c ChildProxy) unsafe.Pointer {
i := c.upcastToGstChildProxy()
return gobject.UnsafeObjectToGlibNone(&i.Instance)
}
// UnsafeChildProxyToGlibFull is used to convert the instance to it's C value GstChildProxy, while removeing the finalizer. This is used by the bindings internally.
func UnsafeChildProxyToGlibFull(c ChildProxy) unsafe.Pointer {
i := c.upcastToGstChildProxy()
return gobject.UnsafeObjectToGlibFull(&i.Instance)
}
// ChildAdded wraps gst_child_proxy_child_added
//
// The function takes the following parameters:
//
// - child gobject.Object: the newly added child
// - name string: the name of the new child
//
// Emits the #GstChildProxy::child-added signal.
func (parent *ChildProxyInstance) ChildAdded(child gobject.Object, name string) {
var carg0 *C.GstChildProxy // in, none, converted
var carg1 *C.GObject // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(parent))
carg1 = (*C.GObject)(gobject.UnsafeObjectToGlibNone(child))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
C.gst_child_proxy_child_added(carg0, carg1, carg2)
runtime.KeepAlive(parent)
runtime.KeepAlive(child)
runtime.KeepAlive(name)
}
// ChildRemoved wraps gst_child_proxy_child_removed
//
// The function takes the following parameters:
//
// - child gobject.Object: the removed child
// - name string: the name of the old child
//
// Emits the #GstChildProxy::child-removed signal.
func (parent *ChildProxyInstance) ChildRemoved(child gobject.Object, name string) {
var carg0 *C.GstChildProxy // in, none, converted
var carg1 *C.GObject // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(parent))
carg1 = (*C.GObject)(gobject.UnsafeObjectToGlibNone(child))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
C.gst_child_proxy_child_removed(carg0, carg1, carg2)
runtime.KeepAlive(parent)
runtime.KeepAlive(child)
runtime.KeepAlive(name)
}
// GetChildByIndex wraps gst_child_proxy_get_child_by_index
//
// The function takes the following parameters:
//
// - index uint: the child's position in the child list
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Fetches a child by its number.
func (parent *ChildProxyInstance) GetChildByIndex(index uint) gobject.Object {
var carg0 *C.GstChildProxy // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GObject // return, full, converted
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(parent))
carg1 = C.guint(index)
cret = C.gst_child_proxy_get_child_by_index(carg0, carg1)
runtime.KeepAlive(parent)
runtime.KeepAlive(index)
var goret gobject.Object
goret = gobject.UnsafeObjectFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetChildByName wraps gst_child_proxy_get_child_by_name
//
// The function takes the following parameters:
//
// - name string: the child's name
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Looks up a child element by the given name.
//
// This virtual method has a default implementation that uses #GstObject
// together with gst_object_get_name(). If the interface is to be used with
// #GObjects, this methods needs to be overridden.
func (parent *ChildProxyInstance) GetChildByName(name string) gobject.Object {
var carg0 *C.GstChildProxy // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GObject // return, full, converted
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(parent))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_child_proxy_get_child_by_name(carg0, carg1)
runtime.KeepAlive(parent)
runtime.KeepAlive(name)
var goret gobject.Object
goret = gobject.UnsafeObjectFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetChildByNameRecurse wraps gst_child_proxy_get_child_by_name_recurse
//
// The function takes the following parameters:
//
// - name string: the full-path child's name
//
// The function returns the following values:
//
// - goret gobject.Object
//
// Looks up a child element by the given full-path name.
//
// Similar to gst_child_proxy_get_child_by_name(), this method
// searches and returns a child given a name. The difference is that
// this method allows a hierarchical path in the form of
// child1::child2::child3. In the later example this method would
// return a reference to child3, if found. The name should be made of
// element names only and should not contain any property names.
func (childProxy *ChildProxyInstance) GetChildByNameRecurse(name string) gobject.Object {
var carg0 *C.GstChildProxy // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GObject // return, full, converted
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(childProxy))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_child_proxy_get_child_by_name_recurse(carg0, carg1)
runtime.KeepAlive(childProxy)
runtime.KeepAlive(name)
var goret gobject.Object
goret = gobject.UnsafeObjectFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetChildrenCount wraps gst_child_proxy_get_children_count
// The function returns the following values:
//
// - goret uint
//
// Gets the number of child objects this parent contains.
func (parent *ChildProxyInstance) GetChildrenCount() uint {
var carg0 *C.GstChildProxy // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstChildProxy)(UnsafeChildProxyToGlibNone(parent))
cret = C.gst_child_proxy_get_children_count(carg0)
runtime.KeepAlive(parent)
var goret uint
goret = uint(cret)
return goret
}
// 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
Instance gobject.ObjectInstance
}
var _ Preset = (*PresetInstance)(nil)
// PresetInstance 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.
// The name of a preset serves as key for subsequent method calls to manipulate
// single presets.
// All instances of one type will share the list of presets. The list is created
// on demand, if presets are not used, the list is not created.
//
// The interface comes with a default implementation that serves most plugins.
// Wrapper plugins will override most methods to implement support for the
// native preset format of those wrapped plugins.
// One method that is useful to be overridden is gst_preset_get_property_names().
// With that one can control which properties are saved and in which order.
// When implementing support for read-only presets, one should set the vmethods
// for gst_preset_save_preset() and gst_preset_delete_preset() to %NULL.
// Applications can use gst_preset_is_editable() to check for that.
//
// The default implementation supports presets located in a system directory,
// application specific directory and in the users home directory. When getting
// a list of presets individual presets are read and overlaid in 1) system,
// 2) application and 3) user order. Whenever an earlier entry is newer, the
// later entries will be updated. Since 1.8 you can also provide extra paths
// where to find presets through the GST_PRESET_PATH environment variable.
// Presets found in those paths will be considered as "app presets".
type Preset interface {
upcastToGstPreset() *PresetInstance
// DeletePreset wraps gst_preset_delete_preset
//
// The function takes the following parameters:
//
// - name string: preset name to remove
//
// The function returns the following values:
//
// - goret bool
//
// Delete the given preset.
DeletePreset(string) bool
// GetMeta wraps gst_preset_get_meta
//
// The function takes the following parameters:
//
// - name string: preset name
// - tag string: meta data item name
//
// The function returns the following values:
//
// - value string: value
// - goret bool
//
// Gets the @value for an existing meta data @tag. Meta data @tag names can be
// something like e.g. "comment". Returned values need to be released when done.
GetMeta(string, string) (string, bool)
// GetPresetNames wraps gst_preset_get_preset_names
// The function returns the following values:
//
// - goret []string
//
// Get a copy of preset names as a %NULL terminated string array.
GetPresetNames() []string
// GetPropertyNames wraps gst_preset_get_property_names
// The function returns the following values:
//
// - goret []string
//
// Get a the names of the GObject properties that can be used for presets.
GetPropertyNames() []string
// IsEditable wraps gst_preset_is_editable
// The function returns the following values:
//
// - goret bool
//
// Check if one can add new presets, change existing ones and remove presets.
IsEditable() bool
// LoadPreset wraps gst_preset_load_preset
//
// The function takes the following parameters:
//
// - name string: preset name to load
//
// The function returns the following values:
//
// - goret bool
//
// Load the given preset.
LoadPreset(string) bool
// RenamePreset wraps gst_preset_rename_preset
//
// The function takes the following parameters:
//
// - oldName string: current preset name
// - newName string: new preset name
//
// The function returns the following values:
//
// - goret bool
//
// Renames a preset. If there is already a preset by the @new_name it will be
// overwritten.
RenamePreset(string, string) bool
// SavePreset wraps gst_preset_save_preset
//
// The function takes the following parameters:
//
// - name string: preset name to save
//
// The function returns the following values:
//
// - goret bool
//
// Save the current object settings as a preset under the given name. If there
// is already a preset by this @name it will be overwritten.
SavePreset(string) bool
// SetMeta wraps gst_preset_set_meta
//
// The function takes the following parameters:
//
// - name string: preset name
// - tag string: meta data item name
// - value string (nullable): new value
//
// The function returns the following values:
//
// - goret bool
//
// Sets a new @value for an existing meta data item or adds a new item. Meta
// data @tag names can be something like e.g. "comment". Supplying %NULL for the
// @value will unset an existing value.
SetMeta(string, string, string) bool
}
var _ Preset = (*PresetInstance)(nil)
func unsafeWrapPreset(base *gobject.ObjectInstance) *PresetInstance {
return &PresetInstance{
Instance: *base,
}
}
func marshalPresetInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPreset(gobject.ValueFromNative(p).Object()), nil
}
func (p *PresetInstance) upcastToGstPreset() *PresetInstance {
return p
}
// UnsafePresetFromGlibNone is used to convert raw GstPreset pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePresetFromGlibNone(c unsafe.Pointer) Preset {
return gobject.UnsafeObjectFromGlibNone(c).(Preset)
}
// UnsafePresetFromGlibFull is used to convert raw GstPreset pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePresetFromGlibFull(c unsafe.Pointer) Preset {
return gobject.UnsafeObjectFromGlibFull(c).(Preset)
}
// UnsafePresetToGlibNone is used to convert the instance to it's C value GstPreset. This is used by the bindings internally.
func UnsafePresetToGlibNone(c Preset) unsafe.Pointer {
i := c.upcastToGstPreset()
return gobject.UnsafeObjectToGlibNone(&i.Instance)
}
// UnsafePresetToGlibFull is used to convert the instance to it's C value GstPreset, while removeing the finalizer. This is used by the bindings internally.
func UnsafePresetToGlibFull(c Preset) unsafe.Pointer {
i := c.upcastToGstPreset()
return gobject.UnsafeObjectToGlibFull(&i.Instance)
}
// PresetGetAppDir wraps gst_preset_get_app_dir
// The function returns the following values:
//
// - goret string
//
// Gets the directory for application specific presets if set by the
// application.
func PresetGetAppDir() string {
var cret *C.gchar // return, none, string, casted *C.gchar
cret = C.gst_preset_get_app_dir()
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// PresetSetAppDir wraps gst_preset_set_app_dir
//
// The function takes the following parameters:
//
// - appDir string: the application specific preset dir
//
// The function returns the following values:
//
// - goret bool
//
// Sets an extra directory as an absolute path that should be considered when
// looking for presets. Any presets in the application dir will shadow the
// system presets.
func PresetSetAppDir(appDir string) bool {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(appDir)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_preset_set_app_dir(carg1)
runtime.KeepAlive(appDir)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DeletePreset wraps gst_preset_delete_preset
//
// The function takes the following parameters:
//
// - name string: preset name to remove
//
// The function returns the following values:
//
// - goret bool
//
// Delete the given preset.
func (preset *PresetInstance) DeletePreset(name string) bool {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_preset_delete_preset(carg0, carg1)
runtime.KeepAlive(preset)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetMeta wraps gst_preset_get_meta
//
// The function takes the following parameters:
//
// - name string: preset name
// - tag string: meta data item name
//
// The function returns the following values:
//
// - value string: value
// - goret bool
//
// Gets the @value for an existing meta data @tag. Meta data @tag names can be
// something like e.g. "comment". Returned values need to be released when done.
func (preset *PresetInstance) GetMeta(name string, tag string) (string, bool) {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // out, full, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_preset_get_meta(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(preset)
runtime.KeepAlive(name)
runtime.KeepAlive(tag)
var value string
var goret bool
value = C.GoString((*C.char)(unsafe.Pointer(carg3)))
defer C.free(unsafe.Pointer(carg3))
if cret != 0 {
goret = true
}
return value, goret
}
// GetPresetNames wraps gst_preset_get_preset_names
// The function returns the following values:
//
// - goret []string
//
// Get a copy of preset names as a %NULL terminated string array.
func (preset *PresetInstance) GetPresetNames() []string {
var carg0 *C.GstPreset // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
cret = C.gst_preset_get_preset_names(carg0)
runtime.KeepAlive(preset)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetPropertyNames wraps gst_preset_get_property_names
// The function returns the following values:
//
// - goret []string
//
// Get a the names of the GObject properties that can be used for presets.
func (preset *PresetInstance) GetPropertyNames() []string {
var carg0 *C.GstPreset // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
cret = C.gst_preset_get_property_names(carg0)
runtime.KeepAlive(preset)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// IsEditable wraps gst_preset_is_editable
// The function returns the following values:
//
// - goret bool
//
// Check if one can add new presets, change existing ones and remove presets.
func (preset *PresetInstance) IsEditable() bool {
var carg0 *C.GstPreset // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
cret = C.gst_preset_is_editable(carg0)
runtime.KeepAlive(preset)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LoadPreset wraps gst_preset_load_preset
//
// The function takes the following parameters:
//
// - name string: preset name to load
//
// The function returns the following values:
//
// - goret bool
//
// Load the given preset.
func (preset *PresetInstance) LoadPreset(name string) bool {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_preset_load_preset(carg0, carg1)
runtime.KeepAlive(preset)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RenamePreset wraps gst_preset_rename_preset
//
// The function takes the following parameters:
//
// - oldName string: current preset name
// - newName string: new preset name
//
// The function returns the following values:
//
// - goret bool
//
// Renames a preset. If there is already a preset by the @new_name it will be
// overwritten.
func (preset *PresetInstance) RenamePreset(oldName string, newName string) bool {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(oldName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(newName)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_preset_rename_preset(carg0, carg1, carg2)
runtime.KeepAlive(preset)
runtime.KeepAlive(oldName)
runtime.KeepAlive(newName)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SavePreset wraps gst_preset_save_preset
//
// The function takes the following parameters:
//
// - name string: preset name to save
//
// The function returns the following values:
//
// - goret bool
//
// Save the current object settings as a preset under the given name. If there
// is already a preset by this @name it will be overwritten.
func (preset *PresetInstance) SavePreset(name string) bool {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_preset_save_preset(carg0, carg1)
runtime.KeepAlive(preset)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetMeta wraps gst_preset_set_meta
//
// The function takes the following parameters:
//
// - name string: preset name
// - tag string: meta data item name
// - value string (nullable): new value
//
// The function returns the following values:
//
// - goret bool
//
// Sets a new @value for an existing meta data item or adds a new item. Meta
// data @tag names can be something like e.g. "comment". Supplying %NULL for the
// @value will unset an existing value.
func (preset *PresetInstance) SetMeta(name string, tag string, value string) bool {
var carg0 *C.GstPreset // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstPreset)(UnsafePresetToGlibNone(preset))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg2))
if value != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
defer C.free(unsafe.Pointer(carg3))
}
cret = C.gst_preset_set_meta(carg0, carg1, carg2, carg3)
runtime.KeepAlive(preset)
runtime.KeepAlive(name)
runtime.KeepAlive(tag)
runtime.KeepAlive(value)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// URIHandlerInstance is the instance type used by all types implementing GstURIHandler. It is used internally by the bindings. Users should use the interface [URIHandler] instead.
type URIHandlerInstance struct {
_ [0]func() // equal guard
Instance gobject.ObjectInstance
}
var _ URIHandler = (*URIHandlerInstance)(nil)
// URIHandlerInstance wraps GstURIHandler
//
// The #GstURIHandler is an interface that is implemented by Source and Sink
// #GstElement to unify handling of URI.
//
// An application can use the following functions to quickly get an element
// that handles the given URI for reading or writing
// (gst_element_make_from_uri()).
//
// Source and Sink plugins should implement this interface when possible.
type URIHandler interface {
upcastToGstURIHandler() *URIHandlerInstance
// GetProtocols wraps gst_uri_handler_get_protocols
// The function returns the following values:
//
// - goret []string
//
// Gets the list of protocols supported by @handler. This list may not be
// modified.
GetProtocols() []string
// GetURI wraps gst_uri_handler_get_uri
// The function returns the following values:
//
// - goret string
//
// Gets the currently handled URI.
GetURI() string
// GetURIType wraps gst_uri_handler_get_uri_type
// The function returns the following values:
//
// - goret URIType
//
// Gets the type of the given URI handler
GetURIType() URIType
// SetURI wraps gst_uri_handler_set_uri
//
// The function takes the following parameters:
//
// - uri string: URI to set
//
// The function returns the following values:
//
// - goret bool
// - _goerr error (nullable): an error
//
// Tries to set the URI of the given handler.
SetURI(string) (bool, error)
}
var _ URIHandler = (*URIHandlerInstance)(nil)
func unsafeWrapURIHandler(base *gobject.ObjectInstance) *URIHandlerInstance {
return &URIHandlerInstance{
Instance: *base,
}
}
func marshalURIHandlerInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapURIHandler(gobject.ValueFromNative(p).Object()), nil
}
func (u *URIHandlerInstance) upcastToGstURIHandler() *URIHandlerInstance {
return u
}
// UnsafeURIHandlerFromGlibNone is used to convert raw GstURIHandler pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeURIHandlerFromGlibNone(c unsafe.Pointer) URIHandler {
return gobject.UnsafeObjectFromGlibNone(c).(URIHandler)
}
// UnsafeURIHandlerFromGlibFull is used to convert raw GstURIHandler pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeURIHandlerFromGlibFull(c unsafe.Pointer) URIHandler {
return gobject.UnsafeObjectFromGlibFull(c).(URIHandler)
}
// UnsafeURIHandlerToGlibNone is used to convert the instance to it's C value GstURIHandler. This is used by the bindings internally.
func UnsafeURIHandlerToGlibNone(c URIHandler) unsafe.Pointer {
i := c.upcastToGstURIHandler()
return gobject.UnsafeObjectToGlibNone(&i.Instance)
}
// UnsafeURIHandlerToGlibFull is used to convert the instance to it's C value GstURIHandler, while removeing the finalizer. This is used by the bindings internally.
func UnsafeURIHandlerToGlibFull(c URIHandler) unsafe.Pointer {
i := c.upcastToGstURIHandler()
return gobject.UnsafeObjectToGlibFull(&i.Instance)
}
// GetProtocols wraps gst_uri_handler_get_protocols
// The function returns the following values:
//
// - goret []string
//
// Gets the list of protocols supported by @handler. This list may not be
// modified.
func (handler *URIHandlerInstance) GetProtocols() []string {
var carg0 *C.GstURIHandler // in, none, converted
var cret **C.gchar // return, transfer: none, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstURIHandler)(UnsafeURIHandlerToGlibNone(handler))
cret = C.gst_uri_handler_get_protocols(carg0)
runtime.KeepAlive(handler)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (const gchar* const*)")
return goret
}
// GetURI wraps gst_uri_handler_get_uri
// The function returns the following values:
//
// - goret string
//
// Gets the currently handled URI.
func (handler *URIHandlerInstance) GetURI() string {
var carg0 *C.GstURIHandler // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstURIHandler)(UnsafeURIHandlerToGlibNone(handler))
cret = C.gst_uri_handler_get_uri(carg0)
runtime.KeepAlive(handler)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetURIType wraps gst_uri_handler_get_uri_type
// The function returns the following values:
//
// - goret URIType
//
// Gets the type of the given URI handler
func (handler *URIHandlerInstance) GetURIType() URIType {
var carg0 *C.GstURIHandler // in, none, converted
var cret C.GstURIType // return, none, casted
carg0 = (*C.GstURIHandler)(UnsafeURIHandlerToGlibNone(handler))
cret = C.gst_uri_handler_get_uri_type(carg0)
runtime.KeepAlive(handler)
var goret URIType
goret = URIType(cret)
return goret
}
// SetURI wraps gst_uri_handler_set_uri
//
// The function takes the following parameters:
//
// - uri string: URI to set
//
// The function returns the following values:
//
// - goret bool
// - _goerr error (nullable): an error
//
// Tries to set the URI of the given handler.
func (handler *URIHandlerInstance) SetURI(uri string) (bool, error) {
var carg0 *C.GstURIHandler // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
var _cerr *C.GError // out, full, converted, nullable
carg0 = (*C.GstURIHandler)(UnsafeURIHandlerToGlibNone(handler))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uri)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_handler_set_uri(carg0, carg1, &_cerr)
runtime.KeepAlive(handler)
runtime.KeepAlive(uri)
var goret bool
var _goerr error
if cret != 0 {
goret = true
}
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// TagSetterInstance is the instance type used by all types implementing GstTagSetter. It is used internally by the bindings. Users should use the interface [TagSetter] instead.
type TagSetterInstance struct {
_ [0]func() // equal guard
Instance gobject.ObjectInstance
}
var _ TagSetter = (*TagSetterInstance)(nil)
// TagSetterInstance wraps GstTagSetter
//
// Element interface that allows setting of media metadata.
//
// Elements that support changing a stream's metadata will implement this
// interface. Examples of such elements are 'vorbisenc', 'theoraenc' and
// 'id3v2mux'.
//
// If you just want to retrieve metadata in your application then all you
// need to do is watch for tag messages on your pipeline's bus. This
// interface is only for setting metadata, not for extracting it. To set tags
// from the application, find tagsetter elements and set tags using e.g.
// gst_tag_setter_merge_tags() or gst_tag_setter_add_tags(). Also consider
// setting the #GstTagMergeMode that is used for tag events that arrive at the
// tagsetter element (default mode is to keep existing tags).
// The application should do that before the element goes to %GST_STATE_PAUSED.
//
// Elements implementing the #GstTagSetter interface often have to merge
// any tags received from upstream and the tags set by the application via
// the interface. This can be done like this:
//
// |[&lt;!-- language="C" --&gt;
// GstTagMergeMode merge_mode;
// const GstTagList *application_tags;
// const GstTagList *event_tags;
// GstTagSetter *tagsetter;
// GstTagList *result;
//
// tagsetter = GST_TAG_SETTER (element);
//
// merge_mode = gst_tag_setter_get_tag_merge_mode (tagsetter);
// application_tags = gst_tag_setter_get_tag_list (tagsetter);
// event_tags = (const GstTagList *) element-&gt;event_tags;
//
// GST_LOG_OBJECT (tagsetter, "merging tags, merge mode = %d", merge_mode);
// GST_LOG_OBJECT (tagsetter, "event tags: %" GST_PTR_FORMAT, event_tags);
// GST_LOG_OBJECT (tagsetter, "set tags: %" GST_PTR_FORMAT, application_tags);
//
// result = gst_tag_list_merge (application_tags, event_tags, merge_mode);
//
// GST_LOG_OBJECT (tagsetter, "final tags: %" GST_PTR_FORMAT, result);
// ]|
type TagSetter interface {
upcastToGstTagSetter() *TagSetterInstance
// AddTagValue wraps gst_tag_setter_add_tag_value
//
// The function takes the following parameters:
//
// - mode TagMergeMode: the mode to use
// - tag string: tag to set
// - value *gobject.Value: GValue to set for the tag
//
// Adds the given tag / GValue pair on the setter using the given merge mode.
AddTagValue(TagMergeMode, string, *gobject.Value)
// GetTagList wraps gst_tag_setter_get_tag_list
// The function returns the following values:
//
// - goret *TagList
//
// Returns the current list of tags the setter uses. The list should not be
// modified or freed.
//
// This function is not thread-safe.
GetTagList() *TagList
// GetTagMergeMode wraps gst_tag_setter_get_tag_merge_mode
// The function returns the following values:
//
// - goret TagMergeMode
//
// Queries the mode by which tags inside the setter are overwritten by tags
// from events
GetTagMergeMode() TagMergeMode
// MergeTags wraps gst_tag_setter_merge_tags
//
// The function takes the following parameters:
//
// - list *TagList: a tag list to merge from
// - mode TagMergeMode: the mode to merge with
//
// Merges the given list into the setter's list using the given mode.
MergeTags(*TagList, TagMergeMode)
// ResetTags wraps gst_tag_setter_reset_tags
//
// Reset the internal taglist. Elements should call this from within the
// state-change handler.
ResetTags()
// SetTagMergeMode wraps gst_tag_setter_set_tag_merge_mode
//
// The function takes the following parameters:
//
// - mode TagMergeMode: The mode with which tags are added
//
// Sets the given merge mode that is used for adding tags from events to tags
// specified by this interface. The default is #GST_TAG_MERGE_KEEP, which keeps
// the tags set with this interface and discards tags from events.
SetTagMergeMode(TagMergeMode)
}
var _ TagSetter = (*TagSetterInstance)(nil)
func unsafeWrapTagSetter(base *gobject.ObjectInstance) *TagSetterInstance {
return &TagSetterInstance{
Instance: *base,
}
}
func marshalTagSetterInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTagSetter(gobject.ValueFromNative(p).Object()), nil
}
func (t *TagSetterInstance) upcastToGstTagSetter() *TagSetterInstance {
return t
}
// UnsafeTagSetterFromGlibNone is used to convert raw GstTagSetter pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTagSetterFromGlibNone(c unsafe.Pointer) TagSetter {
return gobject.UnsafeObjectFromGlibNone(c).(TagSetter)
}
// UnsafeTagSetterFromGlibFull is used to convert raw GstTagSetter pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTagSetterFromGlibFull(c unsafe.Pointer) TagSetter {
return gobject.UnsafeObjectFromGlibFull(c).(TagSetter)
}
// UnsafeTagSetterToGlibNone is used to convert the instance to it's C value GstTagSetter. This is used by the bindings internally.
func UnsafeTagSetterToGlibNone(c TagSetter) unsafe.Pointer {
i := c.upcastToGstTagSetter()
return gobject.UnsafeObjectToGlibNone(&i.Instance)
}
// UnsafeTagSetterToGlibFull is used to convert the instance to it's C value GstTagSetter, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTagSetterToGlibFull(c TagSetter) unsafe.Pointer {
i := c.upcastToGstTagSetter()
return gobject.UnsafeObjectToGlibFull(&i.Instance)
}
// AddTagValue wraps gst_tag_setter_add_tag_value
//
// The function takes the following parameters:
//
// - mode TagMergeMode: the mode to use
// - tag string: tag to set
// - value *gobject.Value: GValue to set for the tag
//
// Adds the given tag / GValue pair on the setter using the given merge mode.
func (setter *TagSetterInstance) AddTagValue(mode TagMergeMode, tag string, value *gobject.Value) {
var carg0 *C.GstTagSetter // in, none, converted
var carg1 C.GstTagMergeMode // in, none, casted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.GValue // in, none, converted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
carg1 = C.GstTagMergeMode(mode)
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
C.gst_tag_setter_add_tag_value(carg0, carg1, carg2, carg3)
runtime.KeepAlive(setter)
runtime.KeepAlive(mode)
runtime.KeepAlive(tag)
runtime.KeepAlive(value)
}
// GetTagList wraps gst_tag_setter_get_tag_list
// The function returns the following values:
//
// - goret *TagList
//
// Returns the current list of tags the setter uses. The list should not be
// modified or freed.
//
// This function is not thread-safe.
func (setter *TagSetterInstance) GetTagList() *TagList {
var carg0 *C.GstTagSetter // in, none, converted
var cret *C.GstTagList // return, none, converted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
cret = C.gst_tag_setter_get_tag_list(carg0)
runtime.KeepAlive(setter)
var goret *TagList
goret = UnsafeTagListFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetTagMergeMode wraps gst_tag_setter_get_tag_merge_mode
// The function returns the following values:
//
// - goret TagMergeMode
//
// Queries the mode by which tags inside the setter are overwritten by tags
// from events
func (setter *TagSetterInstance) GetTagMergeMode() TagMergeMode {
var carg0 *C.GstTagSetter // in, none, converted
var cret C.GstTagMergeMode // return, none, casted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
cret = C.gst_tag_setter_get_tag_merge_mode(carg0)
runtime.KeepAlive(setter)
var goret TagMergeMode
goret = TagMergeMode(cret)
return goret
}
// MergeTags wraps gst_tag_setter_merge_tags
//
// The function takes the following parameters:
//
// - list *TagList: a tag list to merge from
// - mode TagMergeMode: the mode to merge with
//
// Merges the given list into the setter's list using the given mode.
func (setter *TagSetterInstance) MergeTags(list *TagList, mode TagMergeMode) {
var carg0 *C.GstTagSetter // in, none, converted
var carg1 *C.GstTagList // in, none, converted
var carg2 C.GstTagMergeMode // in, none, casted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg2 = C.GstTagMergeMode(mode)
C.gst_tag_setter_merge_tags(carg0, carg1, carg2)
runtime.KeepAlive(setter)
runtime.KeepAlive(list)
runtime.KeepAlive(mode)
}
// ResetTags wraps gst_tag_setter_reset_tags
//
// Reset the internal taglist. Elements should call this from within the
// state-change handler.
func (setter *TagSetterInstance) ResetTags() {
var carg0 *C.GstTagSetter // in, none, converted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
C.gst_tag_setter_reset_tags(carg0)
runtime.KeepAlive(setter)
}
// SetTagMergeMode wraps gst_tag_setter_set_tag_merge_mode
//
// The function takes the following parameters:
//
// - mode TagMergeMode: The mode with which tags are added
//
// Sets the given merge mode that is used for adding tags from events to tags
// specified by this interface. The default is #GST_TAG_MERGE_KEEP, which keeps
// the tags set with this interface and discards tags from events.
func (setter *TagSetterInstance) SetTagMergeMode(mode TagMergeMode) {
var carg0 *C.GstTagSetter // in, none, converted
var carg1 C.GstTagMergeMode // in, none, casted
carg0 = (*C.GstTagSetter)(UnsafeTagSetterToGlibNone(setter))
carg1 = C.GstTagMergeMode(mode)
C.gst_tag_setter_set_tag_merge_mode(carg0, carg1)
runtime.KeepAlive(setter)
runtime.KeepAlive(mode)
}
// TocSetterInstance is the instance type used by all types implementing GstTocSetter. It is used internally by the bindings. Users should use the interface [TocSetter] instead.
type TocSetterInstance struct {
_ [0]func() // equal guard
Instance gobject.ObjectInstance
}
var _ TocSetter = (*TocSetterInstance)(nil)
// TocSetterInstance wraps GstTocSetter
//
// Element interface that allows setting of the TOC.
//
// Elements that support some kind of chapters or editions (or tracks like in
// the FLAC cue sheet) will implement this interface.
//
// If you just want to retrieve the TOC in your application then all you
// need to do is watch for TOC messages on your pipeline's bus (or you can
// perform TOC query). This interface is only for setting TOC data, not for
// extracting it. To set TOC from the application, find proper tocsetter element
// and set TOC using gst_toc_setter_set_toc().
//
// Elements implementing the #GstTocSetter interface can extend existing TOC
// by getting extend UID for that (you can use gst_toc_find_entry() to retrieve it)
// with any TOC entries received from downstream.
type TocSetter interface {
upcastToGstTocSetter() *TocSetterInstance
// GetToc wraps gst_toc_setter_get_toc
// The function returns the following values:
//
// - goret *Toc
//
// Return current TOC the setter uses. The TOC should not be
// modified without making it writable first.
GetToc() *Toc
// Reset wraps gst_toc_setter_reset
//
// Reset the internal TOC. Elements should call this from within the
// state-change handler.
Reset()
// SetToc wraps gst_toc_setter_set_toc
//
// The function takes the following parameters:
//
// - toc *Toc (nullable): a #GstToc to set.
//
// Set the given TOC on the setter. Previously set TOC will be
// unreffed before setting a new one.
SetToc(*Toc)
}
var _ TocSetter = (*TocSetterInstance)(nil)
func unsafeWrapTocSetter(base *gobject.ObjectInstance) *TocSetterInstance {
return &TocSetterInstance{
Instance: *base,
}
}
func marshalTocSetterInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTocSetter(gobject.ValueFromNative(p).Object()), nil
}
func (t *TocSetterInstance) upcastToGstTocSetter() *TocSetterInstance {
return t
}
// UnsafeTocSetterFromGlibNone is used to convert raw GstTocSetter pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTocSetterFromGlibNone(c unsafe.Pointer) TocSetter {
return gobject.UnsafeObjectFromGlibNone(c).(TocSetter)
}
// UnsafeTocSetterFromGlibFull is used to convert raw GstTocSetter pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTocSetterFromGlibFull(c unsafe.Pointer) TocSetter {
return gobject.UnsafeObjectFromGlibFull(c).(TocSetter)
}
// UnsafeTocSetterToGlibNone is used to convert the instance to it's C value GstTocSetter. This is used by the bindings internally.
func UnsafeTocSetterToGlibNone(c TocSetter) unsafe.Pointer {
i := c.upcastToGstTocSetter()
return gobject.UnsafeObjectToGlibNone(&i.Instance)
}
// UnsafeTocSetterToGlibFull is used to convert the instance to it's C value GstTocSetter, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTocSetterToGlibFull(c TocSetter) unsafe.Pointer {
i := c.upcastToGstTocSetter()
return gobject.UnsafeObjectToGlibFull(&i.Instance)
}
// GetToc wraps gst_toc_setter_get_toc
// The function returns the following values:
//
// - goret *Toc
//
// Return current TOC the setter uses. The TOC should not be
// modified without making it writable first.
func (setter *TocSetterInstance) GetToc() *Toc {
var carg0 *C.GstTocSetter // in, none, converted
var cret *C.GstToc // return, full, converted
carg0 = (*C.GstTocSetter)(UnsafeTocSetterToGlibNone(setter))
cret = C.gst_toc_setter_get_toc(carg0)
runtime.KeepAlive(setter)
var goret *Toc
goret = UnsafeTocFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Reset wraps gst_toc_setter_reset
//
// Reset the internal TOC. Elements should call this from within the
// state-change handler.
func (setter *TocSetterInstance) Reset() {
var carg0 *C.GstTocSetter // in, none, converted
carg0 = (*C.GstTocSetter)(UnsafeTocSetterToGlibNone(setter))
C.gst_toc_setter_reset(carg0)
runtime.KeepAlive(setter)
}
// SetToc wraps gst_toc_setter_set_toc
//
// The function takes the following parameters:
//
// - toc *Toc (nullable): a #GstToc to set.
//
// Set the given TOC on the setter. Previously set TOC will be
// unreffed before setting a new one.
func (setter *TocSetterInstance) SetToc(toc *Toc) {
var carg0 *C.GstTocSetter // in, none, converted
var carg1 *C.GstToc // in, none, converted, nullable
carg0 = (*C.GstTocSetter)(UnsafeTocSetterToGlibNone(setter))
if toc != nil {
carg1 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
}
C.gst_toc_setter_set_toc(carg0, carg1)
runtime.KeepAlive(setter)
runtime.KeepAlive(toc)
}
// ObjectInstance is the instance type used by all types extending GstObject. It is used internally by the bindings. Users should use the interface [Object] instead.
type ObjectInstance struct {
_ [0]func() // equal guard
gobject.InitiallyUnownedInstance
}
var _ Object = (*ObjectInstance)(nil)
// Object wraps GstObject
//
// #GstObject provides a root for the object hierarchy tree filed in by the
// GStreamer library. It is currently a thin wrapper on top of
// #GInitiallyUnowned. It is an abstract class that is not very usable on its own.
//
// #GstObject gives us basic refcounting, parenting functionality and locking.
// Most of the functions are just extended for special GStreamer needs and can be
// found under the same name in the base class of #GstObject which is #GObject
// (e.g. g_object_ref() becomes gst_object_ref()).
//
// Since #GstObject derives from #GInitiallyUnowned, it also inherits the
// floating reference. Be aware that functions such as gst_bin_add() and
// gst_element_add_pad() take ownership of the floating reference.
//
// In contrast to #GObject instances, #GstObject adds a name property. The functions
// gst_object_set_name() and gst_object_get_name() are used to set/get the name
// of the object.
//
// ## controlled properties
//
// Controlled properties offers a lightweight way to adjust gobject properties
// over stream-time. It works by using time-stamped value pairs that are queued
// for element-properties. At run-time the elements continuously pull value
// changes for the current stream-time.
//
// What needs to be changed in a #GstElement?
// Very little - it is just two steps to make a plugin controllable!
//
// * mark gobject-properties paramspecs that make sense to be controlled,
// by GST_PARAM_CONTROLLABLE.
//
// * when processing data (get, chain, loop function) at the beginning call
// gst_object_sync_values(element,timestamp).
// This will make the controller update all GObject properties that are
// under its control with the current values based on the timestamp.
//
// What needs to be done in applications? Again it's not a lot to change.
//
// * create a #GstControlSource.
// csource = gst_interpolation_control_source_new ();
// g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
//
// * Attach the #GstControlSource on the controller to a property.
// gst_object_add_control_binding (object, gst_direct_control_binding_new (object, "prop1", csource));
//
// * Set the control values
// gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,0 * GST_SECOND, value1);
// gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,1 * GST_SECOND, value2);
//
// * start your pipeline
type Object interface {
ObjectExtManual // handwritten functions
gobject.InitiallyUnowned
upcastToGstObject() *ObjectInstance
// AddControlBinding wraps gst_object_add_control_binding
//
// The function takes the following parameters:
//
// - binding ControlBinding: the #GstControlBinding that should be used
//
// The function returns the following values:
//
// - goret bool
//
// Attach the #GstControlBinding to the object. If there already was a
// #GstControlBinding for this property it will be replaced.
//
// The object's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
AddControlBinding(ControlBinding) bool
// DefaultError wraps gst_object_default_error
//
// The function takes the following parameters:
//
// - debug string (nullable): an additional debug information string, or %NULL
// - err error: the GError.
//
// A default error function that uses g_printerr() to display the error message
// and the optional debug string..
//
// The default handler will simply print the error string using g_print.
DefaultError(string, error)
// CurrentControlBinding wraps gst_object_get_control_binding
//
// The function takes the following parameters:
//
// - propertyName string: name of the property
//
// The function returns the following values:
//
// - goret ControlBinding
//
// Gets the corresponding #GstControlBinding for the property. This should be
// unreferenced again after use.
CurrentControlBinding(string) ControlBinding
// GetControlRate wraps gst_object_get_control_rate
// The function returns the following values:
//
// - goret ClockTime
//
// Obtain the control-rate for this @object. Audio processing #GstElement
// objects will use this rate to sub-divide their processing loop and call
// gst_object_sync_values() in between. The length of the processing segment
// should be up to @control-rate nanoseconds.
//
// If the @object is not under property control, this will return
// %GST_CLOCK_TIME_NONE. This allows the element to avoid the sub-dividing.
//
// The control-rate is not expected to change if the element is in
// %GST_STATE_PAUSED or %GST_STATE_PLAYING.
GetControlRate() ClockTime
// GetName wraps gst_object_get_name
// The function returns the following values:
//
// - goret string
//
// Returns a copy of the name of @object.
// Caller should g_free() the return value after usage.
// For a nameless object, this returns %NULL, which you can safely g_free()
// as well.
//
// Free-function: g_free
GetName() string
// GetParent wraps gst_object_get_parent
// The function returns the following values:
//
// - goret Object
//
// Returns the parent of @object. This function increases the refcount
// of the parent object so you should gst_object_unref() it after usage.
GetParent() Object
// GetPathString wraps gst_object_get_path_string
// The function returns the following values:
//
// - goret string
//
// Generates a string describing the path of @object in
// the object hierarchy. Only useful (or used) for debugging.
//
// Free-function: g_free
GetPathString() string
// HasActiveControlBindings wraps gst_object_has_active_control_bindings
// The function returns the following values:
//
// - goret bool
//
// Check if the @object has active controlled properties.
HasActiveControlBindings() bool
// HasAncestor wraps gst_object_has_ancestor
//
// The function takes the following parameters:
//
// - ancestor Object: a #GstObject to check as ancestor
//
// The function returns the following values:
//
// - goret bool
//
// Check if @object has an ancestor @ancestor somewhere up in
// the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
//
// Deprecated: Use gst_object_has_as_ancestor() instead.
//
// MT safe. Grabs and releases @object's locks.
HasAncestor(Object) bool
// HasAsAncestor wraps gst_object_has_as_ancestor
//
// The function takes the following parameters:
//
// - ancestor Object: a #GstObject to check as ancestor
//
// The function returns the following values:
//
// - goret bool
//
// Check if @object has an ancestor @ancestor somewhere up in
// the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
HasAsAncestor(Object) bool
// HasAsParent wraps gst_object_has_as_parent
//
// The function takes the following parameters:
//
// - parent Object: a #GstObject to check as parent
//
// The function returns the following values:
//
// - goret bool
//
// Check if @parent is the parent of @object.
// E.g. a #GstElement can check if it owns a given #GstPad.
HasAsParent(Object) bool
// RemoveControlBinding wraps gst_object_remove_control_binding
//
// The function takes the following parameters:
//
// - binding ControlBinding: the binding
//
// The function returns the following values:
//
// - goret bool
//
// Removes the corresponding #GstControlBinding. If it was the
// last ref of the binding, it will be disposed.
RemoveControlBinding(ControlBinding) bool
// SetControlBindingDisabled wraps gst_object_set_control_binding_disabled
//
// The function takes the following parameters:
//
// - propertyName string: property to disable
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable the control bindings on a property for
// some time, i.e. gst_object_sync_values() will do nothing for the
// property.
SetControlBindingDisabled(string, bool)
// SetControlBindingsDisabled wraps gst_object_set_control_bindings_disabled
//
// The function takes the following parameters:
//
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable all controlled properties of the @object for
// some time, i.e. gst_object_sync_values() will do nothing.
SetControlBindingsDisabled(bool)
// SetControlRate wraps gst_object_set_control_rate
//
// The function takes the following parameters:
//
// - controlRate ClockTime: the new control-rate in nanoseconds.
//
// Change the control-rate for this @object. Audio processing #GstElement
// objects will use this rate to sub-divide their processing loop and call
// gst_object_sync_values() in between. The length of the processing segment
// should be up to @control-rate nanoseconds.
//
// The control-rate should not change if the element is in %GST_STATE_PAUSED or
// %GST_STATE_PLAYING.
SetControlRate(ClockTime)
// SetName wraps gst_object_set_name
//
// The function takes the following parameters:
//
// - name string (nullable): new name of object
//
// The function returns the following values:
//
// - goret bool
//
// Sets the name of @object, or gives @object a guaranteed unique
// name (if @name is %NULL).
// This function makes a copy of the provided name, so the caller
// retains ownership of the name it sent.
SetName(string) bool
// SetParent wraps gst_object_set_parent
//
// The function takes the following parameters:
//
// - parent Object: new parent of object
//
// The function returns the following values:
//
// - goret bool
//
// Sets the parent of @object to @parent. The object's reference count will
// be incremented, and any floating reference will be removed (see gst_object_ref_sink()).
SetParent(Object) bool
// SuggestNextSync wraps gst_object_suggest_next_sync
// The function returns the following values:
//
// - goret ClockTime
//
// Returns a suggestion for timestamps where buffers should be split
// to get best controller results.
SuggestNextSync() ClockTime
// SyncValues wraps gst_object_sync_values
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the time that should be processed
//
// The function returns the following values:
//
// - goret bool
//
// Sets the properties of the object, according to the #GstControlSources that
// (maybe) handle them and for the given timestamp.
//
// If this function fails, it is most likely the application developers fault.
// Most probably the control sources are not setup correctly.
SyncValues(ClockTime) bool
// Unparent wraps gst_object_unparent
//
// Clear the parent of @object, removing the associated reference.
// This function decreases the refcount of @object.
//
// MT safe. Grabs and releases @object's lock.
Unparent()
}
func unsafeWrapObject(base *gobject.ObjectInstance) *ObjectInstance {
return &ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
}
}
func marshalObjectInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapObject(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeObjectFromGlibNone is used to convert raw GstObject pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeObjectFromGlibNone(c unsafe.Pointer) Object {
return gobject.UnsafeObjectFromGlibNone(c).(Object)
}
// UnsafeObjectFromGlibFull is used to convert raw GstObject pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeObjectFromGlibFull(c unsafe.Pointer) Object {
return gobject.UnsafeObjectFromGlibFull(c).(Object)
}
func (o *ObjectInstance) upcastToGstObject() *ObjectInstance {
return o
}
// UnsafeObjectToGlibNone is used to convert the instance to it's C value GstObject. This is used by the bindings internally.
func UnsafeObjectToGlibNone(c Object) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeObjectToGlibFull is used to convert the instance to it's C value GstObject, while removeing the finalizer. This is used by the bindings internally.
func UnsafeObjectToGlibFull(c Object) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// AddControlBinding wraps gst_object_add_control_binding
//
// The function takes the following parameters:
//
// - binding ControlBinding: the #GstControlBinding that should be used
//
// The function returns the following values:
//
// - goret bool
//
// Attach the #GstControlBinding to the object. If there already was a
// #GstControlBinding for this property it will be replaced.
//
// The object's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
func (object *ObjectInstance) AddControlBinding(binding ControlBinding) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstControlBinding // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstControlBinding)(UnsafeControlBindingToGlibNone(binding))
cret = C.gst_object_add_control_binding(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(binding)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DefaultError wraps gst_object_default_error
//
// The function takes the following parameters:
//
// - debug string (nullable): an additional debug information string, or %NULL
// - err error: the GError.
//
// A default error function that uses g_printerr() to display the error message
// and the optional debug string..
//
// The default handler will simply print the error string using g_print.
func (source *ObjectInstance) DefaultError(debug string, err error) {
var carg0 *C.GstObject // in, none, converted
var carg2 *C.gchar // in, none, string, nullable-string
var carg1 *C.GError // in, none, converted
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(source))
if debug != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg2))
}
carg1 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
C.gst_object_default_error(carg0, carg1, carg2)
runtime.KeepAlive(source)
runtime.KeepAlive(debug)
runtime.KeepAlive(err)
}
// CurrentControlBinding wraps gst_object_get_control_binding
//
// The function takes the following parameters:
//
// - propertyName string: name of the property
//
// The function returns the following values:
//
// - goret ControlBinding
//
// Gets the corresponding #GstControlBinding for the property. This should be
// unreferenced again after use.
func (object *ObjectInstance) CurrentControlBinding(propertyName string) ControlBinding {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstControlBinding // return, full, converted
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(propertyName)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_object_get_control_binding(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(propertyName)
var goret ControlBinding
goret = UnsafeControlBindingFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetControlRate wraps gst_object_get_control_rate
// The function returns the following values:
//
// - goret ClockTime
//
// Obtain the control-rate for this @object. Audio processing #GstElement
// objects will use this rate to sub-divide their processing loop and call
// gst_object_sync_values() in between. The length of the processing segment
// should be up to @control-rate nanoseconds.
//
// If the @object is not under property control, this will return
// %GST_CLOCK_TIME_NONE. This allows the element to avoid the sub-dividing.
//
// The control-rate is not expected to change if the element is in
// %GST_STATE_PAUSED or %GST_STATE_PLAYING.
func (object *ObjectInstance) GetControlRate() ClockTime {
var carg0 *C.GstObject // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_get_control_rate(carg0)
runtime.KeepAlive(object)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetName wraps gst_object_get_name
// The function returns the following values:
//
// - goret string
//
// Returns a copy of the name of @object.
// Caller should g_free() the return value after usage.
// For a nameless object, this returns %NULL, which you can safely g_free()
// as well.
//
// Free-function: g_free
func (object *ObjectInstance) GetName() string {
var carg0 *C.GstObject // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_get_name(carg0)
runtime.KeepAlive(object)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetParent wraps gst_object_get_parent
// The function returns the following values:
//
// - goret Object
//
// Returns the parent of @object. This function increases the refcount
// of the parent object so you should gst_object_unref() it after usage.
func (object *ObjectInstance) GetParent() Object {
var carg0 *C.GstObject // in, none, converted
var cret *C.GstObject // return, full, converted
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_get_parent(carg0)
runtime.KeepAlive(object)
var goret Object
goret = UnsafeObjectFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetPathString wraps gst_object_get_path_string
// The function returns the following values:
//
// - goret string
//
// Generates a string describing the path of @object in
// the object hierarchy. Only useful (or used) for debugging.
//
// Free-function: g_free
func (object *ObjectInstance) GetPathString() string {
var carg0 *C.GstObject // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_get_path_string(carg0)
runtime.KeepAlive(object)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// HasActiveControlBindings wraps gst_object_has_active_control_bindings
// The function returns the following values:
//
// - goret bool
//
// Check if the @object has active controlled properties.
func (object *ObjectInstance) HasActiveControlBindings() bool {
var carg0 *C.GstObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_has_active_control_bindings(carg0)
runtime.KeepAlive(object)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasAncestor wraps gst_object_has_ancestor
//
// The function takes the following parameters:
//
// - ancestor Object: a #GstObject to check as ancestor
//
// The function returns the following values:
//
// - goret bool
//
// Check if @object has an ancestor @ancestor somewhere up in
// the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
//
// Deprecated: Use gst_object_has_as_ancestor() instead.
//
// MT safe. Grabs and releases @object's locks.
func (object *ObjectInstance) HasAncestor(ancestor Object) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(ancestor))
cret = C.gst_object_has_ancestor(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(ancestor)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasAsAncestor wraps gst_object_has_as_ancestor
//
// The function takes the following parameters:
//
// - ancestor Object: a #GstObject to check as ancestor
//
// The function returns the following values:
//
// - goret bool
//
// Check if @object has an ancestor @ancestor somewhere up in
// the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
func (object *ObjectInstance) HasAsAncestor(ancestor Object) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(ancestor))
cret = C.gst_object_has_as_ancestor(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(ancestor)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasAsParent wraps gst_object_has_as_parent
//
// The function takes the following parameters:
//
// - parent Object: a #GstObject to check as parent
//
// The function returns the following values:
//
// - goret bool
//
// Check if @parent is the parent of @object.
// E.g. a #GstElement can check if it owns a given #GstPad.
func (object *ObjectInstance) HasAsParent(parent Object) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
cret = C.gst_object_has_as_parent(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(parent)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveControlBinding wraps gst_object_remove_control_binding
//
// The function takes the following parameters:
//
// - binding ControlBinding: the binding
//
// The function returns the following values:
//
// - goret bool
//
// Removes the corresponding #GstControlBinding. If it was the
// last ref of the binding, it will be disposed.
func (object *ObjectInstance) RemoveControlBinding(binding ControlBinding) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstControlBinding // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstControlBinding)(UnsafeControlBindingToGlibNone(binding))
cret = C.gst_object_remove_control_binding(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(binding)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetControlBindingDisabled wraps gst_object_set_control_binding_disabled
//
// The function takes the following parameters:
//
// - propertyName string: property to disable
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable the control bindings on a property for
// some time, i.e. gst_object_sync_values() will do nothing for the
// property.
func (object *ObjectInstance) SetControlBindingDisabled(propertyName string, disabled bool) {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(propertyName)))
defer C.free(unsafe.Pointer(carg1))
if disabled {
carg2 = C.TRUE
}
C.gst_object_set_control_binding_disabled(carg0, carg1, carg2)
runtime.KeepAlive(object)
runtime.KeepAlive(propertyName)
runtime.KeepAlive(disabled)
}
// SetControlBindingsDisabled wraps gst_object_set_control_bindings_disabled
//
// The function takes the following parameters:
//
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable all controlled properties of the @object for
// some time, i.e. gst_object_sync_values() will do nothing.
func (object *ObjectInstance) SetControlBindingsDisabled(disabled bool) {
var carg0 *C.GstObject // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
if disabled {
carg1 = C.TRUE
}
C.gst_object_set_control_bindings_disabled(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(disabled)
}
// SetControlRate wraps gst_object_set_control_rate
//
// The function takes the following parameters:
//
// - controlRate ClockTime: the new control-rate in nanoseconds.
//
// Change the control-rate for this @object. Audio processing #GstElement
// objects will use this rate to sub-divide their processing loop and call
// gst_object_sync_values() in between. The length of the processing segment
// should be up to @control-rate nanoseconds.
//
// The control-rate should not change if the element is in %GST_STATE_PAUSED or
// %GST_STATE_PLAYING.
func (object *ObjectInstance) SetControlRate(controlRate ClockTime) {
var carg0 *C.GstObject // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = C.GstClockTime(controlRate)
C.gst_object_set_control_rate(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(controlRate)
}
// SetName wraps gst_object_set_name
//
// The function takes the following parameters:
//
// - name string (nullable): new name of object
//
// The function returns the following values:
//
// - goret bool
//
// Sets the name of @object, or gives @object a guaranteed unique
// name (if @name is %NULL).
// This function makes a copy of the provided name, so the caller
// retains ownership of the name it sent.
func (object *ObjectInstance) SetName(name string) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_object_set_name(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetParent wraps gst_object_set_parent
//
// The function takes the following parameters:
//
// - parent Object: new parent of object
//
// The function returns the following values:
//
// - goret bool
//
// Sets the parent of @object to @parent. The object's reference count will
// be incremented, and any floating reference will be removed (see gst_object_ref_sink()).
func (object *ObjectInstance) SetParent(parent Object) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 *C.GstObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
cret = C.gst_object_set_parent(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(parent)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SuggestNextSync wraps gst_object_suggest_next_sync
// The function returns the following values:
//
// - goret ClockTime
//
// Returns a suggestion for timestamps where buffers should be split
// to get best controller results.
func (object *ObjectInstance) SuggestNextSync() ClockTime {
var carg0 *C.GstObject // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
cret = C.gst_object_suggest_next_sync(carg0)
runtime.KeepAlive(object)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// SyncValues wraps gst_object_sync_values
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the time that should be processed
//
// The function returns the following values:
//
// - goret bool
//
// Sets the properties of the object, according to the #GstControlSources that
// (maybe) handle them and for the given timestamp.
//
// If this function fails, it is most likely the application developers fault.
// Most probably the control sources are not setup correctly.
func (object *ObjectInstance) SyncValues(timestamp ClockTime) bool {
var carg0 *C.GstObject // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg1 = C.GstClockTime(timestamp)
cret = C.gst_object_sync_values(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(timestamp)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Unparent wraps gst_object_unparent
//
// Clear the parent of @object, removing the associated reference.
// This function decreases the refcount of @object.
//
// MT safe. Grabs and releases @object's lock.
func (object *ObjectInstance) Unparent() {
var carg0 *C.GstObject // in, none, converted
carg0 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
C.gst_object_unparent(carg0)
runtime.KeepAlive(object)
}
// PadInstance is the instance type used by all types extending GstPad. It is used internally by the bindings. Users should use the interface [Pad] instead.
type PadInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Pad = (*PadInstance)(nil)
// Pad wraps GstPad
//
// A #GstElement is linked to other elements via "pads", which are extremely
// light-weight generic link points.
//
// Pads have a #GstPadDirection, source pads produce data, sink pads consume
// data.
//
// Pads are typically created from a #GstPadTemplate with
// gst_pad_new_from_template() and are then added to a #GstElement. This usually
// happens when the element is created but it can also happen dynamically based
// on the data that the element is processing or based on the pads that the
// application requests.
//
// Pads without pad templates can be created with gst_pad_new(),
// which takes a direction and a name as an argument. If the name is %NULL,
// then a guaranteed unique name will be assigned to it.
//
// A #GstElement creating a pad will typically use the various
// gst_pad_set_*_function\() calls to register callbacks for events, queries or
// dataflow on the pads.
//
// gst_pad_get_parent() will retrieve the #GstElement that owns the pad.
//
// After two pads are retrieved from an element by gst_element_get_static_pad(),
// the pads can be linked with gst_pad_link(). (For quick links,
// you can also use gst_element_link(), which will make the obvious
// link for you if it's straightforward.). Pads can be unlinked again with
// gst_pad_unlink(). gst_pad_get_peer() can be used to check what the pad is
// linked to.
//
// Before dataflow is possible on the pads, they need to be activated with
// gst_pad_set_active().
//
// gst_pad_query() and gst_pad_peer_query() can be used to query various
// properties of the pad and the stream.
//
// To send a #GstEvent on a pad, use gst_pad_send_event() and
// gst_pad_push_event(). Some events will be sticky on the pad, meaning that
// after they pass on the pad they can be queried later with
// gst_pad_get_sticky_event() and gst_pad_sticky_events_foreach().
// gst_pad_get_current_caps() and gst_pad_has_current_caps() are convenience
// functions to query the current sticky CAPS event on a pad.
//
// GstElements will use gst_pad_push() and gst_pad_pull_range() to push out
// or pull in a buffer.
//
// The dataflow, events and queries that happen on a pad can be monitored with
// probes that can be installed with gst_pad_add_probe(). gst_pad_is_blocked()
// can be used to check if a block probe is installed on the pad.
// gst_pad_is_blocking() checks if the blocking probe is currently blocking the
// pad. gst_pad_remove_probe() is used to remove a previously installed probe
// and unblock blocking probes if any.
//
// Pad have an offset that can be retrieved with gst_pad_get_offset(). This
// offset will be applied to the running_time of all data passing over the pad.
// gst_pad_set_offset() can be used to change the offset.
//
// Convenience functions exist to start, pause and stop the task on a pad with
// gst_pad_start_task(), gst_pad_pause_task() and gst_pad_stop_task()
// respectively.
type Pad interface {
Object
upcastToGstPad() *PadInstance
// ActivateMode wraps gst_pad_activate_mode
//
// The function takes the following parameters:
//
// - mode PadMode: the requested activation mode
// - active bool: whether or not the pad should be active.
//
// The function returns the following values:
//
// - goret bool
//
// Activates or deactivates the given pad in @mode via dispatching to the
// pad's activatemodefunc. For use from within pad activation functions only.
//
// If you don't know what this is, you probably don't want to call it.
ActivateMode(PadMode, bool) bool
// AddProbe wraps gst_pad_add_probe
//
// The function takes the following parameters:
//
// - mask PadProbeType: the probe mask
// - callback PadProbeCallback: #GstPadProbeCallback that will be called with notifications of
// the pad state
//
// The function returns the following values:
//
// - goret uint32
//
// Be notified of different states of pads. The provided callback is called for
// every state that matches @mask.
//
// Probes are called in groups: First GST_PAD_PROBE_TYPE_BLOCK probes are
// called, then others, then finally GST_PAD_PROBE_TYPE_IDLE. The only
// exception here are GST_PAD_PROBE_TYPE_IDLE probes that are called
// immediately if the pad is already idle while calling gst_pad_add_probe().
// In each of the groups, probes are called in the order in which they were
// added.
AddProbe(PadProbeType, PadProbeCallback) uint32
// CanLink wraps gst_pad_can_link
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the source pad and the sink pad are compatible so they can be
// linked.
CanLink(Pad) bool
// Chain wraps gst_pad_chain
//
// The function takes the following parameters:
//
// - buffer *Buffer: the #GstBuffer to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Chain a buffer to @pad.
//
// The function returns #GST_FLOW_FLUSHING if the pad was flushing.
//
// If the buffer type is not acceptable for @pad (as negotiated with a
// preceding GST_EVENT_CAPS event), this function returns
// #GST_FLOW_NOT_NEGOTIATED.
//
// The function proceeds calling the chain function installed on @pad (see
// gst_pad_set_chain_function()) and the return value of that function is
// returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
// chain function.
//
// In all cases, success or failure, the caller loses its reference to @buffer
// after calling this function.
Chain(*Buffer) FlowReturn
// ChainList wraps gst_pad_chain_list
//
// The function takes the following parameters:
//
// - list *BufferList: the #GstBufferList to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Chain a bufferlist to @pad.
//
// The function returns #GST_FLOW_FLUSHING if the pad was flushing.
//
// If @pad was not negotiated properly with a CAPS event, this function
// returns #GST_FLOW_NOT_NEGOTIATED.
//
// The function proceeds calling the chainlist function installed on @pad (see
// gst_pad_set_chain_list_function()) and the return value of that function is
// returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
// chainlist function.
//
// In all cases, success or failure, the caller loses its reference to @list
// after calling this function.
//
// MT safe.
ChainList(*BufferList) FlowReturn
// CheckReconfigure wraps gst_pad_check_reconfigure
// The function returns the following values:
//
// - goret bool
//
// Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
// if the flag was set.
CheckReconfigure() bool
// CreateStreamID wraps gst_pad_create_stream_id
//
// The function takes the following parameters:
//
// - parent Element: Parent #GstElement of @pad
// - streamId string (nullable): The stream-id
//
// The function returns the following values:
//
// - goret string
//
// Creates a stream-id for the source #GstPad @pad by combining the
// upstream information with the optional @stream_id of the stream
// of @pad. @pad must have a parent #GstElement and which must have zero
// or one sinkpad. @stream_id can only be %NULL if the parent element
// of @pad has only a single source pad.
//
// This function generates an unique stream-id by getting the upstream
// stream-start event stream ID and appending @stream_id to it. If the
// element has no sinkpad it will generate an upstream stream-id by
// doing an URI query on the element and in the worst case just uses
// a random number. Source elements that don't implement the URI
// handler interface should ideally generate a unique, deterministic
// stream-id manually instead.
//
// Since stream IDs are sorted alphabetically, any numbers in the
// stream ID should be printed with a fixed number of characters,
// preceded by 0's, such as by using the format \%03u instead of \%u.
CreateStreamID(Element, string) string
// EventDefault wraps gst_pad_event_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
// - event *Event: the #GstEvent to handle.
//
// The function returns the following values:
//
// - goret bool
//
// Invokes the default event handler for the given pad.
//
// The EOS event will pause the task associated with @pad before it is forwarded
// to all internally linked pads,
//
// The event is sent to all pads internally linked to @pad. This function
// takes ownership of @event.
EventDefault(Object, *Event) bool
// Forward wraps gst_pad_forward
//
// The function takes the following parameters:
//
// - forward PadForwardFunction: a #GstPadForwardFunction
//
// The function returns the following values:
//
// - goret bool
//
// Calls @forward for all internally linked pads of @pad. This function deals with
// dynamically changing internal pads and will make sure that the @forward
// function is only called once for each pad.
//
// When @forward returns %TRUE, no further pads will be processed.
Forward(PadForwardFunction) bool
// GetAllowedCaps wraps gst_pad_get_allowed_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the allowed media types that can flow through
// @pad and its peer.
//
// The allowed capabilities is calculated as the intersection of the results of
// calling gst_pad_query_caps() on @pad and its peer. The caller owns a reference
// on the resulting caps.
GetAllowedCaps() *Caps
// GetCurrentCaps wraps gst_pad_get_current_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities currently configured on @pad with the last
// #GST_EVENT_CAPS event.
GetCurrentCaps() *Caps
// GetDirection wraps gst_pad_get_direction
// The function returns the following values:
//
// - goret PadDirection
//
// Gets the direction of the pad. The direction of the pad is
// 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:
//
// - goret FlowReturn
//
// Gets the #GstFlowReturn return from the last data passed by this pad.
GetLastFlowReturn() FlowReturn
// GetOffset wraps gst_pad_get_offset
// The function returns the following values:
//
// - goret int64
//
// Get the offset applied to the running time of @pad. @pad has to be a source
// pad.
GetOffset() int64
// GetPadTemplate wraps gst_pad_get_pad_template
// The function returns the following values:
//
// - goret PadTemplate
//
// Gets the template for @pad.
GetPadTemplate() PadTemplate
// GetPadTemplateCaps wraps gst_pad_get_pad_template_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities for @pad's template.
GetPadTemplateCaps() *Caps
// GetParentElement wraps gst_pad_get_parent_element
// The function returns the following values:
//
// - goret Element
//
// Gets the parent of @pad, cast to a #GstElement. If a @pad has no parent or
// its parent is not an element, return %NULL.
GetParentElement() Element
// GetPeer wraps gst_pad_get_peer
// The function returns the following values:
//
// - goret Pad
//
// Gets the peer of @pad. This function refs the peer pad so
// you need to unref it after use.
GetPeer() Pad
// GetRange wraps gst_pad_get_range
//
// The function takes the following parameters:
//
// - offset uint64: The start offset of the buffer
// - size uint: The length of the buffer
//
// The function returns the following values:
//
// - buffer *Buffer: a pointer to hold the #GstBuffer,
// returns #GST_FLOW_ERROR if %NULL.
// - goret FlowReturn
//
// When @pad is flushing this function returns #GST_FLOW_FLUSHING
// immediately and @buffer is %NULL.
//
// Calls the getrange function of @pad, see #GstPadGetRangeFunction for a
// description of a getrange function. If @pad has no getrange function
// installed (see gst_pad_set_getrange_function()) this function returns
// #GST_FLOW_NOT_SUPPORTED.
//
// If @buffer points to a variable holding %NULL, a valid new #GstBuffer will be
// placed in @buffer when this function returns #GST_FLOW_OK. The new buffer
// must be freed with gst_buffer_unref() after usage.
//
// When @buffer points to a variable that points to a valid #GstBuffer, the
// buffer will be filled with the result data when this function returns
// #GST_FLOW_OK. If the provided buffer is larger than @size, only
// @size bytes will be filled in the result buffer and its size will be updated
// accordingly.
//
// Note that less than @size bytes can be returned in @buffer when, for example,
// an EOS condition is near or when @buffer is not large enough to hold @size
// bytes. The caller should check the result buffer size to get the result size.
//
// When this function returns any other result value than #GST_FLOW_OK, @buffer
// will be unchanged.
//
// This is a lowlevel function. Usually gst_pad_pull_range() is used.
GetRange(uint64, uint) (*Buffer, FlowReturn)
// GetSingleInternalLink wraps gst_pad_get_single_internal_link
// The function returns the following values:
//
// - goret Pad
//
// If there is a single internal link of the given pad, this function will
// return it. Otherwise, it will return NULL.
GetSingleInternalLink() Pad
// GetStickyEvent wraps gst_pad_get_sticky_event
//
// The function takes the following parameters:
//
// - eventType EventType: the #GstEventType that should be retrieved.
// - idx uint: the index of the event
//
// The function returns the following values:
//
// - goret *Event
//
// Returns a new reference of the sticky event of type @event_type
// from the event.
GetStickyEvent(EventType, uint) *Event
// GetStream wraps gst_pad_get_stream
// The function returns the following values:
//
// - goret Stream
//
// Returns the current #GstStream for the @pad, or %NULL if none has been
// set yet, i.e. the pad has not received a stream-start event yet.
//
// This is a convenience wrapper around gst_pad_get_sticky_event() and
// gst_event_parse_stream().
GetStream() Stream
// GetStreamID wraps gst_pad_get_stream_id
// The function returns the following values:
//
// - goret string
//
// Returns the current stream-id for the @pad, or %NULL if none has been
// set yet, i.e. the pad has not received a stream-start event yet.
//
// This is a convenience wrapper around gst_pad_get_sticky_event() and
// gst_event_parse_stream_start().
//
// The returned stream-id string should be treated as an opaque string, its
// contents should not be interpreted.
GetStreamID() string
// GetTaskState wraps gst_pad_get_task_state
// The function returns the following values:
//
// - goret TaskState
//
// Get @pad task state. If no task is currently
// set, #GST_TASK_STOPPED is returned.
GetTaskState() TaskState
// HasCurrentCaps wraps gst_pad_has_current_caps
// The function returns the following values:
//
// - goret bool
//
// Check if @pad has caps set on it with a #GST_EVENT_CAPS event.
HasCurrentCaps() bool
// IsActive wraps gst_pad_is_active
// The function returns the following values:
//
// - goret bool
//
// Query if a pad is active
IsActive() bool
// IsBlocked wraps gst_pad_is_blocked
// The function returns the following values:
//
// - goret bool
//
// Checks if the pad is blocked or not. This function returns the
// last requested state of the pad. It is not certain that the pad
// is actually blocking at this point (see gst_pad_is_blocking()).
IsBlocked() bool
// IsBlocking wraps gst_pad_is_blocking
// The function returns the following values:
//
// - goret bool
//
// Checks if the pad is blocking or not. This is a guaranteed state
// of whether the pad is actually blocking on a #GstBuffer or a #GstEvent.
IsBlocking() bool
// IsLinked wraps gst_pad_is_linked
// The function returns the following values:
//
// - goret bool
//
// Checks if a @pad is linked to another pad or not.
IsLinked() bool
// IterateInternalLinks wraps gst_pad_iterate_internal_links
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the pads to which the given pad is linked to inside
// of the parent element.
//
// Each #GstPad element yielded by the iterator will have its refcount increased,
// so unref after use.
//
// Free-function: gst_iterator_free
IterateInternalLinks() *Iterator
// IterateInternalLinksDefault wraps gst_pad_iterate_internal_links_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
//
// The function returns the following values:
//
// - goret *Iterator
//
// Iterate the list of pads to which the given pad is linked to inside of
// the parent element.
// This is the default handler, and thus returns an iterator of all of the
// pads inside the parent element with opposite direction.
//
// The caller must free this iterator after use with gst_iterator_free().
IterateInternalLinksDefault(Object) *Iterator
// Link wraps gst_pad_link
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to link.
//
// The function returns the following values:
//
// - goret PadLinkReturn
//
// Links the source pad and the sink pad.
Link(Pad) PadLinkReturn
// LinkFull wraps gst_pad_link_full
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to link.
// - flags PadLinkCheck: the checks to validate when linking
//
// The function returns the following values:
//
// - goret PadLinkReturn
//
// Links the source pad and the sink pad.
//
// This variant of #gst_pad_link provides a more granular control on the
// checks being done when linking. While providing some considerable speedups
// the caller of this method must be aware that wrong usage of those flags
// can cause severe issues. Refer to the documentation of #GstPadLinkCheck
// for more information.
//
// MT Safe.
LinkFull(Pad, PadLinkCheck) PadLinkReturn
// LinkMaybeGhosting wraps gst_pad_link_maybe_ghosting
//
// The function takes the following parameters:
//
// - sink Pad: a #GstPad
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @sink, creating any #GstGhostPad's in between as necessary.
//
// This is a convenience function to save having to create and add intermediate
// #GstGhostPad's as required for linking across #GstBin boundaries.
//
// If @src or @sink pads don't have parent elements or do not share a common
// ancestor, the link will fail.
LinkMaybeGhosting(Pad) bool
// LinkMaybeGhostingFull wraps gst_pad_link_maybe_ghosting_full
//
// The function takes the following parameters:
//
// - sink Pad: a #GstPad
// - flags PadLinkCheck: some #GstPadLinkCheck flags
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @sink, creating any #GstGhostPad's in between as necessary.
//
// This is a convenience function to save having to create and add intermediate
// #GstGhostPad's as required for linking across #GstBin boundaries.
//
// If @src or @sink pads don't have parent elements or do not share a common
// ancestor, the link will fail.
//
// Calling gst_pad_link_maybe_ghosting_full() with
// @flags == %GST_PAD_LINK_CHECK_DEFAULT is the recommended way of linking
// pads with safety checks applied.
LinkMaybeGhostingFull(Pad, PadLinkCheck) bool
// MarkReconfigure wraps gst_pad_mark_reconfigure
//
// Mark a pad for needing reconfiguration. The next call to
// gst_pad_check_reconfigure() will return %TRUE after this call.
MarkReconfigure()
// NeedsReconfigure wraps gst_pad_needs_reconfigure
// The function returns the following values:
//
// - goret bool
//
// Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
// if the flag was set.
NeedsReconfigure() bool
// PauseTask wraps gst_pad_pause_task
// The function returns the following values:
//
// - goret bool
//
// Pause the task of @pad. This function will also wait until the
// function executed by the task is finished if this function is not
// called from the task function.
PauseTask() bool
// PeerQuery wraps gst_pad_peer_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery to perform.
//
// The function returns the following values:
//
// - goret bool
//
// Performs gst_pad_query() on the peer of @pad.
//
// The caller is responsible for both the allocation and deallocation of
// the query structure.
PeerQuery(*Query) bool
// PeerQueryAcceptCaps wraps gst_pad_peer_query_accept_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a #GstCaps to check on the pad
//
// The function returns the following values:
//
// - goret bool
//
// Check if the peer of @pad accepts @caps. If @pad has no peer, this function
// returns %TRUE.
PeerQueryAcceptCaps(*Caps) bool
// PeerQueryCaps wraps gst_pad_peer_query_caps
//
// The function takes the following parameters:
//
// - filter *Caps (nullable): a #GstCaps filter, or %NULL.
//
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the peer connected to this pad. Similar to
// gst_pad_query_caps().
//
// When called on srcpads @filter contains the caps that
// upstream could produce in the order preferred by upstream. When
// called on sinkpads @filter contains the caps accepted by
// downstream in the preferred order. @filter might be %NULL but
// if it is not %NULL the returned caps will be a subset of @filter.
PeerQueryCaps(*Caps) *Caps
// PeerQueryConvert wraps gst_pad_peer_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries the peer pad of a given sink pad to convert @src_val in @src_format
// to @dest_format.
PeerQueryConvert(Format, int64, Format) (int64, bool)
// PeerQueryDuration wraps gst_pad_peer_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: a location in which to store the total
// duration, or %NULL.
// - goret bool
//
// Queries the peer pad of a given sink pad for the total stream duration.
PeerQueryDuration(Format) (int64, bool)
// PeerQueryPosition wraps gst_pad_peer_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: a location in which to store the current
// position, or %NULL.
// - goret bool
//
// Queries the peer of a given sink pad for the stream position.
PeerQueryPosition(Format) (int64, bool)
// ProxyQueryAcceptCaps wraps gst_pad_proxy_query_accept_caps
//
// The function takes the following parameters:
//
// - query *Query: an ACCEPT_CAPS #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if all internally linked pads of @pad accepts the caps in @query and
// returns the intersection of the results.
//
// This function is useful as a default accept caps query function for an element
// that can handle any stream format, but requires caps that are acceptable for
// all opposite pads.
ProxyQueryAcceptCaps(*Query) bool
// ProxyQueryCaps wraps gst_pad_proxy_query_caps
//
// The function takes the following parameters:
//
// - query *Query: a CAPS #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Calls gst_pad_query_caps() for all internally linked pads of @pad and returns
// the intersection of the results.
//
// This function is useful as a default caps query function for an element
// that can handle any stream format, but requires all its pads to have
// the same caps. Two such elements are tee and adder.
ProxyQueryCaps(*Query) bool
// PullRange wraps gst_pad_pull_range
//
// The function takes the following parameters:
//
// - offset uint64: The start offset of the buffer
// - size uint: The length of the buffer
//
// The function returns the following values:
//
// - buffer *Buffer: a pointer to hold the #GstBuffer, returns
// GST_FLOW_ERROR if %NULL.
// - goret FlowReturn
//
// Pulls a @buffer from the peer pad or fills up a provided buffer.
//
// This function will first trigger the pad block signal if it was
// installed.
//
// When @pad is not linked #GST_FLOW_NOT_LINKED is returned else this
// function returns the result of gst_pad_get_range() on the peer pad.
// See gst_pad_get_range() for a list of return values and for the
// semantics of the arguments of this function.
//
// If @buffer points to a variable holding %NULL, a valid new #GstBuffer will be
// placed in @buffer when this function returns #GST_FLOW_OK. The new buffer
// must be freed with gst_buffer_unref() after usage. When this function
// returns any other result value, @buffer will still point to %NULL.
//
// When @buffer points to a variable that points to a valid #GstBuffer, the
// buffer will be filled with the result data when this function returns
// #GST_FLOW_OK. When this function returns any other result value,
// @buffer will be unchanged. If the provided buffer is larger than @size, only
// @size bytes will be filled in the result buffer and its size will be updated
// accordingly.
//
// Note that less than @size bytes can be returned in @buffer when, for example,
// an EOS condition is near or when @buffer is not large enough to hold @size
// bytes. The caller should check the result buffer size to get the result size.
PullRange(uint64, uint) (*Buffer, FlowReturn)
// Push wraps gst_pad_push
//
// The function takes the following parameters:
//
// - buffer *Buffer: the #GstBuffer to push returns GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Pushes a buffer to the peer of @pad.
//
// This function will call installed block probes before triggering any
// installed data probes.
//
// The function proceeds calling gst_pad_chain() on the peer pad and returns
// the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
// be returned.
//
// In all cases, success or failure, the caller loses its reference to @buffer
// after calling this function.
Push(*Buffer) FlowReturn
// PushEvent wraps gst_pad_push_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the pad.
//
// The function returns the following values:
//
// - goret bool
//
// Sends the event to the peer of the given pad. This function is
// mainly used by elements to send events to their peer
// elements.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
PushEvent(*Event) bool
// PushList wraps gst_pad_push_list
//
// The function takes the following parameters:
//
// - list *BufferList: the #GstBufferList to push returns GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Pushes a buffer list to the peer of @pad.
//
// This function will call installed block probes before triggering any
// installed data probes.
//
// The function proceeds calling the chain function on the peer pad and returns
// the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
// be returned. If the peer pad does not have any installed chainlist function
// every group buffer of the list will be merged into a normal #GstBuffer and
// chained via gst_pad_chain().
//
// In all cases, success or failure, the caller loses its reference to @list
// after calling this function.
PushList(*BufferList) FlowReturn
// Query wraps gst_pad_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery to perform.
//
// The function returns the following values:
//
// - goret bool
//
// Dispatches a query to a pad. The query should have been allocated by the
// caller via one of the type-specific allocation functions. The element that
// the pad belongs to is responsible for filling the query with an appropriate
// response, which should then be parsed with a type-specific query parsing
// function.
//
// Again, the caller is responsible for both the allocation and deallocation of
// the query structure.
//
// Please also note that some queries might need a running pipeline to work.
Query(*Query) bool
// QueryAcceptCaps wraps gst_pad_query_accept_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a #GstCaps to check on the pad
//
// The function returns the following values:
//
// - goret bool
//
// Check if the given pad accepts the caps.
QueryAcceptCaps(*Caps) bool
// QueryCaps wraps gst_pad_query_caps
//
// The function takes the following parameters:
//
// - filter *Caps (nullable): suggested #GstCaps, or %NULL
//
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities this pad can produce or consume.
// Note that this method doesn't necessarily return the caps set by sending a
// gst_event_new_caps() - use gst_pad_get_current_caps() for that instead.
// gst_pad_query_caps returns all possible caps a pad can operate with, using
// the pad's CAPS query function, If the query fails, this function will return
// @filter, if not %NULL, otherwise ANY.
//
// When called on sinkpads @filter contains the caps that
// upstream could produce in the order preferred by upstream. When
// called on srcpads @filter contains the caps accepted by
// downstream in the preferred order. @filter might be %NULL but
// if it is not %NULL the returned caps will be a subset of @filter.
//
// Note that this function does not return writable #GstCaps, use
// gst_caps_make_writable() before modifying the caps.
QueryCaps(*Caps) *Caps
// QueryConvert wraps gst_pad_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries a pad to convert @src_val in @src_format to @dest_format.
QueryConvert(Format, int64, Format) (int64, bool)
// QueryDefault wraps gst_pad_query_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
// - query *Query: the #GstQuery to handle.
//
// The function returns the following values:
//
// - goret bool
//
// Invokes the default query handler for the given pad.
// The query is sent to all pads internally linked to @pad. Note that
// if there are many possible sink pads that are internally linked to
// @pad, only one will be sent the query.
// Multi-sinkpad elements should implement custom query handlers.
QueryDefault(Object, *Query) bool
// QueryDuration wraps gst_pad_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: a location in which to store the total
// duration, or %NULL.
// - goret bool
//
// Queries a pad for the total stream duration.
QueryDuration(Format) (int64, bool)
// QueryPosition wraps gst_pad_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: A location in which to store the current position, or %NULL.
// - goret bool
//
// Queries a pad for the stream position.
QueryPosition(Format) (int64, bool)
// RemoveProbe wraps gst_pad_remove_probe
//
// The function takes the following parameters:
//
// - id uint32: the probe id to remove
//
// Remove the probe with @id from @pad.
//
// MT safe.
RemoveProbe(uint32)
// SendEvent wraps gst_pad_send_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the pad.
//
// The function returns the following values:
//
// - goret bool
//
// Sends the event to the pad. This function can be used
// by applications to send events in the pipeline.
//
// If @pad is a source pad, @event should be an upstream event. If @pad is a
// sink pad, @event should be a downstream event. For example, you would not
// send a #GST_EVENT_EOS on a src pad; EOS events only propagate downstream.
// Furthermore, some downstream events have to be serialized with data flow,
// like EOS, while some can travel out-of-band, like #GST_EVENT_FLUSH_START. If
// the event needs to be serialized with data flow, this function will take the
// pad's stream lock while calling its event function.
//
// To find out whether an event type is upstream, downstream, or downstream and
// serialized, see #GstEventTypeFlags, gst_event_type_get_flags(),
// #GST_EVENT_IS_UPSTREAM, #GST_EVENT_IS_DOWNSTREAM, and
// #GST_EVENT_IS_SERIALIZED. Note that in practice that an application or
// plugin doesn't need to bother itself with this information; the core handles
// all necessary locks and checks.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
SendEvent(*Event) bool
// SetActive wraps gst_pad_set_active
//
// The function takes the following parameters:
//
// - active bool: whether or not the pad should be active.
//
// The function returns the following values:
//
// - goret bool
//
// Activates or deactivates the given pad.
// Normally called from within core state change functions.
//
// If @active, makes sure the pad is active. If it is already active, either in
// push or pull mode, just return. Otherwise dispatches to the pad's activate
// function to perform the actual activation.
//
// 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:
//
// - offset int64: the offset
//
// Set the offset that will be applied to the running time of @pad.
SetOffset(int64)
// StartTask wraps gst_pad_start_task
//
// The function takes the following parameters:
//
// - fn TaskFunction: the task function to call
//
// The function returns the following values:
//
// - goret bool
//
// Starts a task that repeatedly calls @func with @user_data. This function
// is mostly used in pad activation functions to start the dataflow.
// The #GST_PAD_STREAM_LOCK of @pad will automatically be acquired
// before @func is called.
StartTask(TaskFunction) bool
// StopTask wraps gst_pad_stop_task
// The function returns the following values:
//
// - goret bool
//
// Stop the task of @pad. This function will also make sure that the
// function executed by the task will effectively stop if not called
// from the GstTaskFunction.
//
// This function will deadlock if called from the GstTaskFunction of
// the task. Use gst_task_pause() instead.
//
// Regardless of whether the pad has a task, the stream lock is acquired and
// released so as to ensure that streaming through this pad has finished.
StopTask() bool
// StoreStickyEvent wraps gst_pad_store_sticky_event
//
// The function takes the following parameters:
//
// - event *Event: a #GstEvent
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Store the sticky @event on @pad
StoreStickyEvent(*Event) FlowReturn
// Unlink wraps gst_pad_unlink
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to unlink.
//
// The function returns the following values:
//
// - goret bool
//
// Unlinks the source pad from the sink pad. Will emit the #GstPad::unlinked
// signal on both pads.
Unlink(Pad) bool
// UseFixedCaps wraps gst_pad_use_fixed_caps
//
// A helper function you can use that sets the FIXED_CAPS flag
// This way the default CAPS query will always return the negotiated caps
// or in case the pad is not negotiated, the padtemplate caps.
//
// The negotiated caps are the caps of the last CAPS event that passed on the
// pad. Use this function on a pad that, once it negotiated to a CAPS, cannot
// be renegotiated to something else.
UseFixedCaps()
}
func unsafeWrapPad(base *gobject.ObjectInstance) *PadInstance {
return &PadInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalPadInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPad(gobject.ValueFromNative(p).Object()), nil
}
// UnsafePadFromGlibNone is used to convert raw GstPad pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePadFromGlibNone(c unsafe.Pointer) Pad {
return gobject.UnsafeObjectFromGlibNone(c).(Pad)
}
// UnsafePadFromGlibFull is used to convert raw GstPad pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePadFromGlibFull(c unsafe.Pointer) Pad {
return gobject.UnsafeObjectFromGlibFull(c).(Pad)
}
func (p *PadInstance) upcastToGstPad() *PadInstance {
return p
}
// UnsafePadToGlibNone is used to convert the instance to it's C value GstPad. This is used by the bindings internally.
func UnsafePadToGlibNone(c Pad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafePadToGlibFull is used to convert the instance to it's C value GstPad, while removeing the finalizer. This is used by the bindings internally.
func UnsafePadToGlibFull(c Pad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewPad wraps gst_pad_new
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new pad.
// - direction PadDirection: the #GstPadDirection of the pad.
//
// The function returns the following values:
//
// - goret Pad
//
// Creates a new pad with the given name in the given direction.
// If name is %NULL, a guaranteed unique name (across all pads)
// will be assigned.
// This function makes a copy of the name so you can safely free the name.
func NewPad(name string, direction PadDirection) Pad {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 C.GstPadDirection // in, none, casted
var cret *C.GstPad // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = C.GstPadDirection(direction)
cret = C.gst_pad_new(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(direction)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewPadFromStaticTemplate wraps gst_pad_new_from_static_template
//
// The function takes the following parameters:
//
// - templ *StaticPadTemplate: the #GstStaticPadTemplate to use
// - name string: the name of the pad
//
// The function returns the following values:
//
// - goret Pad
//
// Creates a new pad with the given name from the given static template.
// If name is %NULL, a guaranteed unique name (across all pads)
// will be assigned.
// This function makes a copy of the name so you can safely free the name.
func NewPadFromStaticTemplate(templ *StaticPadTemplate, name string) Pad {
var carg1 *C.GstStaticPadTemplate // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPad // return, none, converted
carg1 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(templ))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_pad_new_from_static_template(carg1, carg2)
runtime.KeepAlive(templ)
runtime.KeepAlive(name)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewPadFromTemplate wraps gst_pad_new_from_template
//
// The function takes the following parameters:
//
// - templ PadTemplate: the pad template to use
// - name string (nullable): the name of the pad
//
// The function returns the following values:
//
// - goret Pad
//
// Creates a new pad with the given name from the given template.
// If name is %NULL, a guaranteed unique name (across all pads)
// will be assigned.
// This function makes a copy of the name so you can safely free the name.
func NewPadFromTemplate(templ PadTemplate, name string) Pad {
var carg1 *C.GstPadTemplate // in, none, converted
var carg2 *C.gchar // in, none, string, nullable-string
var cret *C.GstPad // return, none, converted
carg1 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
if name != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
}
cret = C.gst_pad_new_from_template(carg1, carg2)
runtime.KeepAlive(templ)
runtime.KeepAlive(name)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// PadLinkGetName wraps gst_pad_link_get_name
//
// The function takes the following parameters:
//
// - ret PadLinkReturn: a #GstPadLinkReturn to get the name of.
//
// The function returns the following values:
//
// - goret string
//
// Gets a string representing the given pad-link return.
func PadLinkGetName(ret PadLinkReturn) string {
var carg1 C.GstPadLinkReturn // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = C.GstPadLinkReturn(ret)
cret = C.gst_pad_link_get_name(carg1)
runtime.KeepAlive(ret)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// ActivateMode wraps gst_pad_activate_mode
//
// The function takes the following parameters:
//
// - mode PadMode: the requested activation mode
// - active bool: whether or not the pad should be active.
//
// The function returns the following values:
//
// - goret bool
//
// Activates or deactivates the given pad in @mode via dispatching to the
// pad's activatemodefunc. For use from within pad activation functions only.
//
// If you don't know what this is, you probably don't want to call it.
func (pad *PadInstance) ActivateMode(mode PadMode, active bool) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstPadMode // in, none, casted
var carg2 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstPadMode(mode)
if active {
carg2 = C.TRUE
}
cret = C.gst_pad_activate_mode(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(mode)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AddProbe wraps gst_pad_add_probe
//
// The function takes the following parameters:
//
// - mask PadProbeType: the probe mask
// - callback PadProbeCallback: #GstPadProbeCallback that will be called with notifications of
// the pad state
//
// The function returns the following values:
//
// - goret uint32
//
// Be notified of different states of pads. The provided callback is called for
// every state that matches @mask.
//
// Probes are called in groups: First GST_PAD_PROBE_TYPE_BLOCK probes are
// called, then others, then finally GST_PAD_PROBE_TYPE_IDLE. The only
// exception here are GST_PAD_PROBE_TYPE_IDLE probes that are called
// immediately if the pad is already idle while calling gst_pad_add_probe().
// In each of the groups, probes are called in the order in which they were
// added.
func (pad *PadInstance) AddProbe(mask PadProbeType, callback PadProbeCallback) uint32 {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstPadProbeType // in, none, casted
var carg2 C.GstPadProbeCallback // callback, scope: notified, closure: carg3, destroy: carg4
var carg3 C.gpointer // implicit
var carg4 C.GDestroyNotify // implicit
var cret C.gulong // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstPadProbeType(mask)
carg2 = (*[0]byte)(C._gotk4_gst1_PadProbeCallback)
carg3 = C.gpointer(userdata.Register(callback))
carg4 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_pad_add_probe(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(pad)
runtime.KeepAlive(mask)
runtime.KeepAlive(callback)
var goret uint32
goret = uint32(cret)
return goret
}
// CanLink wraps gst_pad_can_link
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the source pad and the sink pad are compatible so they can be
// linked.
func (srcpad *PadInstance) CanLink(sinkpad Pad) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(srcpad))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sinkpad))
cret = C.gst_pad_can_link(carg0, carg1)
runtime.KeepAlive(srcpad)
runtime.KeepAlive(sinkpad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Chain wraps gst_pad_chain
//
// The function takes the following parameters:
//
// - buffer *Buffer: the #GstBuffer to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Chain a buffer to @pad.
//
// The function returns #GST_FLOW_FLUSHING if the pad was flushing.
//
// If the buffer type is not acceptable for @pad (as negotiated with a
// preceding GST_EVENT_CAPS event), this function returns
// #GST_FLOW_NOT_NEGOTIATED.
//
// The function proceeds calling the chain function installed on @pad (see
// gst_pad_set_chain_function()) and the return value of that function is
// returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
// chain function.
//
// In all cases, success or failure, the caller loses its reference to @buffer
// after calling this function.
func (pad *PadInstance) Chain(buffer *Buffer) FlowReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstBuffer // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buffer))
cret = C.gst_pad_chain(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(buffer)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// ChainList wraps gst_pad_chain_list
//
// The function takes the following parameters:
//
// - list *BufferList: the #GstBufferList to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Chain a bufferlist to @pad.
//
// The function returns #GST_FLOW_FLUSHING if the pad was flushing.
//
// If @pad was not negotiated properly with a CAPS event, this function
// returns #GST_FLOW_NOT_NEGOTIATED.
//
// The function proceeds calling the chainlist function installed on @pad (see
// gst_pad_set_chain_list_function()) and the return value of that function is
// returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
// chainlist function.
//
// In all cases, success or failure, the caller loses its reference to @list
// after calling this function.
//
// MT safe.
func (pad *PadInstance) ChainList(list *BufferList) FlowReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstBufferList // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstBufferList)(UnsafeBufferListToGlibFull(list))
cret = C.gst_pad_chain_list(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(list)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// CheckReconfigure wraps gst_pad_check_reconfigure
// The function returns the following values:
//
// - goret bool
//
// Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
// if the flag was set.
func (pad *PadInstance) CheckReconfigure() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_check_reconfigure(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CreateStreamID wraps gst_pad_create_stream_id
//
// The function takes the following parameters:
//
// - parent Element: Parent #GstElement of @pad
// - streamId string (nullable): The stream-id
//
// The function returns the following values:
//
// - goret string
//
// Creates a stream-id for the source #GstPad @pad by combining the
// upstream information with the optional @stream_id of the stream
// of @pad. @pad must have a parent #GstElement and which must have zero
// or one sinkpad. @stream_id can only be %NULL if the parent element
// of @pad has only a single source pad.
//
// This function generates an unique stream-id by getting the upstream
// stream-start event stream ID and appending @stream_id to it. If the
// element has no sinkpad it will generate an upstream stream-id by
// doing an URI query on the element and in the worst case just uses
// a random number. Source elements that don't implement the URI
// handler interface should ideally generate a unique, deterministic
// stream-id manually instead.
//
// Since stream IDs are sorted alphabetically, any numbers in the
// stream ID should be printed with a fixed number of characters,
// preceded by 0's, such as by using the format \%03u instead of \%u.
func (pad *PadInstance) CreateStreamID(parent Element, streamId string) string {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstElement // in, none, converted
var carg2 *C.gchar // in, none, string, nullable-string
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(parent))
if streamId != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(streamId)))
defer C.free(unsafe.Pointer(carg2))
}
cret = C.gst_pad_create_stream_id(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(streamId)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// EventDefault wraps gst_pad_event_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
// - event *Event: the #GstEvent to handle.
//
// The function returns the following values:
//
// - goret bool
//
// Invokes the default event handler for the given pad.
//
// The EOS event will pause the task associated with @pad before it is forwarded
// to all internally linked pads,
//
// The event is sent to all pads internally linked to @pad. This function
// takes ownership of @event.
func (pad *PadInstance) EventDefault(parent Object, event *Event) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstEvent // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg2 = (*C.GstEvent)(UnsafeEventToGlibFull(event))
cret = C.gst_pad_event_default(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(event)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Forward wraps gst_pad_forward
//
// The function takes the following parameters:
//
// - forward PadForwardFunction: a #GstPadForwardFunction
//
// The function returns the following values:
//
// - goret bool
//
// Calls @forward for all internally linked pads of @pad. This function deals with
// dynamically changing internal pads and will make sure that the @forward
// function is only called once for each pad.
//
// When @forward returns %TRUE, no further pads will be processed.
func (pad *PadInstance) Forward(forward PadForwardFunction) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstPadForwardFunction // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*[0]byte)(C._gotk4_gst1_PadForwardFunction)
carg2 = C.gpointer(userdata.Register(forward))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_pad_forward(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(forward)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetAllowedCaps wraps gst_pad_get_allowed_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the allowed media types that can flow through
// @pad and its peer.
//
// The allowed capabilities is calculated as the intersection of the results of
// calling gst_pad_query_caps() on @pad and its peer. The caller owns a reference
// on the resulting caps.
func (pad *PadInstance) GetAllowedCaps() *Caps {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_allowed_caps(carg0)
runtime.KeepAlive(pad)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCurrentCaps wraps gst_pad_get_current_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities currently configured on @pad with the last
// #GST_EVENT_CAPS event.
func (pad *PadInstance) GetCurrentCaps() *Caps {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_current_caps(carg0)
runtime.KeepAlive(pad)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetDirection wraps gst_pad_get_direction
// The function returns the following values:
//
// - goret PadDirection
//
// Gets the direction of the pad. The direction of the pad is
// decided at construction time so this function does not take
// the LOCK.
func (pad *PadInstance) GetDirection() PadDirection {
var carg0 *C.GstPad // in, none, converted
var cret C.GstPadDirection // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_direction(carg0)
runtime.KeepAlive(pad)
var goret PadDirection
goret = PadDirection(cret)
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:
//
// - goret FlowReturn
//
// Gets the #GstFlowReturn return from the last data passed by this pad.
func (pad *PadInstance) GetLastFlowReturn() FlowReturn {
var carg0 *C.GstPad // in, none, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_last_flow_return(carg0)
runtime.KeepAlive(pad)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// GetOffset wraps gst_pad_get_offset
// The function returns the following values:
//
// - goret int64
//
// Get the offset applied to the running time of @pad. @pad has to be a source
// pad.
func (pad *PadInstance) GetOffset() int64 {
var carg0 *C.GstPad // in, none, converted
var cret C.gint64 // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_offset(carg0)
runtime.KeepAlive(pad)
var goret int64
goret = int64(cret)
return goret
}
// GetPadTemplate wraps gst_pad_get_pad_template
// The function returns the following values:
//
// - goret PadTemplate
//
// Gets the template for @pad.
func (pad *PadInstance) GetPadTemplate() PadTemplate {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstPadTemplate // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_pad_template(carg0)
runtime.KeepAlive(pad)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetPadTemplateCaps wraps gst_pad_get_pad_template_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities for @pad's template.
func (pad *PadInstance) GetPadTemplateCaps() *Caps {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_pad_template_caps(carg0)
runtime.KeepAlive(pad)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetParentElement wraps gst_pad_get_parent_element
// The function returns the following values:
//
// - goret Element
//
// Gets the parent of @pad, cast to a #GstElement. If a @pad has no parent or
// its parent is not an element, return %NULL.
func (pad *PadInstance) GetParentElement() Element {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstElement // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_parent_element(carg0)
runtime.KeepAlive(pad)
var goret Element
goret = UnsafeElementFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetPeer wraps gst_pad_get_peer
// The function returns the following values:
//
// - goret Pad
//
// Gets the peer of @pad. This function refs the peer pad so
// you need to unref it after use.
func (pad *PadInstance) GetPeer() Pad {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_peer(carg0)
runtime.KeepAlive(pad)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetRange wraps gst_pad_get_range
//
// The function takes the following parameters:
//
// - offset uint64: The start offset of the buffer
// - size uint: The length of the buffer
//
// The function returns the following values:
//
// - buffer *Buffer: a pointer to hold the #GstBuffer,
// returns #GST_FLOW_ERROR if %NULL.
// - goret FlowReturn
//
// When @pad is flushing this function returns #GST_FLOW_FLUSHING
// immediately and @buffer is %NULL.
//
// Calls the getrange function of @pad, see #GstPadGetRangeFunction for a
// description of a getrange function. If @pad has no getrange function
// installed (see gst_pad_set_getrange_function()) this function returns
// #GST_FLOW_NOT_SUPPORTED.
//
// If @buffer points to a variable holding %NULL, a valid new #GstBuffer will be
// placed in @buffer when this function returns #GST_FLOW_OK. The new buffer
// must be freed with gst_buffer_unref() after usage.
//
// When @buffer points to a variable that points to a valid #GstBuffer, the
// buffer will be filled with the result data when this function returns
// #GST_FLOW_OK. If the provided buffer is larger than @size, only
// @size bytes will be filled in the result buffer and its size will be updated
// accordingly.
//
// Note that less than @size bytes can be returned in @buffer when, for example,
// an EOS condition is near or when @buffer is not large enough to hold @size
// bytes. The caller should check the result buffer size to get the result size.
//
// When this function returns any other result value than #GST_FLOW_OK, @buffer
// will be unchanged.
//
// This is a lowlevel function. Usually gst_pad_pull_range() is used.
func (pad *PadInstance) GetRange(offset uint64, size uint) (*Buffer, FlowReturn) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.guint64 // in, none, casted
var carg2 C.guint // in, none, casted
var carg3 *C.GstBuffer // out, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.guint64(offset)
carg2 = C.guint(size)
cret = C.gst_pad_get_range(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(pad)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var buffer *Buffer
var goret FlowReturn
buffer = UnsafeBufferFromGlibFull(unsafe.Pointer(carg3))
goret = FlowReturn(cret)
return buffer, goret
}
// GetSingleInternalLink wraps gst_pad_get_single_internal_link
// The function returns the following values:
//
// - goret Pad
//
// If there is a single internal link of the given pad, this function will
// return it. Otherwise, it will return NULL.
func (pad *PadInstance) GetSingleInternalLink() Pad {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_single_internal_link(carg0)
runtime.KeepAlive(pad)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetStickyEvent wraps gst_pad_get_sticky_event
//
// The function takes the following parameters:
//
// - eventType EventType: the #GstEventType that should be retrieved.
// - idx uint: the index of the event
//
// The function returns the following values:
//
// - goret *Event
//
// Returns a new reference of the sticky event of type @event_type
// from the event.
func (pad *PadInstance) GetStickyEvent(eventType EventType, idx uint) *Event {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstEventType // in, none, casted
var carg2 C.guint // in, none, casted
var cret *C.GstEvent // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstEventType(eventType)
carg2 = C.guint(idx)
cret = C.gst_pad_get_sticky_event(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(eventType)
runtime.KeepAlive(idx)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetStream wraps gst_pad_get_stream
// The function returns the following values:
//
// - goret Stream
//
// Returns the current #GstStream for the @pad, or %NULL if none has been
// set yet, i.e. the pad has not received a stream-start event yet.
//
// This is a convenience wrapper around gst_pad_get_sticky_event() and
// gst_event_parse_stream().
func (pad *PadInstance) GetStream() Stream {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstStream // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_stream(carg0)
runtime.KeepAlive(pad)
var goret Stream
goret = UnsafeStreamFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetStreamID wraps gst_pad_get_stream_id
// The function returns the following values:
//
// - goret string
//
// Returns the current stream-id for the @pad, or %NULL if none has been
// set yet, i.e. the pad has not received a stream-start event yet.
//
// This is a convenience wrapper around gst_pad_get_sticky_event() and
// gst_event_parse_stream_start().
//
// The returned stream-id string should be treated as an opaque string, its
// contents should not be interpreted.
func (pad *PadInstance) GetStreamID() string {
var carg0 *C.GstPad // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_stream_id(carg0)
runtime.KeepAlive(pad)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetTaskState wraps gst_pad_get_task_state
// The function returns the following values:
//
// - goret TaskState
//
// Get @pad task state. If no task is currently
// set, #GST_TASK_STOPPED is returned.
func (pad *PadInstance) GetTaskState() TaskState {
var carg0 *C.GstPad // in, none, converted
var cret C.GstTaskState // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_get_task_state(carg0)
runtime.KeepAlive(pad)
var goret TaskState
goret = TaskState(cret)
return goret
}
// HasCurrentCaps wraps gst_pad_has_current_caps
// The function returns the following values:
//
// - goret bool
//
// Check if @pad has caps set on it with a #GST_EVENT_CAPS event.
func (pad *PadInstance) HasCurrentCaps() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_has_current_caps(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsActive wraps gst_pad_is_active
// The function returns the following values:
//
// - goret bool
//
// Query if a pad is active
func (pad *PadInstance) IsActive() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_is_active(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsBlocked wraps gst_pad_is_blocked
// The function returns the following values:
//
// - goret bool
//
// Checks if the pad is blocked or not. This function returns the
// last requested state of the pad. It is not certain that the pad
// is actually blocking at this point (see gst_pad_is_blocking()).
func (pad *PadInstance) IsBlocked() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_is_blocked(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsBlocking wraps gst_pad_is_blocking
// The function returns the following values:
//
// - goret bool
//
// Checks if the pad is blocking or not. This is a guaranteed state
// of whether the pad is actually blocking on a #GstBuffer or a #GstEvent.
func (pad *PadInstance) IsBlocking() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_is_blocking(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsLinked wraps gst_pad_is_linked
// The function returns the following values:
//
// - goret bool
//
// Checks if a @pad is linked to another pad or not.
func (pad *PadInstance) IsLinked() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_is_linked(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IterateInternalLinks wraps gst_pad_iterate_internal_links
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the pads to which the given pad is linked to inside
// of the parent element.
//
// Each #GstPad element yielded by the iterator will have its refcount increased,
// so unref after use.
//
// Free-function: gst_iterator_free
func (pad *PadInstance) IterateInternalLinks() *Iterator {
var carg0 *C.GstPad // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_iterate_internal_links(carg0)
runtime.KeepAlive(pad)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateInternalLinksDefault wraps gst_pad_iterate_internal_links_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
//
// The function returns the following values:
//
// - goret *Iterator
//
// Iterate the list of pads to which the given pad is linked to inside of
// the parent element.
// This is the default handler, and thus returns an iterator of all of the
// pads inside the parent element with opposite direction.
//
// The caller must free this iterator after use with gst_iterator_free().
func (pad *PadInstance) IterateInternalLinksDefault(parent Object) *Iterator {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
cret = C.gst_pad_iterate_internal_links_default(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Link wraps gst_pad_link
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to link.
//
// The function returns the following values:
//
// - goret PadLinkReturn
//
// Links the source pad and the sink pad.
func (srcpad *PadInstance) Link(sinkpad Pad) PadLinkReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.GstPadLinkReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(srcpad))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sinkpad))
cret = C.gst_pad_link(carg0, carg1)
runtime.KeepAlive(srcpad)
runtime.KeepAlive(sinkpad)
var goret PadLinkReturn
goret = PadLinkReturn(cret)
return goret
}
// LinkFull wraps gst_pad_link_full
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to link.
// - flags PadLinkCheck: the checks to validate when linking
//
// The function returns the following values:
//
// - goret PadLinkReturn
//
// Links the source pad and the sink pad.
//
// This variant of #gst_pad_link provides a more granular control on the
// checks being done when linking. While providing some considerable speedups
// the caller of this method must be aware that wrong usage of those flags
// can cause severe issues. Refer to the documentation of #GstPadLinkCheck
// for more information.
//
// MT Safe.
func (srcpad *PadInstance) LinkFull(sinkpad Pad, flags PadLinkCheck) PadLinkReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var carg2 C.GstPadLinkCheck // in, none, casted
var cret C.GstPadLinkReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(srcpad))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sinkpad))
carg2 = C.GstPadLinkCheck(flags)
cret = C.gst_pad_link_full(carg0, carg1, carg2)
runtime.KeepAlive(srcpad)
runtime.KeepAlive(sinkpad)
runtime.KeepAlive(flags)
var goret PadLinkReturn
goret = PadLinkReturn(cret)
return goret
}
// LinkMaybeGhosting wraps gst_pad_link_maybe_ghosting
//
// The function takes the following parameters:
//
// - sink Pad: a #GstPad
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @sink, creating any #GstGhostPad's in between as necessary.
//
// This is a convenience function to save having to create and add intermediate
// #GstGhostPad's as required for linking across #GstBin boundaries.
//
// If @src or @sink pads don't have parent elements or do not share a common
// ancestor, the link will fail.
func (src *PadInstance) LinkMaybeGhosting(sink Pad) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(src))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sink))
cret = C.gst_pad_link_maybe_ghosting(carg0, carg1)
runtime.KeepAlive(src)
runtime.KeepAlive(sink)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LinkMaybeGhostingFull wraps gst_pad_link_maybe_ghosting_full
//
// The function takes the following parameters:
//
// - sink Pad: a #GstPad
// - flags PadLinkCheck: some #GstPadLinkCheck flags
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @sink, creating any #GstGhostPad's in between as necessary.
//
// This is a convenience function to save having to create and add intermediate
// #GstGhostPad's as required for linking across #GstBin boundaries.
//
// If @src or @sink pads don't have parent elements or do not share a common
// ancestor, the link will fail.
//
// Calling gst_pad_link_maybe_ghosting_full() with
// @flags == %GST_PAD_LINK_CHECK_DEFAULT is the recommended way of linking
// pads with safety checks applied.
func (src *PadInstance) LinkMaybeGhostingFull(sink Pad, flags PadLinkCheck) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var carg2 C.GstPadLinkCheck // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(src))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sink))
carg2 = C.GstPadLinkCheck(flags)
cret = C.gst_pad_link_maybe_ghosting_full(carg0, carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(sink)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MarkReconfigure wraps gst_pad_mark_reconfigure
//
// Mark a pad for needing reconfiguration. The next call to
// gst_pad_check_reconfigure() will return %TRUE after this call.
func (pad *PadInstance) MarkReconfigure() {
var carg0 *C.GstPad // in, none, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
C.gst_pad_mark_reconfigure(carg0)
runtime.KeepAlive(pad)
}
// NeedsReconfigure wraps gst_pad_needs_reconfigure
// The function returns the following values:
//
// - goret bool
//
// Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
// if the flag was set.
func (pad *PadInstance) NeedsReconfigure() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_needs_reconfigure(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PauseTask wraps gst_pad_pause_task
// The function returns the following values:
//
// - goret bool
//
// Pause the task of @pad. This function will also wait until the
// function executed by the task is finished if this function is not
// called from the task function.
func (pad *PadInstance) PauseTask() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_pause_task(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PeerQuery wraps gst_pad_peer_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery to perform.
//
// The function returns the following values:
//
// - goret bool
//
// Performs gst_pad_query() on the peer of @pad.
//
// The caller is responsible for both the allocation and deallocation of
// the query structure.
func (pad *PadInstance) PeerQuery(query *Query) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_pad_peer_query(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PeerQueryAcceptCaps wraps gst_pad_peer_query_accept_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a #GstCaps to check on the pad
//
// The function returns the following values:
//
// - goret bool
//
// Check if the peer of @pad accepts @caps. If @pad has no peer, this function
// returns %TRUE.
func (pad *PadInstance) PeerQueryAcceptCaps(caps *Caps) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_pad_peer_query_accept_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PeerQueryCaps wraps gst_pad_peer_query_caps
//
// The function takes the following parameters:
//
// - filter *Caps (nullable): a #GstCaps filter, or %NULL.
//
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the peer connected to this pad. Similar to
// gst_pad_query_caps().
//
// When called on srcpads @filter contains the caps that
// upstream could produce in the order preferred by upstream. When
// called on sinkpads @filter contains the caps accepted by
// downstream in the preferred order. @filter might be %NULL but
// if it is not %NULL the returned caps will be a subset of @filter.
func (pad *PadInstance) PeerQueryCaps(filter *Caps) *Caps {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstCaps // in, none, converted, nullable
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if filter != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(filter))
}
cret = C.gst_pad_peer_query_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(filter)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// PeerQueryConvert wraps gst_pad_peer_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries the peer pad of a given sink pad to convert @src_val in @src_format
// to @dest_format.
func (pad *PadInstance) PeerQueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.GstFormat // in, none, casted
var carg4 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(srcFormat)
carg2 = C.gint64(srcVal)
carg3 = C.GstFormat(destFormat)
cret = C.gst_pad_peer_query_convert(carg0, carg1, carg2, carg3, &carg4)
runtime.KeepAlive(pad)
runtime.KeepAlive(srcFormat)
runtime.KeepAlive(srcVal)
runtime.KeepAlive(destFormat)
var destVal int64
var goret bool
destVal = int64(carg4)
if cret != 0 {
goret = true
}
return destVal, goret
}
// PeerQueryDuration wraps gst_pad_peer_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: a location in which to store the total
// duration, or %NULL.
// - goret bool
//
// Queries the peer pad of a given sink pad for the total stream duration.
func (pad *PadInstance) PeerQueryDuration(format Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(format)
cret = C.gst_pad_peer_query_duration(carg0, carg1, &carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(format)
var duration int64
var goret bool
duration = int64(carg2)
if cret != 0 {
goret = true
}
return duration, goret
}
// PeerQueryPosition wraps gst_pad_peer_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: a location in which to store the current
// position, or %NULL.
// - goret bool
//
// Queries the peer of a given sink pad for the stream position.
func (pad *PadInstance) PeerQueryPosition(format Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(format)
cret = C.gst_pad_peer_query_position(carg0, carg1, &carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(format)
var cur int64
var goret bool
cur = int64(carg2)
if cret != 0 {
goret = true
}
return cur, goret
}
// ProxyQueryAcceptCaps wraps gst_pad_proxy_query_accept_caps
//
// The function takes the following parameters:
//
// - query *Query: an ACCEPT_CAPS #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if all internally linked pads of @pad accepts the caps in @query and
// returns the intersection of the results.
//
// This function is useful as a default accept caps query function for an element
// that can handle any stream format, but requires caps that are acceptable for
// all opposite pads.
func (pad *PadInstance) ProxyQueryAcceptCaps(query *Query) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_pad_proxy_query_accept_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ProxyQueryCaps wraps gst_pad_proxy_query_caps
//
// The function takes the following parameters:
//
// - query *Query: a CAPS #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Calls gst_pad_query_caps() for all internally linked pads of @pad and returns
// the intersection of the results.
//
// This function is useful as a default caps query function for an element
// that can handle any stream format, but requires all its pads to have
// the same caps. Two such elements are tee and adder.
func (pad *PadInstance) ProxyQueryCaps(query *Query) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_pad_proxy_query_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PullRange wraps gst_pad_pull_range
//
// The function takes the following parameters:
//
// - offset uint64: The start offset of the buffer
// - size uint: The length of the buffer
//
// The function returns the following values:
//
// - buffer *Buffer: a pointer to hold the #GstBuffer, returns
// GST_FLOW_ERROR if %NULL.
// - goret FlowReturn
//
// Pulls a @buffer from the peer pad or fills up a provided buffer.
//
// This function will first trigger the pad block signal if it was
// installed.
//
// When @pad is not linked #GST_FLOW_NOT_LINKED is returned else this
// function returns the result of gst_pad_get_range() on the peer pad.
// See gst_pad_get_range() for a list of return values and for the
// semantics of the arguments of this function.
//
// If @buffer points to a variable holding %NULL, a valid new #GstBuffer will be
// placed in @buffer when this function returns #GST_FLOW_OK. The new buffer
// must be freed with gst_buffer_unref() after usage. When this function
// returns any other result value, @buffer will still point to %NULL.
//
// When @buffer points to a variable that points to a valid #GstBuffer, the
// buffer will be filled with the result data when this function returns
// #GST_FLOW_OK. When this function returns any other result value,
// @buffer will be unchanged. If the provided buffer is larger than @size, only
// @size bytes will be filled in the result buffer and its size will be updated
// accordingly.
//
// Note that less than @size bytes can be returned in @buffer when, for example,
// an EOS condition is near or when @buffer is not large enough to hold @size
// bytes. The caller should check the result buffer size to get the result size.
func (pad *PadInstance) PullRange(offset uint64, size uint) (*Buffer, FlowReturn) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.guint64 // in, none, casted
var carg2 C.guint // in, none, casted
var carg3 *C.GstBuffer // out, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.guint64(offset)
carg2 = C.guint(size)
cret = C.gst_pad_pull_range(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(pad)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var buffer *Buffer
var goret FlowReturn
buffer = UnsafeBufferFromGlibFull(unsafe.Pointer(carg3))
goret = FlowReturn(cret)
return buffer, goret
}
// Push wraps gst_pad_push
//
// The function takes the following parameters:
//
// - buffer *Buffer: the #GstBuffer to push returns GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Pushes a buffer to the peer of @pad.
//
// This function will call installed block probes before triggering any
// installed data probes.
//
// The function proceeds calling gst_pad_chain() on the peer pad and returns
// the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
// be returned.
//
// In all cases, success or failure, the caller loses its reference to @buffer
// after calling this function.
func (pad *PadInstance) Push(buffer *Buffer) FlowReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstBuffer // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buffer))
cret = C.gst_pad_push(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(buffer)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// PushEvent wraps gst_pad_push_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the pad.
//
// The function returns the following values:
//
// - goret bool
//
// Sends the event to the peer of the given pad. This function is
// mainly used by elements to send events to their peer
// elements.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
func (pad *PadInstance) PushEvent(event *Event) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstEvent // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstEvent)(UnsafeEventToGlibFull(event))
cret = C.gst_pad_push_event(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(event)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PushList wraps gst_pad_push_list
//
// The function takes the following parameters:
//
// - list *BufferList: the #GstBufferList to push returns GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Pushes a buffer list to the peer of @pad.
//
// This function will call installed block probes before triggering any
// installed data probes.
//
// The function proceeds calling the chain function on the peer pad and returns
// the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
// be returned. If the peer pad does not have any installed chainlist function
// every group buffer of the list will be merged into a normal #GstBuffer and
// chained via gst_pad_chain().
//
// In all cases, success or failure, the caller loses its reference to @list
// after calling this function.
func (pad *PadInstance) PushList(list *BufferList) FlowReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstBufferList // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstBufferList)(UnsafeBufferListToGlibFull(list))
cret = C.gst_pad_push_list(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(list)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// Query wraps gst_pad_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery to perform.
//
// The function returns the following values:
//
// - goret bool
//
// Dispatches a query to a pad. The query should have been allocated by the
// caller via one of the type-specific allocation functions. The element that
// the pad belongs to is responsible for filling the query with an appropriate
// response, which should then be parsed with a type-specific query parsing
// function.
//
// Again, the caller is responsible for both the allocation and deallocation of
// the query structure.
//
// Please also note that some queries might need a running pipeline to work.
func (pad *PadInstance) Query(query *Query) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_pad_query(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// QueryAcceptCaps wraps gst_pad_query_accept_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a #GstCaps to check on the pad
//
// The function returns the following values:
//
// - goret bool
//
// Check if the given pad accepts the caps.
func (pad *PadInstance) QueryAcceptCaps(caps *Caps) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_pad_query_accept_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// QueryCaps wraps gst_pad_query_caps
//
// The function takes the following parameters:
//
// - filter *Caps (nullable): suggested #GstCaps, or %NULL
//
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities this pad can produce or consume.
// Note that this method doesn't necessarily return the caps set by sending a
// gst_event_new_caps() - use gst_pad_get_current_caps() for that instead.
// gst_pad_query_caps returns all possible caps a pad can operate with, using
// the pad's CAPS query function, If the query fails, this function will return
// @filter, if not %NULL, otherwise ANY.
//
// When called on sinkpads @filter contains the caps that
// upstream could produce in the order preferred by upstream. When
// called on srcpads @filter contains the caps accepted by
// downstream in the preferred order. @filter might be %NULL but
// if it is not %NULL the returned caps will be a subset of @filter.
//
// Note that this function does not return writable #GstCaps, use
// gst_caps_make_writable() before modifying the caps.
func (pad *PadInstance) QueryCaps(filter *Caps) *Caps {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstCaps // in, none, converted, nullable
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if filter != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(filter))
}
cret = C.gst_pad_query_caps(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(filter)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// QueryConvert wraps gst_pad_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries a pad to convert @src_val in @src_format to @dest_format.
func (pad *PadInstance) QueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.GstFormat // in, none, casted
var carg4 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(srcFormat)
carg2 = C.gint64(srcVal)
carg3 = C.GstFormat(destFormat)
cret = C.gst_pad_query_convert(carg0, carg1, carg2, carg3, &carg4)
runtime.KeepAlive(pad)
runtime.KeepAlive(srcFormat)
runtime.KeepAlive(srcVal)
runtime.KeepAlive(destFormat)
var destVal int64
var goret bool
destVal = int64(carg4)
if cret != 0 {
goret = true
}
return destVal, goret
}
// QueryDefault wraps gst_pad_query_default
//
// The function takes the following parameters:
//
// - parent Object (nullable): the parent of @pad or %NULL
// - query *Query: the #GstQuery to handle.
//
// The function returns the following values:
//
// - goret bool
//
// Invokes the default query handler for the given pad.
// The query is sent to all pads internally linked to @pad. Note that
// if there are many possible sink pads that are internally linked to
// @pad, only one will be sent the query.
// Multi-sinkpad elements should implement custom query handlers.
func (pad *PadInstance) QueryDefault(parent Object, query *Query) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg2 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_pad_query_default(carg0, carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// QueryDuration wraps gst_pad_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: a location in which to store the total
// duration, or %NULL.
// - goret bool
//
// Queries a pad for the total stream duration.
func (pad *PadInstance) QueryDuration(format Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(format)
cret = C.gst_pad_query_duration(carg0, carg1, &carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(format)
var duration int64
var goret bool
duration = int64(carg2)
if cret != 0 {
goret = true
}
return duration, goret
}
// QueryPosition wraps gst_pad_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: A location in which to store the current position, or %NULL.
// - goret bool
//
// Queries a pad for the stream position.
func (pad *PadInstance) QueryPosition(format Format) (int64, bool) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.GstFormat(format)
cret = C.gst_pad_query_position(carg0, carg1, &carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(format)
var cur int64
var goret bool
cur = int64(carg2)
if cret != 0 {
goret = true
}
return cur, goret
}
// RemoveProbe wraps gst_pad_remove_probe
//
// The function takes the following parameters:
//
// - id uint32: the probe id to remove
//
// Remove the probe with @id from @pad.
//
// MT safe.
func (pad *PadInstance) RemoveProbe(id uint32) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.gulong // in, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.gulong(id)
C.gst_pad_remove_probe(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(id)
}
// SendEvent wraps gst_pad_send_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the pad.
//
// The function returns the following values:
//
// - goret bool
//
// Sends the event to the pad. This function can be used
// by applications to send events in the pipeline.
//
// If @pad is a source pad, @event should be an upstream event. If @pad is a
// sink pad, @event should be a downstream event. For example, you would not
// send a #GST_EVENT_EOS on a src pad; EOS events only propagate downstream.
// Furthermore, some downstream events have to be serialized with data flow,
// like EOS, while some can travel out-of-band, like #GST_EVENT_FLUSH_START. If
// the event needs to be serialized with data flow, this function will take the
// pad's stream lock while calling its event function.
//
// To find out whether an event type is upstream, downstream, or downstream and
// serialized, see #GstEventTypeFlags, gst_event_type_get_flags(),
// #GST_EVENT_IS_UPSTREAM, #GST_EVENT_IS_DOWNSTREAM, and
// #GST_EVENT_IS_SERIALIZED. Note that in practice that an application or
// plugin doesn't need to bother itself with this information; the core handles
// all necessary locks and checks.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
func (pad *PadInstance) SendEvent(event *Event) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstEvent // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstEvent)(UnsafeEventToGlibFull(event))
cret = C.gst_pad_send_event(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(event)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetActive wraps gst_pad_set_active
//
// The function takes the following parameters:
//
// - active bool: whether or not the pad should be active.
//
// The function returns the following values:
//
// - goret bool
//
// Activates or deactivates the given pad.
// Normally called from within core state change functions.
//
// If @active, makes sure the pad is active. If it is already active, either in
// push or pull mode, just return. Otherwise dispatches to the pad's activate
// function to perform the actual activation.
//
// If not @active, calls gst_pad_activate_mode() with the pad's current mode
// and a %FALSE argument.
func (pad *PadInstance) SetActive(active bool) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if active {
carg1 = C.TRUE
}
cret = C.gst_pad_set_active(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
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:
//
// - offset int64: the offset
//
// Set the offset that will be applied to the running time of @pad.
func (pad *PadInstance) SetOffset(offset int64) {
var carg0 *C.GstPad // in, none, converted
var carg1 C.gint64 // in, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = C.gint64(offset)
C.gst_pad_set_offset(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(offset)
}
// StartTask wraps gst_pad_start_task
//
// The function takes the following parameters:
//
// - fn TaskFunction: the task function to call
//
// The function returns the following values:
//
// - goret bool
//
// Starts a task that repeatedly calls @func with @user_data. This function
// is mostly used in pad activation functions to start the dataflow.
// The #GST_PAD_STREAM_LOCK of @pad will automatically be acquired
// before @func is called.
func (pad *PadInstance) StartTask(fn TaskFunction) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 C.GstTaskFunction // callback, scope: notified, closure: carg2, destroy: carg3
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*[0]byte)(C._gotk4_gst1_TaskFunction)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_pad_start_task(carg0, carg1, carg2, carg3)
runtime.KeepAlive(pad)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// StopTask wraps gst_pad_stop_task
// The function returns the following values:
//
// - goret bool
//
// Stop the task of @pad. This function will also make sure that the
// function executed by the task will effectively stop if not called
// from the GstTaskFunction.
//
// This function will deadlock if called from the GstTaskFunction of
// the task. Use gst_task_pause() instead.
//
// Regardless of whether the pad has a task, the stream lock is acquired and
// released so as to ensure that streaming through this pad has finished.
func (pad *PadInstance) StopTask() bool {
var carg0 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_pad_stop_task(carg0)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// StoreStickyEvent wraps gst_pad_store_sticky_event
//
// The function takes the following parameters:
//
// - event *Event: a #GstEvent
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Store the sticky @event on @pad
func (pad *PadInstance) StoreStickyEvent(event *Event) FlowReturn {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstEvent // in, none, converted
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg1 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_pad_store_sticky_event(carg0, carg1)
runtime.KeepAlive(pad)
runtime.KeepAlive(event)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// Unlink wraps gst_pad_unlink
//
// The function takes the following parameters:
//
// - sinkpad Pad: the sink #GstPad to unlink.
//
// The function returns the following values:
//
// - goret bool
//
// Unlinks the source pad from the sink pad. Will emit the #GstPad::unlinked
// signal on both pads.
func (srcpad *PadInstance) Unlink(sinkpad Pad) bool {
var carg0 *C.GstPad // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPad)(UnsafePadToGlibNone(srcpad))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(sinkpad))
cret = C.gst_pad_unlink(carg0, carg1)
runtime.KeepAlive(srcpad)
runtime.KeepAlive(sinkpad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// UseFixedCaps wraps gst_pad_use_fixed_caps
//
// A helper function you can use that sets the FIXED_CAPS flag
// This way the default CAPS query will always return the negotiated caps
// or in case the pad is not negotiated, the padtemplate caps.
//
// The negotiated caps are the caps of the last CAPS event that passed on the
// pad. Use this function on a pad that, once it negotiated to a CAPS, cannot
// be renegotiated to something else.
func (pad *PadInstance) UseFixedCaps() {
var carg0 *C.GstPad // in, none, converted
carg0 = (*C.GstPad)(UnsafePadToGlibNone(pad))
C.gst_pad_use_fixed_caps(carg0)
runtime.KeepAlive(pad)
}
// 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
ObjectInstance
}
var _ PadTemplate = (*PadTemplateInstance)(nil)
// PadTemplate wraps GstPadTemplate
//
// Padtemplates describe the possible media types a pad or an elementfactory can
// handle. This allows for both inspection of handled types before loading the
// element plugin as well as identifying pads on elements that are not yet
// created (request or sometimes pads).
//
// Pad and PadTemplates have #GstCaps attached to it to describe the media type
// they are capable of dealing with. gst_pad_template_get_caps() or
// GST_PAD_TEMPLATE_CAPS() are used to get the caps of a padtemplate. It's not
// possible to modify the caps of a padtemplate after creation.
//
// PadTemplates have a #GstPadPresence property which identifies the lifetime
// of the pad and that can be retrieved with GST_PAD_TEMPLATE_PRESENCE(). Also
// the direction of the pad can be retrieved from the #GstPadTemplate with
// GST_PAD_TEMPLATE_DIRECTION().
//
// The GST_PAD_TEMPLATE_NAME_TEMPLATE () is important for GST_PAD_REQUEST pads
// because it has to be used as the name in the gst_element_request_pad_simple()
// call to instantiate a pad from this template.
//
// Padtemplates can be created with gst_pad_template_new() or with
// gst_static_pad_template_get (), which creates a #GstPadTemplate from a
// #GstStaticPadTemplate that can be filled with the
// convenient GST_STATIC_PAD_TEMPLATE() macro.
//
// A padtemplate can be used to create a pad (see gst_pad_new_from_template()
// or gst_pad_new_from_static_template ()) or to add to an element class
// (see gst_element_class_add_static_pad_template ()).
//
// The following code example shows the code to create a pad from a padtemplate.
// |[&lt;!-- language="C" --&gt;
// GstStaticPadTemplate my_template =
// GST_STATIC_PAD_TEMPLATE (
// "sink", // the name of the pad
// GST_PAD_SINK, // the direction of the pad
// GST_PAD_ALWAYS, // when this pad will be present
// GST_STATIC_CAPS ( // the capabilities of the padtemplate
// "audio/x-raw, "
// "channels = (int) [ 1, 6 ]"
// )
// );
// void
// my_method (void)
// {
// GstPad *pad;
// pad = gst_pad_new_from_static_template (&amp;my_template, "sink");
// ...
// }
// ]|
//
// The following example shows you how to add the padtemplate to an
// element class, this is usually done in the class_init of the class:
// |[&lt;!-- language="C" --&gt;
// static void
// my_element_class_init (GstMyElementClass *klass)
// {
// GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
//
// gst_element_class_add_static_pad_template (gstelement_class, &amp;my_template);
// }
// ]|
type PadTemplate interface {
Object
upcastToGstPadTemplate() *PadTemplateInstance
// GetCaps wraps gst_pad_template_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the pad template.
GetCaps() *Caps
// GetDocumentationCaps wraps gst_pad_template_get_documentation_caps
// The function returns the following values:
//
// - goret *Caps
//
// See gst_pad_template_set_documentation_caps().
GetDocumentationCaps() *Caps
// PadCreated wraps gst_pad_template_pad_created
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad that created it
//
// Emit the pad-created signal for this template when created by this pad.
PadCreated(Pad)
// SetDocumentationCaps wraps gst_pad_template_set_documentation_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the documented capabilities
//
// Certain elements will dynamically construct the caps of their
// pad templates. In order not to let environment-specific information
// into the documentation, element authors should use this method to
// expose "stable" caps to the reader.
SetDocumentationCaps(*Caps)
}
func unsafeWrapPadTemplate(base *gobject.ObjectInstance) *PadTemplateInstance {
return &PadTemplateInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalPadTemplateInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPadTemplate(gobject.ValueFromNative(p).Object()), nil
}
// UnsafePadTemplateFromGlibNone is used to convert raw GstPadTemplate pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePadTemplateFromGlibNone(c unsafe.Pointer) PadTemplate {
return gobject.UnsafeObjectFromGlibNone(c).(PadTemplate)
}
// UnsafePadTemplateFromGlibFull is used to convert raw GstPadTemplate pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePadTemplateFromGlibFull(c unsafe.Pointer) PadTemplate {
return gobject.UnsafeObjectFromGlibFull(c).(PadTemplate)
}
func (p *PadTemplateInstance) upcastToGstPadTemplate() *PadTemplateInstance {
return p
}
// UnsafePadTemplateToGlibNone is used to convert the instance to it's C value GstPadTemplate. This is used by the bindings internally.
func UnsafePadTemplateToGlibNone(c PadTemplate) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafePadTemplateToGlibFull is used to convert the instance to it's C value GstPadTemplate, while removeing the finalizer. This is used by the bindings internally.
func UnsafePadTemplateToGlibFull(c PadTemplate) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewPadTemplate wraps gst_pad_template_new
//
// The function takes the following parameters:
//
// - nameTemplate string: the name template.
// - direction PadDirection: the #GstPadDirection of the template.
// - presence PadPresence: the #GstPadPresence of the pad.
// - caps *Caps: a #GstCaps set for the template.
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Creates a new pad template with a name according to the given template
// and with the given arguments.
func NewPadTemplate(nameTemplate string, direction PadDirection, presence PadPresence, caps *Caps) PadTemplate {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GstPadDirection // in, none, casted
var carg3 C.GstPadPresence // in, none, casted
var carg4 *C.GstCaps // in, none, converted
var cret *C.GstPadTemplate // return, none, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(nameTemplate)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GstPadDirection(direction)
carg3 = C.GstPadPresence(presence)
carg4 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_pad_template_new(carg1, carg2, carg3, carg4)
runtime.KeepAlive(nameTemplate)
runtime.KeepAlive(direction)
runtime.KeepAlive(presence)
runtime.KeepAlive(caps)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewPadTemplateFromStaticPadTemplateWithGType wraps gst_pad_template_new_from_static_pad_template_with_gtype
//
// The function takes the following parameters:
//
// - padTemplate *StaticPadTemplate: the static pad template
// - padType gobject.Type: The #GType of the pad to create
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Converts a #GstStaticPadTemplate into a #GstPadTemplate with a type.
func NewPadTemplateFromStaticPadTemplateWithGType(padTemplate *StaticPadTemplate, padType gobject.Type) PadTemplate {
var carg1 *C.GstStaticPadTemplate // in, none, converted
var carg2 C.GType // in, none, casted, alias
var cret *C.GstPadTemplate // return, none, converted
carg1 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(padTemplate))
carg2 = C.GType(padType)
cret = C.gst_pad_template_new_from_static_pad_template_with_gtype(carg1, carg2)
runtime.KeepAlive(padTemplate)
runtime.KeepAlive(padType)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewPadTemplateWithGType wraps gst_pad_template_new_with_gtype
//
// The function takes the following parameters:
//
// - nameTemplate string: the name template.
// - direction PadDirection: the #GstPadDirection of the template.
// - presence PadPresence: the #GstPadPresence of the pad.
// - caps *Caps: a #GstCaps set for the template.
// - padType gobject.Type: The #GType of the pad to create
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Creates a new pad template with a name according to the given template
// and with the given arguments.
func NewPadTemplateWithGType(nameTemplate string, direction PadDirection, presence PadPresence, caps *Caps, padType gobject.Type) PadTemplate {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GstPadDirection // in, none, casted
var carg3 C.GstPadPresence // in, none, casted
var carg4 *C.GstCaps // in, none, converted
var carg5 C.GType // in, none, casted, alias
var cret *C.GstPadTemplate // return, none, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(nameTemplate)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GstPadDirection(direction)
carg3 = C.GstPadPresence(presence)
carg4 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg5 = C.GType(padType)
cret = C.gst_pad_template_new_with_gtype(carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(nameTemplate)
runtime.KeepAlive(direction)
runtime.KeepAlive(presence)
runtime.KeepAlive(caps)
runtime.KeepAlive(padType)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetCaps wraps gst_pad_template_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the pad template.
func (templ *PadTemplateInstance) GetCaps() *Caps {
var carg0 *C.GstPadTemplate // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
cret = C.gst_pad_template_get_caps(carg0)
runtime.KeepAlive(templ)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetDocumentationCaps wraps gst_pad_template_get_documentation_caps
// The function returns the following values:
//
// - goret *Caps
//
// See gst_pad_template_set_documentation_caps().
func (templ *PadTemplateInstance) GetDocumentationCaps() *Caps {
var carg0 *C.GstPadTemplate // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
cret = C.gst_pad_template_get_documentation_caps(carg0)
runtime.KeepAlive(templ)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// PadCreated wraps gst_pad_template_pad_created
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad that created it
//
// Emit the pad-created signal for this template when created by this pad.
func (templ *PadTemplateInstance) PadCreated(pad Pad) {
var carg0 *C.GstPadTemplate // in, none, converted
var carg1 *C.GstPad // in, none, converted
carg0 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
C.gst_pad_template_pad_created(carg0, carg1)
runtime.KeepAlive(templ)
runtime.KeepAlive(pad)
}
// SetDocumentationCaps wraps gst_pad_template_set_documentation_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the documented capabilities
//
// Certain elements will dynamically construct the caps of their
// pad templates. In order not to let environment-specific information
// into the documentation, element authors should use this method to
// expose "stable" caps to the reader.
func (templ *PadTemplateInstance) SetDocumentationCaps(caps *Caps) {
var carg0 *C.GstPadTemplate // in, none, converted
var carg1 *C.GstCaps // in, none, converted
carg0 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
C.gst_pad_template_set_documentation_caps(carg0, carg1)
runtime.KeepAlive(templ)
runtime.KeepAlive(caps)
}
// 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
ObjectInstance
}
var _ Plugin = (*PluginInstance)(nil)
// Plugin wraps GstPlugin
//
// GStreamer is extensible, so #GstElement instances can be loaded at runtime.
// A plugin system can provide one or more of the basic GStreamer
// #GstPluginFeature subclasses.
//
// A plugin should export a symbol `gst_plugin_desc` that is a
// struct of type #GstPluginDesc.
// the plugin loader will check the version of the core library the plugin was
// linked against and will create a new #GstPlugin. It will then call the
// #GstPluginInitFunc function that was provided in the
// `gst_plugin_desc`.
//
// Once you have a handle to a #GstPlugin (e.g. from the #GstRegistry), you
// can add any object that subclasses #GstPluginFeature.
//
// Usually plugins are always automatically loaded so you don't need to call
// gst_plugin_load() explicitly to bring it into memory. There are options to
// statically link plugins to an app or even use GStreamer without a plugin
// repository in which case gst_plugin_load() can be needed to bring the plugin
// into memory.
type Plugin interface {
Object
upcastToGstPlugin() *PluginInstance
// AddDependency wraps gst_plugin_add_dependency
//
// The function takes the following parameters:
//
// - envVars []string (nullable): %NULL-terminated array of environment variables affecting the
// feature set of the plugin (e.g. an environment variable containing
// paths where to look for additional modules/plugins of a library),
// or %NULL. Environment variable names may be followed by a path component
// which will be added to the content of the environment variable, e.g.
// "HOME/.mystuff/plugins".
// - paths []string (nullable): %NULL-terminated array of directories/paths where dependent files
// may be, or %NULL.
// - names []string (nullable): %NULL-terminated array of file names (or file name suffixes,
// depending on @flags) to be used in combination with the paths from
// @paths and/or the paths extracted from the environment variables in
// @env_vars, or %NULL.
// - flags PluginDependencyFlags: optional flags, or #GST_PLUGIN_DEPENDENCY_FLAG_NONE
//
// Make GStreamer aware of external dependencies which affect the feature
// set of this plugin (ie. the elements or typefinders associated with it).
//
// GStreamer will re-inspect plugins with external dependencies whenever any
// of the external dependencies change. This is useful for plugins which wrap
// other plugin systems, e.g. a plugin which wraps a plugin-based visualisation
// library and makes visualisations available as GStreamer elements, or a
// codec loader which exposes elements and/or caps dependent on what external
// codec libraries are currently installed.
AddDependency([]string, []string, []string, PluginDependencyFlags)
// AddDependencySimple wraps gst_plugin_add_dependency_simple
//
// The function takes the following parameters:
//
// - envVars string (nullable): one or more environment variables (separated by ':', ';' or ','),
// or %NULL. Environment variable names may be followed by a path component
// which will be added to the content of the environment variable, e.g.
// "HOME/.mystuff/plugins:MYSTUFF_PLUGINS_PATH"
// - paths string (nullable): one ore more directory paths (separated by ':' or ';' or ','),
// or %NULL. Example: "/usr/lib/mystuff/plugins"
// - names string (nullable): one or more file names or file name suffixes (separated by commas),
// or %NULL
// - flags PluginDependencyFlags: optional flags, or #GST_PLUGIN_DEPENDENCY_FLAG_NONE
//
// Make GStreamer aware of external dependencies which affect the feature
// set of this plugin (ie. the elements or typefinders associated with it).
//
// GStreamer will re-inspect plugins with external dependencies whenever any
// of the external dependencies change. This is useful for plugins which wrap
// other plugin systems, e.g. a plugin which wraps a plugin-based visualisation
// library and makes visualisations available as GStreamer elements, or a
// codec loader which exposes elements and/or caps dependent on what external
// codec libraries are currently installed.
//
// Convenience wrapper function for gst_plugin_add_dependency() which
// takes simple strings as arguments instead of string arrays, with multiple
// arguments separated by predefined delimiters (see above).
AddDependencySimple(string, string, string, PluginDependencyFlags)
// AddStatusError wraps gst_plugin_add_status_error
//
// The function takes the following parameters:
//
// - message string: the status error message
AddStatusError(string)
// AddStatusInfo wraps gst_plugin_add_status_info
//
// The function takes the following parameters:
//
// - message string: the status info message
AddStatusInfo(string)
// AddStatusWarning wraps gst_plugin_add_status_warning
//
// The function takes the following parameters:
//
// - message string: the status warning message
AddStatusWarning(string)
// GetCacheData wraps gst_plugin_get_cache_data
// The function returns the following values:
//
// - goret *Structure
//
// Gets the plugin specific data cache. If it is %NULL there is no cached data
// stored. This is the case when the registry is getting rebuilt.
GetCacheData() *Structure
// GetDescription wraps gst_plugin_get_description
// The function returns the following values:
//
// - goret string
//
// Get the long descriptive name of the plugin
GetDescription() string
// GetFilename wraps gst_plugin_get_filename
// The function returns the following values:
//
// - goret string
//
// get the filename of the plugin
GetFilename() string
// GetLicense wraps gst_plugin_get_license
// The function returns the following values:
//
// - goret string
//
// get the license of the plugin
GetLicense() string
// GetName wraps gst_plugin_get_name
// The function returns the following values:
//
// - goret string
//
// Get the short name of the plugin
GetName() string
// GetOrigin wraps gst_plugin_get_origin
// The function returns the following values:
//
// - goret string
//
// get the URL where the plugin comes from
GetOrigin() string
// GetPackage wraps gst_plugin_get_package
// The function returns the following values:
//
// - goret string
//
// get the package the plugin belongs to.
GetPackage() string
// GetReleaseDateString wraps gst_plugin_get_release_date_string
// The function returns the following values:
//
// - goret string
//
// Get the release date (and possibly time) in form of a string, if available.
//
// For normal GStreamer plugin releases this will usually just be a date in
// the form of "YYYY-MM-DD", while pre-releases and builds from git may contain
// a time component after the date as well, in which case the string will be
// formatted like "YYYY-MM-DDTHH:MMZ" (e.g. "2012-04-30T09:30Z").
//
// There may be plugins that do not have a valid release date set on them.
GetReleaseDateString() string
// GetSource wraps gst_plugin_get_source
// The function returns the following values:
//
// - goret string
//
// get the source module the plugin belongs to.
GetSource() string
// GetStatusErrors wraps gst_plugin_get_status_errors
// The function returns the following values:
//
// - goret []string
GetStatusErrors() []string
// GetStatusInfos wraps gst_plugin_get_status_infos
// The function returns the following values:
//
// - goret []string
GetStatusInfos() []string
// GetStatusWarnings wraps gst_plugin_get_status_warnings
// The function returns the following values:
//
// - goret []string
GetStatusWarnings() []string
// GetVersion wraps gst_plugin_get_version
// The function returns the following values:
//
// - goret string
//
// get the version of the plugin
GetVersion() string
// IsLoaded wraps gst_plugin_is_loaded
// The function returns the following values:
//
// - goret bool
//
// queries if the plugin is loaded into memory
IsLoaded() bool
// Load wraps gst_plugin_load
// The function returns the following values:
//
// - goret Plugin
//
// Loads @plugin. Note that the *return value* is the loaded plugin; @plugin is
// untouched. The normal use pattern of this function goes like this:
//
// |[
// GstPlugin *loaded_plugin;
// loaded_plugin = gst_plugin_load (plugin);
// // presumably, we're no longer interested in the potentially-unloaded plugin
// gst_object_unref (plugin);
// plugin = loaded_plugin;
// ]|
Load() Plugin
// SetCacheData wraps gst_plugin_set_cache_data
//
// The function takes the following parameters:
//
// - cacheData *Structure: a structure containing the data to cache
//
// Adds plugin specific data to cache. Passes the ownership of the structure to
// the @plugin.
//
// The cache is flushed every time the registry is rebuilt.
SetCacheData(*Structure)
}
func unsafeWrapPlugin(base *gobject.ObjectInstance) *PluginInstance {
return &PluginInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalPluginInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPlugin(gobject.ValueFromNative(p).Object()), nil
}
// UnsafePluginFromGlibNone is used to convert raw GstPlugin pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePluginFromGlibNone(c unsafe.Pointer) Plugin {
return gobject.UnsafeObjectFromGlibNone(c).(Plugin)
}
// UnsafePluginFromGlibFull is used to convert raw GstPlugin pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePluginFromGlibFull(c unsafe.Pointer) Plugin {
return gobject.UnsafeObjectFromGlibFull(c).(Plugin)
}
func (p *PluginInstance) upcastToGstPlugin() *PluginInstance {
return p
}
// UnsafePluginToGlibNone is used to convert the instance to it's C value GstPlugin. This is used by the bindings internally.
func UnsafePluginToGlibNone(c Plugin) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafePluginToGlibFull is used to convert the instance to it's C value GstPlugin, while removeing the finalizer. This is used by the bindings internally.
func UnsafePluginToGlibFull(c Plugin) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// PluginLoadByName wraps gst_plugin_load_by_name
//
// The function takes the following parameters:
//
// - name string: name of plugin to load
//
// The function returns the following values:
//
// - goret Plugin
//
// Load the named plugin. Refs the plugin.
func PluginLoadByName(name string) Plugin {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPlugin // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_plugin_load_by_name(carg1)
runtime.KeepAlive(name)
var goret Plugin
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
return goret
}
// PluginLoadFile wraps gst_plugin_load_file
//
// The function takes the following parameters:
//
// - filename string: the plugin filename to load
//
// The function returns the following values:
//
// - goret Plugin
// - _goerr error (nullable): an error
//
// Loads the given plugin and refs it. Caller needs to unref after use.
func PluginLoadFile(filename string) (Plugin, error) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPlugin // return, full, converted
var _cerr *C.GError // out, full, converted, nullable
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(filename)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_plugin_load_file(carg1, &_cerr)
runtime.KeepAlive(filename)
var goret Plugin
var _goerr error
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// PluginRegisterStaticFull wraps gst_plugin_register_static_full
//
// The function takes the following parameters:
//
// - majorVersion int: the major version number of the GStreamer core that the
// plugin was compiled for, you can just use GST_VERSION_MAJOR here
// - minorVersion int: the minor version number of the GStreamer core that the
// plugin was compiled for, you can just use GST_VERSION_MINOR here
// - name string: a unique name of the plugin (ideally prefixed with an application- or
// library-specific namespace prefix in order to avoid name conflicts in
// case a similar plugin with the same name ever gets added to GStreamer)
// - description string: description of the plugin
// - initFullFunc PluginInitFullFunc: pointer to the init function with user data
// of this plugin.
// - version string: version string of the plugin
// - license string: effective license of plugin. Must be one of the approved licenses
// (see #GstPluginDesc above) or the plugin will not be registered.
// - source string: source module plugin belongs to
// - pkg string: shipped package plugin belongs to
// - origin string: URL to provider of plugin
//
// The function returns the following values:
//
// - goret bool
//
// Registers a static plugin, ie. a plugin which is private to an application
// or library and contained within the application or library (as opposed to
// being shipped as a separate module file) with a #GstPluginInitFullFunc
// which allows user data to be passed to the callback function (useful
// for bindings).
//
// You must make sure that GStreamer has been initialised (with gst_init() or
// via gst_init_get_option_group()) before calling this function.
func PluginRegisterStaticFull(majorVersion int, minorVersion int, name string, description string, initFullFunc PluginInitFullFunc, version string, license string, source string, pkg string, origin string) bool {
var carg1 C.gint // in, none, casted
var carg2 C.gint // 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.GstPluginInitFullFunc // callback, scope: call, closure: carg11
var carg6 *C.gchar // in, none, string, casted *C.gchar
var carg7 *C.gchar // in, none, string, casted *C.gchar
var carg8 *C.gchar // in, none, string, casted *C.gchar
var carg9 *C.gchar // in, none, string, casted *C.gchar
var carg10 *C.gchar // in, none, string, casted *C.gchar
var carg11 C.gpointer // implicit
var cret C.gboolean // return
carg1 = C.gint(majorVersion)
carg2 = C.gint(minorVersion)
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg3))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(description)))
defer C.free(unsafe.Pointer(carg4))
carg5 = (*[0]byte)(C._gotk4_gst1_PluginInitFullFunc)
carg11 = C.gpointer(userdata.Register(initFullFunc))
defer userdata.Delete(unsafe.Pointer(carg11))
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(version)))
defer C.free(unsafe.Pointer(carg6))
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(license)))
defer C.free(unsafe.Pointer(carg7))
carg8 = (*C.gchar)(unsafe.Pointer(C.CString(source)))
defer C.free(unsafe.Pointer(carg8))
carg9 = (*C.gchar)(unsafe.Pointer(C.CString(pkg)))
defer C.free(unsafe.Pointer(carg9))
carg10 = (*C.gchar)(unsafe.Pointer(C.CString(origin)))
defer C.free(unsafe.Pointer(carg10))
cret = C.gst_plugin_register_static_full(carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8, carg9, carg10, carg11)
runtime.KeepAlive(majorVersion)
runtime.KeepAlive(minorVersion)
runtime.KeepAlive(name)
runtime.KeepAlive(description)
runtime.KeepAlive(initFullFunc)
runtime.KeepAlive(version)
runtime.KeepAlive(license)
runtime.KeepAlive(source)
runtime.KeepAlive(pkg)
runtime.KeepAlive(origin)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AddDependency wraps gst_plugin_add_dependency
//
// The function takes the following parameters:
//
// - envVars []string (nullable): %NULL-terminated array of environment variables affecting the
// feature set of the plugin (e.g. an environment variable containing
// paths where to look for additional modules/plugins of a library),
// or %NULL. Environment variable names may be followed by a path component
// which will be added to the content of the environment variable, e.g.
// "HOME/.mystuff/plugins".
// - paths []string (nullable): %NULL-terminated array of directories/paths where dependent files
// may be, or %NULL.
// - names []string (nullable): %NULL-terminated array of file names (or file name suffixes,
// depending on @flags) to be used in combination with the paths from
// @paths and/or the paths extracted from the environment variables in
// @env_vars, or %NULL.
// - flags PluginDependencyFlags: optional flags, or #GST_PLUGIN_DEPENDENCY_FLAG_NONE
//
// Make GStreamer aware of external dependencies which affect the feature
// set of this plugin (ie. the elements or typefinders associated with it).
//
// GStreamer will re-inspect plugins with external dependencies whenever any
// of the external dependencies change. This is useful for plugins which wrap
// other plugin systems, e.g. a plugin which wraps a plugin-based visualisation
// library and makes visualisations available as GStreamer elements, or a
// codec loader which exposes elements and/or caps dependent on what external
// codec libraries are currently installed.
func (plugin *PluginInstance) AddDependency(envVars []string, paths []string, names []string, flags PluginDependencyFlags) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], nullable, array (inner: *typesystem.StringPrimitive, zero-terminated)
var carg2 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], nullable, array (inner: *typesystem.StringPrimitive, zero-terminated)
var carg3 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], nullable, array (inner: *typesystem.StringPrimitive, zero-terminated)
var carg4 C.GstPluginDependencyFlags // in, none, casted
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
_ = envVars
_ = carg1
panic("unimplemented conversion of []string (const gchar**)")
_ = paths
_ = carg2
panic("unimplemented conversion of []string (const gchar**)")
_ = names
_ = carg3
panic("unimplemented conversion of []string (const gchar**)")
carg4 = C.GstPluginDependencyFlags(flags)
C.gst_plugin_add_dependency(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(plugin)
runtime.KeepAlive(envVars)
runtime.KeepAlive(paths)
runtime.KeepAlive(names)
runtime.KeepAlive(flags)
}
// AddDependencySimple wraps gst_plugin_add_dependency_simple
//
// The function takes the following parameters:
//
// - envVars string (nullable): one or more environment variables (separated by ':', ';' or ','),
// or %NULL. Environment variable names may be followed by a path component
// which will be added to the content of the environment variable, e.g.
// "HOME/.mystuff/plugins:MYSTUFF_PLUGINS_PATH"
// - paths string (nullable): one ore more directory paths (separated by ':' or ';' or ','),
// or %NULL. Example: "/usr/lib/mystuff/plugins"
// - names string (nullable): one or more file names or file name suffixes (separated by commas),
// or %NULL
// - flags PluginDependencyFlags: optional flags, or #GST_PLUGIN_DEPENDENCY_FLAG_NONE
//
// Make GStreamer aware of external dependencies which affect the feature
// set of this plugin (ie. the elements or typefinders associated with it).
//
// GStreamer will re-inspect plugins with external dependencies whenever any
// of the external dependencies change. This is useful for plugins which wrap
// other plugin systems, e.g. a plugin which wraps a plugin-based visualisation
// library and makes visualisations available as GStreamer elements, or a
// codec loader which exposes elements and/or caps dependent on what external
// codec libraries are currently installed.
//
// Convenience wrapper function for gst_plugin_add_dependency() which
// takes simple strings as arguments instead of string arrays, with multiple
// arguments separated by predefined delimiters (see above).
func (plugin *PluginInstance) AddDependencySimple(envVars string, paths string, names string, flags PluginDependencyFlags) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.gchar // in, none, string, nullable-string
var carg3 *C.gchar // in, none, string, nullable-string
var carg4 C.GstPluginDependencyFlags // in, none, casted
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
if envVars != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(envVars)))
defer C.free(unsafe.Pointer(carg1))
}
if paths != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(paths)))
defer C.free(unsafe.Pointer(carg2))
}
if names != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(names)))
defer C.free(unsafe.Pointer(carg3))
}
carg4 = C.GstPluginDependencyFlags(flags)
C.gst_plugin_add_dependency_simple(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(plugin)
runtime.KeepAlive(envVars)
runtime.KeepAlive(paths)
runtime.KeepAlive(names)
runtime.KeepAlive(flags)
}
// AddStatusError wraps gst_plugin_add_status_error
//
// The function takes the following parameters:
//
// - message string: the status error message
func (plugin *PluginInstance) AddStatusError(message string) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(message)))
defer C.free(unsafe.Pointer(carg1))
C.gst_plugin_add_status_error(carg0, carg1)
runtime.KeepAlive(plugin)
runtime.KeepAlive(message)
}
// AddStatusInfo wraps gst_plugin_add_status_info
//
// The function takes the following parameters:
//
// - message string: the status info message
func (plugin *PluginInstance) AddStatusInfo(message string) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(message)))
defer C.free(unsafe.Pointer(carg1))
C.gst_plugin_add_status_info(carg0, carg1)
runtime.KeepAlive(plugin)
runtime.KeepAlive(message)
}
// AddStatusWarning wraps gst_plugin_add_status_warning
//
// The function takes the following parameters:
//
// - message string: the status warning message
func (plugin *PluginInstance) AddStatusWarning(message string) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(message)))
defer C.free(unsafe.Pointer(carg1))
C.gst_plugin_add_status_warning(carg0, carg1)
runtime.KeepAlive(plugin)
runtime.KeepAlive(message)
}
// GetCacheData wraps gst_plugin_get_cache_data
// The function returns the following values:
//
// - goret *Structure
//
// Gets the plugin specific data cache. If it is %NULL there is no cached data
// stored. This is the case when the registry is getting rebuilt.
func (plugin *PluginInstance) GetCacheData() *Structure {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_cache_data(carg0)
runtime.KeepAlive(plugin)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetDescription wraps gst_plugin_get_description
// The function returns the following values:
//
// - goret string
//
// Get the long descriptive name of the plugin
func (plugin *PluginInstance) GetDescription() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_description(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetFilename wraps gst_plugin_get_filename
// The function returns the following values:
//
// - goret string
//
// get the filename of the plugin
func (plugin *PluginInstance) GetFilename() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_filename(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetLicense wraps gst_plugin_get_license
// The function returns the following values:
//
// - goret string
//
// get the license of the plugin
func (plugin *PluginInstance) GetLicense() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_license(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetName wraps gst_plugin_get_name
// The function returns the following values:
//
// - goret string
//
// Get the short name of the plugin
func (plugin *PluginInstance) GetName() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_name(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetOrigin wraps gst_plugin_get_origin
// The function returns the following values:
//
// - goret string
//
// get the URL where the plugin comes from
func (plugin *PluginInstance) GetOrigin() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_origin(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetPackage wraps gst_plugin_get_package
// The function returns the following values:
//
// - goret string
//
// get the package the plugin belongs to.
func (plugin *PluginInstance) GetPackage() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_package(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetReleaseDateString wraps gst_plugin_get_release_date_string
// The function returns the following values:
//
// - goret string
//
// Get the release date (and possibly time) in form of a string, if available.
//
// For normal GStreamer plugin releases this will usually just be a date in
// the form of "YYYY-MM-DD", while pre-releases and builds from git may contain
// a time component after the date as well, in which case the string will be
// formatted like "YYYY-MM-DDTHH:MMZ" (e.g. "2012-04-30T09:30Z").
//
// There may be plugins that do not have a valid release date set on them.
func (plugin *PluginInstance) GetReleaseDateString() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_release_date_string(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetSource wraps gst_plugin_get_source
// The function returns the following values:
//
// - goret string
//
// get the source module the plugin belongs to.
func (plugin *PluginInstance) GetSource() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_source(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetStatusErrors wraps gst_plugin_get_status_errors
// The function returns the following values:
//
// - goret []string
func (plugin *PluginInstance) GetStatusErrors() []string {
var carg0 *C.GstPlugin // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_status_errors(carg0)
runtime.KeepAlive(plugin)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetStatusInfos wraps gst_plugin_get_status_infos
// The function returns the following values:
//
// - goret []string
func (plugin *PluginInstance) GetStatusInfos() []string {
var carg0 *C.GstPlugin // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_status_infos(carg0)
runtime.KeepAlive(plugin)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetStatusWarnings wraps gst_plugin_get_status_warnings
// The function returns the following values:
//
// - goret []string
func (plugin *PluginInstance) GetStatusWarnings() []string {
var carg0 *C.GstPlugin // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_status_warnings(carg0)
runtime.KeepAlive(plugin)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetVersion wraps gst_plugin_get_version
// The function returns the following values:
//
// - goret string
//
// get the version of the plugin
func (plugin *PluginInstance) GetVersion() string {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_get_version(carg0)
runtime.KeepAlive(plugin)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// IsLoaded wraps gst_plugin_is_loaded
// The function returns the following values:
//
// - goret bool
//
// queries if the plugin is loaded into memory
func (plugin *PluginInstance) IsLoaded() bool {
var carg0 *C.GstPlugin // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_is_loaded(carg0)
runtime.KeepAlive(plugin)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Load wraps gst_plugin_load
// The function returns the following values:
//
// - goret Plugin
//
// Loads @plugin. Note that the *return value* is the loaded plugin; @plugin is
// untouched. The normal use pattern of this function goes like this:
//
// |[
// GstPlugin *loaded_plugin;
// loaded_plugin = gst_plugin_load (plugin);
// // presumably, we're no longer interested in the potentially-unloaded plugin
// gst_object_unref (plugin);
// plugin = loaded_plugin;
// ]|
func (plugin *PluginInstance) Load() Plugin {
var carg0 *C.GstPlugin // in, none, converted
var cret *C.GstPlugin // return, full, converted
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_plugin_load(carg0)
runtime.KeepAlive(plugin)
var goret Plugin
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
return goret
}
// SetCacheData wraps gst_plugin_set_cache_data
//
// The function takes the following parameters:
//
// - cacheData *Structure: a structure containing the data to cache
//
// Adds plugin specific data to cache. Passes the ownership of the structure to
// the @plugin.
//
// The cache is flushed every time the registry is rebuilt.
func (plugin *PluginInstance) SetCacheData(cacheData *Structure) {
var carg0 *C.GstPlugin // in, none, converted
var carg1 *C.GstStructure // in, full, converted
carg0 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(cacheData))
C.gst_plugin_set_cache_data(carg0, carg1)
runtime.KeepAlive(plugin)
runtime.KeepAlive(cacheData)
}
// PluginFeatureInstance is the instance type used by all types extending GstPluginFeature. It is used internally by the bindings. Users should use the interface [PluginFeature] instead.
type PluginFeatureInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ PluginFeature = (*PluginFeatureInstance)(nil)
// PluginFeature wraps GstPluginFeature
//
// This is a base class for anything that can be added to a #GstPlugin.
type PluginFeature interface {
Object
upcastToGstPluginFeature() *PluginFeatureInstance
// CheckVersion wraps gst_plugin_feature_check_version
//
// The function takes the following parameters:
//
// - minMajor uint: minimum required major version
// - minMinor uint: minimum required minor version
// - minMicro uint: minimum required micro version
//
// The function returns the following values:
//
// - goret bool
//
// Checks whether the given plugin feature is at least the required version.
//
// Note: Since version 1.24 this function no longer returns %TRUE if the
// version is a git development version (e.g. 1.23.0.1) and the check is
// for the "next" micro version, that is it will no longer return %TRUE for
// e.g. 1.23.0.1 if the check is for 1.23.1. It is still possible to parse
// the nano version from the string and do this check that way if needed.
CheckVersion(uint, uint, uint) bool
// GetPlugin wraps gst_plugin_feature_get_plugin
// The function returns the following values:
//
// - goret Plugin
//
// Get the plugin that provides this feature.
GetPlugin() Plugin
// GetPluginName wraps gst_plugin_feature_get_plugin_name
// The function returns the following values:
//
// - goret string
//
// Get the name of the plugin that provides this feature.
GetPluginName() string
// GetRank wraps gst_plugin_feature_get_rank
// The function returns the following values:
//
// - goret uint
//
// Gets the rank of a plugin feature.
GetRank() uint
// Load wraps gst_plugin_feature_load
// The function returns the following values:
//
// - goret PluginFeature
//
// Loads the plugin containing @feature if it's not already loaded. @feature is
// unaffected; use the return value instead.
//
// Normally this function is used like this:
// |[&lt;!-- language="C" --&gt;
// GstPluginFeature *loaded_feature;
//
// loaded_feature = gst_plugin_feature_load (feature);
// // presumably, we're no longer interested in the potentially-unloaded feature
// gst_object_unref (feature);
// feature = loaded_feature;
// ]|
Load() PluginFeature
// SetRank wraps gst_plugin_feature_set_rank
//
// The function takes the following parameters:
//
// - rank uint: rank value - higher number means more priority rank
//
// Specifies a rank for a plugin feature, so that autoplugging uses
// the most appropriate feature.
SetRank(uint)
}
func unsafeWrapPluginFeature(base *gobject.ObjectInstance) *PluginFeatureInstance {
return &PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalPluginFeatureInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPluginFeature(gobject.ValueFromNative(p).Object()), nil
}
// UnsafePluginFeatureFromGlibNone is used to convert raw GstPluginFeature pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePluginFeatureFromGlibNone(c unsafe.Pointer) PluginFeature {
return gobject.UnsafeObjectFromGlibNone(c).(PluginFeature)
}
// UnsafePluginFeatureFromGlibFull is used to convert raw GstPluginFeature pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePluginFeatureFromGlibFull(c unsafe.Pointer) PluginFeature {
return gobject.UnsafeObjectFromGlibFull(c).(PluginFeature)
}
func (p *PluginFeatureInstance) upcastToGstPluginFeature() *PluginFeatureInstance {
return p
}
// UnsafePluginFeatureToGlibNone is used to convert the instance to it's C value GstPluginFeature. This is used by the bindings internally.
func UnsafePluginFeatureToGlibNone(c PluginFeature) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafePluginFeatureToGlibFull is used to convert the instance to it's C value GstPluginFeature, while removeing the finalizer. This is used by the bindings internally.
func UnsafePluginFeatureToGlibFull(c PluginFeature) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// PluginFeatureRankCompareFunc wraps gst_plugin_feature_rank_compare_func
//
// The function takes the following parameters:
//
// - p1 unsafe.Pointer (nullable): a #GstPluginFeature
// - p2 unsafe.Pointer (nullable): a #GstPluginFeature
//
// The function returns the following values:
//
// - goret int
//
// Compares the two given #GstPluginFeature instances. This function can be
// used as a #GCompareFunc when sorting by rank and then by name.
func PluginFeatureRankCompareFunc(p1 unsafe.Pointer, p2 unsafe.Pointer) int {
var carg1 C.gconstpointer // in, none, casted, nullable
var carg2 C.gconstpointer // in, none, casted, nullable
var cret C.gint // return, none, casted
if p1 != nil {
carg1 = C.gconstpointer(p1)
}
if p2 != nil {
carg2 = C.gconstpointer(p2)
}
cret = C.gst_plugin_feature_rank_compare_func(carg1, carg2)
runtime.KeepAlive(p1)
runtime.KeepAlive(p2)
var goret int
goret = int(cret)
return goret
}
// CheckVersion wraps gst_plugin_feature_check_version
//
// The function takes the following parameters:
//
// - minMajor uint: minimum required major version
// - minMinor uint: minimum required minor version
// - minMicro uint: minimum required micro version
//
// The function returns the following values:
//
// - goret bool
//
// Checks whether the given plugin feature is at least the required version.
//
// Note: Since version 1.24 this function no longer returns %TRUE if the
// version is a git development version (e.g. 1.23.0.1) and the check is
// for the "next" micro version, that is it will no longer return %TRUE for
// e.g. 1.23.0.1 if the check is for 1.23.1. It is still possible to parse
// the nano version from the string and do this check that way if needed.
func (feature *PluginFeatureInstance) CheckVersion(minMajor uint, minMinor uint, minMicro uint) bool {
var carg0 *C.GstPluginFeature // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.guint // in, none, casted
var carg3 C.guint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
carg1 = C.guint(minMajor)
carg2 = C.guint(minMinor)
carg3 = C.guint(minMicro)
cret = C.gst_plugin_feature_check_version(carg0, carg1, carg2, carg3)
runtime.KeepAlive(feature)
runtime.KeepAlive(minMajor)
runtime.KeepAlive(minMinor)
runtime.KeepAlive(minMicro)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetPlugin wraps gst_plugin_feature_get_plugin
// The function returns the following values:
//
// - goret Plugin
//
// Get the plugin that provides this feature.
func (feature *PluginFeatureInstance) GetPlugin() Plugin {
var carg0 *C.GstPluginFeature // in, none, converted
var cret *C.GstPlugin // return, full, converted
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
cret = C.gst_plugin_feature_get_plugin(carg0)
runtime.KeepAlive(feature)
var goret Plugin
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetPluginName wraps gst_plugin_feature_get_plugin_name
// The function returns the following values:
//
// - goret string
//
// Get the name of the plugin that provides this feature.
func (feature *PluginFeatureInstance) GetPluginName() string {
var carg0 *C.GstPluginFeature // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
cret = C.gst_plugin_feature_get_plugin_name(carg0)
runtime.KeepAlive(feature)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetRank wraps gst_plugin_feature_get_rank
// The function returns the following values:
//
// - goret uint
//
// Gets the rank of a plugin feature.
func (feature *PluginFeatureInstance) GetRank() uint {
var carg0 *C.GstPluginFeature // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
cret = C.gst_plugin_feature_get_rank(carg0)
runtime.KeepAlive(feature)
var goret uint
goret = uint(cret)
return goret
}
// Load wraps gst_plugin_feature_load
// The function returns the following values:
//
// - goret PluginFeature
//
// Loads the plugin containing @feature if it's not already loaded. @feature is
// unaffected; use the return value instead.
//
// Normally this function is used like this:
// |[&lt;!-- language="C" --&gt;
// GstPluginFeature *loaded_feature;
//
// loaded_feature = gst_plugin_feature_load (feature);
// // presumably, we're no longer interested in the potentially-unloaded feature
// gst_object_unref (feature);
// feature = loaded_feature;
// ]|
func (feature *PluginFeatureInstance) Load() PluginFeature {
var carg0 *C.GstPluginFeature // in, none, converted
var cret *C.GstPluginFeature // return, full, converted
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
cret = C.gst_plugin_feature_load(carg0)
runtime.KeepAlive(feature)
var goret PluginFeature
goret = UnsafePluginFeatureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// SetRank wraps gst_plugin_feature_set_rank
//
// The function takes the following parameters:
//
// - rank uint: rank value - higher number means more priority rank
//
// Specifies a rank for a plugin feature, so that autoplugging uses
// the most appropriate feature.
func (feature *PluginFeatureInstance) SetRank(rank uint) {
var carg0 *C.GstPluginFeature // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
carg1 = C.guint(rank)
C.gst_plugin_feature_set_rank(carg0, carg1)
runtime.KeepAlive(feature)
runtime.KeepAlive(rank)
}
// ProxyPadInstance is the instance type used by all types extending GstProxyPad. It is used internally by the bindings. Users should use the interface [ProxyPad] instead.
type ProxyPadInstance struct {
_ [0]func() // equal guard
PadInstance
}
var _ ProxyPad = (*ProxyPadInstance)(nil)
// ProxyPad wraps GstProxyPad
type ProxyPad interface {
Pad
upcastToGstProxyPad() *ProxyPadInstance
// GetInternal wraps gst_proxy_pad_get_internal
// The function returns the following values:
//
// - goret ProxyPad
//
// Get the internal pad of @pad. Unref target pad after usage.
//
// The internal pad of a #GstGhostPad is the internally used
// pad of opposite direction, which is used to link to the target.
GetInternal() ProxyPad
}
func unsafeWrapProxyPad(base *gobject.ObjectInstance) *ProxyPadInstance {
return &ProxyPadInstance{
PadInstance: PadInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalProxyPadInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapProxyPad(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeProxyPadFromGlibNone is used to convert raw GstProxyPad pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeProxyPadFromGlibNone(c unsafe.Pointer) ProxyPad {
return gobject.UnsafeObjectFromGlibNone(c).(ProxyPad)
}
// UnsafeProxyPadFromGlibFull is used to convert raw GstProxyPad pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeProxyPadFromGlibFull(c unsafe.Pointer) ProxyPad {
return gobject.UnsafeObjectFromGlibFull(c).(ProxyPad)
}
func (p *ProxyPadInstance) upcastToGstProxyPad() *ProxyPadInstance {
return p
}
// UnsafeProxyPadToGlibNone is used to convert the instance to it's C value GstProxyPad. This is used by the bindings internally.
func UnsafeProxyPadToGlibNone(c ProxyPad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeProxyPadToGlibFull is used to convert the instance to it's C value GstProxyPad, while removeing the finalizer. This is used by the bindings internally.
func UnsafeProxyPadToGlibFull(c ProxyPad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// ProxyPadChainDefault wraps gst_proxy_pad_chain_default
//
// The function takes the following parameters:
//
// - pad Pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
// - parent Object (nullable): the parent of @pad or %NULL
// - buffer *Buffer: the #GstBuffer to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Invoke the default chain function of the proxy pad.
func ProxyPadChainDefault(pad Pad, parent Object, buffer *Buffer) FlowReturn {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted, nullable
var carg3 *C.GstBuffer // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg3 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buffer))
cret = C.gst_proxy_pad_chain_default(carg1, carg2, carg3)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(buffer)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// ProxyPadChainListDefault wraps gst_proxy_pad_chain_list_default
//
// The function takes the following parameters:
//
// - pad Pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
// - parent Object (nullable): the parent of @pad or %NULL
// - list *BufferList: the #GstBufferList to send, return GST_FLOW_ERROR
// if not.
//
// The function returns the following values:
//
// - goret FlowReturn
//
// Invoke the default chain list function of the proxy pad.
func ProxyPadChainListDefault(pad Pad, parent Object, list *BufferList) FlowReturn {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted, nullable
var carg3 *C.GstBufferList // in, full, converted
var cret C.GstFlowReturn // return, none, casted
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg3 = (*C.GstBufferList)(UnsafeBufferListToGlibFull(list))
cret = C.gst_proxy_pad_chain_list_default(carg1, carg2, carg3)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(list)
var goret FlowReturn
goret = FlowReturn(cret)
return goret
}
// ProxyPadGetrangeDefault wraps gst_proxy_pad_getrange_default
//
// The function takes the following parameters:
//
// - pad Pad: a src #GstPad, returns #GST_FLOW_ERROR if not.
// - parent Object: the parent of @pad
// - offset uint64: The start offset of the buffer
// - size uint: The length of the buffer
//
// The function returns the following values:
//
// - buffer *Buffer: a pointer to hold the #GstBuffer,
// returns #GST_FLOW_ERROR if %NULL.
// - goret FlowReturn
//
// Invoke the default getrange function of the proxy pad.
func ProxyPadGetrangeDefault(pad Pad, parent Object, offset uint64, size uint) (*Buffer, FlowReturn) {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted
var carg3 C.guint64 // in, none, casted
var carg4 C.guint // in, none, casted
var carg5 *C.GstBuffer // out, full, converted
var cret C.GstFlowReturn // return, none, casted
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
carg3 = C.guint64(offset)
carg4 = C.guint(size)
cret = C.gst_proxy_pad_getrange_default(carg1, carg2, carg3, carg4, &carg5)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var buffer *Buffer
var goret FlowReturn
buffer = UnsafeBufferFromGlibFull(unsafe.Pointer(carg5))
goret = FlowReturn(cret)
return buffer, goret
}
// ProxyPadIterateInternalLinksDefault wraps gst_proxy_pad_iterate_internal_links_default
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to get the internal links of.
// - parent Object (nullable): the parent of @pad or %NULL
//
// The function returns the following values:
//
// - goret *Iterator
//
// Invoke the default iterate internal links function of the proxy pad.
func ProxyPadIterateInternalLinksDefault(pad Pad, parent Object) *Iterator {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted, nullable
var cret *C.GstIterator // return, full, converted
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
cret = C.gst_proxy_pad_iterate_internal_links_default(carg1, carg2)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetInternal wraps gst_proxy_pad_get_internal
// The function returns the following values:
//
// - goret ProxyPad
//
// Get the internal pad of @pad. Unref target pad after usage.
//
// The internal pad of a #GstGhostPad is the internally used
// pad of opposite direction, which is used to link to the target.
func (pad *ProxyPadInstance) GetInternal() ProxyPad {
var carg0 *C.GstProxyPad // in, none, converted
var cret *C.GstProxyPad // return, full, converted
carg0 = (*C.GstProxyPad)(UnsafeProxyPadToGlibNone(pad))
cret = C.gst_proxy_pad_get_internal(carg0)
runtime.KeepAlive(pad)
var goret ProxyPad
goret = UnsafeProxyPadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// RegistryInstance is the instance type used by all types extending GstRegistry. It is used internally by the bindings. Users should use the interface [Registry] instead.
type RegistryInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Registry = (*RegistryInstance)(nil)
// Registry wraps GstRegistry
//
// One registry holds the metadata of a set of plugins.
//
// &lt;emphasis role="bold"&gt;Design:&lt;/emphasis&gt;
//
// The #GstRegistry object is a list of plugins and some functions for dealing
// with them. Each #GstPlugin is matched 1-1 with a file on disk, and may or may
// not be loaded at a given time.
//
// The primary source, at all times, of plugin information is each plugin file
// itself. Thus, if an application wants information about a particular plugin,
// or wants to search for a feature that satisfies given criteria, the primary
// means of doing so is to load every plugin and look at the resulting
// information that is gathered in the default registry. Clearly, this is a time
// consuming process, so we cache information in the registry file. The format
// and location of the cache file is internal to gstreamer.
//
// On startup, plugins are searched for in the plugin search path. The following
// locations are checked in this order:
//
// * location from --gst-plugin-path commandline option.
// * the GST_PLUGIN_PATH environment variable.
// * the GST_PLUGIN_SYSTEM_PATH environment variable.
// * default locations (if GST_PLUGIN_SYSTEM_PATH is not set).
// Those default locations are:
// `$XDG_DATA_HOME/gstreamer-$GST_API_VERSION/plugins/`
// and `$prefix/libs/gstreamer-$GST_API_VERSION/`.
// [$XDG_DATA_HOME](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) defaults to
// `$HOME/.local/share`.
//
// The registry cache file is loaded from
// `$XDG_CACHE_HOME/gstreamer-$GST_API_VERSION/registry-$ARCH.bin`
// (where $XDG_CACHE_HOME defaults to `$HOME/.cache`) or the file listed in the `GST_REGISTRY`
// env var. One reason to change the registry location is for testing.
//
// For each plugin that is found in the plugin search path, there could be 3
// possibilities for cached information:
//
// * the cache may not contain information about a given file.
// * the cache may have stale information.
// * the cache may have current information.
//
// In the first two cases, the plugin is loaded and the cache updated. In
// addition to these cases, the cache may have entries for plugins that are not
// relevant to the current process. These are marked as not available to the
// current process. If the cache is updated for whatever reason, it is marked
// dirty.
//
// A dirty cache is written out at the end of initialization. Each entry is
// checked to make sure the information is minimally valid. If not, the entry is
// simply dropped.
//
// ## Implementation notes:
//
// The "cache" and "registry" are different concepts and can represent
// different sets of plugins. For various reasons, at init time, the cache is
// stored in the default registry, and plugins not relevant to the current
// process are marked with the %GST_PLUGIN_FLAG_CACHED bit. These plugins are
// removed at the end of initialization.
type Registry interface {
Object
upcastToGstRegistry() *RegistryInstance
// AddFeature wraps gst_registry_add_feature
//
// The function takes the following parameters:
//
// - feature PluginFeature: the feature to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the feature to the registry. The feature-added signal will be emitted.
//
// @feature's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
AddFeature(PluginFeature) bool
// AddPlugin wraps gst_registry_add_plugin
//
// The function takes the following parameters:
//
// - plugin Plugin: the plugin to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the plugin to the registry. The plugin-added signal will be emitted.
//
// @plugin's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
AddPlugin(Plugin) bool
// CheckFeatureVersion wraps gst_registry_check_feature_version
//
// The function takes the following parameters:
//
// - featureName string: the name of the feature (e.g. "oggdemux")
// - minMajor uint: the minimum major version number
// - minMinor uint: the minimum minor version number
// - minMicro uint: the minimum micro version number
//
// The function returns the following values:
//
// - goret bool
//
// Checks whether a plugin feature by the given name exists in
// @registry and whether its version is at least the
// version required.
CheckFeatureVersion(string, uint, uint, uint) bool
// FindFeature wraps gst_registry_find_feature
//
// The function takes the following parameters:
//
// - name string: the pluginfeature name to find
// - typ gobject.Type: the pluginfeature type to find
//
// The function returns the following values:
//
// - goret PluginFeature
//
// Find the pluginfeature with the given name and type in the registry.
FindFeature(string, gobject.Type) PluginFeature
// FindPlugin wraps gst_registry_find_plugin
//
// The function takes the following parameters:
//
// - name string: the plugin name to find
//
// The function returns the following values:
//
// - goret Plugin
//
// Find the plugin with the given name in the registry.
// The plugin will be reffed; caller is responsible for unreffing.
FindPlugin(string) Plugin
// GetFeatureListCookie wraps gst_registry_get_feature_list_cookie
// The function returns the following values:
//
// - goret uint32
//
// Returns the registry's feature list cookie. This changes
// every time a feature is added or removed from the registry.
GetFeatureListCookie() uint32
// Lookup wraps gst_registry_lookup
//
// The function takes the following parameters:
//
// - filename string: the name of the file to look up
//
// The function returns the following values:
//
// - goret Plugin
//
// Look up a plugin in the given registry with the given filename.
// If found, plugin is reffed.
Lookup(string) Plugin
// LookupFeature wraps gst_registry_lookup_feature
//
// The function takes the following parameters:
//
// - name string: a #GstPluginFeature name
//
// The function returns the following values:
//
// - goret PluginFeature
//
// Find a #GstPluginFeature with @name in @registry.
LookupFeature(string) PluginFeature
// RemoveFeature wraps gst_registry_remove_feature
//
// The function takes the following parameters:
//
// - feature PluginFeature: the feature to remove
//
// Remove the feature from the registry.
//
// MT safe.
RemoveFeature(PluginFeature)
// RemovePlugin wraps gst_registry_remove_plugin
//
// The function takes the following parameters:
//
// - plugin Plugin: the plugin to remove
//
// Remove the plugin from the registry.
//
// MT safe.
RemovePlugin(Plugin)
// ScanPath wraps gst_registry_scan_path
//
// The function takes the following parameters:
//
// - path string: the path to scan
//
// The function returns the following values:
//
// - goret bool
//
// Scan the given path for plugins to add to the registry. The syntax of the
// path is specific to the registry.
ScanPath(string) bool
}
func unsafeWrapRegistry(base *gobject.ObjectInstance) *RegistryInstance {
return &RegistryInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalRegistryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapRegistry(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeRegistryFromGlibNone is used to convert raw GstRegistry pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeRegistryFromGlibNone(c unsafe.Pointer) Registry {
return gobject.UnsafeObjectFromGlibNone(c).(Registry)
}
// UnsafeRegistryFromGlibFull is used to convert raw GstRegistry pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeRegistryFromGlibFull(c unsafe.Pointer) Registry {
return gobject.UnsafeObjectFromGlibFull(c).(Registry)
}
func (r *RegistryInstance) upcastToGstRegistry() *RegistryInstance {
return r
}
// UnsafeRegistryToGlibNone is used to convert the instance to it's C value GstRegistry. This is used by the bindings internally.
func UnsafeRegistryToGlibNone(c Registry) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeRegistryToGlibFull is used to convert the instance to it's C value GstRegistry, while removeing the finalizer. This is used by the bindings internally.
func UnsafeRegistryToGlibFull(c Registry) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// RegistryForkIsEnabled wraps gst_registry_fork_is_enabled
// The function returns the following values:
//
// - goret bool
//
// By default GStreamer will perform scanning and rebuilding of the
// registry file using a helper child process.
//
// Applications might want to disable this behaviour with the
// gst_registry_fork_set_enabled() function, in which case new plugins
// are scanned (and loaded) into the application process.
func RegistryForkIsEnabled() bool {
var cret C.gboolean // return
cret = C.gst_registry_fork_is_enabled()
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RegistryForkSetEnabled wraps gst_registry_fork_set_enabled
//
// The function takes the following parameters:
//
// - enabled bool: whether rebuilding the registry can use a temporary child helper process.
//
// Applications might want to disable/enable spawning of a child helper process
// when rebuilding the registry. See gst_registry_fork_is_enabled() for more
// information.
func RegistryForkSetEnabled(enabled bool) {
var carg1 C.gboolean // in
if enabled {
carg1 = C.TRUE
}
C.gst_registry_fork_set_enabled(carg1)
runtime.KeepAlive(enabled)
}
// RegistryGet wraps gst_registry_get
// The function returns the following values:
//
// - goret Registry
//
// Retrieves the singleton plugin registry. The caller does not own a
// reference on the registry, as it is alive as long as GStreamer is
// initialized.
func RegistryGet() Registry {
var cret *C.GstRegistry // return, none, converted
cret = C.gst_registry_get()
var goret Registry
goret = UnsafeRegistryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// AddFeature wraps gst_registry_add_feature
//
// The function takes the following parameters:
//
// - feature PluginFeature: the feature to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the feature to the registry. The feature-added signal will be emitted.
//
// @feature's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
func (registry *RegistryInstance) AddFeature(feature PluginFeature) bool {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.GstPluginFeature // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
cret = C.gst_registry_add_feature(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(feature)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AddPlugin wraps gst_registry_add_plugin
//
// The function takes the following parameters:
//
// - plugin Plugin: the plugin to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the plugin to the registry. The plugin-added signal will be emitted.
//
// @plugin's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
func (registry *RegistryInstance) AddPlugin(plugin Plugin) bool {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.GstPlugin // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
cret = C.gst_registry_add_plugin(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(plugin)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CheckFeatureVersion wraps gst_registry_check_feature_version
//
// The function takes the following parameters:
//
// - featureName string: the name of the feature (e.g. "oggdemux")
// - minMajor uint: the minimum major version number
// - minMinor uint: the minimum minor version number
// - minMicro uint: the minimum micro version number
//
// The function returns the following values:
//
// - goret bool
//
// Checks whether a plugin feature by the given name exists in
// @registry and whether its version is at least the
// version required.
func (registry *RegistryInstance) CheckFeatureVersion(featureName string, minMajor uint, minMinor uint, minMicro uint) bool {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint // in, none, casted
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(featureName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.guint(minMajor)
carg3 = C.guint(minMinor)
carg4 = C.guint(minMicro)
cret = C.gst_registry_check_feature_version(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(registry)
runtime.KeepAlive(featureName)
runtime.KeepAlive(minMajor)
runtime.KeepAlive(minMinor)
runtime.KeepAlive(minMicro)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FindFeature wraps gst_registry_find_feature
//
// The function takes the following parameters:
//
// - name string: the pluginfeature name to find
// - typ gobject.Type: the pluginfeature type to find
//
// The function returns the following values:
//
// - goret PluginFeature
//
// Find the pluginfeature with the given name and type in the registry.
func (registry *RegistryInstance) FindFeature(name string, typ gobject.Type) PluginFeature {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GType // in, none, casted, alias
var cret *C.GstPluginFeature // return, full, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GType(typ)
cret = C.gst_registry_find_feature(carg0, carg1, carg2)
runtime.KeepAlive(registry)
runtime.KeepAlive(name)
runtime.KeepAlive(typ)
var goret PluginFeature
goret = UnsafePluginFeatureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// FindPlugin wraps gst_registry_find_plugin
//
// The function takes the following parameters:
//
// - name string: the plugin name to find
//
// The function returns the following values:
//
// - goret Plugin
//
// Find the plugin with the given name in the registry.
// The plugin will be reffed; caller is responsible for unreffing.
func (registry *RegistryInstance) FindPlugin(name string) Plugin {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPlugin // return, full, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_registry_find_plugin(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(name)
var goret Plugin
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetFeatureListCookie wraps gst_registry_get_feature_list_cookie
// The function returns the following values:
//
// - goret uint32
//
// Returns the registry's feature list cookie. This changes
// every time a feature is added or removed from the registry.
func (registry *RegistryInstance) GetFeatureListCookie() uint32 {
var carg0 *C.GstRegistry // in, none, converted
var cret C.guint32 // return, none, casted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
cret = C.gst_registry_get_feature_list_cookie(carg0)
runtime.KeepAlive(registry)
var goret uint32
goret = uint32(cret)
return goret
}
// Lookup wraps gst_registry_lookup
//
// The function takes the following parameters:
//
// - filename string: the name of the file to look up
//
// The function returns the following values:
//
// - goret Plugin
//
// Look up a plugin in the given registry with the given filename.
// If found, plugin is reffed.
func (registry *RegistryInstance) Lookup(filename string) Plugin {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var cret *C.GstPlugin // return, full, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.char)(unsafe.Pointer(C.CString(filename)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_registry_lookup(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(filename)
var goret Plugin
goret = UnsafePluginFromGlibFull(unsafe.Pointer(cret))
return goret
}
// LookupFeature wraps gst_registry_lookup_feature
//
// The function takes the following parameters:
//
// - name string: a #GstPluginFeature name
//
// The function returns the following values:
//
// - goret PluginFeature
//
// Find a #GstPluginFeature with @name in @registry.
func (registry *RegistryInstance) LookupFeature(name string) PluginFeature {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var cret *C.GstPluginFeature // return, full, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.char)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_registry_lookup_feature(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(name)
var goret PluginFeature
goret = UnsafePluginFeatureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// RemoveFeature wraps gst_registry_remove_feature
//
// The function takes the following parameters:
//
// - feature PluginFeature: the feature to remove
//
// Remove the feature from the registry.
//
// MT safe.
func (registry *RegistryInstance) RemoveFeature(feature PluginFeature) {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.GstPluginFeature // in, none, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.GstPluginFeature)(UnsafePluginFeatureToGlibNone(feature))
C.gst_registry_remove_feature(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(feature)
}
// RemovePlugin wraps gst_registry_remove_plugin
//
// The function takes the following parameters:
//
// - plugin Plugin: the plugin to remove
//
// Remove the plugin from the registry.
//
// MT safe.
func (registry *RegistryInstance) RemovePlugin(plugin Plugin) {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.GstPlugin // in, none, converted
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
C.gst_registry_remove_plugin(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(plugin)
}
// ScanPath wraps gst_registry_scan_path
//
// The function takes the following parameters:
//
// - path string: the path to scan
//
// The function returns the following values:
//
// - goret bool
//
// Scan the given path for plugins to add to the registry. The syntax of the
// path is specific to the registry.
func (registry *RegistryInstance) ScanPath(path string) bool {
var carg0 *C.GstRegistry // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstRegistry)(UnsafeRegistryToGlibNone(registry))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(path)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_registry_scan_path(carg0, carg1)
runtime.KeepAlive(registry)
runtime.KeepAlive(path)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// 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
ObjectInstance
}
var _ Stream = (*StreamInstance)(nil)
// Stream wraps GstStream
//
// A high-level object representing a single stream. It might be backed, or
// not, by an actual flow of data in a pipeline (#GstPad).
//
// A #GstStream does not care about data changes (such as decoding, encoding,
// parsing,...) as long as the underlying data flow corresponds to the same
// high-level flow (ex: a certain audio track).
//
// A #GstStream contains all the information pertinent to a stream, such as
// stream-id, tags, caps, type, ...
//
// Elements can subclass a #GstStream for internal usage (to contain information
// pertinent to streams of data).
type Stream interface {
Object
upcastToGstStream() *StreamInstance
// GetCaps wraps gst_stream_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Retrieve the caps for @stream, if any
GetCaps() *Caps
// GetStreamFlags wraps gst_stream_get_stream_flags
// The function returns the following values:
//
// - goret StreamFlags
//
// Retrieve the current stream flags for @stream
GetStreamFlags() StreamFlags
// GetStreamID wraps gst_stream_get_stream_id
// The function returns the following values:
//
// - goret string
//
// Returns the stream ID of @stream.
GetStreamID() string
// GetStreamType wraps gst_stream_get_stream_type
// The function returns the following values:
//
// - goret StreamType
//
// Retrieve the stream type for @stream
GetStreamType() StreamType
// GetTags wraps gst_stream_get_tags
// The function returns the following values:
//
// - goret *TagList
//
// Retrieve the tags for @stream, if any
GetTags() *TagList
// SetCaps wraps gst_stream_set_caps
//
// The function takes the following parameters:
//
// - caps *Caps (nullable): a #GstCaps
//
// Set the caps for the #GstStream
SetCaps(*Caps)
// SetStreamFlags wraps gst_stream_set_stream_flags
//
// The function takes the following parameters:
//
// - flags StreamFlags: the flags to set on @stream
//
// Set the @flags for the @stream.
SetStreamFlags(StreamFlags)
// SetStreamType wraps gst_stream_set_stream_type
//
// The function takes the following parameters:
//
// - streamType StreamType: the type to set on @stream
//
// Set the stream type of @stream
SetStreamType(StreamType)
// SetTags wraps gst_stream_set_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): a #GstTagList
//
// Set the tags for the #GstStream
SetTags(*TagList)
}
func unsafeWrapStream(base *gobject.ObjectInstance) *StreamInstance {
return &StreamInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalStreamInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapStream(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeStreamFromGlibNone is used to convert raw GstStream pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeStreamFromGlibNone(c unsafe.Pointer) Stream {
return gobject.UnsafeObjectFromGlibNone(c).(Stream)
}
// UnsafeStreamFromGlibFull is used to convert raw GstStream pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeStreamFromGlibFull(c unsafe.Pointer) Stream {
return gobject.UnsafeObjectFromGlibFull(c).(Stream)
}
func (s *StreamInstance) upcastToGstStream() *StreamInstance {
return s
}
// UnsafeStreamToGlibNone is used to convert the instance to it's C value GstStream. This is used by the bindings internally.
func UnsafeStreamToGlibNone(c Stream) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeStreamToGlibFull is used to convert the instance to it's C value GstStream, while removeing the finalizer. This is used by the bindings internally.
func UnsafeStreamToGlibFull(c Stream) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewStream wraps gst_stream_new
//
// The function takes the following parameters:
//
// - streamId string (nullable): the id for the new stream. If %NULL,
// a new one will be automatically generated
// - caps *Caps (nullable): the #GstCaps of the stream
// - typ StreamType: the #GstStreamType of the stream
// - flags StreamFlags: the #GstStreamFlags of the stream
//
// The function returns the following values:
//
// - goret Stream
//
// Create a new #GstStream for the given @stream_id, @caps, @type
// and @flags
func NewStream(streamId string, caps *Caps, typ StreamType, flags StreamFlags) Stream {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstCaps // in, none, converted, nullable
var carg3 C.GstStreamType // in, none, casted
var carg4 C.GstStreamFlags // in, none, casted
var cret *C.GstStream // return, full, converted
if streamId != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(streamId)))
defer C.free(unsafe.Pointer(carg1))
}
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
carg3 = C.GstStreamType(typ)
carg4 = C.GstStreamFlags(flags)
cret = C.gst_stream_new(carg1, carg2, carg3, carg4)
runtime.KeepAlive(streamId)
runtime.KeepAlive(caps)
runtime.KeepAlive(typ)
runtime.KeepAlive(flags)
var goret Stream
goret = UnsafeStreamFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCaps wraps gst_stream_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Retrieve the caps for @stream, if any
func (stream *StreamInstance) GetCaps() *Caps {
var carg0 *C.GstStream // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
cret = C.gst_stream_get_caps(carg0)
runtime.KeepAlive(stream)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetStreamFlags wraps gst_stream_get_stream_flags
// The function returns the following values:
//
// - goret StreamFlags
//
// Retrieve the current stream flags for @stream
func (stream *StreamInstance) GetStreamFlags() StreamFlags {
var carg0 *C.GstStream // in, none, converted
var cret C.GstStreamFlags // return, none, casted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
cret = C.gst_stream_get_stream_flags(carg0)
runtime.KeepAlive(stream)
var goret StreamFlags
goret = StreamFlags(cret)
return goret
}
// GetStreamID wraps gst_stream_get_stream_id
// The function returns the following values:
//
// - goret string
//
// Returns the stream ID of @stream.
func (stream *StreamInstance) GetStreamID() string {
var carg0 *C.GstStream // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
cret = C.gst_stream_get_stream_id(carg0)
runtime.KeepAlive(stream)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetStreamType wraps gst_stream_get_stream_type
// The function returns the following values:
//
// - goret StreamType
//
// Retrieve the stream type for @stream
func (stream *StreamInstance) GetStreamType() StreamType {
var carg0 *C.GstStream // in, none, converted
var cret C.GstStreamType // return, none, casted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
cret = C.gst_stream_get_stream_type(carg0)
runtime.KeepAlive(stream)
var goret StreamType
goret = StreamType(cret)
return goret
}
// GetTags wraps gst_stream_get_tags
// The function returns the following values:
//
// - goret *TagList
//
// Retrieve the tags for @stream, if any
func (stream *StreamInstance) GetTags() *TagList {
var carg0 *C.GstStream // in, none, converted
var cret *C.GstTagList // return, full, converted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
cret = C.gst_stream_get_tags(carg0)
runtime.KeepAlive(stream)
var goret *TagList
goret = UnsafeTagListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// SetCaps wraps gst_stream_set_caps
//
// The function takes the following parameters:
//
// - caps *Caps (nullable): a #GstCaps
//
// Set the caps for the #GstStream
func (stream *StreamInstance) SetCaps(caps *Caps) {
var carg0 *C.GstStream // in, none, converted
var carg1 *C.GstCaps // in, none, converted, nullable
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
if caps != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
C.gst_stream_set_caps(carg0, carg1)
runtime.KeepAlive(stream)
runtime.KeepAlive(caps)
}
// SetStreamFlags wraps gst_stream_set_stream_flags
//
// The function takes the following parameters:
//
// - flags StreamFlags: the flags to set on @stream
//
// Set the @flags for the @stream.
func (stream *StreamInstance) SetStreamFlags(flags StreamFlags) {
var carg0 *C.GstStream // in, none, converted
var carg1 C.GstStreamFlags // in, none, casted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
carg1 = C.GstStreamFlags(flags)
C.gst_stream_set_stream_flags(carg0, carg1)
runtime.KeepAlive(stream)
runtime.KeepAlive(flags)
}
// SetStreamType wraps gst_stream_set_stream_type
//
// The function takes the following parameters:
//
// - streamType StreamType: the type to set on @stream
//
// Set the stream type of @stream
func (stream *StreamInstance) SetStreamType(streamType StreamType) {
var carg0 *C.GstStream // in, none, converted
var carg1 C.GstStreamType // in, none, casted
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
carg1 = C.GstStreamType(streamType)
C.gst_stream_set_stream_type(carg0, carg1)
runtime.KeepAlive(stream)
runtime.KeepAlive(streamType)
}
// SetTags wraps gst_stream_set_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): a #GstTagList
//
// Set the tags for the #GstStream
func (stream *StreamInstance) SetTags(tags *TagList) {
var carg0 *C.GstStream // in, none, converted
var carg1 *C.GstTagList // in, none, converted, nullable
carg0 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
if tags != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(tags))
}
C.gst_stream_set_tags(carg0, carg1)
runtime.KeepAlive(stream)
runtime.KeepAlive(tags)
}
// StreamCollectionInstance is the instance type used by all types extending GstStreamCollection. It is used internally by the bindings. Users should use the interface [StreamCollection] instead.
type StreamCollectionInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ StreamCollection = (*StreamCollectionInstance)(nil)
// StreamCollection wraps GstStreamCollection
//
// A collection of #GstStream that are available.
//
// A #GstStreamCollection will be provided by elements that can make those
// streams available. Applications can use the collection to show the user
// what streams are available by using %gst_stream_collection_get_stream()
//
// Once posted, a #GstStreamCollection is immutable. Updates are made by sending
// a new #GstStreamCollection message, which may or may not share some of
// the #GstStream objects from the collection it replaces. The receiver can check
// the sender of a stream collection message to know which collection is
// obsoleted.
//
// Several elements in a pipeline can provide #GstStreamCollection.
//
// Applications can activate streams from a collection by using the
// #GST_EVENT_SELECT_STREAMS event on a pipeline, bin or element.
type StreamCollection interface {
Object
upcastToGstStreamCollection() *StreamCollectionInstance
// AddStream wraps gst_stream_collection_add_stream
//
// The function takes the following parameters:
//
// - stream Stream: the #GstStream to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the given @stream to the @collection.
AddStream(Stream) bool
// GetSize wraps gst_stream_collection_get_size
// The function returns the following values:
//
// - goret uint
//
// Get the number of streams this collection contains
GetSize() uint
// GetStream wraps gst_stream_collection_get_stream
//
// The function takes the following parameters:
//
// - index uint: Index of the stream to retrieve
//
// The function returns the following values:
//
// - goret Stream
//
// Retrieve the #GstStream with index @index from the collection.
//
// The caller should not modify the returned #GstStream
GetStream(uint) Stream
// GetUpstreamID wraps gst_stream_collection_get_upstream_id
// The function returns the following values:
//
// - goret string
//
// Returns the upstream id of the @collection.
GetUpstreamID() string
}
func unsafeWrapStreamCollection(base *gobject.ObjectInstance) *StreamCollectionInstance {
return &StreamCollectionInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalStreamCollectionInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapStreamCollection(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeStreamCollectionFromGlibNone is used to convert raw GstStreamCollection pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeStreamCollectionFromGlibNone(c unsafe.Pointer) StreamCollection {
return gobject.UnsafeObjectFromGlibNone(c).(StreamCollection)
}
// UnsafeStreamCollectionFromGlibFull is used to convert raw GstStreamCollection pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeStreamCollectionFromGlibFull(c unsafe.Pointer) StreamCollection {
return gobject.UnsafeObjectFromGlibFull(c).(StreamCollection)
}
func (s *StreamCollectionInstance) upcastToGstStreamCollection() *StreamCollectionInstance {
return s
}
// UnsafeStreamCollectionToGlibNone is used to convert the instance to it's C value GstStreamCollection. This is used by the bindings internally.
func UnsafeStreamCollectionToGlibNone(c StreamCollection) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeStreamCollectionToGlibFull is used to convert the instance to it's C value GstStreamCollection, while removeing the finalizer. This is used by the bindings internally.
func UnsafeStreamCollectionToGlibFull(c StreamCollection) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewStreamCollection wraps gst_stream_collection_new
//
// The function takes the following parameters:
//
// - upstreamId string (nullable): The stream id of the parent stream
//
// The function returns the following values:
//
// - goret StreamCollection
//
// Create a new #GstStreamCollection.
func NewStreamCollection(upstreamId string) StreamCollection {
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstStreamCollection // return, full, converted
if upstreamId != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(upstreamId)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_stream_collection_new(carg1)
runtime.KeepAlive(upstreamId)
var goret StreamCollection
goret = UnsafeStreamCollectionFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddStream wraps gst_stream_collection_add_stream
//
// The function takes the following parameters:
//
// - stream Stream: the #GstStream to add
//
// The function returns the following values:
//
// - goret bool
//
// Add the given @stream to the @collection.
func (collection *StreamCollectionInstance) AddStream(stream Stream) bool {
var carg0 *C.GstStreamCollection // in, none, converted
var carg1 *C.GstStream // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
carg1 = (*C.GstStream)(UnsafeStreamToGlibFull(stream))
cret = C.gst_stream_collection_add_stream(carg0, carg1)
runtime.KeepAlive(collection)
runtime.KeepAlive(stream)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetSize wraps gst_stream_collection_get_size
// The function returns the following values:
//
// - goret uint
//
// Get the number of streams this collection contains
func (collection *StreamCollectionInstance) GetSize() uint {
var carg0 *C.GstStreamCollection // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
cret = C.gst_stream_collection_get_size(carg0)
runtime.KeepAlive(collection)
var goret uint
goret = uint(cret)
return goret
}
// GetStream wraps gst_stream_collection_get_stream
//
// The function takes the following parameters:
//
// - index uint: Index of the stream to retrieve
//
// The function returns the following values:
//
// - goret Stream
//
// Retrieve the #GstStream with index @index from the collection.
//
// The caller should not modify the returned #GstStream
func (collection *StreamCollectionInstance) GetStream(index uint) Stream {
var carg0 *C.GstStreamCollection // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstStream // return, none, converted
carg0 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
carg1 = C.guint(index)
cret = C.gst_stream_collection_get_stream(carg0, carg1)
runtime.KeepAlive(collection)
runtime.KeepAlive(index)
var goret Stream
goret = UnsafeStreamFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetUpstreamID wraps gst_stream_collection_get_upstream_id
// The function returns the following values:
//
// - goret string
//
// Returns the upstream id of the @collection.
func (collection *StreamCollectionInstance) GetUpstreamID() string {
var carg0 *C.GstStreamCollection // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
cret = C.gst_stream_collection_get_upstream_id(carg0)
runtime.KeepAlive(collection)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// TaskInstance is the instance type used by all types extending GstTask. It is used internally by the bindings. Users should use the interface [Task] instead.
type TaskInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Task = (*TaskInstance)(nil)
// Task wraps GstTask
//
// #GstTask is used by #GstElement and #GstPad to provide the data passing
// threads in a #GstPipeline.
//
// A #GstPad will typically start a #GstTask to push or pull data to/from the
// peer pads. Most source elements start a #GstTask to push data. In some cases
// a demuxer element can start a #GstTask to pull data from a peer element. This
// is typically done when the demuxer can perform random access on the upstream
// peer element for improved performance.
//
// Although convenience functions exist on #GstPad to start/pause/stop tasks, it
// might sometimes be needed to create a #GstTask manually if it is not related to
// a #GstPad.
//
// Before the #GstTask can be run, it needs a #GRecMutex that can be set with
// gst_task_set_lock().
//
// The task can be started, paused and stopped with gst_task_start(), gst_task_pause()
// and gst_task_stop() respectively or with the gst_task_set_state() function.
//
// A #GstTask will repeatedly call the #GstTaskFunction with the user data
// that was provided when creating the task with gst_task_new(). While calling
// the function it will acquire the provided lock. The provided lock is released
// when the task pauses or stops.
//
// Stopping a task with gst_task_stop() will not immediately make sure the task is
// not running anymore. Use gst_task_join() to make sure the task is completely
// stopped and the thread is stopped.
//
// After creating a #GstTask, use gst_object_unref() to free its resources. This can
// only be done when the task is not running anymore.
//
// Task functions can send a #GstMessage to send out-of-band data to the
// application. The application can receive messages from the #GstBus in its
// mainloop.
//
// For debugging purposes, the task will configure its object name as the thread
// name on Linux. Please note that the object name should be configured before the
// task is started; changing the object name after the task has been started, has
// no effect on the thread name.
type Task interface {
Object
upcastToGstTask() *TaskInstance
// GetPool wraps gst_task_get_pool
// The function returns the following values:
//
// - goret TaskPool
//
// Get the #GstTaskPool that this task will use for its streaming
// threads.
//
// MT safe.
GetPool() TaskPool
// GetState wraps gst_task_get_state
// The function returns the following values:
//
// - goret TaskState
//
// Get the current state of the task.
GetState() TaskState
// Join wraps gst_task_join
// The function returns the following values:
//
// - goret bool
//
// Joins @task. After this call, it is safe to unref the task
// and clean up the lock set with gst_task_set_lock().
//
// The task will automatically be stopped with this call.
//
// This function cannot be called from within a task function as this
// would cause a deadlock. The function will detect this and print a
// g_warning.
Join() bool
// Pause wraps gst_task_pause
// The function returns the following values:
//
// - goret bool
//
// Pauses @task. This method can also be called on a task in the
// stopped state, in which case a thread will be started and will remain
// in the paused state. This function does not wait for the task to complete
// the paused state.
Pause() bool
// Resume wraps gst_task_resume
// The function returns the following values:
//
// - goret bool
//
// Resume @task in case it was paused. If the task was stopped, it will
// remain in that state and this function will return %FALSE.
Resume() bool
// SetPool wraps gst_task_set_pool
//
// The function takes the following parameters:
//
// - pool TaskPool: a #GstTaskPool
//
// Set @pool as the new GstTaskPool for @task. Any new streaming threads that
// will be created by @task will now use @pool.
//
// MT safe.
SetPool(TaskPool)
// SetState wraps gst_task_set_state
//
// The function takes the following parameters:
//
// - state TaskState: the new task state
//
// The function returns the following values:
//
// - goret bool
//
// Sets the state of @task to @state.
//
// The @task must have a lock associated with it using
// gst_task_set_lock() when going to GST_TASK_STARTED or GST_TASK_PAUSED or
// this function will return %FALSE.
//
// MT safe.
SetState(TaskState) bool
// Start wraps gst_task_start
// The function returns the following values:
//
// - goret bool
//
// Starts @task. The @task must have a lock associated with it using
// gst_task_set_lock() or this function will return %FALSE.
Start() bool
// Stop wraps gst_task_stop
// The function returns the following values:
//
// - goret bool
//
// Stops @task. This method merely schedules the task to stop and
// will not wait for the task to have completely stopped. Use
// gst_task_join() to stop and wait for completion.
Stop() bool
}
func unsafeWrapTask(base *gobject.ObjectInstance) *TaskInstance {
return &TaskInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalTaskInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTask(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTaskFromGlibNone is used to convert raw GstTask pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTaskFromGlibNone(c unsafe.Pointer) Task {
return gobject.UnsafeObjectFromGlibNone(c).(Task)
}
// UnsafeTaskFromGlibFull is used to convert raw GstTask pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTaskFromGlibFull(c unsafe.Pointer) Task {
return gobject.UnsafeObjectFromGlibFull(c).(Task)
}
func (t *TaskInstance) upcastToGstTask() *TaskInstance {
return t
}
// UnsafeTaskToGlibNone is used to convert the instance to it's C value GstTask. This is used by the bindings internally.
func UnsafeTaskToGlibNone(c Task) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTaskToGlibFull is used to convert the instance to it's C value GstTask, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTaskToGlibFull(c Task) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewTask wraps gst_task_new
//
// The function takes the following parameters:
//
// - fn TaskFunction: The #GstTaskFunction to use
//
// The function returns the following values:
//
// - goret Task
//
// Create a new Task that will repeatedly call the provided @func
// with @user_data as a parameter. Typically the task will run in
// a new thread.
//
// The function cannot be changed after the task has been created. You
// must create a new #GstTask to change the function.
//
// This function will not yet create and start a thread. Use gst_task_start() or
// gst_task_pause() to create and start the GThread.
//
// Before the task can be used, a #GRecMutex must be configured using the
// gst_task_set_lock() function. This lock will always be acquired while
// @func is called.
func NewTask(fn TaskFunction) Task {
var carg1 C.GstTaskFunction // callback, scope: notified, closure: carg2, destroy: carg3
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
var cret *C.GstTask // return, full, converted
carg1 = (*[0]byte)(C._gotk4_gst1_TaskFunction)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_task_new(carg1, carg2, carg3)
runtime.KeepAlive(fn)
var goret Task
goret = UnsafeTaskFromGlibFull(unsafe.Pointer(cret))
return goret
}
// TaskCleanupAll wraps gst_task_cleanup_all
//
// Wait for all tasks to be stopped. This is mainly used internally
// to ensure proper cleanup of internal data structures in test suites.
//
// MT safe.
func TaskCleanupAll() {
C.gst_task_cleanup_all()
}
// GetPool wraps gst_task_get_pool
// The function returns the following values:
//
// - goret TaskPool
//
// Get the #GstTaskPool that this task will use for its streaming
// threads.
//
// MT safe.
func (task *TaskInstance) GetPool() TaskPool {
var carg0 *C.GstTask // in, none, converted
var cret *C.GstTaskPool // return, full, converted
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_get_pool(carg0)
runtime.KeepAlive(task)
var goret TaskPool
goret = UnsafeTaskPoolFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetState wraps gst_task_get_state
// The function returns the following values:
//
// - goret TaskState
//
// Get the current state of the task.
func (task *TaskInstance) GetState() TaskState {
var carg0 *C.GstTask // in, none, converted
var cret C.GstTaskState // return, none, casted
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_get_state(carg0)
runtime.KeepAlive(task)
var goret TaskState
goret = TaskState(cret)
return goret
}
// Join wraps gst_task_join
// The function returns the following values:
//
// - goret bool
//
// Joins @task. After this call, it is safe to unref the task
// and clean up the lock set with gst_task_set_lock().
//
// The task will automatically be stopped with this call.
//
// This function cannot be called from within a task function as this
// would cause a deadlock. The function will detect this and print a
// g_warning.
func (task *TaskInstance) Join() bool {
var carg0 *C.GstTask // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_join(carg0)
runtime.KeepAlive(task)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Pause wraps gst_task_pause
// The function returns the following values:
//
// - goret bool
//
// Pauses @task. This method can also be called on a task in the
// stopped state, in which case a thread will be started and will remain
// in the paused state. This function does not wait for the task to complete
// the paused state.
func (task *TaskInstance) Pause() bool {
var carg0 *C.GstTask // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_pause(carg0)
runtime.KeepAlive(task)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Resume wraps gst_task_resume
// The function returns the following values:
//
// - goret bool
//
// Resume @task in case it was paused. If the task was stopped, it will
// remain in that state and this function will return %FALSE.
func (task *TaskInstance) Resume() bool {
var carg0 *C.GstTask // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_resume(carg0)
runtime.KeepAlive(task)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetPool wraps gst_task_set_pool
//
// The function takes the following parameters:
//
// - pool TaskPool: a #GstTaskPool
//
// Set @pool as the new GstTaskPool for @task. Any new streaming threads that
// will be created by @task will now use @pool.
//
// MT safe.
func (task *TaskInstance) SetPool(pool TaskPool) {
var carg0 *C.GstTask // in, none, converted
var carg1 *C.GstTaskPool // in, none, converted
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
carg1 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool))
C.gst_task_set_pool(carg0, carg1)
runtime.KeepAlive(task)
runtime.KeepAlive(pool)
}
// SetState wraps gst_task_set_state
//
// The function takes the following parameters:
//
// - state TaskState: the new task state
//
// The function returns the following values:
//
// - goret bool
//
// Sets the state of @task to @state.
//
// The @task must have a lock associated with it using
// gst_task_set_lock() when going to GST_TASK_STARTED or GST_TASK_PAUSED or
// this function will return %FALSE.
//
// MT safe.
func (task *TaskInstance) SetState(state TaskState) bool {
var carg0 *C.GstTask // in, none, converted
var carg1 C.GstTaskState // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
carg1 = C.GstTaskState(state)
cret = C.gst_task_set_state(carg0, carg1)
runtime.KeepAlive(task)
runtime.KeepAlive(state)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Start wraps gst_task_start
// The function returns the following values:
//
// - goret bool
//
// Starts @task. The @task must have a lock associated with it using
// gst_task_set_lock() or this function will return %FALSE.
func (task *TaskInstance) Start() bool {
var carg0 *C.GstTask // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_start(carg0)
runtime.KeepAlive(task)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Stop wraps gst_task_stop
// The function returns the following values:
//
// - goret bool
//
// Stops @task. This method merely schedules the task to stop and
// will not wait for the task to have completely stopped. Use
// gst_task_join() to stop and wait for completion.
func (task *TaskInstance) Stop() bool {
var carg0 *C.GstTask // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTask)(UnsafeTaskToGlibNone(task))
cret = C.gst_task_stop(carg0)
runtime.KeepAlive(task)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// TaskPoolInstance is the instance type used by all types extending GstTaskPool. It is used internally by the bindings. Users should use the interface [TaskPool] instead.
type TaskPoolInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ TaskPool = (*TaskPoolInstance)(nil)
// TaskPool wraps GstTaskPool
//
// This object provides an abstraction for creating threads. The default
// implementation uses a regular GThreadPool to start tasks.
//
// Subclasses can be made to create custom threads.
type TaskPool interface {
Object
upcastToGstTaskPool() *TaskPoolInstance
// Cleanup wraps gst_task_pool_cleanup
//
// Wait for all tasks to be stopped. This is mainly used internally
// to ensure proper cleanup of internal data structures in test suites.
//
// 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:
//
// - _goerr error (nullable): an error
//
// Prepare the taskpool for accepting gst_task_pool_push() operations.
//
// 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 {
return &TaskPoolInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalTaskPoolInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTaskPool(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTaskPoolFromGlibNone is used to convert raw GstTaskPool pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTaskPoolFromGlibNone(c unsafe.Pointer) TaskPool {
return gobject.UnsafeObjectFromGlibNone(c).(TaskPool)
}
// UnsafeTaskPoolFromGlibFull is used to convert raw GstTaskPool pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTaskPoolFromGlibFull(c unsafe.Pointer) TaskPool {
return gobject.UnsafeObjectFromGlibFull(c).(TaskPool)
}
func (t *TaskPoolInstance) upcastToGstTaskPool() *TaskPoolInstance {
return t
}
// UnsafeTaskPoolToGlibNone is used to convert the instance to it's C value GstTaskPool. This is used by the bindings internally.
func UnsafeTaskPoolToGlibNone(c TaskPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTaskPoolToGlibFull is used to convert the instance to it's C value GstTaskPool, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTaskPoolToGlibFull(c TaskPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewTaskPool wraps gst_task_pool_new
// The function returns the following values:
//
// - goret TaskPool
//
// Create a new default task pool. The default task pool will use a regular
// GThreadPool for threads.
func NewTaskPool() TaskPool {
var cret *C.GstTaskPool // return, full, converted
cret = C.gst_task_pool_new()
var goret TaskPool
goret = UnsafeTaskPoolFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Cleanup wraps gst_task_pool_cleanup
//
// Wait for all tasks to be stopped. This is mainly used internally
// to ensure proper cleanup of internal data structures in test suites.
//
// MT safe.
func (pool *TaskPoolInstance) Cleanup() {
var carg0 *C.GstTaskPool // in, none, converted
carg0 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool))
C.gst_task_pool_cleanup(carg0)
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:
//
// - _goerr error (nullable): an error
//
// Prepare the taskpool for accepting gst_task_pool_push() operations.
//
// MT safe.
func (pool *TaskPoolInstance) Prepare() error {
var carg0 *C.GstTaskPool // in, none, converted
var _cerr *C.GError // out, full, converted, nullable
carg0 = (*C.GstTaskPool)(UnsafeTaskPoolToGlibNone(pool))
C.gst_task_pool_prepare(carg0, &_cerr)
runtime.KeepAlive(pool)
var _goerr error
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
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
ObjectInstance
}
var _ Tracer = (*TracerInstance)(nil)
// Tracer wraps GstTracer
//
// Tracing modules will subclass #GstTracer and register through
// gst_tracer_register(). Modules can attach to various hook-types - see
// gst_tracing_register_hook(). When invoked they receive hook specific
// contextual data, which they must not modify.
type Tracer interface {
Object
upcastToGstTracer() *TracerInstance
}
func unsafeWrapTracer(base *gobject.ObjectInstance) *TracerInstance {
return &TracerInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalTracerInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTracer(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTracerFromGlibNone is used to convert raw GstTracer pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerFromGlibNone(c unsafe.Pointer) Tracer {
return gobject.UnsafeObjectFromGlibNone(c).(Tracer)
}
// UnsafeTracerFromGlibFull is used to convert raw GstTracer pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerFromGlibFull(c unsafe.Pointer) Tracer {
return gobject.UnsafeObjectFromGlibFull(c).(Tracer)
}
func (t *TracerInstance) upcastToGstTracer() *TracerInstance {
return t
}
// UnsafeTracerToGlibNone is used to convert the instance to it's C value GstTracer. This is used by the bindings internally.
func UnsafeTracerToGlibNone(c Tracer) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTracerToGlibFull is used to convert the instance to it's C value GstTracer, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTracerToGlibFull(c Tracer) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// TracerRegister wraps gst_tracer_register
//
// The function takes the following parameters:
//
// - plugin Plugin (nullable): A #GstPlugin, or %NULL for a static typefind function
// - name string: The name for registering
// - typ gobject.Type: GType of tracer to register
//
// The function returns the following values:
//
// - goret bool
//
// Create a new tracer-factory capable of instantiating objects of the
// @type and add the factory to @plugin.
func TracerRegister(plugin Plugin, name string, typ gobject.Type) bool {
var carg1 *C.GstPlugin // in, none, converted, nullable
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 C.GType // in, none, casted, alias
var cret C.gboolean // return
if plugin != nil {
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
}
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
carg3 = C.GType(typ)
cret = C.gst_tracer_register(carg1, carg2, carg3)
runtime.KeepAlive(plugin)
runtime.KeepAlive(name)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// TracerFactoryInstance is the instance type used by all types extending GstTracerFactory. It is used internally by the bindings. Users should use the interface [TracerFactory] instead.
type TracerFactoryInstance struct {
_ [0]func() // equal guard
PluginFeatureInstance
}
var _ TracerFactory = (*TracerFactoryInstance)(nil)
// TracerFactory wraps GstTracerFactory
//
// Use gst_tracer_factory_get_list() to get a list of tracer factories known to
// GStreamer.
type TracerFactory interface {
PluginFeature
upcastToGstTracerFactory() *TracerFactoryInstance
// GetTracerType wraps gst_tracer_factory_get_tracer_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for elements managed by this factory. The type can
// only be retrieved if the element factory is loaded, which can be
// assured with gst_plugin_feature_load().
GetTracerType() gobject.Type
}
func unsafeWrapTracerFactory(base *gobject.ObjectInstance) *TracerFactoryInstance {
return &TracerFactoryInstance{
PluginFeatureInstance: PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalTracerFactoryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTracerFactory(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTracerFactoryFromGlibNone is used to convert raw GstTracerFactory pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerFactoryFromGlibNone(c unsafe.Pointer) TracerFactory {
return gobject.UnsafeObjectFromGlibNone(c).(TracerFactory)
}
// UnsafeTracerFactoryFromGlibFull is used to convert raw GstTracerFactory pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerFactoryFromGlibFull(c unsafe.Pointer) TracerFactory {
return gobject.UnsafeObjectFromGlibFull(c).(TracerFactory)
}
func (t *TracerFactoryInstance) upcastToGstTracerFactory() *TracerFactoryInstance {
return t
}
// UnsafeTracerFactoryToGlibNone is used to convert the instance to it's C value GstTracerFactory. This is used by the bindings internally.
func UnsafeTracerFactoryToGlibNone(c TracerFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTracerFactoryToGlibFull is used to convert the instance to it's C value GstTracerFactory, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTracerFactoryToGlibFull(c TracerFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// GetTracerType wraps gst_tracer_factory_get_tracer_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for elements managed by this factory. The type can
// only be retrieved if the element factory is loaded, which can be
// assured with gst_plugin_feature_load().
func (factory *TracerFactoryInstance) GetTracerType() gobject.Type {
var carg0 *C.GstTracerFactory // in, none, converted
var cret C.GType // return, none, casted, alias
carg0 = (*C.GstTracerFactory)(UnsafeTracerFactoryToGlibNone(factory))
cret = C.gst_tracer_factory_get_tracer_type(carg0)
runtime.KeepAlive(factory)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// TracerRecordInstance is the instance type used by all types extending GstTracerRecord. It is used internally by the bindings. Users should use the interface [TracerRecord] instead.
type TracerRecordInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ TracerRecord = (*TracerRecordInstance)(nil)
// TracerRecord wraps GstTracerRecord
//
// Tracing modules will create instances of this class to announce the data they
// will log and create a log formatter.
type TracerRecord interface {
Object
upcastToGstTracerRecord() *TracerRecordInstance
}
func unsafeWrapTracerRecord(base *gobject.ObjectInstance) *TracerRecordInstance {
return &TracerRecordInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalTracerRecordInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTracerRecord(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTracerRecordFromGlibNone is used to convert raw GstTracerRecord pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerRecordFromGlibNone(c unsafe.Pointer) TracerRecord {
return gobject.UnsafeObjectFromGlibNone(c).(TracerRecord)
}
// UnsafeTracerRecordFromGlibFull is used to convert raw GstTracerRecord pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTracerRecordFromGlibFull(c unsafe.Pointer) TracerRecord {
return gobject.UnsafeObjectFromGlibFull(c).(TracerRecord)
}
func (t *TracerRecordInstance) upcastToGstTracerRecord() *TracerRecordInstance {
return t
}
// UnsafeTracerRecordToGlibNone is used to convert the instance to it's C value GstTracerRecord. This is used by the bindings internally.
func UnsafeTracerRecordToGlibNone(c TracerRecord) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTracerRecordToGlibFull is used to convert the instance to it's C value GstTracerRecord, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTracerRecordToGlibFull(c TracerRecord) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// TypeFindFactoryInstance is the instance type used by all types extending GstTypeFindFactory. It is used internally by the bindings. Users should use the interface [TypeFindFactory] instead.
type TypeFindFactoryInstance struct {
_ [0]func() // equal guard
PluginFeatureInstance
}
var _ TypeFindFactory = (*TypeFindFactoryInstance)(nil)
// TypeFindFactory wraps GstTypeFindFactory
//
// These functions allow querying information about registered typefind
// functions. How to create and register these functions is described in
// the section &lt;link linkend="gstreamer-Writing-typefind-functions"&gt;
// "Writing typefind functions"&lt;/link&gt;.
//
// The following example shows how to write a very simple typefinder that
// identifies the given data. You can get quite a bit more complicated than
// that though.
// |[&lt;!-- language="C" --&gt;
// typedef struct {
// guint8 *data;
// guint size;
// guint probability;
// GstCaps *data;
// } MyTypeFind;
// static void
// my_peek (gpointer data, gint64 offset, guint size)
// {
// MyTypeFind *find = (MyTypeFind *) data;
// if (offset &gt;= 0 &amp;&amp; offset + size &lt;= find-&gt;size) {
// return find-&gt;data + offset;
// }
// return NULL;
// }
// static void
// my_suggest (gpointer data, guint probability, GstCaps *caps)
// {
// MyTypeFind *find = (MyTypeFind *) data;
// if (probability &gt; find-&gt;probability) {
// find-&gt;probability = probability;
// gst_caps_replace (&amp;find-&gt;caps, caps);
// }
// }
// static GstCaps *
// find_type (guint8 *data, guint size)
// {
// GList *walk, *type_list;
// MyTypeFind find = {data, size, 0, NULL};
// GstTypeFind gst_find = {my_peek, my_suggest, &amp;find, };
// walk = type_list = gst_type_find_factory_get_list ();
// while (walk) {
// GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (walk-&gt;data);
// walk = g_list_next (walk)
// gst_type_find_factory_call_function (factory, &amp;gst_find);
// }
// g_list_free (type_list);
// return find.caps;
// };
// ]|
type TypeFindFactory interface {
PluginFeature
upcastToGstTypeFindFactory() *TypeFindFactoryInstance
// CallFunction wraps gst_type_find_factory_call_function
//
// The function takes the following parameters:
//
// - find *TypeFind: a properly setup #GstTypeFind entry. The get_data
// and suggest_type members must be set.
//
// Calls the #GstTypeFindFunction associated with this factory.
CallFunction(*TypeFind)
// GetCaps wraps gst_type_find_factory_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the #GstCaps associated with a typefind factory.
GetCaps() *Caps
// GetExtensions wraps gst_type_find_factory_get_extensions
// The function returns the following values:
//
// - goret []string
//
// Gets the extensions associated with a #GstTypeFindFactory. The returned
// array should not be changed. If you need to change stuff in it, you should
// copy it using g_strdupv(). This function may return %NULL to indicate
// a 0-length list.
GetExtensions() []string
// HasFunction wraps gst_type_find_factory_has_function
// The function returns the following values:
//
// - goret bool
//
// Check whether the factory has a typefind function. Typefind factories
// without typefind functions are a last-effort fallback mechanism to
// e.g. assume a certain media type based on the file extension.
HasFunction() bool
}
func unsafeWrapTypeFindFactory(base *gobject.ObjectInstance) *TypeFindFactoryInstance {
return &TypeFindFactoryInstance{
PluginFeatureInstance: PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalTypeFindFactoryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapTypeFindFactory(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeTypeFindFactoryFromGlibNone is used to convert raw GstTypeFindFactory pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeTypeFindFactoryFromGlibNone(c unsafe.Pointer) TypeFindFactory {
return gobject.UnsafeObjectFromGlibNone(c).(TypeFindFactory)
}
// UnsafeTypeFindFactoryFromGlibFull is used to convert raw GstTypeFindFactory pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeTypeFindFactoryFromGlibFull(c unsafe.Pointer) TypeFindFactory {
return gobject.UnsafeObjectFromGlibFull(c).(TypeFindFactory)
}
func (t *TypeFindFactoryInstance) upcastToGstTypeFindFactory() *TypeFindFactoryInstance {
return t
}
// UnsafeTypeFindFactoryToGlibNone is used to convert the instance to it's C value GstTypeFindFactory. This is used by the bindings internally.
func UnsafeTypeFindFactoryToGlibNone(c TypeFindFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeTypeFindFactoryToGlibFull is used to convert the instance to it's C value GstTypeFindFactory, while removeing the finalizer. This is used by the bindings internally.
func UnsafeTypeFindFactoryToGlibFull(c TypeFindFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// CallFunction wraps gst_type_find_factory_call_function
//
// The function takes the following parameters:
//
// - find *TypeFind: a properly setup #GstTypeFind entry. The get_data
// and suggest_type members must be set.
//
// Calls the #GstTypeFindFunction associated with this factory.
func (factory *TypeFindFactoryInstance) CallFunction(find *TypeFind) {
var carg0 *C.GstTypeFindFactory // in, none, converted
var carg1 *C.GstTypeFind // in, none, converted
carg0 = (*C.GstTypeFindFactory)(UnsafeTypeFindFactoryToGlibNone(factory))
carg1 = (*C.GstTypeFind)(UnsafeTypeFindToGlibNone(find))
C.gst_type_find_factory_call_function(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(find)
}
// GetCaps wraps gst_type_find_factory_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the #GstCaps associated with a typefind factory.
func (factory *TypeFindFactoryInstance) GetCaps() *Caps {
var carg0 *C.GstTypeFindFactory // in, none, converted
var cret *C.GstCaps // return, none, converted
carg0 = (*C.GstTypeFindFactory)(UnsafeTypeFindFactoryToGlibNone(factory))
cret = C.gst_type_find_factory_get_caps(carg0)
runtime.KeepAlive(factory)
var goret *Caps
goret = UnsafeCapsFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetExtensions wraps gst_type_find_factory_get_extensions
// The function returns the following values:
//
// - goret []string
//
// Gets the extensions associated with a #GstTypeFindFactory. The returned
// array should not be changed. If you need to change stuff in it, you should
// copy it using g_strdupv(). This function may return %NULL to indicate
// a 0-length list.
func (factory *TypeFindFactoryInstance) GetExtensions() []string {
var carg0 *C.GstTypeFindFactory // in, none, converted
var cret **C.gchar // return, transfer: none, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstTypeFindFactory)(UnsafeTypeFindFactoryToGlibNone(factory))
cret = C.gst_type_find_factory_get_extensions(carg0)
runtime.KeepAlive(factory)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (const gchar* const*)")
return goret
}
// HasFunction wraps gst_type_find_factory_has_function
// The function returns the following values:
//
// - goret bool
//
// Check whether the factory has a typefind function. Typefind factories
// without typefind functions are a last-effort fallback mechanism to
// e.g. assume a certain media type based on the file extension.
func (factory *TypeFindFactoryInstance) HasFunction() bool {
var carg0 *C.GstTypeFindFactory // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTypeFindFactory)(UnsafeTypeFindFactoryToGlibNone(factory))
cret = C.gst_type_find_factory_has_function(carg0)
runtime.KeepAlive(factory)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AllocatorInstance is the instance type used by all types extending GstAllocator. It is used internally by the bindings. Users should use the interface [Allocator] instead.
type AllocatorInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Allocator = (*AllocatorInstance)(nil)
// Allocator wraps GstAllocator
//
// Memory is usually created by allocators with a gst_allocator_alloc()
// method call. When %NULL is used as the allocator, the default allocator will
// be used.
//
// New allocators can be registered with gst_allocator_register().
// Allocators are identified by name and can be retrieved with
// gst_allocator_find(). gst_allocator_set_default() can be used to change the
// default allocator.
//
// New memory can be created with gst_memory_new_wrapped() that wraps the memory
// allocated elsewhere.
type Allocator interface {
Object
upcastToGstAllocator() *AllocatorInstance
// Alloc wraps gst_allocator_alloc
//
// The function takes the following parameters:
//
// - size uint: size of the visible memory area
// - params *AllocationParams (nullable): optional parameters
//
// The function returns the following values:
//
// - goret *Memory
//
// Use @allocator to allocate a new memory block with memory that is at least
// @size big.
//
// The optional @params can specify the prefix and padding for the memory. If
// %NULL is passed, no flags, no extra prefix/padding and a default alignment is
// used.
//
// The prefix/padding will be filled with 0 if flags contains
// #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
//
// When @allocator is %NULL, the default allocator will be used.
//
// The alignment in @params is given as a bitmask so that @align + 1 equals
// the amount of bytes to align to. For example, to align to 8 bytes,
// use an alignment of 7.
Alloc(uint, *AllocationParams) *Memory
// Free wraps gst_allocator_free
//
// The function takes the following parameters:
//
// - memory *Memory: the memory to free
//
// Free @memory that was previously allocated with gst_allocator_alloc().
Free(*Memory)
// SetDefault wraps gst_allocator_set_default
//
// Set the default allocator.
SetDefault()
}
func unsafeWrapAllocator(base *gobject.ObjectInstance) *AllocatorInstance {
return &AllocatorInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalAllocatorInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapAllocator(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeAllocatorFromGlibNone is used to convert raw GstAllocator pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeAllocatorFromGlibNone(c unsafe.Pointer) Allocator {
return gobject.UnsafeObjectFromGlibNone(c).(Allocator)
}
// UnsafeAllocatorFromGlibFull is used to convert raw GstAllocator pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeAllocatorFromGlibFull(c unsafe.Pointer) Allocator {
return gobject.UnsafeObjectFromGlibFull(c).(Allocator)
}
func (a *AllocatorInstance) upcastToGstAllocator() *AllocatorInstance {
return a
}
// UnsafeAllocatorToGlibNone is used to convert the instance to it's C value GstAllocator. This is used by the bindings internally.
func UnsafeAllocatorToGlibNone(c Allocator) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeAllocatorToGlibFull is used to convert the instance to it's C value GstAllocator, while removeing the finalizer. This is used by the bindings internally.
func UnsafeAllocatorToGlibFull(c Allocator) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// AllocatorFind wraps gst_allocator_find
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the allocator
//
// The function returns the following values:
//
// - goret Allocator
//
// Find a previously registered allocator with @name. When @name is %NULL, the
// default allocator will be returned.
func AllocatorFind(name string) Allocator {
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstAllocator // return, full, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_allocator_find(carg1)
runtime.KeepAlive(name)
var goret Allocator
goret = UnsafeAllocatorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AllocatorRegister wraps gst_allocator_register
//
// The function takes the following parameters:
//
// - name string: the name of the allocator
// - allocator Allocator: #GstAllocator
//
// Registers the memory @allocator with @name.
func AllocatorRegister(name string, allocator Allocator) {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstAllocator // in, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.GstAllocator)(UnsafeAllocatorToGlibFull(allocator))
C.gst_allocator_register(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(allocator)
}
// Alloc wraps gst_allocator_alloc
//
// The function takes the following parameters:
//
// - size uint: size of the visible memory area
// - params *AllocationParams (nullable): optional parameters
//
// The function returns the following values:
//
// - goret *Memory
//
// Use @allocator to allocate a new memory block with memory that is at least
// @size big.
//
// The optional @params can specify the prefix and padding for the memory. If
// %NULL is passed, no flags, no extra prefix/padding and a default alignment is
// used.
//
// The prefix/padding will be filled with 0 if flags contains
// #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
//
// When @allocator is %NULL, the default allocator will be used.
//
// The alignment in @params is given as a bitmask so that @align + 1 equals
// the amount of bytes to align to. For example, to align to 8 bytes,
// use an alignment of 7.
func (allocator *AllocatorInstance) Alloc(size uint, params *AllocationParams) *Memory {
var carg0 *C.GstAllocator // in, none, converted
var carg1 C.gsize // in, none, casted
var carg2 *C.GstAllocationParams // in, none, converted, nullable
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
carg1 = C.gsize(size)
if params != nil {
carg2 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
}
cret = C.gst_allocator_alloc(carg0, carg1, carg2)
runtime.KeepAlive(allocator)
runtime.KeepAlive(size)
runtime.KeepAlive(params)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Free wraps gst_allocator_free
//
// The function takes the following parameters:
//
// - memory *Memory: the memory to free
//
// Free @memory that was previously allocated with gst_allocator_alloc().
func (allocator *AllocatorInstance) Free(memory *Memory) {
var carg0 *C.GstAllocator // in, none, converted
var carg1 *C.GstMemory // in, full, converted
carg0 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
carg1 = (*C.GstMemory)(UnsafeMemoryToGlibFull(memory))
C.gst_allocator_free(carg0, carg1)
runtime.KeepAlive(allocator)
runtime.KeepAlive(memory)
}
// SetDefault wraps gst_allocator_set_default
//
// Set the default allocator.
func (allocator *AllocatorInstance) SetDefault() {
var carg0 *C.GstAllocator // in, none, converted
carg0 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
C.gst_allocator_set_default(carg0)
runtime.KeepAlive(allocator)
}
// BufferPoolInstance is the instance type used by all types extending GstBufferPool. It is used internally by the bindings. Users should use the interface [BufferPool] instead.
type BufferPoolInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ BufferPool = (*BufferPoolInstance)(nil)
// BufferPool wraps GstBufferPool
//
// A #GstBufferPool is an object that can be used to pre-allocate and recycle
// buffers of the same size and with the same properties.
//
// A #GstBufferPool is created with gst_buffer_pool_new().
//
// Once a pool is created, it needs to be configured. A call to
// gst_buffer_pool_get_config() returns the current configuration structure from
// the pool. With gst_buffer_pool_config_set_params() and
// gst_buffer_pool_config_set_allocator() the bufferpool parameters and
// allocator can be configured. Other properties can be configured in the pool
// depending on the pool implementation.
//
// A bufferpool can have extra options that can be enabled with
// gst_buffer_pool_config_add_option(). The available options can be retrieved
// with gst_buffer_pool_get_options(). Some options allow for additional
// configuration properties to be set.
//
// After the configuration structure has been configured,
// gst_buffer_pool_set_config() updates the configuration in the pool. This can
// fail when the configuration structure is not accepted.
//
// After the pool has been configured, it can be activated with
// gst_buffer_pool_set_active(). This will preallocate the configured resources
// in the pool.
//
// When the pool is active, gst_buffer_pool_acquire_buffer() can be used to
// retrieve a buffer from the pool.
//
// Buffers allocated from a bufferpool will automatically be returned to the
// pool with gst_buffer_pool_release_buffer() when their refcount drops to 0.
//
// The bufferpool can be deactivated again with gst_buffer_pool_set_active().
// All further gst_buffer_pool_acquire_buffer() calls will return an error. When
// all buffers are returned to the pool they will be freed.
type BufferPool interface {
Object
upcastToGstBufferPool() *BufferPoolInstance
// AcquireBuffer wraps gst_buffer_pool_acquire_buffer
//
// The function takes the following parameters:
//
// - params *BufferPoolAcquireParams (nullable): parameters.
//
// The function returns the following values:
//
// - buffer *Buffer (nullable): a location for a #GstBuffer
// - goret FlowReturn
//
// Acquires a buffer from @pool. @buffer should point to a memory location that
// can hold a pointer to the new buffer. When the pool is empty, this function
// will by default block until a buffer is released into the pool again or when
// the pool is set to flushing or deactivated.
//
// @params can contain optional parameters to influence the allocation.
AcquireBuffer(*BufferPoolAcquireParams) (*Buffer, FlowReturn)
// GetConfig wraps gst_buffer_pool_get_config
// The function returns the following values:
//
// - goret *Structure
//
// Gets a copy of the current configuration of the pool. This configuration
// can be modified and used for the gst_buffer_pool_set_config() call.
GetConfig() *Structure
// GetOptions wraps gst_buffer_pool_get_options
// The function returns the following values:
//
// - goret []string
//
// Gets a %NULL terminated array of string with supported bufferpool options for
// @pool. An option would typically be enabled with
// gst_buffer_pool_config_add_option().
GetOptions() []string
// HasOption wraps gst_buffer_pool_has_option
//
// The function takes the following parameters:
//
// - option string: an option
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the bufferpool supports @option.
HasOption(string) bool
// IsActive wraps gst_buffer_pool_is_active
// The function returns the following values:
//
// - goret bool
//
// Checks if @pool is active. A pool can be activated with the
// gst_buffer_pool_set_active() call.
IsActive() bool
// ReleaseBuffer wraps gst_buffer_pool_release_buffer
//
// The function takes the following parameters:
//
// - buffer *Buffer: a #GstBuffer
//
// Releases @buffer to @pool. @buffer should have previously been allocated from
// @pool with gst_buffer_pool_acquire_buffer().
//
// This function is usually called automatically when the last ref on @buffer
// disappears.
ReleaseBuffer(*Buffer)
// SetActive wraps gst_buffer_pool_set_active
//
// The function takes the following parameters:
//
// - active bool: the new active state
//
// The function returns the following values:
//
// - goret bool
//
// Controls the active state of @pool. When the pool is inactive, new calls to
// gst_buffer_pool_acquire_buffer() will return with %GST_FLOW_FLUSHING.
//
// Activating the bufferpool will preallocate all resources in the pool based on
// the configuration of the pool.
//
// Deactivating will free the resources again when there are no outstanding
// buffers. When there are outstanding buffers, they will be freed as soon as
// they are all returned to the pool.
SetActive(bool) bool
// SetConfig wraps gst_buffer_pool_set_config
//
// The function takes the following parameters:
//
// - config *Structure: a #GstStructure
//
// The function returns the following values:
//
// - goret bool
//
// Sets the configuration of the pool. If the pool is already configured, and
// the configuration hasn't changed, this function will return %TRUE. If the
// pool is active, this method will return %FALSE and active configuration
// will remain. Buffers allocated from this pool must be returned or else this
// function will do nothing and return %FALSE.
//
// @config is a #GstStructure that contains the configuration parameters for
// the pool. A default and mandatory set of parameters can be configured with
// gst_buffer_pool_config_set_params(), gst_buffer_pool_config_set_allocator()
// and gst_buffer_pool_config_add_option().
//
// If the parameters in @config can not be set exactly, this function returns
// %FALSE and will try to update as much state as possible. The new state can
// then be retrieved and refined with gst_buffer_pool_get_config().
//
// This function takes ownership of @config.
SetConfig(*Structure) bool
// SetFlushing wraps gst_buffer_pool_set_flushing
//
// The function takes the following parameters:
//
// - flushing bool: whether to start or stop flushing
//
// Enables or disables the flushing state of a @pool without freeing or
// allocating buffers.
SetFlushing(bool)
}
func unsafeWrapBufferPool(base *gobject.ObjectInstance) *BufferPoolInstance {
return &BufferPoolInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalBufferPoolInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapBufferPool(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeBufferPoolFromGlibNone is used to convert raw GstBufferPool pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeBufferPoolFromGlibNone(c unsafe.Pointer) BufferPool {
return gobject.UnsafeObjectFromGlibNone(c).(BufferPool)
}
// UnsafeBufferPoolFromGlibFull is used to convert raw GstBufferPool pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeBufferPoolFromGlibFull(c unsafe.Pointer) BufferPool {
return gobject.UnsafeObjectFromGlibFull(c).(BufferPool)
}
func (b *BufferPoolInstance) upcastToGstBufferPool() *BufferPoolInstance {
return b
}
// UnsafeBufferPoolToGlibNone is used to convert the instance to it's C value GstBufferPool. This is used by the bindings internally.
func UnsafeBufferPoolToGlibNone(c BufferPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeBufferPoolToGlibFull is used to convert the instance to it's C value GstBufferPool, while removeing the finalizer. This is used by the bindings internally.
func UnsafeBufferPoolToGlibFull(c BufferPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewBufferPool wraps gst_buffer_pool_new
// The function returns the following values:
//
// - goret BufferPool
//
// Creates a new #GstBufferPool instance.
func NewBufferPool() BufferPool {
var cret *C.GstBufferPool // return, full, converted
cret = C.gst_buffer_pool_new()
var goret BufferPool
goret = UnsafeBufferPoolFromGlibFull(unsafe.Pointer(cret))
return goret
}
// BufferPoolConfigAddOption wraps gst_buffer_pool_config_add_option
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - option string: an option to add
//
// Enables the option in @config. This will instruct the @bufferpool to enable
// the specified option on the buffers that it allocates.
//
// The options supported by @pool can be retrieved with gst_buffer_pool_get_options().
func BufferPoolConfigAddOption(config *Structure, option string) {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(option)))
defer C.free(unsafe.Pointer(carg2))
C.gst_buffer_pool_config_add_option(carg1, carg2)
runtime.KeepAlive(config)
runtime.KeepAlive(option)
}
// BufferPoolConfigGetAllocator wraps gst_buffer_pool_config_get_allocator
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
//
// The function returns the following values:
//
// - allocator Allocator (nullable): a #GstAllocator, or %NULL
// - params AllocationParams: #GstAllocationParams, or %NULL
// - goret bool
//
// Gets the @allocator and @params from @config.
func BufferPoolConfigGetAllocator(config *Structure) (Allocator, AllocationParams, bool) {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstAllocator // out, none, converted, nullable
var carg3 C.GstAllocationParams // out, transfer: none, C Pointers: 0, Name: AllocationParams, optional, caller-allocates
var cret C.gboolean // return
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
cret = C.gst_buffer_pool_config_get_allocator(carg1, &carg2, &carg3)
runtime.KeepAlive(config)
var allocator Allocator
var params AllocationParams
var goret bool
if carg2 != nil {
allocator = UnsafeAllocatorFromGlibNone(unsafe.Pointer(carg2))
}
_ = params
_ = carg3
panic("unimplemented conversion of AllocationParams (GstAllocationParams)")
if cret != 0 {
goret = true
}
return allocator, params, goret
}
// BufferPoolConfigGetOption wraps gst_buffer_pool_config_get_option
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - index uint: position in the option array to read
//
// The function returns the following values:
//
// - goret string
//
// Parses an available @config and gets the option at @index of the options API
// array.
func BufferPoolConfigGetOption(config *Structure, index uint) string {
var carg1 *C.GstStructure // in, none, converted
var carg2 C.guint // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
carg2 = C.guint(index)
cret = C.gst_buffer_pool_config_get_option(carg1, carg2)
runtime.KeepAlive(config)
runtime.KeepAlive(index)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// BufferPoolConfigGetParams wraps gst_buffer_pool_config_get_params
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
//
// The function returns the following values:
//
// - caps *Caps (nullable): the caps of buffers
// - size uint: the size of each buffer, not including prefix and padding
// - minBuffers uint: the minimum amount of buffers to allocate.
// - maxBuffers uint: the maximum amount of buffers to allocate or 0 for unlimited.
// - goret bool
//
// Gets the configuration values from @config.
func BufferPoolConfigGetParams(config *Structure) (*Caps, uint, uint, uint, bool) {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstCaps // out, none, converted, nullable
var carg3 C.guint // out, full, casted
var carg4 C.guint // out, full, casted
var carg5 C.guint // out, full, casted
var cret C.gboolean // return
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
cret = C.gst_buffer_pool_config_get_params(carg1, &carg2, &carg3, &carg4, &carg5)
runtime.KeepAlive(config)
var caps *Caps
var size uint
var minBuffers uint
var maxBuffers uint
var goret bool
if carg2 != nil {
caps = UnsafeCapsFromGlibNone(unsafe.Pointer(carg2))
}
size = uint(carg3)
minBuffers = uint(carg4)
maxBuffers = uint(carg5)
if cret != 0 {
goret = true
}
return caps, size, minBuffers, maxBuffers, goret
}
// BufferPoolConfigHasOption wraps gst_buffer_pool_config_has_option
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - option string: an option
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @config contains @option.
func BufferPoolConfigHasOption(config *Structure, option string) bool {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(option)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_buffer_pool_config_has_option(carg1, carg2)
runtime.KeepAlive(config)
runtime.KeepAlive(option)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// BufferPoolConfigNOptions wraps gst_buffer_pool_config_n_options
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
//
// The function returns the following values:
//
// - goret uint
//
// Retrieves the number of values currently stored in the options array of the
// @config structure.
func BufferPoolConfigNOptions(config *Structure) uint {
var carg1 *C.GstStructure // in, none, converted
var cret C.guint // return, none, casted
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
cret = C.gst_buffer_pool_config_n_options(carg1)
runtime.KeepAlive(config)
var goret uint
goret = uint(cret)
return goret
}
// BufferPoolConfigSetAllocator wraps gst_buffer_pool_config_set_allocator
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - allocator Allocator (nullable): a #GstAllocator
// - params *AllocationParams (nullable): #GstAllocationParams
//
// Sets the @allocator and @params on @config.
//
// One of @allocator and @params can be %NULL, but not both. When @allocator
// is %NULL, the default allocator of the pool will use the values in @param
// to perform its allocation. When @param is %NULL, the pool will use the
// provided @allocator with its default #GstAllocationParams.
//
// A call to gst_buffer_pool_set_config() can update the allocator and params
// with the values that it is able to do. Some pools are, for example, not able
// to operate with different allocators or cannot allocate with the values
// specified in @params. Use gst_buffer_pool_get_config() to get the currently
// used values.
func BufferPoolConfigSetAllocator(config *Structure, allocator Allocator, params *AllocationParams) {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstAllocator // in, none, converted, nullable
var carg3 *C.GstAllocationParams // in, none, converted, nullable
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
if allocator != nil {
carg2 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
}
if params != nil {
carg3 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
}
C.gst_buffer_pool_config_set_allocator(carg1, carg2, carg3)
runtime.KeepAlive(config)
runtime.KeepAlive(allocator)
runtime.KeepAlive(params)
}
// BufferPoolConfigSetParams wraps gst_buffer_pool_config_set_params
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - caps *Caps (nullable): caps for the buffers
// - size uint: the size of each buffer, not including prefix and padding
// - minBuffers uint: the minimum amount of buffers to allocate.
// - maxBuffers uint: the maximum amount of buffers to allocate or 0 for unlimited.
//
// Configures @config with the given parameters.
func BufferPoolConfigSetParams(config *Structure, caps *Caps, size uint, minBuffers uint, maxBuffers uint) {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstCaps // in, none, converted, nullable
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
var carg5 C.guint // in, none, casted
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
carg3 = C.guint(size)
carg4 = C.guint(minBuffers)
carg5 = C.guint(maxBuffers)
C.gst_buffer_pool_config_set_params(carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(config)
runtime.KeepAlive(caps)
runtime.KeepAlive(size)
runtime.KeepAlive(minBuffers)
runtime.KeepAlive(maxBuffers)
}
// BufferPoolConfigValidateParams wraps gst_buffer_pool_config_validate_params
//
// The function takes the following parameters:
//
// - config *Structure: a #GstBufferPool configuration
// - caps *Caps (nullable): the excepted caps of buffers
// - size uint: the expected size of each buffer, not including prefix and padding
// - minBuffers uint: the expected minimum amount of buffers to allocate.
// - maxBuffers uint: the expect maximum amount of buffers to allocate or 0 for unlimited.
//
// The function returns the following values:
//
// - goret bool
//
// Validates that changes made to @config are still valid in the context of the
// expected parameters. This function is a helper that can be used to validate
// changes made by a pool to a config when gst_buffer_pool_set_config()
// returns %FALSE. This expects that @caps haven't changed and that
// @min_buffers aren't lower then what we initially expected.
// This does not check if options or allocator parameters are still valid,
// won't check if size have changed, since changing the size is valid to adapt
// padding.
func BufferPoolConfigValidateParams(config *Structure, caps *Caps, size uint, minBuffers uint, maxBuffers uint) bool {
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstCaps // in, none, converted, nullable
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
var carg5 C.guint // in, none, casted
var cret C.gboolean // return
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(config))
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
carg3 = C.guint(size)
carg4 = C.guint(minBuffers)
carg5 = C.guint(maxBuffers)
cret = C.gst_buffer_pool_config_validate_params(carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(config)
runtime.KeepAlive(caps)
runtime.KeepAlive(size)
runtime.KeepAlive(minBuffers)
runtime.KeepAlive(maxBuffers)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AcquireBuffer wraps gst_buffer_pool_acquire_buffer
//
// The function takes the following parameters:
//
// - params *BufferPoolAcquireParams (nullable): parameters.
//
// The function returns the following values:
//
// - buffer *Buffer (nullable): a location for a #GstBuffer
// - goret FlowReturn
//
// Acquires a buffer from @pool. @buffer should point to a memory location that
// can hold a pointer to the new buffer. When the pool is empty, this function
// will by default block until a buffer is released into the pool again or when
// the pool is set to flushing or deactivated.
//
// @params can contain optional parameters to influence the allocation.
func (pool *BufferPoolInstance) AcquireBuffer(params *BufferPoolAcquireParams) (*Buffer, FlowReturn) {
var carg0 *C.GstBufferPool // in, none, converted
var carg2 *C.GstBufferPoolAcquireParams // in, none, converted, nullable
var carg1 *C.GstBuffer // out, full, converted, nullable
var cret C.GstFlowReturn // return, none, casted
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
if params != nil {
carg2 = (*C.GstBufferPoolAcquireParams)(UnsafeBufferPoolAcquireParamsToGlibNone(params))
}
cret = C.gst_buffer_pool_acquire_buffer(carg0, &carg1, carg2)
runtime.KeepAlive(pool)
runtime.KeepAlive(params)
var buffer *Buffer
var goret FlowReturn
if carg1 != nil {
buffer = UnsafeBufferFromGlibFull(unsafe.Pointer(carg1))
}
goret = FlowReturn(cret)
return buffer, goret
}
// GetConfig wraps gst_buffer_pool_get_config
// The function returns the following values:
//
// - goret *Structure
//
// Gets a copy of the current configuration of the pool. This configuration
// can be modified and used for the gst_buffer_pool_set_config() call.
func (pool *BufferPoolInstance) GetConfig() *Structure {
var carg0 *C.GstBufferPool // in, none, converted
var cret *C.GstStructure // return, full, converted
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
cret = C.gst_buffer_pool_get_config(carg0)
runtime.KeepAlive(pool)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetOptions wraps gst_buffer_pool_get_options
// The function returns the following values:
//
// - goret []string
//
// Gets a %NULL terminated array of string with supported bufferpool options for
// @pool. An option would typically be enabled with
// gst_buffer_pool_config_add_option().
func (pool *BufferPoolInstance) GetOptions() []string {
var carg0 *C.GstBufferPool // in, none, converted
var cret **C.gchar // return, transfer: none, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
cret = C.gst_buffer_pool_get_options(carg0)
runtime.KeepAlive(pool)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (const gchar**)")
return goret
}
// HasOption wraps gst_buffer_pool_has_option
//
// The function takes the following parameters:
//
// - option string: an option
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the bufferpool supports @option.
func (pool *BufferPoolInstance) HasOption(option string) bool {
var carg0 *C.GstBufferPool // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(option)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_buffer_pool_has_option(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(option)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsActive wraps gst_buffer_pool_is_active
// The function returns the following values:
//
// - goret bool
//
// Checks if @pool is active. A pool can be activated with the
// gst_buffer_pool_set_active() call.
func (pool *BufferPoolInstance) IsActive() bool {
var carg0 *C.GstBufferPool // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
cret = C.gst_buffer_pool_is_active(carg0)
runtime.KeepAlive(pool)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ReleaseBuffer wraps gst_buffer_pool_release_buffer
//
// The function takes the following parameters:
//
// - buffer *Buffer: a #GstBuffer
//
// Releases @buffer to @pool. @buffer should have previously been allocated from
// @pool with gst_buffer_pool_acquire_buffer().
//
// This function is usually called automatically when the last ref on @buffer
// disappears.
func (pool *BufferPoolInstance) ReleaseBuffer(buffer *Buffer) {
var carg0 *C.GstBufferPool // in, none, converted
var carg1 *C.GstBuffer // in, full, converted
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buffer))
C.gst_buffer_pool_release_buffer(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(buffer)
}
// SetActive wraps gst_buffer_pool_set_active
//
// The function takes the following parameters:
//
// - active bool: the new active state
//
// The function returns the following values:
//
// - goret bool
//
// Controls the active state of @pool. When the pool is inactive, new calls to
// gst_buffer_pool_acquire_buffer() will return with %GST_FLOW_FLUSHING.
//
// Activating the bufferpool will preallocate all resources in the pool based on
// the configuration of the pool.
//
// Deactivating will free the resources again when there are no outstanding
// buffers. When there are outstanding buffers, they will be freed as soon as
// they are all returned to the pool.
func (pool *BufferPoolInstance) SetActive(active bool) bool {
var carg0 *C.GstBufferPool // in, none, converted
var carg1 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
if active {
carg1 = C.TRUE
}
cret = C.gst_buffer_pool_set_active(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetConfig wraps gst_buffer_pool_set_config
//
// The function takes the following parameters:
//
// - config *Structure: a #GstStructure
//
// The function returns the following values:
//
// - goret bool
//
// Sets the configuration of the pool. If the pool is already configured, and
// the configuration hasn't changed, this function will return %TRUE. If the
// pool is active, this method will return %FALSE and active configuration
// will remain. Buffers allocated from this pool must be returned or else this
// function will do nothing and return %FALSE.
//
// @config is a #GstStructure that contains the configuration parameters for
// the pool. A default and mandatory set of parameters can be configured with
// gst_buffer_pool_config_set_params(), gst_buffer_pool_config_set_allocator()
// and gst_buffer_pool_config_add_option().
//
// If the parameters in @config can not be set exactly, this function returns
// %FALSE and will try to update as much state as possible. The new state can
// then be retrieved and refined with gst_buffer_pool_get_config().
//
// This function takes ownership of @config.
func (pool *BufferPoolInstance) SetConfig(config *Structure) bool {
var carg0 *C.GstBufferPool // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(config))
cret = C.gst_buffer_pool_set_config(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(config)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetFlushing wraps gst_buffer_pool_set_flushing
//
// The function takes the following parameters:
//
// - flushing bool: whether to start or stop flushing
//
// Enables or disables the flushing state of a @pool without freeing or
// allocating buffers.
func (pool *BufferPoolInstance) SetFlushing(flushing bool) {
var carg0 *C.GstBufferPool // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
if flushing {
carg1 = C.TRUE
}
C.gst_buffer_pool_set_flushing(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(flushing)
}
// BusInstance is the instance type used by all types extending GstBus. It is used internally by the bindings. Users should use the interface [Bus] instead.
type BusInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Bus = (*BusInstance)(nil)
// Bus wraps GstBus
//
// The #GstBus is an object responsible for delivering #GstMessage packets in
// a first-in first-out way from the streaming threads (see #GstTask) to the
// application.
//
// Since the application typically only wants to deal with delivery of these
// messages from one thread, the GstBus will marshall the messages between
// different threads. This is important since the actual streaming of media
// is done in another thread than the application.
//
// The GstBus provides support for #GSource based notifications. This makes it
// possible to handle the delivery in the glib #GMainLoop.
//
// The #GSource callback function gst_bus_async_signal_func() can be used to
// convert all bus messages into signal emissions.
//
// A message is posted on the bus with the gst_bus_post() method. With the
// gst_bus_peek() and gst_bus_pop() methods one can look at or retrieve a
// previously posted message.
//
// The bus can be polled with the gst_bus_poll() method. This methods blocks
// up to the specified timeout value until one of the specified messages types
// is posted on the bus. The application can then gst_bus_pop() the messages
// from the bus to handle them.
// Alternatively the application can register an asynchronous bus function
// using gst_bus_add_watch_full() or gst_bus_add_watch(). This function will
// install a #GSource in the default glib main loop and will deliver messages
// a short while after they have been posted. Note that the main loop should
// be running for the asynchronous callbacks.
//
// It is also possible to get messages from the bus without any thread
// marshalling with the gst_bus_set_sync_handler() method. This makes it
// possible to react to a message in the same thread that posted the
// message on the bus. This should only be used if the application is able
// to deal with messages from different threads.
//
// Every #GstPipeline has one bus.
//
// Note that a #GstPipeline will set its bus into flushing state when changing
// from READY to NULL state.
type Bus interface {
BusExtManual // handwritten functions
Object
upcastToGstBus() *BusInstance
// AddSignalWatch wraps gst_bus_add_signal_watch
//
// Adds a bus signal watch to the default main context with the default priority
// ( %G_PRIORITY_DEFAULT ). It is also possible to use a non-default
// main context set up using g_main_context_push_thread_default() (before
// one had to create a bus watch source and attach it to the desired main
// context 'manually').
//
// After calling this statement, the bus will emit the "message" signal for each
// message posted on the bus.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_remove_signal_watch() as many times as this
// function is called.
AddSignalWatch()
// AddSignalWatchFull wraps gst_bus_add_signal_watch_full
//
// The function takes the following parameters:
//
// - priority int: The priority of the watch.
//
// Adds a bus signal watch to the default main context with the given @priority
// (e.g. %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
// context set up using g_main_context_push_thread_default()
// (before one had to create a bus watch source and attach it to the desired
// main context 'manually').
//
// After calling this statement, the bus will emit the "message" signal for each
// message posted on the bus when the #GMainLoop is running.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_remove_signal_watch() as many times as this
// function is called.
//
// There can only be a single bus watch per bus, you must remove any signal
// watch before you can set another type of watch.
AddSignalWatchFull(int)
// AddWatchFull wraps gst_bus_add_watch_full
//
// The function takes the following parameters:
//
// - priority int: The priority of the watch.
// - fn BusFunc: A function to call when a message is received.
//
// The function returns the following values:
//
// - goret uint
//
// Adds a bus watch to the default main context with the given @priority (e.g.
// %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
// context set up using g_main_context_push_thread_default() (before
// one had to create a bus watch source and attach it to the desired main
// context 'manually').
//
// This function is used to receive asynchronous messages in the main loop.
// There can only be a single bus watch per bus, you must remove it before you
// can set a new one.
//
// The bus watch will only work if a #GMainLoop is being run.
//
// When @func is called, the message belongs to the caller; if you want to
// keep a copy of it, call gst_message_ref() before leaving @func.
//
// The watch can be removed using gst_bus_remove_watch() or by returning %FALSE
// from @func. If the watch was added to the default main context it is also
// possible to remove the watch using g_source_remove().
//
// 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:
//
// - goret *glib.Source
//
// Create watch for this bus. The #GSource will be dispatched whenever
// a message is on the bus. After the GSource is dispatched, the
// message is popped off the bus and unreffed.
//
// As with other watches, there can only be one watch on the bus, including
// any signal watch added with #gst_bus_add_signal_watch.
CreateWatch() *glib.Source
// DisableSyncMessageEmission wraps gst_bus_disable_sync_message_emission
//
// Instructs GStreamer to stop emitting the "sync-message" signal for this bus.
// See gst_bus_enable_sync_message_emission() for more information.
//
// In the event that multiple pieces of code have called
// gst_bus_enable_sync_message_emission(), the sync-message emissions will only
// be stopped after all calls to gst_bus_enable_sync_message_emission() were
// "cancelled" by calling this function. In this way the semantics are exactly
// the same as gst_object_ref() that which calls enable should also call
// disable.
DisableSyncMessageEmission()
// EnableSyncMessageEmission wraps gst_bus_enable_sync_message_emission
//
// Instructs GStreamer to emit the "sync-message" signal after running the bus's
// sync handler. This function is here so that code can ensure that they can
// synchronously receive messages without having to affect what the bin's sync
// handler is.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_disable_sync_message_emission() as many times
// as this function is called.
//
// While this function looks similar to gst_bus_add_signal_watch(), it is not
// exactly the same -- this function enables *synchronous* emission of
// signals when messages arrive; gst_bus_add_signal_watch() adds an idle callback
// to pop messages off the bus *asynchronously*. The sync-message signal
// comes from the thread of whatever object posted the message; the "message"
// signal is marshalled to the main thread via the #GMainLoop.
EnableSyncMessageEmission()
// GetPollfd wraps gst_bus_get_pollfd
// The function returns the following values:
//
// - fd glib.PollFD: A GPollFD to fill
//
// Gets the file descriptor from the bus which can be used to get notified about
// messages being available with functions like g_poll(), and allows integration
// into other event loops based on file descriptors.
// Whenever a message is available, the POLLIN / %G_IO_IN event is set.
//
// Warning: NEVER read or write anything to the returned fd but only use it
// for getting notifications via g_poll() or similar and then use the normal
// GstBus API, e.g. gst_bus_pop().
GetPollfd() glib.PollFD
// HavePending wraps gst_bus_have_pending
// The function returns the following values:
//
// - goret bool
//
// Checks if there are pending messages on the bus that
// should be handled.
HavePending() bool
// Peek wraps gst_bus_peek
// The function returns the following values:
//
// - goret *Message
//
// Peeks the message on the top of the bus' queue. The message will remain
// on the bus' message queue.
Peek() *Message
// Poll wraps gst_bus_poll
//
// The function takes the following parameters:
//
// - events MessageType: a mask of #GstMessageType, representing the set of message types to
// poll for (note special handling of extended message types below)
// - timeout ClockTime: the poll timeout, as a #GstClockTime, or #GST_CLOCK_TIME_NONE to poll
// indefinitely.
//
// The function returns the following values:
//
// - goret *Message
//
// Polls the bus for messages. Will block while waiting for messages to come.
// You can specify a maximum time to poll with the @timeout parameter. If
// @timeout is negative, this function will block indefinitely.
//
// All messages not in @events will be popped off the bus and will be ignored.
// It is not possible to use message enums beyond #GST_MESSAGE_EXTENDED in the
// @events mask
//
// Because poll is implemented using the "message" signal enabled by
// gst_bus_add_signal_watch(), calling gst_bus_poll() will cause the "message"
// signal to be emitted for every message that poll sees. Thus a "message"
// signal handler will see the same messages that this function sees -- neither
// will steal messages from the other.
//
// This function will run a #GMainLoop from the default main context when
// polling.
//
// You should never use this function, since it is pure evil. This is
// especially true for GUI applications based on Gtk+ or Qt, but also for any
// other non-trivial application that uses the GLib main loop. As this function
// runs a GLib main loop, any callback attached to the default GLib main
// context may be invoked. This could be timeouts, GUI events, I/O events etc.;
// even if gst_bus_poll() is called with a 0 timeout. Any of these callbacks
// may do things you do not expect, e.g. destroy the main application window or
// some other resource; change other application state; display a dialog and
// run another main loop until the user clicks it away. In short, using this
// function may add a lot of complexity to your code through unexpected
// re-entrancy and unexpected changes to your application's state.
//
// For 0 timeouts use gst_bus_pop_filtered() instead of this function; for
// other short timeouts use gst_bus_timed_pop_filtered(); everything else is
// better handled by setting up an asynchronous bus watch and doing things
// from there.
Poll(MessageType, ClockTime) *Message
// Pop wraps gst_bus_pop
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus.
Pop() *Message
// PopFiltered wraps gst_bus_pop_filtered
//
// The function takes the following parameters:
//
// - types MessageType: message types to take into account
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message matching @type from the bus. Will discard all messages on
// the bus that do not match @type and that have been posted before the first
// message that does match @type. If there is no message matching @type on
// the bus, all messages will be discarded. It is not possible to use message
// enums beyond #GST_MESSAGE_EXTENDED in the @events mask.
PopFiltered(MessageType) *Message
// Post wraps gst_bus_post
//
// The function takes the following parameters:
//
// - message *Message: the #GstMessage to post
//
// The function returns the following values:
//
// - goret bool
//
// Posts a message on the given bus. Ownership of the message
// is taken by the bus.
Post(*Message) bool
// RemoveSignalWatch wraps gst_bus_remove_signal_watch
//
// Removes a signal watch previously added with gst_bus_add_signal_watch().
RemoveSignalWatch()
// RemoveWatch wraps gst_bus_remove_watch
// The function returns the following values:
//
// - goret bool
//
// Removes an installed bus watch from @bus.
RemoveWatch() bool
// SetFlushing wraps gst_bus_set_flushing
//
// The function takes the following parameters:
//
// - flushing bool: whether or not to flush the bus
//
// If @flushing, flushes out and unrefs any messages queued in the bus. Releases
// references to the message origin objects. Will flush future messages until
// gst_bus_set_flushing() sets @flushing to %FALSE.
SetFlushing(bool)
// SetSyncHandler wraps gst_bus_set_sync_handler
//
// The function takes the following parameters:
//
// - fn BusSyncHandler (nullable): The handler function to install
//
// Sets the synchronous handler on the bus. The function will be called
// every time a new message is posted on the bus. Note that the function
// will be called in the same thread context as the posting object. This
// function is usually only called by the creator of the bus. Applications
// should handle messages asynchronously using the gst_bus watch and poll
// functions.
//
// 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:
//
// - timeout ClockTime: a timeout
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus, waiting up to the specified timeout.
//
// If @timeout is 0, this function behaves like gst_bus_pop(). If @timeout is
// #GST_CLOCK_TIME_NONE, this function will block forever until a message was
// posted on the bus.
TimedPop(ClockTime) *Message
// TimedPopFiltered wraps gst_bus_timed_pop_filtered
//
// The function takes the following parameters:
//
// - timeout ClockTime: a timeout in nanoseconds, or %GST_CLOCK_TIME_NONE to wait forever
// - types MessageType: message types to take into account, %GST_MESSAGE_ANY for any type
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus whose type matches the message type mask @types,
// waiting up to the specified timeout (and discarding any messages that do not
// match the mask provided).
//
// If @timeout is 0, this function behaves like gst_bus_pop_filtered(). If
// @timeout is #GST_CLOCK_TIME_NONE, this function will block forever until a
// matching message was posted on the bus.
TimedPopFiltered(ClockTime, MessageType) *Message
}
func unsafeWrapBus(base *gobject.ObjectInstance) *BusInstance {
return &BusInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalBusInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapBus(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeBusFromGlibNone is used to convert raw GstBus pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeBusFromGlibNone(c unsafe.Pointer) Bus {
return gobject.UnsafeObjectFromGlibNone(c).(Bus)
}
// UnsafeBusFromGlibFull is used to convert raw GstBus pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeBusFromGlibFull(c unsafe.Pointer) Bus {
return gobject.UnsafeObjectFromGlibFull(c).(Bus)
}
func (b *BusInstance) upcastToGstBus() *BusInstance {
return b
}
// UnsafeBusToGlibNone is used to convert the instance to it's C value GstBus. This is used by the bindings internally.
func UnsafeBusToGlibNone(c Bus) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeBusToGlibFull is used to convert the instance to it's C value GstBus, while removeing the finalizer. This is used by the bindings internally.
func UnsafeBusToGlibFull(c Bus) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewBus wraps gst_bus_new
// The function returns the following values:
//
// - goret Bus
//
// Creates a new #GstBus instance.
func NewBus() Bus {
var cret *C.GstBus // return, full, converted
cret = C.gst_bus_new()
var goret Bus
goret = UnsafeBusFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddSignalWatch wraps gst_bus_add_signal_watch
//
// Adds a bus signal watch to the default main context with the default priority
// ( %G_PRIORITY_DEFAULT ). It is also possible to use a non-default
// main context set up using g_main_context_push_thread_default() (before
// one had to create a bus watch source and attach it to the desired main
// context 'manually').
//
// After calling this statement, the bus will emit the "message" signal for each
// message posted on the bus.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_remove_signal_watch() as many times as this
// function is called.
func (bus *BusInstance) AddSignalWatch() {
var carg0 *C.GstBus // in, none, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
C.gst_bus_add_signal_watch(carg0)
runtime.KeepAlive(bus)
}
// AddSignalWatchFull wraps gst_bus_add_signal_watch_full
//
// The function takes the following parameters:
//
// - priority int: The priority of the watch.
//
// Adds a bus signal watch to the default main context with the given @priority
// (e.g. %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
// context set up using g_main_context_push_thread_default()
// (before one had to create a bus watch source and attach it to the desired
// main context 'manually').
//
// After calling this statement, the bus will emit the "message" signal for each
// message posted on the bus when the #GMainLoop is running.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_remove_signal_watch() as many times as this
// function is called.
//
// There can only be a single bus watch per bus, you must remove any signal
// watch before you can set another type of watch.
func (bus *BusInstance) AddSignalWatchFull(priority int) {
var carg0 *C.GstBus // in, none, converted
var carg1 C.gint // in, none, casted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.gint(priority)
C.gst_bus_add_signal_watch_full(carg0, carg1)
runtime.KeepAlive(bus)
runtime.KeepAlive(priority)
}
// AddWatchFull wraps gst_bus_add_watch_full
//
// The function takes the following parameters:
//
// - priority int: The priority of the watch.
// - fn BusFunc: A function to call when a message is received.
//
// The function returns the following values:
//
// - goret uint
//
// Adds a bus watch to the default main context with the given @priority (e.g.
// %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
// context set up using g_main_context_push_thread_default() (before
// one had to create a bus watch source and attach it to the desired main
// context 'manually').
//
// This function is used to receive asynchronous messages in the main loop.
// There can only be a single bus watch per bus, you must remove it before you
// can set a new one.
//
// The bus watch will only work if a #GMainLoop is being run.
//
// When @func is called, the message belongs to the caller; if you want to
// keep a copy of it, call gst_message_ref() before leaving @func.
//
// The watch can be removed using gst_bus_remove_watch() or by returning %FALSE
// from @func. If the watch was added to the default main context it is also
// possible to remove the watch using g_source_remove().
//
// 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.
func (bus *BusInstance) AddWatchFull(priority int, fn BusFunc) uint {
var carg0 *C.GstBus // in, none, converted
var carg1 C.gint // in, none, casted
var carg2 C.GstBusFunc // callback, scope: notified, closure: carg3, destroy: carg4
var carg3 C.gpointer // implicit
var carg4 C.GDestroyNotify // implicit
var cret C.guint // return, none, casted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.gint(priority)
carg2 = (*[0]byte)(C._gotk4_gst1_BusFunc)
carg3 = C.gpointer(userdata.Register(fn))
carg4 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_bus_add_watch_full(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(bus)
runtime.KeepAlive(priority)
runtime.KeepAlive(fn)
var goret uint
goret = uint(cret)
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:
//
// - goret *glib.Source
//
// Create watch for this bus. The #GSource will be dispatched whenever
// a message is on the bus. After the GSource is dispatched, the
// message is popped off the bus and unreffed.
//
// As with other watches, there can only be one watch on the bus, including
// any signal watch added with #gst_bus_add_signal_watch.
func (bus *BusInstance) CreateWatch() *glib.Source {
var carg0 *C.GstBus // in, none, converted
var cret *C.GSource // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
cret = C.gst_bus_create_watch(carg0)
runtime.KeepAlive(bus)
var goret *glib.Source
goret = glib.UnsafeSourceFromGlibFull(unsafe.Pointer(cret))
return goret
}
// DisableSyncMessageEmission wraps gst_bus_disable_sync_message_emission
//
// Instructs GStreamer to stop emitting the "sync-message" signal for this bus.
// See gst_bus_enable_sync_message_emission() for more information.
//
// In the event that multiple pieces of code have called
// gst_bus_enable_sync_message_emission(), the sync-message emissions will only
// be stopped after all calls to gst_bus_enable_sync_message_emission() were
// "cancelled" by calling this function. In this way the semantics are exactly
// the same as gst_object_ref() that which calls enable should also call
// disable.
func (bus *BusInstance) DisableSyncMessageEmission() {
var carg0 *C.GstBus // in, none, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
C.gst_bus_disable_sync_message_emission(carg0)
runtime.KeepAlive(bus)
}
// EnableSyncMessageEmission wraps gst_bus_enable_sync_message_emission
//
// Instructs GStreamer to emit the "sync-message" signal after running the bus's
// sync handler. This function is here so that code can ensure that they can
// synchronously receive messages without having to affect what the bin's sync
// handler is.
//
// This function may be called multiple times. To clean up, the caller is
// responsible for calling gst_bus_disable_sync_message_emission() as many times
// as this function is called.
//
// While this function looks similar to gst_bus_add_signal_watch(), it is not
// exactly the same -- this function enables *synchronous* emission of
// signals when messages arrive; gst_bus_add_signal_watch() adds an idle callback
// to pop messages off the bus *asynchronously*. The sync-message signal
// comes from the thread of whatever object posted the message; the "message"
// signal is marshalled to the main thread via the #GMainLoop.
func (bus *BusInstance) EnableSyncMessageEmission() {
var carg0 *C.GstBus // in, none, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
C.gst_bus_enable_sync_message_emission(carg0)
runtime.KeepAlive(bus)
}
// GetPollfd wraps gst_bus_get_pollfd
// The function returns the following values:
//
// - fd glib.PollFD: A GPollFD to fill
//
// Gets the file descriptor from the bus which can be used to get notified about
// messages being available with functions like g_poll(), and allows integration
// into other event loops based on file descriptors.
// Whenever a message is available, the POLLIN / %G_IO_IN event is set.
//
// Warning: NEVER read or write anything to the returned fd but only use it
// for getting notifications via g_poll() or similar and then use the normal
// GstBus API, e.g. gst_bus_pop().
func (bus *BusInstance) GetPollfd() glib.PollFD {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GPollFD // out, transfer: none, C Pointers: 0, Name: PollFD, caller-allocates
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
C.gst_bus_get_pollfd(carg0, &carg1)
runtime.KeepAlive(bus)
var fd glib.PollFD
_ = fd
_ = carg1
panic("unimplemented conversion of glib.PollFD (GPollFD)")
return fd
}
// HavePending wraps gst_bus_have_pending
// The function returns the following values:
//
// - goret bool
//
// Checks if there are pending messages on the bus that
// should be handled.
func (bus *BusInstance) HavePending() bool {
var carg0 *C.GstBus // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
cret = C.gst_bus_have_pending(carg0)
runtime.KeepAlive(bus)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Peek wraps gst_bus_peek
// The function returns the following values:
//
// - goret *Message
//
// Peeks the message on the top of the bus' queue. The message will remain
// on the bus' message queue.
func (bus *BusInstance) Peek() *Message {
var carg0 *C.GstBus // in, none, converted
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
cret = C.gst_bus_peek(carg0)
runtime.KeepAlive(bus)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Poll wraps gst_bus_poll
//
// The function takes the following parameters:
//
// - events MessageType: a mask of #GstMessageType, representing the set of message types to
// poll for (note special handling of extended message types below)
// - timeout ClockTime: the poll timeout, as a #GstClockTime, or #GST_CLOCK_TIME_NONE to poll
// indefinitely.
//
// The function returns the following values:
//
// - goret *Message
//
// Polls the bus for messages. Will block while waiting for messages to come.
// You can specify a maximum time to poll with the @timeout parameter. If
// @timeout is negative, this function will block indefinitely.
//
// All messages not in @events will be popped off the bus and will be ignored.
// It is not possible to use message enums beyond #GST_MESSAGE_EXTENDED in the
// @events mask
//
// Because poll is implemented using the "message" signal enabled by
// gst_bus_add_signal_watch(), calling gst_bus_poll() will cause the "message"
// signal to be emitted for every message that poll sees. Thus a "message"
// signal handler will see the same messages that this function sees -- neither
// will steal messages from the other.
//
// This function will run a #GMainLoop from the default main context when
// polling.
//
// You should never use this function, since it is pure evil. This is
// especially true for GUI applications based on Gtk+ or Qt, but also for any
// other non-trivial application that uses the GLib main loop. As this function
// runs a GLib main loop, any callback attached to the default GLib main
// context may be invoked. This could be timeouts, GUI events, I/O events etc.;
// even if gst_bus_poll() is called with a 0 timeout. Any of these callbacks
// may do things you do not expect, e.g. destroy the main application window or
// some other resource; change other application state; display a dialog and
// run another main loop until the user clicks it away. In short, using this
// function may add a lot of complexity to your code through unexpected
// re-entrancy and unexpected changes to your application's state.
//
// For 0 timeouts use gst_bus_pop_filtered() instead of this function; for
// other short timeouts use gst_bus_timed_pop_filtered(); everything else is
// better handled by setting up an asynchronous bus watch and doing things
// from there.
func (bus *BusInstance) Poll(events MessageType, timeout ClockTime) *Message {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GstMessageType // in, none, casted
var carg2 C.GstClockTime // in, none, casted, alias
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.GstMessageType(events)
carg2 = C.GstClockTime(timeout)
cret = C.gst_bus_poll(carg0, carg1, carg2)
runtime.KeepAlive(bus)
runtime.KeepAlive(events)
runtime.KeepAlive(timeout)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Pop wraps gst_bus_pop
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus.
func (bus *BusInstance) Pop() *Message {
var carg0 *C.GstBus // in, none, converted
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
cret = C.gst_bus_pop(carg0)
runtime.KeepAlive(bus)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// PopFiltered wraps gst_bus_pop_filtered
//
// The function takes the following parameters:
//
// - types MessageType: message types to take into account
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message matching @type from the bus. Will discard all messages on
// the bus that do not match @type and that have been posted before the first
// message that does match @type. If there is no message matching @type on
// the bus, all messages will be discarded. It is not possible to use message
// enums beyond #GST_MESSAGE_EXTENDED in the @events mask.
func (bus *BusInstance) PopFiltered(types MessageType) *Message {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GstMessageType // in, none, casted
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.GstMessageType(types)
cret = C.gst_bus_pop_filtered(carg0, carg1)
runtime.KeepAlive(bus)
runtime.KeepAlive(types)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Post wraps gst_bus_post
//
// The function takes the following parameters:
//
// - message *Message: the #GstMessage to post
//
// The function returns the following values:
//
// - goret bool
//
// Posts a message on the given bus. Ownership of the message
// is taken by the bus.
func (bus *BusInstance) Post(message *Message) bool {
var carg0 *C.GstBus // in, none, converted
var carg1 *C.GstMessage // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = (*C.GstMessage)(UnsafeMessageToGlibFull(message))
cret = C.gst_bus_post(carg0, carg1)
runtime.KeepAlive(bus)
runtime.KeepAlive(message)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveSignalWatch wraps gst_bus_remove_signal_watch
//
// Removes a signal watch previously added with gst_bus_add_signal_watch().
func (bus *BusInstance) RemoveSignalWatch() {
var carg0 *C.GstBus // in, none, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
C.gst_bus_remove_signal_watch(carg0)
runtime.KeepAlive(bus)
}
// RemoveWatch wraps gst_bus_remove_watch
// The function returns the following values:
//
// - goret bool
//
// Removes an installed bus watch from @bus.
func (bus *BusInstance) RemoveWatch() bool {
var carg0 *C.GstBus // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
cret = C.gst_bus_remove_watch(carg0)
runtime.KeepAlive(bus)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetFlushing wraps gst_bus_set_flushing
//
// The function takes the following parameters:
//
// - flushing bool: whether or not to flush the bus
//
// If @flushing, flushes out and unrefs any messages queued in the bus. Releases
// references to the message origin objects. Will flush future messages until
// gst_bus_set_flushing() sets @flushing to %FALSE.
func (bus *BusInstance) SetFlushing(flushing bool) {
var carg0 *C.GstBus // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
if flushing {
carg1 = C.TRUE
}
C.gst_bus_set_flushing(carg0, carg1)
runtime.KeepAlive(bus)
runtime.KeepAlive(flushing)
}
// SetSyncHandler wraps gst_bus_set_sync_handler
//
// The function takes the following parameters:
//
// - fn BusSyncHandler (nullable): The handler function to install
//
// Sets the synchronous handler on the bus. The function will be called
// every time a new message is posted on the bus. Note that the function
// will be called in the same thread context as the posting object. This
// function is usually only called by the creator of the bus. Applications
// should handle messages asynchronously using the gst_bus watch and poll
// functions.
//
// Before 1.16.3 it was not possible to replace an existing handler and
// clearing an existing handler with %NULL was not thread-safe.
func (bus *BusInstance) SetSyncHandler(fn BusSyncHandler) {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GstBusSyncHandler // callback, scope: notified, closure: carg2, destroy: carg3, nullable
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
if fn != nil {
carg1 = (*[0]byte)(C._gotk4_gst1_BusSyncHandler)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
}
C.gst_bus_set_sync_handler(carg0, carg1, carg2, carg3)
runtime.KeepAlive(bus)
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:
//
// - timeout ClockTime: a timeout
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus, waiting up to the specified timeout.
//
// If @timeout is 0, this function behaves like gst_bus_pop(). If @timeout is
// #GST_CLOCK_TIME_NONE, this function will block forever until a message was
// posted on the bus.
func (bus *BusInstance) TimedPop(timeout ClockTime) *Message {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.GstClockTime(timeout)
cret = C.gst_bus_timed_pop(carg0, carg1)
runtime.KeepAlive(bus)
runtime.KeepAlive(timeout)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// TimedPopFiltered wraps gst_bus_timed_pop_filtered
//
// The function takes the following parameters:
//
// - timeout ClockTime: a timeout in nanoseconds, or %GST_CLOCK_TIME_NONE to wait forever
// - types MessageType: message types to take into account, %GST_MESSAGE_ANY for any type
//
// The function returns the following values:
//
// - goret *Message
//
// Gets a message from the bus whose type matches the message type mask @types,
// waiting up to the specified timeout (and discarding any messages that do not
// match the mask provided).
//
// If @timeout is 0, this function behaves like gst_bus_pop_filtered(). If
// @timeout is #GST_CLOCK_TIME_NONE, this function will block forever until a
// matching message was posted on the bus.
func (bus *BusInstance) TimedPopFiltered(timeout ClockTime, types MessageType) *Message {
var carg0 *C.GstBus // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstMessageType // in, none, casted
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
carg1 = C.GstClockTime(timeout)
carg2 = C.GstMessageType(types)
cret = C.gst_bus_timed_pop_filtered(carg0, carg1, carg2)
runtime.KeepAlive(bus)
runtime.KeepAlive(timeout)
runtime.KeepAlive(types)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// 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
ObjectInstance
}
var _ Clock = (*ClockInstance)(nil)
// Clock wraps GstClock
//
// GStreamer uses a global clock to synchronize the plugins in a pipeline.
// Different clock implementations are possible by implementing this abstract
// base class or, more conveniently, by subclassing #GstSystemClock.
//
// The #GstClock returns a monotonically increasing time with the method
// gst_clock_get_time(). Its accuracy and base time depend on the specific
// clock implementation but time is always expressed in nanoseconds. Since the
// baseline of the clock is undefined, the clock time returned is not
// meaningful in itself, what matters are the deltas between two clock times.
// The time returned by a clock is called the absolute time.
//
// The pipeline uses the clock to calculate the running time. Usually all
// renderers synchronize to the global clock using the buffer timestamps, the
// #GST_EVENT_SEGMENT events and the element's base time, see #GstPipeline.
//
// A clock implementation can support periodic and single shot clock
// notifications both synchronous and asynchronous.
//
// One first needs to create a #GstClockID for the periodic or single shot
// notification using gst_clock_new_single_shot_id() or
// gst_clock_new_periodic_id().
//
// To perform a blocking wait for the specific time of the #GstClockID use
// gst_clock_id_wait(). To receive a callback when the specific time is reached
// in the clock use gst_clock_id_wait_async(). Both these calls can be
// interrupted with the gst_clock_id_unschedule() call. If the blocking wait is
// unscheduled a return value of #GST_CLOCK_UNSCHEDULED is returned.
//
// Periodic callbacks scheduled async will be repeatedly called automatically
// until they are unscheduled. To schedule a sync periodic callback,
// gst_clock_id_wait() should be called repeatedly.
//
// The async callbacks can happen from any thread, either provided by the core
// or from a streaming thread. The application should be prepared for this.
//
// A #GstClockID that has been unscheduled cannot be used again for any wait
// operation, a new #GstClockID should be created and the old unscheduled one
// should be destroyed with gst_clock_id_unref().
//
// It is possible to perform a blocking wait on the same #GstClockID from
// multiple threads. However, registering the same #GstClockID for multiple
// async notifications is not possible, the callback will only be called for
// the thread registering the entry last.
//
// None of the wait operations unref the #GstClockID, the owner is responsible
// for unreffing the ids itself. This holds for both periodic and single shot
// notifications. The reason being that the owner of the #GstClockID has to
// keep a handle to the #GstClockID to unblock the wait on FLUSHING events or
// state changes and if the entry would be unreffed automatically, the handle
// might become invalid without any notification.
//
// These clock operations do not operate on the running time, so the callbacks
// will also occur when not in PLAYING state as if the clock just keeps on
// running. Some clocks however do not progress when the element that provided
// the clock is not PLAYING.
//
// When a clock has the #GST_CLOCK_FLAG_CAN_SET_MASTER flag set, it can be
// slaved to another #GstClock with gst_clock_set_master(). The clock will
// then automatically be synchronized to this master clock by repeatedly
// sampling the master clock and the slave clock and recalibrating the slave
// clock with gst_clock_set_calibration(). This feature is mostly useful for
// plugins that have an internal clock but must operate with another clock
// selected by the #GstPipeline. They can track the offset and rate difference
// of their internal clock relative to the master clock by using the
// gst_clock_get_calibration() function.
//
// The master/slave synchronisation can be tuned with the #GstClock:timeout,
// #GstClock:window-size and #GstClock:window-threshold properties.
// The #GstClock:timeout property defines the interval to sample the master
// clock and run the calibration functions. #GstClock:window-size defines the
// number of samples to use when calibrating and #GstClock:window-threshold
// defines the minimum number of samples before the calibration is performed.
type Clock interface {
Object
upcastToGstClock() *ClockInstance
// AddObservation wraps gst_clock_add_observation
//
// The function takes the following parameters:
//
// - slave ClockTime: a time on the slave
// - master ClockTime: a time on the master
//
// The function returns the following values:
//
// - rSquared float64: a pointer to hold the result
// - goret bool
//
// The time @master of the master clock and the time @slave of the slave
// clock are added to the list of observations. If enough observations
// are available, a linear regression algorithm is run on the
// observations and @clock is recalibrated.
//
// If this functions returns %TRUE, @r_squared will contain the
// correlation coefficient of the interpolation. A value of 1.0
// means a perfect regression was performed. This value can
// be used to control the sampling frequency of the master and slave
// clocks.
AddObservation(ClockTime, ClockTime) (float64, bool)
// AddObservationUnapplied wraps gst_clock_add_observation_unapplied
//
// The function takes the following parameters:
//
// - slave ClockTime: a time on the slave
// - master ClockTime: a time on the master
//
// The function returns the following values:
//
// - rSquared float64: a pointer to hold the result
// - internal ClockTime: a location to store the internal time
// - external ClockTime: a location to store the external time
// - rateNum ClockTime: a location to store the rate numerator
// - rateDenom ClockTime: a location to store the rate denominator
// - goret bool
//
// Add a clock observation to the internal slaving algorithm the same as
// gst_clock_add_observation(), and return the result of the master clock
// estimation, without updating the internal calibration.
//
// The caller can then take the results and call gst_clock_set_calibration()
// with the values, or some modified version of them.
AddObservationUnapplied(ClockTime, ClockTime) (float64, ClockTime, ClockTime, ClockTime, ClockTime, bool)
// AdjustUnlocked wraps gst_clock_adjust_unlocked
//
// The function takes the following parameters:
//
// - internal ClockTime: a clock time
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @internal clock time to the external time, adjusting for the
// rate and reference time set with gst_clock_set_calibration() and making sure
// that the returned time is increasing. This function should be called with the
// clock's OBJECT_LOCK held and is mainly used by clock subclasses.
//
// This function is the reverse of gst_clock_unadjust_unlocked().
AdjustUnlocked(ClockTime) ClockTime
// AdjustWithCalibration wraps gst_clock_adjust_with_calibration
//
// The function takes the following parameters:
//
// - internalTarget ClockTime: a clock time
// - cinternal ClockTime: a reference internal time
// - cexternal ClockTime: a reference external time
// - cnum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - cdenom ClockTime: the denominator of the rate of the clock
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @internal_target clock time to the external time,
// using the passed calibration parameters. This function performs the
// same calculation as gst_clock_adjust_unlocked() when called using the
// current calibration parameters, but doesn't ensure a monotonically
// increasing result as gst_clock_adjust_unlocked() does.
//
// Note: The @clock parameter is unused and can be NULL
AdjustWithCalibration(ClockTime, ClockTime, ClockTime, ClockTime, ClockTime) ClockTime
// GetCalibration wraps gst_clock_get_calibration
// The function returns the following values:
//
// - internal ClockTime: a location to store the internal time
// - external ClockTime: a location to store the external time
// - rateNum ClockTime: a location to store the rate numerator
// - rateDenom ClockTime: a location to store the rate denominator
//
// Gets the internal rate and reference time of @clock. See
// gst_clock_set_calibration() for more information.
//
// @internal, @external, @rate_num, and @rate_denom can be left %NULL if the
// caller is not interested in the values.
GetCalibration() (ClockTime, ClockTime, ClockTime, ClockTime)
// GetInternalTime wraps gst_clock_get_internal_time
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the current internal time of the given clock. The time is returned
// unadjusted for the offset and the rate.
GetInternalTime() ClockTime
// GetMaster wraps gst_clock_get_master
// The function returns the following values:
//
// - goret Clock
//
// Gets the master clock that @clock is slaved to or %NULL when the clock is
// not slaved to any master clock.
GetMaster() Clock
// GetResolution wraps gst_clock_get_resolution
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the accuracy of the clock. The accuracy of the clock is the granularity
// of the values returned by gst_clock_get_time().
GetResolution() ClockTime
// GetTime wraps gst_clock_get_time
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the current time of the given clock. The time is always
// monotonically increasing and adjusted according to the current
// offset and rate.
GetTime() ClockTime
// GetTimeout wraps gst_clock_get_timeout
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the amount of time that master and slave clocks are sampled.
GetTimeout() ClockTime
// IsSynced wraps gst_clock_is_synced
// The function returns the following values:
//
// - goret bool
//
// Checks if the clock is currently synced, by looking at whether
// %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is set.
IsSynced() bool
// NewPeriodicID wraps gst_clock_new_periodic_id
//
// The function takes the following parameters:
//
// - startTime ClockTime: the requested start time
// - interval ClockTime: the requested interval
//
// The function returns the following values:
//
// - goret ClockID
//
// Gets an ID from @clock to trigger a periodic notification.
// The periodic notifications will start at time @start_time and
// will then be fired with the given @interval.
NewPeriodicID(ClockTime, ClockTime) ClockID
// NewSingleShotID wraps gst_clock_new_single_shot_id
//
// The function takes the following parameters:
//
// - time ClockTime: the requested time
//
// The function returns the following values:
//
// - goret ClockID
//
// Gets a #GstClockID from @clock to trigger a single shot
// notification at the requested time.
NewSingleShotID(ClockTime) ClockID
// PeriodicIDReinit wraps gst_clock_periodic_id_reinit
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID
// - startTime ClockTime: the requested start time
// - interval ClockTime: the requested interval
//
// The function returns the following values:
//
// - goret bool
//
// Reinitializes the provided periodic @id to the provided start time and
// interval. Does not modify the reference count.
PeriodicIDReinit(ClockID, ClockTime, ClockTime) bool
// SetCalibration wraps gst_clock_set_calibration
//
// The function takes the following parameters:
//
// - internal ClockTime: a reference internal time
// - external ClockTime: a reference external time
// - rateNum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - rateDenom ClockTime: the denominator of the rate of the clock
//
// Adjusts the rate and time of @clock. A rate of 1/1 is the normal speed of
// the clock. Values bigger than 1/1 make the clock go faster.
//
// @internal and @external are calibration parameters that arrange that
// gst_clock_get_time() should have been @external at internal time @internal.
// This internal time should not be in the future; that is, it should be less
// than the value of gst_clock_get_internal_time() when this function is called.
//
// Subsequent calls to gst_clock_get_time() will return clock times computed as
// follows:
//
// ``` C
// time = (internal_time - internal) * rate_num / rate_denom + external
// ```
//
// This formula is implemented in gst_clock_adjust_unlocked(). Of course, it
// tries to do the integer arithmetic as precisely as possible.
//
// Note that gst_clock_get_time() always returns increasing values so when you
// move the clock backwards, gst_clock_get_time() will report the previous value
// until the clock catches up.
SetCalibration(ClockTime, ClockTime, ClockTime, ClockTime)
// SetMaster wraps gst_clock_set_master
//
// The function takes the following parameters:
//
// - master Clock (nullable): a master #GstClock
//
// The function returns the following values:
//
// - goret bool
//
// Sets @master as the master clock for @clock. @clock will be automatically
// calibrated so that gst_clock_get_time() reports the same time as the
// master clock.
//
// A clock provider that slaves its clock to a master can get the current
// calibration values with gst_clock_get_calibration().
//
// @master can be %NULL in which case @clock will not be slaved anymore. It will
// however keep reporting its time adjusted with the last configured rate
// and time offsets.
SetMaster(Clock) bool
// SetResolution wraps gst_clock_set_resolution
//
// The function takes the following parameters:
//
// - resolution ClockTime: The resolution to set
//
// The function returns the following values:
//
// - goret ClockTime
//
// Sets the accuracy of the clock. Some clocks have the possibility to operate
// with different accuracy at the expense of more resource usage. There is
// normally no need to change the default resolution of a clock. The resolution
// of a clock can only be changed if the clock has the
// #GST_CLOCK_FLAG_CAN_SET_RESOLUTION flag set.
SetResolution(ClockTime) ClockTime
// SetSynced wraps gst_clock_set_synced
//
// The function takes the following parameters:
//
// - synced bool: if the clock is synced
//
// Sets @clock to synced and emits the #GstClock::synced signal, and wakes up any
// thread waiting in gst_clock_wait_for_sync().
//
// This function must only be called if %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC
// is set on the clock, and is intended to be called by subclasses only.
SetSynced(bool)
// SetTimeout wraps gst_clock_set_timeout
//
// The function takes the following parameters:
//
// - timeout ClockTime: a timeout
//
// Sets the amount of time, in nanoseconds, to sample master and slave
// clocks
SetTimeout(ClockTime)
// SingleShotIDReinit wraps gst_clock_single_shot_id_reinit
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID
// - time ClockTime: The requested time.
//
// The function returns the following values:
//
// - goret bool
//
// Reinitializes the provided single shot @id to the provided time. Does not
// modify the reference count.
SingleShotIDReinit(ClockID, ClockTime) bool
// UnadjustUnlocked wraps gst_clock_unadjust_unlocked
//
// The function takes the following parameters:
//
// - external ClockTime: an external clock time
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @external clock time to the internal time of @clock,
// using the rate and reference time set with gst_clock_set_calibration().
// This function should be called with the clock's OBJECT_LOCK held and
// is mainly used by clock subclasses.
//
// This function is the reverse of gst_clock_adjust_unlocked().
UnadjustUnlocked(ClockTime) ClockTime
// UnadjustWithCalibration wraps gst_clock_unadjust_with_calibration
//
// The function takes the following parameters:
//
// - externalTarget ClockTime: a clock time
// - cinternal ClockTime: a reference internal time
// - cexternal ClockTime: a reference external time
// - cnum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - cdenom ClockTime: the denominator of the rate of the clock
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @external_target clock time to the internal time,
// using the passed calibration parameters. This function performs the
// same calculation as gst_clock_unadjust_unlocked() when called using the
// current calibration parameters.
//
// Note: The @clock parameter is unused and can be NULL
UnadjustWithCalibration(ClockTime, ClockTime, ClockTime, ClockTime, ClockTime) ClockTime
// WaitForSync wraps gst_clock_wait_for_sync
//
// The function takes the following parameters:
//
// - timeout ClockTime: timeout for waiting or %GST_CLOCK_TIME_NONE
//
// The function returns the following values:
//
// - goret bool
//
// Waits until @clock is synced for reporting the current time. If @timeout
// is %GST_CLOCK_TIME_NONE it will wait forever, otherwise it will time out
// after @timeout nanoseconds.
//
// For asynchronous waiting, the #GstClock::synced signal can be used.
//
// 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
}
func unsafeWrapClock(base *gobject.ObjectInstance) *ClockInstance {
return &ClockInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalClockInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapClock(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeClockFromGlibNone is used to convert raw GstClock pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeClockFromGlibNone(c unsafe.Pointer) Clock {
return gobject.UnsafeObjectFromGlibNone(c).(Clock)
}
// UnsafeClockFromGlibFull is used to convert raw GstClock pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeClockFromGlibFull(c unsafe.Pointer) Clock {
return gobject.UnsafeObjectFromGlibFull(c).(Clock)
}
func (c *ClockInstance) upcastToGstClock() *ClockInstance {
return c
}
// UnsafeClockToGlibNone is used to convert the instance to it's C value GstClock. This is used by the bindings internally.
func UnsafeClockToGlibNone(c Clock) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeClockToGlibFull is used to convert the instance to it's C value GstClock, while removeing the finalizer. This is used by the bindings internally.
func UnsafeClockToGlibFull(c Clock) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// ClockIDCompareFunc wraps gst_clock_id_compare_func
//
// The function takes the following parameters:
//
// - id1 unsafe.Pointer (nullable): A #GstClockID
// - id2 unsafe.Pointer (nullable): A #GstClockID to compare with
//
// The function returns the following values:
//
// - goret int
//
// Compares the two #GstClockID instances. This function can be used
// as a GCompareFunc when sorting ids.
func ClockIDCompareFunc(id1 unsafe.Pointer, id2 unsafe.Pointer) int {
var carg1 C.gconstpointer // in, none, casted, nullable
var carg2 C.gconstpointer // in, none, casted, nullable
var cret C.gint // return, none, casted
if id1 != nil {
carg1 = C.gconstpointer(id1)
}
if id2 != nil {
carg2 = C.gconstpointer(id2)
}
cret = C.gst_clock_id_compare_func(carg1, carg2)
runtime.KeepAlive(id1)
runtime.KeepAlive(id2)
var goret int
goret = int(cret)
return goret
}
// ClockIDGetClock wraps gst_clock_id_get_clock
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID
//
// The function returns the following values:
//
// - goret Clock
//
// This function returns the underlying clock.
func ClockIDGetClock(id ClockID) Clock {
var carg1 C.GstClockID // in, none, casted, alias
var cret *C.GstClock // return, full, converted
carg1 = C.GstClockID(id)
cret = C.gst_clock_id_get_clock(carg1)
runtime.KeepAlive(id)
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ClockIDGetTime wraps gst_clock_id_get_time
//
// The function takes the following parameters:
//
// - id ClockID: The #GstClockID to query
//
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the time of the clock ID
func ClockIDGetTime(id ClockID) ClockTime {
var carg1 C.GstClockID // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg1 = C.GstClockID(id)
cret = C.gst_clock_id_get_time(carg1)
runtime.KeepAlive(id)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// ClockIDRef wraps gst_clock_id_ref
//
// The function takes the following parameters:
//
// - id ClockID: The #GstClockID to ref
//
// The function returns the following values:
//
// - goret ClockID
//
// Increases the refcount of given @id.
func ClockIDRef(id ClockID) ClockID {
var carg1 C.GstClockID // in, none, casted, alias
var cret C.GstClockID // return, full, casted, alias
carg1 = C.GstClockID(id)
cret = C.gst_clock_id_ref(carg1)
runtime.KeepAlive(id)
var goret ClockID
goret = ClockID(cret)
return goret
}
// ClockIDUnref wraps gst_clock_id_unref
//
// The function takes the following parameters:
//
// - id ClockID: The #GstClockID to unref
//
// Unrefs given @id. When the refcount reaches 0 the
// #GstClockID will be freed.
func ClockIDUnref(id ClockID) {
var carg1 C.GstClockID // in, full, casted, alias
carg1 = C.GstClockID(id)
C.gst_clock_id_unref(carg1)
runtime.KeepAlive(id)
}
// ClockIDUnschedule wraps gst_clock_id_unschedule
//
// The function takes the following parameters:
//
// - id ClockID: The id to unschedule
//
// Cancels an outstanding request with @id. This can either
// be an outstanding async notification or a pending sync notification.
// After this call, @id cannot be used anymore to receive sync or
// async notifications, you need to create a new #GstClockID.
func ClockIDUnschedule(id ClockID) {
var carg1 C.GstClockID // in, none, casted, alias
carg1 = C.GstClockID(id)
C.gst_clock_id_unschedule(carg1)
runtime.KeepAlive(id)
}
// ClockIDUsesClock wraps gst_clock_id_uses_clock
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID to check
// - clock Clock: a #GstClock to compare against
//
// The function returns the following values:
//
// - goret bool
//
// This function returns whether @id uses @clock as the underlying clock.
// @clock can be NULL, in which case the return value indicates whether
// the underlying clock has been freed. If this is the case, the @id is
// no longer usable and should be freed.
func ClockIDUsesClock(id ClockID, clock Clock) bool {
var carg1 C.GstClockID // in, none, casted, alias
var carg2 *C.GstClock // in, none, converted
var cret C.gboolean // return
carg1 = C.GstClockID(id)
carg2 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_id_uses_clock(carg1, carg2)
runtime.KeepAlive(id)
runtime.KeepAlive(clock)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ClockIDWait wraps gst_clock_id_wait
//
// The function takes the following parameters:
//
// - id ClockID: The #GstClockID to wait on
//
// The function returns the following values:
//
// - jitter ClockTimeDiff: a pointer that will contain the jitter,
// can be %NULL.
// - goret ClockReturn
//
// Performs a blocking wait on @id.
// @id should have been created with gst_clock_new_single_shot_id()
// or gst_clock_new_periodic_id() and should not have been unscheduled
// with a call to gst_clock_id_unschedule().
//
// If the @jitter argument is not %NULL and this function returns #GST_CLOCK_OK
// or #GST_CLOCK_EARLY, it will contain the difference
// against the clock and the time of @id when this method was
// called.
// Positive values indicate how late @id was relative to the clock
// (in which case this function will return #GST_CLOCK_EARLY).
// Negative values indicate how much time was spent waiting on the clock
// before this function returned.
func ClockIDWait(id ClockID) (ClockTimeDiff, ClockReturn) {
var carg1 C.GstClockID // in, none, casted, alias
var carg2 C.GstClockTimeDiff // out, full, casted, alias
var cret C.GstClockReturn // return, none, casted
carg1 = C.GstClockID(id)
cret = C.gst_clock_id_wait(carg1, &carg2)
runtime.KeepAlive(id)
var jitter ClockTimeDiff
var goret ClockReturn
jitter = ClockTimeDiff(carg2)
goret = ClockReturn(cret)
return jitter, goret
}
// ClockIDWaitAsync wraps gst_clock_id_wait_async
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID to wait on
// - fn ClockCallback: The callback function
//
// The function returns the following values:
//
// - goret ClockReturn
//
// Registers a callback on the given #GstClockID @id with the given
// function and user_data. When passing a #GstClockID with an invalid
// time to this function, the callback will be called immediately
// with a time set to %GST_CLOCK_TIME_NONE. The callback will
// be called when the time of @id has been reached.
//
// The callback @func can be invoked from any thread, either provided by the
// core or from a streaming thread. The application should be prepared for this.
func ClockIDWaitAsync(id ClockID, fn ClockCallback) ClockReturn {
var carg1 C.GstClockID // in, none, casted, alias
var carg2 C.GstClockCallback // callback, scope: notified, closure: carg3, destroy: carg4
var carg3 C.gpointer // implicit
var carg4 C.GDestroyNotify // implicit
var cret C.GstClockReturn // return, none, casted
carg1 = C.GstClockID(id)
carg2 = (*[0]byte)(C._gotk4_gst1_ClockCallback)
carg3 = C.gpointer(userdata.Register(fn))
carg4 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_clock_id_wait_async(carg1, carg2, carg3, carg4)
runtime.KeepAlive(id)
runtime.KeepAlive(fn)
var goret ClockReturn
goret = ClockReturn(cret)
return goret
}
// AddObservation wraps gst_clock_add_observation
//
// The function takes the following parameters:
//
// - slave ClockTime: a time on the slave
// - master ClockTime: a time on the master
//
// The function returns the following values:
//
// - rSquared float64: a pointer to hold the result
// - goret bool
//
// The time @master of the master clock and the time @slave of the slave
// clock are added to the list of observations. If enough observations
// are available, a linear regression algorithm is run on the
// observations and @clock is recalibrated.
//
// If this functions returns %TRUE, @r_squared will contain the
// correlation coefficient of the interpolation. A value of 1.0
// means a perfect regression was performed. This value can
// be used to control the sampling frequency of the master and slave
// clocks.
func (clock *ClockInstance) AddObservation(slave ClockTime, master ClockTime) (float64, bool) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.gdouble // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(slave)
carg2 = C.GstClockTime(master)
cret = C.gst_clock_add_observation(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(clock)
runtime.KeepAlive(slave)
runtime.KeepAlive(master)
var rSquared float64
var goret bool
rSquared = float64(carg3)
if cret != 0 {
goret = true
}
return rSquared, goret
}
// AddObservationUnapplied wraps gst_clock_add_observation_unapplied
//
// The function takes the following parameters:
//
// - slave ClockTime: a time on the slave
// - master ClockTime: a time on the master
//
// The function returns the following values:
//
// - rSquared float64: a pointer to hold the result
// - internal ClockTime: a location to store the internal time
// - external ClockTime: a location to store the external time
// - rateNum ClockTime: a location to store the rate numerator
// - rateDenom ClockTime: a location to store the rate denominator
// - goret bool
//
// Add a clock observation to the internal slaving algorithm the same as
// gst_clock_add_observation(), and return the result of the master clock
// estimation, without updating the internal calibration.
//
// The caller can then take the results and call gst_clock_set_calibration()
// with the values, or some modified version of them.
func (clock *ClockInstance) AddObservationUnapplied(slave ClockTime, master ClockTime) (float64, ClockTime, ClockTime, ClockTime, ClockTime, bool) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.gdouble // out, full, casted
var carg4 C.GstClockTime // out, full, casted, alias
var carg5 C.GstClockTime // out, full, casted, alias
var carg6 C.GstClockTime // out, full, casted, alias
var carg7 C.GstClockTime // out, full, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(slave)
carg2 = C.GstClockTime(master)
cret = C.gst_clock_add_observation_unapplied(carg0, carg1, carg2, &carg3, &carg4, &carg5, &carg6, &carg7)
runtime.KeepAlive(clock)
runtime.KeepAlive(slave)
runtime.KeepAlive(master)
var rSquared float64
var internal ClockTime
var external ClockTime
var rateNum ClockTime
var rateDenom ClockTime
var goret bool
rSquared = float64(carg3)
internal = ClockTime(carg4)
external = ClockTime(carg5)
rateNum = ClockTime(carg6)
rateDenom = ClockTime(carg7)
if cret != 0 {
goret = true
}
return rSquared, internal, external, rateNum, rateDenom, goret
}
// AdjustUnlocked wraps gst_clock_adjust_unlocked
//
// The function takes the following parameters:
//
// - internal ClockTime: a clock time
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @internal clock time to the external time, adjusting for the
// rate and reference time set with gst_clock_set_calibration() and making sure
// that the returned time is increasing. This function should be called with the
// clock's OBJECT_LOCK held and is mainly used by clock subclasses.
//
// This function is the reverse of gst_clock_unadjust_unlocked().
func (clock *ClockInstance) AdjustUnlocked(internal ClockTime) ClockTime {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(internal)
cret = C.gst_clock_adjust_unlocked(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(internal)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// AdjustWithCalibration wraps gst_clock_adjust_with_calibration
//
// The function takes the following parameters:
//
// - internalTarget ClockTime: a clock time
// - cinternal ClockTime: a reference internal time
// - cexternal ClockTime: a reference external time
// - cnum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - cdenom ClockTime: the denominator of the rate of the clock
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @internal_target clock time to the external time,
// using the passed calibration parameters. This function performs the
// same calculation as gst_clock_adjust_unlocked() when called using the
// current calibration parameters, but doesn't ensure a monotonically
// increasing result as gst_clock_adjust_unlocked() does.
//
// Note: The @clock parameter is unused and can be NULL
func (clock *ClockInstance) AdjustWithCalibration(internalTarget ClockTime, cinternal ClockTime, cexternal ClockTime, cnum ClockTime, cdenom ClockTime) ClockTime {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var carg4 C.GstClockTime // in, none, casted, alias
var carg5 C.GstClockTime // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(internalTarget)
carg2 = C.GstClockTime(cinternal)
carg3 = C.GstClockTime(cexternal)
carg4 = C.GstClockTime(cnum)
carg5 = C.GstClockTime(cdenom)
cret = C.gst_clock_adjust_with_calibration(carg0, carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(clock)
runtime.KeepAlive(internalTarget)
runtime.KeepAlive(cinternal)
runtime.KeepAlive(cexternal)
runtime.KeepAlive(cnum)
runtime.KeepAlive(cdenom)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetCalibration wraps gst_clock_get_calibration
// The function returns the following values:
//
// - internal ClockTime: a location to store the internal time
// - external ClockTime: a location to store the external time
// - rateNum ClockTime: a location to store the rate numerator
// - rateDenom ClockTime: a location to store the rate denominator
//
// Gets the internal rate and reference time of @clock. See
// gst_clock_set_calibration() for more information.
//
// @internal, @external, @rate_num, and @rate_denom can be left %NULL if the
// caller is not interested in the values.
func (clock *ClockInstance) GetCalibration() (ClockTime, ClockTime, ClockTime, ClockTime) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
var carg2 C.GstClockTime // out, full, casted, alias
var carg3 C.GstClockTime // out, full, casted, alias
var carg4 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
C.gst_clock_get_calibration(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(clock)
var internal ClockTime
var external ClockTime
var rateNum ClockTime
var rateDenom ClockTime
internal = ClockTime(carg1)
external = ClockTime(carg2)
rateNum = ClockTime(carg3)
rateDenom = ClockTime(carg4)
return internal, external, rateNum, rateDenom
}
// GetInternalTime wraps gst_clock_get_internal_time
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the current internal time of the given clock. The time is returned
// unadjusted for the offset and the rate.
func (clock *ClockInstance) GetInternalTime() ClockTime {
var carg0 *C.GstClock // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_get_internal_time(carg0)
runtime.KeepAlive(clock)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetMaster wraps gst_clock_get_master
// The function returns the following values:
//
// - goret Clock
//
// Gets the master clock that @clock is slaved to or %NULL when the clock is
// not slaved to any master clock.
func (clock *ClockInstance) GetMaster() Clock {
var carg0 *C.GstClock // in, none, converted
var cret *C.GstClock // return, full, converted
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_get_master(carg0)
runtime.KeepAlive(clock)
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetResolution wraps gst_clock_get_resolution
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the accuracy of the clock. The accuracy of the clock is the granularity
// of the values returned by gst_clock_get_time().
func (clock *ClockInstance) GetResolution() ClockTime {
var carg0 *C.GstClock // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_get_resolution(carg0)
runtime.KeepAlive(clock)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetTime wraps gst_clock_get_time
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the current time of the given clock. The time is always
// monotonically increasing and adjusted according to the current
// offset and rate.
func (clock *ClockInstance) GetTime() ClockTime {
var carg0 *C.GstClock // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_get_time(carg0)
runtime.KeepAlive(clock)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetTimeout wraps gst_clock_get_timeout
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the amount of time that master and slave clocks are sampled.
func (clock *ClockInstance) GetTimeout() ClockTime {
var carg0 *C.GstClock // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_get_timeout(carg0)
runtime.KeepAlive(clock)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// IsSynced wraps gst_clock_is_synced
// The function returns the following values:
//
// - goret bool
//
// Checks if the clock is currently synced, by looking at whether
// %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is set.
func (clock *ClockInstance) IsSynced() bool {
var carg0 *C.GstClock // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_clock_is_synced(carg0)
runtime.KeepAlive(clock)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// NewPeriodicID wraps gst_clock_new_periodic_id
//
// The function takes the following parameters:
//
// - startTime ClockTime: the requested start time
// - interval ClockTime: the requested interval
//
// The function returns the following values:
//
// - goret ClockID
//
// Gets an ID from @clock to trigger a periodic notification.
// The periodic notifications will start at time @start_time and
// will then be fired with the given @interval.
func (clock *ClockInstance) NewPeriodicID(startTime ClockTime, interval ClockTime) ClockID {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var cret C.GstClockID // return, full, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(startTime)
carg2 = C.GstClockTime(interval)
cret = C.gst_clock_new_periodic_id(carg0, carg1, carg2)
runtime.KeepAlive(clock)
runtime.KeepAlive(startTime)
runtime.KeepAlive(interval)
var goret ClockID
goret = ClockID(cret)
return goret
}
// NewSingleShotID wraps gst_clock_new_single_shot_id
//
// The function takes the following parameters:
//
// - time ClockTime: the requested time
//
// The function returns the following values:
//
// - goret ClockID
//
// Gets a #GstClockID from @clock to trigger a single shot
// notification at the requested time.
func (clock *ClockInstance) NewSingleShotID(time ClockTime) ClockID {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.GstClockID // return, full, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(time)
cret = C.gst_clock_new_single_shot_id(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(time)
var goret ClockID
goret = ClockID(cret)
return goret
}
// PeriodicIDReinit wraps gst_clock_periodic_id_reinit
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID
// - startTime ClockTime: the requested start time
// - interval ClockTime: the requested interval
//
// The function returns the following values:
//
// - goret bool
//
// Reinitializes the provided periodic @id to the provided start time and
// interval. Does not modify the reference count.
func (clock *ClockInstance) PeriodicIDReinit(id ClockID, startTime ClockTime, interval ClockTime) bool {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockID // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockID(id)
carg2 = C.GstClockTime(startTime)
carg3 = C.GstClockTime(interval)
cret = C.gst_clock_periodic_id_reinit(carg0, carg1, carg2, carg3)
runtime.KeepAlive(clock)
runtime.KeepAlive(id)
runtime.KeepAlive(startTime)
runtime.KeepAlive(interval)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetCalibration wraps gst_clock_set_calibration
//
// The function takes the following parameters:
//
// - internal ClockTime: a reference internal time
// - external ClockTime: a reference external time
// - rateNum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - rateDenom ClockTime: the denominator of the rate of the clock
//
// Adjusts the rate and time of @clock. A rate of 1/1 is the normal speed of
// the clock. Values bigger than 1/1 make the clock go faster.
//
// @internal and @external are calibration parameters that arrange that
// gst_clock_get_time() should have been @external at internal time @internal.
// This internal time should not be in the future; that is, it should be less
// than the value of gst_clock_get_internal_time() when this function is called.
//
// Subsequent calls to gst_clock_get_time() will return clock times computed as
// follows:
//
// ``` C
// time = (internal_time - internal) * rate_num / rate_denom + external
// ```
//
// This formula is implemented in gst_clock_adjust_unlocked(). Of course, it
// tries to do the integer arithmetic as precisely as possible.
//
// Note that gst_clock_get_time() always returns increasing values so when you
// move the clock backwards, gst_clock_get_time() will report the previous value
// until the clock catches up.
func (clock *ClockInstance) SetCalibration(internal ClockTime, external ClockTime, rateNum ClockTime, rateDenom ClockTime) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var carg4 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(internal)
carg2 = C.GstClockTime(external)
carg3 = C.GstClockTime(rateNum)
carg4 = C.GstClockTime(rateDenom)
C.gst_clock_set_calibration(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(clock)
runtime.KeepAlive(internal)
runtime.KeepAlive(external)
runtime.KeepAlive(rateNum)
runtime.KeepAlive(rateDenom)
}
// SetMaster wraps gst_clock_set_master
//
// The function takes the following parameters:
//
// - master Clock (nullable): a master #GstClock
//
// The function returns the following values:
//
// - goret bool
//
// Sets @master as the master clock for @clock. @clock will be automatically
// calibrated so that gst_clock_get_time() reports the same time as the
// master clock.
//
// A clock provider that slaves its clock to a master can get the current
// calibration values with gst_clock_get_calibration().
//
// @master can be %NULL in which case @clock will not be slaved anymore. It will
// however keep reporting its time adjusted with the last configured rate
// and time offsets.
func (clock *ClockInstance) SetMaster(master Clock) bool {
var carg0 *C.GstClock // in, none, converted
var carg1 *C.GstClock // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
if master != nil {
carg1 = (*C.GstClock)(UnsafeClockToGlibNone(master))
}
cret = C.gst_clock_set_master(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(master)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetResolution wraps gst_clock_set_resolution
//
// The function takes the following parameters:
//
// - resolution ClockTime: The resolution to set
//
// The function returns the following values:
//
// - goret ClockTime
//
// Sets the accuracy of the clock. Some clocks have the possibility to operate
// with different accuracy at the expense of more resource usage. There is
// normally no need to change the default resolution of a clock. The resolution
// of a clock can only be changed if the clock has the
// #GST_CLOCK_FLAG_CAN_SET_RESOLUTION flag set.
func (clock *ClockInstance) SetResolution(resolution ClockTime) ClockTime {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(resolution)
cret = C.gst_clock_set_resolution(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(resolution)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// SetSynced wraps gst_clock_set_synced
//
// The function takes the following parameters:
//
// - synced bool: if the clock is synced
//
// Sets @clock to synced and emits the #GstClock::synced signal, and wakes up any
// thread waiting in gst_clock_wait_for_sync().
//
// This function must only be called if %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC
// is set on the clock, and is intended to be called by subclasses only.
func (clock *ClockInstance) SetSynced(synced bool) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
if synced {
carg1 = C.TRUE
}
C.gst_clock_set_synced(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(synced)
}
// SetTimeout wraps gst_clock_set_timeout
//
// The function takes the following parameters:
//
// - timeout ClockTime: a timeout
//
// Sets the amount of time, in nanoseconds, to sample master and slave
// clocks
func (clock *ClockInstance) SetTimeout(timeout ClockTime) {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(timeout)
C.gst_clock_set_timeout(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(timeout)
}
// SingleShotIDReinit wraps gst_clock_single_shot_id_reinit
//
// The function takes the following parameters:
//
// - id ClockID: a #GstClockID
// - time ClockTime: The requested time.
//
// The function returns the following values:
//
// - goret bool
//
// Reinitializes the provided single shot @id to the provided time. Does not
// modify the reference count.
func (clock *ClockInstance) SingleShotIDReinit(id ClockID, time ClockTime) bool {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockID // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockID(id)
carg2 = C.GstClockTime(time)
cret = C.gst_clock_single_shot_id_reinit(carg0, carg1, carg2)
runtime.KeepAlive(clock)
runtime.KeepAlive(id)
runtime.KeepAlive(time)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// UnadjustUnlocked wraps gst_clock_unadjust_unlocked
//
// The function takes the following parameters:
//
// - external ClockTime: an external clock time
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @external clock time to the internal time of @clock,
// using the rate and reference time set with gst_clock_set_calibration().
// This function should be called with the clock's OBJECT_LOCK held and
// is mainly used by clock subclasses.
//
// This function is the reverse of gst_clock_adjust_unlocked().
func (clock *ClockInstance) UnadjustUnlocked(external ClockTime) ClockTime {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(external)
cret = C.gst_clock_unadjust_unlocked(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(external)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// UnadjustWithCalibration wraps gst_clock_unadjust_with_calibration
//
// The function takes the following parameters:
//
// - externalTarget ClockTime: a clock time
// - cinternal ClockTime: a reference internal time
// - cexternal ClockTime: a reference external time
// - cnum ClockTime: the numerator of the rate of the clock relative to its
// internal time
// - cdenom ClockTime: the denominator of the rate of the clock
//
// The function returns the following values:
//
// - goret ClockTime
//
// Converts the given @external_target clock time to the internal time,
// using the passed calibration parameters. This function performs the
// same calculation as gst_clock_unadjust_unlocked() when called using the
// current calibration parameters.
//
// Note: The @clock parameter is unused and can be NULL
func (clock *ClockInstance) UnadjustWithCalibration(externalTarget ClockTime, cinternal ClockTime, cexternal ClockTime, cnum ClockTime, cdenom ClockTime) ClockTime {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var carg4 C.GstClockTime // in, none, casted, alias
var carg5 C.GstClockTime // in, none, casted, alias
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(externalTarget)
carg2 = C.GstClockTime(cinternal)
carg3 = C.GstClockTime(cexternal)
carg4 = C.GstClockTime(cnum)
carg5 = C.GstClockTime(cdenom)
cret = C.gst_clock_unadjust_with_calibration(carg0, carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(clock)
runtime.KeepAlive(externalTarget)
runtime.KeepAlive(cinternal)
runtime.KeepAlive(cexternal)
runtime.KeepAlive(cnum)
runtime.KeepAlive(cdenom)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// WaitForSync wraps gst_clock_wait_for_sync
//
// The function takes the following parameters:
//
// - timeout ClockTime: timeout for waiting or %GST_CLOCK_TIME_NONE
//
// The function returns the following values:
//
// - goret bool
//
// Waits until @clock is synced for reporting the current time. If @timeout
// is %GST_CLOCK_TIME_NONE it will wait forever, otherwise it will time out
// after @timeout nanoseconds.
//
// For asynchronous waiting, the #GstClock::synced signal can be used.
//
// 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.
func (clock *ClockInstance) WaitForSync(timeout ClockTime) bool {
var carg0 *C.GstClock // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
carg1 = C.GstClockTime(timeout)
cret = C.gst_clock_wait_for_sync(carg0, carg1)
runtime.KeepAlive(clock)
runtime.KeepAlive(timeout)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// 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
ObjectInstance
}
var _ ControlBinding = (*ControlBindingInstance)(nil)
// ControlBinding wraps GstControlBinding
//
// A base class for value mapping objects that attaches control sources to #GObject
// properties. Such an object is taking one or more #GstControlSource instances,
// combines them and maps the resulting value to the type and value range of the
// bound property.
type ControlBinding interface {
Object
upcastToGstControlBinding() *ControlBindingInstance
// IsDisabled wraps gst_control_binding_is_disabled
// The function returns the following values:
//
// - goret bool
//
// Checks if the control binding is disabled.
IsDisabled() bool
// SetDisabled wraps gst_control_binding_set_disabled
//
// The function takes the following parameters:
//
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable a control binding for some time, i.e.
// gst_object_sync_values() will do nothing.
SetDisabled(bool)
// SyncControlBindingValues wraps gst_control_binding_sync_values
//
// The function takes the following parameters:
//
// - object Object: the object that has controlled properties
// - timestamp ClockTime: the time that should be processed
// - lastSync ClockTime: the last time this was called
//
// The function returns the following values:
//
// - goret bool
//
// Sets the property of the @object, according to the #GstControlSources that
// handles it and for the given timestamp.
//
// If this function fails, it is most likely the application developers fault.
// Most probably the control sources are not setup correctly.
SyncControlBindingValues(Object, ClockTime, ClockTime) bool
}
func unsafeWrapControlBinding(base *gobject.ObjectInstance) *ControlBindingInstance {
return &ControlBindingInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalControlBindingInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapControlBinding(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeControlBindingFromGlibNone is used to convert raw GstControlBinding pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeControlBindingFromGlibNone(c unsafe.Pointer) ControlBinding {
return gobject.UnsafeObjectFromGlibNone(c).(ControlBinding)
}
// UnsafeControlBindingFromGlibFull is used to convert raw GstControlBinding pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeControlBindingFromGlibFull(c unsafe.Pointer) ControlBinding {
return gobject.UnsafeObjectFromGlibFull(c).(ControlBinding)
}
func (c *ControlBindingInstance) upcastToGstControlBinding() *ControlBindingInstance {
return c
}
// UnsafeControlBindingToGlibNone is used to convert the instance to it's C value GstControlBinding. This is used by the bindings internally.
func UnsafeControlBindingToGlibNone(c ControlBinding) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeControlBindingToGlibFull is used to convert the instance to it's C value GstControlBinding, while removeing the finalizer. This is used by the bindings internally.
func UnsafeControlBindingToGlibFull(c ControlBinding) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// IsDisabled wraps gst_control_binding_is_disabled
// The function returns the following values:
//
// - goret bool
//
// Checks if the control binding is disabled.
func (binding *ControlBindingInstance) IsDisabled() bool {
var carg0 *C.GstControlBinding // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstControlBinding)(UnsafeControlBindingToGlibNone(binding))
cret = C.gst_control_binding_is_disabled(carg0)
runtime.KeepAlive(binding)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetDisabled wraps gst_control_binding_set_disabled
//
// The function takes the following parameters:
//
// - disabled bool: boolean that specifies whether to disable the controller
// or not.
//
// This function is used to disable a control binding for some time, i.e.
// gst_object_sync_values() will do nothing.
func (binding *ControlBindingInstance) SetDisabled(disabled bool) {
var carg0 *C.GstControlBinding // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstControlBinding)(UnsafeControlBindingToGlibNone(binding))
if disabled {
carg1 = C.TRUE
}
C.gst_control_binding_set_disabled(carg0, carg1)
runtime.KeepAlive(binding)
runtime.KeepAlive(disabled)
}
// SyncControlBindingValues wraps gst_control_binding_sync_values
//
// The function takes the following parameters:
//
// - object Object: the object that has controlled properties
// - timestamp ClockTime: the time that should be processed
// - lastSync ClockTime: the last time this was called
//
// The function returns the following values:
//
// - goret bool
//
// Sets the property of the @object, according to the #GstControlSources that
// handles it and for the given timestamp.
//
// If this function fails, it is most likely the application developers fault.
// Most probably the control sources are not setup correctly.
func (binding *ControlBindingInstance) SyncControlBindingValues(object Object, timestamp ClockTime, lastSync ClockTime) bool {
var carg0 *C.GstControlBinding // in, none, converted
var carg1 *C.GstObject // in, none, converted
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstControlBinding)(UnsafeControlBindingToGlibNone(binding))
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(object))
carg2 = C.GstClockTime(timestamp)
carg3 = C.GstClockTime(lastSync)
cret = C.gst_control_binding_sync_values(carg0, carg1, carg2, carg3)
runtime.KeepAlive(binding)
runtime.KeepAlive(object)
runtime.KeepAlive(timestamp)
runtime.KeepAlive(lastSync)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ControlSourceInstance is the instance type used by all types extending GstControlSource. It is used internally by the bindings. Users should use the interface [ControlSource] instead.
type ControlSourceInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ ControlSource = (*ControlSourceInstance)(nil)
// ControlSource wraps GstControlSource
//
// The #GstControlSource is a base class for control value sources that could
// be used to get timestamp-value pairs. A control source essentially is a
// function over time.
//
// A #GstControlSource is used by first getting an instance of a specific
// control-source, creating a binding for the control-source to the target property
// of the element and then adding the binding to the element. The binding will
// convert the data types and value range to fit to the bound property.
//
// For implementing a new #GstControlSource one has to implement
// #GstControlSourceGetValue and #GstControlSourceGetValueArray functions.
// These are then used by gst_control_source_get_value() and
// gst_control_source_get_value_array() to get values for specific timestamps.
type ControlSource interface {
Object
upcastToGstControlSource() *ControlSourceInstance
// ControlSourceGetValue wraps gst_control_source_get_value
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the time for which the value should be returned
//
// The function returns the following values:
//
// - value float64: the value
// - goret bool
//
// Gets the value for this #GstControlSource at a given timestamp.
ControlSourceGetValue(ClockTime) (float64, bool)
// ControlSourceGetValueArray wraps gst_control_source_get_value_array
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the first timestamp
// - interval ClockTime: the time steps
// - values []float64: array to put control-values in
//
// The function returns the following values:
//
// - goret bool
//
// Gets an array of values for for this #GstControlSource. Values that are
// undefined contain NANs.
ControlSourceGetValueArray(ClockTime, ClockTime, []float64) bool
}
func unsafeWrapControlSource(base *gobject.ObjectInstance) *ControlSourceInstance {
return &ControlSourceInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalControlSourceInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapControlSource(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeControlSourceFromGlibNone is used to convert raw GstControlSource pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeControlSourceFromGlibNone(c unsafe.Pointer) ControlSource {
return gobject.UnsafeObjectFromGlibNone(c).(ControlSource)
}
// UnsafeControlSourceFromGlibFull is used to convert raw GstControlSource pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeControlSourceFromGlibFull(c unsafe.Pointer) ControlSource {
return gobject.UnsafeObjectFromGlibFull(c).(ControlSource)
}
func (c *ControlSourceInstance) upcastToGstControlSource() *ControlSourceInstance {
return c
}
// UnsafeControlSourceToGlibNone is used to convert the instance to it's C value GstControlSource. This is used by the bindings internally.
func UnsafeControlSourceToGlibNone(c ControlSource) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeControlSourceToGlibFull is used to convert the instance to it's C value GstControlSource, while removeing the finalizer. This is used by the bindings internally.
func UnsafeControlSourceToGlibFull(c ControlSource) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// ControlSourceGetValue wraps gst_control_source_get_value
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the time for which the value should be returned
//
// The function returns the following values:
//
// - value float64: the value
// - goret bool
//
// Gets the value for this #GstControlSource at a given timestamp.
func (self *ControlSourceInstance) ControlSourceGetValue(timestamp ClockTime) (float64, bool) {
var carg0 *C.GstControlSource // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.gdouble // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstControlSource)(UnsafeControlSourceToGlibNone(self))
carg1 = C.GstClockTime(timestamp)
cret = C.gst_control_source_get_value(carg0, carg1, &carg2)
runtime.KeepAlive(self)
runtime.KeepAlive(timestamp)
var value float64
var goret bool
value = float64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// ControlSourceGetValueArray wraps gst_control_source_get_value_array
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the first timestamp
// - interval ClockTime: the time steps
// - values []float64: array to put control-values in
//
// The function returns the following values:
//
// - goret bool
//
// Gets an array of values for for this #GstControlSource. Values that are
// undefined contain NANs.
func (self *ControlSourceInstance) ControlSourceGetValueArray(timestamp ClockTime, interval ClockTime, values []float64) bool {
var carg0 *C.GstControlSource // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.guint // implicit
var carg4 *C.gdouble // in, transfer: none, C Pointers: 1, Name: array[gdouble], array (inner: *typesystem.CastablePrimitive, length-by: carg3)
var cret C.gboolean // return
carg0 = (*C.GstControlSource)(UnsafeControlSourceToGlibNone(self))
carg1 = C.GstClockTime(timestamp)
carg2 = C.GstClockTime(interval)
_ = values
_ = carg4
_ = carg3
panic("unimplemented conversion of []float64 (gdouble*)")
cret = C.gst_control_source_get_value_array(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(self)
runtime.KeepAlive(timestamp)
runtime.KeepAlive(interval)
runtime.KeepAlive(values)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DeviceInstance is the instance type used by all types extending GstDevice. It is used internally by the bindings. Users should use the interface [Device] instead.
type DeviceInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Device = (*DeviceInstance)(nil)
// Device wraps GstDevice
//
// #GstDevice are objects representing a device, they contain
// relevant metadata about the device, such as its class and the #GstCaps
// representing the media types it can produce or handle.
//
// #GstDevice are created by #GstDeviceProvider objects which can be
// aggregated by #GstDeviceMonitor objects.
type Device interface {
Object
upcastToGstDevice() *DeviceInstance
// CreateElement wraps gst_device_create_element
//
// The function takes the following parameters:
//
// - name string (nullable): name of new element, or %NULL to automatically
// create a unique name.
//
// The function returns the following values:
//
// - goret Element
//
// Creates the element with all of the required parameters set to use
// this device.
CreateElement(string) Element
// GetCaps wraps gst_device_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Getter for the #GstCaps that this device supports.
GetCaps() *Caps
// GetDeviceClass wraps gst_device_get_device_class
// The function returns the following values:
//
// - goret string
//
// Gets the "class" of a device. This is a "/" separated list of
// classes that represent this device. They are a subset of the
// classes of the #GstDeviceProvider that produced this device.
GetDeviceClass() string
// GetDisplayName wraps gst_device_get_display_name
// The function returns the following values:
//
// - goret string
//
// Gets the user-friendly name of the device.
GetDisplayName() string
// GetProperties wraps gst_device_get_properties
// The function returns the following values:
//
// - goret *Structure
//
// Gets the extra properties of a device.
GetProperties() *Structure
// HasClasses wraps gst_device_has_classes
//
// The function takes the following parameters:
//
// - classes string: a "/"-separated list of device classes to match, only match if
// all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @device matches all of the given classes
HasClasses(string) bool
// HasClassesv wraps gst_device_has_classesv
//
// The function takes the following parameters:
//
// - classes []string: a %NULL terminated array of classes
// to match, only match if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given classes
HasClassesv([]string) bool
// ReconfigureElement wraps gst_device_reconfigure_element
//
// The function takes the following parameters:
//
// - element Element: a #GstElement
//
// The function returns the following values:
//
// - goret bool
//
// Tries to reconfigure an existing element to use the device. If this
// function fails, then one must destroy the element and create a new one
// using gst_device_create_element().
//
// Note: This should only be implemented for elements can change their
// device in the PLAYING state.
ReconfigureElement(Element) bool
}
func unsafeWrapDevice(base *gobject.ObjectInstance) *DeviceInstance {
return &DeviceInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalDeviceInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapDevice(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeDeviceFromGlibNone is used to convert raw GstDevice pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceFromGlibNone(c unsafe.Pointer) Device {
return gobject.UnsafeObjectFromGlibNone(c).(Device)
}
// UnsafeDeviceFromGlibFull is used to convert raw GstDevice pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceFromGlibFull(c unsafe.Pointer) Device {
return gobject.UnsafeObjectFromGlibFull(c).(Device)
}
func (d *DeviceInstance) upcastToGstDevice() *DeviceInstance {
return d
}
// UnsafeDeviceToGlibNone is used to convert the instance to it's C value GstDevice. This is used by the bindings internally.
func UnsafeDeviceToGlibNone(c Device) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeDeviceToGlibFull is used to convert the instance to it's C value GstDevice, while removeing the finalizer. This is used by the bindings internally.
func UnsafeDeviceToGlibFull(c Device) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// CreateElement wraps gst_device_create_element
//
// The function takes the following parameters:
//
// - name string (nullable): name of new element, or %NULL to automatically
// create a unique name.
//
// The function returns the following values:
//
// - goret Element
//
// Creates the element with all of the required parameters set to use
// this device.
func (device *DeviceInstance) CreateElement(name string) Element {
var carg0 *C.GstDevice // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_device_create_element(carg0, carg1)
runtime.KeepAlive(device)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetCaps wraps gst_device_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Getter for the #GstCaps that this device supports.
func (device *DeviceInstance) GetCaps() *Caps {
var carg0 *C.GstDevice // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_device_get_caps(carg0)
runtime.KeepAlive(device)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetDeviceClass wraps gst_device_get_device_class
// The function returns the following values:
//
// - goret string
//
// Gets the "class" of a device. This is a "/" separated list of
// classes that represent this device. They are a subset of the
// classes of the #GstDeviceProvider that produced this device.
func (device *DeviceInstance) GetDeviceClass() string {
var carg0 *C.GstDevice // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_device_get_device_class(carg0)
runtime.KeepAlive(device)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetDisplayName wraps gst_device_get_display_name
// The function returns the following values:
//
// - goret string
//
// Gets the user-friendly name of the device.
func (device *DeviceInstance) GetDisplayName() string {
var carg0 *C.GstDevice // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_device_get_display_name(carg0)
runtime.KeepAlive(device)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetProperties wraps gst_device_get_properties
// The function returns the following values:
//
// - goret *Structure
//
// Gets the extra properties of a device.
func (device *DeviceInstance) GetProperties() *Structure {
var carg0 *C.GstDevice // in, none, converted
var cret *C.GstStructure // return, full, converted
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_device_get_properties(carg0)
runtime.KeepAlive(device)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// HasClasses wraps gst_device_has_classes
//
// The function takes the following parameters:
//
// - classes string: a "/"-separated list of device classes to match, only match if
// all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @device matches all of the given classes
func (device *DeviceInstance) HasClasses(classes string) bool {
var carg0 *C.GstDevice // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(classes)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_has_classes(carg0, carg1)
runtime.KeepAlive(device)
runtime.KeepAlive(classes)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasClassesv wraps gst_device_has_classesv
//
// The function takes the following parameters:
//
// - classes []string: a %NULL terminated array of classes
// to match, only match if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given classes
func (device *DeviceInstance) HasClassesv(classes []string) bool {
var carg0 *C.GstDevice // in, none, converted
var carg1 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], array (inner: *typesystem.StringPrimitive, zero-terminated)
var cret C.gboolean // return
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
_ = classes
_ = carg1
panic("unimplemented conversion of []string (gchar**)")
cret = C.gst_device_has_classesv(carg0, carg1)
runtime.KeepAlive(device)
runtime.KeepAlive(classes)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ReconfigureElement wraps gst_device_reconfigure_element
//
// The function takes the following parameters:
//
// - element Element: a #GstElement
//
// The function returns the following values:
//
// - goret bool
//
// Tries to reconfigure an existing element to use the device. If this
// function fails, then one must destroy the element and create a new one
// using gst_device_create_element().
//
// Note: This should only be implemented for elements can change their
// device in the PLAYING state.
func (device *DeviceInstance) ReconfigureElement(element Element) bool {
var carg0 *C.GstDevice // in, none, converted
var carg1 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_device_reconfigure_element(carg0, carg1)
runtime.KeepAlive(device)
runtime.KeepAlive(element)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// 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
ObjectInstance
}
var _ DeviceMonitor = (*DeviceMonitorInstance)(nil)
// DeviceMonitor wraps GstDeviceMonitor
//
// Applications should create a #GstDeviceMonitor when they want
// to probe, list and monitor devices of a specific type. The
// #GstDeviceMonitor will create the appropriate
// #GstDeviceProvider objects and manage them. It will then post
// messages on its #GstBus for devices that have been added and
// removed.
//
// The device monitor will monitor all devices matching the filters that
// the application has set.
//
// The basic use pattern of a device monitor is as follows:
// |[
// static gboolean
// my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data)
// {
// GstDevice *device;
// gchar *name;
//
// switch (GST_MESSAGE_TYPE (message)) {
// case GST_MESSAGE_DEVICE_ADDED:
// gst_message_parse_device_added (message, &amp;device);
// name = gst_device_get_display_name (device);
// g_print("Device added: %s\n", name);
// g_free (name);
// gst_object_unref (device);
// break;
// case GST_MESSAGE_DEVICE_REMOVED:
// gst_message_parse_device_removed (message, &amp;device);
// name = gst_device_get_display_name (device);
// g_print("Device removed: %s\n", name);
// g_free (name);
// gst_object_unref (device);
// break;
// default:
// break;
// }
//
// return G_SOURCE_CONTINUE;
// }
//
// GstDeviceMonitor *
// setup_raw_video_source_device_monitor (void) {
// GstDeviceMonitor *monitor;
// GstBus *bus;
// GstCaps *caps;
//
// monitor = gst_device_monitor_new ();
//
// bus = gst_device_monitor_get_bus (monitor);
// gst_bus_add_watch (bus, my_bus_func, NULL);
// gst_object_unref (bus);
//
// caps = gst_caps_new_empty_simple ("video/x-raw");
// gst_device_monitor_add_filter (monitor, "Video/Source", caps);
// gst_caps_unref (caps);
//
// gst_device_monitor_start (monitor);
//
// return monitor;
// }
// ]|
type DeviceMonitor interface {
Object
upcastToGstDeviceMonitor() *DeviceMonitorInstance
// AddFilter wraps gst_device_monitor_add_filter
//
// The function takes the following parameters:
//
// - classes string (nullable): device classes to use as filter or %NULL for any class
// - caps *Caps (nullable): the #GstCaps to filter or %NULL for ANY
//
// The function returns the following values:
//
// - goret uint
//
// Adds a filter for which #GstDevice will be monitored, any device that matches
// all these classes and the #GstCaps will be returned.
//
// If this function is called multiple times to add more filters, each will be
// matched independently. That is, adding more filters will not further restrict
// what devices are matched.
//
// The #GstCaps supported by the device as returned by gst_device_get_caps() are
// not intersected with caps filters added using this function.
//
// Filters must be added before the #GstDeviceMonitor is started.
AddFilter(string, *Caps) uint
// GetBus wraps gst_device_monitor_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of this #GstDeviceMonitor
GetBus() Bus
// GetProviders wraps gst_device_monitor_get_providers
// The function returns the following values:
//
// - goret []string
//
// Get a list of the currently selected device provider factories.
//
// This
GetProviders() []string
// GetShowAllDevices wraps gst_device_monitor_get_show_all_devices
// The function returns the following values:
//
// - goret bool
//
// Get if @monitor is currently showing all devices, even those from hidden
// providers.
GetShowAllDevices() bool
// RemoveFilter wraps gst_device_monitor_remove_filter
//
// The function takes the following parameters:
//
// - filterId uint: the id of the filter
//
// The function returns the following values:
//
// - goret bool
//
// Removes a filter from the #GstDeviceMonitor using the id that was returned
// by gst_device_monitor_add_filter().
RemoveFilter(uint) bool
// SetShowAllDevices wraps gst_device_monitor_set_show_all_devices
//
// The function takes the following parameters:
//
// - showAll bool: show all devices
//
// Set if all devices should be visible, even those devices from hidden
// providers. Setting @show_all to true might show some devices multiple times.
SetShowAllDevices(bool)
// Start wraps gst_device_monitor_start
// The function returns the following values:
//
// - goret bool
//
// Starts monitoring the devices, one this has succeeded, the
// %GST_MESSAGE_DEVICE_ADDED and %GST_MESSAGE_DEVICE_REMOVED messages
// will be emitted on the bus when the list of devices changes.
Start() bool
// Stop wraps gst_device_monitor_stop
//
// Stops monitoring the devices.
Stop()
}
func unsafeWrapDeviceMonitor(base *gobject.ObjectInstance) *DeviceMonitorInstance {
return &DeviceMonitorInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalDeviceMonitorInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapDeviceMonitor(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeDeviceMonitorFromGlibNone is used to convert raw GstDeviceMonitor pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceMonitorFromGlibNone(c unsafe.Pointer) DeviceMonitor {
return gobject.UnsafeObjectFromGlibNone(c).(DeviceMonitor)
}
// UnsafeDeviceMonitorFromGlibFull is used to convert raw GstDeviceMonitor pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceMonitorFromGlibFull(c unsafe.Pointer) DeviceMonitor {
return gobject.UnsafeObjectFromGlibFull(c).(DeviceMonitor)
}
func (d *DeviceMonitorInstance) upcastToGstDeviceMonitor() *DeviceMonitorInstance {
return d
}
// UnsafeDeviceMonitorToGlibNone is used to convert the instance to it's C value GstDeviceMonitor. This is used by the bindings internally.
func UnsafeDeviceMonitorToGlibNone(c DeviceMonitor) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeDeviceMonitorToGlibFull is used to convert the instance to it's C value GstDeviceMonitor, while removeing the finalizer. This is used by the bindings internally.
func UnsafeDeviceMonitorToGlibFull(c DeviceMonitor) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewDeviceMonitor wraps gst_device_monitor_new
// The function returns the following values:
//
// - goret DeviceMonitor
//
// Create a new #GstDeviceMonitor
func NewDeviceMonitor() DeviceMonitor {
var cret *C.GstDeviceMonitor // return, full, converted
cret = C.gst_device_monitor_new()
var goret DeviceMonitor
goret = UnsafeDeviceMonitorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddFilter wraps gst_device_monitor_add_filter
//
// The function takes the following parameters:
//
// - classes string (nullable): device classes to use as filter or %NULL for any class
// - caps *Caps (nullable): the #GstCaps to filter or %NULL for ANY
//
// The function returns the following values:
//
// - goret uint
//
// Adds a filter for which #GstDevice will be monitored, any device that matches
// all these classes and the #GstCaps will be returned.
//
// If this function is called multiple times to add more filters, each will be
// matched independently. That is, adding more filters will not further restrict
// what devices are matched.
//
// The #GstCaps supported by the device as returned by gst_device_get_caps() are
// not intersected with caps filters added using this function.
//
// Filters must be added before the #GstDeviceMonitor is started.
func (monitor *DeviceMonitorInstance) AddFilter(classes string, caps *Caps) uint {
var carg0 *C.GstDeviceMonitor // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstCaps // in, none, converted, nullable
var cret C.guint // return, none, casted
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
if classes != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(classes)))
defer C.free(unsafe.Pointer(carg1))
}
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
cret = C.gst_device_monitor_add_filter(carg0, carg1, carg2)
runtime.KeepAlive(monitor)
runtime.KeepAlive(classes)
runtime.KeepAlive(caps)
var goret uint
goret = uint(cret)
return goret
}
// GetBus wraps gst_device_monitor_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of this #GstDeviceMonitor
func (monitor *DeviceMonitorInstance) GetBus() Bus {
var carg0 *C.GstDeviceMonitor // in, none, converted
var cret *C.GstBus // return, full, converted
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
cret = C.gst_device_monitor_get_bus(carg0)
runtime.KeepAlive(monitor)
var goret Bus
goret = UnsafeBusFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetProviders wraps gst_device_monitor_get_providers
// The function returns the following values:
//
// - goret []string
//
// Get a list of the currently selected device provider factories.
//
// This
func (monitor *DeviceMonitorInstance) GetProviders() []string {
var carg0 *C.GstDeviceMonitor // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
cret = C.gst_device_monitor_get_providers(carg0)
runtime.KeepAlive(monitor)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetShowAllDevices wraps gst_device_monitor_get_show_all_devices
// The function returns the following values:
//
// - goret bool
//
// Get if @monitor is currently showing all devices, even those from hidden
// providers.
func (monitor *DeviceMonitorInstance) GetShowAllDevices() bool {
var carg0 *C.GstDeviceMonitor // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
cret = C.gst_device_monitor_get_show_all_devices(carg0)
runtime.KeepAlive(monitor)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveFilter wraps gst_device_monitor_remove_filter
//
// The function takes the following parameters:
//
// - filterId uint: the id of the filter
//
// The function returns the following values:
//
// - goret bool
//
// Removes a filter from the #GstDeviceMonitor using the id that was returned
// by gst_device_monitor_add_filter().
func (monitor *DeviceMonitorInstance) RemoveFilter(filterId uint) bool {
var carg0 *C.GstDeviceMonitor // in, none, converted
var carg1 C.guint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
carg1 = C.guint(filterId)
cret = C.gst_device_monitor_remove_filter(carg0, carg1)
runtime.KeepAlive(monitor)
runtime.KeepAlive(filterId)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetShowAllDevices wraps gst_device_monitor_set_show_all_devices
//
// The function takes the following parameters:
//
// - showAll bool: show all devices
//
// Set if all devices should be visible, even those devices from hidden
// providers. Setting @show_all to true might show some devices multiple times.
func (monitor *DeviceMonitorInstance) SetShowAllDevices(showAll bool) {
var carg0 *C.GstDeviceMonitor // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
if showAll {
carg1 = C.TRUE
}
C.gst_device_monitor_set_show_all_devices(carg0, carg1)
runtime.KeepAlive(monitor)
runtime.KeepAlive(showAll)
}
// Start wraps gst_device_monitor_start
// The function returns the following values:
//
// - goret bool
//
// Starts monitoring the devices, one this has succeeded, the
// %GST_MESSAGE_DEVICE_ADDED and %GST_MESSAGE_DEVICE_REMOVED messages
// will be emitted on the bus when the list of devices changes.
func (monitor *DeviceMonitorInstance) Start() bool {
var carg0 *C.GstDeviceMonitor // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
cret = C.gst_device_monitor_start(carg0)
runtime.KeepAlive(monitor)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Stop wraps gst_device_monitor_stop
//
// Stops monitoring the devices.
func (monitor *DeviceMonitorInstance) Stop() {
var carg0 *C.GstDeviceMonitor // in, none, converted
carg0 = (*C.GstDeviceMonitor)(UnsafeDeviceMonitorToGlibNone(monitor))
C.gst_device_monitor_stop(carg0)
runtime.KeepAlive(monitor)
}
// DeviceProviderInstance is the instance type used by all types extending GstDeviceProvider. It is used internally by the bindings. Users should use the interface [DeviceProvider] instead.
type DeviceProviderInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ DeviceProvider = (*DeviceProviderInstance)(nil)
// DeviceProvider wraps GstDeviceProvider
//
// A #GstDeviceProvider subclass is provided by a plugin that handles devices
// if there is a way to programmatically list connected devices. It can also
// optionally provide updates to the list of connected devices.
//
// Each #GstDeviceProvider subclass is a singleton, a plugin should
// normally provide a single subclass for all devices.
//
// Applications would normally use a #GstDeviceMonitor to monitor devices
// from all relevant providers.
type DeviceProvider interface {
Object
upcastToGstDeviceProvider() *DeviceProviderInstance
// CanMonitor wraps gst_device_provider_can_monitor
// The function returns the following values:
//
// - goret bool
CanMonitor() bool
// DeviceAdd wraps gst_device_provider_device_add
//
// The function takes the following parameters:
//
// - device Device: a #GstDevice that has been added
//
// Posts a message on the provider's #GstBus to inform applications that
// a new device has been added.
//
// This is for use by subclasses.
//
// @device's reference count will be incremented, and any floating reference
// will be removed (see gst_object_ref_sink()).
DeviceAdd(Device)
// DeviceChanged wraps gst_device_provider_device_changed
//
// The function takes the following parameters:
//
// - device Device: the new version of @changed_device
// - changedDevice Device: the old version of the device that has been updated
//
// This function is used when @changed_device was modified into its new form
// @device. This will post a `DEVICE_CHANGED` message on the bus to let
// the application know that the device was modified. #GstDevice is immutable
// for MT. safety purposes so this is an "atomic" way of letting the application
// know when a device was modified.
DeviceChanged(Device, Device)
// DeviceRemove wraps gst_device_provider_device_remove
//
// The function takes the following parameters:
//
// - device Device: a #GstDevice that has been removed
//
// Posts a message on the provider's #GstBus to inform applications that
// a device has been removed.
//
// This is for use by subclasses.
DeviceRemove(Device)
// GetBus wraps gst_device_provider_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of this #GstDeviceProvider
GetBus() Bus
// GetFactory wraps gst_device_provider_get_factory
// The function returns the following values:
//
// - goret DeviceProviderFactory
//
// Retrieves the factory that was used to create this device provider.
GetFactory() DeviceProviderFactory
// GetHiddenProviders wraps gst_device_provider_get_hidden_providers
// The function returns the following values:
//
// - goret []string
//
// Get the provider factory names of the #GstDeviceProvider instances that
// are hidden by @provider.
GetHiddenProviders() []string
// GetMetadata wraps gst_device_provider_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @provider.
GetMetadata(string) string
// HideProvider wraps gst_device_provider_hide_provider
//
// The function takes the following parameters:
//
// - name string: a provider factory name
//
// Make @provider hide the devices from the factory with @name.
//
// This function is used when @provider will also provide the devices reported
// by provider factory @name. A monitor should stop monitoring the
// device provider with @name to avoid duplicate devices.
HideProvider(string)
// IsStarted wraps gst_device_provider_is_started
// The function returns the following values:
//
// - goret bool
//
// This function can be used to know if the @provider was successfully started.
IsStarted() bool
// Start wraps gst_device_provider_start
// The function returns the following values:
//
// - goret bool
//
// Starts providering the devices. This will cause #GST_MESSAGE_DEVICE_ADDED
// and #GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus
// when devices are added or removed from the system.
//
// Since the #GstDeviceProvider is a singleton,
// gst_device_provider_start() may already have been called by another
// user of the object, gst_device_provider_stop() needs to be called the same
// number of times.
//
// After this function has been called, gst_device_provider_get_devices() will
// return the same objects that have been received from the
// #GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.
Start() bool
// Stop wraps gst_device_provider_stop
//
// Decreases the use-count by one. If the use count reaches zero, this
// #GstDeviceProvider will stop providering the devices. This needs to be
// called the same number of times that gst_device_provider_start() was called.
Stop()
// UnhideProvider wraps gst_device_provider_unhide_provider
//
// The function takes the following parameters:
//
// - name string: a provider factory name
//
// Make @provider unhide the devices from factory @name.
//
// This function is used when @provider will no longer provide the devices
// reported by provider factory @name. A monitor should start
// monitoring the devices from provider factory @name in order to see
// all devices again.
UnhideProvider(string)
}
func unsafeWrapDeviceProvider(base *gobject.ObjectInstance) *DeviceProviderInstance {
return &DeviceProviderInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalDeviceProviderInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapDeviceProvider(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeDeviceProviderFromGlibNone is used to convert raw GstDeviceProvider pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderFromGlibNone(c unsafe.Pointer) DeviceProvider {
return gobject.UnsafeObjectFromGlibNone(c).(DeviceProvider)
}
// UnsafeDeviceProviderFromGlibFull is used to convert raw GstDeviceProvider pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderFromGlibFull(c unsafe.Pointer) DeviceProvider {
return gobject.UnsafeObjectFromGlibFull(c).(DeviceProvider)
}
func (d *DeviceProviderInstance) upcastToGstDeviceProvider() *DeviceProviderInstance {
return d
}
// UnsafeDeviceProviderToGlibNone is used to convert the instance to it's C value GstDeviceProvider. This is used by the bindings internally.
func UnsafeDeviceProviderToGlibNone(c DeviceProvider) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeDeviceProviderToGlibFull is used to convert the instance to it's C value GstDeviceProvider, while removeing the finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderToGlibFull(c DeviceProvider) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// DeviceProviderRegister wraps gst_device_provider_register
//
// The function takes the following parameters:
//
// - plugin Plugin (nullable): #GstPlugin to register the device provider with, or %NULL for
// a static device provider.
// - name string: name of device providers of this type
// - rank uint: rank of device provider (higher rank means more importance when autoplugging)
// - typ gobject.Type: GType of device provider to register
//
// The function returns the following values:
//
// - goret bool
//
// Create a new device providerfactory capable of instantiating objects of the
// @type and add the factory to @plugin.
func DeviceProviderRegister(plugin Plugin, name string, rank uint, typ gobject.Type) bool {
var carg1 *C.GstPlugin // in, none, converted, nullable
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 C.guint // in, none, casted
var carg4 C.GType // in, none, casted, alias
var cret C.gboolean // return
if plugin != nil {
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
}
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
carg3 = C.guint(rank)
carg4 = C.GType(typ)
cret = C.gst_device_provider_register(carg1, carg2, carg3, carg4)
runtime.KeepAlive(plugin)
runtime.KeepAlive(name)
runtime.KeepAlive(rank)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CanMonitor wraps gst_device_provider_can_monitor
// The function returns the following values:
//
// - goret bool
func (provider *DeviceProviderInstance) CanMonitor() bool {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_can_monitor(carg0)
runtime.KeepAlive(provider)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DeviceAdd wraps gst_device_provider_device_add
//
// The function takes the following parameters:
//
// - device Device: a #GstDevice that has been added
//
// Posts a message on the provider's #GstBus to inform applications that
// a new device has been added.
//
// This is for use by subclasses.
//
// @device's reference count will be incremented, and any floating reference
// will be removed (see gst_object_ref_sink()).
func (provider *DeviceProviderInstance) DeviceAdd(device Device) {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.GstDevice // in, none, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
C.gst_device_provider_device_add(carg0, carg1)
runtime.KeepAlive(provider)
runtime.KeepAlive(device)
}
// DeviceChanged wraps gst_device_provider_device_changed
//
// The function takes the following parameters:
//
// - device Device: the new version of @changed_device
// - changedDevice Device: the old version of the device that has been updated
//
// This function is used when @changed_device was modified into its new form
// @device. This will post a `DEVICE_CHANGED` message on the bus to let
// the application know that the device was modified. #GstDevice is immutable
// for MT. safety purposes so this is an "atomic" way of letting the application
// know when a device was modified.
func (provider *DeviceProviderInstance) DeviceChanged(device Device, changedDevice Device) {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.GstDevice // in, none, converted
var carg2 *C.GstDevice // in, none, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
carg2 = (*C.GstDevice)(UnsafeDeviceToGlibNone(changedDevice))
C.gst_device_provider_device_changed(carg0, carg1, carg2)
runtime.KeepAlive(provider)
runtime.KeepAlive(device)
runtime.KeepAlive(changedDevice)
}
// DeviceRemove wraps gst_device_provider_device_remove
//
// The function takes the following parameters:
//
// - device Device: a #GstDevice that has been removed
//
// Posts a message on the provider's #GstBus to inform applications that
// a device has been removed.
//
// This is for use by subclasses.
func (provider *DeviceProviderInstance) DeviceRemove(device Device) {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.GstDevice // in, none, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
C.gst_device_provider_device_remove(carg0, carg1)
runtime.KeepAlive(provider)
runtime.KeepAlive(device)
}
// GetBus wraps gst_device_provider_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of this #GstDeviceProvider
func (provider *DeviceProviderInstance) GetBus() Bus {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret *C.GstBus // return, full, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_get_bus(carg0)
runtime.KeepAlive(provider)
var goret Bus
goret = UnsafeBusFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetFactory wraps gst_device_provider_get_factory
// The function returns the following values:
//
// - goret DeviceProviderFactory
//
// Retrieves the factory that was used to create this device provider.
func (provider *DeviceProviderInstance) GetFactory() DeviceProviderFactory {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret *C.GstDeviceProviderFactory // return, none, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_get_factory(carg0)
runtime.KeepAlive(provider)
var goret DeviceProviderFactory
goret = UnsafeDeviceProviderFactoryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetHiddenProviders wraps gst_device_provider_get_hidden_providers
// The function returns the following values:
//
// - goret []string
//
// Get the provider factory names of the #GstDeviceProvider instances that
// are hidden by @provider.
func (provider *DeviceProviderInstance) GetHiddenProviders() []string {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_get_hidden_providers(carg0)
runtime.KeepAlive(provider)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetMetadata wraps gst_device_provider_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @provider.
func (provider *DeviceProviderInstance) GetMetadata(key string) string {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_provider_get_metadata(carg0, carg1)
runtime.KeepAlive(provider)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// HideProvider wraps gst_device_provider_hide_provider
//
// The function takes the following parameters:
//
// - name string: a provider factory name
//
// Make @provider hide the devices from the factory with @name.
//
// This function is used when @provider will also provide the devices reported
// by provider factory @name. A monitor should stop monitoring the
// device provider with @name to avoid duplicate devices.
func (provider *DeviceProviderInstance) HideProvider(name string) {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
C.gst_device_provider_hide_provider(carg0, carg1)
runtime.KeepAlive(provider)
runtime.KeepAlive(name)
}
// IsStarted wraps gst_device_provider_is_started
// The function returns the following values:
//
// - goret bool
//
// This function can be used to know if the @provider was successfully started.
func (provider *DeviceProviderInstance) IsStarted() bool {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_is_started(carg0)
runtime.KeepAlive(provider)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Start wraps gst_device_provider_start
// The function returns the following values:
//
// - goret bool
//
// Starts providering the devices. This will cause #GST_MESSAGE_DEVICE_ADDED
// and #GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus
// when devices are added or removed from the system.
//
// Since the #GstDeviceProvider is a singleton,
// gst_device_provider_start() may already have been called by another
// user of the object, gst_device_provider_stop() needs to be called the same
// number of times.
//
// After this function has been called, gst_device_provider_get_devices() will
// return the same objects that have been received from the
// #GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.
func (provider *DeviceProviderInstance) Start() bool {
var carg0 *C.GstDeviceProvider // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
cret = C.gst_device_provider_start(carg0)
runtime.KeepAlive(provider)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Stop wraps gst_device_provider_stop
//
// Decreases the use-count by one. If the use count reaches zero, this
// #GstDeviceProvider will stop providering the devices. This needs to be
// called the same number of times that gst_device_provider_start() was called.
func (provider *DeviceProviderInstance) Stop() {
var carg0 *C.GstDeviceProvider // in, none, converted
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
C.gst_device_provider_stop(carg0)
runtime.KeepAlive(provider)
}
// UnhideProvider wraps gst_device_provider_unhide_provider
//
// The function takes the following parameters:
//
// - name string: a provider factory name
//
// Make @provider unhide the devices from factory @name.
//
// This function is used when @provider will no longer provide the devices
// reported by provider factory @name. A monitor should start
// monitoring the devices from provider factory @name in order to see
// all devices again.
func (provider *DeviceProviderInstance) UnhideProvider(name string) {
var carg0 *C.GstDeviceProvider // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProvider)(UnsafeDeviceProviderToGlibNone(provider))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
C.gst_device_provider_unhide_provider(carg0, carg1)
runtime.KeepAlive(provider)
runtime.KeepAlive(name)
}
// 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
PluginFeatureInstance
}
var _ DeviceProviderFactory = (*DeviceProviderFactoryInstance)(nil)
// DeviceProviderFactory wraps GstDeviceProviderFactory
//
// #GstDeviceProviderFactory is used to create instances of device providers. A
// GstDeviceProviderfactory can be added to a #GstPlugin as it is also a
// #GstPluginFeature.
//
// Use the gst_device_provider_factory_find() and
// gst_device_provider_factory_get() functions to create device
// provider instances or use gst_device_provider_factory_get_by_name() as a
// convenient shortcut.
type DeviceProviderFactory interface {
PluginFeature
upcastToGstDeviceProviderFactory() *DeviceProviderFactoryInstance
// Get wraps gst_device_provider_factory_get
// The function returns the following values:
//
// - goret DeviceProvider
//
// Returns the device provider of the type defined by the given device
// providerfactory.
Get() DeviceProvider
// GetDeviceProviderType wraps gst_device_provider_factory_get_device_provider_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for device providers managed by this factory. The type can
// only be retrieved if the device provider factory is loaded, which can be
// assured with gst_plugin_feature_load().
GetDeviceProviderType() gobject.Type
// GetMetadata wraps gst_device_provider_factory_get_metadata
//
// The function takes the following parameters:
//
// - key string: a key
//
// The function returns the following values:
//
// - goret string
//
// Get the metadata on @factory with @key.
GetMetadata(string) string
// GetMetadataKeys wraps gst_device_provider_factory_get_metadata_keys
// The function returns the following values:
//
// - goret []string
//
// Get the available keys for the metadata on @factory.
GetMetadataKeys() []string
// HasClasses wraps gst_device_provider_factory_has_classes
//
// The function takes the following parameters:
//
// - classes string (nullable): a "/" separate list of classes to match, only match
// if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given @classes
HasClasses(string) bool
// HasClassesv wraps gst_device_provider_factory_has_classesv
//
// The function takes the following parameters:
//
// - classes []string (nullable): a %NULL terminated array
// of classes to match, only match if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given classes
HasClassesv([]string) bool
}
func unsafeWrapDeviceProviderFactory(base *gobject.ObjectInstance) *DeviceProviderFactoryInstance {
return &DeviceProviderFactoryInstance{
PluginFeatureInstance: PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalDeviceProviderFactoryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapDeviceProviderFactory(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeDeviceProviderFactoryFromGlibNone is used to convert raw GstDeviceProviderFactory pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryFromGlibNone(c unsafe.Pointer) DeviceProviderFactory {
return gobject.UnsafeObjectFromGlibNone(c).(DeviceProviderFactory)
}
// UnsafeDeviceProviderFactoryFromGlibFull is used to convert raw GstDeviceProviderFactory pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryFromGlibFull(c unsafe.Pointer) DeviceProviderFactory {
return gobject.UnsafeObjectFromGlibFull(c).(DeviceProviderFactory)
}
func (d *DeviceProviderFactoryInstance) upcastToGstDeviceProviderFactory() *DeviceProviderFactoryInstance {
return d
}
// UnsafeDeviceProviderFactoryToGlibNone is used to convert the instance to it's C value GstDeviceProviderFactory. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryToGlibNone(c DeviceProviderFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeDeviceProviderFactoryToGlibFull is used to convert the instance to it's C value GstDeviceProviderFactory, while removeing the finalizer. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryToGlibFull(c DeviceProviderFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// DeviceProviderFactoryFind wraps gst_device_provider_factory_find
//
// The function takes the following parameters:
//
// - name string: name of factory to find
//
// The function returns the following values:
//
// - goret DeviceProviderFactory
//
// Search for an device provider factory of the given name. Refs the returned
// device provider factory; caller is responsible for unreffing.
func DeviceProviderFactoryFind(name string) DeviceProviderFactory {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstDeviceProviderFactory // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_provider_factory_find(carg1)
runtime.KeepAlive(name)
var goret DeviceProviderFactory
goret = UnsafeDeviceProviderFactoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// DeviceProviderFactoryGetByName wraps gst_device_provider_factory_get_by_name
//
// The function takes the following parameters:
//
// - factoryname string: a named factory to instantiate
//
// The function returns the following values:
//
// - goret DeviceProvider
//
// Returns the device provider of the type defined by the given device
// provider factory.
func DeviceProviderFactoryGetByName(factoryname string) DeviceProvider {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstDeviceProvider // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(factoryname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_provider_factory_get_by_name(carg1)
runtime.KeepAlive(factoryname)
var goret DeviceProvider
goret = UnsafeDeviceProviderFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Get wraps gst_device_provider_factory_get
// The function returns the following values:
//
// - goret DeviceProvider
//
// Returns the device provider of the type defined by the given device
// providerfactory.
func (factory *DeviceProviderFactoryInstance) Get() DeviceProvider {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var cret *C.GstDeviceProvider // return, full, converted
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
cret = C.gst_device_provider_factory_get(carg0)
runtime.KeepAlive(factory)
var goret DeviceProvider
goret = UnsafeDeviceProviderFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetDeviceProviderType wraps gst_device_provider_factory_get_device_provider_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for device providers managed by this factory. The type can
// only be retrieved if the device provider factory is loaded, which can be
// assured with gst_plugin_feature_load().
func (factory *DeviceProviderFactoryInstance) GetDeviceProviderType() gobject.Type {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var cret C.GType // return, none, casted, alias
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
cret = C.gst_device_provider_factory_get_device_provider_type(carg0)
runtime.KeepAlive(factory)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// GetMetadata wraps gst_device_provider_factory_get_metadata
//
// The function takes the following parameters:
//
// - key string: a key
//
// The function returns the following values:
//
// - goret string
//
// Get the metadata on @factory with @key.
func (factory *DeviceProviderFactoryInstance) GetMetadata(key string) string {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_provider_factory_get_metadata(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetMetadataKeys wraps gst_device_provider_factory_get_metadata_keys
// The function returns the following values:
//
// - goret []string
//
// Get the available keys for the metadata on @factory.
func (factory *DeviceProviderFactoryInstance) GetMetadataKeys() []string {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
cret = C.gst_device_provider_factory_get_metadata_keys(carg0)
runtime.KeepAlive(factory)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// HasClasses wraps gst_device_provider_factory_has_classes
//
// The function takes the following parameters:
//
// - classes string (nullable): a "/" separate list of classes to match, only match
// if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given @classes
func (factory *DeviceProviderFactoryInstance) HasClasses(classes string) bool {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
if classes != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(classes)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_device_provider_factory_has_classes(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(classes)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasClassesv wraps gst_device_provider_factory_has_classesv
//
// The function takes the following parameters:
//
// - classes []string (nullable): a %NULL terminated array
// of classes to match, only match if all classes are matched
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory matches all of the given classes
func (factory *DeviceProviderFactoryInstance) HasClassesv(classes []string) bool {
var carg0 *C.GstDeviceProviderFactory // in, none, converted
var carg1 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], nullable, array (inner: *typesystem.StringPrimitive, zero-terminated)
var cret C.gboolean // return
carg0 = (*C.GstDeviceProviderFactory)(UnsafeDeviceProviderFactoryToGlibNone(factory))
_ = classes
_ = carg1
panic("unimplemented conversion of []string (gchar**)")
cret = C.gst_device_provider_factory_has_classesv(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(classes)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DynamicTypeFactoryInstance is the instance type used by all types extending GstDynamicTypeFactory. It is used internally by the bindings. Users should use the interface [DynamicTypeFactory] instead.
type DynamicTypeFactoryInstance struct {
_ [0]func() // equal guard
PluginFeatureInstance
}
var _ DynamicTypeFactory = (*DynamicTypeFactoryInstance)(nil)
// DynamicTypeFactory wraps GstDynamicTypeFactory
//
// #GstDynamicTypeFactory is used to represent a type that can be
// automatically loaded the first time it is used. For example,
// a non-standard type for use in caps fields.
//
// In general, applications and plugins don't need to use the factory
// beyond registering the type in a plugin init function. Once that is
// done, the type is stored in the registry, and ready as soon as the
// registry is loaded.
//
// ## Registering a type for dynamic loading
//
// |[&lt;!-- language="C" --&gt;
//
// static gboolean
// plugin_init (GstPlugin * plugin)
// {
// return gst_dynamic_type_register (plugin, GST_TYPE_CUSTOM_CAPS_FIELD);
// }
// ]|
type DynamicTypeFactory interface {
PluginFeature
upcastToGstDynamicTypeFactory() *DynamicTypeFactoryInstance
}
func unsafeWrapDynamicTypeFactory(base *gobject.ObjectInstance) *DynamicTypeFactoryInstance {
return &DynamicTypeFactoryInstance{
PluginFeatureInstance: PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalDynamicTypeFactoryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapDynamicTypeFactory(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeDynamicTypeFactoryFromGlibNone is used to convert raw GstDynamicTypeFactory pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryFromGlibNone(c unsafe.Pointer) DynamicTypeFactory {
return gobject.UnsafeObjectFromGlibNone(c).(DynamicTypeFactory)
}
// UnsafeDynamicTypeFactoryFromGlibFull is used to convert raw GstDynamicTypeFactory pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryFromGlibFull(c unsafe.Pointer) DynamicTypeFactory {
return gobject.UnsafeObjectFromGlibFull(c).(DynamicTypeFactory)
}
func (d *DynamicTypeFactoryInstance) upcastToGstDynamicTypeFactory() *DynamicTypeFactoryInstance {
return d
}
// UnsafeDynamicTypeFactoryToGlibNone is used to convert the instance to it's C value GstDynamicTypeFactory. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryToGlibNone(c DynamicTypeFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeDynamicTypeFactoryToGlibFull is used to convert the instance to it's C value GstDynamicTypeFactory, while removeing the finalizer. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryToGlibFull(c DynamicTypeFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// DynamicTypeFactoryLoad wraps gst_dynamic_type_factory_load
//
// The function takes the following parameters:
//
// - factoryname string
//
// The function returns the following values:
//
// - goret gobject.Type
func DynamicTypeFactoryLoad(factoryname string) gobject.Type {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.GType // return, none, casted, alias
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(factoryname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_dynamic_type_factory_load(carg1)
runtime.KeepAlive(factoryname)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// ElementInstance is the instance type used by all types extending GstElement. It is used internally by the bindings. Users should use the interface [Element] instead.
type ElementInstance struct {
_ [0]func() // equal guard
ObjectInstance
}
var _ Element = (*ElementInstance)(nil)
// Element wraps GstElement
//
// GstElement is the abstract base class needed to construct an element that
// can be used in a GStreamer pipeline. Please refer to the plugin writers
// guide for more information on creating #GstElement subclasses.
//
// The name of a #GstElement can be get with gst_element_get_name() and set with
// gst_element_set_name(). For speed, GST_ELEMENT_NAME() can be used in the
// core when using the appropriate locking. Do not use this in plug-ins or
// applications in order to retain ABI compatibility.
//
// Elements can have pads (of the type #GstPad). These pads link to pads on
// other elements. #GstBuffer flow between these linked pads.
// A #GstElement has a #GList of #GstPad structures for all their input (or sink)
// and output (or source) pads.
// Core and plug-in writers can add and remove pads with gst_element_add_pad()
// and gst_element_remove_pad().
//
// An existing pad of an element can be retrieved by name with
// gst_element_get_static_pad(). A new dynamic pad can be created using
// gst_element_request_pad() with a #GstPadTemplate.
// An iterator of all pads can be retrieved with gst_element_iterate_pads().
//
// Elements can be linked through their pads.
// If the link is straightforward, use the gst_element_link()
// convenience function to link two elements, or gst_element_link_many()
// for more elements in a row.
// Use gst_element_link_filtered() to link two elements constrained by
// a specified set of #GstCaps.
// For finer control, use gst_element_link_pads() and
// gst_element_link_pads_filtered() to specify the pads to link on
// each element by name.
//
// Each element has a state (see #GstState). You can get and set the state
// of an element with gst_element_get_state() and gst_element_set_state().
// Setting a state triggers a #GstStateChange. To get a string representation
// of a #GstState, use gst_element_state_get_name().
//
// You can get and set a #GstClock on an element using gst_element_get_clock()
// and gst_element_set_clock().
// Some elements can provide a clock for the pipeline if
// the #GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the
// gst_element_provide_clock() method one can retrieve the clock provided by
// such an element.
// Not all elements require a clock to operate correctly. If the
// #GST_ELEMENT_FLAG_REQUIRE_CLOCK() flag is set, a clock should be set on the
// element with gst_element_set_clock().
//
// Note that clock selection and distribution is normally handled by the
// toplevel #GstPipeline so the clock functions are only to be used in very
// specific situations.
type Element interface {
ElementExtManual // handwritten functions
Object
upcastToGstElement() *ElementInstance
// AbortState wraps gst_element_abort_state
//
// Abort the state change of the element. This function is used
// by elements that do asynchronous state changes and find out
// something is wrong.
//
// This function should be called with the STATE_LOCK held.
//
// MT safe.
AbortState()
// AddPad wraps gst_element_add_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to add to the element.
//
// The function returns the following values:
//
// - goret bool
//
// Adds a pad (link point) to @element. @pad's parent will be set to @element;
// see gst_object_set_parent() for refcounting information.
//
// Pads are automatically activated when added in the PAUSED or PLAYING
// state.
//
// The pad and the element should be unlocked when calling this function.
//
// This function will emit the #GstElement::pad-added signal on the element.
AddPad(Pad) bool
// AddPropertyDeepNotifyWatch wraps gst_element_add_property_deep_notify_watch
//
// The function takes the following parameters:
//
// - propertyName string (nullable): name of property to watch for changes, or
// NULL to watch all properties
// - includeValue bool: whether to include the new property value in the message
//
// The function returns the following values:
//
// - goret uint32
AddPropertyDeepNotifyWatch(string, bool) uint32
// AddPropertyNotifyWatch wraps gst_element_add_property_notify_watch
//
// The function takes the following parameters:
//
// - propertyName string (nullable): name of property to watch for changes, or
// NULL to watch all properties
// - includeValue bool: whether to include the new property value in the message
//
// The function returns the following values:
//
// - goret uint32
AddPropertyNotifyWatch(string, bool) uint32
// CallAsync wraps gst_element_call_async
//
// The function takes the following parameters:
//
// - fn ElementCallAsyncFunc: Function to call asynchronously from another thread
//
// Calls @func from another thread and passes @user_data to it. This is to be
// used for cases when a state change has to be performed from a streaming
// thread, directly via gst_element_set_state() or indirectly e.g. via SEEK
// events.
//
// Calling those functions directly from the streaming thread will cause
// deadlocks in many situations, as they might involve waiting for the
// streaming thread to shut down from this very streaming thread.
//
// MT safe.
CallAsync(ElementCallAsyncFunc)
// ChangeState wraps gst_element_change_state
//
// The function takes the following parameters:
//
// - transition StateChange: the requested transition
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Perform @transition on @element.
//
// This function must be called with STATE_LOCK held and is mainly used
// internally.
ChangeState(StateChange) StateChangeReturn
// ContinueState wraps gst_element_continue_state
//
// The function takes the following parameters:
//
// - ret StateChangeReturn: The previous state return value
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Commit the state change of the element and proceed to the next
// pending state if any. This function is used
// by elements that do asynchronous state changes.
// The core will normally call this method automatically when an
// element returned %GST_STATE_CHANGE_SUCCESS from the state change function.
//
// If after calling this method the element still has not reached
// the pending state, the next state change is performed.
//
// This method is used internally and should normally not be called by plugins
// or applications.
//
// This function must be called with STATE_LOCK held.
ContinueState(StateChangeReturn) StateChangeReturn
// CreateAllPads wraps gst_element_create_all_pads
//
// Creates a pad for each pad template that is always available.
// This function is only useful during object initialization of
// subclasses of #GstElement.
CreateAllPads()
// DecorateStreamID wraps gst_element_decorate_stream_id
//
// The function takes the following parameters:
//
// - streamId string: The stream-id
//
// The function returns the following values:
//
// - goret string
//
// Creates a stream-id for @element by combining the upstream information with
// the @stream_id.
//
// This function generates an unique stream-id by getting the upstream
// stream-start event stream ID and appending @stream_id to it. If the element
// has no sinkpad it will generate an upstream stream-id by doing an URI query
// on the element and in the worst case just uses a random number. Source
// elements that don't implement the URI handler interface should ideally
// generate a unique, deterministic stream-id manually instead.
//
// Since stream IDs are sorted alphabetically, any numbers in the stream ID
// should be printed with a fixed number of characters, preceded by 0's, such as
// by using the format \%03u instead of \%u.
DecorateStreamID(string) string
// ForEachPad wraps gst_element_foreach_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's pads. @func will be called
// exactly once for each pad that exists at the time of this call, unless
// one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new pads are added or pads are removed
// while pads are being iterated, this will not be taken into account until
// next time this function is used.
ForEachPad(ElementForEachPadFunc) bool
// ForEachSinkPad wraps gst_element_foreach_sink_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each sink pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's sink pads. @func will be
// called exactly once for each sink pad that exists at the time of this call,
// unless one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new sink pads are added or sink pads
// are removed while the sink pads are being iterated, this will not be taken
// into account until next time this function is used.
ForEachSinkPad(ElementForEachPadFunc) bool
// ForEachSrcPad wraps gst_element_foreach_src_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each source pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's source pads. @func will be
// called exactly once for each source pad that exists at the time of this call,
// unless one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new source pads are added or source pads
// are removed while the source pads are being iterated, this will not be taken
// into account until next time this function is used.
ForEachSrcPad(ElementForEachPadFunc) bool
// GetBaseTime wraps gst_element_get_base_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the base time of the element. The base time is the
// absolute time of the clock when this element was last put to
// PLAYING. Subtracting the base time from the clock time gives
// the running time of the element.
GetBaseTime() ClockTime
// GetBus wraps gst_element_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Returns the bus of the element. Note that only a #GstPipeline will provide a
// bus for the application.
GetBus() Bus
// GetClock wraps gst_element_get_clock
// The function returns the following values:
//
// - goret Clock
//
// Gets the currently configured clock of the element. This is the clock as was
// last set with gst_element_set_clock().
//
// Elements in a pipeline will only have their clock set when the
// pipeline is in the PLAYING state.
GetClock() Clock
// GetCompatiblePad wraps gst_element_get_compatible_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to find a compatible one for.
// - caps *Caps (nullable): the #GstCaps to use as a filter.
//
// The function returns the following values:
//
// - goret Pad
//
// Looks for an unlinked pad to which the given pad can link. It is not
// guaranteed that linking the pads will work, though it should work in most
// cases.
//
// This function will first attempt to find a compatible unlinked ALWAYS pad,
// and if none can be found, it will request a compatible REQUEST pad by looking
// at the templates of @element.
GetCompatiblePad(Pad, *Caps) Pad
// GetCompatiblePadTemplate wraps gst_element_get_compatible_pad_template
//
// The function takes the following parameters:
//
// - compattempl PadTemplate: the #GstPadTemplate to find a compatible
// template for
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Retrieves a pad template from @element that is compatible with @compattempl.
// Pads from compatible templates can be linked together.
GetCompatiblePadTemplate(PadTemplate) PadTemplate
// GetContext wraps gst_element_get_context
//
// The function takes the following parameters:
//
// - contextType string: a name of a context to retrieve
//
// The function returns the following values:
//
// - goret *Context
//
// Gets the context with @context_type set on the element or NULL.
//
// MT safe.
GetContext(string) *Context
// GetContextUnlocked wraps gst_element_get_context_unlocked
//
// The function takes the following parameters:
//
// - contextType string: a name of a context to retrieve
//
// The function returns the following values:
//
// - goret *Context
//
// Gets the context with @context_type set on the element or NULL.
GetContextUnlocked(string) *Context
// GetCurrentClockTime wraps gst_element_get_current_clock_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the current clock time of the element, as in, the time of the
// element's clock, or GST_CLOCK_TIME_NONE if there is no clock.
GetCurrentClockTime() ClockTime
// GetCurrentRunningTime wraps gst_element_get_current_running_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the running time of the element. The running time is the
// element's clock time minus its base time. Will return GST_CLOCK_TIME_NONE
// if the element has no clock, or if its base time has not been set.
GetCurrentRunningTime() ClockTime
// GetFactory wraps gst_element_get_factory
// The function returns the following values:
//
// - goret ElementFactory
//
// Retrieves the factory that was used to create this element.
GetFactory() ElementFactory
// GetMetadata wraps gst_element_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @klass.
GetMetadata(string) string
// GetPadTemplate wraps gst_element_get_pad_template
//
// The function takes the following parameters:
//
// - name string: the name of the #GstPadTemplate to get.
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Retrieves a padtemplate from @element with the given name.
GetPadTemplate(string) PadTemplate
// GetRequestPad wraps gst_element_get_request_pad
//
// The function takes the following parameters:
//
// - name string: the name of the request #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// The name of this function is confusing to people learning GStreamer.
// gst_element_request_pad_simple() aims at making it more explicit it is
// a simplified gst_element_request_pad().
//
// Deprecated: (since 1.20.0) Prefer using gst_element_request_pad_simple() which
// provides the exact same functionality.
GetRequestPad(string) Pad
// GetStartTime wraps gst_element_get_start_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the start time of the element. The start time is the
// running time of the clock when this element was last put to PAUSED.
//
// Usually the start_time is managed by a toplevel element such as
// #GstPipeline.
//
// MT safe.
GetStartTime() ClockTime
// GetState wraps gst_element_get_state
//
// The function takes the following parameters:
//
// - timeout ClockTime: a #GstClockTime to specify the timeout for an async
// state change or %GST_CLOCK_TIME_NONE for infinite timeout.
//
// The function returns the following values:
//
// - state State: a pointer to #GstState to hold the state.
// Can be %NULL.
// - pending State: a pointer to #GstState to hold the pending
// state. Can be %NULL.
// - goret StateChangeReturn
//
// Gets the state of the element.
//
// For elements that performed an ASYNC state change, as reported by
// gst_element_set_state(), this function will block up to the
// specified timeout value for the state change to complete.
// If the element completes the state change or goes into
// an error, this function returns immediately with a return value of
// %GST_STATE_CHANGE_SUCCESS or %GST_STATE_CHANGE_FAILURE respectively.
//
// For elements that did not return %GST_STATE_CHANGE_ASYNC, this function
// returns the current and pending state immediately.
//
// This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
// successfully changed its state but is not able to provide data yet.
// This mostly happens for live sources that only produce data in
// %GST_STATE_PLAYING. While the state change return is equivalent to
// %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
// some sink elements might not be able to complete their state change because
// an element is not producing data to complete the preroll. When setting the
// element to playing, the preroll will complete and playback will start.
GetState(ClockTime) (State, State, StateChangeReturn)
// GetStaticPad wraps gst_element_get_static_pad
//
// The function takes the following parameters:
//
// - name string: the name of the static #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a pad from @element by name. This version only retrieves
// already-existing (i.e. 'static') pads.
GetStaticPad(string) Pad
// IsLockedState wraps gst_element_is_locked_state
// The function returns the following values:
//
// - goret bool
//
// Checks if the state of an element is locked.
// If the state of an element is locked, state changes of the parent don't
// affect the element.
// This way you can leave currently unused elements inside bins. Just lock their
// state before changing the state from #GST_STATE_NULL.
//
// MT safe.
IsLockedState() bool
// IteratePads wraps gst_element_iterate_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's pads. The iterator should
// be freed after usage. Also more specialized iterators exists such as
// gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
IteratePads() *Iterator
// IterateSinkPads wraps gst_element_iterate_sink_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's sink pads.
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
IterateSinkPads() *Iterator
// IterateSrcPads wraps gst_element_iterate_src_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's source pads.
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
IterateSrcPads() *Iterator
// Link wraps gst_element_link
//
// The function takes the following parameters:
//
// - dest Element: the #GstElement containing the destination pad.
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @dest. The link must be from source to
// destination; the other direction will not be tried. The function looks for
// existing pads that aren't linked yet. It will request new pads if necessary.
// Such pads need to be released manually when unlinking.
// If multiple links are possible, only one is established.
//
// Make sure you have added your elements to a bin or pipeline with
// gst_bin_add() before trying to link them.
Link(Element) bool
// LinkFiltered wraps gst_element_link_filtered
//
// The function takes the following parameters:
//
// - dest Element: the #GstElement containing the destination pad.
// - filter *Caps (nullable): the #GstCaps to filter the link,
// or %NULL for no filter.
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @dest using the given caps as filtercaps.
// The link must be from source to
// destination; the other direction will not be tried. The function looks for
// existing pads that aren't linked yet. It will request new pads if necessary.
// If multiple links are possible, only one is established.
//
// Make sure you have added your elements to a bin or pipeline with
// gst_bin_add() before trying to link them.
LinkFiltered(Element, *Caps) bool
// LinkPads wraps gst_element_link_pads
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element,
// or %NULL for any pad.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements.
// Side effect is that if one of the pads has no parent, it becomes a
// child of the parent of the other element. If they have different
// parents, the link fails.
LinkPads(string, Element, string) bool
// LinkPadsFiltered wraps gst_element_link_pads_filtered
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element
// or %NULL for any pad.
// - filter *Caps (nullable): the #GstCaps to filter the link,
// or %NULL for no filter.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements. Side effect
// is that if one of the pads has no parent, it becomes a child of the parent of
// the other element. If they have different parents, the link fails. If @caps
// is not %NULL, makes sure that the caps of the link is a subset of @caps.
LinkPadsFiltered(string, Element, string, *Caps) bool
// LinkPadsFull wraps gst_element_link_pads_full
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element,
// or %NULL for any pad.
// - flags PadLinkCheck: the #GstPadLinkCheck to be performed when linking pads.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements.
// Side effect is that if one of the pads has no parent, it becomes a
// child of the parent of the other element. If they have different
// parents, the link fails.
//
// Calling gst_element_link_pads_full() with @flags == %GST_PAD_LINK_CHECK_DEFAULT
// is the same as calling gst_element_link_pads() and the recommended way of
// linking pads with safety checks applied.
//
// This is a convenience function for gst_pad_link_full().
LinkPadsFull(string, Element, string, PadLinkCheck) bool
// LostState wraps gst_element_lost_state
//
// Brings the element to the lost state. The current state of the
// element is copied to the pending state so that any call to
// gst_element_get_state() will return %GST_STATE_CHANGE_ASYNC.
//
// An ASYNC_START message is posted. If the element was PLAYING, it will
// go to PAUSED. The element will be restored to its PLAYING state by
// the parent pipeline when it prerolls again.
//
// This is mostly used for elements that lost their preroll buffer
// in the %GST_STATE_PAUSED or %GST_STATE_PLAYING state after a flush,
// they will go to their pending state again when a new preroll buffer is
// queued. This function can only be called when the element is currently
// not in error or an async state change.
//
// This function is used internally and should normally not be called from
// plugins or applications.
LostState()
// MessageFull wraps gst_element_message_full
//
// The function takes the following parameters:
//
// - typ MessageType: the #GstMessageType
// - domain glib.Quark: the GStreamer GError domain this message belongs to
// - code int: the GError code belonging to the domain
// - text string (nullable): an allocated text string to be used
// as a replacement for the default message connected to code,
// or %NULL
// - debug string (nullable): an allocated debug message to be
// used as a replacement for the default debugging information,
// or %NULL
// - file string: the source code file where the error was generated
// - function string: the source code function where the error was generated
// - line int: the source code line where the error was generated
//
// Post an error, warning or info message on the bus from inside an element.
//
// @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
// #GST_MESSAGE_INFO.
//
// MT safe.
MessageFull(MessageType, glib.Quark, int, string, string, string, string, int)
// MessageFullWithDetails wraps gst_element_message_full_with_details
//
// The function takes the following parameters:
//
// - typ MessageType: the #GstMessageType
// - domain glib.Quark: the GStreamer GError domain this message belongs to
// - code int: the GError code belonging to the domain
// - text string (nullable): an allocated text string to be used
// as a replacement for the default message connected to code,
// or %NULL
// - debug string (nullable): an allocated debug message to be
// used as a replacement for the default debugging information,
// or %NULL
// - file string: the source code file where the error was generated
// - function string: the source code function where the error was generated
// - line int: the source code line where the error was generated
// - structure *Structure: optional details structure
//
// Post an error, warning or info message on the bus from inside an element.
//
// @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
// #GST_MESSAGE_INFO.
MessageFullWithDetails(MessageType, glib.Quark, int, string, string, string, string, int, *Structure)
// NoMorePads wraps gst_element_no_more_pads
//
// Use this function to signal that the element does not expect any more pads
// to show up in the current pipeline. This function should be called whenever
// pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
// pad templates use this in combination with autopluggers to figure out that
// the element is done initializing its pads.
//
// This function emits the #GstElement::no-more-pads signal.
//
// MT safe.
NoMorePads()
// PostMessage wraps gst_element_post_message
//
// The function takes the following parameters:
//
// - message *Message: a #GstMessage to post
//
// The function returns the following values:
//
// - goret bool
//
// Post a message on the element's #GstBus. This function takes ownership of the
// message; if you want to access the message after this call, you should add an
// additional reference before calling.
PostMessage(*Message) bool
// ProvidedClock wraps gst_element_provide_clock
// The function returns the following values:
//
// - goret Clock
//
// Get the clock provided by the given element.
// &gt; An element is only required to provide a clock in the PAUSED
// &gt; state. Some elements can provide a clock in other states.
ProvidedClock() Clock
// Query wraps gst_element_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Performs a query on the given element.
//
// For elements that don't implement a query handler, this function
// forwards the query to a random srcpad or to the peer of a
// random linked sinkpad of this element.
//
// Please note that some queries might need a running pipeline to work.
Query(*Query) bool
// QueryConvert wraps gst_element_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries an element to convert @src_val in @src_format to @dest_format.
QueryConvert(Format, int64, Format) (int64, bool)
// QueryDuration wraps gst_element_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: A location in which to store the total duration, or %NULL.
// - goret bool
//
// Queries an element (usually top-level pipeline or playbin element) for the
// total stream duration in nanoseconds. This query will only work once the
// pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application
// will receive an ASYNC_DONE message on the pipeline bus when that is the case.
//
// If the duration changes for some reason, you will get a DURATION_CHANGED
// message on the pipeline bus, in which case you should re-query the duration
// using this function.
QueryDuration(Format) (int64, bool)
// QueryPosition wraps gst_element_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: a location in which to store the current
// position, or %NULL.
// - goret bool
//
// Queries an element (usually top-level pipeline or playbin element) for the
// stream position in nanoseconds. This will be a value between 0 and the
// stream duration (if the stream duration is known). This query will usually
// only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING
// state). The application will receive an ASYNC_DONE message on the pipeline
// bus when that is the case.
//
// If one repeatedly calls this function one can also create a query and reuse
// it in gst_element_query().
QueryPosition(Format) (int64, bool)
// ReleaseRequestPad wraps gst_element_release_request_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to release.
//
// Makes the element free the previously requested pad as obtained
// with gst_element_request_pad().
//
// This does not unref the pad. If the pad was created by using
// gst_element_request_pad(), gst_element_release_request_pad() needs to be
// followed by gst_object_unref() to free the @pad.
//
// MT safe.
ReleaseRequestPad(Pad)
// RemovePad wraps gst_element_remove_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to remove from the element.
//
// The function returns the following values:
//
// - goret bool
//
// Removes @pad from @element. @pad will be destroyed if it has not been
// referenced elsewhere using gst_object_unparent().
//
// This function is used by plugin developers and should not be used
// by applications. Pads that were dynamically requested from elements
// with gst_element_request_pad() should be released with the
// gst_element_release_request_pad() function instead.
//
// Pads are not automatically deactivated so elements should perform the needed
// steps to deactivate the pad in case this pad is removed in the PAUSED or
// PLAYING state. See gst_pad_set_active() for more information about
// deactivating pads.
//
// The pad and the element should be unlocked when calling this function.
//
// This function will emit the #GstElement::pad-removed signal on the element.
RemovePad(Pad) bool
// RemovePropertyNotifyWatch wraps gst_element_remove_property_notify_watch
//
// The function takes the following parameters:
//
// - watchId uint32: watch id to remove
RemovePropertyNotifyWatch(uint32)
// RequestPad wraps gst_element_request_pad
//
// The function takes the following parameters:
//
// - templ PadTemplate: a #GstPadTemplate of which we want a pad of.
// - name string (nullable): the name of the request #GstPad
// to retrieve. Can be %NULL.
// - caps *Caps (nullable): the caps of the pad we want to
// request. Can be %NULL.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a request pad from the element according to the provided template.
// Pad templates can be looked up using
// gst_element_factory_get_static_pad_templates().
//
// The pad should be released with gst_element_release_request_pad().
RequestPad(PadTemplate, string, *Caps) Pad
// RequestPadSimple wraps gst_element_request_pad_simple
//
// The function takes the following parameters:
//
// - name string: the name of the request #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
// retrieves request pads. The pad should be released with
// gst_element_release_request_pad().
//
// This method is slower than manually getting the pad template and calling
// gst_element_request_pad() if the pads should have a specific name (e.g.
// @name is "src_1" instead of "src_\%u").
//
// Note that this function was introduced in GStreamer 1.20 in order to provide
// a better name to gst_element_get_request_pad(). Prior to 1.20, users
// should use gst_element_get_request_pad() which provides the same
// functionality.
RequestPadSimple(string) Pad
// Seek wraps gst_element_seek
//
// The function takes the following parameters:
//
// - rate float64: The new playback rate
// - format Format: The format of the seek values
// - flags SeekFlags: The optional seek flags.
// - startType SeekType: The type and flags for the new start position
// - start int64: The value of the new start position
// - stopType SeekType: The type and flags for the new stop position
// - stop int64: The value of the new stop position
//
// The function returns the following values:
//
// - goret bool
//
// Sends a seek event to an element. See gst_event_new_seek() for the details of
// the parameters. The seek event is sent to the element using
// gst_element_send_event().
//
// MT safe.
Seek(float64, Format, SeekFlags, SeekType, int64, SeekType, int64) bool
// SeekSimple wraps gst_element_seek_simple
//
// The function takes the following parameters:
//
// - format Format: a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
// - seekFlags SeekFlags: seek options; playback applications will usually want to use
// GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
// - seekPos int64: position to seek to (relative to the start); if you are doing
// a seek in #GST_FORMAT_TIME this value is in nanoseconds -
// multiply with #GST_SECOND to convert seconds to nanoseconds or
// with #GST_MSECOND to convert milliseconds to nanoseconds.
//
// The function returns the following values:
//
// - goret bool
//
// Simple API to perform a seek on the given element, meaning it just seeks
// to the given position relative to the start of the stream. For more complex
// operations like segment seeks (e.g. for looping) or changing the playback
// rate or seeking relative to the last configured playback segment you should
// use gst_element_seek().
//
// In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
// guaranteed to return %TRUE on a seekable media type or %FALSE when the media
// type is certainly not seekable (such as a live stream).
//
// Some elements allow for seeking in the READY state, in this
// case they will store the seek event and execute it when they are put to
// PAUSED. If the element supports seek in READY, it will always return %TRUE when
// it receives the event in the READY state.
SeekSimple(Format, SeekFlags, int64) bool
// SendEvent wraps gst_element_send_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the element.
//
// The function returns the following values:
//
// - goret bool
//
// Sends an event to an element. If the element doesn't implement an
// event handler, the event will be pushed on a random linked sink pad for
// downstream events or a random linked source pad for upstream events.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
//
// MT safe.
SendEvent(*Event) bool
// SetBaseTime wraps gst_element_set_base_time
//
// The function takes the following parameters:
//
// - time ClockTime: the base time to set.
//
// Set the base time of an element. See gst_element_get_base_time().
//
// MT safe.
SetBaseTime(ClockTime)
// SetBus wraps gst_element_set_bus
//
// The function takes the following parameters:
//
// - bus Bus (nullable): the #GstBus to set.
//
// Sets the bus of the element. Increases the refcount on the bus.
// For internal use only, unless you're testing elements.
//
// MT safe.
SetBus(Bus)
// SetClock wraps gst_element_set_clock
//
// The function takes the following parameters:
//
// - clock Clock (nullable): the #GstClock to set for the element.
//
// The function returns the following values:
//
// - goret bool
//
// Sets the clock for the element. This function increases the
// refcount on the clock. Any previously set clock on the object
// is unreffed.
SetClock(Clock) bool
// SetContext wraps gst_element_set_context
//
// The function takes the following parameters:
//
// - _context *Context: the #GstContext to set.
//
// Sets the context of the element. Increases the refcount of the context.
//
// MT safe.
SetContext(*Context)
// SetLockedState wraps gst_element_set_locked_state
//
// The function takes the following parameters:
//
// - lockedState bool: %TRUE to lock the element's state
//
// The function returns the following values:
//
// - goret bool
//
// Locks the state of an element, so state changes of the parent don't affect
// this element anymore.
//
// Note that this is racy if the state lock of the parent bin is not taken.
// The parent bin might've just checked the flag in another thread and as the
// next step proceed to change the child element's state.
//
// MT safe.
SetLockedState(bool) bool
// SetStartTime wraps gst_element_set_start_time
//
// The function takes the following parameters:
//
// - time ClockTime: the base time to set.
//
// Set the start time of an element. The start time of the element is the
// running time of the element when it last went to the PAUSED state. In READY
// or after a flushing seek, it is set to 0.
//
// Toplevel elements like #GstPipeline will manage the start_time and
// base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE
// on such a toplevel element will disable the distribution of the base_time to
// the children and can be useful if the application manages the base_time
// itself, for example if you want to synchronize capture from multiple
// pipelines, and you can also ensure that the pipelines have the same clock.
//
// MT safe.
SetStartTime(ClockTime)
// SetState wraps gst_element_set_state
//
// The function takes the following parameters:
//
// - state State: the element's new #GstState.
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Sets the state of the element. This function will try to set the
// requested state by going through all the intermediary states and calling
// the class's state change function for each.
//
// This function can return #GST_STATE_CHANGE_ASYNC, in which case the
// element will perform the remainder of the state change asynchronously in
// another thread.
// An application can use gst_element_get_state() to wait for the completion
// of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
// %GST_MESSAGE_STATE_CHANGED on the bus.
//
// State changes to %GST_STATE_READY or %GST_STATE_NULL never return
// #GST_STATE_CHANGE_ASYNC.
SetState(State) StateChangeReturn
// SyncStateWithParent wraps gst_element_sync_state_with_parent
// The function returns the following values:
//
// - goret bool
//
// Tries to change the state of the element to the same as its parent.
// If this function returns %FALSE, the state of element is undefined.
SyncStateWithParent() bool
// Unlink wraps gst_element_unlink
//
// The function takes the following parameters:
//
// - dest Element: the sink #GstElement to unlink.
//
// Unlinks all source pads of the source element with all sink pads
// of the sink element to which they are linked.
//
// If the link has been made using gst_element_link(), it could have created an
// requestpad, which has to be released using gst_element_release_request_pad().
Unlink(Element)
// UnlinkPads wraps gst_element_unlink_pads
//
// The function takes the following parameters:
//
// - srcpadname string: the name of the #GstPad in source element.
// - dest Element: a #GstElement containing the destination pad.
// - destpadname string: the name of the #GstPad in destination element.
//
// Unlinks the two named pads of the source and destination elements.
//
// This is a convenience function for gst_pad_unlink().
UnlinkPads(string, Element, string)
}
func unsafeWrapElement(base *gobject.ObjectInstance) *ElementInstance {
return &ElementInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
}
}
func marshalElementInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapElement(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeElementFromGlibNone is used to convert raw GstElement pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeElementFromGlibNone(c unsafe.Pointer) Element {
return gobject.UnsafeObjectFromGlibNone(c).(Element)
}
// UnsafeElementFromGlibFull is used to convert raw GstElement pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeElementFromGlibFull(c unsafe.Pointer) Element {
return gobject.UnsafeObjectFromGlibFull(c).(Element)
}
func (e *ElementInstance) upcastToGstElement() *ElementInstance {
return e
}
// UnsafeElementToGlibNone is used to convert the instance to it's C value GstElement. This is used by the bindings internally.
func UnsafeElementToGlibNone(c Element) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeElementToGlibFull is used to convert the instance to it's C value GstElement, while removeing the finalizer. This is used by the bindings internally.
func UnsafeElementToGlibFull(c Element) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// ElementMakeFromURI wraps gst_element_make_from_uri
//
// The function takes the following parameters:
//
// - typ URIType: Whether to create a source or a sink
// - uri string: URI to create an element for
// - elementname string (nullable): Name of created element, can be %NULL.
//
// The function returns the following values:
//
// - goret Element
// - _goerr error (nullable): an error
//
// Creates an element for handling the given URI.
func ElementMakeFromURI(typ URIType, uri string, elementname string) (Element, error) {
var carg1 C.GstURIType // in, none, casted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
var _cerr *C.GError // out, full, converted, nullable
carg1 = C.GstURIType(typ)
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(uri)))
defer C.free(unsafe.Pointer(carg2))
if elementname != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(elementname)))
defer C.free(unsafe.Pointer(carg3))
}
cret = C.gst_element_make_from_uri(carg1, carg2, carg3, &_cerr)
runtime.KeepAlive(typ)
runtime.KeepAlive(uri)
runtime.KeepAlive(elementname)
var goret Element
var _goerr error
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
if _cerr != nil {
_goerr = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(_cerr))
}
return goret, _goerr
}
// ElementRegister wraps gst_element_register
//
// The function takes the following parameters:
//
// - plugin Plugin (nullable): #GstPlugin to register the element with, or %NULL for
// a static element.
// - name string: name of elements of this type
// - rank uint: rank of element (higher rank means more importance when autoplugging)
// - typ gobject.Type: GType of element to register
//
// The function returns the following values:
//
// - goret bool
//
// Create a new elementfactory capable of instantiating objects of the
// @type and add the factory to @plugin.
func ElementRegister(plugin Plugin, name string, rank uint, typ gobject.Type) bool {
var carg1 *C.GstPlugin // in, none, converted, nullable
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 C.guint // in, none, casted
var carg4 C.GType // in, none, casted, alias
var cret C.gboolean // return
if plugin != nil {
carg1 = (*C.GstPlugin)(UnsafePluginToGlibNone(plugin))
}
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
carg3 = C.guint(rank)
carg4 = C.GType(typ)
cret = C.gst_element_register(carg1, carg2, carg3, carg4)
runtime.KeepAlive(plugin)
runtime.KeepAlive(name)
runtime.KeepAlive(rank)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ElementStateChangeReturnGetName wraps gst_element_state_change_return_get_name
//
// The function takes the following parameters:
//
// - stateRet StateChangeReturn: a #GstStateChangeReturn to get the name of.
//
// The function returns the following values:
//
// - goret string
//
// Gets a string representing the given state change result.
func ElementStateChangeReturnGetName(stateRet StateChangeReturn) string {
var carg1 C.GstStateChangeReturn // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = C.GstStateChangeReturn(stateRet)
cret = C.gst_element_state_change_return_get_name(carg1)
runtime.KeepAlive(stateRet)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// ElementStateGetName wraps gst_element_state_get_name
//
// The function takes the following parameters:
//
// - state State: a #GstState to get the name of.
//
// The function returns the following values:
//
// - goret string
//
// Gets a string representing the given state.
func ElementStateGetName(state State) string {
var carg1 C.GstState // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg1 = C.GstState(state)
cret = C.gst_element_state_get_name(carg1)
runtime.KeepAlive(state)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// ElementTypeSetSkipDocumentation wraps gst_element_type_set_skip_documentation
//
// The function takes the following parameters:
//
// - typ gobject.Type: a #GType of element
//
// Marks @type as "documentation should be skipped".
// Can be useful for dynamically registered element to be excluded from
// plugin documentation system.
//
// Example:
// ```c
// GType my_type;
// GTypeInfo my_type_info;
//
// // Fill "my_type_info"
// ...
//
// my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
// &amp;my_type_info, 0);
// gst_element_type_set_skip_documentation (my_type);
// gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);
// ```
func ElementTypeSetSkipDocumentation(typ gobject.Type) {
var carg1 C.GType // in, none, casted, alias
carg1 = C.GType(typ)
C.gst_element_type_set_skip_documentation(carg1)
runtime.KeepAlive(typ)
}
// AbortState wraps gst_element_abort_state
//
// Abort the state change of the element. This function is used
// by elements that do asynchronous state changes and find out
// something is wrong.
//
// This function should be called with the STATE_LOCK held.
//
// MT safe.
func (element *ElementInstance) AbortState() {
var carg0 *C.GstElement // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
C.gst_element_abort_state(carg0)
runtime.KeepAlive(element)
}
// AddPad wraps gst_element_add_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to add to the element.
//
// The function returns the following values:
//
// - goret bool
//
// Adds a pad (link point) to @element. @pad's parent will be set to @element;
// see gst_object_set_parent() for refcounting information.
//
// Pads are automatically activated when added in the PAUSED or PLAYING
// state.
//
// The pad and the element should be unlocked when calling this function.
//
// This function will emit the #GstElement::pad-added signal on the element.
func (element *ElementInstance) AddPad(pad Pad) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_element_add_pad(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AddPropertyDeepNotifyWatch wraps gst_element_add_property_deep_notify_watch
//
// The function takes the following parameters:
//
// - propertyName string (nullable): name of property to watch for changes, or
// NULL to watch all properties
// - includeValue bool: whether to include the new property value in the message
//
// The function returns the following values:
//
// - goret uint32
func (element *ElementInstance) AddPropertyDeepNotifyWatch(propertyName string, includeValue bool) uint32 {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 C.gboolean // in
var cret C.gulong // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
if propertyName != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(propertyName)))
defer C.free(unsafe.Pointer(carg1))
}
if includeValue {
carg2 = C.TRUE
}
cret = C.gst_element_add_property_deep_notify_watch(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(propertyName)
runtime.KeepAlive(includeValue)
var goret uint32
goret = uint32(cret)
return goret
}
// AddPropertyNotifyWatch wraps gst_element_add_property_notify_watch
//
// The function takes the following parameters:
//
// - propertyName string (nullable): name of property to watch for changes, or
// NULL to watch all properties
// - includeValue bool: whether to include the new property value in the message
//
// The function returns the following values:
//
// - goret uint32
func (element *ElementInstance) AddPropertyNotifyWatch(propertyName string, includeValue bool) uint32 {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 C.gboolean // in
var cret C.gulong // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
if propertyName != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(propertyName)))
defer C.free(unsafe.Pointer(carg1))
}
if includeValue {
carg2 = C.TRUE
}
cret = C.gst_element_add_property_notify_watch(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(propertyName)
runtime.KeepAlive(includeValue)
var goret uint32
goret = uint32(cret)
return goret
}
// CallAsync wraps gst_element_call_async
//
// The function takes the following parameters:
//
// - fn ElementCallAsyncFunc: Function to call asynchronously from another thread
//
// Calls @func from another thread and passes @user_data to it. This is to be
// used for cases when a state change has to be performed from a streaming
// thread, directly via gst_element_set_state() or indirectly e.g. via SEEK
// events.
//
// Calling those functions directly from the streaming thread will cause
// deadlocks in many situations, as they might involve waiting for the
// streaming thread to shut down from this very streaming thread.
//
// MT safe.
func (element *ElementInstance) CallAsync(fn ElementCallAsyncFunc) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstElementCallAsyncFunc // callback, scope: notified, closure: carg2, destroy: carg3
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*[0]byte)(C._gotk4_gst1_ElementCallAsyncFunc)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
C.gst_element_call_async(carg0, carg1, carg2, carg3)
runtime.KeepAlive(element)
runtime.KeepAlive(fn)
}
// ChangeState wraps gst_element_change_state
//
// The function takes the following parameters:
//
// - transition StateChange: the requested transition
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Perform @transition on @element.
//
// This function must be called with STATE_LOCK held and is mainly used
// internally.
func (element *ElementInstance) ChangeState(transition StateChange) StateChangeReturn {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstStateChange // in, none, casted
var cret C.GstStateChangeReturn // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstStateChange(transition)
cret = C.gst_element_change_state(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(transition)
var goret StateChangeReturn
goret = StateChangeReturn(cret)
return goret
}
// ContinueState wraps gst_element_continue_state
//
// The function takes the following parameters:
//
// - ret StateChangeReturn: The previous state return value
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Commit the state change of the element and proceed to the next
// pending state if any. This function is used
// by elements that do asynchronous state changes.
// The core will normally call this method automatically when an
// element returned %GST_STATE_CHANGE_SUCCESS from the state change function.
//
// If after calling this method the element still has not reached
// the pending state, the next state change is performed.
//
// This method is used internally and should normally not be called by plugins
// or applications.
//
// This function must be called with STATE_LOCK held.
func (element *ElementInstance) ContinueState(ret StateChangeReturn) StateChangeReturn {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstStateChangeReturn // in, none, casted
var cret C.GstStateChangeReturn // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstStateChangeReturn(ret)
cret = C.gst_element_continue_state(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(ret)
var goret StateChangeReturn
goret = StateChangeReturn(cret)
return goret
}
// CreateAllPads wraps gst_element_create_all_pads
//
// Creates a pad for each pad template that is always available.
// This function is only useful during object initialization of
// subclasses of #GstElement.
func (element *ElementInstance) CreateAllPads() {
var carg0 *C.GstElement // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
C.gst_element_create_all_pads(carg0)
runtime.KeepAlive(element)
}
// DecorateStreamID wraps gst_element_decorate_stream_id
//
// The function takes the following parameters:
//
// - streamId string: The stream-id
//
// The function returns the following values:
//
// - goret string
//
// Creates a stream-id for @element by combining the upstream information with
// the @stream_id.
//
// This function generates an unique stream-id by getting the upstream
// stream-start event stream ID and appending @stream_id to it. If the element
// has no sinkpad it will generate an upstream stream-id by doing an URI query
// on the element and in the worst case just uses a random number. Source
// elements that don't implement the URI handler interface should ideally
// generate a unique, deterministic stream-id manually instead.
//
// Since stream IDs are sorted alphabetically, any numbers in the stream ID
// should be printed with a fixed number of characters, preceded by 0's, such as
// by using the format \%03u instead of \%u.
func (element *ElementInstance) DecorateStreamID(streamId string) string {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(streamId)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_decorate_stream_id(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(streamId)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// ForEachPad wraps gst_element_foreach_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's pads. @func will be called
// exactly once for each pad that exists at the time of this call, unless
// one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new pads are added or pads are removed
// while pads are being iterated, this will not be taken into account until
// next time this function is used.
func (element *ElementInstance) ForEachPad(fn ElementForEachPadFunc) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstElementForeachPadFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*[0]byte)(C._gotk4_gst1_ElementForEachPadFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_element_foreach_pad(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ForEachSinkPad wraps gst_element_foreach_sink_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each sink pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's sink pads. @func will be
// called exactly once for each sink pad that exists at the time of this call,
// unless one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new sink pads are added or sink pads
// are removed while the sink pads are being iterated, this will not be taken
// into account until next time this function is used.
func (element *ElementInstance) ForEachSinkPad(fn ElementForEachPadFunc) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstElementForeachPadFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*[0]byte)(C._gotk4_gst1_ElementForEachPadFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_element_foreach_sink_pad(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ForEachSrcPad wraps gst_element_foreach_src_pad
//
// The function takes the following parameters:
//
// - fn ElementForEachPadFunc: function to call for each source pad
//
// The function returns the following values:
//
// - goret bool
//
// Call @func with @user_data for each of @element's source pads. @func will be
// called exactly once for each source pad that exists at the time of this call,
// unless one of the calls to @func returns %FALSE in which case we will stop
// iterating pads and return early. If new source pads are added or source pads
// are removed while the source pads are being iterated, this will not be taken
// into account until next time this function is used.
func (element *ElementInstance) ForEachSrcPad(fn ElementForEachPadFunc) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstElementForeachPadFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*[0]byte)(C._gotk4_gst1_ElementForEachPadFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_element_foreach_src_pad(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetBaseTime wraps gst_element_get_base_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the base time of the element. The base time is the
// absolute time of the clock when this element was last put to
// PLAYING. Subtracting the base time from the clock time gives
// the running time of the element.
func (element *ElementInstance) GetBaseTime() ClockTime {
var carg0 *C.GstElement // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_base_time(carg0)
runtime.KeepAlive(element)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetBus wraps gst_element_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Returns the bus of the element. Note that only a #GstPipeline will provide a
// bus for the application.
func (element *ElementInstance) GetBus() Bus {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstBus // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_bus(carg0)
runtime.KeepAlive(element)
var goret Bus
goret = UnsafeBusFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetClock wraps gst_element_get_clock
// The function returns the following values:
//
// - goret Clock
//
// Gets the currently configured clock of the element. This is the clock as was
// last set with gst_element_set_clock().
//
// Elements in a pipeline will only have their clock set when the
// pipeline is in the PLAYING state.
func (element *ElementInstance) GetClock() Clock {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstClock // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_clock(carg0)
runtime.KeepAlive(element)
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCompatiblePad wraps gst_element_get_compatible_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to find a compatible one for.
// - caps *Caps (nullable): the #GstCaps to use as a filter.
//
// The function returns the following values:
//
// - goret Pad
//
// Looks for an unlinked pad to which the given pad can link. It is not
// guaranteed that linking the pads will work, though it should work in most
// cases.
//
// This function will first attempt to find a compatible unlinked ALWAYS pad,
// and if none can be found, it will request a compatible REQUEST pad by looking
// at the templates of @element.
func (element *ElementInstance) GetCompatiblePad(pad Pad, caps *Caps) Pad {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstCaps // in, none, converted, nullable
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
cret = C.gst_element_get_compatible_pad(carg0, carg1, carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(pad)
runtime.KeepAlive(caps)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCompatiblePadTemplate wraps gst_element_get_compatible_pad_template
//
// The function takes the following parameters:
//
// - compattempl PadTemplate: the #GstPadTemplate to find a compatible
// template for
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Retrieves a pad template from @element that is compatible with @compattempl.
// Pads from compatible templates can be linked together.
func (element *ElementInstance) GetCompatiblePadTemplate(compattempl PadTemplate) PadTemplate {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPadTemplate // in, none, converted
var cret *C.GstPadTemplate // return, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(compattempl))
cret = C.gst_element_get_compatible_pad_template(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(compattempl)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetContext wraps gst_element_get_context
//
// The function takes the following parameters:
//
// - contextType string: a name of a context to retrieve
//
// The function returns the following values:
//
// - goret *Context
//
// Gets the context with @context_type set on the element or NULL.
//
// MT safe.
func (element *ElementInstance) GetContext(contextType string) *Context {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstContext // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_context(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(contextType)
var goret *Context
goret = UnsafeContextFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetContextUnlocked wraps gst_element_get_context_unlocked
//
// The function takes the following parameters:
//
// - contextType string: a name of a context to retrieve
//
// The function returns the following values:
//
// - goret *Context
//
// Gets the context with @context_type set on the element or NULL.
func (element *ElementInstance) GetContextUnlocked(contextType string) *Context {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstContext // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_context_unlocked(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(contextType)
var goret *Context
goret = UnsafeContextFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCurrentClockTime wraps gst_element_get_current_clock_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the current clock time of the element, as in, the time of the
// element's clock, or GST_CLOCK_TIME_NONE if there is no clock.
func (element *ElementInstance) GetCurrentClockTime() ClockTime {
var carg0 *C.GstElement // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_current_clock_time(carg0)
runtime.KeepAlive(element)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetCurrentRunningTime wraps gst_element_get_current_running_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the running time of the element. The running time is the
// element's clock time minus its base time. Will return GST_CLOCK_TIME_NONE
// if the element has no clock, or if its base time has not been set.
func (element *ElementInstance) GetCurrentRunningTime() ClockTime {
var carg0 *C.GstElement // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_current_running_time(carg0)
runtime.KeepAlive(element)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetFactory wraps gst_element_get_factory
// The function returns the following values:
//
// - goret ElementFactory
//
// Retrieves the factory that was used to create this element.
func (element *ElementInstance) GetFactory() ElementFactory {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstElementFactory // return, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_factory(carg0)
runtime.KeepAlive(element)
var goret ElementFactory
goret = UnsafeElementFactoryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetMetadata wraps gst_element_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @klass.
func (element *ElementInstance) GetMetadata(key string) string {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_metadata(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetPadTemplate wraps gst_element_get_pad_template
//
// The function takes the following parameters:
//
// - name string: the name of the #GstPadTemplate to get.
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Retrieves a padtemplate from @element with the given name.
func (element *ElementInstance) GetPadTemplate(name string) PadTemplate {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPadTemplate // return, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_pad_template(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(name)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetRequestPad wraps gst_element_get_request_pad
//
// The function takes the following parameters:
//
// - name string: the name of the request #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// The name of this function is confusing to people learning GStreamer.
// gst_element_request_pad_simple() aims at making it more explicit it is
// a simplified gst_element_request_pad().
//
// Deprecated: (since 1.20.0) Prefer using gst_element_request_pad_simple() which
// provides the exact same functionality.
func (element *ElementInstance) GetRequestPad(name string) Pad {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_request_pad(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(name)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetStartTime wraps gst_element_get_start_time
// The function returns the following values:
//
// - goret ClockTime
//
// Returns the start time of the element. The start time is the
// running time of the clock when this element was last put to PAUSED.
//
// Usually the start_time is managed by a toplevel element such as
// #GstPipeline.
//
// MT safe.
func (element *ElementInstance) GetStartTime() ClockTime {
var carg0 *C.GstElement // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_get_start_time(carg0)
runtime.KeepAlive(element)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetState wraps gst_element_get_state
//
// The function takes the following parameters:
//
// - timeout ClockTime: a #GstClockTime to specify the timeout for an async
// state change or %GST_CLOCK_TIME_NONE for infinite timeout.
//
// The function returns the following values:
//
// - state State: a pointer to #GstState to hold the state.
// Can be %NULL.
// - pending State: a pointer to #GstState to hold the pending
// state. Can be %NULL.
// - goret StateChangeReturn
//
// Gets the state of the element.
//
// For elements that performed an ASYNC state change, as reported by
// gst_element_set_state(), this function will block up to the
// specified timeout value for the state change to complete.
// If the element completes the state change or goes into
// an error, this function returns immediately with a return value of
// %GST_STATE_CHANGE_SUCCESS or %GST_STATE_CHANGE_FAILURE respectively.
//
// For elements that did not return %GST_STATE_CHANGE_ASYNC, this function
// returns the current and pending state immediately.
//
// This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
// successfully changed its state but is not able to provide data yet.
// This mostly happens for live sources that only produce data in
// %GST_STATE_PLAYING. While the state change return is equivalent to
// %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
// some sink elements might not be able to complete their state change because
// an element is not producing data to complete the preroll. When setting the
// element to playing, the preroll will complete and playback will start.
func (element *ElementInstance) GetState(timeout ClockTime) (State, State, StateChangeReturn) {
var carg0 *C.GstElement // in, none, converted
var carg3 C.GstClockTime // in, none, casted, alias
var carg1 C.GstState // out, full, casted
var carg2 C.GstState // out, full, casted
var cret C.GstStateChangeReturn // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg3 = C.GstClockTime(timeout)
cret = C.gst_element_get_state(carg0, &carg1, &carg2, carg3)
runtime.KeepAlive(element)
runtime.KeepAlive(timeout)
var state State
var pending State
var goret StateChangeReturn
state = State(carg1)
pending = State(carg2)
goret = StateChangeReturn(cret)
return state, pending, goret
}
// GetStaticPad wraps gst_element_get_static_pad
//
// The function takes the following parameters:
//
// - name string: the name of the static #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a pad from @element by name. This version only retrieves
// already-existing (i.e. 'static') pads.
func (element *ElementInstance) GetStaticPad(name string) Pad {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_get_static_pad(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(name)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IsLockedState wraps gst_element_is_locked_state
// The function returns the following values:
//
// - goret bool
//
// Checks if the state of an element is locked.
// If the state of an element is locked, state changes of the parent don't
// affect the element.
// This way you can leave currently unused elements inside bins. Just lock their
// state before changing the state from #GST_STATE_NULL.
//
// MT safe.
func (element *ElementInstance) IsLockedState() bool {
var carg0 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_is_locked_state(carg0)
runtime.KeepAlive(element)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IteratePads wraps gst_element_iterate_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's pads. The iterator should
// be freed after usage. Also more specialized iterators exists such as
// gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
func (element *ElementInstance) IteratePads() *Iterator {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_iterate_pads(carg0)
runtime.KeepAlive(element)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateSinkPads wraps gst_element_iterate_sink_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's sink pads.
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
func (element *ElementInstance) IterateSinkPads() *Iterator {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_iterate_sink_pads(carg0)
runtime.KeepAlive(element)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateSrcPads wraps gst_element_iterate_src_pads
// The function returns the following values:
//
// - goret *Iterator
//
// Retrieves an iterator of @element's source pads.
//
// The order of pads returned by the iterator will be the order in which
// the pads were added to the element.
func (element *ElementInstance) IterateSrcPads() *Iterator {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_iterate_src_pads(carg0)
runtime.KeepAlive(element)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Link wraps gst_element_link
//
// The function takes the following parameters:
//
// - dest Element: the #GstElement containing the destination pad.
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @dest. The link must be from source to
// destination; the other direction will not be tried. The function looks for
// existing pads that aren't linked yet. It will request new pads if necessary.
// Such pads need to be released manually when unlinking.
// If multiple links are possible, only one is established.
//
// Make sure you have added your elements to a bin or pipeline with
// gst_bin_add() before trying to link them.
func (src *ElementInstance) Link(dest Element) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
cret = C.gst_element_link(carg0, carg1)
runtime.KeepAlive(src)
runtime.KeepAlive(dest)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LinkFiltered wraps gst_element_link_filtered
//
// The function takes the following parameters:
//
// - dest Element: the #GstElement containing the destination pad.
// - filter *Caps (nullable): the #GstCaps to filter the link,
// or %NULL for no filter.
//
// The function returns the following values:
//
// - goret bool
//
// Links @src to @dest using the given caps as filtercaps.
// The link must be from source to
// destination; the other direction will not be tried. The function looks for
// existing pads that aren't linked yet. It will request new pads if necessary.
// If multiple links are possible, only one is established.
//
// Make sure you have added your elements to a bin or pipeline with
// gst_bin_add() before trying to link them.
func (src *ElementInstance) LinkFiltered(dest Element, filter *Caps) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstElement // in, none, converted
var carg2 *C.GstCaps // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
if filter != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(filter))
}
cret = C.gst_element_link_filtered(carg0, carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(dest)
runtime.KeepAlive(filter)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LinkPads wraps gst_element_link_pads
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element,
// or %NULL for any pad.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements.
// Side effect is that if one of the pads has no parent, it becomes a
// child of the parent of the other element. If they have different
// parents, the link fails.
func (src *ElementInstance) LinkPads(srcpadname string, dest Element, destpadname string) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstElement // in, none, converted
var carg3 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
if srcpadname != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(srcpadname)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
if destpadname != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(destpadname)))
defer C.free(unsafe.Pointer(carg3))
}
cret = C.gst_element_link_pads(carg0, carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(srcpadname)
runtime.KeepAlive(dest)
runtime.KeepAlive(destpadname)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LinkPadsFiltered wraps gst_element_link_pads_filtered
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element
// or %NULL for any pad.
// - filter *Caps (nullable): the #GstCaps to filter the link,
// or %NULL for no filter.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements. Side effect
// is that if one of the pads has no parent, it becomes a child of the parent of
// the other element. If they have different parents, the link fails. If @caps
// is not %NULL, makes sure that the caps of the link is a subset of @caps.
func (src *ElementInstance) LinkPadsFiltered(srcpadname string, dest Element, destpadname string, filter *Caps) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstElement // in, none, converted
var carg3 *C.gchar // in, none, string, nullable-string
var carg4 *C.GstCaps // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
if srcpadname != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(srcpadname)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
if destpadname != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(destpadname)))
defer C.free(unsafe.Pointer(carg3))
}
if filter != nil {
carg4 = (*C.GstCaps)(UnsafeCapsToGlibNone(filter))
}
cret = C.gst_element_link_pads_filtered(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(srcpadname)
runtime.KeepAlive(dest)
runtime.KeepAlive(destpadname)
runtime.KeepAlive(filter)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LinkPadsFull wraps gst_element_link_pads_full
//
// The function takes the following parameters:
//
// - srcpadname string (nullable): the name of the #GstPad in source element
// or %NULL for any pad.
// - dest Element: the #GstElement containing the destination pad.
// - destpadname string (nullable): the name of the #GstPad in destination element,
// or %NULL for any pad.
// - flags PadLinkCheck: the #GstPadLinkCheck to be performed when linking pads.
//
// The function returns the following values:
//
// - goret bool
//
// Links the two named pads of the source and destination elements.
// Side effect is that if one of the pads has no parent, it becomes a
// child of the parent of the other element. If they have different
// parents, the link fails.
//
// Calling gst_element_link_pads_full() with @flags == %GST_PAD_LINK_CHECK_DEFAULT
// is the same as calling gst_element_link_pads() and the recommended way of
// linking pads with safety checks applied.
//
// This is a convenience function for gst_pad_link_full().
func (src *ElementInstance) LinkPadsFull(srcpadname string, dest Element, destpadname string, flags PadLinkCheck) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstElement // in, none, converted
var carg3 *C.gchar // in, none, string, nullable-string
var carg4 C.GstPadLinkCheck // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
if srcpadname != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(srcpadname)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
if destpadname != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(destpadname)))
defer C.free(unsafe.Pointer(carg3))
}
carg4 = C.GstPadLinkCheck(flags)
cret = C.gst_element_link_pads_full(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(srcpadname)
runtime.KeepAlive(dest)
runtime.KeepAlive(destpadname)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// LostState wraps gst_element_lost_state
//
// Brings the element to the lost state. The current state of the
// element is copied to the pending state so that any call to
// gst_element_get_state() will return %GST_STATE_CHANGE_ASYNC.
//
// An ASYNC_START message is posted. If the element was PLAYING, it will
// go to PAUSED. The element will be restored to its PLAYING state by
// the parent pipeline when it prerolls again.
//
// This is mostly used for elements that lost their preroll buffer
// in the %GST_STATE_PAUSED or %GST_STATE_PLAYING state after a flush,
// they will go to their pending state again when a new preroll buffer is
// queued. This function can only be called when the element is currently
// not in error or an async state change.
//
// This function is used internally and should normally not be called from
// plugins or applications.
func (element *ElementInstance) LostState() {
var carg0 *C.GstElement // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
C.gst_element_lost_state(carg0)
runtime.KeepAlive(element)
}
// MessageFull wraps gst_element_message_full
//
// The function takes the following parameters:
//
// - typ MessageType: the #GstMessageType
// - domain glib.Quark: the GStreamer GError domain this message belongs to
// - code int: the GError code belonging to the domain
// - text string (nullable): an allocated text string to be used
// as a replacement for the default message connected to code,
// or %NULL
// - debug string (nullable): an allocated debug message to be
// used as a replacement for the default debugging information,
// or %NULL
// - file string: the source code file where the error was generated
// - function string: the source code function where the error was generated
// - line int: the source code line where the error was generated
//
// Post an error, warning or info message on the bus from inside an element.
//
// @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
// #GST_MESSAGE_INFO.
//
// MT safe.
func (element *ElementInstance) MessageFull(typ MessageType, domain glib.Quark, code int, text string, debug string, file string, function string, line int) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstMessageType // in, none, casted
var carg2 C.GQuark // in, none, casted, alias
var carg3 C.gint // in, none, casted
var carg4 *C.gchar // in, full, string, nullable-string
var carg5 *C.gchar // in, full, string, nullable-string
var carg6 *C.gchar // in, none, string, casted *C.gchar
var carg7 *C.gchar // in, none, string, casted *C.gchar
var carg8 C.gint // in, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstMessageType(typ)
carg2 = C.GQuark(domain)
carg3 = C.gint(code)
if text != "" {
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(text)))
}
if debug != "" {
carg5 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
}
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(file)))
defer C.free(unsafe.Pointer(carg6))
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(function)))
defer C.free(unsafe.Pointer(carg7))
carg8 = C.gint(line)
C.gst_element_message_full(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8)
runtime.KeepAlive(element)
runtime.KeepAlive(typ)
runtime.KeepAlive(domain)
runtime.KeepAlive(code)
runtime.KeepAlive(text)
runtime.KeepAlive(debug)
runtime.KeepAlive(file)
runtime.KeepAlive(function)
runtime.KeepAlive(line)
}
// MessageFullWithDetails wraps gst_element_message_full_with_details
//
// The function takes the following parameters:
//
// - typ MessageType: the #GstMessageType
// - domain glib.Quark: the GStreamer GError domain this message belongs to
// - code int: the GError code belonging to the domain
// - text string (nullable): an allocated text string to be used
// as a replacement for the default message connected to code,
// or %NULL
// - debug string (nullable): an allocated debug message to be
// used as a replacement for the default debugging information,
// or %NULL
// - file string: the source code file where the error was generated
// - function string: the source code function where the error was generated
// - line int: the source code line where the error was generated
// - structure *Structure: optional details structure
//
// Post an error, warning or info message on the bus from inside an element.
//
// @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
// #GST_MESSAGE_INFO.
func (element *ElementInstance) MessageFullWithDetails(typ MessageType, domain glib.Quark, code int, text string, debug string, file string, function string, line int, structure *Structure) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstMessageType // in, none, casted
var carg2 C.GQuark // in, none, casted, alias
var carg3 C.gint // in, none, casted
var carg4 *C.gchar // in, full, string, nullable-string
var carg5 *C.gchar // in, full, string, nullable-string
var carg6 *C.gchar // in, none, string, casted *C.gchar
var carg7 *C.gchar // in, none, string, casted *C.gchar
var carg8 C.gint // in, none, casted
var carg9 *C.GstStructure // in, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstMessageType(typ)
carg2 = C.GQuark(domain)
carg3 = C.gint(code)
if text != "" {
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(text)))
}
if debug != "" {
carg5 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
}
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(file)))
defer C.free(unsafe.Pointer(carg6))
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(function)))
defer C.free(unsafe.Pointer(carg7))
carg8 = C.gint(line)
carg9 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
C.gst_element_message_full_with_details(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8, carg9)
runtime.KeepAlive(element)
runtime.KeepAlive(typ)
runtime.KeepAlive(domain)
runtime.KeepAlive(code)
runtime.KeepAlive(text)
runtime.KeepAlive(debug)
runtime.KeepAlive(file)
runtime.KeepAlive(function)
runtime.KeepAlive(line)
runtime.KeepAlive(structure)
}
// NoMorePads wraps gst_element_no_more_pads
//
// Use this function to signal that the element does not expect any more pads
// to show up in the current pipeline. This function should be called whenever
// pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
// pad templates use this in combination with autopluggers to figure out that
// the element is done initializing its pads.
//
// This function emits the #GstElement::no-more-pads signal.
//
// MT safe.
func (element *ElementInstance) NoMorePads() {
var carg0 *C.GstElement // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
C.gst_element_no_more_pads(carg0)
runtime.KeepAlive(element)
}
// PostMessage wraps gst_element_post_message
//
// The function takes the following parameters:
//
// - message *Message: a #GstMessage to post
//
// The function returns the following values:
//
// - goret bool
//
// Post a message on the element's #GstBus. This function takes ownership of the
// message; if you want to access the message after this call, you should add an
// additional reference before calling.
func (element *ElementInstance) PostMessage(message *Message) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstMessage // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstMessage)(UnsafeMessageToGlibFull(message))
cret = C.gst_element_post_message(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(message)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ProvidedClock wraps gst_element_provide_clock
// The function returns the following values:
//
// - goret Clock
//
// Get the clock provided by the given element.
// &gt; An element is only required to provide a clock in the PAUSED
// &gt; state. Some elements can provide a clock in other states.
func (element *ElementInstance) ProvidedClock() Clock {
var carg0 *C.GstElement // in, none, converted
var cret *C.GstClock // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_provide_clock(carg0)
runtime.KeepAlive(element)
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Query wraps gst_element_query
//
// The function takes the following parameters:
//
// - query *Query: the #GstQuery.
//
// The function returns the following values:
//
// - goret bool
//
// Performs a query on the given element.
//
// For elements that don't implement a query handler, this function
// forwards the query to a random srcpad or to the peer of a
// random linked sinkpad of this element.
//
// Please note that some queries might need a running pipeline to work.
func (element *ElementInstance) Query(query *Query) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstQuery // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_element_query(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// QueryConvert wraps gst_element_query_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: a #GstFormat to convert from.
// - srcVal int64: a value to convert.
// - destFormat Format: the #GstFormat to convert to.
//
// The function returns the following values:
//
// - destVal int64: a pointer to the result.
// - goret bool
//
// Queries an element to convert @src_val in @src_format to @dest_format.
func (element *ElementInstance) QueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.GstFormat // in, none, casted
var carg4 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstFormat(srcFormat)
carg2 = C.gint64(srcVal)
carg3 = C.GstFormat(destFormat)
cret = C.gst_element_query_convert(carg0, carg1, carg2, carg3, &carg4)
runtime.KeepAlive(element)
runtime.KeepAlive(srcFormat)
runtime.KeepAlive(srcVal)
runtime.KeepAlive(destFormat)
var destVal int64
var goret bool
destVal = int64(carg4)
if cret != 0 {
goret = true
}
return destVal, goret
}
// QueryDuration wraps gst_element_query_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - duration int64: A location in which to store the total duration, or %NULL.
// - goret bool
//
// Queries an element (usually top-level pipeline or playbin element) for the
// total stream duration in nanoseconds. This query will only work once the
// pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application
// will receive an ASYNC_DONE message on the pipeline bus when that is the case.
//
// If the duration changes for some reason, you will get a DURATION_CHANGED
// message on the pipeline bus, in which case you should re-query the duration
// using this function.
func (element *ElementInstance) QueryDuration(format Format) (int64, bool) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstFormat(format)
cret = C.gst_element_query_duration(carg0, carg1, &carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(format)
var duration int64
var goret bool
duration = int64(carg2)
if cret != 0 {
goret = true
}
return duration, goret
}
// QueryPosition wraps gst_element_query_position
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat requested
//
// The function returns the following values:
//
// - cur int64: a location in which to store the current
// position, or %NULL.
// - goret bool
//
// Queries an element (usually top-level pipeline or playbin element) for the
// stream position in nanoseconds. This will be a value between 0 and the
// stream duration (if the stream duration is known). This query will usually
// only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING
// state). The application will receive an ASYNC_DONE message on the pipeline
// bus when that is the case.
//
// If one repeatedly calls this function one can also create a query and reuse
// it in gst_element_query().
func (element *ElementInstance) QueryPosition(format Format) (int64, bool) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstFormat(format)
cret = C.gst_element_query_position(carg0, carg1, &carg2)
runtime.KeepAlive(element)
runtime.KeepAlive(format)
var cur int64
var goret bool
cur = int64(carg2)
if cret != 0 {
goret = true
}
return cur, goret
}
// ReleaseRequestPad wraps gst_element_release_request_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to release.
//
// Makes the element free the previously requested pad as obtained
// with gst_element_request_pad().
//
// This does not unref the pad. If the pad was created by using
// gst_element_request_pad(), gst_element_release_request_pad() needs to be
// followed by gst_object_unref() to free the @pad.
//
// MT safe.
func (element *ElementInstance) ReleaseRequestPad(pad Pad) {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPad // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
C.gst_element_release_request_pad(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(pad)
}
// RemovePad wraps gst_element_remove_pad
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to remove from the element.
//
// The function returns the following values:
//
// - goret bool
//
// Removes @pad from @element. @pad will be destroyed if it has not been
// referenced elsewhere using gst_object_unparent().
//
// This function is used by plugin developers and should not be used
// by applications. Pads that were dynamically requested from elements
// with gst_element_request_pad() should be released with the
// gst_element_release_request_pad() function instead.
//
// Pads are not automatically deactivated so elements should perform the needed
// steps to deactivate the pad in case this pad is removed in the PAUSED or
// PLAYING state. See gst_pad_set_active() for more information about
// deactivating pads.
//
// The pad and the element should be unlocked when calling this function.
//
// This function will emit the #GstElement::pad-removed signal on the element.
func (element *ElementInstance) RemovePad(pad Pad) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
cret = C.gst_element_remove_pad(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(pad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemovePropertyNotifyWatch wraps gst_element_remove_property_notify_watch
//
// The function takes the following parameters:
//
// - watchId uint32: watch id to remove
func (element *ElementInstance) RemovePropertyNotifyWatch(watchId uint32) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.gulong // in, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.gulong(watchId)
C.gst_element_remove_property_notify_watch(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(watchId)
}
// RequestPad wraps gst_element_request_pad
//
// The function takes the following parameters:
//
// - templ PadTemplate: a #GstPadTemplate of which we want a pad of.
// - name string (nullable): the name of the request #GstPad
// to retrieve. Can be %NULL.
// - caps *Caps (nullable): the caps of the pad we want to
// request. Can be %NULL.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a request pad from the element according to the provided template.
// Pad templates can be looked up using
// gst_element_factory_get_static_pad_templates().
//
// The pad should be released with gst_element_release_request_pad().
func (element *ElementInstance) RequestPad(templ PadTemplate, name string, caps *Caps) Pad {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstPadTemplate // in, none, converted
var carg2 *C.gchar // in, none, string, nullable-string
var carg3 *C.GstCaps // in, none, converted, nullable
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
if name != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
}
if caps != nil {
carg3 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
cret = C.gst_element_request_pad(carg0, carg1, carg2, carg3)
runtime.KeepAlive(element)
runtime.KeepAlive(templ)
runtime.KeepAlive(name)
runtime.KeepAlive(caps)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// RequestPadSimple wraps gst_element_request_pad_simple
//
// The function takes the following parameters:
//
// - name string: the name of the request #GstPad to retrieve.
//
// The function returns the following values:
//
// - goret Pad
//
// Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
// retrieves request pads. The pad should be released with
// gst_element_release_request_pad().
//
// This method is slower than manually getting the pad template and calling
// gst_element_request_pad() if the pads should have a specific name (e.g.
// @name is "src_1" instead of "src_\%u").
//
// Note that this function was introduced in GStreamer 1.20 in order to provide
// a better name to gst_element_get_request_pad(). Prior to 1.20, users
// should use gst_element_get_request_pad() which provides the same
// functionality.
func (element *ElementInstance) RequestPadSimple(name string) Pad {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_request_pad_simple(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(name)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Seek wraps gst_element_seek
//
// The function takes the following parameters:
//
// - rate float64: The new playback rate
// - format Format: The format of the seek values
// - flags SeekFlags: The optional seek flags.
// - startType SeekType: The type and flags for the new start position
// - start int64: The value of the new start position
// - stopType SeekType: The type and flags for the new stop position
// - stop int64: The value of the new stop position
//
// The function returns the following values:
//
// - goret bool
//
// Sends a seek event to an element. See gst_event_new_seek() for the details of
// the parameters. The seek event is sent to the element using
// gst_element_send_event().
//
// MT safe.
func (element *ElementInstance) Seek(rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.gdouble // in, none, casted
var carg2 C.GstFormat // in, none, casted
var carg3 C.GstSeekFlags // in, none, casted
var carg4 C.GstSeekType // in, none, casted
var carg5 C.gint64 // in, none, casted
var carg6 C.GstSeekType // in, none, casted
var carg7 C.gint64 // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.gdouble(rate)
carg2 = C.GstFormat(format)
carg3 = C.GstSeekFlags(flags)
carg4 = C.GstSeekType(startType)
carg5 = C.gint64(start)
carg6 = C.GstSeekType(stopType)
carg7 = C.gint64(stop)
cret = C.gst_element_seek(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(element)
runtime.KeepAlive(rate)
runtime.KeepAlive(format)
runtime.KeepAlive(flags)
runtime.KeepAlive(startType)
runtime.KeepAlive(start)
runtime.KeepAlive(stopType)
runtime.KeepAlive(stop)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SeekSimple wraps gst_element_seek_simple
//
// The function takes the following parameters:
//
// - format Format: a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
// - seekFlags SeekFlags: seek options; playback applications will usually want to use
// GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
// - seekPos int64: position to seek to (relative to the start); if you are doing
// a seek in #GST_FORMAT_TIME this value is in nanoseconds -
// multiply with #GST_SECOND to convert seconds to nanoseconds or
// with #GST_MSECOND to convert milliseconds to nanoseconds.
//
// The function returns the following values:
//
// - goret bool
//
// Simple API to perform a seek on the given element, meaning it just seeks
// to the given position relative to the start of the stream. For more complex
// operations like segment seeks (e.g. for looping) or changing the playback
// rate or seeking relative to the last configured playback segment you should
// use gst_element_seek().
//
// In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
// guaranteed to return %TRUE on a seekable media type or %FALSE when the media
// type is certainly not seekable (such as a live stream).
//
// Some elements allow for seeking in the READY state, in this
// case they will store the seek event and execute it when they are put to
// PAUSED. If the element supports seek in READY, it will always return %TRUE when
// it receives the event in the READY state.
func (element *ElementInstance) SeekSimple(format Format, seekFlags SeekFlags, seekPos int64) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.GstSeekFlags // in, none, casted
var carg3 C.gint64 // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstFormat(format)
carg2 = C.GstSeekFlags(seekFlags)
carg3 = C.gint64(seekPos)
cret = C.gst_element_seek_simple(carg0, carg1, carg2, carg3)
runtime.KeepAlive(element)
runtime.KeepAlive(format)
runtime.KeepAlive(seekFlags)
runtime.KeepAlive(seekPos)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SendEvent wraps gst_element_send_event
//
// The function takes the following parameters:
//
// - event *Event: the #GstEvent to send to the element.
//
// The function returns the following values:
//
// - goret bool
//
// Sends an event to an element. If the element doesn't implement an
// event handler, the event will be pushed on a random linked sink pad for
// downstream events or a random linked source pad for upstream events.
//
// This function takes ownership of the provided event so you should
// gst_event_ref() it if you want to reuse the event after this call.
//
// MT safe.
func (element *ElementInstance) SendEvent(event *Event) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstEvent // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstEvent)(UnsafeEventToGlibFull(event))
cret = C.gst_element_send_event(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(event)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetBaseTime wraps gst_element_set_base_time
//
// The function takes the following parameters:
//
// - time ClockTime: the base time to set.
//
// Set the base time of an element. See gst_element_get_base_time().
//
// MT safe.
func (element *ElementInstance) SetBaseTime(time ClockTime) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstClockTime(time)
C.gst_element_set_base_time(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(time)
}
// SetBus wraps gst_element_set_bus
//
// The function takes the following parameters:
//
// - bus Bus (nullable): the #GstBus to set.
//
// Sets the bus of the element. Increases the refcount on the bus.
// For internal use only, unless you're testing elements.
//
// MT safe.
func (element *ElementInstance) SetBus(bus Bus) {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstBus // in, none, converted, nullable
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
if bus != nil {
carg1 = (*C.GstBus)(UnsafeBusToGlibNone(bus))
}
C.gst_element_set_bus(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(bus)
}
// SetClock wraps gst_element_set_clock
//
// The function takes the following parameters:
//
// - clock Clock (nullable): the #GstClock to set for the element.
//
// The function returns the following values:
//
// - goret bool
//
// Sets the clock for the element. This function increases the
// refcount on the clock. Any previously set clock on the object
// is unreffed.
func (element *ElementInstance) SetClock(clock Clock) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstClock // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
if clock != nil {
carg1 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
}
cret = C.gst_element_set_clock(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(clock)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetContext wraps gst_element_set_context
//
// The function takes the following parameters:
//
// - _context *Context: the #GstContext to set.
//
// Sets the context of the element. Increases the refcount of the context.
//
// MT safe.
func (element *ElementInstance) SetContext(_context *Context) {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstContext // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
C.gst_element_set_context(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(_context)
}
// SetLockedState wraps gst_element_set_locked_state
//
// The function takes the following parameters:
//
// - lockedState bool: %TRUE to lock the element's state
//
// The function returns the following values:
//
// - goret bool
//
// Locks the state of an element, so state changes of the parent don't affect
// this element anymore.
//
// Note that this is racy if the state lock of the parent bin is not taken.
// The parent bin might've just checked the flag in another thread and as the
// next step proceed to change the child element's state.
//
// MT safe.
func (element *ElementInstance) SetLockedState(lockedState bool) bool {
var carg0 *C.GstElement // in, none, converted
var carg1 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
if lockedState {
carg1 = C.TRUE
}
cret = C.gst_element_set_locked_state(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(lockedState)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetStartTime wraps gst_element_set_start_time
//
// The function takes the following parameters:
//
// - time ClockTime: the base time to set.
//
// Set the start time of an element. The start time of the element is the
// running time of the element when it last went to the PAUSED state. In READY
// or after a flushing seek, it is set to 0.
//
// Toplevel elements like #GstPipeline will manage the start_time and
// base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE
// on such a toplevel element will disable the distribution of the base_time to
// the children and can be useful if the application manages the base_time
// itself, for example if you want to synchronize capture from multiple
// pipelines, and you can also ensure that the pipelines have the same clock.
//
// MT safe.
func (element *ElementInstance) SetStartTime(time ClockTime) {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstClockTime(time)
C.gst_element_set_start_time(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(time)
}
// SetState wraps gst_element_set_state
//
// The function takes the following parameters:
//
// - state State: the element's new #GstState.
//
// The function returns the following values:
//
// - goret StateChangeReturn
//
// Sets the state of the element. This function will try to set the
// requested state by going through all the intermediary states and calling
// the class's state change function for each.
//
// This function can return #GST_STATE_CHANGE_ASYNC, in which case the
// element will perform the remainder of the state change asynchronously in
// another thread.
// An application can use gst_element_get_state() to wait for the completion
// of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
// %GST_MESSAGE_STATE_CHANGED on the bus.
//
// State changes to %GST_STATE_READY or %GST_STATE_NULL never return
// #GST_STATE_CHANGE_ASYNC.
func (element *ElementInstance) SetState(state State) StateChangeReturn {
var carg0 *C.GstElement // in, none, converted
var carg1 C.GstState // in, none, casted
var cret C.GstStateChangeReturn // return, none, casted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
carg1 = C.GstState(state)
cret = C.gst_element_set_state(carg0, carg1)
runtime.KeepAlive(element)
runtime.KeepAlive(state)
var goret StateChangeReturn
goret = StateChangeReturn(cret)
return goret
}
// SyncStateWithParent wraps gst_element_sync_state_with_parent
// The function returns the following values:
//
// - goret bool
//
// Tries to change the state of the element to the same as its parent.
// If this function returns %FALSE, the state of element is undefined.
func (element *ElementInstance) SyncStateWithParent() bool {
var carg0 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_element_sync_state_with_parent(carg0)
runtime.KeepAlive(element)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Unlink wraps gst_element_unlink
//
// The function takes the following parameters:
//
// - dest Element: the sink #GstElement to unlink.
//
// Unlinks all source pads of the source element with all sink pads
// of the sink element to which they are linked.
//
// If the link has been made using gst_element_link(), it could have created an
// requestpad, which has to be released using gst_element_release_request_pad().
func (src *ElementInstance) Unlink(dest Element) {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.GstElement // in, none, converted
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
C.gst_element_unlink(carg0, carg1)
runtime.KeepAlive(src)
runtime.KeepAlive(dest)
}
// UnlinkPads wraps gst_element_unlink_pads
//
// The function takes the following parameters:
//
// - srcpadname string: the name of the #GstPad in source element.
// - dest Element: a #GstElement containing the destination pad.
// - destpadname string: the name of the #GstPad in destination element.
//
// Unlinks the two named pads of the source and destination elements.
//
// This is a convenience function for gst_pad_unlink().
func (src *ElementInstance) UnlinkPads(srcpadname string, dest Element, destpadname string) {
var carg0 *C.GstElement // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstElement // in, none, converted
var carg3 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstElement)(UnsafeElementToGlibNone(src))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(srcpadname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.GstElement)(UnsafeElementToGlibNone(dest))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(destpadname)))
defer C.free(unsafe.Pointer(carg3))
C.gst_element_unlink_pads(carg0, carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(srcpadname)
runtime.KeepAlive(dest)
runtime.KeepAlive(destpadname)
}
// 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
PluginFeatureInstance
}
var _ ElementFactory = (*ElementFactoryInstance)(nil)
// ElementFactory wraps GstElementFactory
//
// #GstElementFactory is used to create instances of elements. A
// GstElementFactory can be added to a #GstPlugin as it is also a
// #GstPluginFeature.
//
// Use the gst_element_factory_find() and gst_element_factory_create()
// functions to create element instances or use gst_element_factory_make() as a
// convenient shortcut.
//
// The following code example shows you how to create a GstFileSrc element.
//
// ## Using an element factory
// |[&lt;!-- language="C" --&gt;
// #include &lt;gst/gst.h&gt;
//
// GstElement *src;
// GstElementFactory *srcfactory;
//
// gst_init (&amp;argc, &amp;argv);
//
// srcfactory = gst_element_factory_find ("filesrc");
// g_return_if_fail (srcfactory != NULL);
// src = gst_element_factory_create (srcfactory, "src");
// g_return_if_fail (src != NULL);
// ...
// ]|
type ElementFactory interface {
PluginFeature
upcastToGstElementFactory() *ElementFactoryInstance
// CanSinkAllCaps wraps gst_element_factory_can_sink_all_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can sink all possible capabilities.
CanSinkAllCaps(*Caps) bool
// CanSinkAnyCaps wraps gst_element_factory_can_sink_any_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can sink any possible capability.
CanSinkAnyCaps(*Caps) bool
// CanSrcAllCaps wraps gst_element_factory_can_src_all_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can src all possible capabilities.
CanSrcAllCaps(*Caps) bool
// CanSrcAnyCaps wraps gst_element_factory_can_src_any_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can src any possible capability.
CanSrcAnyCaps(*Caps) bool
// Create wraps gst_element_factory_create
//
// The function takes the following parameters:
//
// - name string (nullable): name of new element, or %NULL to automatically create
// a unique name
//
// The function returns the following values:
//
// - goret Element
//
// Create a new element of the type defined by the given elementfactory.
// It will be given the name supplied, since all elements require a name as
// their first argument.
Create(string) Element
// CreateWithProperties wraps gst_element_factory_create_with_properties
//
// The function takes the following parameters:
//
// - names []string (nullable): array of properties names
// - values []gobject.Value (nullable): array of associated properties values
//
// The function returns the following values:
//
// - goret Element
//
// Create a new element of the type defined by the given elementfactory.
// The supplied list of properties, will be passed at object construction.
CreateWithProperties([]string, []gobject.Value) Element
// GetElementType wraps gst_element_factory_get_element_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for elements managed by this factory. The type can
// only be retrieved if the element factory is loaded, which can be
// assured with gst_plugin_feature_load().
GetElementType() gobject.Type
// GetMetadata wraps gst_element_factory_get_metadata
//
// The function takes the following parameters:
//
// - key string: a key
//
// The function returns the following values:
//
// - goret string
//
// Get the metadata on @factory with @key.
GetMetadata(string) string
// GetMetadataKeys wraps gst_element_factory_get_metadata_keys
// The function returns the following values:
//
// - goret []string
//
// Get the available keys for the metadata on @factory.
GetMetadataKeys() []string
// GetNumPadTemplates wraps gst_element_factory_get_num_pad_templates
// The function returns the following values:
//
// - goret uint
//
// Gets the number of pad_templates in this factory.
GetNumPadTemplates() uint
// GetSkipDocumentation wraps gst_element_factory_get_skip_documentation
// The function returns the following values:
//
// - goret bool
//
// Queries whether registered element managed by @factory needs to
// be excluded from documentation system or not.
GetSkipDocumentation() bool
// GetURIProtocols wraps gst_element_factory_get_uri_protocols
// The function returns the following values:
//
// - goret []string
//
// Gets a %NULL-terminated array of protocols this element supports or %NULL if
// no protocols are supported. You may not change the contents of the returned
// array, as it is still owned by the element factory. Use g_strdupv() to
// make a copy of the protocol string array if you need to.
GetURIProtocols() []string
// GetURIType wraps gst_element_factory_get_uri_type
// The function returns the following values:
//
// - goret URIType
//
// Gets the type of URIs the element supports or #GST_URI_UNKNOWN if none.
GetURIType() URIType
// HasInterface wraps gst_element_factory_has_interface
//
// The function takes the following parameters:
//
// - interfacename string: an interface name
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory implements the interface with name @interfacename.
HasInterface(string) bool
// ListIsType wraps gst_element_factory_list_is_type
//
// The function takes the following parameters:
//
// - typ ElementFactoryListType: a #GstElementFactoryListType
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory is of the given types.
ListIsType(ElementFactoryListType) bool
}
func unsafeWrapElementFactory(base *gobject.ObjectInstance) *ElementFactoryInstance {
return &ElementFactoryInstance{
PluginFeatureInstance: PluginFeatureInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalElementFactoryInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapElementFactory(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeElementFactoryFromGlibNone is used to convert raw GstElementFactory pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeElementFactoryFromGlibNone(c unsafe.Pointer) ElementFactory {
return gobject.UnsafeObjectFromGlibNone(c).(ElementFactory)
}
// UnsafeElementFactoryFromGlibFull is used to convert raw GstElementFactory pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeElementFactoryFromGlibFull(c unsafe.Pointer) ElementFactory {
return gobject.UnsafeObjectFromGlibFull(c).(ElementFactory)
}
func (e *ElementFactoryInstance) upcastToGstElementFactory() *ElementFactoryInstance {
return e
}
// UnsafeElementFactoryToGlibNone is used to convert the instance to it's C value GstElementFactory. This is used by the bindings internally.
func UnsafeElementFactoryToGlibNone(c ElementFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeElementFactoryToGlibFull is used to convert the instance to it's C value GstElementFactory, while removeing the finalizer. This is used by the bindings internally.
func UnsafeElementFactoryToGlibFull(c ElementFactory) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// ElementFactoryFind wraps gst_element_factory_find
//
// The function takes the following parameters:
//
// - name string: name of factory to find
//
// The function returns the following values:
//
// - goret ElementFactory
//
// Search for an element factory of the given name. Refs the returned
// element factory; caller is responsible for unreffing.
func ElementFactoryFind(name string) ElementFactory {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstElementFactory // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_factory_find(carg1)
runtime.KeepAlive(name)
var goret ElementFactory
goret = UnsafeElementFactoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ElementFactoryMake wraps gst_element_factory_make
//
// The function takes the following parameters:
//
// - factoryname string: a named factory to instantiate
// - name string (nullable): name of new element, or %NULL to automatically create
// a unique name
//
// The function returns the following values:
//
// - goret Element
//
// Create a new element of the type defined by the given element factory.
// If name is %NULL, then the element will receive a guaranteed unique name,
// consisting of the element factory name and a number.
// If name is given, it will be given the name supplied.
func ElementFactoryMake(factoryname string, name string) Element {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(factoryname)))
defer C.free(unsafe.Pointer(carg1))
if name != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg2))
}
cret = C.gst_element_factory_make(carg1, carg2)
runtime.KeepAlive(factoryname)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// CanSinkAllCaps wraps gst_element_factory_can_sink_all_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can sink all possible capabilities.
func (factory *ElementFactoryInstance) CanSinkAllCaps(caps *Caps) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_element_factory_can_sink_all_caps(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CanSinkAnyCaps wraps gst_element_factory_can_sink_any_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can sink any possible capability.
func (factory *ElementFactoryInstance) CanSinkAnyCaps(caps *Caps) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_element_factory_can_sink_any_caps(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CanSrcAllCaps wraps gst_element_factory_can_src_all_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can src all possible capabilities.
func (factory *ElementFactoryInstance) CanSrcAllCaps(caps *Caps) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_element_factory_can_src_all_caps(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CanSrcAnyCaps wraps gst_element_factory_can_src_any_caps
//
// The function takes the following parameters:
//
// - caps *Caps: the caps to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the factory can src any possible capability.
func (factory *ElementFactoryInstance) CanSrcAnyCaps(caps *Caps) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_element_factory_can_src_any_caps(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Create wraps gst_element_factory_create
//
// The function takes the following parameters:
//
// - name string (nullable): name of new element, or %NULL to automatically create
// a unique name
//
// The function returns the following values:
//
// - goret Element
//
// Create a new element of the type defined by the given elementfactory.
// It will be given the name supplied, since all elements require a name as
// their first argument.
func (factory *ElementFactoryInstance) Create(name string) Element {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_element_factory_create(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// CreateWithProperties wraps gst_element_factory_create_with_properties
//
// The function takes the following parameters:
//
// - names []string (nullable): array of properties names
// - values []gobject.Value (nullable): array of associated properties values
//
// The function returns the following values:
//
// - goret Element
//
// Create a new element of the type defined by the given elementfactory.
// The supplied list of properties, will be passed at object construction.
func (factory *ElementFactoryInstance) CreateWithProperties(names []string, values []gobject.Value) Element {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 C.guint // implicit
var carg2 **C.gchar // in, transfer: none, C Pointers: 2, Name: array[utf8], nullable, array (inner: *typesystem.StringPrimitive, length-by: carg1)
var carg3 *C.GValue // in, transfer: none, C Pointers: 1, Name: array[Value], nullable, array (inner: *typesystem.Record, length-by: carg1)
var cret *C.GstElement // return, none, converted
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
_ = names
_ = carg2
_ = carg1
panic("unimplemented conversion of []string (const gchar**)")
_ = values
_ = carg3
_ = carg1
panic("unimplemented conversion of []gobject.Value (const GValue*)")
cret = C.gst_element_factory_create_with_properties(carg0, carg1, carg2, carg3)
runtime.KeepAlive(factory)
runtime.KeepAlive(names)
runtime.KeepAlive(values)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetElementType wraps gst_element_factory_get_element_type
// The function returns the following values:
//
// - goret gobject.Type
//
// Get the #GType for elements managed by this factory. The type can
// only be retrieved if the element factory is loaded, which can be
// assured with gst_plugin_feature_load().
func (factory *ElementFactoryInstance) GetElementType() gobject.Type {
var carg0 *C.GstElementFactory // in, none, converted
var cret C.GType // return, none, casted, alias
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_element_type(carg0)
runtime.KeepAlive(factory)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// GetMetadata wraps gst_element_factory_get_metadata
//
// The function takes the following parameters:
//
// - key string: a key
//
// The function returns the following values:
//
// - goret string
//
// Get the metadata on @factory with @key.
func (factory *ElementFactoryInstance) GetMetadata(key string) string {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_factory_get_metadata(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetMetadataKeys wraps gst_element_factory_get_metadata_keys
// The function returns the following values:
//
// - goret []string
//
// Get the available keys for the metadata on @factory.
func (factory *ElementFactoryInstance) GetMetadataKeys() []string {
var carg0 *C.GstElementFactory // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_metadata_keys(carg0)
runtime.KeepAlive(factory)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// GetNumPadTemplates wraps gst_element_factory_get_num_pad_templates
// The function returns the following values:
//
// - goret uint
//
// Gets the number of pad_templates in this factory.
func (factory *ElementFactoryInstance) GetNumPadTemplates() uint {
var carg0 *C.GstElementFactory // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_num_pad_templates(carg0)
runtime.KeepAlive(factory)
var goret uint
goret = uint(cret)
return goret
}
// GetSkipDocumentation wraps gst_element_factory_get_skip_documentation
// The function returns the following values:
//
// - goret bool
//
// Queries whether registered element managed by @factory needs to
// be excluded from documentation system or not.
func (factory *ElementFactoryInstance) GetSkipDocumentation() bool {
var carg0 *C.GstElementFactory // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_skip_documentation(carg0)
runtime.KeepAlive(factory)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetURIProtocols wraps gst_element_factory_get_uri_protocols
// The function returns the following values:
//
// - goret []string
//
// Gets a %NULL-terminated array of protocols this element supports or %NULL if
// no protocols are supported. You may not change the contents of the returned
// array, as it is still owned by the element factory. Use g_strdupv() to
// make a copy of the protocol string array if you need to.
func (factory *ElementFactoryInstance) GetURIProtocols() []string {
var carg0 *C.GstElementFactory // in, none, converted
var cret **C.gchar // return, transfer: none, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_uri_protocols(carg0)
runtime.KeepAlive(factory)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (const gchar* const*)")
return goret
}
// GetURIType wraps gst_element_factory_get_uri_type
// The function returns the following values:
//
// - goret URIType
//
// Gets the type of URIs the element supports or #GST_URI_UNKNOWN if none.
func (factory *ElementFactoryInstance) GetURIType() URIType {
var carg0 *C.GstElementFactory // in, none, converted
var cret C.GstURIType // return, none, casted
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
cret = C.gst_element_factory_get_uri_type(carg0)
runtime.KeepAlive(factory)
var goret URIType
goret = URIType(cret)
return goret
}
// HasInterface wraps gst_element_factory_has_interface
//
// The function takes the following parameters:
//
// - interfacename string: an interface name
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory implements the interface with name @interfacename.
func (factory *ElementFactoryInstance) HasInterface(interfacename string) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(interfacename)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_factory_has_interface(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(interfacename)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ListIsType wraps gst_element_factory_list_is_type
//
// The function takes the following parameters:
//
// - typ ElementFactoryListType: a #GstElementFactoryListType
//
// The function returns the following values:
//
// - goret bool
//
// Check if @factory is of the given types.
func (factory *ElementFactoryInstance) ListIsType(typ ElementFactoryListType) bool {
var carg0 *C.GstElementFactory // in, none, converted
var carg1 C.GstElementFactoryListType // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstElementFactory)(UnsafeElementFactoryToGlibNone(factory))
carg1 = C.GstElementFactoryListType(typ)
cret = C.gst_element_factory_list_is_type(carg0, carg1)
runtime.KeepAlive(factory)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GhostPadInstance is the instance type used by all types extending GstGhostPad. It is used internally by the bindings. Users should use the interface [GhostPad] instead.
type GhostPadInstance struct {
_ [0]func() // equal guard
ProxyPadInstance
}
var _ GhostPad = (*GhostPadInstance)(nil)
// GhostPad wraps GstGhostPad
//
// GhostPads are useful when organizing pipelines with #GstBin like elements.
// The idea here is to create hierarchical element graphs. The bin element
// contains a sub-graph. Now one would like to treat the bin-element like any
// other #GstElement. This is where GhostPads come into play. A GhostPad acts as
// a proxy for another pad. Thus the bin can have sink and source ghost-pads
// that are associated with sink and source pads of the child elements.
//
// If the target pad is known at creation time, gst_ghost_pad_new() is the
// function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target()
// to create the ghost-pad and use gst_ghost_pad_set_target() to establish the
// association later on.
//
// Note that GhostPads add overhead to the data processing of a pipeline.
type GhostPad interface {
ProxyPad
upcastToGstGhostPad() *GhostPadInstance
// Construct wraps gst_ghost_pad_construct
// The function returns the following values:
//
// - goret bool
//
// Finish initialization of a newly allocated ghost pad.
//
// This function is most useful in language bindings and when subclassing
// #GstGhostPad; plugin and application developers normally will not call this
// function. Call this function directly after a call to g_object_new
// (GST_TYPE_GHOST_PAD, "direction", @dir, ..., NULL).
//
// Deprecated: This function is deprecated since 1.18 and does nothing
// anymore.
Construct() bool
// GetTarget wraps gst_ghost_pad_get_target
// The function returns the following values:
//
// - goret Pad
//
// Get the target pad of @gpad. Unref target pad after usage.
GetTarget() Pad
// SetTarget wraps gst_ghost_pad_set_target
//
// The function takes the following parameters:
//
// - newtarget Pad (nullable): the new pad target
//
// The function returns the following values:
//
// - goret bool
//
// Set the new target of the ghostpad @gpad. Any existing target
// is unlinked and links to the new target are established. if @newtarget is
// %NULL the target will be cleared.
SetTarget(Pad) bool
}
func unsafeWrapGhostPad(base *gobject.ObjectInstance) *GhostPadInstance {
return &GhostPadInstance{
ProxyPadInstance: ProxyPadInstance{
PadInstance: PadInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
},
}
}
func marshalGhostPadInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapGhostPad(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeGhostPadFromGlibNone is used to convert raw GstGhostPad pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeGhostPadFromGlibNone(c unsafe.Pointer) GhostPad {
return gobject.UnsafeObjectFromGlibNone(c).(GhostPad)
}
// UnsafeGhostPadFromGlibFull is used to convert raw GstGhostPad pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeGhostPadFromGlibFull(c unsafe.Pointer) GhostPad {
return gobject.UnsafeObjectFromGlibFull(c).(GhostPad)
}
func (g *GhostPadInstance) upcastToGstGhostPad() *GhostPadInstance {
return g
}
// UnsafeGhostPadToGlibNone is used to convert the instance to it's C value GstGhostPad. This is used by the bindings internally.
func UnsafeGhostPadToGlibNone(c GhostPad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeGhostPadToGlibFull is used to convert the instance to it's C value GstGhostPad, while removeing the finalizer. This is used by the bindings internally.
func UnsafeGhostPadToGlibFull(c GhostPad) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewGhostPad wraps gst_ghost_pad_new
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new pad, or %NULL to assign a default name
// - target Pad: the pad to ghost.
//
// The function returns the following values:
//
// - goret Pad
//
// Create a new ghostpad with @target as the target. The direction will be taken
// from the target pad. @target must be unlinked.
//
// Will ref the target.
func NewGhostPad(name string, target Pad) Pad {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstPad // in, none, converted
var cret *C.GstPad // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstPad)(UnsafePadToGlibNone(target))
cret = C.gst_ghost_pad_new(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(target)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewGhostPadFromTemplate wraps gst_ghost_pad_new_from_template
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new pad, or %NULL to assign a default name.
// - target Pad: the pad to ghost.
// - templ PadTemplate: the #GstPadTemplate to use on the ghostpad.
//
// The function returns the following values:
//
// - goret Pad
//
// Create a new ghostpad with @target as the target. The direction will be taken
// from the target pad. The template used on the ghostpad will be @template.
//
// Will ref the target.
func NewGhostPadFromTemplate(name string, target Pad, templ PadTemplate) Pad {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstPad // in, none, converted
var carg3 *C.GstPadTemplate // in, none, converted
var cret *C.GstPad // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstPad)(UnsafePadToGlibNone(target))
carg3 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
cret = C.gst_ghost_pad_new_from_template(carg1, carg2, carg3)
runtime.KeepAlive(name)
runtime.KeepAlive(target)
runtime.KeepAlive(templ)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewGhostPadNoTarget wraps gst_ghost_pad_new_no_target
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new pad, or %NULL to assign a default name.
// - dir PadDirection: the direction of the ghostpad
//
// The function returns the following values:
//
// - goret Pad
//
// Create a new ghostpad without a target with the given direction.
// A target can be set on the ghostpad later with the
// gst_ghost_pad_set_target() function.
//
// The created ghostpad will not have a padtemplate.
func NewGhostPadNoTarget(name string, dir PadDirection) Pad {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 C.GstPadDirection // in, none, casted
var cret *C.GstPad // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = C.GstPadDirection(dir)
cret = C.gst_ghost_pad_new_no_target(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(dir)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// NewGhostPadNoTargetFromTemplate wraps gst_ghost_pad_new_no_target_from_template
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new pad, or %NULL to assign a default name
// - templ PadTemplate: the #GstPadTemplate to create the ghostpad from.
//
// The function returns the following values:
//
// - goret Pad
//
// Create a new ghostpad based on @templ, without setting a target. The
// direction will be taken from the @templ.
func NewGhostPadNoTargetFromTemplate(name string, templ PadTemplate) Pad {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.GstPadTemplate // in, none, converted
var cret *C.GstPad // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
carg2 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
cret = C.gst_ghost_pad_new_no_target_from_template(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(templ)
var goret Pad
goret = UnsafePadFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GhostPadActivateModeDefault wraps gst_ghost_pad_activate_mode_default
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to activate or deactivate.
// - parent Object (nullable): the parent of @pad or %NULL
// - mode PadMode: the requested activation mode
// - active bool: whether the pad should be active or not.
//
// The function returns the following values:
//
// - goret bool
//
// Invoke the default activate mode function of a ghost pad.
func GhostPadActivateModeDefault(pad Pad, parent Object, mode PadMode, active bool) bool {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted, nullable
var carg3 C.GstPadMode // in, none, casted
var carg4 C.gboolean // in
var cret C.gboolean // return
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg3 = C.GstPadMode(mode)
if active {
carg4 = C.TRUE
}
cret = C.gst_ghost_pad_activate_mode_default(carg1, carg2, carg3, carg4)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(mode)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GhostPadInternalActivateModeDefault wraps gst_ghost_pad_internal_activate_mode_default
//
// The function takes the following parameters:
//
// - pad Pad: the #GstPad to activate or deactivate.
// - parent Object (nullable): the parent of @pad or %NULL
// - mode PadMode: the requested activation mode
// - active bool: whether the pad should be active or not.
//
// The function returns the following values:
//
// - goret bool
//
// Invoke the default activate mode function of a proxy pad that is
// owned by a ghost pad.
func GhostPadInternalActivateModeDefault(pad Pad, parent Object, mode PadMode, active bool) bool {
var carg1 *C.GstPad // in, none, converted
var carg2 *C.GstObject // in, none, converted, nullable
var carg3 C.GstPadMode // in, none, casted
var carg4 C.gboolean // in
var cret C.gboolean // return
carg1 = (*C.GstPad)(UnsafePadToGlibNone(pad))
if parent != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(parent))
}
carg3 = C.GstPadMode(mode)
if active {
carg4 = C.TRUE
}
cret = C.gst_ghost_pad_internal_activate_mode_default(carg1, carg2, carg3, carg4)
runtime.KeepAlive(pad)
runtime.KeepAlive(parent)
runtime.KeepAlive(mode)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Construct wraps gst_ghost_pad_construct
// The function returns the following values:
//
// - goret bool
//
// Finish initialization of a newly allocated ghost pad.
//
// This function is most useful in language bindings and when subclassing
// #GstGhostPad; plugin and application developers normally will not call this
// function. Call this function directly after a call to g_object_new
// (GST_TYPE_GHOST_PAD, "direction", @dir, ..., NULL).
//
// Deprecated: This function is deprecated since 1.18 and does nothing
// anymore.
func (gpad *GhostPadInstance) Construct() bool {
var carg0 *C.GstGhostPad // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstGhostPad)(UnsafeGhostPadToGlibNone(gpad))
cret = C.gst_ghost_pad_construct(carg0)
runtime.KeepAlive(gpad)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetTarget wraps gst_ghost_pad_get_target
// The function returns the following values:
//
// - goret Pad
//
// Get the target pad of @gpad. Unref target pad after usage.
func (gpad *GhostPadInstance) GetTarget() Pad {
var carg0 *C.GstGhostPad // in, none, converted
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstGhostPad)(UnsafeGhostPadToGlibNone(gpad))
cret = C.gst_ghost_pad_get_target(carg0)
runtime.KeepAlive(gpad)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// SetTarget wraps gst_ghost_pad_set_target
//
// The function takes the following parameters:
//
// - newtarget Pad (nullable): the new pad target
//
// The function returns the following values:
//
// - goret bool
//
// Set the new target of the ghostpad @gpad. Any existing target
// is unlinked and links to the new target are established. if @newtarget is
// %NULL the target will be cleared.
func (gpad *GhostPadInstance) SetTarget(newtarget Pad) bool {
var carg0 *C.GstGhostPad // in, none, converted
var carg1 *C.GstPad // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstGhostPad)(UnsafeGhostPadToGlibNone(gpad))
if newtarget != nil {
carg1 = (*C.GstPad)(UnsafePadToGlibNone(newtarget))
}
cret = C.gst_ghost_pad_set_target(carg0, carg1)
runtime.KeepAlive(gpad)
runtime.KeepAlive(newtarget)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SharedTaskPoolInstance is the instance type used by all types extending GstSharedTaskPool. It is used internally by the bindings. Users should use the interface [SharedTaskPool] instead.
type SharedTaskPoolInstance struct {
_ [0]func() // equal guard
TaskPoolInstance
}
var _ SharedTaskPool = (*SharedTaskPoolInstance)(nil)
// SharedTaskPool wraps GstSharedTaskPool
//
// The #GstSharedTaskPool object.
type SharedTaskPool interface {
TaskPool
upcastToGstSharedTaskPool() *SharedTaskPoolInstance
// GetMaxThreads wraps gst_shared_task_pool_get_max_threads
// The function returns the following values:
//
// - goret uint
GetMaxThreads() uint
// SetMaxThreads wraps gst_shared_task_pool_set_max_threads
//
// The function takes the following parameters:
//
// - maxThreads uint: Maximum number of threads to spawn.
//
// Update the maximal number of threads the @pool may spawn. When
// the maximal number of threads is reduced, existing threads are not
// immediately shut down, see g_thread_pool_set_max_threads().
//
// Setting @max_threads to 0 effectively freezes the pool.
SetMaxThreads(uint)
}
func unsafeWrapSharedTaskPool(base *gobject.ObjectInstance) *SharedTaskPoolInstance {
return &SharedTaskPoolInstance{
TaskPoolInstance: TaskPoolInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalSharedTaskPoolInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapSharedTaskPool(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeSharedTaskPoolFromGlibNone is used to convert raw GstSharedTaskPool pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeSharedTaskPoolFromGlibNone(c unsafe.Pointer) SharedTaskPool {
return gobject.UnsafeObjectFromGlibNone(c).(SharedTaskPool)
}
// UnsafeSharedTaskPoolFromGlibFull is used to convert raw GstSharedTaskPool pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeSharedTaskPoolFromGlibFull(c unsafe.Pointer) SharedTaskPool {
return gobject.UnsafeObjectFromGlibFull(c).(SharedTaskPool)
}
func (s *SharedTaskPoolInstance) upcastToGstSharedTaskPool() *SharedTaskPoolInstance {
return s
}
// UnsafeSharedTaskPoolToGlibNone is used to convert the instance to it's C value GstSharedTaskPool. This is used by the bindings internally.
func UnsafeSharedTaskPoolToGlibNone(c SharedTaskPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeSharedTaskPoolToGlibFull is used to convert the instance to it's C value GstSharedTaskPool, while removeing the finalizer. This is used by the bindings internally.
func UnsafeSharedTaskPoolToGlibFull(c SharedTaskPool) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewSharedTaskPool wraps gst_shared_task_pool_new
// The function returns the following values:
//
// - goret TaskPool
//
// Create a new shared task pool. The shared task pool will queue tasks on
// a maximum number of threads, 1 by default.
//
// Do not use a #GstSharedTaskPool to manage potentially inter-dependent tasks such
// as pad tasks, as having one task waiting on another to return before returning
// would cause obvious deadlocks if they happen to share the same thread.
func NewSharedTaskPool() TaskPool {
var cret *C.GstTaskPool // return, full, converted
cret = C.gst_shared_task_pool_new()
var goret TaskPool
goret = UnsafeTaskPoolFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetMaxThreads wraps gst_shared_task_pool_get_max_threads
// The function returns the following values:
//
// - goret uint
func (pool *SharedTaskPoolInstance) GetMaxThreads() uint {
var carg0 *C.GstSharedTaskPool // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstSharedTaskPool)(UnsafeSharedTaskPoolToGlibNone(pool))
cret = C.gst_shared_task_pool_get_max_threads(carg0)
runtime.KeepAlive(pool)
var goret uint
goret = uint(cret)
return goret
}
// SetMaxThreads wraps gst_shared_task_pool_set_max_threads
//
// The function takes the following parameters:
//
// - maxThreads uint: Maximum number of threads to spawn.
//
// Update the maximal number of threads the @pool may spawn. When
// the maximal number of threads is reduced, existing threads are not
// immediately shut down, see g_thread_pool_set_max_threads().
//
// Setting @max_threads to 0 effectively freezes the pool.
func (pool *SharedTaskPoolInstance) SetMaxThreads(maxThreads uint) {
var carg0 *C.GstSharedTaskPool // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstSharedTaskPool)(UnsafeSharedTaskPoolToGlibNone(pool))
carg1 = C.guint(maxThreads)
C.gst_shared_task_pool_set_max_threads(carg0, carg1)
runtime.KeepAlive(pool)
runtime.KeepAlive(maxThreads)
}
// SystemClockInstance is the instance type used by all types extending GstSystemClock. It is used internally by the bindings. Users should use the interface [SystemClock] instead.
type SystemClockInstance struct {
_ [0]func() // equal guard
ClockInstance
}
var _ SystemClock = (*SystemClockInstance)(nil)
// SystemClock wraps GstSystemClock
//
// The GStreamer core provides a GstSystemClock based on the system time.
// Asynchronous callbacks are scheduled from an internal thread.
//
// Clock implementors are encouraged to subclass this systemclock as it
// implements the async notification.
//
// Subclasses can however override all of the important methods for sync and
// async notifications to implement their own callback methods or blocking
// wait operations.
type SystemClock interface {
Clock
upcastToGstSystemClock() *SystemClockInstance
}
func unsafeWrapSystemClock(base *gobject.ObjectInstance) *SystemClockInstance {
return &SystemClockInstance{
ClockInstance: ClockInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
}
}
func marshalSystemClockInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapSystemClock(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeSystemClockFromGlibNone is used to convert raw GstSystemClock pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeSystemClockFromGlibNone(c unsafe.Pointer) SystemClock {
return gobject.UnsafeObjectFromGlibNone(c).(SystemClock)
}
// UnsafeSystemClockFromGlibFull is used to convert raw GstSystemClock pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeSystemClockFromGlibFull(c unsafe.Pointer) SystemClock {
return gobject.UnsafeObjectFromGlibFull(c).(SystemClock)
}
func (s *SystemClockInstance) upcastToGstSystemClock() *SystemClockInstance {
return s
}
// UnsafeSystemClockToGlibNone is used to convert the instance to it's C value GstSystemClock. This is used by the bindings internally.
func UnsafeSystemClockToGlibNone(c SystemClock) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeSystemClockToGlibFull is used to convert the instance to it's C value GstSystemClock, while removeing the finalizer. This is used by the bindings internally.
func UnsafeSystemClockToGlibFull(c SystemClock) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// SystemClockObtain wraps gst_system_clock_obtain
// The function returns the following values:
//
// - goret Clock
//
// Get a handle to the default system clock. The refcount of the
// clock will be increased so you need to unref the clock after
// usage.
func SystemClockObtain() Clock {
var cret *C.GstClock // return, full, converted
cret = C.gst_system_clock_obtain()
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// SystemClockSetDefault wraps gst_system_clock_set_default
//
// The function takes the following parameters:
//
// - newClock Clock (nullable): a #GstClock
//
// Sets the default system clock that can be obtained with
// gst_system_clock_obtain().
//
// This is mostly used for testing and debugging purposes when you
// want to have control over the time reported by the default system
// clock.
//
// MT safe.
func SystemClockSetDefault(newClock Clock) {
var carg1 *C.GstClock // in, none, converted, nullable
if newClock != nil {
carg1 = (*C.GstClock)(UnsafeClockToGlibNone(newClock))
}
C.gst_system_clock_set_default(carg1)
runtime.KeepAlive(newClock)
}
// BinInstance is the instance type used by all types extending GstBin. It is used internally by the bindings. Users should use the interface [Bin] instead.
type BinInstance struct {
_ [0]func() // equal guard
ElementInstance
// implemented interfaces:
ChildProxyInstance
}
var _ Bin = (*BinInstance)(nil)
// Bin wraps GstBin
//
// #GstBin is an element that can contain other #GstElement, allowing them to be
// managed as a group.
// Pads from the child elements can be ghosted to the bin, see #GstGhostPad.
// This makes the bin look like any other elements and enables creation of
// higher-level abstraction elements.
//
// A new #GstBin is created with gst_bin_new(). Use a #GstPipeline instead if you
// want to create a toplevel bin because a normal bin doesn't have a bus or
// handle clock distribution of its own.
//
// After the bin has been created you will typically add elements to it with
// gst_bin_add(). You can remove elements with gst_bin_remove().
//
// An element can be retrieved from a bin with gst_bin_get_by_name(), using the
// elements name. gst_bin_get_by_name_recurse_up() is mainly used for internal
// purposes and will query the parent bins when the element is not found in the
// current bin.
//
// An iterator of elements in a bin can be retrieved with
// gst_bin_iterate_elements(). Various other iterators exist to retrieve the
// elements in a bin.
//
// gst_object_unref() is used to drop your reference to the bin.
//
// The #GstBin::element-added signal is fired whenever a new element is added to
// the bin. Likewise the #GstBin::element-removed signal is fired whenever an
// element is removed from the bin.
//
// A #GstBin internally intercepts every #GstMessage posted by its children and
// implements the following default behaviour for each of them:
//
// * %GST_MESSAGE_EOS: This message is only posted by sinks in the PLAYING
// state. If all sinks posted the EOS message, this bin will post and EOS
// message upwards.
//
// * %GST_MESSAGE_SEGMENT_START: Just collected and never forwarded upwards.
// The messages are used to decide when all elements have completed playback
// of their segment.
//
// * %GST_MESSAGE_SEGMENT_DONE: Is posted by #GstBin when all elements that posted
// a SEGMENT_START have posted a SEGMENT_DONE.
//
// * %GST_MESSAGE_DURATION_CHANGED: Is posted by an element that detected a change
// in the stream duration. The duration change is posted to the
// application so that it can refetch the new duration with a duration
// query.
//
// Note that these messages can be posted before the bin is prerolled, in which
// case the duration query might fail.
//
// Note also that there might be a discrepancy (due to internal buffering/queueing)
// between the stream being currently displayed and the returned duration query.
//
// Applications might want to also query for duration (and changes) by
// listening to the %GST_MESSAGE_STREAM_START message, signaling the active start
// of a (new) stream.
//
// * %GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it
// can no longer provide a clock.
//
// The default bin behaviour is to check if the lost clock was the one provided
// by the bin. If so and the bin is currently in the PLAYING state, the message
// is forwarded to the bin parent.
//
// This message is also generated when a clock provider is removed from
// the bin. If this message is received by the application, it should
// PAUSE the pipeline and set it back to PLAYING to force a new clock
// distribution.
//
// * %GST_MESSAGE_CLOCK_PROVIDE: This message is generated when an element
// can provide a clock. This mostly happens when a new clock
// provider is added to the bin.
//
// The default behaviour of the bin is to mark the currently selected clock as
// dirty, which will perform a clock recalculation the next time the bin is
// asked to provide a clock.
//
// This message is never sent to the application but is forwarded to
// the parent of the bin.
//
// * OTHERS: posted upwards.
//
// A #GstBin implements the following default behaviour for answering to a
// #GstQuery:
//
// * %GST_QUERY_DURATION: The bin will forward the query to all sink
// elements contained within and will return the maximum value.
// If no sinks are available in the bin, the query fails.
//
// * %GST_QUERY_POSITION: The query is sent to all sink elements in the bin and the
// MAXIMUM of all values is returned. If no sinks are available in the bin,
// the query fails.
//
// * OTHERS: the query is forwarded to all sink elements, the result
// of the first sink that answers the query successfully is returned. If no
// sink is in the bin, the query fails.
//
// A #GstBin will by default forward any event sent to it to all sink
// ( %GST_EVENT_TYPE_UPSTREAM ) or source ( %GST_EVENT_TYPE_DOWNSTREAM ) elements
// depending on the event type.
//
// If all the elements return %TRUE, the bin will also return %TRUE, else %FALSE
// is returned. If no elements of the required type are in the bin, the event
// handler will return %TRUE.
type Bin interface {
BinExtManual // handwritten functions
Element
ChildProxy
upcastToGstBin() *BinInstance
// Add wraps gst_bin_add
//
// The function takes the following parameters:
//
// - element Element: the #GstElement to add
//
// The function returns the following values:
//
// - goret bool
//
// Adds the given element to the bin. Sets the element's parent, and thus
// takes ownership of the element. An element can only be added to one bin.
//
// If the element's pads are linked to other pads, the pads will be unlinked
// before the element is added to the bin.
//
// &gt; When you add an element to an already-running pipeline, you will have to
// &gt; take care to set the state of the newly-added element to the desired
// &gt; state (usually PLAYING or PAUSED, same you set the pipeline to originally)
// &gt; with gst_element_set_state(), or use gst_element_sync_state_with_parent().
// &gt; The bin or pipeline will not take care of this for you.
Add(Element) bool
// FindUnlinkedPad wraps gst_bin_find_unlinked_pad
//
// The function takes the following parameters:
//
// - direction PadDirection: whether to look for an unlinked source or sink pad
//
// The function returns the following values:
//
// - goret Pad
//
// Recursively looks for elements with an unlinked pad of the given
// direction within the specified bin and returns an unlinked pad
// if one is found, or %NULL otherwise. If a pad is found, the caller
// owns a reference to it and should use gst_object_unref() on the
// pad when it is not needed any longer.
FindUnlinkedPad(PadDirection) Pad
// GetByInterface wraps gst_bin_get_by_interface
//
// The function takes the following parameters:
//
// - iface gobject.Type: the #GType of an interface
//
// The function returns the following values:
//
// - goret Element
//
// Looks for an element inside the bin that implements the given
// interface. If such an element is found, it returns the element.
// You can cast this element to the given interface afterwards. If you want
// all elements that implement the interface, use
// gst_bin_iterate_all_by_interface(). This function recurses into child bins.
GetByInterface(gobject.Type) Element
// GetByName wraps gst_bin_get_by_name
//
// The function takes the following parameters:
//
// - name string: the element name to search for
//
// The function returns the following values:
//
// - goret Element
//
// Gets the element with the given name from a bin. This
// function recurses into child bins.
GetByName(string) Element
// GetByNameRecurseUp wraps gst_bin_get_by_name_recurse_up
//
// The function takes the following parameters:
//
// - name string: the element name to search for
//
// The function returns the following values:
//
// - goret Element
//
// Gets the element with the given name from this bin. If the
// element is not found, a recursion is performed on the parent bin.
GetByNameRecurseUp(string) Element
// GetSuppressedFlags wraps gst_bin_get_suppressed_flags
// The function returns the following values:
//
// - goret ElementFlags
GetSuppressedFlags() ElementFlags
// IterateAllByElementFactoryName wraps gst_bin_iterate_all_by_element_factory_name
//
// The function takes the following parameters:
//
// - factoryName string: the name of the #GstElementFactory
//
// The function returns the following values:
//
// - goret *Iterator
//
// Looks for all elements inside the bin with the given element factory name.
// The function recurses inside child bins. The iterator will yield a series of
// #GstElement.
IterateAllByElementFactoryName(string) *Iterator
// IterateAllByInterface wraps gst_bin_iterate_all_by_interface
//
// The function takes the following parameters:
//
// - iface gobject.Type: the #GType of an interface
//
// The function returns the following values:
//
// - goret *Iterator
//
// Looks for all elements inside the bin that implements the given
// interface. You can safely cast all returned elements to the given interface.
// The function recurses inside child bins. The iterator will yield a series
// of #GstElement.
IterateAllByInterface(gobject.Type) *Iterator
// IterateElements wraps gst_bin_iterate_elements
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin.
IterateElements() *Iterator
// IterateRecurse wraps gst_bin_iterate_recurse
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin.
// This iterator recurses into GstBin children.
IterateRecurse() *Iterator
// IterateSinks wraps gst_bin_iterate_sinks
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for all elements in the bin that have the
// #GST_ELEMENT_FLAG_SINK flag set.
IterateSinks() *Iterator
// IterateSorted wraps gst_bin_iterate_sorted
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin in topologically
// sorted order. This means that the elements are returned from
// the most downstream elements (sinks) to the sources.
//
// This function is used internally to perform the state changes
// of the bin elements and for clock selection.
IterateSorted() *Iterator
// IterateSources wraps gst_bin_iterate_sources
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for all elements in the bin that have the
// #GST_ELEMENT_FLAG_SOURCE flag set.
IterateSources() *Iterator
// RecalculateLatency wraps gst_bin_recalculate_latency
// The function returns the following values:
//
// - goret bool
//
// Queries @bin for the current latency and reconfigures this latency on all the
// elements using a LATENCY event.
//
// This method is typically called on the pipeline when a #GST_MESSAGE_LATENCY
// is posted on the bus.
//
// This function simply emits the #GstBin::do-latency signal so any custom latency
// calculations will be performed.
RecalculateLatency() bool
// Remove wraps gst_bin_remove
//
// The function takes the following parameters:
//
// - element Element: the #GstElement to remove
//
// The function returns the following values:
//
// - goret bool
//
// Removes the element from the bin, unparenting it as well.
// Unparenting the element means that the element will be dereferenced,
// so if the bin holds the only reference to the element, the element
// will be freed in the process of removing it from the bin. If you
// want the element to still exist after removing, you need to call
// gst_object_ref() before removing it from the bin.
//
// If the element's pads are linked to other pads, the pads will be unlinked
// before the element is removed from the bin.
Remove(Element) bool
// SetSuppressedFlags wraps gst_bin_set_suppressed_flags
//
// The function takes the following parameters:
//
// - flags ElementFlags: the #GstElementFlags to suppress
//
// Suppresses the given flags on the bin. #GstElementFlags of a
// child element are propagated when it is added to the bin.
// When suppressed flags are set, those specified flags will
// not be propagated to the bin.
SetSuppressedFlags(ElementFlags)
// SyncChildrenStates wraps gst_bin_sync_children_states
// The function returns the following values:
//
// - goret bool
//
// Synchronizes the state of every child of @bin with the state
// of @bin. See also gst_element_sync_state_with_parent().
SyncChildrenStates() bool
}
func unsafeWrapBin(base *gobject.ObjectInstance) *BinInstance {
return &BinInstance{
ElementInstance: ElementInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
ChildProxyInstance: ChildProxyInstance{
Instance: *base,
},
}
}
func marshalBinInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapBin(gobject.ValueFromNative(p).Object()), nil
}
// UnsafeBinFromGlibNone is used to convert raw GstBin pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafeBinFromGlibNone(c unsafe.Pointer) Bin {
return gobject.UnsafeObjectFromGlibNone(c).(Bin)
}
// UnsafeBinFromGlibFull is used to convert raw GstBin pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafeBinFromGlibFull(c unsafe.Pointer) Bin {
return gobject.UnsafeObjectFromGlibFull(c).(Bin)
}
func (b *BinInstance) upcastToGstBin() *BinInstance {
return b
}
// UnsafeBinToGlibNone is used to convert the instance to it's C value GstBin. This is used by the bindings internally.
func UnsafeBinToGlibNone(c Bin) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafeBinToGlibFull is used to convert the instance to it's C value GstBin, while removeing the finalizer. This is used by the bindings internally.
func UnsafeBinToGlibFull(c Bin) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewBin wraps gst_bin_new
//
// The function takes the following parameters:
//
// - name string (nullable): the name of the new bin
//
// The function returns the following values:
//
// - goret Element
//
// Creates a new bin with the given name.
func NewBin(name string) Element {
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_bin_new(carg1)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// Add wraps gst_bin_add
//
// The function takes the following parameters:
//
// - element Element: the #GstElement to add
//
// The function returns the following values:
//
// - goret bool
//
// Adds the given element to the bin. Sets the element's parent, and thus
// takes ownership of the element. An element can only be added to one bin.
//
// If the element's pads are linked to other pads, the pads will be unlinked
// before the element is added to the bin.
//
// &gt; When you add an element to an already-running pipeline, you will have to
// &gt; take care to set the state of the newly-added element to the desired
// &gt; state (usually PLAYING or PAUSED, same you set the pipeline to originally)
// &gt; with gst_element_set_state(), or use gst_element_sync_state_with_parent().
// &gt; The bin or pipeline will not take care of this for you.
func (bin *BinInstance) Add(element Element) bool {
var carg0 *C.GstBin // in, none, converted
var carg1 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_bin_add(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(element)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FindUnlinkedPad wraps gst_bin_find_unlinked_pad
//
// The function takes the following parameters:
//
// - direction PadDirection: whether to look for an unlinked source or sink pad
//
// The function returns the following values:
//
// - goret Pad
//
// Recursively looks for elements with an unlinked pad of the given
// direction within the specified bin and returns an unlinked pad
// if one is found, or %NULL otherwise. If a pad is found, the caller
// owns a reference to it and should use gst_object_unref() on the
// pad when it is not needed any longer.
func (bin *BinInstance) FindUnlinkedPad(direction PadDirection) Pad {
var carg0 *C.GstBin // in, none, converted
var carg1 C.GstPadDirection // in, none, casted
var cret *C.GstPad // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = C.GstPadDirection(direction)
cret = C.gst_bin_find_unlinked_pad(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(direction)
var goret Pad
goret = UnsafePadFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetByInterface wraps gst_bin_get_by_interface
//
// The function takes the following parameters:
//
// - iface gobject.Type: the #GType of an interface
//
// The function returns the following values:
//
// - goret Element
//
// Looks for an element inside the bin that implements the given
// interface. If such an element is found, it returns the element.
// You can cast this element to the given interface afterwards. If you want
// all elements that implement the interface, use
// gst_bin_iterate_all_by_interface(). This function recurses into child bins.
func (bin *BinInstance) GetByInterface(iface gobject.Type) Element {
var carg0 *C.GstBin // in, none, converted
var carg1 C.GType // in, none, casted, alias
var cret *C.GstElement // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = C.GType(iface)
cret = C.gst_bin_get_by_interface(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(iface)
var goret Element
goret = UnsafeElementFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetByName wraps gst_bin_get_by_name
//
// The function takes the following parameters:
//
// - name string: the element name to search for
//
// The function returns the following values:
//
// - goret Element
//
// Gets the element with the given name from a bin. This
// function recurses into child bins.
func (bin *BinInstance) GetByName(name string) Element {
var carg0 *C.GstBin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstElement // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_bin_get_by_name(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetByNameRecurseUp wraps gst_bin_get_by_name_recurse_up
//
// The function takes the following parameters:
//
// - name string: the element name to search for
//
// The function returns the following values:
//
// - goret Element
//
// Gets the element with the given name from this bin. If the
// element is not found, a recursion is performed on the parent bin.
func (bin *BinInstance) GetByNameRecurseUp(name string) Element {
var carg0 *C.GstBin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstElement // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_bin_get_by_name_recurse_up(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetSuppressedFlags wraps gst_bin_get_suppressed_flags
// The function returns the following values:
//
// - goret ElementFlags
func (bin *BinInstance) GetSuppressedFlags() ElementFlags {
var carg0 *C.GstBin // in, none, converted
var cret C.GstElementFlags // return, none, casted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_get_suppressed_flags(carg0)
runtime.KeepAlive(bin)
var goret ElementFlags
goret = ElementFlags(cret)
return goret
}
// IterateAllByElementFactoryName wraps gst_bin_iterate_all_by_element_factory_name
//
// The function takes the following parameters:
//
// - factoryName string: the name of the #GstElementFactory
//
// The function returns the following values:
//
// - goret *Iterator
//
// Looks for all elements inside the bin with the given element factory name.
// The function recurses inside child bins. The iterator will yield a series of
// #GstElement.
func (bin *BinInstance) IterateAllByElementFactoryName(factoryName string) *Iterator {
var carg0 *C.GstBin // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(factoryName)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_bin_iterate_all_by_element_factory_name(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(factoryName)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateAllByInterface wraps gst_bin_iterate_all_by_interface
//
// The function takes the following parameters:
//
// - iface gobject.Type: the #GType of an interface
//
// The function returns the following values:
//
// - goret *Iterator
//
// Looks for all elements inside the bin that implements the given
// interface. You can safely cast all returned elements to the given interface.
// The function recurses inside child bins. The iterator will yield a series
// of #GstElement.
func (bin *BinInstance) IterateAllByInterface(iface gobject.Type) *Iterator {
var carg0 *C.GstBin // in, none, converted
var carg1 C.GType // in, none, casted, alias
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = C.GType(iface)
cret = C.gst_bin_iterate_all_by_interface(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(iface)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateElements wraps gst_bin_iterate_elements
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin.
func (bin *BinInstance) IterateElements() *Iterator {
var carg0 *C.GstBin // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_iterate_elements(carg0)
runtime.KeepAlive(bin)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateRecurse wraps gst_bin_iterate_recurse
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin.
// This iterator recurses into GstBin children.
func (bin *BinInstance) IterateRecurse() *Iterator {
var carg0 *C.GstBin // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_iterate_recurse(carg0)
runtime.KeepAlive(bin)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateSinks wraps gst_bin_iterate_sinks
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for all elements in the bin that have the
// #GST_ELEMENT_FLAG_SINK flag set.
func (bin *BinInstance) IterateSinks() *Iterator {
var carg0 *C.GstBin // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_iterate_sinks(carg0)
runtime.KeepAlive(bin)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateSorted wraps gst_bin_iterate_sorted
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for the elements in this bin in topologically
// sorted order. This means that the elements are returned from
// the most downstream elements (sinks) to the sources.
//
// This function is used internally to perform the state changes
// of the bin elements and for clock selection.
func (bin *BinInstance) IterateSorted() *Iterator {
var carg0 *C.GstBin // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_iterate_sorted(carg0)
runtime.KeepAlive(bin)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IterateSources wraps gst_bin_iterate_sources
// The function returns the following values:
//
// - goret *Iterator
//
// Gets an iterator for all elements in the bin that have the
// #GST_ELEMENT_FLAG_SOURCE flag set.
func (bin *BinInstance) IterateSources() *Iterator {
var carg0 *C.GstBin // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_iterate_sources(carg0)
runtime.KeepAlive(bin)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// RecalculateLatency wraps gst_bin_recalculate_latency
// The function returns the following values:
//
// - goret bool
//
// Queries @bin for the current latency and reconfigures this latency on all the
// elements using a LATENCY event.
//
// This method is typically called on the pipeline when a #GST_MESSAGE_LATENCY
// is posted on the bus.
//
// This function simply emits the #GstBin::do-latency signal so any custom latency
// calculations will be performed.
func (bin *BinInstance) RecalculateLatency() bool {
var carg0 *C.GstBin // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_recalculate_latency(carg0)
runtime.KeepAlive(bin)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Remove wraps gst_bin_remove
//
// The function takes the following parameters:
//
// - element Element: the #GstElement to remove
//
// The function returns the following values:
//
// - goret bool
//
// Removes the element from the bin, unparenting it as well.
// Unparenting the element means that the element will be dereferenced,
// so if the bin holds the only reference to the element, the element
// will be freed in the process of removing it from the bin. If you
// want the element to still exist after removing, you need to call
// gst_object_ref() before removing it from the bin.
//
// If the element's pads are linked to other pads, the pads will be unlinked
// before the element is removed from the bin.
func (bin *BinInstance) Remove(element Element) bool {
var carg0 *C.GstBin // in, none, converted
var carg1 *C.GstElement // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = (*C.GstElement)(UnsafeElementToGlibNone(element))
cret = C.gst_bin_remove(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(element)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetSuppressedFlags wraps gst_bin_set_suppressed_flags
//
// The function takes the following parameters:
//
// - flags ElementFlags: the #GstElementFlags to suppress
//
// Suppresses the given flags on the bin. #GstElementFlags of a
// child element are propagated when it is added to the bin.
// When suppressed flags are set, those specified flags will
// not be propagated to the bin.
func (bin *BinInstance) SetSuppressedFlags(flags ElementFlags) {
var carg0 *C.GstBin // in, none, converted
var carg1 C.GstElementFlags // in, none, casted
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
carg1 = C.GstElementFlags(flags)
C.gst_bin_set_suppressed_flags(carg0, carg1)
runtime.KeepAlive(bin)
runtime.KeepAlive(flags)
}
// SyncChildrenStates wraps gst_bin_sync_children_states
// The function returns the following values:
//
// - goret bool
//
// Synchronizes the state of every child of @bin with the state
// of @bin. See also gst_element_sync_state_with_parent().
func (bin *BinInstance) SyncChildrenStates() bool {
var carg0 *C.GstBin // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBin)(UnsafeBinToGlibNone(bin))
cret = C.gst_bin_sync_children_states(carg0)
runtime.KeepAlive(bin)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// 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
BinInstance
}
var _ Pipeline = (*PipelineInstance)(nil)
// Pipeline wraps GstPipeline
//
// A #GstPipeline is a special #GstBin used as the toplevel container for
// the filter graph. The #GstPipeline will manage the selection and
// distribution of a global #GstClock as well as provide a #GstBus to the
// application.
//
// gst_pipeline_new() is used to create a pipeline. when you are done with
// the pipeline, use gst_object_unref() to free its resources including all
// added #GstElement objects (if not otherwise referenced).
//
// Elements are added and removed from the pipeline using the #GstBin
// methods like gst_bin_add() and gst_bin_remove() (see #GstBin).
//
// Before changing the state of the #GstPipeline (see #GstElement) a #GstBus
// should be retrieved with gst_pipeline_get_bus(). This #GstBus should then
// be used to receive #GstMessage from the elements in the pipeline. Listening
// to the #GstBus is necessary for retrieving error messages from the
// #GstPipeline and otherwise the #GstPipeline might stop without any
// indication, why. Furthermore, the #GstPipeline posts messages even if
// nobody listens on the #GstBus, which will pile up and use up memory.
//
// By default, a #GstPipeline will automatically flush the pending #GstBus
// messages when going to the NULL state to ensure that no circular
// references exist when no messages are read from the #GstBus. This
// behaviour can be changed with gst_pipeline_set_auto_flush_bus().
//
// When the #GstPipeline performs the PAUSED to PLAYING state change it will
// select a clock for the elements. The clock selection algorithm will by
// default select a clock provided by an element that is most upstream
// (closest to the source). For live pipelines (ones that return
// #GST_STATE_CHANGE_NO_PREROLL from the gst_element_set_state() call) this
// will select the clock provided by the live source. For normal pipelines
// this will select a clock provided by the sinks (most likely the audio
// sink). If no element provides a clock, a default #GstSystemClock is used.
//
// The clock selection can be controlled with the gst_pipeline_use_clock()
// method, which will enforce a given clock on the pipeline. With
// gst_pipeline_auto_clock() the default clock selection algorithm can be
// restored.
//
// A #GstPipeline maintains a running time for the elements. The running
// time is defined as the difference between the current clock time and
// the base time. When the pipeline goes to READY or a flushing seek is
// performed on it, the running time is reset to 0. When the pipeline is
// set from PLAYING to PAUSED, the current clock time is sampled and used to
// configure the base time for the elements when the pipeline is set
// to PLAYING again. The effect is that the running time (as the difference
// between the clock time and the base time) will count how much time was spent
// in the PLAYING state. This default behaviour can be changed with the
// gst_element_set_start_time() method.
type Pipeline interface {
Bin
upcastToGstPipeline() *PipelineInstance
// AutoClock wraps gst_pipeline_auto_clock
//
// Let @pipeline select a clock automatically. This is the default
// behaviour.
//
// Use this function if you previous forced a fixed clock with
// gst_pipeline_use_clock() and want to restore the default
// pipeline clock selection algorithm.
//
// MT safe.
AutoClock()
// GetAutoFlushBus wraps gst_pipeline_get_auto_flush_bus
// The function returns the following values:
//
// - goret bool
//
// Check if @pipeline will automatically flush messages when going to
// the NULL state.
GetAutoFlushBus() bool
// GetBus wraps gst_pipeline_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of @pipeline. The bus allows applications to receive
// #GstMessage packets.
GetBus() Bus
// GetConfiguredLatency wraps gst_pipeline_get_configured_latency
// The function returns the following values:
//
// - goret ClockTime
//
// Return the configured latency on @pipeline.
GetConfiguredLatency() ClockTime
// GetDelay wraps gst_pipeline_get_delay
// The function returns the following values:
//
// - goret ClockTime
//
// Get the configured delay (see gst_pipeline_set_delay()).
GetDelay() ClockTime
// GetLatency wraps gst_pipeline_get_latency
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the latency that should be configured on the pipeline. See
// gst_pipeline_set_latency().
GetLatency() ClockTime
// GetPipelineClock wraps gst_pipeline_get_pipeline_clock
// The function returns the following values:
//
// - goret Clock
//
// Gets the current clock used by @pipeline.
//
// Unlike gst_element_get_clock(), this function will always return a
// clock, even if the pipeline is not in the PLAYING state.
GetPipelineClock() Clock
// IsLive wraps gst_pipeline_is_live
// The function returns the following values:
//
// - goret bool
//
// Check if @pipeline is live.
IsLive() bool
// SetAutoFlushBus wraps gst_pipeline_set_auto_flush_bus
//
// The function takes the following parameters:
//
// - autoFlush bool: whether or not to automatically flush the bus when
// the pipeline goes from READY to NULL state
//
// Usually, when a pipeline goes from READY to NULL state, it automatically
// flushes all pending messages on the bus, which is done for refcounting
// purposes, to break circular references.
//
// This means that applications that update state using (async) bus messages
// (e.g. do certain things when a pipeline goes from PAUSED to READY) might
// not get to see messages when the pipeline is shut down, because they might
// be flushed before they can be dispatched in the main thread. This behaviour
// can be disabled using this function.
//
// It is important that all messages on the bus are handled when the
// automatic flushing is disabled else memory leaks will be introduced.
//
// MT safe.
SetAutoFlushBus(bool)
// SetDelay wraps gst_pipeline_set_delay
//
// The function takes the following parameters:
//
// - delay ClockTime: the delay
//
// Set the expected delay needed for all elements to perform the
// PAUSED to PLAYING state change. @delay will be added to the
// base time of the elements so that they wait an additional @delay
// amount of time before starting to process buffers and cannot be
// #GST_CLOCK_TIME_NONE.
//
// This option is used for tuning purposes and should normally not be
// used.
//
// MT safe.
SetDelay(ClockTime)
// SetLatency wraps gst_pipeline_set_latency
//
// The function takes the following parameters:
//
// - latency ClockTime: latency to configure
//
// Sets the latency that should be configured on the pipeline. Setting
// GST_CLOCK_TIME_NONE will restore the default behaviour of using the minimum
// latency from the LATENCY query. Setting this is usually not required and
// the pipeline will figure out an appropriate latency automatically.
//
// Setting a too low latency, especially lower than the minimum latency from
// the LATENCY query, will most likely cause the pipeline to fail.
SetLatency(ClockTime)
// UseClock wraps gst_pipeline_use_clock
//
// The function takes the following parameters:
//
// - clock Clock (nullable): the clock to use
//
// Force @pipeline to use the given @clock. The pipeline will
// always use the given clock even if new clock providers are added
// to this pipeline.
//
// If @clock is %NULL all clocking will be disabled which will make
// the pipeline run as fast as possible.
//
// MT safe.
UseClock(Clock)
}
func unsafeWrapPipeline(base *gobject.ObjectInstance) *PipelineInstance {
return &PipelineInstance{
BinInstance: BinInstance{
ElementInstance: ElementInstance{
ObjectInstance: ObjectInstance{
InitiallyUnownedInstance: gobject.InitiallyUnownedInstance{
ObjectInstance: *base,
},
},
},
ChildProxyInstance: ChildProxyInstance{
Instance: *base,
},
},
}
}
func marshalPipelineInstance(p unsafe.Pointer) (any, error) {
return unsafeWrapPipeline(gobject.ValueFromNative(p).Object()), nil
}
// UnsafePipelineFromGlibNone is used to convert raw GstPipeline pointers to go while taking a reference and attaching a finalizer. This is used by the bindings internally.
func UnsafePipelineFromGlibNone(c unsafe.Pointer) Pipeline {
return gobject.UnsafeObjectFromGlibNone(c).(Pipeline)
}
// UnsafePipelineFromGlibFull is used to convert raw GstPipeline pointers to go while attaching a finalizer. This is used by the bindings internally.
func UnsafePipelineFromGlibFull(c unsafe.Pointer) Pipeline {
return gobject.UnsafeObjectFromGlibFull(c).(Pipeline)
}
func (p *PipelineInstance) upcastToGstPipeline() *PipelineInstance {
return p
}
// UnsafePipelineToGlibNone is used to convert the instance to it's C value GstPipeline. This is used by the bindings internally.
func UnsafePipelineToGlibNone(c Pipeline) unsafe.Pointer {
return gobject.UnsafeObjectToGlibNone(c)
}
// UnsafePipelineToGlibFull is used to convert the instance to it's C value GstPipeline, while removeing the finalizer. This is used by the bindings internally.
func UnsafePipelineToGlibFull(c Pipeline) unsafe.Pointer {
return gobject.UnsafeObjectToGlibFull(c)
}
// NewPipeline wraps gst_pipeline_new
//
// The function takes the following parameters:
//
// - name string (nullable): name of new pipeline
//
// The function returns the following values:
//
// - goret Element
//
// Create a new pipeline with the given name.
func NewPipeline(name string) Element {
var carg1 *C.gchar // in, none, string, nullable-string
var cret *C.GstElement // return, none, converted
if name != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_pipeline_new(carg1)
runtime.KeepAlive(name)
var goret Element
goret = UnsafeElementFromGlibNone(unsafe.Pointer(cret))
return goret
}
// AutoClock wraps gst_pipeline_auto_clock
//
// Let @pipeline select a clock automatically. This is the default
// behaviour.
//
// Use this function if you previous forced a fixed clock with
// gst_pipeline_use_clock() and want to restore the default
// pipeline clock selection algorithm.
//
// MT safe.
func (pipeline *PipelineInstance) AutoClock() {
var carg0 *C.GstPipeline // in, none, converted
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
C.gst_pipeline_auto_clock(carg0)
runtime.KeepAlive(pipeline)
}
// GetAutoFlushBus wraps gst_pipeline_get_auto_flush_bus
// The function returns the following values:
//
// - goret bool
//
// Check if @pipeline will automatically flush messages when going to
// the NULL state.
func (pipeline *PipelineInstance) GetAutoFlushBus() bool {
var carg0 *C.GstPipeline // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_auto_flush_bus(carg0)
runtime.KeepAlive(pipeline)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetBus wraps gst_pipeline_get_bus
// The function returns the following values:
//
// - goret Bus
//
// Gets the #GstBus of @pipeline. The bus allows applications to receive
// #GstMessage packets.
func (pipeline *PipelineInstance) GetBus() Bus {
var carg0 *C.GstPipeline // in, none, converted
var cret *C.GstBus // return, full, converted
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_bus(carg0)
runtime.KeepAlive(pipeline)
var goret Bus
goret = UnsafeBusFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetConfiguredLatency wraps gst_pipeline_get_configured_latency
// The function returns the following values:
//
// - goret ClockTime
//
// Return the configured latency on @pipeline.
func (pipeline *PipelineInstance) GetConfiguredLatency() ClockTime {
var carg0 *C.GstPipeline // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_configured_latency(carg0)
runtime.KeepAlive(pipeline)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetDelay wraps gst_pipeline_get_delay
// The function returns the following values:
//
// - goret ClockTime
//
// Get the configured delay (see gst_pipeline_set_delay()).
func (pipeline *PipelineInstance) GetDelay() ClockTime {
var carg0 *C.GstPipeline // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_delay(carg0)
runtime.KeepAlive(pipeline)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetLatency wraps gst_pipeline_get_latency
// The function returns the following values:
//
// - goret ClockTime
//
// Gets the latency that should be configured on the pipeline. See
// gst_pipeline_set_latency().
func (pipeline *PipelineInstance) GetLatency() ClockTime {
var carg0 *C.GstPipeline // in, none, converted
var cret C.GstClockTime // return, none, casted, alias
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_latency(carg0)
runtime.KeepAlive(pipeline)
var goret ClockTime
goret = ClockTime(cret)
return goret
}
// GetPipelineClock wraps gst_pipeline_get_pipeline_clock
// The function returns the following values:
//
// - goret Clock
//
// Gets the current clock used by @pipeline.
//
// Unlike gst_element_get_clock(), this function will always return a
// clock, even if the pipeline is not in the PLAYING state.
func (pipeline *PipelineInstance) GetPipelineClock() Clock {
var carg0 *C.GstPipeline // in, none, converted
var cret *C.GstClock // return, full, converted
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_get_pipeline_clock(carg0)
runtime.KeepAlive(pipeline)
var goret Clock
goret = UnsafeClockFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IsLive wraps gst_pipeline_is_live
// The function returns the following values:
//
// - goret bool
//
// Check if @pipeline is live.
func (pipeline *PipelineInstance) IsLive() bool {
var carg0 *C.GstPipeline // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
cret = C.gst_pipeline_is_live(carg0)
runtime.KeepAlive(pipeline)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetAutoFlushBus wraps gst_pipeline_set_auto_flush_bus
//
// The function takes the following parameters:
//
// - autoFlush bool: whether or not to automatically flush the bus when
// the pipeline goes from READY to NULL state
//
// Usually, when a pipeline goes from READY to NULL state, it automatically
// flushes all pending messages on the bus, which is done for refcounting
// purposes, to break circular references.
//
// This means that applications that update state using (async) bus messages
// (e.g. do certain things when a pipeline goes from PAUSED to READY) might
// not get to see messages when the pipeline is shut down, because they might
// be flushed before they can be dispatched in the main thread. This behaviour
// can be disabled using this function.
//
// It is important that all messages on the bus are handled when the
// automatic flushing is disabled else memory leaks will be introduced.
//
// MT safe.
func (pipeline *PipelineInstance) SetAutoFlushBus(autoFlush bool) {
var carg0 *C.GstPipeline // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
if autoFlush {
carg1 = C.TRUE
}
C.gst_pipeline_set_auto_flush_bus(carg0, carg1)
runtime.KeepAlive(pipeline)
runtime.KeepAlive(autoFlush)
}
// SetDelay wraps gst_pipeline_set_delay
//
// The function takes the following parameters:
//
// - delay ClockTime: the delay
//
// Set the expected delay needed for all elements to perform the
// PAUSED to PLAYING state change. @delay will be added to the
// base time of the elements so that they wait an additional @delay
// amount of time before starting to process buffers and cannot be
// #GST_CLOCK_TIME_NONE.
//
// This option is used for tuning purposes and should normally not be
// used.
//
// MT safe.
func (pipeline *PipelineInstance) SetDelay(delay ClockTime) {
var carg0 *C.GstPipeline // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
carg1 = C.GstClockTime(delay)
C.gst_pipeline_set_delay(carg0, carg1)
runtime.KeepAlive(pipeline)
runtime.KeepAlive(delay)
}
// SetLatency wraps gst_pipeline_set_latency
//
// The function takes the following parameters:
//
// - latency ClockTime: latency to configure
//
// Sets the latency that should be configured on the pipeline. Setting
// GST_CLOCK_TIME_NONE will restore the default behaviour of using the minimum
// latency from the LATENCY query. Setting this is usually not required and
// the pipeline will figure out an appropriate latency automatically.
//
// Setting a too low latency, especially lower than the minimum latency from
// the LATENCY query, will most likely cause the pipeline to fail.
func (pipeline *PipelineInstance) SetLatency(latency ClockTime) {
var carg0 *C.GstPipeline // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
carg1 = C.GstClockTime(latency)
C.gst_pipeline_set_latency(carg0, carg1)
runtime.KeepAlive(pipeline)
runtime.KeepAlive(latency)
}
// UseClock wraps gst_pipeline_use_clock
//
// The function takes the following parameters:
//
// - clock Clock (nullable): the clock to use
//
// Force @pipeline to use the given @clock. The pipeline will
// always use the given clock even if new clock providers are added
// to this pipeline.
//
// If @clock is %NULL all clocking will be disabled which will make
// the pipeline run as fast as possible.
//
// MT safe.
func (pipeline *PipelineInstance) UseClock(clock Clock) {
var carg0 *C.GstPipeline // in, none, converted
var carg1 *C.GstClock // in, none, converted, nullable
carg0 = (*C.GstPipeline)(UnsafePipelineToGlibNone(pipeline))
if clock != nil {
carg1 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
}
C.gst_pipeline_use_clock(carg0, carg1)
runtime.KeepAlive(pipeline)
runtime.KeepAlive(clock)
}
// AllocationParams wraps GstAllocationParams
//
// Parameters to control the allocation of memory
type AllocationParams struct {
*allocationParams
}
// allocationParams is the struct that's finalized
type allocationParams struct {
native *C.GstAllocationParams
}
var _ gobject.GoValueInitializer = (*AllocationParams)(nil)
func marshalAllocationParams(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeAllocationParamsFromGlibBorrow(b), nil
}
func (r *AllocationParams) InitGoValue(v *gobject.Value) {
v.Init(TypeAllocationParams)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeAllocationParamsFromGlibBorrow is used to convert raw C.GstAllocationParams pointers to go. This is used by the bindings internally.
func UnsafeAllocationParamsFromGlibBorrow(p unsafe.Pointer) *AllocationParams {
return &AllocationParams{&allocationParams{(*C.GstAllocationParams)(p)}}
}
// UnsafeAllocationParamsFromGlibNone is used to convert raw C.GstAllocationParams pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAllocationParamsFromGlibNone(p unsafe.Pointer) *AllocationParams {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeAllocationParamsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.allocationParams,
func (intern *allocationParams) {
C.gst_allocation_params_free(intern.native)
},
)
return wrapped
}
// UnsafeAllocationParamsFromGlibFull is used to convert raw C.GstAllocationParams pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAllocationParamsFromGlibFull(p unsafe.Pointer) *AllocationParams {
wrapped := UnsafeAllocationParamsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.allocationParams,
func (intern *allocationParams) {
C.gst_allocation_params_free(intern.native)
},
)
return wrapped
}
// UnsafeAllocationParamsFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [AllocationParams] is expected to work anymore.
func UnsafeAllocationParamsFree(a *AllocationParams) {
C.gst_allocation_params_free(a.native)
}
// UnsafeAllocationParamsToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeAllocationParamsToGlibNone(a *AllocationParams) unsafe.Pointer {
return unsafe.Pointer(a.native)
}
// UnsafeAllocationParamsToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeAllocationParamsToGlibFull(a *AllocationParams) unsafe.Pointer {
runtime.SetFinalizer(a.allocationParams, nil)
_p := unsafe.Pointer(a.native)
a.native = nil // AllocationParams is invalid from here on
return _p
}
// NewAllocationParams wraps gst_allocation_params_new
// The function returns the following values:
//
// - goret *AllocationParams
//
// Create a new #GstAllocationParams on the heap. This function is for
// use in GStreamer language bindings. In your own code, you can just
// declare a #GstAllocationParams on the stack or in a struct, and
// call gst_allocation_params_init() to initialize it.
//
// You do not need to call gst_allocation_params_init() on the instance
// returned by this function.
func NewAllocationParams() *AllocationParams {
var cret *C.GstAllocationParams // return, full, converted
cret = C.gst_allocation_params_new()
var goret *AllocationParams
goret = UnsafeAllocationParamsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Copy wraps gst_allocation_params_copy
// The function returns the following values:
//
// - goret *AllocationParams
//
// Create a copy of @params.
func (params *AllocationParams) Copy() *AllocationParams {
var carg0 *C.GstAllocationParams // in, none, converted
var cret *C.GstAllocationParams // return, full, converted
carg0 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
cret = C.gst_allocation_params_copy(carg0)
runtime.KeepAlive(params)
var goret *AllocationParams
goret = UnsafeAllocationParamsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Init wraps gst_allocation_params_init
//
// Initialize @params to its default values
func (params *AllocationParams) Init() {
var carg0 *C.GstAllocationParams // in, none, converted
carg0 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
C.gst_allocation_params_init(carg0)
runtime.KeepAlive(params)
}
// AllocatorClass wraps GstAllocatorClass
//
// The #GstAllocator is used to create new memory.
type AllocatorClass struct {
*allocatorClass
}
// allocatorClass is the struct that's finalized
type allocatorClass struct {
native *C.GstAllocatorClass
}
// UnsafeAllocatorClassFromGlibBorrow is used to convert raw C.GstAllocatorClass pointers to go. This is used by the bindings internally.
func UnsafeAllocatorClassFromGlibBorrow(p unsafe.Pointer) *AllocatorClass {
return &AllocatorClass{&allocatorClass{(*C.GstAllocatorClass)(p)}}
}
// UnsafeAllocatorClassFromGlibNone is used to convert raw C.GstAllocatorClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAllocatorClassFromGlibNone(p unsafe.Pointer) *AllocatorClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeAllocatorClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.allocatorClass,
func (intern *allocatorClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeAllocatorClassFromGlibFull is used to convert raw C.GstAllocatorClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAllocatorClassFromGlibFull(p unsafe.Pointer) *AllocatorClass {
wrapped := UnsafeAllocatorClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.allocatorClass,
func (intern *allocatorClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeAllocatorClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [AllocatorClass] is expected to work anymore.
func UnsafeAllocatorClassFree(a *AllocatorClass) {
C.free(unsafe.Pointer(a.native))
}
// UnsafeAllocatorClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeAllocatorClassToGlibNone(a *AllocatorClass) unsafe.Pointer {
return unsafe.Pointer(a.native)
}
// UnsafeAllocatorClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeAllocatorClassToGlibFull(a *AllocatorClass) unsafe.Pointer {
runtime.SetFinalizer(a.allocatorClass, nil)
_p := unsafe.Pointer(a.native)
a.native = nil // AllocatorClass is invalid from here on
return _p
}
// AtomicQueue wraps GstAtomicQueue
//
// The #GstAtomicQueue object implements a queue that can be used from multiple
// threads without performing any blocking operations.
type AtomicQueue struct {
*atomicQueue
}
// atomicQueue is the struct that's finalized
type atomicQueue struct {
native *C.GstAtomicQueue
}
var _ gobject.GoValueInitializer = (*AtomicQueue)(nil)
func marshalAtomicQueue(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeAtomicQueueFromGlibBorrow(b), nil
}
func (r *AtomicQueue) InitGoValue(v *gobject.Value) {
v.Init(TypeAtomicQueue)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeAtomicQueueFromGlibBorrow is used to convert raw C.GstAtomicQueue pointers to go. This is used by the bindings internally.
func UnsafeAtomicQueueFromGlibBorrow(p unsafe.Pointer) *AtomicQueue {
return &AtomicQueue{&atomicQueue{(*C.GstAtomicQueue)(p)}}
}
// UnsafeAtomicQueueFromGlibNone is used to convert raw C.GstAtomicQueue pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAtomicQueueFromGlibNone(p unsafe.Pointer) *AtomicQueue {
C.gst_atomic_queue_ref((*C.GstAtomicQueue)(p))
wrapped := UnsafeAtomicQueueFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.atomicQueue,
func (intern *atomicQueue) {
C.gst_atomic_queue_unref(intern.native)
},
)
return wrapped
}
// UnsafeAtomicQueueFromGlibFull is used to convert raw C.GstAtomicQueue pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeAtomicQueueFromGlibFull(p unsafe.Pointer) *AtomicQueue {
wrapped := UnsafeAtomicQueueFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.atomicQueue,
func (intern *atomicQueue) {
C.gst_atomic_queue_unref(intern.native)
},
)
return wrapped
}
// UnsafeAtomicQueueRef increases the refcount on the underlying resource. This is used by the bindings internally.
//
// When this is called without an associated call to [AtomicQueue.UnsafeAtomicQueueUnref], then [AtomicQueue] will leak memory.
func UnsafeAtomicQueueRef(a *AtomicQueue) {
C.gst_atomic_queue_ref(a.native)
}
// UnsafeAtomicQueueUnref unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [AtomicQueue] is expected to work anymore.
func UnsafeAtomicQueueUnref(a *AtomicQueue) {
C.gst_atomic_queue_unref(a.native)
}
// UnsafeAtomicQueueToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeAtomicQueueToGlibNone(a *AtomicQueue) unsafe.Pointer {
return unsafe.Pointer(a.native)
}
// UnsafeAtomicQueueToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeAtomicQueueToGlibFull(a *AtomicQueue) unsafe.Pointer {
runtime.SetFinalizer(a.atomicQueue, nil)
_p := unsafe.Pointer(a.native)
a.native = nil // AtomicQueue is invalid from here on
return _p
}
// NewAtomicQueue wraps gst_atomic_queue_new
//
// The function takes the following parameters:
//
// - initialSize uint: initial queue size
//
// The function returns the following values:
//
// - goret *AtomicQueue
//
// Create a new atomic queue instance. @initial_size will be rounded up to the
// nearest power of 2 and used as the initial size of the queue.
func NewAtomicQueue(initialSize uint) *AtomicQueue {
var carg1 C.guint // in, none, casted
var cret *C.GstAtomicQueue // return, full, converted
carg1 = C.guint(initialSize)
cret = C.gst_atomic_queue_new(carg1)
runtime.KeepAlive(initialSize)
var goret *AtomicQueue
goret = UnsafeAtomicQueueFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Length wraps gst_atomic_queue_length
// The function returns the following values:
//
// - goret uint
//
// Get the amount of items in the queue.
func (queue *AtomicQueue) Length() uint {
var carg0 *C.GstAtomicQueue // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstAtomicQueue)(UnsafeAtomicQueueToGlibNone(queue))
cret = C.gst_atomic_queue_length(carg0)
runtime.KeepAlive(queue)
var goret uint
goret = uint(cret)
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
// to update the list of children in the bin.
//
// The #GstBinClass::handle_message method can be overridden to implement custom
// message handling.
//
// #GstBinClass::deep_element_added will be called when a new element has been
// added to any bin inside this bin, so it will also be called if a new child
// was added to a sub-bin of this bin. #GstBin implementations that override
// this message should chain up to the parent class implementation so the
// #GstBin::deep-element-added signal is emitted on all parents.
type BinClass struct {
*binClass
}
// binClass is the struct that's finalized
type binClass struct {
native *C.GstBinClass
}
// UnsafeBinClassFromGlibBorrow is used to convert raw C.GstBinClass pointers to go. This is used by the bindings internally.
func UnsafeBinClassFromGlibBorrow(p unsafe.Pointer) *BinClass {
return &BinClass{&binClass{(*C.GstBinClass)(p)}}
}
// UnsafeBinClassFromGlibNone is used to convert raw C.GstBinClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBinClassFromGlibNone(p unsafe.Pointer) *BinClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBinClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.binClass,
func (intern *binClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBinClassFromGlibFull is used to convert raw C.GstBinClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBinClassFromGlibFull(p unsafe.Pointer) *BinClass {
wrapped := UnsafeBinClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.binClass,
func (intern *binClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBinClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [BinClass] is expected to work anymore.
func UnsafeBinClassFree(b *BinClass) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBinClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBinClassToGlibNone(b *BinClass) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBinClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBinClassToGlibFull(b *BinClass) unsafe.Pointer {
runtime.SetFinalizer(b.binClass, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // BinClass is invalid from here on
return _p
}
// Buffer wraps GstBuffer
//
// Buffers are the basic unit of data transfer in GStreamer. They contain the
// timing and offset along with other arbitrary metadata that is associated
// with the #GstMemory blocks that the buffer contains.
//
// Buffers are usually created with gst_buffer_new(). After a buffer has been
// created one will typically allocate memory for it and add it to the buffer.
// The following example creates a buffer that can hold a given video frame
// with a given width, height and bits per plane.
//
// ``` C
// GstBuffer *buffer;
// GstMemory *memory;
// gint size, width, height, bpp;
// ...
// size = width * height * bpp;
// buffer = gst_buffer_new ();
// memory = gst_allocator_alloc (NULL, size, NULL);
// gst_buffer_insert_memory (buffer, -1, memory);
// ...
// ```
//
// Alternatively, use gst_buffer_new_allocate() to create a buffer with
// preallocated data of a given size.
//
// Buffers can contain a list of #GstMemory objects. You can retrieve how many
// memory objects with gst_buffer_n_memory() and you can get a pointer
// to memory with gst_buffer_peek_memory()
//
// A buffer will usually have timestamps, and a duration, but neither of these
// are guaranteed (they may be set to #GST_CLOCK_TIME_NONE). Whenever a
// meaningful value can be given for these, they should be set. The timestamps
// and duration are measured in nanoseconds (they are #GstClockTime values).
//
// The buffer DTS refers to the timestamp when the buffer should be decoded and
// is usually monotonically increasing. The buffer PTS refers to the timestamp when
// the buffer content should be presented to the user and is not always
// monotonically increasing.
//
// A buffer can also have one or both of a start and an end offset. These are
// media-type specific. For video buffers, the start offset will generally be
// the frame number. For audio buffers, it will be the number of samples
// produced so far. For compressed data, it could be the byte offset in a
// source or destination file. Likewise, the end offset will be the offset of
// the end of the buffer. These can only be meaningfully interpreted if you
// know the media type of the buffer (the preceding CAPS event). Either or both
// can be set to #GST_BUFFER_OFFSET_NONE.
//
// gst_buffer_ref() is used to increase the refcount of a buffer. This must be
// done when you want to keep a handle to the buffer after pushing it to the
// next element. The buffer refcount determines the writability of the buffer, a
// buffer is only writable when the refcount is exactly 1, i.e. when the caller
// has the only reference to the buffer.
//
// To efficiently create a smaller buffer out of an existing one, you can
// use gst_buffer_copy_region(). This method tries to share the memory objects
// between the two buffers.
//
// If a plug-in wants to modify the buffer data or metadata in-place, it should
// first obtain a buffer that is safe to modify by using
// gst_buffer_make_writable(). This function is optimized so that a copy will
// only be made when it is necessary.
//
// Several flags of the buffer can be set and unset with the
// GST_BUFFER_FLAG_SET() and GST_BUFFER_FLAG_UNSET() macros. Use
// GST_BUFFER_FLAG_IS_SET() to test if a certain #GstBufferFlags flag is set.
//
// Buffers can be efficiently merged into a larger buffer with
// gst_buffer_append(). Copying of memory will only be done when absolutely
// needed.
//
// Arbitrary extra metadata can be set on a buffer with gst_buffer_add_meta().
// Metadata can be retrieved with gst_buffer_get_meta(). See also #GstMeta.
//
// An element should either unref the buffer or push it out on a src pad
// using gst_pad_push() (see #GstPad).
//
// Buffers are usually freed by unreffing them with gst_buffer_unref(). When
// the refcount drops to 0, any memory and metadata pointed to by the buffer is
// unreffed as well. Buffers allocated from a #GstBufferPool will be returned to
// the pool when the refcount drops to 0.
//
// The #GstParentBufferMeta is a meta which can be attached to a #GstBuffer
// to hold a reference to another buffer that is only released when the child
// #GstBuffer is released.
//
// Typically, #GstParentBufferMeta is used when the child buffer is directly
// using the #GstMemory of the parent buffer, and wants to prevent the parent
// buffer from being returned to a buffer pool until the #GstMemory is available
// for re-use. (Since: 1.6)
type Buffer struct {
*buffer
}
// buffer is the struct that's finalized
type buffer struct {
native *C.GstBuffer
}
var _ gobject.GoValueInitializer = (*Buffer)(nil)
func marshalBuffer(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeBufferFromGlibBorrow(b), nil
}
func (r *Buffer) InitGoValue(v *gobject.Value) {
v.Init(TypeBuffer)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeBufferFromGlibBorrow is used to convert raw C.GstBuffer pointers to go. This is used by the bindings internally.
func UnsafeBufferFromGlibBorrow(p unsafe.Pointer) *Buffer {
return &Buffer{&buffer{(*C.GstBuffer)(p)}}
}
// UnsafeBufferFromGlibNone is used to convert raw C.GstBuffer pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferFromGlibNone(p unsafe.Pointer) *Buffer {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBufferFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.buffer,
func (intern *buffer) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferFromGlibFull is used to convert raw C.GstBuffer pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferFromGlibFull(p unsafe.Pointer) *Buffer {
wrapped := UnsafeBufferFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.buffer,
func (intern *buffer) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Buffer] is expected to work anymore.
func UnsafeBufferFree(b *Buffer) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBufferToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBufferToGlibNone(b *Buffer) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBufferToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBufferToGlibFull(b *Buffer) unsafe.Pointer {
runtime.SetFinalizer(b.buffer, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // Buffer is invalid from here on
return _p
}
// NewBuffer wraps gst_buffer_new
// The function returns the following values:
//
// - goret *Buffer
//
// Creates a newly allocated buffer without any data.
func NewBuffer() *Buffer {
var cret *C.GstBuffer // return, full, converted
cret = C.gst_buffer_new()
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewBufferAllocate wraps gst_buffer_new_allocate
//
// The function takes the following parameters:
//
// - allocator Allocator (nullable): the #GstAllocator to use, or %NULL to use the
// default allocator
// - size uint: the size in bytes of the new buffer's data.
// - params *AllocationParams (nullable): optional parameters
//
// The function returns the following values:
//
// - goret *Buffer
//
// Tries to create a newly allocated buffer with data of the given size and
// extra parameters from @allocator. If the requested amount of memory can't be
// allocated, %NULL will be returned. The allocated buffer memory is not cleared.
//
// When @allocator is %NULL, the default memory allocator will be used.
//
// Note that when @size == 0, the buffer will not have memory associated with it.
func NewBufferAllocate(allocator Allocator, size uint, params *AllocationParams) *Buffer {
var carg1 *C.GstAllocator // in, none, converted, nullable
var carg2 C.gsize // in, none, casted
var carg3 *C.GstAllocationParams // in, none, converted, nullable
var cret *C.GstBuffer // return, full, converted
if allocator != nil {
carg1 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
}
carg2 = C.gsize(size)
if params != nil {
carg3 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
}
cret = C.gst_buffer_new_allocate(carg1, carg2, carg3)
runtime.KeepAlive(allocator)
runtime.KeepAlive(size)
runtime.KeepAlive(params)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewBufferWrappedBytes wraps gst_buffer_new_wrapped_bytes
//
// The function takes the following parameters:
//
// - bytes *glib.Bytes: a #GBytes to wrap
//
// The function returns the following values:
//
// - goret *Buffer
//
// Creates a new #GstBuffer that wraps the given @bytes. The data inside
// @bytes cannot be %NULL and the resulting buffer will be marked as read only.
func NewBufferWrappedBytes(bytes *glib.Bytes) *Buffer {
var carg1 *C.GBytes // in, none, converted
var cret *C.GstBuffer // return, full, converted
carg1 = (*C.GBytes)(glib.UnsafeBytesToGlibNone(bytes))
cret = C.gst_buffer_new_wrapped_bytes(carg1)
runtime.KeepAlive(bytes)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddCustomMeta wraps gst_buffer_add_custom_meta
//
// The function takes the following parameters:
//
// - name string: the registered name of the desired custom meta
//
// The function returns the following values:
//
// - goret *CustomMeta
//
// Creates and adds a #GstCustomMeta for the desired @name. @name must have
// been successfully registered with gst_meta_register_custom().
func (buffer *Buffer) AddCustomMeta(name string) *CustomMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstCustomMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_buffer_add_custom_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(name)
var goret *CustomMeta
goret = UnsafeCustomMetaFromGlibNone(unsafe.Pointer(cret))
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:
//
// - ref *Buffer: a #GstBuffer to ref
//
// The function returns the following values:
//
// - goret *ParentBufferMeta
//
// Adds a #GstParentBufferMeta to @buffer that holds a reference on
// @ref until the buffer is freed.
func (buffer *Buffer) AddParentBufferMeta(ref *Buffer) *ParentBufferMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstBuffer // in, none, converted
var cret *C.GstParentBufferMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibNone(ref))
cret = C.gst_buffer_add_parent_buffer_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(ref)
var goret *ParentBufferMeta
goret = UnsafeParentBufferMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// AddProtectionMeta wraps gst_buffer_add_protection_meta
//
// The function takes the following parameters:
//
// - info *Structure: a #GstStructure holding cryptographic
// information relating to the sample contained in @buffer. This
// function takes ownership of @info.
//
// The function returns the following values:
//
// - goret *ProtectionMeta
//
// Attaches protection metadata to a #GstBuffer.
func (buffer *Buffer) AddProtectionMeta(info *Structure) *ProtectionMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var cret *C.GstProtectionMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(info))
cret = C.gst_buffer_add_protection_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(info)
var goret *ProtectionMeta
goret = UnsafeProtectionMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// AddReferenceTimestampMeta wraps gst_buffer_add_reference_timestamp_meta
//
// The function takes the following parameters:
//
// - reference *Caps: identifier for the timestamp reference.
// - timestamp ClockTime: timestamp
// - duration ClockTime: duration, or %GST_CLOCK_TIME_NONE
//
// The function returns the following values:
//
// - goret *ReferenceTimestampMeta
//
// Adds a #GstReferenceTimestampMeta to @buffer that holds a @timestamp and
// optionally @duration based on a specific timestamp @reference. See the
// documentation of #GstReferenceTimestampMeta for details.
func (buffer *Buffer) AddReferenceTimestampMeta(reference *Caps, timestamp ClockTime, duration ClockTime) *ReferenceTimestampMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var cret *C.GstReferenceTimestampMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(reference))
carg2 = C.GstClockTime(timestamp)
carg3 = C.GstClockTime(duration)
cret = C.gst_buffer_add_reference_timestamp_meta(carg0, carg1, carg2, carg3)
runtime.KeepAlive(buffer)
runtime.KeepAlive(reference)
runtime.KeepAlive(timestamp)
runtime.KeepAlive(duration)
var goret *ReferenceTimestampMeta
goret = UnsafeReferenceTimestampMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// Append wraps gst_buffer_append
//
// The function takes the following parameters:
//
// - buf2 *Buffer: the second source #GstBuffer to append.
//
// The function returns the following values:
//
// - goret *Buffer
//
// Appends all the memory from @buf2 to @buf1. The result buffer will contain a
// concatenation of the memory of @buf1 and @buf2.
func (buf1 *Buffer) Append(buf2 *Buffer) *Buffer {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstBuffer // in, full, converted
var cret *C.GstBuffer // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buf1))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buf2))
cret = C.gst_buffer_append(carg0, carg1)
runtime.KeepAlive(buf1)
runtime.KeepAlive(buf2)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AppendMemory wraps gst_buffer_append_memory
//
// The function takes the following parameters:
//
// - mem *Memory: a #GstMemory.
//
// Appends the memory block @mem to @buffer. This function takes
// ownership of @mem and thus doesn't increase its refcount.
//
// This function is identical to gst_buffer_insert_memory() with an index of -1.
// See gst_buffer_insert_memory() for more details.
func (buffer *Buffer) AppendMemory(mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_append_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(mem)
}
// AppendRegion wraps gst_buffer_append_region
//
// The function takes the following parameters:
//
// - buf2 *Buffer: the second source #GstBuffer to append.
// - offset int: the offset in @buf2
// - size int: the size or -1 of @buf2
//
// The function returns the following values:
//
// - goret *Buffer
//
// Appends @size bytes at @offset from @buf2 to @buf1. The result buffer will
// contain a concatenation of the memory of @buf1 and the requested region of
// @buf2.
func (buf1 *Buffer) AppendRegion(buf2 *Buffer, offset int, size int) *Buffer {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstBuffer // in, full, converted
var carg2 C.gssize // in, none, casted
var carg3 C.gssize // in, none, casted
var cret *C.GstBuffer // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buf1))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buf2))
carg2 = C.gssize(offset)
carg3 = C.gssize(size)
cret = C.gst_buffer_append_region(carg0, carg1, carg2, carg3)
runtime.KeepAlive(buf1)
runtime.KeepAlive(buf2)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CopyDeep wraps gst_buffer_copy_deep
// The function returns the following values:
//
// - goret *Buffer
//
// Creates a copy of the given buffer. This will make a newly allocated
// copy of the data the source buffer contains.
func (buf *Buffer) CopyDeep() *Buffer {
var carg0 *C.GstBuffer // in, none, converted
var cret *C.GstBuffer // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buf))
cret = C.gst_buffer_copy_deep(carg0)
runtime.KeepAlive(buf)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CopyInto wraps gst_buffer_copy_into
//
// The function takes the following parameters:
//
// - src *Buffer: a source #GstBuffer
// - flags BufferCopyFlagsType: flags indicating what metadata fields should be copied.
// - offset uint: offset to copy from
// - size uint: total size to copy. If -1, all data is copied.
//
// The function returns the following values:
//
// - goret bool
//
// Copies the information from @src into @dest.
//
// If @dest already contains memory and @flags contains GST_BUFFER_COPY_MEMORY,
// the memory from @src will be appended to @dest.
//
// @flags indicate which fields will be copied.
func (dest *Buffer) CopyInto(src *Buffer, flags BufferCopyFlagsType, offset uint, size uint) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstBuffer // in, none, converted
var carg2 C.GstBufferCopyFlags // in, none, casted
var carg3 C.gsize // in, none, casted
var carg4 C.gsize // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(dest))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibNone(src))
carg2 = C.GstBufferCopyFlags(flags)
carg3 = C.gsize(offset)
carg4 = C.gsize(size)
cret = C.gst_buffer_copy_into(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(dest)
runtime.KeepAlive(src)
runtime.KeepAlive(flags)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// CopyRegion wraps gst_buffer_copy_region
//
// The function takes the following parameters:
//
// - flags BufferCopyFlagsType: the #GstBufferCopyFlags
// - offset uint: the offset into parent #GstBuffer at which the new sub-buffer
// begins.
// - size uint: the size of the new #GstBuffer sub-buffer, in bytes. If -1, all
// data is copied.
//
// The function returns the following values:
//
// - goret *Buffer
//
// Creates a sub-buffer from @parent at @offset and @size.
// This sub-buffer uses the actual memory space of the parent buffer.
// This function will copy the offset and timestamp fields when the
// offset is 0. If not, they will be set to #GST_CLOCK_TIME_NONE and
// #GST_BUFFER_OFFSET_NONE.
// If @offset equals 0 and @size equals the total size of @buffer, the
// duration and offset end fields are also copied. If not they will be set
// to #GST_CLOCK_TIME_NONE and #GST_BUFFER_OFFSET_NONE.
func (parent *Buffer) CopyRegion(flags BufferCopyFlagsType, offset uint, size uint) *Buffer {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GstBufferCopyFlags // in, none, casted
var carg2 C.gsize // in, none, casted
var carg3 C.gsize // in, none, casted
var cret *C.GstBuffer // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(parent))
carg1 = C.GstBufferCopyFlags(flags)
carg2 = C.gsize(offset)
carg3 = C.gsize(size)
cret = C.gst_buffer_copy_region(carg0, carg1, carg2, carg3)
runtime.KeepAlive(parent)
runtime.KeepAlive(flags)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret *Buffer
goret = UnsafeBufferFromGlibFull(unsafe.Pointer(cret))
return goret
}
// FindMemory wraps gst_buffer_find_memory
//
// The function takes the following parameters:
//
// - offset uint: an offset
// - size uint: a size
//
// The function returns the following values:
//
// - idx uint: pointer to index
// - length uint: pointer to length
// - skip uint: pointer to skip
// - goret bool
//
// Finds the memory blocks that span @size bytes starting from @offset
// in @buffer.
//
// When this function returns %TRUE, @idx will contain the index of the first
// memory block where the byte for @offset can be found and @length contains the
// number of memory blocks containing the @size remaining bytes. @skip contains
// the number of bytes to skip in the memory block at @idx to get to the byte
// for @offset.
//
// @size can be -1 to get all the memory blocks after @idx.
func (buffer *Buffer) FindMemory(offset uint, size uint) (uint, uint, uint, bool) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gsize // in, none, casted
var carg2 C.gsize // in, none, casted
var carg3 C.guint // out, full, casted
var carg4 C.guint // out, full, casted
var carg5 C.gsize // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.gsize(offset)
carg2 = C.gsize(size)
cret = C.gst_buffer_find_memory(carg0, carg1, carg2, &carg3, &carg4, &carg5)
runtime.KeepAlive(buffer)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var idx uint
var length uint
var skip uint
var goret bool
idx = uint(carg3)
length = uint(carg4)
skip = uint(carg5)
if cret != 0 {
goret = true
}
return idx, length, skip, goret
}
// ForEachMeta wraps gst_buffer_foreach_meta
//
// The function takes the following parameters:
//
// - fn BufferForEachMetaFunc: a #GstBufferForeachMetaFunc to call
//
// The function returns the following values:
//
// - goret bool
//
// Calls @func with @user_data for each meta in @buffer.
//
// @func can modify the passed meta pointer or its contents. The return value
// of @func defines if this function returns or if the remaining metadata items
// in the buffer should be skipped.
func (buffer *Buffer) ForEachMeta(fn BufferForEachMetaFunc) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GstBufferForeachMetaFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*[0]byte)(C._gotk4_gst1_BufferForEachMetaFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_buffer_foreach_meta(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetAllMemory wraps gst_buffer_get_all_memory
// The function returns the following values:
//
// - goret *Memory
//
// Gets all the memory blocks in @buffer. The memory blocks will be merged
// into one large #GstMemory.
func (buffer *Buffer) GetAllMemory() *Memory {
var carg0 *C.GstBuffer // in, none, converted
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_get_all_memory(carg0)
runtime.KeepAlive(buffer)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetCustomMeta wraps gst_buffer_get_custom_meta
//
// The function takes the following parameters:
//
// - name string: the registered name of the custom meta to retrieve.
//
// The function returns the following values:
//
// - goret *CustomMeta
//
// Finds the first #GstCustomMeta on @buffer for the desired @name.
func (buffer *Buffer) GetCustomMeta(name string) *CustomMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstCustomMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_buffer_get_custom_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(name)
var goret *CustomMeta
goret = UnsafeCustomMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetFlags wraps gst_buffer_get_flags
// The function returns the following values:
//
// - goret BufferFlags
//
// Gets the #GstBufferFlags flags set on this buffer.
func (buffer *Buffer) GetFlags() BufferFlags {
var carg0 *C.GstBuffer // in, none, converted
var cret C.GstBufferFlags // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_get_flags(carg0)
runtime.KeepAlive(buffer)
var goret BufferFlags
goret = BufferFlags(cret)
return goret
}
// GetMemory wraps gst_buffer_get_memory
//
// The function takes the following parameters:
//
// - idx uint: an index
//
// The function returns the following values:
//
// - goret *Memory
//
// Gets the memory block at index @idx in @buffer.
func (buffer *Buffer) GetMemory(idx uint) *Memory {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
cret = C.gst_buffer_get_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetMemoryRange wraps gst_buffer_get_memory_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length
//
// The function returns the following values:
//
// - goret *Memory
//
// Gets @length memory blocks in @buffer starting at @idx. The memory blocks will
// be merged into one large #GstMemory.
//
// If @length is -1, all memory starting from @idx is merged.
func (buffer *Buffer) GetMemoryRange(idx uint, length int) *Memory {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
cret = C.gst_buffer_get_memory_range(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetMeta wraps gst_buffer_get_meta
//
// The function takes the following parameters:
//
// - api gobject.Type: the #GType of an API
//
// The function returns the following values:
//
// - goret *Meta
//
// Gets the metadata for @api on buffer. When there is no such metadata, %NULL is
// returned. If multiple metadata with the given @api are attached to this
// buffer only the first one is returned. To handle multiple metadata with a
// given API use gst_buffer_iterate_meta() or gst_buffer_foreach_meta() instead
// and check the `meta-&gt;info.api` member for the API type.
func (buffer *Buffer) GetMeta(api gobject.Type) *Meta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GType // in, none, casted, alias
var cret *C.GstMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.GType(api)
cret = C.gst_buffer_get_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(api)
var goret *Meta
goret = UnsafeMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetNMeta wraps gst_buffer_get_n_meta
//
// The function takes the following parameters:
//
// - apiType gobject.Type: the #GType of an API
//
// The function returns the following values:
//
// - goret uint
func (buffer *Buffer) GetNMeta(apiType gobject.Type) uint {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GType // in, none, casted, alias
var cret C.guint // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.GType(apiType)
cret = C.gst_buffer_get_n_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(apiType)
var goret uint
goret = uint(cret)
return goret
}
// GetReferenceTimestampMeta wraps gst_buffer_get_reference_timestamp_meta
//
// The function takes the following parameters:
//
// - reference *Caps (nullable): a reference #GstCaps
//
// The function returns the following values:
//
// - goret *ReferenceTimestampMeta
//
// Finds the first #GstReferenceTimestampMeta on @buffer that conforms to
// @reference. Conformance is tested by checking if the meta's reference is a
// subset of @reference.
//
// Buffers can contain multiple #GstReferenceTimestampMeta metadata items.
func (buffer *Buffer) GetReferenceTimestampMeta(reference *Caps) *ReferenceTimestampMeta {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstCaps // in, none, converted, nullable
var cret *C.GstReferenceTimestampMeta // return, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
if reference != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(reference))
}
cret = C.gst_buffer_get_reference_timestamp_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(reference)
var goret *ReferenceTimestampMeta
goret = UnsafeReferenceTimestampMetaFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetSize wraps gst_buffer_get_size
// The function returns the following values:
//
// - goret uint
//
// Gets the total size of the memory blocks in @buffer.
func (buffer *Buffer) GetSize() uint {
var carg0 *C.GstBuffer // in, none, converted
var cret C.gsize // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_get_size(carg0)
runtime.KeepAlive(buffer)
var goret uint
goret = uint(cret)
return goret
}
// GetSizes wraps gst_buffer_get_sizes
// The function returns the following values:
//
// - offset uint: a pointer to the offset
// - maxsize uint: a pointer to the maxsize
// - goret uint
//
// Gets the total size of the memory blocks in @buffer.
//
// When not %NULL, @offset will contain the offset of the data in the
// first memory block in @buffer and @maxsize will contain the sum of
// the size and @offset and the amount of extra padding on the last
// memory block. @offset and @maxsize can be used to resize the
// buffer memory blocks with gst_buffer_resize().
func (buffer *Buffer) GetSizes() (uint, uint, uint) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gsize // out, full, casted
var carg2 C.gsize // out, full, casted
var cret C.gsize // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_get_sizes(carg0, &carg1, &carg2)
runtime.KeepAlive(buffer)
var offset uint
var maxsize uint
var goret uint
offset = uint(carg1)
maxsize = uint(carg2)
goret = uint(cret)
return offset, maxsize, goret
}
// GetSizesRange wraps gst_buffer_get_sizes_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length
//
// The function returns the following values:
//
// - offset uint: a pointer to the offset
// - maxsize uint: a pointer to the maxsize
// - goret uint
//
// Gets the total size of @length memory blocks stating from @idx in @buffer.
//
// When not %NULL, @offset will contain the offset of the data in the
// memory block in @buffer at @idx and @maxsize will contain the sum of the size
// and @offset and the amount of extra padding on the memory block at @idx +
// @length -1.
// @offset and @maxsize can be used to resize the buffer memory blocks with
// gst_buffer_resize_range().
func (buffer *Buffer) GetSizesRange(idx uint, length int) (uint, uint, uint) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gsize // out, full, casted
var carg4 C.gsize // out, full, casted
var cret C.gsize // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
cret = C.gst_buffer_get_sizes_range(carg0, carg1, carg2, &carg3, &carg4)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
var offset uint
var maxsize uint
var goret uint
offset = uint(carg3)
maxsize = uint(carg4)
goret = uint(cret)
return offset, maxsize, goret
}
// HasFlags wraps gst_buffer_has_flags
//
// The function takes the following parameters:
//
// - flags BufferFlags: the #GstBufferFlags flag to check.
//
// The function returns the following values:
//
// - goret bool
//
// Gives the status of a specific flag on a buffer.
func (buffer *Buffer) HasFlags(flags BufferFlags) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GstBufferFlags // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.GstBufferFlags(flags)
cret = C.gst_buffer_has_flags(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// InsertMemory wraps gst_buffer_insert_memory
//
// The function takes the following parameters:
//
// - idx int: the index to add the memory at, or -1 to append it to the end
// - mem *Memory: a #GstMemory.
//
// Inserts the memory block @mem into @buffer at @idx. This function takes ownership
// of @mem and thus doesn't increase its refcount.
//
// Only gst_buffer_get_max_memory() can be added to a buffer. If more memory is
// added, existing memory blocks will automatically be merged to make room for
// the new memory.
func (buffer *Buffer) InsertMemory(idx int, mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gint // in, none, casted
var carg2 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.gint(idx)
carg2 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_insert_memory(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(mem)
}
// IsAllMemoryWritable wraps gst_buffer_is_all_memory_writable
// The function returns the following values:
//
// - goret bool
//
// Checks if all memory blocks in @buffer are writable.
//
// Note that this function does not check if @buffer is writable, use
// gst_buffer_is_writable() to check that if needed.
func (buffer *Buffer) IsAllMemoryWritable() bool {
var carg0 *C.GstBuffer // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_is_all_memory_writable(carg0)
runtime.KeepAlive(buffer)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsMemoryRangeWritable wraps gst_buffer_is_memory_range_writable
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length, should not be 0
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @length memory blocks in @buffer starting from @idx are writable.
//
// @length can be -1 to check all the memory blocks after @idx.
//
// Note that this function does not check if @buffer is writable, use
// gst_buffer_is_writable() to check that if needed.
func (buffer *Buffer) IsMemoryRangeWritable(idx uint, length int) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
cret = C.gst_buffer_is_memory_range_writable(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Map wraps gst_buffer_map
//
// The function takes the following parameters:
//
// - flags MapFlags: flags for the mapping
//
// The function returns the following values:
//
// - info MapInfo: info about the mapping
// - goret bool
//
// Fills @info with the #GstMapInfo of all merged memory blocks in @buffer.
//
// @flags describe the desired access of the memory. When @flags is
// #GST_MAP_WRITE, @buffer should be writable (as returned from
// gst_buffer_is_writable()).
//
// When @buffer is writable but the memory isn't, a writable copy will
// automatically be created and returned. The readonly copy of the
// buffer memory will then also be replaced with this writable copy.
//
// The memory in @info should be unmapped with gst_buffer_unmap() after
// usage.
func (buffer *Buffer) Map(flags MapFlags) (MapInfo, bool) {
var carg0 *C.GstBuffer // in, none, converted
var carg2 C.GstMapFlags // in, none, casted
var carg1 C.GstMapInfo // out, transfer: none, C Pointers: 0, Name: MapInfo, caller-allocates
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg2 = C.GstMapFlags(flags)
cret = C.gst_buffer_map(carg0, &carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(flags)
var info MapInfo
var goret bool
_ = info
_ = carg1
panic("unimplemented conversion of MapInfo (GstMapInfo)")
if cret != 0 {
goret = true
}
return info, goret
}
// MapRange wraps gst_buffer_map_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length
// - flags MapFlags: flags for the mapping
//
// The function returns the following values:
//
// - info MapInfo: info about the mapping
// - goret bool
//
// Fills @info with the #GstMapInfo of @length merged memory blocks
// starting at @idx in @buffer. When @length is -1, all memory blocks starting
// from @idx are merged and mapped.
//
// @flags describe the desired access of the memory. When @flags is
// #GST_MAP_WRITE, @buffer should be writable (as returned from
// gst_buffer_is_writable()).
//
// When @buffer is writable but the memory isn't, a writable copy will
// automatically be created and returned. The readonly copy of the buffer memory
// will then also be replaced with this writable copy.
//
// The memory in @info should be unmapped with gst_buffer_unmap() after usage.
func (buffer *Buffer) MapRange(idx uint, length int, flags MapFlags) (MapInfo, bool) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var carg4 C.GstMapFlags // in, none, casted
var carg3 C.GstMapInfo // out, transfer: none, C Pointers: 0, Name: MapInfo, caller-allocates
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
carg4 = C.GstMapFlags(flags)
cret = C.gst_buffer_map_range(carg0, carg1, carg2, &carg3, carg4)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
runtime.KeepAlive(flags)
var info MapInfo
var goret bool
_ = info
_ = carg3
panic("unimplemented conversion of MapInfo (GstMapInfo)")
if cret != 0 {
goret = true
}
return info, goret
}
// Memset wraps gst_buffer_memset
//
// The function takes the following parameters:
//
// - offset uint: the offset in @buffer
// - val uint8: the value to set
// - size uint: the size to set
//
// The function returns the following values:
//
// - goret uint
//
// Fills @buf with @size bytes with @val starting from @offset.
func (buffer *Buffer) Memset(offset uint, val uint8, size uint) uint {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gsize // in, none, casted
var carg2 C.guint8 // in, none, casted
var carg3 C.gsize // in, none, casted
var cret C.gsize // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.gsize(offset)
carg2 = C.guint8(val)
carg3 = C.gsize(size)
cret = C.gst_buffer_memset(carg0, carg1, carg2, carg3)
runtime.KeepAlive(buffer)
runtime.KeepAlive(offset)
runtime.KeepAlive(val)
runtime.KeepAlive(size)
var goret uint
goret = uint(cret)
return goret
}
// NMemory wraps gst_buffer_n_memory
// The function returns the following values:
//
// - goret uint
//
// Gets the amount of memory blocks that this buffer has. This amount is never
// larger than what gst_buffer_get_max_memory() returns.
func (buffer *Buffer) NMemory() uint {
var carg0 *C.GstBuffer // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
cret = C.gst_buffer_n_memory(carg0)
runtime.KeepAlive(buffer)
var goret uint
goret = uint(cret)
return goret
}
// PeekMemory wraps gst_buffer_peek_memory
//
// The function takes the following parameters:
//
// - idx uint: an index
//
// The function returns the following values:
//
// - goret *Memory
//
// Gets the memory block at @idx in @buffer. The memory block stays valid until
// the memory block in @buffer is removed, replaced or merged, typically with
// any call that modifies the memory in @buffer.
func (buffer *Buffer) PeekMemory(idx uint) *Memory {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstMemory // return, borrow, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
cret = C.gst_buffer_peek_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
var goret *Memory
goret = UnsafeMemoryFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Buffer) {}, buffer)
return goret
}
// PrependMemory wraps gst_buffer_prepend_memory
//
// The function takes the following parameters:
//
// - mem *Memory: a #GstMemory.
//
// Prepends the memory block @mem to @buffer. This function takes
// ownership of @mem and thus doesn't increase its refcount.
//
// This function is identical to gst_buffer_insert_memory() with an index of 0.
// See gst_buffer_insert_memory() for more details.
func (buffer *Buffer) PrependMemory(mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_prepend_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(mem)
}
// RemoveAllMemory wraps gst_buffer_remove_all_memory
//
// Removes all the memory blocks in @buffer.
func (buffer *Buffer) RemoveAllMemory() {
var carg0 *C.GstBuffer // in, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
C.gst_buffer_remove_all_memory(carg0)
runtime.KeepAlive(buffer)
}
// RemoveMemory wraps gst_buffer_remove_memory
//
// The function takes the following parameters:
//
// - idx uint: an index
//
// Removes the memory block in @b at index @i.
func (buffer *Buffer) RemoveMemory(idx uint) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
C.gst_buffer_remove_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
}
// RemoveMemoryRange wraps gst_buffer_remove_memory_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length
//
// Removes @length memory blocks in @buffer starting from @idx.
//
// @length can be -1, in which case all memory starting from @idx is removed.
func (buffer *Buffer) RemoveMemoryRange(idx uint, length int) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
C.gst_buffer_remove_memory_range(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
}
// RemoveMeta wraps gst_buffer_remove_meta
//
// The function takes the following parameters:
//
// - meta *Meta: a #GstMeta
//
// The function returns the following values:
//
// - goret bool
//
// Removes the metadata for @meta on @buffer.
func (buffer *Buffer) RemoveMeta(meta *Meta) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstMeta // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstMeta)(UnsafeMetaToGlibNone(meta))
cret = C.gst_buffer_remove_meta(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(meta)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ReplaceAllMemory wraps gst_buffer_replace_all_memory
//
// The function takes the following parameters:
//
// - mem *Memory: a #GstMemory
//
// Replaces all memory in @buffer with @mem.
func (buffer *Buffer) ReplaceAllMemory(mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_replace_all_memory(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(mem)
}
// ReplaceMemory wraps gst_buffer_replace_memory
//
// The function takes the following parameters:
//
// - idx uint: an index
// - mem *Memory: a #GstMemory
//
// Replaces the memory block at index @idx in @buffer with @mem.
func (buffer *Buffer) ReplaceMemory(idx uint, mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_replace_memory(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(mem)
}
// ReplaceMemoryRange wraps gst_buffer_replace_memory_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length, should not be 0
// - mem *Memory: a #GstMemory
//
// Replaces @length memory blocks in @buffer starting at @idx with @mem.
//
// If @length is -1, all memory starting from @idx will be removed and
// replaced with @mem.
//
// @buffer should be writable.
func (buffer *Buffer) ReplaceMemoryRange(idx uint, length int, mem *Memory) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 *C.GstMemory // in, full, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
carg3 = (*C.GstMemory)(UnsafeMemoryToGlibFull(mem))
C.gst_buffer_replace_memory_range(carg0, carg1, carg2, carg3)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
runtime.KeepAlive(mem)
}
// Resize wraps gst_buffer_resize
//
// The function takes the following parameters:
//
// - offset int: the offset adjustment
// - size int: the new size or -1 to just adjust the offset
//
// Sets the offset and total size of the memory blocks in @buffer.
func (buffer *Buffer) Resize(offset int, size int) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gssize // in, none, casted
var carg2 C.gssize // in, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.gssize(offset)
carg2 = C.gssize(size)
C.gst_buffer_resize(carg0, carg1, carg2)
runtime.KeepAlive(buffer)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
}
// ResizeRange wraps gst_buffer_resize_range
//
// The function takes the following parameters:
//
// - idx uint: an index
// - length int: a length
// - offset int: the offset adjustment
// - size int: the new size or -1 to just adjust the offset
//
// The function returns the following values:
//
// - goret bool
//
// Sets the total size of the @length memory blocks starting at @idx in
// @buffer
func (buffer *Buffer) ResizeRange(idx uint, length int, offset int, size int) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gssize // in, none, casted
var carg4 C.gssize // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.guint(idx)
carg2 = C.gint(length)
carg3 = C.gssize(offset)
carg4 = C.gssize(size)
cret = C.gst_buffer_resize_range(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(buffer)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetFlags wraps gst_buffer_set_flags
//
// The function takes the following parameters:
//
// - flags BufferFlags: the #GstBufferFlags to set.
//
// The function returns the following values:
//
// - goret bool
//
// Sets one or more buffer flags on a buffer.
func (buffer *Buffer) SetFlags(flags BufferFlags) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GstBufferFlags // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.GstBufferFlags(flags)
cret = C.gst_buffer_set_flags(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetSize wraps gst_buffer_set_size
//
// The function takes the following parameters:
//
// - size int: the new size
//
// Sets the total size of the memory blocks in @buffer.
func (buffer *Buffer) SetSize(size int) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.gssize // in, none, casted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.gssize(size)
C.gst_buffer_set_size(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(size)
}
// Unmap wraps gst_buffer_unmap
//
// The function takes the following parameters:
//
// - info *MapInfo: a #GstMapInfo
//
// Releases the memory previously mapped with gst_buffer_map().
func (buffer *Buffer) Unmap(info *MapInfo) {
var carg0 *C.GstBuffer // in, none, converted
var carg1 *C.GstMapInfo // in, none, converted
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = (*C.GstMapInfo)(UnsafeMapInfoToGlibNone(info))
C.gst_buffer_unmap(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(info)
}
// UnsetFlags wraps gst_buffer_unset_flags
//
// The function takes the following parameters:
//
// - flags BufferFlags: the #GstBufferFlags to clear
//
// The function returns the following values:
//
// - goret bool
//
// Clears one or more buffer flags.
func (buffer *Buffer) UnsetFlags(flags BufferFlags) bool {
var carg0 *C.GstBuffer // in, none, converted
var carg1 C.GstBufferFlags // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
carg1 = C.GstBufferFlags(flags)
cret = C.gst_buffer_unset_flags(carg0, carg1)
runtime.KeepAlive(buffer)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// BufferList wraps GstBufferList
//
// Buffer lists are an object containing a list of buffers.
//
// Buffer lists are created with gst_buffer_list_new() and filled with data
// using gst_buffer_list_insert().
//
// Buffer lists can be pushed on a srcpad with gst_pad_push_list(). This is
// interesting when multiple buffers need to be pushed in one go because it
// can reduce the amount of overhead for pushing each buffer individually.
type BufferList struct {
*bufferList
}
// bufferList is the struct that's finalized
type bufferList struct {
native *C.GstBufferList
}
var _ gobject.GoValueInitializer = (*BufferList)(nil)
func marshalBufferList(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeBufferListFromGlibBorrow(b), nil
}
func (r *BufferList) InitGoValue(v *gobject.Value) {
v.Init(TypeBufferList)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeBufferListFromGlibBorrow is used to convert raw C.GstBufferList pointers to go. This is used by the bindings internally.
func UnsafeBufferListFromGlibBorrow(p unsafe.Pointer) *BufferList {
return &BufferList{&bufferList{(*C.GstBufferList)(p)}}
}
// UnsafeBufferListFromGlibNone is used to convert raw C.GstBufferList pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferListFromGlibNone(p unsafe.Pointer) *BufferList {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBufferListFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferList,
func (intern *bufferList) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferListFromGlibFull is used to convert raw C.GstBufferList pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferListFromGlibFull(p unsafe.Pointer) *BufferList {
wrapped := UnsafeBufferListFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferList,
func (intern *bufferList) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferListFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [BufferList] is expected to work anymore.
func UnsafeBufferListFree(b *BufferList) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBufferListToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBufferListToGlibNone(b *BufferList) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBufferListToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBufferListToGlibFull(b *BufferList) unsafe.Pointer {
runtime.SetFinalizer(b.bufferList, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // BufferList is invalid from here on
return _p
}
// NewBufferList wraps gst_buffer_list_new
// The function returns the following values:
//
// - goret *BufferList
//
// Creates a new, empty #GstBufferList.
func NewBufferList() *BufferList {
var cret *C.GstBufferList // return, full, converted
cret = C.gst_buffer_list_new()
var goret *BufferList
goret = UnsafeBufferListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewBufferListSized wraps gst_buffer_list_new_sized
//
// The function takes the following parameters:
//
// - size uint: an initial reserved size
//
// The function returns the following values:
//
// - goret *BufferList
//
// Creates a new, empty #GstBufferList. The list will have @size space
// preallocated so that memory reallocations can be avoided.
func NewBufferListSized(size uint) *BufferList {
var carg1 C.guint // in, none, casted
var cret *C.GstBufferList // return, full, converted
carg1 = C.guint(size)
cret = C.gst_buffer_list_new_sized(carg1)
runtime.KeepAlive(size)
var goret *BufferList
goret = UnsafeBufferListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CalculateSize wraps gst_buffer_list_calculate_size
// The function returns the following values:
//
// - goret uint
//
// Calculates the size of the data contained in @list by adding the
// size of all buffers.
func (list *BufferList) CalculateSize() uint {
var carg0 *C.GstBufferList // in, none, converted
var cret C.gsize // return, none, casted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
cret = C.gst_buffer_list_calculate_size(carg0)
runtime.KeepAlive(list)
var goret uint
goret = uint(cret)
return goret
}
// CopyDeep wraps gst_buffer_list_copy_deep
// The function returns the following values:
//
// - goret *BufferList
//
// Creates a copy of the given buffer list. This will make a newly allocated
// copy of the buffers that the source buffer list contains.
func (list *BufferList) CopyDeep() *BufferList {
var carg0 *C.GstBufferList // in, none, converted
var cret *C.GstBufferList // return, full, converted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
cret = C.gst_buffer_list_copy_deep(carg0)
runtime.KeepAlive(list)
var goret *BufferList
goret = UnsafeBufferListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ForEach wraps gst_buffer_list_foreach
//
// The function takes the following parameters:
//
// - fn BufferListFunc: a #GstBufferListFunc to call
//
// The function returns the following values:
//
// - goret bool
//
// Calls @func with @data for each buffer in @list.
//
// @func can modify the passed buffer pointer or its contents. The return value
// of @func defines if this function returns or if the remaining buffers in
// the list should be skipped.
func (list *BufferList) ForEach(fn BufferListFunc) bool {
var carg0 *C.GstBufferList // in, none, converted
var carg1 C.GstBufferListFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
carg1 = (*[0]byte)(C._gotk4_gst1_BufferListFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_buffer_list_foreach(carg0, carg1, carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Get wraps gst_buffer_list_get
//
// The function takes the following parameters:
//
// - idx uint: the index
//
// The function returns the following values:
//
// - goret *Buffer
//
// Gets the buffer at @idx.
//
// You must make sure that @idx does not exceed the number of
// buffers available.
func (list *BufferList) Get(idx uint) *Buffer {
var carg0 *C.GstBufferList // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstBuffer // return, borrow, converted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
carg1 = C.guint(idx)
cret = C.gst_buffer_list_get(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(idx)
var goret *Buffer
goret = UnsafeBufferFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *BufferList) {}, list)
return goret
}
// GetWritable wraps gst_buffer_list_get_writable
//
// The function takes the following parameters:
//
// - idx uint: the index
//
// The function returns the following values:
//
// - goret *Buffer
//
// Gets the buffer at @idx, ensuring it is a writable buffer.
//
// You must make sure that @idx does not exceed the number of
// buffers available.
func (list *BufferList) GetWritable(idx uint) *Buffer {
var carg0 *C.GstBufferList // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstBuffer // return, borrow, converted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
carg1 = C.guint(idx)
cret = C.gst_buffer_list_get_writable(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(idx)
var goret *Buffer
goret = UnsafeBufferFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *BufferList) {}, list)
return goret
}
// Insert wraps gst_buffer_list_insert
//
// The function takes the following parameters:
//
// - idx int: the index
// - buffer *Buffer: a #GstBuffer
//
// Inserts @buffer at @idx in @list. Other buffers are moved to make room for
// this new buffer.
//
// A -1 value for @idx will append the buffer at the end.
func (list *BufferList) Insert(idx int, buffer *Buffer) {
var carg0 *C.GstBufferList // in, none, converted
var carg1 C.gint // in, none, casted
var carg2 *C.GstBuffer // in, full, converted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
carg1 = C.gint(idx)
carg2 = (*C.GstBuffer)(UnsafeBufferToGlibFull(buffer))
C.gst_buffer_list_insert(carg0, carg1, carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(idx)
runtime.KeepAlive(buffer)
}
// Length wraps gst_buffer_list_length
// The function returns the following values:
//
// - goret uint
//
// Returns the number of buffers in @list.
func (list *BufferList) Length() uint {
var carg0 *C.GstBufferList // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
cret = C.gst_buffer_list_length(carg0)
runtime.KeepAlive(list)
var goret uint
goret = uint(cret)
return goret
}
// Remove wraps gst_buffer_list_remove
//
// The function takes the following parameters:
//
// - idx uint: the index
// - length uint: the amount to remove
//
// Removes @length buffers starting from @idx in @list. The following buffers
// are moved to close the gap.
func (list *BufferList) Remove(idx uint, length uint) {
var carg0 *C.GstBufferList // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.guint // in, none, casted
carg0 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(list))
carg1 = C.guint(idx)
carg2 = C.guint(length)
C.gst_buffer_list_remove(carg0, carg1, carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(idx)
runtime.KeepAlive(length)
}
// BufferPoolAcquireParams wraps GstBufferPoolAcquireParams
//
// Parameters passed to the gst_buffer_pool_acquire_buffer() function to control the
// allocation of the buffer.
//
// The default implementation ignores the @start and @stop members but other
// implementations can use this extra information to decide what buffer to
// return.
type BufferPoolAcquireParams struct {
*bufferPoolAcquireParams
}
// bufferPoolAcquireParams is the struct that's finalized
type bufferPoolAcquireParams struct {
native *C.GstBufferPoolAcquireParams
}
// UnsafeBufferPoolAcquireParamsFromGlibBorrow is used to convert raw C.GstBufferPoolAcquireParams pointers to go. This is used by the bindings internally.
func UnsafeBufferPoolAcquireParamsFromGlibBorrow(p unsafe.Pointer) *BufferPoolAcquireParams {
return &BufferPoolAcquireParams{&bufferPoolAcquireParams{(*C.GstBufferPoolAcquireParams)(p)}}
}
// UnsafeBufferPoolAcquireParamsFromGlibNone is used to convert raw C.GstBufferPoolAcquireParams pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferPoolAcquireParamsFromGlibNone(p unsafe.Pointer) *BufferPoolAcquireParams {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBufferPoolAcquireParamsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferPoolAcquireParams,
func (intern *bufferPoolAcquireParams) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferPoolAcquireParamsFromGlibFull is used to convert raw C.GstBufferPoolAcquireParams pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferPoolAcquireParamsFromGlibFull(p unsafe.Pointer) *BufferPoolAcquireParams {
wrapped := UnsafeBufferPoolAcquireParamsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferPoolAcquireParams,
func (intern *bufferPoolAcquireParams) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferPoolAcquireParamsFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [BufferPoolAcquireParams] is expected to work anymore.
func UnsafeBufferPoolAcquireParamsFree(b *BufferPoolAcquireParams) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBufferPoolAcquireParamsToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBufferPoolAcquireParamsToGlibNone(b *BufferPoolAcquireParams) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBufferPoolAcquireParamsToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBufferPoolAcquireParamsToGlibFull(b *BufferPoolAcquireParams) unsafe.Pointer {
runtime.SetFinalizer(b.bufferPoolAcquireParams, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // BufferPoolAcquireParams is invalid from here on
return _p
}
// BufferPoolClass wraps GstBufferPoolClass
//
// The #GstBufferPool class.
type BufferPoolClass struct {
*bufferPoolClass
}
// bufferPoolClass is the struct that's finalized
type bufferPoolClass struct {
native *C.GstBufferPoolClass
}
// UnsafeBufferPoolClassFromGlibBorrow is used to convert raw C.GstBufferPoolClass pointers to go. This is used by the bindings internally.
func UnsafeBufferPoolClassFromGlibBorrow(p unsafe.Pointer) *BufferPoolClass {
return &BufferPoolClass{&bufferPoolClass{(*C.GstBufferPoolClass)(p)}}
}
// UnsafeBufferPoolClassFromGlibNone is used to convert raw C.GstBufferPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferPoolClassFromGlibNone(p unsafe.Pointer) *BufferPoolClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBufferPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferPoolClass,
func (intern *bufferPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferPoolClassFromGlibFull is used to convert raw C.GstBufferPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBufferPoolClassFromGlibFull(p unsafe.Pointer) *BufferPoolClass {
wrapped := UnsafeBufferPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.bufferPoolClass,
func (intern *bufferPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBufferPoolClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [BufferPoolClass] is expected to work anymore.
func UnsafeBufferPoolClassFree(b *BufferPoolClass) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBufferPoolClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBufferPoolClassToGlibNone(b *BufferPoolClass) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBufferPoolClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBufferPoolClassToGlibFull(b *BufferPoolClass) unsafe.Pointer {
runtime.SetFinalizer(b.bufferPoolClass, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // BufferPoolClass is invalid from here on
return _p
}
// BusClass wraps GstBusClass
//
// GStreamer bus class.
type BusClass struct {
*busClass
}
// busClass is the struct that's finalized
type busClass struct {
native *C.GstBusClass
}
// UnsafeBusClassFromGlibBorrow is used to convert raw C.GstBusClass pointers to go. This is used by the bindings internally.
func UnsafeBusClassFromGlibBorrow(p unsafe.Pointer) *BusClass {
return &BusClass{&busClass{(*C.GstBusClass)(p)}}
}
// UnsafeBusClassFromGlibNone is used to convert raw C.GstBusClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBusClassFromGlibNone(p unsafe.Pointer) *BusClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeBusClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.busClass,
func (intern *busClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBusClassFromGlibFull is used to convert raw C.GstBusClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeBusClassFromGlibFull(p unsafe.Pointer) *BusClass {
wrapped := UnsafeBusClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.busClass,
func (intern *busClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeBusClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [BusClass] is expected to work anymore.
func UnsafeBusClassFree(b *BusClass) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeBusClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeBusClassToGlibNone(b *BusClass) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeBusClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeBusClassToGlibFull(b *BusClass) unsafe.Pointer {
runtime.SetFinalizer(b.busClass, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // BusClass is invalid from here on
return _p
}
// ByteArrayInterface wraps GstByteArrayInterface
//
// Interface for an array of bytes. It is expected to be subclassed to implement
// @resize virtual method using language native array implementation, such as
// GLib's #GByteArray, C++'s `std::vector&lt;uint8_t&gt;` or Rust's `Vec&lt;u8&gt;`.
//
// @resize implementation could allocate more than requested to avoid repeated
// reallocations. It can return %FALSE, or be set to %NULL, in the case the
// array cannot grow.
type ByteArrayInterface struct {
*byteArrayInterface
}
// byteArrayInterface is the struct that's finalized
type byteArrayInterface struct {
native *C.GstByteArrayInterface
}
// UnsafeByteArrayInterfaceFromGlibBorrow is used to convert raw C.GstByteArrayInterface pointers to go. This is used by the bindings internally.
func UnsafeByteArrayInterfaceFromGlibBorrow(p unsafe.Pointer) *ByteArrayInterface {
return &ByteArrayInterface{&byteArrayInterface{(*C.GstByteArrayInterface)(p)}}
}
// UnsafeByteArrayInterfaceFromGlibNone is used to convert raw C.GstByteArrayInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeByteArrayInterfaceFromGlibNone(p unsafe.Pointer) *ByteArrayInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeByteArrayInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.byteArrayInterface,
func (intern *byteArrayInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeByteArrayInterfaceFromGlibFull is used to convert raw C.GstByteArrayInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeByteArrayInterfaceFromGlibFull(p unsafe.Pointer) *ByteArrayInterface {
wrapped := UnsafeByteArrayInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.byteArrayInterface,
func (intern *byteArrayInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeByteArrayInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ByteArrayInterface] is expected to work anymore.
func UnsafeByteArrayInterfaceFree(b *ByteArrayInterface) {
C.free(unsafe.Pointer(b.native))
}
// UnsafeByteArrayInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeByteArrayInterfaceToGlibNone(b *ByteArrayInterface) unsafe.Pointer {
return unsafe.Pointer(b.native)
}
// UnsafeByteArrayInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeByteArrayInterfaceToGlibFull(b *ByteArrayInterface) unsafe.Pointer {
runtime.SetFinalizer(b.byteArrayInterface, nil)
_p := unsafe.Pointer(b.native)
b.native = nil // ByteArrayInterface is invalid from here on
return _p
}
// Caps wraps GstCaps
//
// Caps (capabilities) are lightweight refcounted objects describing media types.
// They are composed of an array of #GstStructure.
//
// Caps are exposed on #GstPadTemplate to describe all possible types a
// given pad can handle. They are also stored in the #GstRegistry along with
// a description of the #GstElement.
//
// Caps are exposed on the element pads using the gst_pad_query_caps() pad
// function. This function describes the possible types that the pad can
// handle or produce at runtime.
//
// A #GstCaps can be constructed with the following code fragment:
//
// ``` C
// GstCaps *caps = gst_caps_new_simple ("video/x-raw",
// "format", G_TYPE_STRING, "I420",
// "framerate", GST_TYPE_FRACTION, 25, 1,
// "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
// "width", G_TYPE_INT, 320,
// "height", G_TYPE_INT, 240,
// NULL);
// ```
//
// A #GstCaps is fixed when it has no fields with ranges or lists. Use
// gst_caps_is_fixed() to test for fixed caps. Fixed caps can be used in a
// caps event to notify downstream elements of the current media type.
//
// Various methods exist to work with the media types such as subtracting
// or intersecting.
//
// Be aware that until 1.20 the #GstCaps / #GstStructure serialization into string
// had limited support for nested #GstCaps / #GstStructure fields. It could only
// support one level of nesting. Using more levels would lead to unexpected
// behavior when using serialization features, such as gst_caps_to_string() or
// gst_value_serialize() and their counterparts.
type Caps struct {
*caps
}
// caps is the struct that's finalized
type caps struct {
native *C.GstCaps
}
var _ gobject.GoValueInitializer = (*Caps)(nil)
func marshalCaps(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeCapsFromGlibBorrow(b), nil
}
func (r *Caps) InitGoValue(v *gobject.Value) {
v.Init(TypeCaps)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeCapsFromGlibBorrow is used to convert raw C.GstCaps pointers to go. This is used by the bindings internally.
func UnsafeCapsFromGlibBorrow(p unsafe.Pointer) *Caps {
return &Caps{&caps{(*C.GstCaps)(p)}}
}
// UnsafeCapsFromGlibNone is used to convert raw C.GstCaps pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCapsFromGlibNone(p unsafe.Pointer) *Caps {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeCapsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.caps,
func (intern *caps) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeCapsFromGlibFull is used to convert raw C.GstCaps pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCapsFromGlibFull(p unsafe.Pointer) *Caps {
wrapped := UnsafeCapsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.caps,
func (intern *caps) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeCapsFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Caps] is expected to work anymore.
func UnsafeCapsFree(c *Caps) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeCapsToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeCapsToGlibNone(c *Caps) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeCapsToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeCapsToGlibFull(c *Caps) unsafe.Pointer {
runtime.SetFinalizer(c.caps, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // Caps is invalid from here on
return _p
}
// NewCapsAny wraps gst_caps_new_any
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps that indicates that it is compatible with
// any media format.
func NewCapsAny() *Caps {
var cret *C.GstCaps // return, full, converted
cret = C.gst_caps_new_any()
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewCapsEmpty wraps gst_caps_new_empty
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps that is empty. That is, the returned
// #GstCaps contains no media formats.
// The #GstCaps is guaranteed to be writable.
func NewCapsEmpty() *Caps {
var cret *C.GstCaps // return, full, converted
cret = C.gst_caps_new_empty()
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewCapsEmptySimple wraps gst_caps_new_empty_simple
//
// The function takes the following parameters:
//
// - mediaType string: the media type of the structure
//
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps that contains one #GstStructure with name
// @media_type.
func NewCapsEmptySimple(mediaType string) *Caps {
var carg1 *C.char // in, none, string, casted *C.gchar
var cret *C.GstCaps // return, full, converted
carg1 = (*C.char)(unsafe.Pointer(C.CString(mediaType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_caps_new_empty_simple(carg1)
runtime.KeepAlive(mediaType)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Append wraps gst_caps_append
//
// The function takes the following parameters:
//
// - caps2 *Caps: the #GstCaps to append
//
// Appends the structures contained in @caps2 to @caps1. The structures in
// @caps2 are not copied -- they are transferred to @caps1, and then @caps2 is
// freed. If either caps is ANY, the resulting caps will be ANY.
func (caps1 *Caps) Append(caps2 *Caps) {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibFull(caps2))
C.gst_caps_append(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
}
// AppendStructure wraps gst_caps_append_structure
//
// The function takes the following parameters:
//
// - structure *Structure: the #GstStructure to append
//
// Appends @structure to @caps. The structure is not copied; @caps
// becomes the owner of @structure.
func (caps *Caps) AppendStructure(structure *Structure) {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
C.gst_caps_append_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
}
// AppendStructureFull wraps gst_caps_append_structure_full
//
// The function takes the following parameters:
//
// - structure *Structure: the #GstStructure to append
// - features *CapsFeatures (nullable): the #GstCapsFeatures to append
//
// Appends @structure with @features to @caps. The structure is not copied; @caps
// becomes the owner of @structure.
func (caps *Caps) AppendStructureFull(structure *Structure, features *CapsFeatures) {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var carg2 *C.GstCapsFeatures // in, full, converted, nullable
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
if features != nil {
carg2 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibFull(features))
}
C.gst_caps_append_structure_full(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
runtime.KeepAlive(features)
}
// CanIntersect wraps gst_caps_can_intersect
//
// The function takes the following parameters:
//
// - caps2 *Caps: a #GstCaps to intersect
//
// The function returns the following values:
//
// - goret bool
//
// Tries intersecting @caps1 and @caps2 and reports whether the result would not
// be empty
func (caps1 *Caps) CanIntersect(caps2 *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_can_intersect(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Copy wraps gst_caps_copy
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps as a copy of the old @caps. The new caps will have a
// refcount of 1, owned by the caller. The structures are copied as well.
//
// Note that this function is the semantic equivalent of a gst_caps_ref()
// followed by a gst_caps_make_writable(). If you only want to hold on to a
// reference to the data, you should use gst_caps_ref().
func (caps *Caps) Copy() *Caps {
var carg0 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_copy(carg0)
runtime.KeepAlive(caps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CopyNth wraps gst_caps_copy_nth
//
// The function takes the following parameters:
//
// - nth uint: the nth structure to copy
//
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps and appends a copy of the nth structure
// contained in @caps.
func (caps *Caps) CopyNth(nth uint) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(nth)
cret = C.gst_caps_copy_nth(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(nth)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// FilterAndMapInPlace wraps gst_caps_filter_and_map_in_place
//
// The function takes the following parameters:
//
// - fn CapsFilterMapFunc: a function to call for each field
//
// Calls the provided function once for each structure and caps feature in the
// #GstCaps. In contrast to gst_caps_foreach(), the function may modify the
// structure and features. In contrast to gst_caps_map_in_place(), the structure
// and features are removed from the caps if %FALSE is returned from the
// function. The caps must be mutable.
func (caps *Caps) FilterAndMapInPlace(fn CapsFilterMapFunc) {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.GstCapsFilterMapFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*[0]byte)(C._gotk4_gst1_CapsFilterMapFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
C.gst_caps_filter_and_map_in_place(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(fn)
}
// Fixate wraps gst_caps_fixate
// The function returns the following values:
//
// - goret *Caps
//
// Modifies the given @caps into a representation with only fixed
// values. First the caps will be truncated and then the first structure will be
// fixated with gst_structure_fixate().
//
// This function takes ownership of @caps and will call gst_caps_make_writable()
// on it so you must not use @caps afterwards unless you keep an additional
// reference to it with gst_caps_ref().
//
// Note that it is not guaranteed that the returned caps have exactly one
// structure. If @caps are empty caps then the returned caps will be
// the empty too and contain no structure at all.
//
// Calling this function with ANY caps is not allowed.
func (caps *Caps) Fixate() *Caps {
var carg0 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_fixate(carg0)
runtime.KeepAlive(caps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ForEach wraps gst_caps_foreach
//
// The function takes the following parameters:
//
// - fn CapsForEachFunc: a function to call for each field
//
// The function returns the following values:
//
// - goret bool
//
// Calls the provided function once for each structure and caps feature in the
// #GstCaps. The function must not modify the fields.
// Also see gst_caps_map_in_place() and gst_caps_filter_and_map_in_place().
func (caps *Caps) ForEach(fn CapsForEachFunc) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.GstCapsForeachFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*[0]byte)(C._gotk4_gst1_CapsForEachFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_caps_foreach(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetFeatures wraps gst_caps_get_features
//
// The function takes the following parameters:
//
// - index uint: the index of the structure
//
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Finds the features in @caps at @index, and returns it.
//
// WARNING: This function takes a `const GstCaps *`, but returns a
// non-const `GstCapsFeatures *`. This is for programming convenience --
// the caller should be aware that features inside a constant
// #GstCaps should not be modified. However, if you know the caps
// are writable, either because you have just copied them or made
// them writable with gst_caps_make_writable(), you may modify the
// features returned in the usual way, e.g. with functions like
// gst_caps_features_add().
func (caps *Caps) GetFeatures(index uint) *CapsFeatures {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstCapsFeatures // return, none, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(index)
cret = C.gst_caps_get_features(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(index)
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetSize wraps gst_caps_get_size
// The function returns the following values:
//
// - goret uint
//
// Gets the number of structures contained in @caps.
func (caps *Caps) GetSize() uint {
var carg0 *C.GstCaps // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_get_size(carg0)
runtime.KeepAlive(caps)
var goret uint
goret = uint(cret)
return goret
}
// GetStructure wraps gst_caps_get_structure
//
// The function takes the following parameters:
//
// - index uint: the index of the structure
//
// The function returns the following values:
//
// - goret *Structure
//
// Finds the structure in @caps at @index, and returns it.
//
// WARNING: This function takes a `const GstCaps *`, but returns a
// non-const `GstStructure *`. This is for programming convenience --
// the caller should be aware that structures inside a constant
// #GstCaps should not be modified. However, if you know the caps
// are writable, either because you have just copied them or made
// them writable with gst_caps_make_writable(), you may modify the
// structure returned in the usual way, e.g. with functions like
// gst_structure_set().
func (caps *Caps) GetStructure(index uint) *Structure {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(index)
cret = C.gst_caps_get_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(index)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Caps) {}, caps)
return goret
}
// Intersect wraps gst_caps_intersect
//
// The function takes the following parameters:
//
// - caps2 *Caps: a #GstCaps to intersect
//
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps that contains all the formats that are common
// to both @caps1 and @caps2. Defaults to %GST_CAPS_INTERSECT_ZIG_ZAG mode.
func (caps1 *Caps) Intersect(caps2 *Caps) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_intersect(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IntersectFull wraps gst_caps_intersect_full
//
// The function takes the following parameters:
//
// - caps2 *Caps: a #GstCaps to intersect
// - mode CapsIntersectMode: The intersection algorithm/mode to use
//
// The function returns the following values:
//
// - goret *Caps
//
// Creates a new #GstCaps that contains all the formats that are common
// to both @caps1 and @caps2, the order is defined by the #GstCapsIntersectMode
// used.
func (caps1 *Caps) IntersectFull(caps2 *Caps, mode CapsIntersectMode) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var carg2 C.GstCapsIntersectMode // in, none, casted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
carg2 = C.GstCapsIntersectMode(mode)
cret = C.gst_caps_intersect_full(carg0, carg1, carg2)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
runtime.KeepAlive(mode)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IsAlwaysCompatible wraps gst_caps_is_always_compatible
//
// The function takes the following parameters:
//
// - caps2 *Caps: the #GstCaps to test
//
// The function returns the following values:
//
// - goret bool
//
// A given #GstCaps structure is always compatible with another if
// every media format that is in the first is also contained in the
// second. That is, @caps1 is a subset of @caps2.
func (caps1 *Caps) IsAlwaysCompatible(caps2 *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_is_always_compatible(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsAny wraps gst_caps_is_any
// The function returns the following values:
//
// - goret bool
//
// Determines if @caps represents any media format.
func (caps *Caps) IsAny() bool {
var carg0 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_is_any(carg0)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsEmpty wraps gst_caps_is_empty
// The function returns the following values:
//
// - goret bool
//
// Determines if @caps represents no media formats.
func (caps *Caps) IsEmpty() bool {
var carg0 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_is_empty(carg0)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsEqual wraps gst_caps_is_equal
//
// The function takes the following parameters:
//
// - caps2 *Caps: another #GstCaps
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the given caps represent the same set of caps.
func (caps1 *Caps) IsEqual(caps2 *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_is_equal(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsEqualFixed wraps gst_caps_is_equal_fixed
//
// The function takes the following parameters:
//
// - caps2 *Caps: the #GstCaps to test
//
// The function returns the following values:
//
// - goret bool
//
// Tests if two #GstCaps are equal. This function only works on fixed
// #GstCaps.
func (caps1 *Caps) IsEqualFixed(caps2 *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_is_equal_fixed(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsFixed wraps gst_caps_is_fixed
// The function returns the following values:
//
// - goret bool
//
// Fixed #GstCaps describe exactly one format, that is, they have exactly
// one structure, and each field in the structure describes a fixed type.
// Examples of non-fixed types are GST_TYPE_INT_RANGE and GST_TYPE_LIST.
func (caps *Caps) IsFixed() bool {
var carg0 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_is_fixed(carg0)
runtime.KeepAlive(caps)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsStrictlyEqual wraps gst_caps_is_strictly_equal
//
// The function takes the following parameters:
//
// - caps2 *Caps: another #GstCaps
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the given caps are exactly the same set of caps.
func (caps1 *Caps) IsStrictlyEqual(caps2 *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps2))
cret = C.gst_caps_is_strictly_equal(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsSubset wraps gst_caps_is_subset
//
// The function takes the following parameters:
//
// - superset *Caps: a potentially greater #GstCaps
//
// The function returns the following values:
//
// - goret bool
//
// Checks if all caps represented by @subset are also represented by @superset.
func (subset *Caps) IsSubset(superset *Caps) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(subset))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(superset))
cret = C.gst_caps_is_subset(carg0, carg1)
runtime.KeepAlive(subset)
runtime.KeepAlive(superset)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsSubsetStructure wraps gst_caps_is_subset_structure
//
// The function takes the following parameters:
//
// - structure *Structure: a potential #GstStructure subset of @caps
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @structure is a subset of @caps. See gst_caps_is_subset()
// for more information.
func (caps *Caps) IsSubsetStructure(structure *Structure) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_caps_is_subset_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsSubsetStructureFull wraps gst_caps_is_subset_structure_full
//
// The function takes the following parameters:
//
// - structure *Structure: a potential #GstStructure subset of @caps
// - features *CapsFeatures (nullable): a #GstCapsFeatures for @structure
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @structure is a subset of @caps. See gst_caps_is_subset()
// for more information.
func (caps *Caps) IsSubsetStructureFull(structure *Structure, features *CapsFeatures) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var carg2 *C.GstCapsFeatures // in, none, converted, nullable
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
if features != nil {
carg2 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
}
cret = C.gst_caps_is_subset_structure_full(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
runtime.KeepAlive(features)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MapInPlace wraps gst_caps_map_in_place
//
// The function takes the following parameters:
//
// - fn CapsMapFunc: a function to call for each field
//
// The function returns the following values:
//
// - goret bool
//
// Calls the provided function once for each structure and caps feature in the
// #GstCaps. In contrast to gst_caps_foreach(), the function may modify but not
// delete the structures and features. The caps must be mutable.
func (caps *Caps) MapInPlace(fn CapsMapFunc) bool {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.GstCapsMapFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*[0]byte)(C._gotk4_gst1_CapsMapFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_caps_map_in_place(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Merge wraps gst_caps_merge
//
// The function takes the following parameters:
//
// - caps2 *Caps: the #GstCaps to merge in
//
// The function returns the following values:
//
// - goret *Caps
//
// Appends the structures contained in @caps2 to @caps1 if they are not yet
// expressed by @caps1. The structures in @caps2 are not copied -- they are
// transferred to a writable copy of @caps1, and then @caps2 is freed.
// If either caps is ANY, the resulting caps will be ANY.
func (caps1 *Caps) Merge(caps2 *Caps) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, full, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps1))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibFull(caps2))
cret = C.gst_caps_merge(carg0, carg1)
runtime.KeepAlive(caps1)
runtime.KeepAlive(caps2)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// MergeStructure wraps gst_caps_merge_structure
//
// The function takes the following parameters:
//
// - structure *Structure: the #GstStructure to merge
//
// The function returns the following values:
//
// - goret *Caps
//
// Appends @structure to @caps if it is not already expressed by @caps.
func (caps *Caps) MergeStructure(structure *Structure) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
cret = C.gst_caps_merge_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// MergeStructureFull wraps gst_caps_merge_structure_full
//
// The function takes the following parameters:
//
// - structure *Structure: the #GstStructure to merge
// - features *CapsFeatures (nullable): the #GstCapsFeatures to merge
//
// The function returns the following values:
//
// - goret *Caps
//
// Appends @structure with @features to @caps if its not already expressed by @caps.
func (caps *Caps) MergeStructureFull(structure *Structure, features *CapsFeatures) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var carg2 *C.GstCapsFeatures // in, full, converted, nullable
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
if features != nil {
carg2 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibFull(features))
}
cret = C.gst_caps_merge_structure_full(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(structure)
runtime.KeepAlive(features)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Normalize wraps gst_caps_normalize
// The function returns the following values:
//
// - goret *Caps
//
// Returns a #GstCaps that represents the same set of formats as
// @caps, but contains no lists. Each list is expanded into separate
// #GstStructure.
//
// This function takes ownership of @caps and will call gst_caps_make_writable()
// on it so you must not use @caps afterwards unless you keep an additional
// reference to it with gst_caps_ref().
func (caps *Caps) Normalize() *Caps {
var carg0 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_normalize(carg0)
runtime.KeepAlive(caps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// RemoveStructure wraps gst_caps_remove_structure
//
// The function takes the following parameters:
//
// - idx uint: Index of the structure to remove
//
// Removes the structure with the given index from the list of structures
// contained in @caps.
func (caps *Caps) RemoveStructure(idx uint) {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(idx)
C.gst_caps_remove_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(idx)
}
// Serialize wraps gst_caps_serialize
//
// The function takes the following parameters:
//
// - flags SerializeFlags: a #GstSerializeFlags
//
// The function returns the following values:
//
// - goret string
//
// Converts @caps to a string representation. This string representation can be
// converted back to a #GstCaps by gst_caps_from_string().
//
// This prints the caps in human readable form.
//
// This version of the caps serialization function introduces support for nested
// structures and caps but the resulting strings won't be parsable with
// GStreamer prior to 1.20 unless #GST_SERIALIZE_FLAG_BACKWARD_COMPAT is passed
// as @flag.
func (caps *Caps) Serialize(flags SerializeFlags) string {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.GstSerializeFlags // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.GstSerializeFlags(flags)
cret = C.gst_caps_serialize(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(flags)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// SetFeatures wraps gst_caps_set_features
//
// The function takes the following parameters:
//
// - index uint: the index of the structure
// - features *CapsFeatures (nullable): the #GstCapsFeatures to set
//
// Sets the @features for the structure at @index.
func (caps *Caps) SetFeatures(index uint, features *CapsFeatures) {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstCapsFeatures // in, full, converted, nullable
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(index)
if features != nil {
carg2 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibFull(features))
}
C.gst_caps_set_features(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(index)
runtime.KeepAlive(features)
}
// SetFeaturesSimple wraps gst_caps_set_features_simple
//
// The function takes the following parameters:
//
// - features *CapsFeatures (nullable): the #GstCapsFeatures to set
//
// Sets the @features for all the structures of @caps.
func (caps *Caps) SetFeaturesSimple(features *CapsFeatures) {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCapsFeatures // in, full, converted, nullable
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
if features != nil {
carg1 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibFull(features))
}
C.gst_caps_set_features_simple(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(features)
}
// SetValue wraps gst_caps_set_value
//
// The function takes the following parameters:
//
// - field string: name of the field to set
// - value *gobject.Value: value to set the field to
//
// Sets the given @field on all structures of @caps to the given @value.
// This is a convenience function for calling gst_structure_set_value() on
// all structures of @caps.
func (caps *Caps) SetValue(field string, value *gobject.Value) {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 *C.GValue // in, none, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = (*C.char)(unsafe.Pointer(C.CString(field)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
C.gst_caps_set_value(carg0, carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(field)
runtime.KeepAlive(value)
}
// Simplify wraps gst_caps_simplify
// The function returns the following values:
//
// - goret *Caps
//
// Converts the given @caps into a representation that represents the
// same set of formats, but in a simpler form. Component structures that are
// identical are merged. Component structures that have values that can be
// merged are also merged.
//
// This function takes ownership of @caps and will call gst_caps_make_writable()
// on it if necessary, so you must not use @caps afterwards unless you keep an
// additional reference to it with gst_caps_ref().
//
// This method does not preserve the original order of @caps.
func (caps *Caps) Simplify() *Caps {
var carg0 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_simplify(carg0)
runtime.KeepAlive(caps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// StealStructure wraps gst_caps_steal_structure
//
// The function takes the following parameters:
//
// - index uint: Index of the structure to retrieve
//
// The function returns the following values:
//
// - goret *Structure
//
// Retrieves the structure with the given index from the list of structures
// contained in @caps. The caller becomes the owner of the returned structure.
func (caps *Caps) StealStructure(index uint) *Structure {
var carg0 *C.GstCaps // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstStructure // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
carg1 = C.guint(index)
cret = C.gst_caps_steal_structure(carg0, carg1)
runtime.KeepAlive(caps)
runtime.KeepAlive(index)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Subtract wraps gst_caps_subtract
//
// The function takes the following parameters:
//
// - subtrahend *Caps: #GstCaps to subtract
//
// The function returns the following values:
//
// - goret *Caps
//
// Subtracts the @subtrahend from the @minuend.
// &gt; This function does not work reliably if optional properties for caps
// &gt; are included on one caps and omitted on the other.
func (minuend *Caps) Subtract(subtrahend *Caps) *Caps {
var carg0 *C.GstCaps // in, none, converted
var carg1 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(minuend))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(subtrahend))
cret = C.gst_caps_subtract(carg0, carg1)
runtime.KeepAlive(minuend)
runtime.KeepAlive(subtrahend)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ToString wraps gst_caps_to_string
// The function returns the following values:
//
// - goret string
//
// Converts @caps to a string representation. This string representation
// can be converted back to a #GstCaps by gst_caps_from_string().
//
// For debugging purposes its easier to do something like this:
//
// ``` C
// GST_LOG ("caps are %" GST_PTR_FORMAT, caps);
// ```
//
// This prints the caps in human readable form.
//
// The implementation of serialization up to 1.20 would lead to unexpected results
// when there were nested #GstCaps / #GstStructure deeper than one level.
func (caps *Caps) ToString() string {
var carg0 *C.GstCaps // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_to_string(carg0)
runtime.KeepAlive(caps)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// Truncate wraps gst_caps_truncate
// The function returns the following values:
//
// - goret *Caps
//
// Discards all but the first structure from @caps. Useful when
// fixating.
//
// This function takes ownership of @caps and will call gst_caps_make_writable()
// on it if necessary, so you must not use @caps afterwards unless you keep an
// additional reference to it with gst_caps_ref().
//
// Note that it is not guaranteed that the returned caps have exactly one
// structure. If @caps is any or empty caps then the returned caps will be
// the same and contain no structure at all.
func (caps *Caps) Truncate() *Caps {
var carg0 *C.GstCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_caps_truncate(carg0)
runtime.KeepAlive(caps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CapsFeatures wraps GstCapsFeatures
//
// #GstCapsFeatures can optionally be set on a #GstCaps to add requirements
// for additional features for a specific #GstStructure. Caps structures with
// the same name but with a non-equal set of caps features are not compatible.
// If a pad supports multiple sets of features it has to add multiple equal
// structures with different feature sets to the caps.
//
// Empty #GstCapsFeatures are equivalent with the #GstCapsFeatures that only
// contain #GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY #GstCapsFeatures as
// created by gst_caps_features_new_any() are equal to any other #GstCapsFeatures
// and can be used to specify that any #GstCapsFeatures would be supported, e.g.
// for elements that don't touch buffer memory. #GstCaps with ANY #GstCapsFeatures
// are considered non-fixed and during negotiation some #GstCapsFeatures have
// to be selected.
//
// Examples for caps features would be the requirement of a specific #GstMemory
// types or the requirement of having a specific #GstMeta on the buffer. Features
// are given as a string of the format `memory:GstMemoryTypeName` or
// `meta:GstMetaAPIName`.
type CapsFeatures struct {
*capsFeatures
}
// capsFeatures is the struct that's finalized
type capsFeatures struct {
native *C.GstCapsFeatures
}
var _ gobject.GoValueInitializer = (*CapsFeatures)(nil)
func marshalCapsFeatures(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeCapsFeaturesFromGlibBorrow(b), nil
}
func (r *CapsFeatures) InitGoValue(v *gobject.Value) {
v.Init(TypeCapsFeatures)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeCapsFeaturesFromGlibBorrow is used to convert raw C.GstCapsFeatures pointers to go. This is used by the bindings internally.
func UnsafeCapsFeaturesFromGlibBorrow(p unsafe.Pointer) *CapsFeatures {
return &CapsFeatures{&capsFeatures{(*C.GstCapsFeatures)(p)}}
}
// UnsafeCapsFeaturesFromGlibNone is used to convert raw C.GstCapsFeatures pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCapsFeaturesFromGlibNone(p unsafe.Pointer) *CapsFeatures {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeCapsFeaturesFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.capsFeatures,
func (intern *capsFeatures) {
C.gst_caps_features_free(intern.native)
},
)
return wrapped
}
// UnsafeCapsFeaturesFromGlibFull is used to convert raw C.GstCapsFeatures pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCapsFeaturesFromGlibFull(p unsafe.Pointer) *CapsFeatures {
wrapped := UnsafeCapsFeaturesFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.capsFeatures,
func (intern *capsFeatures) {
C.gst_caps_features_free(intern.native)
},
)
return wrapped
}
// UnsafeCapsFeaturesFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [CapsFeatures] is expected to work anymore.
func UnsafeCapsFeaturesFree(c *CapsFeatures) {
C.gst_caps_features_free(c.native)
}
// UnsafeCapsFeaturesToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeCapsFeaturesToGlibNone(c *CapsFeatures) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeCapsFeaturesToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeCapsFeaturesToGlibFull(c *CapsFeatures) unsafe.Pointer {
runtime.SetFinalizer(c.capsFeatures, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // CapsFeatures is invalid from here on
return _p
}
// NewCapsFeaturesAny wraps gst_caps_features_new_any
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Creates a new, ANY #GstCapsFeatures. This will be equal
// to any other #GstCapsFeatures but caps with these are
// unfixed.
func NewCapsFeaturesAny() *CapsFeatures {
var cret *C.GstCapsFeatures // return, full, converted
cret = C.gst_caps_features_new_any()
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewCapsFeaturesEmpty wraps gst_caps_features_new_empty
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Creates a new, empty #GstCapsFeatures.
func NewCapsFeaturesEmpty() *CapsFeatures {
var cret *C.GstCapsFeatures // return, full, converted
cret = C.gst_caps_features_new_empty()
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewCapsFeaturesSingle wraps gst_caps_features_new_single
//
// The function takes the following parameters:
//
// - feature string: The feature
//
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Creates a new #GstCapsFeatures with a single feature.
func NewCapsFeaturesSingle(feature string) *CapsFeatures {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstCapsFeatures // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(feature)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_caps_features_new_single(carg1)
runtime.KeepAlive(feature)
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Add wraps gst_caps_features_add
//
// The function takes the following parameters:
//
// - feature string: a feature.
//
// Adds @feature to @features.
func (features *CapsFeatures) Add(feature string) {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(feature)))
defer C.free(unsafe.Pointer(carg1))
C.gst_caps_features_add(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
}
// AddID wraps gst_caps_features_add_id
//
// The function takes the following parameters:
//
// - feature glib.Quark: a feature.
//
// Adds @feature to @features.
func (features *CapsFeatures) AddID(feature glib.Quark) {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = C.GQuark(feature)
C.gst_caps_features_add_id(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
}
// Contains wraps gst_caps_features_contains
//
// The function takes the following parameters:
//
// - feature string: a feature
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @features contains @feature.
func (features *CapsFeatures) Contains(feature string) bool {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(feature)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_caps_features_contains(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ContainsID wraps gst_caps_features_contains_id
//
// The function takes the following parameters:
//
// - feature glib.Quark: a feature
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @features contains @feature.
func (features *CapsFeatures) ContainsID(feature glib.Quark) bool {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = C.GQuark(feature)
cret = C.gst_caps_features_contains_id(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Copy wraps gst_caps_features_copy
// The function returns the following values:
//
// - goret *CapsFeatures
//
// Duplicates a #GstCapsFeatures and all its values.
func (features *CapsFeatures) Copy() *CapsFeatures {
var carg0 *C.GstCapsFeatures // in, none, converted
var cret *C.GstCapsFeatures // return, full, converted
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
cret = C.gst_caps_features_copy(carg0)
runtime.KeepAlive(features)
var goret *CapsFeatures
goret = UnsafeCapsFeaturesFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetNth wraps gst_caps_features_get_nth
//
// The function takes the following parameters:
//
// - i uint: index of the feature
//
// The function returns the following values:
//
// - goret string
//
// Returns the @i-th feature of @features.
func (features *CapsFeatures) GetNth(i uint) string {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = C.guint(i)
cret = C.gst_caps_features_get_nth(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(i)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetNthID wraps gst_caps_features_get_nth_id
//
// The function takes the following parameters:
//
// - i uint: index of the feature
//
// The function returns the following values:
//
// - goret glib.Quark
//
// Returns the @i-th feature of @features.
func (features *CapsFeatures) GetNthID(i uint) glib.Quark {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 C.guint // in, none, casted
var cret C.GQuark // return, none, casted, alias
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = C.guint(i)
cret = C.gst_caps_features_get_nth_id(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(i)
var goret glib.Quark
goret = glib.Quark(cret)
return goret
}
// GetSize wraps gst_caps_features_get_size
// The function returns the following values:
//
// - goret uint
//
// Returns the number of features in @features.
func (features *CapsFeatures) GetSize() uint {
var carg0 *C.GstCapsFeatures // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
cret = C.gst_caps_features_get_size(carg0)
runtime.KeepAlive(features)
var goret uint
goret = uint(cret)
return goret
}
// IsAny wraps gst_caps_features_is_any
// The function returns the following values:
//
// - goret bool
//
// Checks if @features is %GST_CAPS_FEATURES_ANY.
func (features *CapsFeatures) IsAny() bool {
var carg0 *C.GstCapsFeatures // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
cret = C.gst_caps_features_is_any(carg0)
runtime.KeepAlive(features)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsEqual wraps gst_caps_features_is_equal
//
// The function takes the following parameters:
//
// - features2 *CapsFeatures: a #GstCapsFeatures.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @features1 and @features2 are equal.
func (features1 *CapsFeatures) IsEqual(features2 *CapsFeatures) bool {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 *C.GstCapsFeatures // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features1))
carg1 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features2))
cret = C.gst_caps_features_is_equal(carg0, carg1)
runtime.KeepAlive(features1)
runtime.KeepAlive(features2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Remove wraps gst_caps_features_remove
//
// The function takes the following parameters:
//
// - feature string: a feature.
//
// Removes @feature from @features.
func (features *CapsFeatures) Remove(feature string) {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(feature)))
defer C.free(unsafe.Pointer(carg1))
C.gst_caps_features_remove(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
}
// RemoveID wraps gst_caps_features_remove_id
//
// The function takes the following parameters:
//
// - feature glib.Quark: a feature.
//
// Removes @feature from @features.
func (features *CapsFeatures) RemoveID(feature glib.Quark) {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
carg1 = C.GQuark(feature)
C.gst_caps_features_remove_id(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(feature)
}
// SetParentRefcount wraps gst_caps_features_set_parent_refcount
//
// The function takes the following parameters:
//
// - refcount *int: a pointer to the parent's refcount
//
// The function returns the following values:
//
// - goret bool
//
// Sets the parent_refcount field of #GstCapsFeatures. This field is used to
// determine whether a caps features is mutable or not. This function should only be
// called by code implementing parent objects of #GstCapsFeatures, as described in
// [the MT refcounting design document](additional/design/MT-refcounting.md).
func (features *CapsFeatures) SetParentRefcount(refcount *int) bool {
var carg0 *C.GstCapsFeatures // in, none, converted
var carg1 *C.gint // in, transfer: none, C Pointers: 1, Name: gint
var cret C.gboolean // return
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
_ = refcount
_ = carg1
panic("unimplemented conversion of *int (gint*)")
cret = C.gst_caps_features_set_parent_refcount(carg0, carg1)
runtime.KeepAlive(features)
runtime.KeepAlive(refcount)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ToString wraps gst_caps_features_to_string
// The function returns the following values:
//
// - goret string
//
// Converts @features to a human-readable string representation.
//
// For debugging purposes its easier to do something like this:
//
// ``` C
// GST_LOG ("features is %" GST_PTR_FORMAT, features);
// ```
//
// This prints the features in human readable form.
func (features *CapsFeatures) ToString() string {
var carg0 *C.GstCapsFeatures // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstCapsFeatures)(UnsafeCapsFeaturesToGlibNone(features))
cret = C.gst_caps_features_to_string(carg0)
runtime.KeepAlive(features)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// ChildProxyInterface wraps GstChildProxyInterface
//
// #GstChildProxy interface.
type ChildProxyInterface struct {
*childProxyInterface
}
// childProxyInterface is the struct that's finalized
type childProxyInterface struct {
native *C.GstChildProxyInterface
}
// UnsafeChildProxyInterfaceFromGlibBorrow is used to convert raw C.GstChildProxyInterface pointers to go. This is used by the bindings internally.
func UnsafeChildProxyInterfaceFromGlibBorrow(p unsafe.Pointer) *ChildProxyInterface {
return &ChildProxyInterface{&childProxyInterface{(*C.GstChildProxyInterface)(p)}}
}
// UnsafeChildProxyInterfaceFromGlibNone is used to convert raw C.GstChildProxyInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeChildProxyInterfaceFromGlibNone(p unsafe.Pointer) *ChildProxyInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeChildProxyInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.childProxyInterface,
func (intern *childProxyInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeChildProxyInterfaceFromGlibFull is used to convert raw C.GstChildProxyInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeChildProxyInterfaceFromGlibFull(p unsafe.Pointer) *ChildProxyInterface {
wrapped := UnsafeChildProxyInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.childProxyInterface,
func (intern *childProxyInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeChildProxyInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ChildProxyInterface] is expected to work anymore.
func UnsafeChildProxyInterfaceFree(c *ChildProxyInterface) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeChildProxyInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeChildProxyInterfaceToGlibNone(c *ChildProxyInterface) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeChildProxyInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeChildProxyInterfaceToGlibFull(c *ChildProxyInterface) unsafe.Pointer {
runtime.SetFinalizer(c.childProxyInterface, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // ChildProxyInterface is invalid from here on
return _p
}
// ClockClass wraps GstClockClass
//
// GStreamer clock class. Override the vmethods to implement the clock
// functionality.
type ClockClass struct {
*clockClass
}
// clockClass is the struct that's finalized
type clockClass struct {
native *C.GstClockClass
}
// UnsafeClockClassFromGlibBorrow is used to convert raw C.GstClockClass pointers to go. This is used by the bindings internally.
func UnsafeClockClassFromGlibBorrow(p unsafe.Pointer) *ClockClass {
return &ClockClass{&clockClass{(*C.GstClockClass)(p)}}
}
// UnsafeClockClassFromGlibNone is used to convert raw C.GstClockClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeClockClassFromGlibNone(p unsafe.Pointer) *ClockClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeClockClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.clockClass,
func (intern *clockClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeClockClassFromGlibFull is used to convert raw C.GstClockClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeClockClassFromGlibFull(p unsafe.Pointer) *ClockClass {
wrapped := UnsafeClockClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.clockClass,
func (intern *clockClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeClockClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ClockClass] is expected to work anymore.
func UnsafeClockClassFree(c *ClockClass) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeClockClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeClockClassToGlibNone(c *ClockClass) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeClockClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeClockClassToGlibFull(c *ClockClass) unsafe.Pointer {
runtime.SetFinalizer(c.clockClass, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // ClockClass is invalid from here on
return _p
}
// ClockEntry wraps GstClockEntry
//
// All pending timeouts or periodic notifies are converted into
// an entry.
// Note that GstClockEntry should be treated as an opaque structure. It must
// not be extended or allocated using a custom allocator.
type ClockEntry struct {
*clockEntry
}
// clockEntry is the struct that's finalized
type clockEntry struct {
native *C.GstClockEntry
}
// UnsafeClockEntryFromGlibBorrow is used to convert raw C.GstClockEntry pointers to go. This is used by the bindings internally.
func UnsafeClockEntryFromGlibBorrow(p unsafe.Pointer) *ClockEntry {
return &ClockEntry{&clockEntry{(*C.GstClockEntry)(p)}}
}
// UnsafeClockEntryFromGlibNone is used to convert raw C.GstClockEntry pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeClockEntryFromGlibNone(p unsafe.Pointer) *ClockEntry {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeClockEntryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.clockEntry,
func (intern *clockEntry) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeClockEntryFromGlibFull is used to convert raw C.GstClockEntry pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeClockEntryFromGlibFull(p unsafe.Pointer) *ClockEntry {
wrapped := UnsafeClockEntryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.clockEntry,
func (intern *clockEntry) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeClockEntryFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ClockEntry] is expected to work anymore.
func UnsafeClockEntryFree(c *ClockEntry) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeClockEntryToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeClockEntryToGlibNone(c *ClockEntry) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeClockEntryToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeClockEntryToGlibFull(c *ClockEntry) unsafe.Pointer {
runtime.SetFinalizer(c.clockEntry, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // ClockEntry is invalid from here on
return _p
}
// Context wraps GstContext
//
// #GstContext is a container object used to store contexts like a device
// context, a display server connection and similar concepts that should
// be shared between multiple elements.
//
// Applications can set a context on a complete pipeline by using
// gst_element_set_context(), which will then be propagated to all
// child elements. Elements can handle these in #GstElementClass::set_context
// and merge them with the context information they already have.
//
// When an element needs a context it will do the following actions in this
// order until one step succeeds:
//
// 1. Check if the element already has a context
// 2. Query downstream with %GST_QUERY_CONTEXT for the context
// 3. Query upstream with %GST_QUERY_CONTEXT for the context
// 4. Post a %GST_MESSAGE_NEED_CONTEXT message on the bus with the required
// context types and afterwards check if a usable context was set now
// 5. Create a context by itself and post a %GST_MESSAGE_HAVE_CONTEXT message
// on the bus.
//
// Bins will catch %GST_MESSAGE_NEED_CONTEXT messages and will set any previously
// known context on the element that asks for it if possible. Otherwise the
// application should provide one if it can.
//
// #GstContext can be persistent.
// A persistent #GstContext is kept in elements when they reach
// %GST_STATE_NULL, non-persistent ones will be removed.
// Also, a non-persistent context won't override a previous persistent
// context set to an element.
type Context struct {
*_context
}
// _context is the struct that's finalized
type _context struct {
native *C.GstContext
}
var _ gobject.GoValueInitializer = (*Context)(nil)
func marshalContext(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeContextFromGlibBorrow(b), nil
}
func (r *Context) InitGoValue(v *gobject.Value) {
v.Init(TypeContext)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeContextFromGlibBorrow is used to convert raw C.GstContext pointers to go. This is used by the bindings internally.
func UnsafeContextFromGlibBorrow(p unsafe.Pointer) *Context {
return &Context{&_context{(*C.GstContext)(p)}}
}
// UnsafeContextFromGlibNone is used to convert raw C.GstContext pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeContextFromGlibNone(p unsafe.Pointer) *Context {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeContextFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped._context,
func (intern *_context) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeContextFromGlibFull is used to convert raw C.GstContext pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeContextFromGlibFull(p unsafe.Pointer) *Context {
wrapped := UnsafeContextFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped._context,
func (intern *_context) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeContextFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Context] is expected to work anymore.
func UnsafeContextFree(c *Context) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeContextToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeContextToGlibNone(c *Context) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeContextToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeContextToGlibFull(c *Context) unsafe.Pointer {
runtime.SetFinalizer(c._context, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // Context is invalid from here on
return _p
}
// NewContext wraps gst_context_new
//
// The function takes the following parameters:
//
// - contextType string: Context type
// - persistent bool: Persistent context
//
// The function returns the following values:
//
// - goret *Context
//
// Creates a new context.
func NewContext(contextType string, persistent bool) *Context {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
var cret *C.GstContext // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg1))
if persistent {
carg2 = C.TRUE
}
cret = C.gst_context_new(carg1, carg2)
runtime.KeepAlive(contextType)
runtime.KeepAlive(persistent)
var goret *Context
goret = UnsafeContextFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetContextType wraps gst_context_get_context_type
// The function returns the following values:
//
// - goret string
//
// Gets the type of @context.
func (_context *Context) GetContextType() string {
var carg0 *C.GstContext // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
cret = C.gst_context_get_context_type(carg0)
runtime.KeepAlive(_context)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetStructure wraps gst_context_get_structure
// The function returns the following values:
//
// - goret *Structure
//
// Accesses the structure of the context.
func (_context *Context) GetStructure() *Structure {
var carg0 *C.GstContext // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
cret = C.gst_context_get_structure(carg0)
runtime.KeepAlive(_context)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// HasContextType wraps gst_context_has_context_type
//
// The function takes the following parameters:
//
// - contextType string: Context type to check.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @context has @context_type.
func (_context *Context) HasContextType(contextType string) bool {
var carg0 *C.GstContext // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_context_has_context_type(carg0, carg1)
runtime.KeepAlive(_context)
runtime.KeepAlive(contextType)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsPersistent wraps gst_context_is_persistent
// The function returns the following values:
//
// - goret bool
//
// Checks if @context is persistent.
func (_context *Context) IsPersistent() bool {
var carg0 *C.GstContext // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
cret = C.gst_context_is_persistent(carg0)
runtime.KeepAlive(_context)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// WritableStructure wraps gst_context_writable_structure
// The function returns the following values:
//
// - goret *Structure
//
// Gets a writable version of the structure.
func (_context *Context) WritableStructure() *Structure {
var carg0 *C.GstContext // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
cret = C.gst_context_writable_structure(carg0)
runtime.KeepAlive(_context)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// ControlBindingClass wraps GstControlBindingClass
//
// The class structure of #GstControlBinding.
type ControlBindingClass struct {
*controlBindingClass
}
// controlBindingClass is the struct that's finalized
type controlBindingClass struct {
native *C.GstControlBindingClass
}
// UnsafeControlBindingClassFromGlibBorrow is used to convert raw C.GstControlBindingClass pointers to go. This is used by the bindings internally.
func UnsafeControlBindingClassFromGlibBorrow(p unsafe.Pointer) *ControlBindingClass {
return &ControlBindingClass{&controlBindingClass{(*C.GstControlBindingClass)(p)}}
}
// UnsafeControlBindingClassFromGlibNone is used to convert raw C.GstControlBindingClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeControlBindingClassFromGlibNone(p unsafe.Pointer) *ControlBindingClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeControlBindingClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.controlBindingClass,
func (intern *controlBindingClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeControlBindingClassFromGlibFull is used to convert raw C.GstControlBindingClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeControlBindingClassFromGlibFull(p unsafe.Pointer) *ControlBindingClass {
wrapped := UnsafeControlBindingClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.controlBindingClass,
func (intern *controlBindingClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeControlBindingClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ControlBindingClass] is expected to work anymore.
func UnsafeControlBindingClassFree(c *ControlBindingClass) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeControlBindingClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeControlBindingClassToGlibNone(c *ControlBindingClass) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeControlBindingClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeControlBindingClassToGlibFull(c *ControlBindingClass) unsafe.Pointer {
runtime.SetFinalizer(c.controlBindingClass, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // ControlBindingClass is invalid from here on
return _p
}
// ControlSourceClass wraps GstControlSourceClass
//
// The class structure of #GstControlSource.
type ControlSourceClass struct {
*controlSourceClass
}
// controlSourceClass is the struct that's finalized
type controlSourceClass struct {
native *C.GstControlSourceClass
}
// UnsafeControlSourceClassFromGlibBorrow is used to convert raw C.GstControlSourceClass pointers to go. This is used by the bindings internally.
func UnsafeControlSourceClassFromGlibBorrow(p unsafe.Pointer) *ControlSourceClass {
return &ControlSourceClass{&controlSourceClass{(*C.GstControlSourceClass)(p)}}
}
// UnsafeControlSourceClassFromGlibNone is used to convert raw C.GstControlSourceClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeControlSourceClassFromGlibNone(p unsafe.Pointer) *ControlSourceClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeControlSourceClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.controlSourceClass,
func (intern *controlSourceClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeControlSourceClassFromGlibFull is used to convert raw C.GstControlSourceClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeControlSourceClassFromGlibFull(p unsafe.Pointer) *ControlSourceClass {
wrapped := UnsafeControlSourceClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.controlSourceClass,
func (intern *controlSourceClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeControlSourceClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ControlSourceClass] is expected to work anymore.
func UnsafeControlSourceClassFree(c *ControlSourceClass) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeControlSourceClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeControlSourceClassToGlibNone(c *ControlSourceClass) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeControlSourceClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeControlSourceClassToGlibFull(c *ControlSourceClass) unsafe.Pointer {
runtime.SetFinalizer(c.controlSourceClass, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // ControlSourceClass is invalid from here on
return _p
}
// CustomMeta wraps GstCustomMeta
//
// Extra custom metadata. The @structure field is the same as returned by
// gst_custom_meta_get_structure().
//
// Since 1.24 it can be serialized using gst_meta_serialize() and
// gst_meta_deserialize(), but only if the #GstStructure does not contain any
// fields that cannot be serialized, see %GST_SERIALIZE_FLAG_STRICT.
type CustomMeta struct {
*customMeta
}
// customMeta is the struct that's finalized
type customMeta struct {
native *C.GstCustomMeta
}
// UnsafeCustomMetaFromGlibBorrow is used to convert raw C.GstCustomMeta pointers to go. This is used by the bindings internally.
func UnsafeCustomMetaFromGlibBorrow(p unsafe.Pointer) *CustomMeta {
return &CustomMeta{&customMeta{(*C.GstCustomMeta)(p)}}
}
// UnsafeCustomMetaFromGlibNone is used to convert raw C.GstCustomMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCustomMetaFromGlibNone(p unsafe.Pointer) *CustomMeta {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeCustomMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.customMeta,
func (intern *customMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeCustomMetaFromGlibFull is used to convert raw C.GstCustomMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeCustomMetaFromGlibFull(p unsafe.Pointer) *CustomMeta {
wrapped := UnsafeCustomMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.customMeta,
func (intern *customMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeCustomMetaFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [CustomMeta] is expected to work anymore.
func UnsafeCustomMetaFree(c *CustomMeta) {
C.free(unsafe.Pointer(c.native))
}
// UnsafeCustomMetaToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeCustomMetaToGlibNone(c *CustomMeta) unsafe.Pointer {
return unsafe.Pointer(c.native)
}
// UnsafeCustomMetaToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeCustomMetaToGlibFull(c *CustomMeta) unsafe.Pointer {
runtime.SetFinalizer(c.customMeta, nil)
_p := unsafe.Pointer(c.native)
c.native = nil // CustomMeta is invalid from here on
return _p
}
// GetStructure wraps gst_custom_meta_get_structure
// The function returns the following values:
//
// - goret *Structure
//
// Retrieve the #GstStructure backing a custom meta, the structure's mutability
// is conditioned to the writability of the #GstBuffer @meta is attached to.
func (meta *CustomMeta) GetStructure() *Structure {
var carg0 *C.GstCustomMeta // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstCustomMeta)(UnsafeCustomMetaToGlibNone(meta))
cret = C.gst_custom_meta_get_structure(carg0)
runtime.KeepAlive(meta)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// HasName wraps gst_custom_meta_has_name
//
// The function takes the following parameters:
//
// - name string
//
// The function returns the following values:
//
// - goret bool
//
// Checks whether the name of the custom meta is @name
func (meta *CustomMeta) HasName(name string) bool {
var carg0 *C.GstCustomMeta // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstCustomMeta)(UnsafeCustomMetaToGlibNone(meta))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_custom_meta_has_name(carg0, carg1)
runtime.KeepAlive(meta)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// DateTime wraps GstDateTime
//
// Struct to store date, time and timezone information altogether.
// #GstDateTime is refcounted and immutable.
//
// Date information is handled using the [proleptic Gregorian calendar].
//
// Provides basic creation functions and accessor functions to its fields.
//
// [proleptic Gregorian calendar]: https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar
type DateTime struct {
*dateTime
}
// dateTime is the struct that's finalized
type dateTime struct {
native *C.GstDateTime
}
var _ gobject.GoValueInitializer = (*DateTime)(nil)
func marshalDateTime(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeDateTimeFromGlibBorrow(b), nil
}
func (r *DateTime) InitGoValue(v *gobject.Value) {
v.Init(TypeDateTime)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeDateTimeFromGlibBorrow is used to convert raw C.GstDateTime pointers to go. This is used by the bindings internally.
func UnsafeDateTimeFromGlibBorrow(p unsafe.Pointer) *DateTime {
return &DateTime{&dateTime{(*C.GstDateTime)(p)}}
}
// UnsafeDateTimeFromGlibNone is used to convert raw C.GstDateTime pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDateTimeFromGlibNone(p unsafe.Pointer) *DateTime {
C.gst_date_time_ref((*C.GstDateTime)(p))
wrapped := UnsafeDateTimeFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.dateTime,
func (intern *dateTime) {
C.gst_date_time_unref(intern.native)
},
)
return wrapped
}
// UnsafeDateTimeFromGlibFull is used to convert raw C.GstDateTime pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDateTimeFromGlibFull(p unsafe.Pointer) *DateTime {
wrapped := UnsafeDateTimeFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.dateTime,
func (intern *dateTime) {
C.gst_date_time_unref(intern.native)
},
)
return wrapped
}
// UnsafeDateTimeRef increases the refcount on the underlying resource. This is used by the bindings internally.
//
// When this is called without an associated call to [DateTime.UnsafeDateTimeUnref], then [DateTime] will leak memory.
func UnsafeDateTimeRef(d *DateTime) {
C.gst_date_time_ref(d.native)
}
// UnsafeDateTimeUnref unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DateTime] is expected to work anymore.
func UnsafeDateTimeUnref(d *DateTime) {
C.gst_date_time_unref(d.native)
}
// UnsafeDateTimeToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDateTimeToGlibNone(d *DateTime) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDateTimeToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDateTimeToGlibFull(d *DateTime) unsafe.Pointer {
runtime.SetFinalizer(d.dateTime, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DateTime is invalid from here on
return _p
}
// NewDateTime wraps gst_date_time_new
//
// The function takes the following parameters:
//
// - tzoffset float32: Offset from UTC in hours.
// - year int: the gregorian year
// - month int: the gregorian month
// - day int: the day of the gregorian month
// - hour int: the hour of the day
// - minute int: the minute of the hour
// - seconds float64: the second of the minute
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the date and times in the gregorian calendar
// in the supplied timezone.
//
// @year should be from 1 to 9999, @month should be from 1 to 12, @day from
// 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59.
//
// Note that @tzoffset is a float and was chosen so for being able to handle
// some fractional timezones, while it still keeps the readability of
// representing it in hours for most timezones.
//
// If value is -1 then all over value will be ignored. For example
// if @month == -1, then #GstDateTime will be created only for @year. If
// @day == -1, then #GstDateTime will be created for @year and @month and
// so on.
func NewDateTime(tzoffset float32, year int, month int, day int, hour int, minute int, seconds float64) *DateTime {
var carg1 C.gfloat // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var carg5 C.gint // in, none, casted
var carg6 C.gint // in, none, casted
var carg7 C.gdouble // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gfloat(tzoffset)
carg2 = C.gint(year)
carg3 = C.gint(month)
carg4 = C.gint(day)
carg5 = C.gint(hour)
carg6 = C.gint(minute)
carg7 = C.gdouble(seconds)
cret = C.gst_date_time_new(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(tzoffset)
runtime.KeepAlive(year)
runtime.KeepAlive(month)
runtime.KeepAlive(day)
runtime.KeepAlive(hour)
runtime.KeepAlive(minute)
runtime.KeepAlive(seconds)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromGDateTime wraps gst_date_time_new_from_g_date_time
//
// The function takes the following parameters:
//
// - dt *glib.DateTime (nullable): the #GDateTime.
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime from a #GDateTime object.
func NewDateTimeFromGDateTime(dt *glib.DateTime) *DateTime {
var carg1 *C.GDateTime // in, full, converted, nullable
var cret *C.GstDateTime // return, full, converted
if dt != nil {
carg1 = (*C.GDateTime)(glib.UnsafeDateTimeToGlibFull(dt))
}
cret = C.gst_date_time_new_from_g_date_time(carg1)
runtime.KeepAlive(dt)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromISO8601String wraps gst_date_time_new_from_iso8601_string
//
// The function takes the following parameters:
//
// - str string: ISO 8601-formatted datetime string.
//
// The function returns the following values:
//
// - goret *DateTime
//
// Tries to parse common variants of ISO-8601 datetime strings into a
// #GstDateTime. Possible input formats are (for example):
// `2012-06-30T22:46:43Z`, `2012`, `2012-06`, `2012-06-30`, `2012-06-30T22:46:43-0430`,
// `2012-06-30T22:46Z`, `2012-06-30T22:46-0430`, `2012-06-30 22:46`,
// `2012-06-30 22:46:43`, `2012-06-00`, `2012-00-00`, `2012-00-30`, `22:46:43Z`, `22:46Z`,
// `22:46:43-0430`, `22:46-0430`, `22:46:30`, `22:46`
// If no date is provided, it is assumed to be "today" in the timezone
// provided (if any), otherwise UTC.
func NewDateTimeFromISO8601String(str string) *DateTime {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstDateTime // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(str)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_date_time_new_from_iso8601_string(carg1)
runtime.KeepAlive(str)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromUnixEpochLocalTime wraps gst_date_time_new_from_unix_epoch_local_time
//
// The function takes the following parameters:
//
// - secs int64: seconds from the Unix epoch
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
// @secs. The #GstDateTime is in the local timezone.
func NewDateTimeFromUnixEpochLocalTime(secs int64) *DateTime {
var carg1 C.gint64 // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint64(secs)
cret = C.gst_date_time_new_from_unix_epoch_local_time(carg1)
runtime.KeepAlive(secs)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromUnixEpochLocalTimeUsecs wraps gst_date_time_new_from_unix_epoch_local_time_usecs
//
// The function takes the following parameters:
//
// - usecs int64: microseconds from the Unix epoch
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
// @usecs. The #GstDateTime is in the local timezone.
func NewDateTimeFromUnixEpochLocalTimeUsecs(usecs int64) *DateTime {
var carg1 C.gint64 // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint64(usecs)
cret = C.gst_date_time_new_from_unix_epoch_local_time_usecs(carg1)
runtime.KeepAlive(usecs)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromUnixEpochUTC wraps gst_date_time_new_from_unix_epoch_utc
//
// The function takes the following parameters:
//
// - secs int64: seconds from the Unix epoch
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
// @secs. The #GstDateTime is in the UTC timezone.
func NewDateTimeFromUnixEpochUTC(secs int64) *DateTime {
var carg1 C.gint64 // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint64(secs)
cret = C.gst_date_time_new_from_unix_epoch_utc(carg1)
runtime.KeepAlive(secs)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeFromUnixEpochUTCUsecs wraps gst_date_time_new_from_unix_epoch_utc_usecs
//
// The function takes the following parameters:
//
// - usecs int64: microseconds from the Unix epoch
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
// @usecs. The #GstDateTime is in UTC.
func NewDateTimeFromUnixEpochUTCUsecs(usecs int64) *DateTime {
var carg1 C.gint64 // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint64(usecs)
cret = C.gst_date_time_new_from_unix_epoch_utc_usecs(carg1)
runtime.KeepAlive(usecs)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeLocalTime wraps gst_date_time_new_local_time
//
// The function takes the following parameters:
//
// - year int: the gregorian year
// - month int: the gregorian month, or -1
// - day int: the day of the gregorian month, or -1
// - hour int: the hour of the day, or -1
// - minute int: the minute of the hour, or -1
// - seconds float64: the second of the minute, or -1
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the date and times in the gregorian calendar
// in the local timezone.
//
// @year should be from 1 to 9999, @month should be from 1 to 12, @day from
// 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59.
//
// If @month is -1, then the #GstDateTime created will only contain @year,
// and all other fields will be considered not set.
//
// If @day is -1, then the #GstDateTime created will only contain @year and
// @month and all other fields will be considered not set.
//
// If @hour is -1, then the #GstDateTime created will only contain @year and
// @month and @day, and the time fields will be considered not set. In this
// case @minute and @seconds should also be -1.
func NewDateTimeLocalTime(year int, month int, day int, hour int, minute int, seconds float64) *DateTime {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
var carg5 C.gint // in, none, casted
var carg6 C.gdouble // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint(year)
carg2 = C.gint(month)
carg3 = C.gint(day)
carg4 = C.gint(hour)
carg5 = C.gint(minute)
carg6 = C.gdouble(seconds)
cret = C.gst_date_time_new_local_time(carg1, carg2, carg3, carg4, carg5, carg6)
runtime.KeepAlive(year)
runtime.KeepAlive(month)
runtime.KeepAlive(day)
runtime.KeepAlive(hour)
runtime.KeepAlive(minute)
runtime.KeepAlive(seconds)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeNowLocalTime wraps gst_date_time_new_now_local_time
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime representing the current date and time.
func NewDateTimeNowLocalTime() *DateTime {
var cret *C.GstDateTime // return, full, converted
cret = C.gst_date_time_new_now_local_time()
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeNowUTC wraps gst_date_time_new_now_utc
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime that represents the current instant at Universal
// coordinated time.
func NewDateTimeNowUTC() *DateTime {
var cret *C.GstDateTime // return, full, converted
cret = C.gst_date_time_new_now_utc()
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeY wraps gst_date_time_new_y
//
// The function takes the following parameters:
//
// - year int: the gregorian year
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the date and times in the gregorian calendar
// in the local timezone.
//
// @year should be from 1 to 9999.
func NewDateTimeY(year int) *DateTime {
var carg1 C.gint // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint(year)
cret = C.gst_date_time_new_y(carg1)
runtime.KeepAlive(year)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeYM wraps gst_date_time_new_ym
//
// The function takes the following parameters:
//
// - year int: the gregorian year
// - month int: the gregorian month
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the date and times in the gregorian calendar
// in the local timezone.
//
// @year should be from 1 to 9999, @month should be from 1 to 12.
//
// If value is -1 then all over value will be ignored. For example
// if @month == -1, then #GstDateTime will created only for @year.
func NewDateTimeYM(year int, month int) *DateTime {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint(year)
carg2 = C.gint(month)
cret = C.gst_date_time_new_ym(carg1, carg2)
runtime.KeepAlive(year)
runtime.KeepAlive(month)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewDateTimeYmd wraps gst_date_time_new_ymd
//
// The function takes the following parameters:
//
// - year int: the gregorian year
// - month int: the gregorian month
// - day int: the day of the gregorian month
//
// The function returns the following values:
//
// - goret *DateTime
//
// Creates a new #GstDateTime using the date and times in the gregorian calendar
// in the local timezone.
//
// @year should be from 1 to 9999, @month should be from 1 to 12, @day from
// 1 to 31.
//
// If value is -1 then all over value will be ignored. For example
// if @month == -1, then #GstDateTime will created only for @year. If
// @day == -1, then #GstDateTime will created for @year and @month and
// so on.
func NewDateTimeYmd(year int, month int, day int) *DateTime {
var carg1 C.gint // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var cret *C.GstDateTime // return, full, converted
carg1 = C.gint(year)
carg2 = C.gint(month)
carg3 = C.gint(day)
cret = C.gst_date_time_new_ymd(carg1, carg2, carg3)
runtime.KeepAlive(year)
runtime.KeepAlive(month)
runtime.KeepAlive(day)
var goret *DateTime
goret = UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetDay wraps gst_date_time_get_day
// The function returns the following values:
//
// - goret int
//
// Returns the day of the month of this #GstDateTime.
func (datetime *DateTime) GetDay() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_day(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetHour wraps gst_date_time_get_hour
// The function returns the following values:
//
// - goret int
//
// Retrieves the hour of the day represented by @datetime in the gregorian
// calendar. The return is in the range of 0 to 23.
func (datetime *DateTime) GetHour() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_hour(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetMicrosecond wraps gst_date_time_get_microsecond
// The function returns the following values:
//
// - goret int
//
// Retrieves the fractional part of the seconds in microseconds represented by
// @datetime in the gregorian calendar.
func (datetime *DateTime) GetMicrosecond() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_microsecond(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetMinute wraps gst_date_time_get_minute
// The function returns the following values:
//
// - goret int
//
// Retrieves the minute of the hour represented by @datetime in the gregorian
// calendar.
func (datetime *DateTime) GetMinute() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_minute(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetMonth wraps gst_date_time_get_month
// The function returns the following values:
//
// - goret int
//
// Returns the month of this #GstDateTime. January is 1, February is 2, etc..
func (datetime *DateTime) GetMonth() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_month(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetSecond wraps gst_date_time_get_second
// The function returns the following values:
//
// - goret int
//
// Retrieves the second of the minute represented by @datetime in the gregorian
// calendar.
func (datetime *DateTime) GetSecond() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_second(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// GetTimeZoneOffset wraps gst_date_time_get_time_zone_offset
// The function returns the following values:
//
// - goret float32
//
// Retrieves the offset from UTC in hours that the timezone specified
// by @datetime represents. Timezones ahead (to the east) of UTC have positive
// values, timezones before (to the west) of UTC have negative values.
// If @datetime represents UTC time, then the offset is zero.
func (datetime *DateTime) GetTimeZoneOffset() float32 {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gfloat // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_time_zone_offset(carg0)
runtime.KeepAlive(datetime)
var goret float32
goret = float32(cret)
return goret
}
// GetYear wraps gst_date_time_get_year
// The function returns the following values:
//
// - goret int
//
// Returns the year of this #GstDateTime.
// Call gst_date_time_has_year() before, to avoid warnings.
func (datetime *DateTime) GetYear() int {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_get_year(carg0)
runtime.KeepAlive(datetime)
var goret int
goret = int(cret)
return goret
}
// HasDay wraps gst_date_time_has_day
// The function returns the following values:
//
// - goret bool
func (datetime *DateTime) HasDay() bool {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_has_day(carg0)
runtime.KeepAlive(datetime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasMonth wraps gst_date_time_has_month
// The function returns the following values:
//
// - goret bool
func (datetime *DateTime) HasMonth() bool {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_has_month(carg0)
runtime.KeepAlive(datetime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasSecond wraps gst_date_time_has_second
// The function returns the following values:
//
// - goret bool
func (datetime *DateTime) HasSecond() bool {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_has_second(carg0)
runtime.KeepAlive(datetime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasTime wraps gst_date_time_has_time
// The function returns the following values:
//
// - goret bool
func (datetime *DateTime) HasTime() bool {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_has_time(carg0)
runtime.KeepAlive(datetime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasYear wraps gst_date_time_has_year
// The function returns the following values:
//
// - goret bool
func (datetime *DateTime) HasYear() bool {
var carg0 *C.GstDateTime // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_has_year(carg0)
runtime.KeepAlive(datetime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ToGDateTime wraps gst_date_time_to_g_date_time
// The function returns the following values:
//
// - goret *glib.DateTime
//
// Creates a new #GDateTime from a fully defined #GstDateTime object.
func (datetime *DateTime) ToGDateTime() *glib.DateTime {
var carg0 *C.GstDateTime // in, none, converted
var cret *C.GDateTime // return, full, converted
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_to_g_date_time(carg0)
runtime.KeepAlive(datetime)
var goret *glib.DateTime
goret = glib.UnsafeDateTimeFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ToISO8601String wraps gst_date_time_to_iso8601_string
// The function returns the following values:
//
// - goret string
//
// Create a minimal string compatible with ISO-8601. Possible output formats
// are (for example): `2012`, `2012-06`, `2012-06-23`, `2012-06-23T23:30Z`,
// `2012-06-23T23:30+0100`, `2012-06-23T23:30:59Z`, `2012-06-23T23:30:59+0100`
func (datetime *DateTime) ToISO8601String() string {
var carg0 *C.GstDateTime // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstDateTime)(UnsafeDateTimeToGlibNone(datetime))
cret = C.gst_date_time_to_iso8601_string(carg0)
runtime.KeepAlive(datetime)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// DebugCategory wraps GstDebugCategory
//
// This is the struct that describes the categories. Once initialized with
// #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
type DebugCategory struct {
*debugCategory
}
// debugCategory is the struct that's finalized
type debugCategory struct {
native *C.GstDebugCategory
}
// UnsafeDebugCategoryFromGlibBorrow is used to convert raw C.GstDebugCategory pointers to go. This is used by the bindings internally.
func UnsafeDebugCategoryFromGlibBorrow(p unsafe.Pointer) *DebugCategory {
return &DebugCategory{&debugCategory{(*C.GstDebugCategory)(p)}}
}
// UnsafeDebugCategoryFromGlibNone is used to convert raw C.GstDebugCategory pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDebugCategoryFromGlibNone(p unsafe.Pointer) *DebugCategory {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDebugCategoryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.debugCategory,
func (intern *debugCategory) {
C.gst_debug_category_free(intern.native)
},
)
return wrapped
}
// UnsafeDebugCategoryFromGlibFull is used to convert raw C.GstDebugCategory pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDebugCategoryFromGlibFull(p unsafe.Pointer) *DebugCategory {
wrapped := UnsafeDebugCategoryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.debugCategory,
func (intern *debugCategory) {
C.gst_debug_category_free(intern.native)
},
)
return wrapped
}
// UnsafeDebugCategoryFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DebugCategory] is expected to work anymore.
func UnsafeDebugCategoryFree(d *DebugCategory) {
C.gst_debug_category_free(d.native)
}
// UnsafeDebugCategoryToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDebugCategoryToGlibNone(d *DebugCategory) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDebugCategoryToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDebugCategoryToGlibFull(d *DebugCategory) unsafe.Pointer {
runtime.SetFinalizer(d.debugCategory, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DebugCategory is invalid from here on
return _p
}
// GetColor wraps gst_debug_category_get_color
// The function returns the following values:
//
// - goret uint
//
// Returns the color of a debug category used when printing output in this
// category.
func (category *DebugCategory) GetColor() uint {
var carg0 *C.GstDebugCategory // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
cret = C.gst_debug_category_get_color(carg0)
runtime.KeepAlive(category)
var goret uint
goret = uint(cret)
return goret
}
// GetDescription wraps gst_debug_category_get_description
// The function returns the following values:
//
// - goret string
//
// Returns the description of a debug category.
func (category *DebugCategory) GetDescription() string {
var carg0 *C.GstDebugCategory // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
cret = C.gst_debug_category_get_description(carg0)
runtime.KeepAlive(category)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetName wraps gst_debug_category_get_name
// The function returns the following values:
//
// - goret string
//
// Returns the name of a debug category.
func (category *DebugCategory) GetName() string {
var carg0 *C.GstDebugCategory // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
cret = C.gst_debug_category_get_name(carg0)
runtime.KeepAlive(category)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetThreshold wraps gst_debug_category_get_threshold
// The function returns the following values:
//
// - goret DebugLevel
//
// Returns the threshold of a #GstDebugCategory.
func (category *DebugCategory) GetThreshold() DebugLevel {
var carg0 *C.GstDebugCategory // in, none, converted
var cret C.GstDebugLevel // return, none, casted
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
cret = C.gst_debug_category_get_threshold(carg0)
runtime.KeepAlive(category)
var goret DebugLevel
goret = DebugLevel(cret)
return goret
}
// ResetThreshold wraps gst_debug_category_reset_threshold
//
// Resets the threshold of the category to the default level. Debug information
// will only be output if the threshold is lower or equal to the level of the
// debugging message.
// Use this function to set the threshold back to where it was after using
// gst_debug_category_set_threshold().
func (category *DebugCategory) ResetThreshold() {
var carg0 *C.GstDebugCategory // in, none, converted
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
C.gst_debug_category_reset_threshold(carg0)
runtime.KeepAlive(category)
}
// SetThreshold wraps gst_debug_category_set_threshold
//
// The function takes the following parameters:
//
// - level DebugLevel: the #GstDebugLevel threshold to set.
//
// Sets the threshold of the category to the given level. Debug information will
// only be output if the threshold is lower or equal to the level of the
// debugging message.
// &gt; Do not use this function in production code, because other functions may
// &gt; change the threshold of categories as side effect. It is however a nice
// &gt; function to use when debugging (even from gdb).
func (category *DebugCategory) SetThreshold(level DebugLevel) {
var carg0 *C.GstDebugCategory // in, none, converted
var carg1 C.GstDebugLevel // in, none, casted
carg0 = (*C.GstDebugCategory)(UnsafeDebugCategoryToGlibNone(category))
carg1 = C.GstDebugLevel(level)
C.gst_debug_category_set_threshold(carg0, carg1)
runtime.KeepAlive(category)
runtime.KeepAlive(level)
}
// DebugMessage wraps GstDebugMessage
type DebugMessage struct {
*debugMessage
}
// debugMessage is the struct that's finalized
type debugMessage struct {
native *C.GstDebugMessage
}
// UnsafeDebugMessageFromGlibBorrow is used to convert raw C.GstDebugMessage pointers to go. This is used by the bindings internally.
func UnsafeDebugMessageFromGlibBorrow(p unsafe.Pointer) *DebugMessage {
return &DebugMessage{&debugMessage{(*C.GstDebugMessage)(p)}}
}
// UnsafeDebugMessageFromGlibNone is used to convert raw C.GstDebugMessage pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDebugMessageFromGlibNone(p unsafe.Pointer) *DebugMessage {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDebugMessageFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.debugMessage,
func (intern *debugMessage) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDebugMessageFromGlibFull is used to convert raw C.GstDebugMessage pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDebugMessageFromGlibFull(p unsafe.Pointer) *DebugMessage {
wrapped := UnsafeDebugMessageFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.debugMessage,
func (intern *debugMessage) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDebugMessageFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DebugMessage] is expected to work anymore.
func UnsafeDebugMessageFree(d *DebugMessage) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDebugMessageToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDebugMessageToGlibNone(d *DebugMessage) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDebugMessageToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDebugMessageToGlibFull(d *DebugMessage) unsafe.Pointer {
runtime.SetFinalizer(d.debugMessage, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DebugMessage is invalid from here on
return _p
}
// Get wraps gst_debug_message_get
// The function returns the following values:
//
// - goret string
//
// Gets the string representation of a #GstDebugMessage. This function is used
// in debug handlers to extract the message.
func (message *DebugMessage) Get() string {
var carg0 *C.GstDebugMessage // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDebugMessage)(UnsafeDebugMessageToGlibNone(message))
cret = C.gst_debug_message_get(carg0)
runtime.KeepAlive(message)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetID wraps gst_debug_message_get_id
// The function returns the following values:
//
// - goret string
//
// Get the id of the object that emitted this message. This function is used in
// debug handlers. Can be empty.
func (message *DebugMessage) GetID() string {
var carg0 *C.GstDebugMessage // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDebugMessage)(UnsafeDebugMessageToGlibNone(message))
cret = C.gst_debug_message_get_id(carg0)
runtime.KeepAlive(message)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// DeviceClass wraps GstDeviceClass
//
// The class structure for a #GstDevice object.
type DeviceClass struct {
*deviceClass
}
// deviceClass is the struct that's finalized
type deviceClass struct {
native *C.GstDeviceClass
}
// UnsafeDeviceClassFromGlibBorrow is used to convert raw C.GstDeviceClass pointers to go. This is used by the bindings internally.
func UnsafeDeviceClassFromGlibBorrow(p unsafe.Pointer) *DeviceClass {
return &DeviceClass{&deviceClass{(*C.GstDeviceClass)(p)}}
}
// UnsafeDeviceClassFromGlibNone is used to convert raw C.GstDeviceClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceClassFromGlibNone(p unsafe.Pointer) *DeviceClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDeviceClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceClass,
func (intern *deviceClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceClassFromGlibFull is used to convert raw C.GstDeviceClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceClassFromGlibFull(p unsafe.Pointer) *DeviceClass {
wrapped := UnsafeDeviceClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceClass,
func (intern *deviceClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DeviceClass] is expected to work anymore.
func UnsafeDeviceClassFree(d *DeviceClass) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDeviceClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDeviceClassToGlibNone(d *DeviceClass) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDeviceClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDeviceClassToGlibFull(d *DeviceClass) unsafe.Pointer {
runtime.SetFinalizer(d.deviceClass, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DeviceClass is invalid from here on
return _p
}
// DeviceMonitorClass wraps GstDeviceMonitorClass
//
// Opaque device monitor class structure.
type DeviceMonitorClass struct {
*deviceMonitorClass
}
// deviceMonitorClass is the struct that's finalized
type deviceMonitorClass struct {
native *C.GstDeviceMonitorClass
}
// UnsafeDeviceMonitorClassFromGlibBorrow is used to convert raw C.GstDeviceMonitorClass pointers to go. This is used by the bindings internally.
func UnsafeDeviceMonitorClassFromGlibBorrow(p unsafe.Pointer) *DeviceMonitorClass {
return &DeviceMonitorClass{&deviceMonitorClass{(*C.GstDeviceMonitorClass)(p)}}
}
// UnsafeDeviceMonitorClassFromGlibNone is used to convert raw C.GstDeviceMonitorClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceMonitorClassFromGlibNone(p unsafe.Pointer) *DeviceMonitorClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDeviceMonitorClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceMonitorClass,
func (intern *deviceMonitorClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceMonitorClassFromGlibFull is used to convert raw C.GstDeviceMonitorClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceMonitorClassFromGlibFull(p unsafe.Pointer) *DeviceMonitorClass {
wrapped := UnsafeDeviceMonitorClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceMonitorClass,
func (intern *deviceMonitorClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceMonitorClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DeviceMonitorClass] is expected to work anymore.
func UnsafeDeviceMonitorClassFree(d *DeviceMonitorClass) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDeviceMonitorClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDeviceMonitorClassToGlibNone(d *DeviceMonitorClass) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDeviceMonitorClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDeviceMonitorClassToGlibFull(d *DeviceMonitorClass) unsafe.Pointer {
runtime.SetFinalizer(d.deviceMonitorClass, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DeviceMonitorClass is invalid from here on
return _p
}
// DeviceProviderClass wraps GstDeviceProviderClass
//
// The structure of the base #GstDeviceProviderClass
type DeviceProviderClass struct {
*deviceProviderClass
}
// deviceProviderClass is the struct that's finalized
type deviceProviderClass struct {
native *C.GstDeviceProviderClass
}
// UnsafeDeviceProviderClassFromGlibBorrow is used to convert raw C.GstDeviceProviderClass pointers to go. This is used by the bindings internally.
func UnsafeDeviceProviderClassFromGlibBorrow(p unsafe.Pointer) *DeviceProviderClass {
return &DeviceProviderClass{&deviceProviderClass{(*C.GstDeviceProviderClass)(p)}}
}
// UnsafeDeviceProviderClassFromGlibNone is used to convert raw C.GstDeviceProviderClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceProviderClassFromGlibNone(p unsafe.Pointer) *DeviceProviderClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDeviceProviderClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceProviderClass,
func (intern *deviceProviderClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceProviderClassFromGlibFull is used to convert raw C.GstDeviceProviderClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceProviderClassFromGlibFull(p unsafe.Pointer) *DeviceProviderClass {
wrapped := UnsafeDeviceProviderClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceProviderClass,
func (intern *deviceProviderClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceProviderClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DeviceProviderClass] is expected to work anymore.
func UnsafeDeviceProviderClassFree(d *DeviceProviderClass) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDeviceProviderClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDeviceProviderClassToGlibNone(d *DeviceProviderClass) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDeviceProviderClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDeviceProviderClassToGlibFull(d *DeviceProviderClass) unsafe.Pointer {
runtime.SetFinalizer(d.deviceProviderClass, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DeviceProviderClass is invalid from here on
return _p
}
// AddMetadata wraps gst_device_provider_class_add_metadata
//
// The function takes the following parameters:
//
// - key string: the key to set
// - value string: the value to set
//
// Set @key with @value as metadata in @klass.
func (klass *DeviceProviderClass) AddMetadata(key string, value string) {
var carg0 *C.GstDeviceProviderClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderClass)(UnsafeDeviceProviderClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
defer C.free(unsafe.Pointer(carg2))
C.gst_device_provider_class_add_metadata(carg0, carg1, carg2)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
runtime.KeepAlive(value)
}
// AddStaticMetadata wraps gst_device_provider_class_add_static_metadata
//
// The function takes the following parameters:
//
// - key string: the key to set
// - value string: the value to set
//
// Set @key with @value as metadata in @klass.
//
// Same as gst_device_provider_class_add_metadata(), but @value must be a static string
// or an inlined string, as it will not be copied. (GStreamer plugins will
// be made resident once loaded, so this function can be used even from
// dynamically loaded plugins.)
func (klass *DeviceProviderClass) AddStaticMetadata(key string, value string) {
var carg0 *C.GstDeviceProviderClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, full, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderClass)(UnsafeDeviceProviderClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
C.gst_device_provider_class_add_static_metadata(carg0, carg1, carg2)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
runtime.KeepAlive(value)
}
// GetMetadata wraps gst_device_provider_class_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @klass.
func (klass *DeviceProviderClass) GetMetadata(key string) string {
var carg0 *C.GstDeviceProviderClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderClass)(UnsafeDeviceProviderClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_device_provider_class_get_metadata(carg0, carg1)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// SetMetadata wraps gst_device_provider_class_set_metadata
//
// The function takes the following parameters:
//
// - longname string: The long English name of the device provider. E.g. "File Sink"
// - classification string: String describing the type of device provider, as an
// unordered list separated with slashes ('/'). See draft-klass.txt of the
// design docs
// for more details and common types. E.g: "Sink/File"
// - description string: Sentence describing the purpose of the device provider.
// E.g: "Write stream to a file"
// - author string: Name and contact details of the author(s). Use \n to separate
// multiple author metadata. E.g: "Joe Bloggs &amp;lt;joe.blogs at foo.com&amp;gt;"
//
// Sets the detailed information for a #GstDeviceProviderClass.
//
// &gt; This function is for use in _class_init functions only.
func (klass *DeviceProviderClass) SetMetadata(longname string, classification string, description string, author string) {
var carg0 *C.GstDeviceProviderClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderClass)(UnsafeDeviceProviderClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(longname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(classification)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(description)))
defer C.free(unsafe.Pointer(carg3))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(author)))
defer C.free(unsafe.Pointer(carg4))
C.gst_device_provider_class_set_metadata(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(klass)
runtime.KeepAlive(longname)
runtime.KeepAlive(classification)
runtime.KeepAlive(description)
runtime.KeepAlive(author)
}
// SetStaticMetadata wraps gst_device_provider_class_set_static_metadata
//
// The function takes the following parameters:
//
// - longname string: The long English name of the element. E.g. "File Sink"
// - classification string: String describing the type of element, as
// an unordered list separated with slashes ('/'). See draft-klass.txt of the
// design docs for more details and common types. E.g: "Sink/File"
// - description string: Sentence describing the purpose of the
// element. E.g: "Write stream to a file"
// - author string: Name and contact details of the author(s). Use \n
// to separate multiple author metadata. E.g: "Joe Bloggs &amp;lt;joe.blogs at
// foo.com&amp;gt;"
//
// Sets the detailed information for a #GstDeviceProviderClass.
//
// &gt; This function is for use in _class_init functions only.
//
// Same as gst_device_provider_class_set_metadata(), but @longname, @classification,
// @description, and @author must be static strings or inlined strings, as
// they will not be copied. (GStreamer plugins will be made resident once
// loaded, so this function can be used even from dynamically loaded plugins.)
func (klass *DeviceProviderClass) SetStaticMetadata(longname string, classification string, description string, author string) {
var carg0 *C.GstDeviceProviderClass // in, none, converted
var carg1 *C.gchar // in, full, string, casted *C.gchar
var carg2 *C.gchar // in, full, string, casted *C.gchar
var carg3 *C.gchar // in, full, string, casted *C.gchar
var carg4 *C.gchar // in, full, string, casted *C.gchar
carg0 = (*C.GstDeviceProviderClass)(UnsafeDeviceProviderClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(longname)))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(classification)))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(description)))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(author)))
C.gst_device_provider_class_set_static_metadata(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(klass)
runtime.KeepAlive(longname)
runtime.KeepAlive(classification)
runtime.KeepAlive(description)
runtime.KeepAlive(author)
}
// DeviceProviderFactoryClass wraps GstDeviceProviderFactoryClass
//
// The opaque #GstDeviceProviderFactoryClass data structure.
type DeviceProviderFactoryClass struct {
*deviceProviderFactoryClass
}
// deviceProviderFactoryClass is the struct that's finalized
type deviceProviderFactoryClass struct {
native *C.GstDeviceProviderFactoryClass
}
// UnsafeDeviceProviderFactoryClassFromGlibBorrow is used to convert raw C.GstDeviceProviderFactoryClass pointers to go. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryClassFromGlibBorrow(p unsafe.Pointer) *DeviceProviderFactoryClass {
return &DeviceProviderFactoryClass{&deviceProviderFactoryClass{(*C.GstDeviceProviderFactoryClass)(p)}}
}
// UnsafeDeviceProviderFactoryClassFromGlibNone is used to convert raw C.GstDeviceProviderFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryClassFromGlibNone(p unsafe.Pointer) *DeviceProviderFactoryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDeviceProviderFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceProviderFactoryClass,
func (intern *deviceProviderFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceProviderFactoryClassFromGlibFull is used to convert raw C.GstDeviceProviderFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryClassFromGlibFull(p unsafe.Pointer) *DeviceProviderFactoryClass {
wrapped := UnsafeDeviceProviderFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.deviceProviderFactoryClass,
func (intern *deviceProviderFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDeviceProviderFactoryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DeviceProviderFactoryClass] is expected to work anymore.
func UnsafeDeviceProviderFactoryClassFree(d *DeviceProviderFactoryClass) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDeviceProviderFactoryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDeviceProviderFactoryClassToGlibNone(d *DeviceProviderFactoryClass) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDeviceProviderFactoryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDeviceProviderFactoryClassToGlibFull(d *DeviceProviderFactoryClass) unsafe.Pointer {
runtime.SetFinalizer(d.deviceProviderFactoryClass, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DeviceProviderFactoryClass is invalid from here on
return _p
}
// DynamicTypeFactoryClass wraps GstDynamicTypeFactoryClass
type DynamicTypeFactoryClass struct {
*dynamicTypeFactoryClass
}
// dynamicTypeFactoryClass is the struct that's finalized
type dynamicTypeFactoryClass struct {
native *C.GstDynamicTypeFactoryClass
}
// UnsafeDynamicTypeFactoryClassFromGlibBorrow is used to convert raw C.GstDynamicTypeFactoryClass pointers to go. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryClassFromGlibBorrow(p unsafe.Pointer) *DynamicTypeFactoryClass {
return &DynamicTypeFactoryClass{&dynamicTypeFactoryClass{(*C.GstDynamicTypeFactoryClass)(p)}}
}
// UnsafeDynamicTypeFactoryClassFromGlibNone is used to convert raw C.GstDynamicTypeFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryClassFromGlibNone(p unsafe.Pointer) *DynamicTypeFactoryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeDynamicTypeFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.dynamicTypeFactoryClass,
func (intern *dynamicTypeFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDynamicTypeFactoryClassFromGlibFull is used to convert raw C.GstDynamicTypeFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryClassFromGlibFull(p unsafe.Pointer) *DynamicTypeFactoryClass {
wrapped := UnsafeDynamicTypeFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.dynamicTypeFactoryClass,
func (intern *dynamicTypeFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeDynamicTypeFactoryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [DynamicTypeFactoryClass] is expected to work anymore.
func UnsafeDynamicTypeFactoryClassFree(d *DynamicTypeFactoryClass) {
C.free(unsafe.Pointer(d.native))
}
// UnsafeDynamicTypeFactoryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeDynamicTypeFactoryClassToGlibNone(d *DynamicTypeFactoryClass) unsafe.Pointer {
return unsafe.Pointer(d.native)
}
// UnsafeDynamicTypeFactoryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeDynamicTypeFactoryClassToGlibFull(d *DynamicTypeFactoryClass) unsafe.Pointer {
runtime.SetFinalizer(d.dynamicTypeFactoryClass, nil)
_p := unsafe.Pointer(d.native)
d.native = nil // DynamicTypeFactoryClass is invalid from here on
return _p
}
// ElementClass wraps GstElementClass
//
// GStreamer element class. Override the vmethods to implement the element
// functionality.
type ElementClass struct {
*elementClass
}
// elementClass is the struct that's finalized
type elementClass struct {
native *C.GstElementClass
}
// UnsafeElementClassFromGlibBorrow is used to convert raw C.GstElementClass pointers to go. This is used by the bindings internally.
func UnsafeElementClassFromGlibBorrow(p unsafe.Pointer) *ElementClass {
return &ElementClass{&elementClass{(*C.GstElementClass)(p)}}
}
// UnsafeElementClassFromGlibNone is used to convert raw C.GstElementClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeElementClassFromGlibNone(p unsafe.Pointer) *ElementClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeElementClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.elementClass,
func (intern *elementClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeElementClassFromGlibFull is used to convert raw C.GstElementClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeElementClassFromGlibFull(p unsafe.Pointer) *ElementClass {
wrapped := UnsafeElementClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.elementClass,
func (intern *elementClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeElementClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ElementClass] is expected to work anymore.
func UnsafeElementClassFree(e *ElementClass) {
C.free(unsafe.Pointer(e.native))
}
// UnsafeElementClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeElementClassToGlibNone(e *ElementClass) unsafe.Pointer {
return unsafe.Pointer(e.native)
}
// UnsafeElementClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeElementClassToGlibFull(e *ElementClass) unsafe.Pointer {
runtime.SetFinalizer(e.elementClass, nil)
_p := unsafe.Pointer(e.native)
e.native = nil // ElementClass is invalid from here on
return _p
}
// AddMetadata wraps gst_element_class_add_metadata
//
// The function takes the following parameters:
//
// - key string: the key to set
// - value string: the value to set
//
// Set @key with @value as metadata in @klass.
func (klass *ElementClass) AddMetadata(key string, value string) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
defer C.free(unsafe.Pointer(carg2))
C.gst_element_class_add_metadata(carg0, carg1, carg2)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
runtime.KeepAlive(value)
}
// AddPadTemplate wraps gst_element_class_add_pad_template
//
// The function takes the following parameters:
//
// - templ PadTemplate: a #GstPadTemplate to add to the element class.
//
// Adds a padtemplate to an element class. This is mainly used in the _class_init
// functions of classes. If a pad template with the same name as an already
// existing one is added the old one is replaced by the new one.
//
// @templ's reference count will be incremented, and any floating
// reference will be removed (see gst_object_ref_sink())
func (klass *ElementClass) AddPadTemplate(templ PadTemplate) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.GstPadTemplate // in, none, converted
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.GstPadTemplate)(UnsafePadTemplateToGlibNone(templ))
C.gst_element_class_add_pad_template(carg0, carg1)
runtime.KeepAlive(klass)
runtime.KeepAlive(templ)
}
// AddStaticMetadata wraps gst_element_class_add_static_metadata
//
// The function takes the following parameters:
//
// - key string: the key to set
// - value string: the value to set
//
// Set @key with @value as metadata in @klass.
//
// Same as gst_element_class_add_metadata(), but @value must be a static string
// or an inlined string, as it will not be copied. (GStreamer plugins will
// be made resident once loaded, so this function can be used even from
// dynamically loaded plugins.)
func (klass *ElementClass) AddStaticMetadata(key string, value string) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(value)))
defer C.free(unsafe.Pointer(carg2))
C.gst_element_class_add_static_metadata(carg0, carg1, carg2)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
runtime.KeepAlive(value)
}
// AddStaticPadTemplate wraps gst_element_class_add_static_pad_template
//
// The function takes the following parameters:
//
// - staticTempl *StaticPadTemplate: #GstStaticPadTemplate to add as pad template to the element class.
//
// Adds a pad template to an element class based on the static pad template
// @templ. This is mainly used in the _class_init functions of element
// implementations. If a pad template with the same name already exists,
// the old one is replaced by the new one.
func (klass *ElementClass) AddStaticPadTemplate(staticTempl *StaticPadTemplate) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.GstStaticPadTemplate // in, none, converted
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(staticTempl))
C.gst_element_class_add_static_pad_template(carg0, carg1)
runtime.KeepAlive(klass)
runtime.KeepAlive(staticTempl)
}
// AddStaticPadTemplateWithGType wraps gst_element_class_add_static_pad_template_with_gtype
//
// The function takes the following parameters:
//
// - staticTempl *StaticPadTemplate: #GstStaticPadTemplate to add as pad template to the element class.
// - padType gobject.Type: The #GType of the pad to create
//
// Adds a pad template to an element class based on the static pad template
// @templ. This is mainly used in the _class_init functions of element
// implementations. If a pad template with the same name already exists,
// the old one is replaced by the new one.
func (klass *ElementClass) AddStaticPadTemplateWithGType(staticTempl *StaticPadTemplate, padType gobject.Type) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.GstStaticPadTemplate // in, none, converted
var carg2 C.GType // in, none, casted, alias
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(staticTempl))
carg2 = C.GType(padType)
C.gst_element_class_add_static_pad_template_with_gtype(carg0, carg1, carg2)
runtime.KeepAlive(klass)
runtime.KeepAlive(staticTempl)
runtime.KeepAlive(padType)
}
// GetMetadata wraps gst_element_class_get_metadata
//
// The function takes the following parameters:
//
// - key string: the key to get
//
// The function returns the following values:
//
// - goret string
//
// Get metadata with @key in @klass.
func (klass *ElementClass) GetMetadata(key string) string {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(key)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_class_get_metadata(carg0, carg1)
runtime.KeepAlive(klass)
runtime.KeepAlive(key)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetPadTemplate wraps gst_element_class_get_pad_template
//
// The function takes the following parameters:
//
// - name string: the name of the #GstPadTemplate to get.
//
// The function returns the following values:
//
// - goret PadTemplate
//
// Retrieves a padtemplate from @element_class with the given name.
// &gt; If you use this function in the GInstanceInitFunc of an object class
// &gt; that has subclasses, make sure to pass the g_class parameter of the
// &gt; GInstanceInitFunc here.
func (elementClass *ElementClass) GetPadTemplate(name string) PadTemplate {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstPadTemplate // return, none, converted
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(elementClass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_element_class_get_pad_template(carg0, carg1)
runtime.KeepAlive(elementClass)
runtime.KeepAlive(name)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// SetMetadata wraps gst_element_class_set_metadata
//
// The function takes the following parameters:
//
// - longname string: The long English name of the element. E.g. "File Sink"
// - classification string: String describing the type of element, as an unordered list
// separated with slashes ('/'). See draft-klass.txt of the design docs
// for more details and common types. E.g: "Sink/File"
// - description string: Sentence describing the purpose of the element.
// E.g: "Write stream to a file"
// - author string: Name and contact details of the author(s). Use \n to separate
// multiple author metadata. E.g: "Joe Bloggs &amp;lt;joe.blogs at foo.com&amp;gt;"
//
// Sets the detailed information for a #GstElementClass.
// &gt; This function is for use in _class_init functions only.
func (klass *ElementClass) SetMetadata(longname string, classification string, description string, author string) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(longname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(classification)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(description)))
defer C.free(unsafe.Pointer(carg3))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(author)))
defer C.free(unsafe.Pointer(carg4))
C.gst_element_class_set_metadata(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(klass)
runtime.KeepAlive(longname)
runtime.KeepAlive(classification)
runtime.KeepAlive(description)
runtime.KeepAlive(author)
}
// SetStaticMetadata wraps gst_element_class_set_static_metadata
//
// The function takes the following parameters:
//
// - longname string: The long English name of the element. E.g. "File Sink"
// - classification string: String describing the type of element, as an unordered list
// separated with slashes ('/'). See draft-klass.txt of the design docs
// for more details and common types. E.g: "Sink/File"
// - description string: Sentence describing the purpose of the element.
// E.g: "Write stream to a file"
// - author string: Name and contact details of the author(s). Use \n to separate
// multiple author metadata. E.g: "Joe Bloggs &amp;lt;joe.blogs at foo.com&amp;gt;"
//
// Sets the detailed information for a #GstElementClass.
//
// &gt; This function is for use in _class_init functions only.
//
// Same as gst_element_class_set_metadata(), but @longname, @classification,
// @description, and @author must be static strings or inlined strings, as
// they will not be copied. (GStreamer plugins will be made resident once
// loaded, so this function can be used even from dynamically loaded plugins.)
func (klass *ElementClass) SetStaticMetadata(longname string, classification string, description string, author string) {
var carg0 *C.GstElementClass // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstElementClass)(UnsafeElementClassToGlibNone(klass))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(longname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(classification)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(description)))
defer C.free(unsafe.Pointer(carg3))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(author)))
defer C.free(unsafe.Pointer(carg4))
C.gst_element_class_set_static_metadata(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(klass)
runtime.KeepAlive(longname)
runtime.KeepAlive(classification)
runtime.KeepAlive(description)
runtime.KeepAlive(author)
}
// ElementFactoryClass wraps GstElementFactoryClass
type ElementFactoryClass struct {
*elementFactoryClass
}
// elementFactoryClass is the struct that's finalized
type elementFactoryClass struct {
native *C.GstElementFactoryClass
}
// UnsafeElementFactoryClassFromGlibBorrow is used to convert raw C.GstElementFactoryClass pointers to go. This is used by the bindings internally.
func UnsafeElementFactoryClassFromGlibBorrow(p unsafe.Pointer) *ElementFactoryClass {
return &ElementFactoryClass{&elementFactoryClass{(*C.GstElementFactoryClass)(p)}}
}
// UnsafeElementFactoryClassFromGlibNone is used to convert raw C.GstElementFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeElementFactoryClassFromGlibNone(p unsafe.Pointer) *ElementFactoryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeElementFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.elementFactoryClass,
func (intern *elementFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeElementFactoryClassFromGlibFull is used to convert raw C.GstElementFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeElementFactoryClassFromGlibFull(p unsafe.Pointer) *ElementFactoryClass {
wrapped := UnsafeElementFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.elementFactoryClass,
func (intern *elementFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeElementFactoryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ElementFactoryClass] is expected to work anymore.
func UnsafeElementFactoryClassFree(e *ElementFactoryClass) {
C.free(unsafe.Pointer(e.native))
}
// UnsafeElementFactoryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeElementFactoryClassToGlibNone(e *ElementFactoryClass) unsafe.Pointer {
return unsafe.Pointer(e.native)
}
// UnsafeElementFactoryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeElementFactoryClassToGlibFull(e *ElementFactoryClass) unsafe.Pointer {
runtime.SetFinalizer(e.elementFactoryClass, nil)
_p := unsafe.Pointer(e.native)
e.native = nil // ElementFactoryClass is invalid from here on
return _p
}
// Event wraps GstEvent
//
// The event class provides factory methods to construct events for sending
// and functions to query (parse) received events.
//
// Events are usually created with gst_event_new_*() which takes event-type
// specific parameters as arguments.
// To send an event application will usually use gst_element_send_event() and
// elements will use gst_pad_send_event() or gst_pad_push_event().
// The event should be unreffed with gst_event_unref() if it has not been sent.
//
// Events that have been received can be parsed with their respective
// gst_event_parse_*() functions. It is valid to pass %NULL for unwanted details.
//
// Events are passed between elements in parallel to the data stream. Some events
// are serialized with buffers, others are not. Some events only travel downstream,
// others only upstream. Some events can travel both upstream and downstream.
//
// The events are used to signal special conditions in the datastream such as
// EOS (end of stream) or the start of a new stream-segment.
// Events are also used to flush the pipeline of any pending data.
//
// Most of the event API is used inside plugins. Applications usually only
// construct and use seek events.
// To do that gst_event_new_seek() is used to create a seek event. It takes
// the needed parameters to specify seeking time and mode.
// |[&lt;!-- language="C" --&gt;
// GstEvent *event;
// gboolean result;
// ...
// // construct a seek event to play the media from second 2 to 5, flush
// // the pipeline to decrease latency.
// event = gst_event_new_seek (1.0,
// GST_FORMAT_TIME,
// GST_SEEK_FLAG_FLUSH,
// GST_SEEK_TYPE_SET, 2 * GST_SECOND,
// GST_SEEK_TYPE_SET, 5 * GST_SECOND);
// ...
// result = gst_element_send_event (pipeline, event);
// if (!result)
// g_warning ("seek failed");
// ...
// ]|
type Event struct {
*event
}
// event is the struct that's finalized
type event struct {
native *C.GstEvent
}
var _ gobject.GoValueInitializer = (*Event)(nil)
func marshalEvent(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeEventFromGlibBorrow(b), nil
}
func (r *Event) InitGoValue(v *gobject.Value) {
v.Init(TypeEvent)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeEventFromGlibBorrow is used to convert raw C.GstEvent pointers to go. This is used by the bindings internally.
func UnsafeEventFromGlibBorrow(p unsafe.Pointer) *Event {
return &Event{&event{(*C.GstEvent)(p)}}
}
// UnsafeEventFromGlibNone is used to convert raw C.GstEvent pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeEventFromGlibNone(p unsafe.Pointer) *Event {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeEventFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.event,
func (intern *event) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeEventFromGlibFull is used to convert raw C.GstEvent pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeEventFromGlibFull(p unsafe.Pointer) *Event {
wrapped := UnsafeEventFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.event,
func (intern *event) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeEventFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Event] is expected to work anymore.
func UnsafeEventFree(e *Event) {
C.free(unsafe.Pointer(e.native))
}
// UnsafeEventToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeEventToGlibNone(e *Event) unsafe.Pointer {
return unsafe.Pointer(e.native)
}
// UnsafeEventToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeEventToGlibFull(e *Event) unsafe.Pointer {
runtime.SetFinalizer(e.event, nil)
_p := unsafe.Pointer(e.native)
e.native = nil // Event is invalid from here on
return _p
}
// NewEventBufferSize wraps gst_event_new_buffer_size
//
// The function takes the following parameters:
//
// - format Format: buffer format
// - minsize int64: minimum buffer size
// - maxsize int64: maximum buffer size
// - async bool: thread behavior
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new buffersize event. The event is sent downstream and notifies
// elements that they should provide a buffer of the specified dimensions.
//
// When the @async flag is set, a thread boundary is preferred.
func NewEventBufferSize(format Format, minsize int64, maxsize int64, async bool) *Event {
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.gint64 // in, none, casted
var carg4 C.gboolean // in
var cret *C.GstEvent // return, full, converted
carg1 = C.GstFormat(format)
carg2 = C.gint64(minsize)
carg3 = C.gint64(maxsize)
if async {
carg4 = C.TRUE
}
cret = C.gst_event_new_buffer_size(carg1, carg2, carg3, carg4)
runtime.KeepAlive(format)
runtime.KeepAlive(minsize)
runtime.KeepAlive(maxsize)
runtime.KeepAlive(async)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventCaps wraps gst_event_new_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a #GstCaps
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new CAPS event for @caps. The caps event can only travel downstream
// synchronized with the buffer flow and contains the format of the buffers
// that will follow after the event.
func NewEventCaps(caps *Caps) *Event {
var carg1 *C.GstCaps // in, none, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_event_new_caps(carg1)
runtime.KeepAlive(caps)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventCustom wraps gst_event_new_custom
//
// The function takes the following parameters:
//
// - typ EventType: The type of the new event
// - structure *Structure: the structure for the event. The event will
// take ownership of the structure.
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new custom-typed event. This can be used for anything not
// handled by other event-specific functions to pass an event to another
// element.
//
// Make sure to allocate an event type with the #GST_EVENT_MAKE_TYPE macro,
// assigning a free number and filling in the correct direction and
// serialization flags.
//
// New custom events can also be created by subclassing the event type if
// needed.
func NewEventCustom(typ EventType, structure *Structure) *Event {
var carg1 C.GstEventType // in, none, casted
var carg2 *C.GstStructure // in, full, converted
var cret *C.GstEvent // return, full, converted
carg1 = C.GstEventType(typ)
carg2 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
cret = C.gst_event_new_custom(carg1, carg2)
runtime.KeepAlive(typ)
runtime.KeepAlive(structure)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventEos wraps gst_event_new_eos
// The function returns the following values:
//
// - goret *Event
//
// Create a new EOS event. The eos event can only travel downstream
// synchronized with the buffer flow. Elements that receive the EOS
// event on a pad can return #GST_FLOW_EOS as a #GstFlowReturn
// when data after the EOS event arrives.
//
// The EOS event will travel down to the sink elements in the pipeline
// which will then post the #GST_MESSAGE_EOS on the bus after they have
// finished playing any buffered data.
//
// When all sinks have posted an EOS message, an EOS message is
// forwarded to the application.
//
// The EOS event itself will not cause any state transitions of the pipeline.
func NewEventEos() *Event {
var cret *C.GstEvent // return, full, converted
cret = C.gst_event_new_eos()
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventFlushStart wraps gst_event_new_flush_start
// The function returns the following values:
//
// - goret *Event
//
// Allocate a new flush start event. The flush start event can be sent
// upstream and downstream and travels out-of-bounds with the dataflow.
//
// It marks pads as being flushing and will make them return
// #GST_FLOW_FLUSHING when used for data flow with gst_pad_push(),
// gst_pad_chain(), gst_pad_get_range() and gst_pad_pull_range().
// Any event (except a #GST_EVENT_FLUSH_STOP) received
// on a flushing pad will return %FALSE immediately.
//
// Elements should unlock any blocking functions and exit their streaming
// functions as fast as possible when this event is received.
//
// This event is typically generated after a seek to flush out all queued data
// in the pipeline so that the new media is played as soon as possible.
func NewEventFlushStart() *Event {
var cret *C.GstEvent // return, full, converted
cret = C.gst_event_new_flush_start()
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventFlushStop wraps gst_event_new_flush_stop
//
// The function takes the following parameters:
//
// - resetTime bool: if time should be reset
//
// The function returns the following values:
//
// - goret *Event
//
// Allocate a new flush stop event. The flush stop event can be sent
// upstream and downstream and travels serialized with the dataflow.
// It is typically sent after sending a FLUSH_START event to make the
// pads accept data again.
//
// Elements can process this event synchronized with the dataflow since
// the preceding FLUSH_START event stopped the dataflow.
//
// This event is typically generated to complete a seek and to resume
// dataflow.
func NewEventFlushStop(resetTime bool) *Event {
var carg1 C.gboolean // in
var cret *C.GstEvent // return, full, converted
if resetTime {
carg1 = C.TRUE
}
cret = C.gst_event_new_flush_stop(carg1)
runtime.KeepAlive(resetTime)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventGap wraps gst_event_new_gap
//
// The function takes the following parameters:
//
// - timestamp ClockTime: the start time (pts) of the gap
// - duration ClockTime: the duration of the gap
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new GAP event. A gap event can be thought of as conceptually
// equivalent to a buffer to signal that there is no data for a certain
// amount of time. This is useful to signal a gap to downstream elements
// which may wait for data, such as muxers or mixers or overlays, especially
// for sparse streams such as subtitle streams.
func NewEventGap(timestamp ClockTime, duration ClockTime) *Event {
var carg1 C.GstClockTime // in, none, casted, alias
var carg2 C.GstClockTime // in, none, casted, alias
var cret *C.GstEvent // return, full, converted
carg1 = C.GstClockTime(timestamp)
carg2 = C.GstClockTime(duration)
cret = C.gst_event_new_gap(carg1, carg2)
runtime.KeepAlive(timestamp)
runtime.KeepAlive(duration)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventInstantRateChange wraps gst_event_new_instant_rate_change
//
// The function takes the following parameters:
//
// - rateMultiplier float64: the multiplier to be applied to the playback rate
// - newFlags SegmentFlags: A new subset of segment flags to replace in segments
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new instant-rate-change event. This event is sent by seek
// handlers (e.g. demuxers) when receiving a seek with the
// %GST_SEEK_FLAG_INSTANT_RATE_CHANGE and signals to downstream elements that
// the playback rate in the existing segment should be immediately multiplied
// by the @rate_multiplier factor.
//
// The flags provided replace any flags in the existing segment, for the
// flags within the %GST_SEGMENT_INSTANT_FLAGS set. Other GstSegmentFlags
// are ignored and not transferred in the event.
func NewEventInstantRateChange(rateMultiplier float64, newFlags SegmentFlags) *Event {
var carg1 C.gdouble // in, none, casted
var carg2 C.GstSegmentFlags // in, none, casted
var cret *C.GstEvent // return, full, converted
carg1 = C.gdouble(rateMultiplier)
carg2 = C.GstSegmentFlags(newFlags)
cret = C.gst_event_new_instant_rate_change(carg1, carg2)
runtime.KeepAlive(rateMultiplier)
runtime.KeepAlive(newFlags)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventInstantRateSyncTime wraps gst_event_new_instant_rate_sync_time
//
// The function takes the following parameters:
//
// - rateMultiplier float64: the new playback rate multiplier to be applied
// - runningTime ClockTime: Running time when the rate change should be applied
// - upstreamRunningTime ClockTime: The upstream-centric running-time when the
// rate change should be applied.
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new instant-rate-sync-time event. This event is sent by the
// pipeline to notify elements handling the instant-rate-change event about
// the running-time when the new rate should be applied. The running time
// may be in the past when elements handle this event, which can lead to
// switching artifacts. The magnitude of those depends on the exact timing
// of event delivery to each element and the magnitude of the change in
// playback rate being applied.
//
// The @running_time and @upstream_running_time are the same if this
// is the first instant-rate adjustment, but will differ for later ones
// to compensate for the accumulated offset due to playing at a rate
// different to the one indicated in the playback segments.
func NewEventInstantRateSyncTime(rateMultiplier float64, runningTime ClockTime, upstreamRunningTime ClockTime) *Event {
var carg1 C.gdouble // in, none, casted
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
var cret *C.GstEvent // return, full, converted
carg1 = C.gdouble(rateMultiplier)
carg2 = C.GstClockTime(runningTime)
carg3 = C.GstClockTime(upstreamRunningTime)
cret = C.gst_event_new_instant_rate_sync_time(carg1, carg2, carg3)
runtime.KeepAlive(rateMultiplier)
runtime.KeepAlive(runningTime)
runtime.KeepAlive(upstreamRunningTime)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventLatency wraps gst_event_new_latency
//
// The function takes the following parameters:
//
// - latency ClockTime: the new latency value
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new latency event. The event is sent upstream from the sinks and
// notifies elements that they should add an additional @latency to the
// running time before synchronising against the clock.
//
// The latency is mostly used in live sinks and is always expressed in
// the time format.
func NewEventLatency(latency ClockTime) *Event {
var carg1 C.GstClockTime // in, none, casted, alias
var cret *C.GstEvent // return, full, converted
carg1 = C.GstClockTime(latency)
cret = C.gst_event_new_latency(carg1)
runtime.KeepAlive(latency)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventNavigation wraps gst_event_new_navigation
//
// The function takes the following parameters:
//
// - structure *Structure: description of the event. The event will take
// ownership of the structure. See #GstNavigation for more specific
// constructors.
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new navigation event from the given description.
func NewEventNavigation(structure *Structure) *Event {
var carg1 *C.GstStructure // in, full, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
cret = C.gst_event_new_navigation(carg1)
runtime.KeepAlive(structure)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventProtection wraps gst_event_new_protection
//
// The function takes the following parameters:
//
// - systemId string: a string holding a UUID that uniquely
// identifies a protection system.
// - data *Buffer: a #GstBuffer holding protection system specific
// information. The reference count of the buffer will be incremented by one.
// - origin string: a string indicating where the protection
// information carried in the event was extracted from. The allowed values
// of this string will depend upon the protection scheme.
//
// The function returns the following values:
//
// - goret *Event
//
// Creates a new event containing information specific to a particular
// protection system (uniquely identified by @system_id), by which that
// protection system can acquire key(s) to decrypt a protected stream.
//
// In order for a decryption element to decrypt media
// protected using a specific system, it first needs all the
// protection system specific information necessary to acquire the decryption
// key(s) for that stream. The functions defined here enable this information
// to be passed in events from elements that extract it
// (e.g., ISOBMFF demuxers, MPEG DASH demuxers) to protection decrypter
// elements that use it.
//
// Events containing protection system specific information are created using
// #gst_event_new_protection, and they can be parsed by downstream elements
// using #gst_event_parse_protection.
//
// In Common Encryption, protection system specific information may be located
// within ISOBMFF files, both in movie (moov) boxes and movie fragment (moof)
// boxes; it may also be contained in ContentProtection elements within MPEG
// DASH MPDs. The events created by #gst_event_new_protection contain data
// identifying from which of these locations the encapsulated protection system
// specific information originated. This origin information is required as
// some protection systems use different encodings depending upon where the
// information originates.
//
// The events returned by gst_event_new_protection() are implemented
// in such a way as to ensure that the most recently-pushed protection info
// event of a particular @origin and @system_id will
// be stuck to the output pad of the sending element.
func NewEventProtection(systemId string, data *Buffer, origin string) *Event {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstBuffer // in, none, converted
var carg3 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstEvent // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(systemId)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.GstBuffer)(UnsafeBufferToGlibNone(data))
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(origin)))
defer C.free(unsafe.Pointer(carg3))
cret = C.gst_event_new_protection(carg1, carg2, carg3)
runtime.KeepAlive(systemId)
runtime.KeepAlive(data)
runtime.KeepAlive(origin)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventQos wraps gst_event_new_qos
//
// The function takes the following parameters:
//
// - typ QOSType: the QoS type
// - proportion float64: the proportion of the qos message
// - diff ClockTimeDiff: The time difference of the last Clock sync
// - timestamp ClockTime: The timestamp of the buffer
//
// The function returns the following values:
//
// - goret *Event
//
// Allocate a new qos event with the given values.
// The QOS event is generated in an element that wants an upstream
// element to either reduce or increase its rate because of
// high/low CPU load or other resource usage such as network performance or
// throttling. Typically sinks generate these events for each buffer
// they receive.
//
// @type indicates the reason for the QoS event. #GST_QOS_TYPE_OVERFLOW is
// used when a buffer arrived in time or when the sink cannot keep up with
// the upstream datarate. #GST_QOS_TYPE_UNDERFLOW is when the sink is not
// receiving buffers fast enough and thus has to drop late buffers.
// #GST_QOS_TYPE_THROTTLE is used when the datarate is artificially limited
// by the application, for example to reduce power consumption.
//
// @proportion indicates the real-time performance of the streaming in the
// element that generated the QoS event (usually the sink). The value is
// generally computed based on more long term statistics about the streams
// timestamps compared to the clock.
// A value &lt; 1.0 indicates that the upstream element is producing data faster
// than real-time. A value &gt; 1.0 indicates that the upstream element is not
// producing data fast enough. 1.0 is the ideal @proportion value. The
// proportion value can safely be used to lower or increase the quality of
// the element.
//
// @diff is the difference against the clock in running time of the last
// buffer that caused the element to generate the QOS event. A negative value
// means that the buffer with @timestamp arrived in time. A positive value
// indicates how late the buffer with @timestamp was. When throttling is
// enabled, @diff will be set to the requested throttling interval.
//
// @timestamp is the timestamp of the last buffer that cause the element
// to generate the QOS event. It is expressed in running time and thus an ever
// increasing value.
//
// The upstream element can use the @diff and @timestamp values to decide
// whether to process more buffers. For positive @diff, all buffers with
// timestamp &lt;= @timestamp + @diff will certainly arrive late in the sink
// as well. A (negative) @diff value so that @timestamp + @diff would yield a
// result smaller than 0 is not allowed.
//
// The application can use general event probes to intercept the QoS
// event and implement custom application specific QoS handling.
func NewEventQos(typ QOSType, proportion float64, diff ClockTimeDiff, timestamp ClockTime) *Event {
var carg1 C.GstQOSType // in, none, casted
var carg2 C.gdouble // in, none, casted
var carg3 C.GstClockTimeDiff // in, none, casted, alias
var carg4 C.GstClockTime // in, none, casted, alias
var cret *C.GstEvent // return, full, converted
carg1 = C.GstQOSType(typ)
carg2 = C.gdouble(proportion)
carg3 = C.GstClockTimeDiff(diff)
carg4 = C.GstClockTime(timestamp)
cret = C.gst_event_new_qos(carg1, carg2, carg3, carg4)
runtime.KeepAlive(typ)
runtime.KeepAlive(proportion)
runtime.KeepAlive(diff)
runtime.KeepAlive(timestamp)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventReconfigure wraps gst_event_new_reconfigure
// The function returns the following values:
//
// - goret *Event
//
// Create a new reconfigure event. The purpose of the reconfigure event is
// to travel upstream and make elements renegotiate their caps or reconfigure
// their buffer pools. This is useful when changing properties on elements
// or changing the topology of the pipeline.
func NewEventReconfigure() *Event {
var cret *C.GstEvent // return, full, converted
cret = C.gst_event_new_reconfigure()
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventSeek wraps gst_event_new_seek
//
// The function takes the following parameters:
//
// - rate float64: The new playback rate
// - format Format: The format of the seek values
// - flags SeekFlags: The optional seek flags
// - startType SeekType: The type and flags for the new start position
// - start int64: The value of the new start position
// - stopType SeekType: The type and flags for the new stop position
// - stop int64: The value of the new stop position
//
// The function returns the following values:
//
// - goret *Event
//
// Allocate a new seek event with the given parameters.
//
// The seek event configures playback of the pipeline between @start to @stop
// at the speed given in @rate, also called a playback segment.
// The @start and @stop values are expressed in @format.
//
// A @rate of 1.0 means normal playback rate, 2.0 means double speed.
// Negatives values means backwards playback. A value of 0.0 for the
// rate is not allowed and should be accomplished instead by PAUSING the
// pipeline.
//
// A pipeline has a default playback segment configured with a start
// position of 0, a stop position of -1 and a rate of 1.0. The currently
// configured playback segment can be queried with #GST_QUERY_SEGMENT.
//
// @start_type and @stop_type specify how to adjust the currently configured
// start and stop fields in playback segment. Adjustments can be made relative
// or absolute to the last configured values. A type of #GST_SEEK_TYPE_NONE
// means that the position should not be updated.
//
// When the rate is positive and @start has been updated, playback will start
// from the newly configured start position.
//
// For negative rates, playback will start from the newly configured stop
// position (if any). If the stop position is updated, it must be different from
// -1 (#GST_CLOCK_TIME_NONE) for negative rates.
//
// It is not possible to seek relative to the current playback position, to do
// this, PAUSE the pipeline, query the current playback position with
// #GST_QUERY_POSITION and update the playback segment current position with a
// #GST_SEEK_TYPE_SET to the desired position.
func NewEventSeek(rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64) *Event {
var carg1 C.gdouble // in, none, casted
var carg2 C.GstFormat // in, none, casted
var carg3 C.GstSeekFlags // in, none, casted
var carg4 C.GstSeekType // in, none, casted
var carg5 C.gint64 // in, none, casted
var carg6 C.GstSeekType // in, none, casted
var carg7 C.gint64 // in, none, casted
var cret *C.GstEvent // return, full, converted
carg1 = C.gdouble(rate)
carg2 = C.GstFormat(format)
carg3 = C.GstSeekFlags(flags)
carg4 = C.GstSeekType(startType)
carg5 = C.gint64(start)
carg6 = C.GstSeekType(stopType)
carg7 = C.gint64(stop)
cret = C.gst_event_new_seek(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(rate)
runtime.KeepAlive(format)
runtime.KeepAlive(flags)
runtime.KeepAlive(startType)
runtime.KeepAlive(start)
runtime.KeepAlive(stopType)
runtime.KeepAlive(stop)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventSegment wraps gst_event_new_segment
//
// The function takes the following parameters:
//
// - segment *Segment: a #GstSegment
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new SEGMENT event for @segment. The segment event can only travel
// downstream synchronized with the buffer flow and contains timing information
// and playback properties for the buffers that will follow.
//
// The segment event marks the range of buffers to be processed. All
// data not within the segment range is not to be processed. This can be
// used intelligently by plugins to apply more efficient methods of skipping
// unneeded data. The valid range is expressed with the @start and @stop
// values.
//
// The time value of the segment is used in conjunction with the start
// value to convert the buffer timestamps into the stream time. This is
// usually done in sinks to report the current stream_time.
// @time represents the stream_time of a buffer carrying a timestamp of
// @start. @time cannot be -1.
//
// @start cannot be -1, @stop can be -1. If there
// is a valid @stop given, it must be greater or equal the @start, including
// when the indicated playback @rate is &lt; 0.
//
// The @applied_rate value provides information about any rate adjustment that
// has already been made to the timestamps and content on the buffers of the
// stream. (@rate * @applied_rate) should always equal the rate that has been
// requested for playback. For example, if an element has an input segment
// with intended playback @rate of 2.0 and applied_rate of 1.0, it can adjust
// incoming timestamps and buffer content by half and output a segment event
// with @rate of 1.0 and @applied_rate of 2.0
//
// After a segment event, the buffer stream time is calculated with:
//
// time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
func NewEventSegment(segment *Segment) *Event {
var carg1 *C.GstSegment // in, none, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
cret = C.gst_event_new_segment(carg1)
runtime.KeepAlive(segment)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventSegmentDone wraps gst_event_new_segment_done
//
// The function takes the following parameters:
//
// - format Format: The format of the position being done
// - position int64: The position of the segment being done
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new segment-done event. This event is sent by elements that
// finish playback of a segment as a result of a segment seek.
func NewEventSegmentDone(format Format, position int64) *Event {
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var cret *C.GstEvent // return, full, converted
carg1 = C.GstFormat(format)
carg2 = C.gint64(position)
cret = C.gst_event_new_segment_done(carg1, carg2)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventSinkMessage wraps gst_event_new_sink_message
//
// The function takes the following parameters:
//
// - name string: a name for the event
// - msg *Message: the #GstMessage to be posted
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new sink-message event. The purpose of the sink-message event is
// to instruct a sink to post the message contained in the event synchronized
// with the stream.
//
// @name is used to store multiple sticky events on one pad.
func NewEventSinkMessage(name string, msg *Message) *Event {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstMessage // in, none, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.GstMessage)(UnsafeMessageToGlibNone(msg))
cret = C.gst_event_new_sink_message(carg1, carg2)
runtime.KeepAlive(name)
runtime.KeepAlive(msg)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventStep wraps gst_event_new_step
//
// The function takes the following parameters:
//
// - format Format: the format of @amount
// - amount uint64: the amount of data to step
// - rate float64: the step rate
// - flush bool: flushing steps
// - intermediate bool: intermediate steps
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new step event. The purpose of the step event is to instruct a sink
// to skip @amount (expressed in @format) of media. It can be used to implement
// stepping through the video frame by frame or for doing fast trick modes.
//
// A rate of &lt;= 0.0 is not allowed. Pause the pipeline, for the effect of rate
// = 0.0 or first reverse the direction of playback using a seek event to get
// the same effect as rate &lt; 0.0.
//
// The @flush flag will clear any pending data in the pipeline before starting
// the step operation.
//
// The @intermediate flag instructs the pipeline that this step operation is
// part of a larger step operation.
func NewEventStep(format Format, amount uint64, rate float64, flush bool, intermediate bool) *Event {
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.gdouble // in, none, casted
var carg4 C.gboolean // in
var carg5 C.gboolean // in
var cret *C.GstEvent // return, full, converted
carg1 = C.GstFormat(format)
carg2 = C.guint64(amount)
carg3 = C.gdouble(rate)
if flush {
carg4 = C.TRUE
}
if intermediate {
carg5 = C.TRUE
}
cret = C.gst_event_new_step(carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(format)
runtime.KeepAlive(amount)
runtime.KeepAlive(rate)
runtime.KeepAlive(flush)
runtime.KeepAlive(intermediate)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventStreamCollection wraps gst_event_new_stream_collection
//
// The function takes the following parameters:
//
// - collection StreamCollection: Active collection for this data flow
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new STREAM_COLLECTION event. The stream collection event can only
// travel downstream synchronized with the buffer flow.
//
// Source elements, demuxers and other elements that manage collections
// of streams and post #GstStreamCollection messages on the bus also send
// this event downstream on each pad involved in the collection, so that
// activation of a new collection can be tracked through the downstream
// data flow.
func NewEventStreamCollection(collection StreamCollection) *Event {
var carg1 *C.GstStreamCollection // in, none, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
cret = C.gst_event_new_stream_collection(carg1)
runtime.KeepAlive(collection)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventStreamGroupDone wraps gst_event_new_stream_group_done
//
// The function takes the following parameters:
//
// - groupId uint: the group id of the stream group which is ending
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new Stream Group Done event. The stream-group-done event can
// only travel downstream synchronized with the buffer flow. Elements
// that receive the event on a pad should handle it mostly like EOS,
// and emit any data or pending buffers that would depend on more data
// arriving and unblock, since there won't be any more data.
//
// This event is followed by EOS at some point in the future, and is
// generally used when switching pads - to unblock downstream so that
// new pads can be exposed before sending EOS on the existing pads.
func NewEventStreamGroupDone(groupId uint) *Event {
var carg1 C.guint // in, none, casted
var cret *C.GstEvent // return, full, converted
carg1 = C.guint(groupId)
cret = C.gst_event_new_stream_group_done(carg1)
runtime.KeepAlive(groupId)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventStreamStart wraps gst_event_new_stream_start
//
// The function takes the following parameters:
//
// - streamId string: Identifier for this stream
//
// The function returns the following values:
//
// - goret *Event
//
// Create a new STREAM_START event. The stream start event can only
// travel downstream synchronized with the buffer flow. It is expected
// to be the first event that is sent for a new stream.
//
// Source elements, demuxers and other elements that create new streams
// are supposed to send this event as the first event of a new stream. It
// should not be sent after a flushing seek or in similar situations
// and is used to mark the beginning of a new logical stream. Elements
// combining multiple streams must ensure that this event is only forwarded
// downstream once and not for every single input stream.
//
// The @stream_id should be a unique string that consists of the upstream
// stream-id, / as separator and a unique stream-id for this specific
// stream. A new stream-id should only be created for a stream if the upstream
// stream is split into (potentially) multiple new streams, e.g. in a demuxer,
// but not for every single element in the pipeline.
// gst_pad_create_stream_id() or gst_pad_create_stream_id_printf() can be
// used to create a stream-id. There are no particular semantics for the
// stream-id, though it should be deterministic (to support stream matching)
// and it might be used to order streams (besides any information conveyed by
// stream flags).
func NewEventStreamStart(streamId string) *Event {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstEvent // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(streamId)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_event_new_stream_start(carg1)
runtime.KeepAlive(streamId)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventTag wraps gst_event_new_tag
//
// The function takes the following parameters:
//
// - taglist *TagList: metadata list. The event will take ownership
// of the taglist.
//
// The function returns the following values:
//
// - goret *Event
//
// Generates a metadata tag event from the given @taglist.
//
// The scope of the taglist specifies if the taglist applies to the
// complete medium or only to this specific stream. As the tag event
// is a sticky event, elements should merge tags received from
// upstream with a given scope with their own tags with the same
// scope and create a new tag event from it.
func NewEventTag(taglist *TagList) *Event {
var carg1 *C.GstTagList // in, full, converted
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstTagList)(UnsafeTagListToGlibFull(taglist))
cret = C.gst_event_new_tag(carg1)
runtime.KeepAlive(taglist)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventToc wraps gst_event_new_toc
//
// The function takes the following parameters:
//
// - toc *Toc: #GstToc structure.
// - updated bool: whether @toc was updated or not.
//
// The function returns the following values:
//
// - goret *Event
//
// Generate a TOC event from the given @toc. The purpose of the TOC event is to
// inform elements that some kind of the TOC was found.
func NewEventToc(toc *Toc, updated bool) *Event {
var carg1 *C.GstToc // in, none, converted
var carg2 C.gboolean // in
var cret *C.GstEvent // return, full, converted
carg1 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
if updated {
carg2 = C.TRUE
}
cret = C.gst_event_new_toc(carg1, carg2)
runtime.KeepAlive(toc)
runtime.KeepAlive(updated)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewEventTocSelect wraps gst_event_new_toc_select
//
// The function takes the following parameters:
//
// - uid string: UID in the TOC to start playback from.
//
// The function returns the following values:
//
// - goret *Event
//
// Generate a TOC select event with the given @uid. The purpose of the
// TOC select event is to start playback based on the TOC's entry with the
// given @uid.
func NewEventTocSelect(uid string) *Event {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstEvent // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uid)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_event_new_toc_select(carg1)
runtime.KeepAlive(uid)
var goret *Event
goret = UnsafeEventFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CopySegment wraps gst_event_copy_segment
//
// The function takes the following parameters:
//
// - segment *Segment: a pointer to a #GstSegment
//
// Parses a segment @event and copies the #GstSegment into the location
// given by @segment.
func (event *Event) CopySegment(segment *Segment) {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstSegment // in, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
C.gst_event_copy_segment(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(segment)
}
// GetRunningTimeOffset wraps gst_event_get_running_time_offset
// The function returns the following values:
//
// - goret int64
//
// Retrieve the accumulated running time offset of the event.
//
// Events passing through #GstPads that have a running time
// offset set via gst_pad_set_offset() will get their offset
// adjusted according to the pad's offset.
//
// If the event contains any information that related to the
// running time, this information will need to be updated
// before usage with this offset.
func (event *Event) GetRunningTimeOffset() int64 {
var carg0 *C.GstEvent // in, none, converted
var cret C.gint64 // return, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_event_get_running_time_offset(carg0)
runtime.KeepAlive(event)
var goret int64
goret = int64(cret)
return goret
}
// GetSeqnum wraps gst_event_get_seqnum
// The function returns the following values:
//
// - goret uint32
//
// Retrieve the sequence number of a event.
//
// Events have ever-incrementing sequence numbers, which may also be set
// explicitly via gst_event_set_seqnum(). Sequence numbers are typically used to
// indicate that a event corresponds to some other set of events or messages,
// for example an EOS event corresponding to a SEEK event. It is considered good
// practice to make this correspondence when possible, though it is not
// required.
//
// Note that events and messages share the same sequence number incrementor;
// two events or messages will never have the same sequence number unless
// that correspondence was made explicitly.
func (event *Event) GetSeqnum() uint32 {
var carg0 *C.GstEvent // in, none, converted
var cret C.guint32 // return, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_event_get_seqnum(carg0)
runtime.KeepAlive(event)
var goret uint32
goret = uint32(cret)
return goret
}
// GetStructure wraps gst_event_get_structure
// The function returns the following values:
//
// - goret *Structure
//
// Access the structure of the event.
func (event *Event) GetStructure() *Structure {
var carg0 *C.GstEvent // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_event_get_structure(carg0)
runtime.KeepAlive(event)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// HasName wraps gst_event_has_name
//
// The function takes the following parameters:
//
// - name string: name to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @event has the given @name. This function is usually used to
// check the name of a custom event.
func (event *Event) HasName(name string) bool {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_event_has_name(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasNameID wraps gst_event_has_name_id
//
// The function takes the following parameters:
//
// - name glib.Quark: name to check as a GQuark
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @event has the given @name. This function is usually used to
// check the name of a custom event.
func (event *Event) HasNameID(name glib.Quark) bool {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.GQuark(name)
cret = C.gst_event_has_name_id(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ParseBufferSize wraps gst_event_parse_buffer_size
// The function returns the following values:
//
// - format Format: A pointer to store the format in
// - minsize int64: A pointer to store the minsize in
// - maxsize int64: A pointer to store the maxsize in
// - async bool: A pointer to store the async-flag in
//
// Get the format, minsize, maxsize and async-flag in the buffersize event.
func (event *Event) ParseBufferSize() (Format, int64, int64, bool) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
var carg3 C.gint64 // out, full, casted
var carg4 C.gboolean // out
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_buffer_size(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(event)
var format Format
var minsize int64
var maxsize int64
var async bool
format = Format(carg1)
minsize = int64(carg2)
maxsize = int64(carg3)
if carg4 != 0 {
async = true
}
return format, minsize, maxsize, async
}
// ParseCaps wraps gst_event_parse_caps
// The function returns the following values:
//
// - caps *Caps: A pointer to the caps
//
// Get the caps from @event. The caps remains valid as long as @event remains
// valid.
func (event *Event) ParseCaps() *Caps {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstCaps // out, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_caps(carg0, &carg1)
runtime.KeepAlive(event)
var caps *Caps
caps = UnsafeCapsFromGlibNone(unsafe.Pointer(carg1))
return caps
}
// ParseFlushStop wraps gst_event_parse_flush_stop
// The function returns the following values:
//
// - resetTime bool: if time should be reset
//
// Parse the FLUSH_STOP event and retrieve the @reset_time member.
func (event *Event) ParseFlushStop() bool {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.gboolean // out
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_flush_stop(carg0, &carg1)
runtime.KeepAlive(event)
var resetTime bool
if carg1 != 0 {
resetTime = true
}
return resetTime
}
// ParseGap wraps gst_event_parse_gap
// The function returns the following values:
//
// - timestamp ClockTime: location where to store the
// start time (pts) of the gap, or %NULL
// - duration ClockTime: location where to store the duration of
// the gap, or %NULL
//
// Extract timestamp and duration from a new GAP event.
func (event *Event) ParseGap() (ClockTime, ClockTime) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
var carg2 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_gap(carg0, &carg1, &carg2)
runtime.KeepAlive(event)
var timestamp ClockTime
var duration ClockTime
timestamp = ClockTime(carg1)
duration = ClockTime(carg2)
return timestamp, duration
}
// ParseGapFlags wraps gst_event_parse_gap_flags
// The function returns the following values:
//
// - flags GapFlags: a #GstGapFlags or %NULL
//
// Retrieve the gap flags that may have been set on a gap event with
// gst_event_set_gap_flags().
func (event *Event) ParseGapFlags() GapFlags {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstGapFlags // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_gap_flags(carg0, &carg1)
runtime.KeepAlive(event)
var flags GapFlags
flags = GapFlags(carg1)
return flags
}
// ParseGroupID wraps gst_event_parse_group_id
// The function returns the following values:
//
// - groupId uint: address of variable where to store the group id
// - goret bool
func (event *Event) ParseGroupID() (uint, bool) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.guint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_event_parse_group_id(carg0, &carg1)
runtime.KeepAlive(event)
var groupId uint
var goret bool
groupId = uint(carg1)
if cret != 0 {
goret = true
}
return groupId, goret
}
// ParseInstantRateChange wraps gst_event_parse_instant_rate_change
// The function returns the following values:
//
// - rateMultiplier float64: location in which to store the rate
// multiplier of the instant-rate-change event, or %NULL
// - newFlags SegmentFlags: location in which to store the new
// segment flags of the instant-rate-change event, or %NULL
//
// Extract rate and flags from an instant-rate-change event.
func (event *Event) ParseInstantRateChange() (float64, SegmentFlags) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.gdouble // out, full, casted
var carg2 C.GstSegmentFlags // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_instant_rate_change(carg0, &carg1, &carg2)
runtime.KeepAlive(event)
var rateMultiplier float64
var newFlags SegmentFlags
rateMultiplier = float64(carg1)
newFlags = SegmentFlags(carg2)
return rateMultiplier, newFlags
}
// ParseInstantRateSyncTime wraps gst_event_parse_instant_rate_sync_time
// The function returns the following values:
//
// - rateMultiplier float64: location where to store the rate of
// the instant-rate-sync-time event, or %NULL
// - runningTime ClockTime: location in which to store the running time
// of the instant-rate-sync-time event, or %NULL
// - upstreamRunningTime ClockTime: location in which to store the
// upstream running time of the instant-rate-sync-time event, or %NULL
//
// Extract the rate multiplier and running times from an instant-rate-sync-time event.
func (event *Event) ParseInstantRateSyncTime() (float64, ClockTime, ClockTime) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.gdouble // out, full, casted
var carg2 C.GstClockTime // out, full, casted, alias
var carg3 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_instant_rate_sync_time(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(event)
var rateMultiplier float64
var runningTime ClockTime
var upstreamRunningTime ClockTime
rateMultiplier = float64(carg1)
runningTime = ClockTime(carg2)
upstreamRunningTime = ClockTime(carg3)
return rateMultiplier, runningTime, upstreamRunningTime
}
// ParseLatency wraps gst_event_parse_latency
// The function returns the following values:
//
// - latency ClockTime: A pointer to store the latency in.
//
// Get the latency in the latency event.
func (event *Event) ParseLatency() ClockTime {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_latency(carg0, &carg1)
runtime.KeepAlive(event)
var latency ClockTime
latency = ClockTime(carg1)
return latency
}
// ParseProtection wraps gst_event_parse_protection
// The function returns the following values:
//
// - systemId string: pointer to store the UUID
// string uniquely identifying a content protection system.
// - data *Buffer: pointer to store a #GstBuffer
// holding protection system specific information.
// - origin string: pointer to store a value that
// indicates where the protection information carried by @event was extracted
// from.
//
// Parses an event containing protection system specific information and stores
// the results in @system_id, @data and @origin. The data stored in @system_id,
// @origin and @data are valid until @event is released.
func (event *Event) ParseProtection() (string, *Buffer, string) {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.gchar // out, none, string, casted *C.gchar
var carg2 *C.GstBuffer // out, none, converted
var carg3 *C.gchar // out, none, string, casted *C.gchar
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_protection(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(event)
var systemId string
var data *Buffer
var origin string
systemId = C.GoString((*C.char)(unsafe.Pointer(carg1)))
data = UnsafeBufferFromGlibNone(unsafe.Pointer(carg2))
origin = C.GoString((*C.char)(unsafe.Pointer(carg3)))
return systemId, data, origin
}
// ParseQos wraps gst_event_parse_qos
// The function returns the following values:
//
// - typ QOSType: A pointer to store the QoS type in
// - proportion float64: A pointer to store the proportion in
// - diff ClockTimeDiff: A pointer to store the diff in
// - timestamp ClockTime: A pointer to store the timestamp in
//
// Get the type, proportion, diff and timestamp in the qos event. See
// gst_event_new_qos() for more information about the different QoS values.
//
// @timestamp will be adjusted for any pad offsets of pads it was passing through.
func (event *Event) ParseQos() (QOSType, float64, ClockTimeDiff, ClockTime) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstQOSType // out, full, casted
var carg2 C.gdouble // out, full, casted
var carg3 C.GstClockTimeDiff // out, full, casted, alias
var carg4 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_qos(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(event)
var typ QOSType
var proportion float64
var diff ClockTimeDiff
var timestamp ClockTime
typ = QOSType(carg1)
proportion = float64(carg2)
diff = ClockTimeDiff(carg3)
timestamp = ClockTime(carg4)
return typ, proportion, diff, timestamp
}
// ParseSeek wraps gst_event_parse_seek
// The function returns the following values:
//
// - rate float64: result location for the rate
// - format Format: result location for the stream format
// - flags SeekFlags: result location for the #GstSeekFlags
// - startType SeekType: result location for the #GstSeekType of the start position
// - start int64: result location for the start position expressed in @format
// - stopType SeekType: result location for the #GstSeekType of the stop position
// - stop int64: result location for the stop position expressed in @format
//
// Parses a seek @event and stores the results in the given result locations.
func (event *Event) ParseSeek() (float64, Format, SeekFlags, SeekType, int64, SeekType, int64) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.gdouble // out, full, casted
var carg2 C.GstFormat // out, full, casted
var carg3 C.GstSeekFlags // out, full, casted
var carg4 C.GstSeekType // out, full, casted
var carg5 C.gint64 // out, full, casted
var carg6 C.GstSeekType // out, full, casted
var carg7 C.gint64 // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_seek(carg0, &carg1, &carg2, &carg3, &carg4, &carg5, &carg6, &carg7)
runtime.KeepAlive(event)
var rate float64
var format Format
var flags SeekFlags
var startType SeekType
var start int64
var stopType SeekType
var stop int64
rate = float64(carg1)
format = Format(carg2)
flags = SeekFlags(carg3)
startType = SeekType(carg4)
start = int64(carg5)
stopType = SeekType(carg6)
stop = int64(carg7)
return rate, format, flags, startType, start, stopType, stop
}
// ParseSeekTrickmodeInterval wraps gst_event_parse_seek_trickmode_interval
// The function returns the following values:
//
// - interval ClockTime: interval
//
// Retrieve the trickmode interval that may have been set on a
// seek event with gst_event_set_seek_trickmode_interval().
func (event *Event) ParseSeekTrickmodeInterval() ClockTime {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_seek_trickmode_interval(carg0, &carg1)
runtime.KeepAlive(event)
var interval ClockTime
interval = ClockTime(carg1)
return interval
}
// ParseSegment wraps gst_event_parse_segment
// The function returns the following values:
//
// - segment *Segment: a pointer to a #GstSegment
//
// Parses a segment @event and stores the result in the given @segment location.
// @segment remains valid only until the @event is freed. Don't modify the segment
// and make a copy if you want to modify it or store it for later use.
func (event *Event) ParseSegment() *Segment {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstSegment // out, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_segment(carg0, &carg1)
runtime.KeepAlive(event)
var segment *Segment
segment = UnsafeSegmentFromGlibNone(unsafe.Pointer(carg1))
return segment
}
// ParseSegmentDone wraps gst_event_parse_segment_done
// The function returns the following values:
//
// - format Format: Result location for the format, or %NULL
// - position int64: Result location for the position, or %NULL
//
// Extracts the position and format from the segment done message.
func (event *Event) ParseSegmentDone() (Format, int64) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_segment_done(carg0, &carg1, &carg2)
runtime.KeepAlive(event)
var format Format
var position int64
format = Format(carg1)
position = int64(carg2)
return format, position
}
// ParseSinkMessage wraps gst_event_parse_sink_message
// The function returns the following values:
//
// - msg *Message: a pointer to store the #GstMessage in.
//
// Parse the sink-message event. Unref @msg after usage.
func (event *Event) ParseSinkMessage() *Message {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstMessage // out, full, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_sink_message(carg0, &carg1)
runtime.KeepAlive(event)
var msg *Message
msg = UnsafeMessageFromGlibFull(unsafe.Pointer(carg1))
return msg
}
// ParseStep wraps gst_event_parse_step
// The function returns the following values:
//
// - format Format: a pointer to store the format in
// - amount uint64: a pointer to store the amount in
// - rate float64: a pointer to store the rate in
// - flush bool: a pointer to store the flush boolean in
// - intermediate bool: a pointer to store the intermediate
// boolean in
//
// Parse the step event.
func (event *Event) ParseStep() (Format, uint64, float64, bool, bool) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.guint64 // out, full, casted
var carg3 C.gdouble // out, full, casted
var carg4 C.gboolean // out
var carg5 C.gboolean // out
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_step(carg0, &carg1, &carg2, &carg3, &carg4, &carg5)
runtime.KeepAlive(event)
var format Format
var amount uint64
var rate float64
var flush bool
var intermediate bool
format = Format(carg1)
amount = uint64(carg2)
rate = float64(carg3)
if carg4 != 0 {
flush = true
}
if carg5 != 0 {
intermediate = true
}
return format, amount, rate, flush, intermediate
}
// ParseStream wraps gst_event_parse_stream
// The function returns the following values:
//
// - stream Stream: address of variable to store the stream
//
// Parse a stream-start @event and extract the #GstStream from it.
func (event *Event) ParseStream() Stream {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstStream // out, full, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_stream(carg0, &carg1)
runtime.KeepAlive(event)
var stream Stream
stream = UnsafeStreamFromGlibFull(unsafe.Pointer(carg1))
return stream
}
// ParseStreamCollection wraps gst_event_parse_stream_collection
// The function returns the following values:
//
// - collection StreamCollection: pointer to store the collection.
//
// Retrieve new #GstStreamCollection from STREAM_COLLECTION event @event.
func (event *Event) ParseStreamCollection() StreamCollection {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstStreamCollection // out, full, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_stream_collection(carg0, &carg1)
runtime.KeepAlive(event)
var collection StreamCollection
collection = UnsafeStreamCollectionFromGlibFull(unsafe.Pointer(carg1))
return collection
}
// ParseStreamFlags wraps gst_event_parse_stream_flags
// The function returns the following values:
//
// - flags StreamFlags: address of variable where to store the stream flags
func (event *Event) ParseStreamFlags() StreamFlags {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstStreamFlags // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_stream_flags(carg0, &carg1)
runtime.KeepAlive(event)
var flags StreamFlags
flags = StreamFlags(carg1)
return flags
}
// ParseStreamGroupDone wraps gst_event_parse_stream_group_done
// The function returns the following values:
//
// - groupId uint: address of variable to store the group id into
//
// Parse a stream-group-done @event and store the result in the given
// @group_id location.
func (event *Event) ParseStreamGroupDone() uint {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.guint // out, full, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_stream_group_done(carg0, &carg1)
runtime.KeepAlive(event)
var groupId uint
groupId = uint(carg1)
return groupId
}
// ParseStreamStart wraps gst_event_parse_stream_start
// The function returns the following values:
//
// - streamId string: pointer to store the stream-id
//
// Parse a stream-id @event and store the result in the given @stream_id
// location. The string stored in @stream_id must not be modified and will
// remain valid only until @event gets freed. Make a copy if you want to
// modify it or store it for later use.
func (event *Event) ParseStreamStart() string {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.gchar // out, none, string, casted *C.gchar
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_stream_start(carg0, &carg1)
runtime.KeepAlive(event)
var streamId string
streamId = C.GoString((*C.char)(unsafe.Pointer(carg1)))
return streamId
}
// ParseTag wraps gst_event_parse_tag
// The function returns the following values:
//
// - taglist *TagList: pointer to metadata list
//
// Parses a tag @event and stores the results in the given @taglist location.
// No reference to the taglist will be returned, it remains valid only until
// the @event is freed. Don't modify or free the taglist, make a copy if you
// want to modify it or store it for later use.
func (event *Event) ParseTag() *TagList {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstTagList // out, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_tag(carg0, &carg1)
runtime.KeepAlive(event)
var taglist *TagList
taglist = UnsafeTagListFromGlibNone(unsafe.Pointer(carg1))
return taglist
}
// ParseToc wraps gst_event_parse_toc
// The function returns the following values:
//
// - toc *Toc: pointer to #GstToc structure.
// - updated bool: pointer to store TOC updated flag.
//
// Parse a TOC @event and store the results in the given @toc and @updated locations.
func (event *Event) ParseToc() (*Toc, bool) {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstToc // out, full, converted
var carg2 C.gboolean // out
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_toc(carg0, &carg1, &carg2)
runtime.KeepAlive(event)
var toc *Toc
var updated bool
toc = UnsafeTocFromGlibFull(unsafe.Pointer(carg1))
if carg2 != 0 {
updated = true
}
return toc, updated
}
// ParseTocSelect wraps gst_event_parse_toc_select
// The function returns the following values:
//
// - uid string: storage for the selection UID.
//
// Parse a TOC select @event and store the results in the given @uid location.
func (event *Event) ParseTocSelect() string {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.gchar // out, full, string, casted *C.gchar
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
C.gst_event_parse_toc_select(carg0, &carg1)
runtime.KeepAlive(event)
var uid string
uid = C.GoString((*C.char)(unsafe.Pointer(carg1)))
defer C.free(unsafe.Pointer(carg1))
return uid
}
// SetGapFlags wraps gst_event_set_gap_flags
//
// The function takes the following parameters:
//
// - flags GapFlags: a #GstGapFlags
//
// Sets @flags on @event to give additional information about the reason for
// the #GST_EVENT_GAP.
func (event *Event) SetGapFlags(flags GapFlags) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstGapFlags // in, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.GstGapFlags(flags)
C.gst_event_set_gap_flags(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(flags)
}
// SetGroupID wraps gst_event_set_group_id
//
// The function takes the following parameters:
//
// - groupId uint: the group id to set
//
// All streams that have the same group id are supposed to be played
// together, i.e. all streams inside a container file should have the
// same group id but different stream ids. The group id should change
// each time the stream is started, resulting in different group ids
// each time a file is played for example.
//
// Use gst_util_group_id_next() to get a new group id.
func (event *Event) SetGroupID(groupId uint) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.guint(groupId)
C.gst_event_set_group_id(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(groupId)
}
// SetRunningTimeOffset wraps gst_event_set_running_time_offset
//
// The function takes the following parameters:
//
// - offset int64: A the new running time offset
//
// Set the running time offset of a event. See
// gst_event_get_running_time_offset() for more information.
//
// MT safe.
func (event *Event) SetRunningTimeOffset(offset int64) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.gint64 // in, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.gint64(offset)
C.gst_event_set_running_time_offset(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(offset)
}
// SetSeekTrickmodeInterval wraps gst_event_set_seek_trickmode_interval
//
// The function takes the following parameters:
//
// - interval ClockTime
//
// Sets a trickmode interval on a (writable) seek event. Elements
// that support TRICKMODE_KEY_UNITS seeks SHOULD use this as the minimal
// interval between each frame they may output.
func (event *Event) SetSeekTrickmodeInterval(interval ClockTime) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.GstClockTime(interval)
C.gst_event_set_seek_trickmode_interval(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(interval)
}
// SetSeqnum wraps gst_event_set_seqnum
//
// The function takes the following parameters:
//
// - seqnum uint32: A sequence number.
//
// Set the sequence number of a event.
//
// This function might be called by the creator of a event to indicate that the
// event relates to other events or messages. See gst_event_get_seqnum() for
// more information.
//
// MT safe.
func (event *Event) SetSeqnum(seqnum uint32) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.guint32 // in, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.guint32(seqnum)
C.gst_event_set_seqnum(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(seqnum)
}
// SetStream wraps gst_event_set_stream
//
// The function takes the following parameters:
//
// - stream Stream: the stream object to set
//
// Set the @stream on the stream-start @event
func (event *Event) SetStream(stream Stream) {
var carg0 *C.GstEvent // in, none, converted
var carg1 *C.GstStream // in, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
C.gst_event_set_stream(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(stream)
}
// SetStreamFlags wraps gst_event_set_stream_flags
//
// The function takes the following parameters:
//
// - flags StreamFlags: the stream flags to set
func (event *Event) SetStreamFlags(flags StreamFlags) {
var carg0 *C.GstEvent // in, none, converted
var carg1 C.GstStreamFlags // in, none, casted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
carg1 = C.GstStreamFlags(flags)
C.gst_event_set_stream_flags(carg0, carg1)
runtime.KeepAlive(event)
runtime.KeepAlive(flags)
}
// WritableStructure wraps gst_event_writable_structure
// The function returns the following values:
//
// - goret *Structure
//
// Get a writable version of the structure.
func (event *Event) WritableStructure() *Structure {
var carg0 *C.GstEvent // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstEvent)(UnsafeEventToGlibNone(event))
cret = C.gst_event_writable_structure(carg0)
runtime.KeepAlive(event)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// FormatDefinition wraps GstFormatDefinition
//
// A format definition
type FormatDefinition struct {
*formatDefinition
}
// formatDefinition is the struct that's finalized
type formatDefinition struct {
native *C.GstFormatDefinition
}
// UnsafeFormatDefinitionFromGlibBorrow is used to convert raw C.GstFormatDefinition pointers to go. This is used by the bindings internally.
func UnsafeFormatDefinitionFromGlibBorrow(p unsafe.Pointer) *FormatDefinition {
return &FormatDefinition{&formatDefinition{(*C.GstFormatDefinition)(p)}}
}
// UnsafeFormatDefinitionFromGlibNone is used to convert raw C.GstFormatDefinition pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeFormatDefinitionFromGlibNone(p unsafe.Pointer) *FormatDefinition {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeFormatDefinitionFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.formatDefinition,
func (intern *formatDefinition) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeFormatDefinitionFromGlibFull is used to convert raw C.GstFormatDefinition pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeFormatDefinitionFromGlibFull(p unsafe.Pointer) *FormatDefinition {
wrapped := UnsafeFormatDefinitionFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.formatDefinition,
func (intern *formatDefinition) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeFormatDefinitionFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [FormatDefinition] is expected to work anymore.
func UnsafeFormatDefinitionFree(f *FormatDefinition) {
C.free(unsafe.Pointer(f.native))
}
// UnsafeFormatDefinitionToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeFormatDefinitionToGlibNone(f *FormatDefinition) unsafe.Pointer {
return unsafe.Pointer(f.native)
}
// UnsafeFormatDefinitionToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeFormatDefinitionToGlibFull(f *FormatDefinition) unsafe.Pointer {
runtime.SetFinalizer(f.formatDefinition, nil)
_p := unsafe.Pointer(f.native)
f.native = nil // FormatDefinition is invalid from here on
return _p
}
// GhostPadClass wraps GstGhostPadClass
type GhostPadClass struct {
*ghostPadClass
}
// ghostPadClass is the struct that's finalized
type ghostPadClass struct {
native *C.GstGhostPadClass
}
// UnsafeGhostPadClassFromGlibBorrow is used to convert raw C.GstGhostPadClass pointers to go. This is used by the bindings internally.
func UnsafeGhostPadClassFromGlibBorrow(p unsafe.Pointer) *GhostPadClass {
return &GhostPadClass{&ghostPadClass{(*C.GstGhostPadClass)(p)}}
}
// UnsafeGhostPadClassFromGlibNone is used to convert raw C.GstGhostPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeGhostPadClassFromGlibNone(p unsafe.Pointer) *GhostPadClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeGhostPadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.ghostPadClass,
func (intern *ghostPadClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeGhostPadClassFromGlibFull is used to convert raw C.GstGhostPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeGhostPadClassFromGlibFull(p unsafe.Pointer) *GhostPadClass {
wrapped := UnsafeGhostPadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.ghostPadClass,
func (intern *ghostPadClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeGhostPadClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [GhostPadClass] is expected to work anymore.
func UnsafeGhostPadClassFree(g *GhostPadClass) {
C.free(unsafe.Pointer(g.native))
}
// UnsafeGhostPadClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeGhostPadClassToGlibNone(g *GhostPadClass) unsafe.Pointer {
return unsafe.Pointer(g.native)
}
// UnsafeGhostPadClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeGhostPadClassToGlibFull(g *GhostPadClass) unsafe.Pointer {
runtime.SetFinalizer(g.ghostPadClass, nil)
_p := unsafe.Pointer(g.native)
g.native = nil // GhostPadClass is invalid from here on
return _p
}
// Iterator wraps GstIterator
//
// A GstIterator is used to retrieve multiple objects from another object in
// a threadsafe way.
//
// Various GStreamer objects provide access to their internal structures using
// an iterator.
//
// Note that if calling a GstIterator function results in your code receiving
// a refcounted object (with, say, g_value_get_object()), the refcount for that
// object will not be increased. Your code is responsible for taking a reference
// if it wants to continue using it later.
//
// The basic use pattern of an iterator is as follows:
// |[&lt;!-- language="C" --&gt;
// GstIterator *it = _get_iterator(object);
// GValue item = G_VALUE_INIT;
// done = FALSE;
// while (!done) {
// switch (gst_iterator_next (it, &amp;item)) {
// case GST_ITERATOR_OK:
// ...get/use/change item here...
// g_value_reset (&amp;item);
// break;
// case GST_ITERATOR_RESYNC:
// ...rollback changes to items...
// gst_iterator_resync (it);
// break;
// case GST_ITERATOR_ERROR:
// ...wrong parameters were given...
// done = TRUE;
// break;
// case GST_ITERATOR_DONE:
// done = TRUE;
// break;
// }
// }
// g_value_unset (&amp;item);
// gst_iterator_free (it);
// ]|
type Iterator struct {
*iterator
}
// iterator is the struct that's finalized
type iterator struct {
native *C.GstIterator
}
var _ gobject.GoValueInitializer = (*Iterator)(nil)
func marshalIterator(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeIteratorFromGlibBorrow(b), nil
}
func (r *Iterator) InitGoValue(v *gobject.Value) {
v.Init(TypeIterator)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeIteratorFromGlibBorrow is used to convert raw C.GstIterator pointers to go. This is used by the bindings internally.
func UnsafeIteratorFromGlibBorrow(p unsafe.Pointer) *Iterator {
return &Iterator{&iterator{(*C.GstIterator)(p)}}
}
// UnsafeIteratorFromGlibNone is used to convert raw C.GstIterator pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeIteratorFromGlibNone(p unsafe.Pointer) *Iterator {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeIteratorFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.iterator,
func (intern *iterator) {
C.gst_iterator_free(intern.native)
},
)
return wrapped
}
// UnsafeIteratorFromGlibFull is used to convert raw C.GstIterator pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeIteratorFromGlibFull(p unsafe.Pointer) *Iterator {
wrapped := UnsafeIteratorFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.iterator,
func (intern *iterator) {
C.gst_iterator_free(intern.native)
},
)
return wrapped
}
// UnsafeIteratorFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Iterator] is expected to work anymore.
func UnsafeIteratorFree(i *Iterator) {
C.gst_iterator_free(i.native)
}
// UnsafeIteratorToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeIteratorToGlibNone(i *Iterator) unsafe.Pointer {
return unsafe.Pointer(i.native)
}
// UnsafeIteratorToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeIteratorToGlibFull(i *Iterator) unsafe.Pointer {
runtime.SetFinalizer(i.iterator, nil)
_p := unsafe.Pointer(i.native)
i.native = nil // Iterator is invalid from here on
return _p
}
// NewIteratorSingle wraps gst_iterator_new_single
//
// The function takes the following parameters:
//
// - typ gobject.Type: #GType of the passed object
// - object *gobject.Value: object that this iterator should return
//
// The function returns the following values:
//
// - goret *Iterator
//
// This #GstIterator is a convenient iterator for the common
// case where a #GstIterator needs to be returned but only
// a single object has to be considered. This happens often
// for the #GstPadIterIntLinkFunction.
func NewIteratorSingle(typ gobject.Type, object *gobject.Value) *Iterator {
var carg1 C.GType // in, none, casted, alias
var carg2 *C.GValue // in, none, converted
var cret *C.GstIterator // return, full, converted
carg1 = C.GType(typ)
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(object))
cret = C.gst_iterator_new_single(carg1, carg2)
runtime.KeepAlive(typ)
runtime.KeepAlive(object)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Copy wraps gst_iterator_copy
// The function returns the following values:
//
// - goret *Iterator
//
// Copy the iterator and its state.
func (it *Iterator) Copy() *Iterator {
var carg0 *C.GstIterator // in, none, converted
var cret *C.GstIterator // return, full, converted
carg0 = (*C.GstIterator)(UnsafeIteratorToGlibNone(it))
cret = C.gst_iterator_copy(carg0)
runtime.KeepAlive(it)
var goret *Iterator
goret = UnsafeIteratorFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Fold wraps gst_iterator_fold
//
// The function takes the following parameters:
//
// - fn IteratorFoldFunction: the fold function
// - ret *gobject.Value: the seed value passed to the fold function
//
// The function returns the following values:
//
// - goret IteratorResult
//
// Folds @func over the elements of @iter. That is to say, @func will be called
// as @func (object, @ret, @user_data) for each object in @it. The normal use
// of this procedure is to accumulate the results of operating on the objects in
// @ret.
//
// This procedure can be used (and is used internally) to implement the
// gst_iterator_foreach() and gst_iterator_find_custom() operations.
//
// The fold will proceed as long as @func returns %TRUE. When the iterator has no
// more arguments, %GST_ITERATOR_DONE will be returned. If @func returns %FALSE,
// the fold will stop, and %GST_ITERATOR_OK will be returned. Errors or resyncs
// will cause fold to return %GST_ITERATOR_ERROR or %GST_ITERATOR_RESYNC as
// appropriate.
//
// The iterator will not be freed.
func (it *Iterator) Fold(fn IteratorFoldFunction, ret *gobject.Value) IteratorResult {
var carg0 *C.GstIterator // in, none, converted
var carg1 C.GstIteratorFoldFunction // callback, scope: call, closure: carg3
var carg2 *C.GValue // in, none, converted
var carg3 C.gpointer // implicit
var cret C.GstIteratorResult // return, none, casted
carg0 = (*C.GstIterator)(UnsafeIteratorToGlibNone(it))
carg1 = (*[0]byte)(C._gotk4_gst1_IteratorFoldFunction)
carg3 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg3))
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(ret))
cret = C.gst_iterator_fold(carg0, carg1, carg2, carg3)
runtime.KeepAlive(it)
runtime.KeepAlive(fn)
runtime.KeepAlive(ret)
var goret IteratorResult
goret = IteratorResult(cret)
return goret
}
// ForEach wraps gst_iterator_foreach
//
// The function takes the following parameters:
//
// - fn IteratorForEachFunction: the function to call for each element.
//
// The function returns the following values:
//
// - goret IteratorResult
//
// Iterate over all element of @it and call the given function @func for
// each element.
func (it *Iterator) ForEach(fn IteratorForEachFunction) IteratorResult {
var carg0 *C.GstIterator // in, none, converted
var carg1 C.GstIteratorForeachFunction // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.GstIteratorResult // return, none, casted
carg0 = (*C.GstIterator)(UnsafeIteratorToGlibNone(it))
carg1 = (*[0]byte)(C._gotk4_gst1_IteratorForEachFunction)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_iterator_foreach(carg0, carg1, carg2)
runtime.KeepAlive(it)
runtime.KeepAlive(fn)
var goret IteratorResult
goret = IteratorResult(cret)
return goret
}
// Push wraps gst_iterator_push
//
// The function takes the following parameters:
//
// - other *Iterator: The #GstIterator to push
//
// Pushes @other iterator onto @it. All calls performed on @it are
// forwarded to @other. If @other returns %GST_ITERATOR_DONE, it is
// popped again and calls are handled by @it again.
//
// This function is mainly used by objects implementing the iterator
// next function to recurse into substructures.
//
// When gst_iterator_resync() is called on @it, @other will automatically be
// popped.
//
// MT safe.
func (it *Iterator) Push(other *Iterator) {
var carg0 *C.GstIterator // in, none, converted
var carg1 *C.GstIterator // in, none, converted
carg0 = (*C.GstIterator)(UnsafeIteratorToGlibNone(it))
carg1 = (*C.GstIterator)(UnsafeIteratorToGlibNone(other))
C.gst_iterator_push(carg0, carg1)
runtime.KeepAlive(it)
runtime.KeepAlive(other)
}
// Resync wraps gst_iterator_resync
//
// Resync the iterator. this function is mostly called
// after gst_iterator_next() returned %GST_ITERATOR_RESYNC.
//
// When an iterator was pushed on @it, it will automatically be popped again
// with this function.
//
// MT safe.
func (it *Iterator) Resync() {
var carg0 *C.GstIterator // in, none, converted
carg0 = (*C.GstIterator)(UnsafeIteratorToGlibNone(it))
C.gst_iterator_resync(carg0)
runtime.KeepAlive(it)
}
// MapInfo wraps GstMapInfo
//
// A structure containing the result of a map operation such as
// gst_memory_map(). It contains the data and size.
//
// #GstMapInfo cannot be used with g_auto() because it is ambiguous whether it
// needs to be unmapped using gst_buffer_unmap() or gst_memory_unmap(). Instead,
// #GstBufferMapInfo and #GstMemoryMapInfo can be used in that case.
type MapInfo struct {
*mapInfo
}
// mapInfo is the struct that's finalized
type mapInfo struct {
native *C.GstMapInfo
}
// UnsafeMapInfoFromGlibBorrow is used to convert raw C.GstMapInfo pointers to go. This is used by the bindings internally.
func UnsafeMapInfoFromGlibBorrow(p unsafe.Pointer) *MapInfo {
return &MapInfo{&mapInfo{(*C.GstMapInfo)(p)}}
}
// UnsafeMapInfoFromGlibNone is used to convert raw C.GstMapInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMapInfoFromGlibNone(p unsafe.Pointer) *MapInfo {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMapInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.mapInfo,
func (intern *mapInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMapInfoFromGlibFull is used to convert raw C.GstMapInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMapInfoFromGlibFull(p unsafe.Pointer) *MapInfo {
wrapped := UnsafeMapInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.mapInfo,
func (intern *mapInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMapInfoFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [MapInfo] is expected to work anymore.
func UnsafeMapInfoFree(m *MapInfo) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMapInfoToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMapInfoToGlibNone(m *MapInfo) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMapInfoToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMapInfoToGlibFull(m *MapInfo) unsafe.Pointer {
runtime.SetFinalizer(m.mapInfo, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // MapInfo is invalid from here on
return _p
}
// Memory wraps GstMemory
//
// GstMemory is a lightweight refcounted object that wraps a region of memory.
// They are typically used to manage the data of a #GstBuffer.
//
// A GstMemory object has an allocated region of memory of maxsize. The maximum
// size does not change during the lifetime of the memory object. The memory
// also has an offset and size property that specifies the valid range of memory
// in the allocated region.
//
// Memory is usually created by allocators with a gst_allocator_alloc()
// method call. When %NULL is used as the allocator, the default allocator will
// be used.
//
// New allocators can be registered with gst_allocator_register().
// Allocators are identified by name and can be retrieved with
// gst_allocator_find(). gst_allocator_set_default() can be used to change the
// default allocator.
//
// New memory can be created with gst_memory_new_wrapped() that wraps the memory
// allocated elsewhere.
//
// Refcounting of the memory block is performed with gst_memory_ref() and
// gst_memory_unref().
//
// The size of the memory can be retrieved and changed with
// gst_memory_get_sizes() and gst_memory_resize() respectively.
//
// Getting access to the data of the memory is performed with gst_memory_map().
// The call will return a pointer to offset bytes into the region of memory.
// After the memory access is completed, gst_memory_unmap() should be called.
//
// Memory can be copied with gst_memory_copy(), which will return a writable
// copy. gst_memory_share() will create a new memory block that shares the
// memory with an existing memory block at a custom offset and with a custom
// size.
//
// Memory can be efficiently merged when gst_memory_is_span() returns %TRUE.
type Memory struct {
*memory
}
// memory is the struct that's finalized
type memory struct {
native *C.GstMemory
}
var _ gobject.GoValueInitializer = (*Memory)(nil)
func marshalMemory(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeMemoryFromGlibBorrow(b), nil
}
func (r *Memory) InitGoValue(v *gobject.Value) {
v.Init(TypeMemory)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeMemoryFromGlibBorrow is used to convert raw C.GstMemory pointers to go. This is used by the bindings internally.
func UnsafeMemoryFromGlibBorrow(p unsafe.Pointer) *Memory {
return &Memory{&memory{(*C.GstMemory)(p)}}
}
// UnsafeMemoryFromGlibNone is used to convert raw C.GstMemory pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMemoryFromGlibNone(p unsafe.Pointer) *Memory {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMemoryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.memory,
func (intern *memory) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMemoryFromGlibFull is used to convert raw C.GstMemory pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMemoryFromGlibFull(p unsafe.Pointer) *Memory {
wrapped := UnsafeMemoryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.memory,
func (intern *memory) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMemoryFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Memory] is expected to work anymore.
func UnsafeMemoryFree(m *Memory) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMemoryToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMemoryToGlibNone(m *Memory) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMemoryToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMemoryToGlibFull(m *Memory) unsafe.Pointer {
runtime.SetFinalizer(m.memory, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // Memory is invalid from here on
return _p
}
// Copy wraps gst_memory_copy
//
// The function takes the following parameters:
//
// - offset int: offset to copy from
// - size int: size to copy, or -1 to copy to the end of the memory region
//
// The function returns the following values:
//
// - goret *Memory
//
// Return a copy of @size bytes from @mem starting from @offset. This copy is
// guaranteed to be writable. @size can be set to -1 to return a copy
// from @offset to the end of the memory region.
func (mem *Memory) Copy(offset int, size int) *Memory {
var carg0 *C.GstMemory // in, none, converted
var carg1 C.gssize // in, none, casted
var carg2 C.gssize // in, none, casted
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg1 = C.gssize(offset)
carg2 = C.gssize(size)
cret = C.gst_memory_copy(carg0, carg1, carg2)
runtime.KeepAlive(mem)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetSizes wraps gst_memory_get_sizes
// The function returns the following values:
//
// - offset uint: pointer to offset
// - maxsize uint: pointer to maxsize
// - goret uint
//
// Get the current @size, @offset and @maxsize of @mem.
func (mem *Memory) GetSizes() (uint, uint, uint) {
var carg0 *C.GstMemory // in, none, converted
var carg1 C.gsize // out, full, casted
var carg2 C.gsize // out, full, casted
var cret C.gsize // return, none, casted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
cret = C.gst_memory_get_sizes(carg0, &carg1, &carg2)
runtime.KeepAlive(mem)
var offset uint
var maxsize uint
var goret uint
offset = uint(carg1)
maxsize = uint(carg2)
goret = uint(cret)
return offset, maxsize, goret
}
// IsSpan wraps gst_memory_is_span
//
// The function takes the following parameters:
//
// - mem2 *Memory: a #GstMemory
//
// The function returns the following values:
//
// - offset uint: a pointer to a result offset
// - goret bool
//
// Check if @mem1 and mem2 share the memory with a common parent memory object
// and that the memory is contiguous.
//
// If this is the case, the memory of @mem1 and @mem2 can be merged
// efficiently by performing gst_memory_share() on the parent object from
// the returned @offset.
func (mem1 *Memory) IsSpan(mem2 *Memory) (uint, bool) {
var carg0 *C.GstMemory // in, none, converted
var carg1 *C.GstMemory // in, none, converted
var carg2 C.gsize // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem1))
carg1 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem2))
cret = C.gst_memory_is_span(carg0, carg1, &carg2)
runtime.KeepAlive(mem1)
runtime.KeepAlive(mem2)
var offset uint
var goret bool
offset = uint(carg2)
if cret != 0 {
goret = true
}
return offset, goret
}
// IsType wraps gst_memory_is_type
//
// The function takes the following parameters:
//
// - memType string: a memory type
//
// The function returns the following values:
//
// - goret bool
//
// Check if @mem if allocated with an allocator for @mem_type.
func (mem *Memory) IsType(memType string) bool {
var carg0 *C.GstMemory // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(memType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_memory_is_type(carg0, carg1)
runtime.KeepAlive(mem)
runtime.KeepAlive(memType)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MakeMapped wraps gst_memory_make_mapped
//
// The function takes the following parameters:
//
// - flags MapFlags: mapping flags
//
// The function returns the following values:
//
// - info MapInfo: pointer for info
// - goret *Memory
//
// Create a #GstMemory object that is mapped with @flags. If @mem is mappable
// with @flags, this function returns the mapped @mem directly. Otherwise a
// mapped copy of @mem is returned.
//
// This function takes ownership of old @mem and returns a reference to a new
// #GstMemory.
func (mem *Memory) MakeMapped(flags MapFlags) (MapInfo, *Memory) {
var carg0 *C.GstMemory // in, none, converted
var carg2 C.GstMapFlags // in, none, casted
var carg1 C.GstMapInfo // out, transfer: none, C Pointers: 0, Name: MapInfo, caller-allocates
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg2 = C.GstMapFlags(flags)
cret = C.gst_memory_make_mapped(carg0, &carg1, carg2)
runtime.KeepAlive(mem)
runtime.KeepAlive(flags)
var info MapInfo
var goret *Memory
_ = info
_ = carg1
panic("unimplemented conversion of MapInfo (GstMapInfo)")
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return info, goret
}
// Map wraps gst_memory_map
//
// The function takes the following parameters:
//
// - flags MapFlags: mapping flags
//
// The function returns the following values:
//
// - info MapInfo: pointer for info
// - goret bool
//
// Fill @info with the pointer and sizes of the memory in @mem that can be
// accessed according to @flags.
//
// This function can return %FALSE for various reasons:
// - the memory backed by @mem is not accessible with the given @flags.
// - the memory was already mapped with a different mapping.
//
// @info and its contents remain valid for as long as @mem is valid and
// until gst_memory_unmap() is called.
//
// For each gst_memory_map() call, a corresponding gst_memory_unmap() call
// should be done.
func (mem *Memory) Map(flags MapFlags) (MapInfo, bool) {
var carg0 *C.GstMemory // in, none, converted
var carg2 C.GstMapFlags // in, none, casted
var carg1 C.GstMapInfo // out, transfer: none, C Pointers: 0, Name: MapInfo, caller-allocates
var cret C.gboolean // return
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg2 = C.GstMapFlags(flags)
cret = C.gst_memory_map(carg0, &carg1, carg2)
runtime.KeepAlive(mem)
runtime.KeepAlive(flags)
var info MapInfo
var goret bool
_ = info
_ = carg1
panic("unimplemented conversion of MapInfo (GstMapInfo)")
if cret != 0 {
goret = true
}
return info, goret
}
// Resize wraps gst_memory_resize
//
// The function takes the following parameters:
//
// - offset int: a new offset
// - size uint: a new size
//
// Resize the memory region. @mem should be writable and offset + size should be
// less than the maxsize of @mem.
//
// #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED will be
// cleared when offset or padding is increased respectively.
func (mem *Memory) Resize(offset int, size uint) {
var carg0 *C.GstMemory // in, none, converted
var carg1 C.gssize // in, none, casted
var carg2 C.gsize // in, none, casted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg1 = C.gssize(offset)
carg2 = C.gsize(size)
C.gst_memory_resize(carg0, carg1, carg2)
runtime.KeepAlive(mem)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
}
// Share wraps gst_memory_share
//
// The function takes the following parameters:
//
// - offset int: offset to share from
// - size int: size to share, or -1 to share to the end of the memory region
//
// The function returns the following values:
//
// - goret *Memory
//
// Return a shared copy of @size bytes from @mem starting from @offset. No
// memory copy is performed and the memory region is simply shared. The result
// is guaranteed to be non-writable. @size can be set to -1 to return a shared
// copy from @offset to the end of the memory region.
func (mem *Memory) Share(offset int, size int) *Memory {
var carg0 *C.GstMemory // in, none, converted
var carg1 C.gssize // in, none, casted
var carg2 C.gssize // in, none, casted
var cret *C.GstMemory // return, full, converted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg1 = C.gssize(offset)
carg2 = C.gssize(size)
cret = C.gst_memory_share(carg0, carg1, carg2)
runtime.KeepAlive(mem)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret *Memory
goret = UnsafeMemoryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Unmap wraps gst_memory_unmap
//
// The function takes the following parameters:
//
// - info *MapInfo: a #GstMapInfo
//
// Release the memory obtained with gst_memory_map()
func (mem *Memory) Unmap(info *MapInfo) {
var carg0 *C.GstMemory // in, none, converted
var carg1 *C.GstMapInfo // in, none, converted
carg0 = (*C.GstMemory)(UnsafeMemoryToGlibNone(mem))
carg1 = (*C.GstMapInfo)(UnsafeMapInfoToGlibNone(info))
C.gst_memory_unmap(carg0, carg1)
runtime.KeepAlive(mem)
runtime.KeepAlive(info)
}
// Message wraps GstMessage
//
// Messages are implemented as a subclass of #GstMiniObject with a generic
// #GstStructure as the content. This allows for writing custom messages without
// requiring an API change while allowing a wide range of different types
// of messages.
//
// Messages are posted by objects in the pipeline and are passed to the
// application using the #GstBus.
//
// The basic use pattern of posting a message on a #GstBus is as follows:
// |[&lt;!-- language="C" --&gt;
// gst_bus_post (bus, gst_message_new_eos());
// ]|
//
// A #GstElement usually posts messages on the bus provided by the parent
// container using gst_element_post_message().
type Message struct {
*message
}
// message is the struct that's finalized
type message struct {
native *C.GstMessage
}
var _ gobject.GoValueInitializer = (*Message)(nil)
func marshalMessage(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeMessageFromGlibBorrow(b), nil
}
func (r *Message) InitGoValue(v *gobject.Value) {
v.Init(TypeMessage)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeMessageFromGlibBorrow is used to convert raw C.GstMessage pointers to go. This is used by the bindings internally.
func UnsafeMessageFromGlibBorrow(p unsafe.Pointer) *Message {
return &Message{&message{(*C.GstMessage)(p)}}
}
// UnsafeMessageFromGlibNone is used to convert raw C.GstMessage pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMessageFromGlibNone(p unsafe.Pointer) *Message {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMessageFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.message,
func (intern *message) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMessageFromGlibFull is used to convert raw C.GstMessage pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMessageFromGlibFull(p unsafe.Pointer) *Message {
wrapped := UnsafeMessageFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.message,
func (intern *message) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMessageFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Message] is expected to work anymore.
func UnsafeMessageFree(m *Message) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMessageToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMessageToGlibNone(m *Message) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMessageToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMessageToGlibFull(m *Message) unsafe.Pointer {
runtime.SetFinalizer(m.message, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // Message is invalid from here on
return _p
}
// NewMessageApplication wraps gst_message_new_application
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - structure *Structure: the structure for the message. The message
// will take ownership of the structure.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new application-typed message. GStreamer will never create these
// messages; they are a gift from us to you. Enjoy.
func NewMessageApplication(src Object, structure *Structure) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstStructure // in, full, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
cret = C.gst_message_new_application(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(structure)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageAsyncDone wraps gst_message_new_async_done
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - runningTime ClockTime: the desired running_time
//
// The function returns the following values:
//
// - goret *Message
//
// The message is posted when elements completed an ASYNC state change.
// @running_time contains the time of the desired running_time when this
// elements goes to PLAYING. A value of #GST_CLOCK_TIME_NONE for @running_time
// means that the element has no clock interaction and thus doesn't care about
// the running_time of the pipeline.
func NewMessageAsyncDone(src Object, runningTime ClockTime) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstClockTime // in, none, casted, alias
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstClockTime(runningTime)
cret = C.gst_message_new_async_done(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(runningTime)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageAsyncStart wraps gst_message_new_async_start
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted by elements when they start an ASYNC state change.
func NewMessageAsyncStart(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_async_start(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageBuffering wraps gst_message_new_buffering
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - percent int: The buffering percent
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new buffering message. This message can be posted by an element that
// needs to buffer data before it can continue processing. @percent should be a
// value between 0 and 100. A value of 100 means that the buffering completed.
//
// When @percent is &lt; 100 the application should PAUSE a PLAYING pipeline. When
// @percent is 100, the application can set the pipeline (back) to PLAYING.
// The application must be prepared to receive BUFFERING messages in the
// PREROLLING state and may only set the pipeline to PLAYING after receiving a
// message with @percent set to 100, which can happen after the pipeline
// completed prerolling.
//
// MT safe.
func NewMessageBuffering(src Object, percent int) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.gint // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.gint(percent)
cret = C.gst_message_new_buffering(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(percent)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageClockLost wraps gst_message_new_clock_lost
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - clock Clock: the clock that was lost
//
// The function returns the following values:
//
// - goret *Message
//
// Create a clock lost message. This message is posted whenever the
// clock is not valid anymore.
//
// If this message is posted by the pipeline, the pipeline will
// select a new clock again when it goes to PLAYING. It might therefore
// be needed to set the pipeline to PAUSED and PLAYING again.
func NewMessageClockLost(src Object, clock Clock) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstClock // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_message_new_clock_lost(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(clock)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageClockProvide wraps gst_message_new_clock_provide
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - clock Clock: the clock it provides
// - ready bool: %TRUE if the sender can provide a clock
//
// The function returns the following values:
//
// - goret *Message
//
// Create a clock provide message. This message is posted whenever an
// element is ready to provide a clock or lost its ability to provide
// a clock (maybe because it paused or became EOS).
//
// This message is mainly used internally to manage the clock
// selection.
func NewMessageClockProvide(src Object, clock Clock, ready bool) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstClock // in, none, converted
var carg3 C.gboolean // in
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
if ready {
carg3 = C.TRUE
}
cret = C.gst_message_new_clock_provide(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(clock)
runtime.KeepAlive(ready)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageCustom wraps gst_message_new_custom
//
// The function takes the following parameters:
//
// - typ MessageType: The #GstMessageType to distinguish messages
// - src Object (nullable): The object originating the message.
// - structure *Structure (nullable): the structure for the
// message. The message will take ownership of the structure.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new custom-typed message. This can be used for anything not
// handled by other message-specific functions to pass a message to the
// app. The structure field can be %NULL.
func NewMessageCustom(typ MessageType, src Object, structure *Structure) *Message {
var carg1 C.GstMessageType // in, none, casted
var carg2 *C.GstObject // in, none, converted, nullable
var carg3 *C.GstStructure // in, full, converted, nullable
var cret *C.GstMessage // return, full, converted
carg1 = C.GstMessageType(typ)
if src != nil {
carg2 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
if structure != nil {
carg3 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
}
cret = C.gst_message_new_custom(carg1, carg2, carg3)
runtime.KeepAlive(typ)
runtime.KeepAlive(src)
runtime.KeepAlive(structure)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageDeviceAdded wraps gst_message_new_device_added
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that created the message
// - device Device: The new #GstDevice
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new device-added message. The device-added message is produced by
// #GstDeviceProvider or a #GstDeviceMonitor. They announce the appearance
// of monitored devices.
func NewMessageDeviceAdded(src Object, device Device) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstDevice // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_message_new_device_added(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(device)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageDeviceChanged wraps gst_message_new_device_changed
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that created the message
// - device Device: The newly created device representing @changed_device
// with its new configuration.
// - changedDevice Device: The old version of the device.
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new device-changed message. The device-changed message is produced
// by #GstDeviceProvider or a #GstDeviceMonitor. They announce that a device
// properties has changed and @device represent the new modified version of @changed_device.
func NewMessageDeviceChanged(src Object, device Device, changedDevice Device) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstDevice // in, none, converted
var carg3 *C.GstDevice // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
carg3 = (*C.GstDevice)(UnsafeDeviceToGlibNone(changedDevice))
cret = C.gst_message_new_device_changed(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(device)
runtime.KeepAlive(changedDevice)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageDeviceRemoved wraps gst_message_new_device_removed
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that created the message
// - device Device: The removed #GstDevice
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new device-removed message. The device-removed message is produced
// by #GstDeviceProvider or a #GstDeviceMonitor. They announce the
// disappearance of monitored devices.
func NewMessageDeviceRemoved(src Object, device Device) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstDevice // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstDevice)(UnsafeDeviceToGlibNone(device))
cret = C.gst_message_new_device_removed(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(device)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageDurationChanged wraps gst_message_new_duration_changed
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new duration changed message. This message is posted by elements
// that know the duration of a stream when the duration changes. This message
// is received by bins and is used to calculate the total duration of a
// pipeline.
func NewMessageDurationChanged(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_duration_changed(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageElement wraps gst_message_new_element
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - structure *Structure: The structure for the
// message. The message will take ownership of the structure.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new element-specific message. This is meant as a generic way of
// allowing one-way communication from an element to an application, for example
// "the firewire cable was unplugged". The format of the message should be
// documented in the element's documentation. The structure field can be %NULL.
func NewMessageElement(src Object, structure *Structure) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstStructure // in, full, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
cret = C.gst_message_new_element(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(structure)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageEos wraps gst_message_new_eos
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new eos message. This message is generated and posted in
// the sink elements of a GstBin. The bin will only forward the EOS
// message to the application if all sinks have posted an EOS message.
func NewMessageEos(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_eos(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageError wraps gst_message_new_error
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new error message. The message will copy @error and
// @debug. This message is posted by element when a fatal event
// occurred. The pipeline will probably (partially) stop. The application
// receiving this message should stop the pipeline.
func NewMessageError(src Object, debug string, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_error(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageErrorWithDetails wraps gst_message_new_error_with_details
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - details *Structure (nullable): A GstStructure with details
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new error message. The message will copy @error and
// @debug. This message is posted by element when a fatal event
// occurred. The pipeline will probably (partially) stop. The application
// receiving this message should stop the pipeline.
func NewMessageErrorWithDetails(src Object, debug string, details *Structure, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.GstStructure // in, full, converted, nullable
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
if details != nil {
carg4 = (*C.GstStructure)(UnsafeStructureToGlibFull(details))
}
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_error_with_details(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(details)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageHaveContext wraps gst_message_new_have_context
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - _context *Context: the context
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted when an element has a new local #GstContext.
func NewMessageHaveContext(src Object, _context *Context) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstContext // in, full, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstContext)(UnsafeContextToGlibFull(_context))
cret = C.gst_message_new_have_context(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(_context)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageInfo wraps gst_message_new_info
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new info message. The message will make copies of @error and
// @debug.
func NewMessageInfo(src Object, debug string, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_info(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageInfoWithDetails wraps gst_message_new_info_with_details
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - details *Structure (nullable): A GstStructure with details
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new info message. The message will make copies of @error and
// @debug.
func NewMessageInfoWithDetails(src Object, debug string, details *Structure, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.GstStructure // in, full, converted, nullable
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
if details != nil {
carg4 = (*C.GstStructure)(UnsafeStructureToGlibFull(details))
}
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_info_with_details(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(details)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageInstantRateRequest wraps gst_message_new_instant_rate_request
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that posted the message
// - rateMultiplier float64: the rate multiplier factor that should be applied
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new instant-rate-request message. Elements handling the
// instant-rate-change event must post this message. The message is
// handled at the pipeline, and allows the pipeline to select the
// running time when the rate change should happen and to send an
// @GST_EVENT_INSTANT_RATE_SYNC_TIME event to notify the elements
// in the pipeline.
func NewMessageInstantRateRequest(src Object, rateMultiplier float64) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.gdouble // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.gdouble(rateMultiplier)
cret = C.gst_message_new_instant_rate_request(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(rateMultiplier)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageLatency wraps gst_message_new_latency
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
//
// The function returns the following values:
//
// - goret *Message
//
// This message can be posted by elements when their latency requirements have
// changed.
func NewMessageLatency(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_latency(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageNeedContext wraps gst_message_new_need_context
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - contextType string: The context type that is needed
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted when an element needs a specific #GstContext.
func NewMessageNeedContext(src Object, contextType string) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_message_new_need_context(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(contextType)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageNewClock wraps gst_message_new_new_clock
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - clock Clock: the new selected clock
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new clock message. This message is posted whenever the
// pipeline selects a new clock for the pipeline.
func NewMessageNewClock(src Object, clock Clock) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstClock // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstClock)(UnsafeClockToGlibNone(clock))
cret = C.gst_message_new_new_clock(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(clock)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageProgress wraps gst_message_new_progress
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - typ ProgressType: a #GstProgressType
// - code string: a progress code
// - text string: free, user visible text describing the progress
//
// The function returns the following values:
//
// - goret *Message
//
// Progress messages are posted by elements when they use an asynchronous task
// to perform actions triggered by a state change.
//
// @code contains a well defined string describing the action.
// @text should contain a user visible string detailing the current action.
func NewMessageProgress(src Object, typ ProgressType, code string, text string) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstProgressType // in, none, casted
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstProgressType(typ)
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(code)))
defer C.free(unsafe.Pointer(carg3))
carg4 = (*C.gchar)(unsafe.Pointer(C.CString(text)))
defer C.free(unsafe.Pointer(carg4))
cret = C.gst_message_new_progress(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(typ)
runtime.KeepAlive(code)
runtime.KeepAlive(text)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageQos wraps gst_message_new_qos
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - live bool: if the message was generated by a live element
// - runningTime uint64: the running time of the buffer that generated the message
// - streamTime uint64: the stream time of the buffer that generated the message
// - timestamp uint64: the timestamps of the buffer that generated the message
// - duration uint64: the duration of the buffer that generated the message
//
// The function returns the following values:
//
// - goret *Message
//
// A QOS message is posted on the bus whenever an element decides to drop a
// buffer because of QoS reasons or whenever it changes its processing strategy
// because of QoS reasons (quality adjustments such as processing at lower
// accuracy).
//
// This message can be posted by an element that performs synchronisation against the
// clock (live) or it could be dropped by an element that performs QoS because of QOS
// events received from a downstream element (!live).
//
// @running_time, @stream_time, @timestamp, @duration should be set to the
// respective running-time, stream-time, timestamp and duration of the (dropped)
// buffer that generated the QoS event. Values can be left to
// GST_CLOCK_TIME_NONE when unknown.
func NewMessageQos(src Object, live bool, runningTime uint64, streamTime uint64, timestamp uint64, duration uint64) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.gboolean // in
var carg3 C.guint64 // in, none, casted
var carg4 C.guint64 // in, none, casted
var carg5 C.guint64 // in, none, casted
var carg6 C.guint64 // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
if live {
carg2 = C.TRUE
}
carg3 = C.guint64(runningTime)
carg4 = C.guint64(streamTime)
carg5 = C.guint64(timestamp)
carg6 = C.guint64(duration)
cret = C.gst_message_new_qos(carg1, carg2, carg3, carg4, carg5, carg6)
runtime.KeepAlive(src)
runtime.KeepAlive(live)
runtime.KeepAlive(runningTime)
runtime.KeepAlive(streamTime)
runtime.KeepAlive(timestamp)
runtime.KeepAlive(duration)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageRedirect wraps gst_message_new_redirect
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject whose property changed (may or may not be a #GstElement)
// - location string: location string for the new entry
// - tagList *TagList (nullable): tag list for the new entry
// - entryStruct *Structure (nullable): structure for the new entry
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new redirect message and adds a new entry to it. Redirect messages
// are posted when an element detects that the actual data has to be retrieved
// from a different location. This is useful if such a redirection cannot be
// handled inside a source element, for example when HTTP 302/303 redirects
// return a non-HTTP URL.
//
// The redirect message can hold multiple entries. The first one is added
// when the redirect message is created, with the given location, tag_list,
// entry_struct arguments. Use gst_message_add_redirect_entry() to add more
// entries.
//
// Each entry has a location, a tag list, and a structure. All of these are
// optional. The tag list and structure are useful for additional metadata,
// such as bitrate statistics for the given location.
//
// By default, message recipients should treat entries in the order they are
// stored. The recipient should therefore try entry \#0 first, and if this
// entry is not acceptable or working, try entry \#1 etc. Senders must make
// sure that they add entries in this order. However, recipients are free to
// ignore the order and pick an entry that is "best" for them. One example
// would be a recipient that scans the entries for the one with the highest
// bitrate tag.
//
// The specified location string is copied. However, ownership over the tag
// list and structure are transferred to the message.
func NewMessageRedirect(src Object, location string, tagList *TagList, entryStruct *Structure) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.GstTagList // in, full, converted, nullable
var carg4 *C.GstStructure // in, full, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(location)))
defer C.free(unsafe.Pointer(carg2))
if tagList != nil {
carg3 = (*C.GstTagList)(UnsafeTagListToGlibFull(tagList))
}
if entryStruct != nil {
carg4 = (*C.GstStructure)(UnsafeStructureToGlibFull(entryStruct))
}
cret = C.gst_message_new_redirect(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(location)
runtime.KeepAlive(tagList)
runtime.KeepAlive(entryStruct)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageRequestState wraps gst_message_new_request_state
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - state State: The new requested state
//
// The function returns the following values:
//
// - goret *Message
//
// This message can be posted by elements when they want to have their state
// changed. A typical use case would be an audio server that wants to pause the
// pipeline because a higher priority stream is being played.
func NewMessageRequestState(src Object, state State) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstState // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstState(state)
cret = C.gst_message_new_request_state(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(state)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageResetTime wraps gst_message_new_reset_time
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - runningTime ClockTime: the requested running-time
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted when the pipeline running-time should be reset to
// @running_time, like after a flushing seek.
func NewMessageResetTime(src Object, runningTime ClockTime) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstClockTime // in, none, casted, alias
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstClockTime(runningTime)
cret = C.gst_message_new_reset_time(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(runningTime)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageSegmentDone wraps gst_message_new_segment_done
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - format Format: The format of the position being done
// - position int64: The position of the segment being done
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new segment done message. This message is posted by elements that
// finish playback of a segment as a result of a segment seek. This message
// is received by the application after all elements that posted a segment_start
// have posted the segment_done.
func NewMessageSegmentDone(src Object, format Format, position int64) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstFormat // in, none, casted
var carg3 C.gint64 // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstFormat(format)
carg3 = C.gint64(position)
cret = C.gst_message_new_segment_done(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageSegmentStart wraps gst_message_new_segment_start
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - format Format: The format of the position being played
// - position int64: The position of the segment being played
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new segment message. This message is posted by elements that
// start playback of a segment as a result of a segment seek. This message
// is not received by the application but is used for maintenance reasons in
// container elements.
func NewMessageSegmentStart(src Object, format Format, position int64) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstFormat // in, none, casted
var carg3 C.gint64 // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstFormat(format)
carg3 = C.gint64(position)
cret = C.gst_message_new_segment_start(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStateChanged wraps gst_message_new_state_changed
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - oldstate State: the previous state
// - newstate State: the new (current) state
// - pending State: the pending (target) state
//
// The function returns the following values:
//
// - goret *Message
//
// Create a state change message. This message is posted whenever an element
// changed its state.
func NewMessageStateChanged(src Object, oldstate State, newstate State, pending State) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstState // in, none, casted
var carg3 C.GstState // in, none, casted
var carg4 C.GstState // in, none, casted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstState(oldstate)
carg3 = C.GstState(newstate)
carg4 = C.GstState(pending)
cret = C.gst_message_new_state_changed(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(oldstate)
runtime.KeepAlive(newstate)
runtime.KeepAlive(pending)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStateDirty wraps gst_message_new_state_dirty
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message
//
// The function returns the following values:
//
// - goret *Message
//
// Create a state dirty message. This message is posted whenever an element
// changed its state asynchronously and is used internally to update the
// states of container objects.
func NewMessageStateDirty(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_state_dirty(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStepDone wraps gst_message_new_step_done
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - format Format: the format of @amount
// - amount uint64: the amount of stepped data
// - rate float64: the rate of the stepped amount
// - flush bool: is this an flushing step
// - intermediate bool: is this an intermediate step
// - duration uint64: the duration of the data
// - eos bool: the step caused EOS
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted by elements when they complete a part, when @intermediate set
// to %TRUE, or a complete step operation.
//
// @duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped
// @amount of media in format @format.
func NewMessageStepDone(src Object, format Format, amount uint64, rate float64, flush bool, intermediate bool, duration uint64, eos bool) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstFormat // in, none, casted
var carg3 C.guint64 // in, none, casted
var carg4 C.gdouble // in, none, casted
var carg5 C.gboolean // in
var carg6 C.gboolean // in
var carg7 C.guint64 // in, none, casted
var carg8 C.gboolean // in
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstFormat(format)
carg3 = C.guint64(amount)
carg4 = C.gdouble(rate)
if flush {
carg5 = C.TRUE
}
if intermediate {
carg6 = C.TRUE
}
carg7 = C.guint64(duration)
if eos {
carg8 = C.TRUE
}
cret = C.gst_message_new_step_done(carg1, carg2, carg3, carg4, carg5, carg6, carg7, carg8)
runtime.KeepAlive(src)
runtime.KeepAlive(format)
runtime.KeepAlive(amount)
runtime.KeepAlive(rate)
runtime.KeepAlive(flush)
runtime.KeepAlive(intermediate)
runtime.KeepAlive(duration)
runtime.KeepAlive(eos)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStepStart wraps gst_message_new_step_start
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - active bool: if the step is active or queued
// - format Format: the format of @amount
// - amount uint64: the amount of stepped data
// - rate float64: the rate of the stepped amount
// - flush bool: is this an flushing step
// - intermediate bool: is this an intermediate step
//
// The function returns the following values:
//
// - goret *Message
//
// This message is posted by elements when they accept or activate a new step
// event for @amount in @format.
//
// @active is set to %FALSE when the element accepted the new step event and has
// queued it for execution in the streaming threads.
//
// @active is set to %TRUE when the element has activated the step operation and
// is now ready to start executing the step in the streaming thread. After this
// message is emitted, the application can queue a new step operation in the
// element.
func NewMessageStepStart(src Object, active bool, format Format, amount uint64, rate float64, flush bool, intermediate bool) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.gboolean // in
var carg3 C.GstFormat // in, none, casted
var carg4 C.guint64 // in, none, casted
var carg5 C.gdouble // in, none, casted
var carg6 C.gboolean // in
var carg7 C.gboolean // in
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
if active {
carg2 = C.TRUE
}
carg3 = C.GstFormat(format)
carg4 = C.guint64(amount)
carg5 = C.gdouble(rate)
if flush {
carg6 = C.TRUE
}
if intermediate {
carg7 = C.TRUE
}
cret = C.gst_message_new_step_start(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(src)
runtime.KeepAlive(active)
runtime.KeepAlive(format)
runtime.KeepAlive(amount)
runtime.KeepAlive(rate)
runtime.KeepAlive(flush)
runtime.KeepAlive(intermediate)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStreamCollection wraps gst_message_new_stream_collection
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that created the message
// - collection StreamCollection: The #GstStreamCollection
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new stream-collection message. The message is used to announce new
// #GstStreamCollection
func NewMessageStreamCollection(src Object, collection StreamCollection) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstStreamCollection // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
cret = C.gst_message_new_stream_collection(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(collection)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStreamStart wraps gst_message_new_stream_start
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new stream_start message. This message is generated and posted in
// the sink elements of a GstBin. The bin will only forward the STREAM_START
// message to the application if all sinks have posted an STREAM_START message.
func NewMessageStreamStart(src Object) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
cret = C.gst_message_new_stream_start(carg1)
runtime.KeepAlive(src)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStreamStatus wraps gst_message_new_stream_status
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - typ StreamStatusType: The stream status type.
// - owner Element: the owner element of @src.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new stream status message. This message is posted when a streaming
// thread is created/destroyed or when the state changed.
func NewMessageStreamStatus(src Object, typ StreamStatusType, owner Element) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstStreamStatusType // in, none, casted
var carg3 *C.GstElement // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstStreamStatusType(typ)
carg3 = (*C.GstElement)(UnsafeElementToGlibNone(owner))
cret = C.gst_message_new_stream_status(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(typ)
runtime.KeepAlive(owner)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStreamsSelected wraps gst_message_new_streams_selected
//
// The function takes the following parameters:
//
// - src Object (nullable): The #GstObject that created the message
// - collection StreamCollection: The #GstStreamCollection
//
// The function returns the following values:
//
// - goret *Message
//
// Creates a new steams-selected message. The message is used to announce
// that an array of streams has been selected. This is generally in response
// to a #GST_EVENT_SELECT_STREAMS event, or when an element (such as decodebin3)
// makes an initial selection of streams.
//
// The message also contains the #GstStreamCollection to which the various streams
// belong to.
//
// Users of gst_message_new_streams_selected() can add the selected streams with
// gst_message_streams_selected_add().
func NewMessageStreamsSelected(src Object, collection StreamCollection) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstStreamCollection // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstStreamCollection)(UnsafeStreamCollectionToGlibNone(collection))
cret = C.gst_message_new_streams_selected(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(collection)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageStructureChange wraps gst_message_new_structure_change
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - typ StructureChangeType: The change type.
// - owner Element: The owner element of @src.
// - busy bool: Whether the structure change is busy.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new structure change message. This message is posted when the
// structure of a pipeline is in the process of being changed, for example
// when pads are linked or unlinked.
//
// @src should be the sinkpad that unlinked or linked.
func NewMessageStructureChange(src Object, typ StructureChangeType, owner Element, busy bool) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 C.GstStructureChangeType // in, none, casted
var carg3 *C.GstElement // in, none, converted
var carg4 C.gboolean // in
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = C.GstStructureChangeType(typ)
carg3 = (*C.GstElement)(UnsafeElementToGlibNone(owner))
if busy {
carg4 = C.TRUE
}
cret = C.gst_message_new_structure_change(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(typ)
runtime.KeepAlive(owner)
runtime.KeepAlive(busy)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageTag wraps gst_message_new_tag
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - tagList *TagList: the tag list for the message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new tag message. The message will take ownership of the tag list.
// The message is posted by elements that discovered a new taglist.
func NewMessageTag(src Object, tagList *TagList) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstTagList // in, full, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstTagList)(UnsafeTagListToGlibFull(tagList))
cret = C.gst_message_new_tag(carg1, carg2)
runtime.KeepAlive(src)
runtime.KeepAlive(tagList)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageToc wraps gst_message_new_toc
//
// The function takes the following parameters:
//
// - src Object (nullable): the object originating the message.
// - toc *Toc: #GstToc structure for the message.
// - updated bool: whether TOC was updated or not.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new TOC message. The message is posted by elements
// that discovered or updated a TOC.
func NewMessageToc(src Object, toc *Toc, updated bool) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg2 *C.GstToc // in, none, converted
var carg3 C.gboolean // in
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg2 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
if updated {
carg3 = C.TRUE
}
cret = C.gst_message_new_toc(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(toc)
runtime.KeepAlive(updated)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageWarning wraps gst_message_new_warning
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new warning message. The message will make copies of @error and
// @debug.
func NewMessageWarning(src Object, debug string, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_warning(carg1, carg2, carg3)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewMessageWarningWithDetails wraps gst_message_new_warning_with_details
//
// The function takes the following parameters:
//
// - src Object (nullable): The object originating the message.
// - debug string: A debugging string.
// - details *Structure (nullable): A GstStructure with details
// - err error: The GError for this message.
//
// The function returns the following values:
//
// - goret *Message
//
// Create a new warning message. The message will make copies of @error and
// @debug.
func NewMessageWarningWithDetails(src Object, debug string, details *Structure, err error) *Message {
var carg1 *C.GstObject // in, none, converted, nullable
var carg3 *C.gchar // in, none, string, casted *C.gchar
var carg4 *C.GstStructure // in, full, converted, nullable
var carg2 *C.GError // in, none, converted
var cret *C.GstMessage // return, full, converted
if src != nil {
carg1 = (*C.GstObject)(UnsafeObjectToGlibNone(src))
}
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(debug)))
defer C.free(unsafe.Pointer(carg3))
if details != nil {
carg4 = (*C.GstStructure)(UnsafeStructureToGlibFull(details))
}
carg2 = (*C.GError)(glib.UnsafeErrorToGlibNone(err))
cret = C.gst_message_new_warning_with_details(carg1, carg2, carg3, carg4)
runtime.KeepAlive(src)
runtime.KeepAlive(debug)
runtime.KeepAlive(details)
runtime.KeepAlive(err)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddRedirectEntry wraps gst_message_add_redirect_entry
//
// The function takes the following parameters:
//
// - location string: location string for the new entry
// - tagList *TagList (nullable): tag list for the new entry
// - entryStruct *Structure (nullable): structure for the new entry
//
// Creates and appends a new entry.
//
// The specified location string is copied. However, ownership over the tag
// list and structure are transferred to the message.
func (message *Message) AddRedirectEntry(location string, tagList *TagList, entryStruct *Structure) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstTagList // in, full, converted, nullable
var carg3 *C.GstStructure // in, full, converted, nullable
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(location)))
defer C.free(unsafe.Pointer(carg1))
if tagList != nil {
carg2 = (*C.GstTagList)(UnsafeTagListToGlibFull(tagList))
}
if entryStruct != nil {
carg3 = (*C.GstStructure)(UnsafeStructureToGlibFull(entryStruct))
}
C.gst_message_add_redirect_entry(carg0, carg1, carg2, carg3)
runtime.KeepAlive(message)
runtime.KeepAlive(location)
runtime.KeepAlive(tagList)
runtime.KeepAlive(entryStruct)
}
// Copy wraps gst_message_copy
// The function returns the following values:
//
// - goret *Message
//
// Creates a copy of the message. Returns a copy of the message.
func (msg *Message) Copy() *Message {
var carg0 *C.GstMessage // in, none, converted
var cret *C.GstMessage // return, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(msg))
cret = C.gst_message_copy(carg0)
runtime.KeepAlive(msg)
var goret *Message
goret = UnsafeMessageFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetNumRedirectEntries wraps gst_message_get_num_redirect_entries
// The function returns the following values:
//
// - goret uint
func (message *Message) GetNumRedirectEntries() uint {
var carg0 *C.GstMessage // in, none, converted
var cret C.gsize // return, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_get_num_redirect_entries(carg0)
runtime.KeepAlive(message)
var goret uint
goret = uint(cret)
return goret
}
// GetSeqnum wraps gst_message_get_seqnum
// The function returns the following values:
//
// - goret uint32
//
// Retrieve the sequence number of a message.
//
// Messages have ever-incrementing sequence numbers, which may also be set
// explicitly via gst_message_set_seqnum(). Sequence numbers are typically used
// to indicate that a message corresponds to some other set of messages or
// events, for example a SEGMENT_DONE message corresponding to a SEEK event. It
// is considered good practice to make this correspondence when possible, though
// it is not required.
//
// Note that events and messages share the same sequence number incrementor;
// two events or messages will never have the same sequence number unless
// that correspondence was made explicitly.
func (message *Message) GetSeqnum() uint32 {
var carg0 *C.GstMessage // in, none, converted
var cret C.guint32 // return, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_get_seqnum(carg0)
runtime.KeepAlive(message)
var goret uint32
goret = uint32(cret)
return goret
}
// GetStructure wraps gst_message_get_structure
// The function returns the following values:
//
// - goret *Structure
//
// Access the structure of the message.
func (message *Message) GetStructure() *Structure {
var carg0 *C.GstMessage // in, none, converted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_get_structure(carg0)
runtime.KeepAlive(message)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Message) {}, message)
return goret
}
// HasName wraps gst_message_has_name
//
// The function takes the following parameters:
//
// - name string: name to check
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @message has the given @name. This function is usually used to
// check the name of a custom message.
func (message *Message) HasName(name string) bool {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_message_has_name(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ParseAsyncDone wraps gst_message_parse_async_done
// The function returns the following values:
//
// - runningTime ClockTime: Result location for the running_time or %NULL
//
// Extract the running_time from the async_done message.
//
// MT safe.
func (message *Message) ParseAsyncDone() ClockTime {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_async_done(carg0, &carg1)
runtime.KeepAlive(message)
var runningTime ClockTime
runningTime = ClockTime(carg1)
return runningTime
}
// ParseBuffering wraps gst_message_parse_buffering
// The function returns the following values:
//
// - percent int: Return location for the percent.
//
// Extracts the buffering percent from the GstMessage. see also
// gst_message_new_buffering().
//
// MT safe.
func (message *Message) ParseBuffering() int {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gint // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_buffering(carg0, &carg1)
runtime.KeepAlive(message)
var percent int
percent = int(carg1)
return percent
}
// ParseBufferingStats wraps gst_message_parse_buffering_stats
// The function returns the following values:
//
// - mode BufferingMode: a buffering mode, or %NULL
// - avgIn int: the average input rate, or %NULL
// - avgOut int: the average output rate, or %NULL
// - bufferingLeft int64: amount of buffering time left in
// milliseconds, or %NULL
//
// Extracts the buffering stats values from @message.
func (message *Message) ParseBufferingStats() (BufferingMode, int, int, int64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstBufferingMode // out, full, casted
var carg2 C.gint // out, full, casted
var carg3 C.gint // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_buffering_stats(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(message)
var mode BufferingMode
var avgIn int
var avgOut int
var bufferingLeft int64
mode = BufferingMode(carg1)
avgIn = int(carg2)
avgOut = int(carg3)
bufferingLeft = int64(carg4)
return mode, avgIn, avgOut, bufferingLeft
}
// ParseClockLost wraps gst_message_parse_clock_lost
// The function returns the following values:
//
// - clock Clock: a pointer to hold the lost clock
//
// Extracts the lost clock from the GstMessage.
// The clock object returned remains valid until the message is freed.
//
// MT safe.
func (message *Message) ParseClockLost() Clock {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstClock // out, none, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_clock_lost(carg0, &carg1)
runtime.KeepAlive(message)
var clock Clock
clock = UnsafeClockFromGlibNone(unsafe.Pointer(carg1))
return clock
}
// ParseClockProvide wraps gst_message_parse_clock_provide
// The function returns the following values:
//
// - clock Clock: a pointer to hold a clock
// object, or %NULL
// - ready bool: a pointer to hold the ready flag, or %NULL
//
// Extracts the clock and ready flag from the GstMessage.
// The clock object returned remains valid until the message is freed.
//
// MT safe.
func (message *Message) ParseClockProvide() (Clock, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstClock // out, none, converted
var carg2 C.gboolean // out
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_clock_provide(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var clock Clock
var ready bool
clock = UnsafeClockFromGlibNone(unsafe.Pointer(carg1))
if carg2 != 0 {
ready = true
}
return clock, ready
}
// ParseContextType wraps gst_message_parse_context_type
// The function returns the following values:
//
// - contextType string: the context type, or %NULL
// - goret bool
//
// Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.
func (message *Message) ParseContextType() (string, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.gchar // out, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_parse_context_type(carg0, &carg1)
runtime.KeepAlive(message)
var contextType string
var goret bool
contextType = C.GoString((*C.char)(unsafe.Pointer(carg1)))
if cret != 0 {
goret = true
}
return contextType, goret
}
// ParseDeviceAdded wraps gst_message_parse_device_added
// The function returns the following values:
//
// - device Device: A location where to store a
// pointer to the new #GstDevice, or %NULL
//
// Parses a device-added message. The device-added message is produced by
// #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance
// of monitored devices.
func (message *Message) ParseDeviceAdded() Device {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstDevice // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_device_added(carg0, &carg1)
runtime.KeepAlive(message)
var device Device
device = UnsafeDeviceFromGlibFull(unsafe.Pointer(carg1))
return device
}
// ParseDeviceChanged wraps gst_message_parse_device_changed
// The function returns the following values:
//
// - device Device: A location where to store a
// pointer to the updated version of the #GstDevice, or %NULL
// - changedDevice Device: A location where to store a
// pointer to the old version of the #GstDevice, or %NULL
//
// Parses a device-changed message. The device-changed message is produced by
// #GstDeviceProvider or a #GstDeviceMonitor. It announces the
// disappearance of monitored devices. * It announce that a device properties has
// changed and @device represents the new modified version of @changed_device.
func (message *Message) ParseDeviceChanged() (Device, Device) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstDevice // out, full, converted
var carg2 *C.GstDevice // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_device_changed(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var device Device
var changedDevice Device
device = UnsafeDeviceFromGlibFull(unsafe.Pointer(carg1))
changedDevice = UnsafeDeviceFromGlibFull(unsafe.Pointer(carg2))
return device, changedDevice
}
// ParseDeviceRemoved wraps gst_message_parse_device_removed
// The function returns the following values:
//
// - device Device: A location where to store a
// pointer to the removed #GstDevice, or %NULL
//
// Parses a device-removed message. The device-removed message is produced by
// #GstDeviceProvider or a #GstDeviceMonitor. It announces the
// disappearance of monitored devices.
func (message *Message) ParseDeviceRemoved() Device {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstDevice // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_device_removed(carg0, &carg1)
runtime.KeepAlive(message)
var device Device
device = UnsafeDeviceFromGlibFull(unsafe.Pointer(carg1))
return device
}
// ParseError wraps gst_message_parse_error
// The function returns the following values:
//
// - debug string (nullable): location for the debug message,
// or %NULL
// - gerror error: location for the GError
//
// Extracts the GError and debug string from the GstMessage. The values returned
// in the output arguments are copies; the caller must free them when done.
//
// Typical usage of this function might be:
// |[&lt;!-- language="C" --&gt;
// ...
// switch (GST_MESSAGE_TYPE (msg)) {
// case GST_MESSAGE_ERROR: {
// GError *err = NULL;
// gchar *dbg_info = NULL;
//
// gst_message_parse_error (msg, &amp;err, &amp;dbg_info);
// g_printerr ("ERROR from element %s: %s\n",
// GST_OBJECT_NAME (msg-&gt;src), err-&gt;message);
// g_printerr ("Debugging info: %s\n", (dbg_info) ? dbg_info : "none");
// g_error_free (err);
// g_free (dbg_info);
// break;
// }
// ...
// }
// ...
// ]|
//
// MT safe.
func (message *Message) ParseError() (string, error) {
var carg0 *C.GstMessage // in, none, converted
var carg2 *C.gchar // out, full, string, casted *C.gchar, nullable
var carg1 *C.GError // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_error(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var debug string
var gerror error
if carg2 != nil {
debug = C.GoString((*C.char)(unsafe.Pointer(carg2)))
defer C.free(unsafe.Pointer(carg2))
}
gerror = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(carg1))
return debug, gerror
}
// ParseErrorDetails wraps gst_message_parse_error_details
// The function returns the following values:
//
// - structure *Structure (nullable): A pointer to the returned details
//
// Returns the optional details structure, may be NULL if none.
// The returned structure must not be freed.
func (message *Message) ParseErrorDetails() *Structure {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStructure // out, none, converted, nullable
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_error_details(carg0, &carg1)
runtime.KeepAlive(message)
var structure *Structure
if carg1 != nil {
structure = UnsafeStructureFromGlibNone(unsafe.Pointer(carg1))
}
return structure
}
// ParseGroupID wraps gst_message_parse_group_id
// The function returns the following values:
//
// - groupId uint: Result location for the group id or
// %NULL
// - goret bool
//
// Extract the group from the STREAM_START message.
func (message *Message) ParseGroupID() (uint, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.guint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_parse_group_id(carg0, &carg1)
runtime.KeepAlive(message)
var groupId uint
var goret bool
groupId = uint(carg1)
if cret != 0 {
goret = true
}
return groupId, goret
}
// ParseHaveContext wraps gst_message_parse_have_context
// The function returns the following values:
//
// - _context *Context: Result location for the
// context or %NULL
//
// Extract the context from the HAVE_CONTEXT message.
//
// MT safe.
func (message *Message) ParseHaveContext() *Context {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstContext // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_have_context(carg0, &carg1)
runtime.KeepAlive(message)
var _context *Context
_context = UnsafeContextFromGlibFull(unsafe.Pointer(carg1))
return _context
}
// ParseInfo wraps gst_message_parse_info
// The function returns the following values:
//
// - debug string (nullable): location for the debug message,
// or %NULL
// - gerror error: location for the GError
//
// Extracts the GError and debug string from the GstMessage. The values returned
// in the output arguments are copies; the caller must free them when done.
//
// MT safe.
func (message *Message) ParseInfo() (string, error) {
var carg0 *C.GstMessage // in, none, converted
var carg2 *C.gchar // out, full, string, casted *C.gchar, nullable
var carg1 *C.GError // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_info(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var debug string
var gerror error
if carg2 != nil {
debug = C.GoString((*C.char)(unsafe.Pointer(carg2)))
defer C.free(unsafe.Pointer(carg2))
}
gerror = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(carg1))
return debug, gerror
}
// ParseInfoDetails wraps gst_message_parse_info_details
// The function returns the following values:
//
// - structure *Structure (nullable): A pointer to the returned details
//
// Returns the optional details structure, may be NULL if none
// The returned structure must not be freed.
func (message *Message) ParseInfoDetails() *Structure {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStructure // out, none, converted, nullable
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_info_details(carg0, &carg1)
runtime.KeepAlive(message)
var structure *Structure
if carg1 != nil {
structure = UnsafeStructureFromGlibNone(unsafe.Pointer(carg1))
}
return structure
}
// ParseInstantRateRequest wraps gst_message_parse_instant_rate_request
// The function returns the following values:
//
// - rateMultiplier float64: return location for the rate, or %NULL
//
// Parses the rate_multiplier from the instant-rate-request message.
func (message *Message) ParseInstantRateRequest() float64 {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gdouble // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_instant_rate_request(carg0, &carg1)
runtime.KeepAlive(message)
var rateMultiplier float64
rateMultiplier = float64(carg1)
return rateMultiplier
}
// ParseNewClock wraps gst_message_parse_new_clock
// The function returns the following values:
//
// - clock Clock: a pointer to hold the selected
// new clock
//
// Extracts the new clock from the GstMessage.
// The clock object returned remains valid until the message is freed.
//
// MT safe.
func (message *Message) ParseNewClock() Clock {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstClock // out, none, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_new_clock(carg0, &carg1)
runtime.KeepAlive(message)
var clock Clock
clock = UnsafeClockFromGlibNone(unsafe.Pointer(carg1))
return clock
}
// ParseProgress wraps gst_message_parse_progress
// The function returns the following values:
//
// - typ ProgressType: location for the type
// - code string: location for the code
// - text string: location for the text
//
// Parses the progress @type, @code and @text.
func (message *Message) ParseProgress() (ProgressType, string, string) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstProgressType // out, full, casted
var carg2 *C.gchar // out, full, string, casted *C.gchar
var carg3 *C.gchar // out, full, string, casted *C.gchar
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_progress(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(message)
var typ ProgressType
var code string
var text string
typ = ProgressType(carg1)
code = C.GoString((*C.char)(unsafe.Pointer(carg2)))
defer C.free(unsafe.Pointer(carg2))
text = C.GoString((*C.char)(unsafe.Pointer(carg3)))
defer C.free(unsafe.Pointer(carg3))
return typ, code, text
}
// ParseQos wraps gst_message_parse_qos
// The function returns the following values:
//
// - live bool: if the message was generated by a live element
// - runningTime uint64: the running time of the buffer that
// generated the message
// - streamTime uint64: the stream time of the buffer that
// generated the message
// - timestamp uint64: the timestamps of the buffer that
// generated the message
// - duration uint64: the duration of the buffer that
// generated the message
//
// Extract the timestamps and live status from the QoS message.
//
// The returned values give the running_time, stream_time, timestamp and
// duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown
// values.
//
// MT safe.
func (message *Message) ParseQos() (bool, uint64, uint64, uint64, uint64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gboolean // out
var carg2 C.guint64 // out, full, casted
var carg3 C.guint64 // out, full, casted
var carg4 C.guint64 // out, full, casted
var carg5 C.guint64 // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_qos(carg0, &carg1, &carg2, &carg3, &carg4, &carg5)
runtime.KeepAlive(message)
var live bool
var runningTime uint64
var streamTime uint64
var timestamp uint64
var duration uint64
if carg1 != 0 {
live = true
}
runningTime = uint64(carg2)
streamTime = uint64(carg3)
timestamp = uint64(carg4)
duration = uint64(carg5)
return live, runningTime, streamTime, timestamp, duration
}
// ParseQosStats wraps gst_message_parse_qos_stats
// The function returns the following values:
//
// - format Format: Units of the 'processed' and 'dropped' fields.
// Video sinks and video filters will use GST_FORMAT_BUFFERS (frames).
// Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT
// (samples).
// - processed uint64: Total number of units correctly processed
// since the last state change to READY or a flushing operation.
// - dropped uint64: Total number of units dropped since the last
// state change to READY or a flushing operation.
//
// Extract the QoS stats representing the history of the current continuous
// pipeline playback period.
//
// When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
// invalid. Values of -1 for either @processed or @dropped mean unknown values.
//
// MT safe.
func (message *Message) ParseQosStats() (Format, uint64, uint64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.guint64 // out, full, casted
var carg3 C.guint64 // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_qos_stats(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(message)
var format Format
var processed uint64
var dropped uint64
format = Format(carg1)
processed = uint64(carg2)
dropped = uint64(carg3)
return format, processed, dropped
}
// ParseQosValues wraps gst_message_parse_qos_values
// The function returns the following values:
//
// - jitter int64: The difference of the running-time against
// the deadline.
// - proportion float64: Long term prediction of the ideal rate
// relative to normal rate to get optimal quality.
// - quality int: An element dependent integer value that
// specifies the current quality level of the element. The default
// maximum quality is 1000000.
//
// Extract the QoS values that have been calculated/analysed from the QoS data
//
// MT safe.
func (message *Message) ParseQosValues() (int64, float64, int) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gint64 // out, full, casted
var carg2 C.gdouble // out, full, casted
var carg3 C.gint // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_qos_values(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(message)
var jitter int64
var proportion float64
var quality int
jitter = int64(carg1)
proportion = float64(carg2)
quality = int(carg3)
return jitter, proportion, quality
}
// ParseRedirectEntry wraps gst_message_parse_redirect_entry
//
// The function takes the following parameters:
//
// - entryIndex uint: index of the entry to parse
//
// The function returns the following values:
//
// - location string: return location for
// the pointer to the entry's location string, or %NULL
// - tagList *TagList (nullable): return location for
// the pointer to the entry's tag list, or %NULL
// - entryStruct *Structure (nullable): return location
// for the pointer to the entry's structure, or %NULL
//
// Parses the location and/or structure from the entry with the given index.
// The index must be between 0 and gst_message_get_num_redirect_entries() - 1.
// Returned pointers are valid for as long as this message exists.
func (message *Message) ParseRedirectEntry(entryIndex uint) (string, *TagList, *Structure) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gsize // in, none, casted
var carg2 *C.gchar // out, none, string, casted *C.gchar
var carg3 *C.GstTagList // out, none, converted, nullable
var carg4 *C.GstStructure // out, none, converted, nullable
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.gsize(entryIndex)
C.gst_message_parse_redirect_entry(carg0, carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(message)
runtime.KeepAlive(entryIndex)
var location string
var tagList *TagList
var entryStruct *Structure
location = C.GoString((*C.char)(unsafe.Pointer(carg2)))
if carg3 != nil {
tagList = UnsafeTagListFromGlibNone(unsafe.Pointer(carg3))
}
if carg4 != nil {
entryStruct = UnsafeStructureFromGlibNone(unsafe.Pointer(carg4))
}
return location, tagList, entryStruct
}
// ParseRequestState wraps gst_message_parse_request_state
// The function returns the following values:
//
// - state State: Result location for the requested state or %NULL
//
// Extract the requested state from the request_state message.
//
// MT safe.
func (message *Message) ParseRequestState() State {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstState // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_request_state(carg0, &carg1)
runtime.KeepAlive(message)
var state State
state = State(carg1)
return state
}
// ParseResetTime wraps gst_message_parse_reset_time
// The function returns the following values:
//
// - runningTime ClockTime: Result location for the running_time or
// %NULL
//
// Extract the running-time from the RESET_TIME message.
//
// MT safe.
func (message *Message) ParseResetTime() ClockTime {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_reset_time(carg0, &carg1)
runtime.KeepAlive(message)
var runningTime ClockTime
runningTime = ClockTime(carg1)
return runningTime
}
// ParseSegmentDone wraps gst_message_parse_segment_done
// The function returns the following values:
//
// - format Format: Result location for the format, or %NULL
// - position int64: Result location for the position, or %NULL
//
// Extracts the position and format from the segment done message.
//
// MT safe.
func (message *Message) ParseSegmentDone() (Format, int64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_segment_done(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var format Format
var position int64
format = Format(carg1)
position = int64(carg2)
return format, position
}
// ParseSegmentStart wraps gst_message_parse_segment_start
// The function returns the following values:
//
// - format Format: Result location for the format, or %NULL
// - position int64: Result location for the position, or %NULL
//
// Extracts the position and format from the segment start message.
//
// MT safe.
func (message *Message) ParseSegmentStart() (Format, int64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_segment_start(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var format Format
var position int64
format = Format(carg1)
position = int64(carg2)
return format, position
}
// ParseStateChanged wraps gst_message_parse_state_changed
// The function returns the following values:
//
// - oldstate State: the previous state, or %NULL
// - newstate State: the new (current) state, or %NULL
// - pending State: the pending (target) state, or %NULL
//
// Extracts the old and new states from the GstMessage.
//
// Typical usage of this function might be:
// |[&lt;!-- language="C" --&gt;
// ...
// switch (GST_MESSAGE_TYPE (msg)) {
// case GST_MESSAGE_STATE_CHANGED: {
// GstState old_state, new_state;
//
// gst_message_parse_state_changed (msg, &amp;old_state, &amp;new_state, NULL);
// g_print ("Element %s changed state from %s to %s.\n",
// GST_OBJECT_NAME (msg-&gt;src),
// gst_element_state_get_name (old_state),
// gst_element_state_get_name (new_state));
// break;
// }
// ...
// }
// ...
// ]|
//
// MT safe.
func (message *Message) ParseStateChanged() (State, State, State) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstState // out, full, casted
var carg2 C.GstState // out, full, casted
var carg3 C.GstState // out, full, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_state_changed(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(message)
var oldstate State
var newstate State
var pending State
oldstate = State(carg1)
newstate = State(carg2)
pending = State(carg3)
return oldstate, newstate, pending
}
// ParseStepDone wraps gst_message_parse_step_done
// The function returns the following values:
//
// - format Format: result location for the format
// - amount uint64: result location for the amount
// - rate float64: result location for the rate
// - flush bool: result location for the flush flag
// - intermediate bool: result location for the intermediate flag
// - duration uint64: result location for the duration
// - eos bool: result location for the EOS flag
//
// Extract the values the step_done message.
//
// MT safe.
func (message *Message) ParseStepDone() (Format, uint64, float64, bool, bool, uint64, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.guint64 // out, full, casted
var carg3 C.gdouble // out, full, casted
var carg4 C.gboolean // out
var carg5 C.gboolean // out
var carg6 C.guint64 // out, full, casted
var carg7 C.gboolean // out
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_step_done(carg0, &carg1, &carg2, &carg3, &carg4, &carg5, &carg6, &carg7)
runtime.KeepAlive(message)
var format Format
var amount uint64
var rate float64
var flush bool
var intermediate bool
var duration uint64
var eos bool
format = Format(carg1)
amount = uint64(carg2)
rate = float64(carg3)
if carg4 != 0 {
flush = true
}
if carg5 != 0 {
intermediate = true
}
duration = uint64(carg6)
if carg7 != 0 {
eos = true
}
return format, amount, rate, flush, intermediate, duration, eos
}
// ParseStepStart wraps gst_message_parse_step_start
// The function returns the following values:
//
// - active bool: result location for the active flag
// - format Format: result location for the format
// - amount uint64: result location for the amount
// - rate float64: result location for the rate
// - flush bool: result location for the flush flag
// - intermediate bool: result location for the intermediate flag
//
// Extract the values from step_start message.
//
// MT safe.
func (message *Message) ParseStepStart() (bool, Format, uint64, float64, bool, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gboolean // out
var carg2 C.GstFormat // out, full, casted
var carg3 C.guint64 // out, full, casted
var carg4 C.gdouble // out, full, casted
var carg5 C.gboolean // out
var carg6 C.gboolean // out
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_step_start(carg0, &carg1, &carg2, &carg3, &carg4, &carg5, &carg6)
runtime.KeepAlive(message)
var active bool
var format Format
var amount uint64
var rate float64
var flush bool
var intermediate bool
if carg1 != 0 {
active = true
}
format = Format(carg2)
amount = uint64(carg3)
rate = float64(carg4)
if carg5 != 0 {
flush = true
}
if carg6 != 0 {
intermediate = true
}
return active, format, amount, rate, flush, intermediate
}
// ParseStreamCollection wraps gst_message_parse_stream_collection
// The function returns the following values:
//
// - collection StreamCollection: A location where to store a
// pointer to the #GstStreamCollection, or %NULL
//
// Parses a stream-collection message.
func (message *Message) ParseStreamCollection() StreamCollection {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStreamCollection // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_stream_collection(carg0, &carg1)
runtime.KeepAlive(message)
var collection StreamCollection
collection = UnsafeStreamCollectionFromGlibFull(unsafe.Pointer(carg1))
return collection
}
// ParseStreamStatus wraps gst_message_parse_stream_status
// The function returns the following values:
//
// - typ StreamStatusType: A pointer to hold the status type
// - owner Element: The owner element of the message source
//
// Extracts the stream status type and owner the GstMessage. The returned
// owner remains valid for as long as the reference to @message is valid and
// should thus not be unreffed.
//
// MT safe.
func (message *Message) ParseStreamStatus() (StreamStatusType, Element) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstStreamStatusType // out, full, casted
var carg2 *C.GstElement // out, none, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_stream_status(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var typ StreamStatusType
var owner Element
typ = StreamStatusType(carg1)
owner = UnsafeElementFromGlibNone(unsafe.Pointer(carg2))
return typ, owner
}
// ParseStreamsSelected wraps gst_message_parse_streams_selected
// The function returns the following values:
//
// - collection StreamCollection: A location where to store a
// pointer to the #GstStreamCollection, or %NULL
//
// Parses a streams-selected message.
func (message *Message) ParseStreamsSelected() StreamCollection {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStreamCollection // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_streams_selected(carg0, &carg1)
runtime.KeepAlive(message)
var collection StreamCollection
collection = UnsafeStreamCollectionFromGlibFull(unsafe.Pointer(carg1))
return collection
}
// ParseStructureChange wraps gst_message_parse_structure_change
// The function returns the following values:
//
// - typ StructureChangeType: A pointer to hold the change type
// - owner Element: The owner element of the
// message source
// - busy bool: a pointer to hold whether the change is in
// progress or has been completed
//
// Extracts the change type and completion status from the GstMessage.
//
// MT safe.
func (message *Message) ParseStructureChange() (StructureChangeType, Element, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstStructureChangeType // out, full, casted
var carg2 *C.GstElement // out, none, converted
var carg3 C.gboolean // out
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_structure_change(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(message)
var typ StructureChangeType
var owner Element
var busy bool
typ = StructureChangeType(carg1)
owner = UnsafeElementFromGlibNone(unsafe.Pointer(carg2))
if carg3 != 0 {
busy = true
}
return typ, owner, busy
}
// ParseTag wraps gst_message_parse_tag
// The function returns the following values:
//
// - tagList *TagList: return location for the tag-list.
//
// Extracts the tag list from the GstMessage. The tag list returned in the
// output argument is a copy; the caller must free it when done.
//
// Typical usage of this function might be:
// |[&lt;!-- language="C" --&gt;
// ...
// switch (GST_MESSAGE_TYPE (msg)) {
// case GST_MESSAGE_TAG: {
// GstTagList *tags = NULL;
//
// gst_message_parse_tag (msg, &amp;tags);
// g_print ("Got tags from element %s\n", GST_OBJECT_NAME (msg-&gt;src));
// handle_tags (tags);
// gst_tag_list_unref (tags);
// break;
// }
// ...
// }
// ...
// ]|
//
// MT safe.
func (message *Message) ParseTag() *TagList {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstTagList // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_tag(carg0, &carg1)
runtime.KeepAlive(message)
var tagList *TagList
tagList = UnsafeTagListFromGlibFull(unsafe.Pointer(carg1))
return tagList
}
// ParseToc wraps gst_message_parse_toc
// The function returns the following values:
//
// - toc *Toc: return location for the TOC.
// - updated bool: return location for the updated flag.
//
// Extract the TOC from the #GstMessage. The TOC returned in the
// output argument is a copy; the caller must free it with
// gst_toc_unref() when done.
//
// MT safe.
func (message *Message) ParseToc() (*Toc, bool) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstToc // out, full, converted
var carg2 C.gboolean // out
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_toc(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var toc *Toc
var updated bool
toc = UnsafeTocFromGlibFull(unsafe.Pointer(carg1))
if carg2 != 0 {
updated = true
}
return toc, updated
}
// ParseWarning wraps gst_message_parse_warning
// The function returns the following values:
//
// - debug string (nullable): location for the debug message,
// or %NULL
// - gerror error: location for the GError
//
// Extracts the GError and debug string from the GstMessage. The values returned
// in the output arguments are copies; the caller must free them when done.
//
// MT safe.
func (message *Message) ParseWarning() (string, error) {
var carg0 *C.GstMessage // in, none, converted
var carg2 *C.gchar // out, full, string, casted *C.gchar, nullable
var carg1 *C.GError // out, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_warning(carg0, &carg1, &carg2)
runtime.KeepAlive(message)
var debug string
var gerror error
if carg2 != nil {
debug = C.GoString((*C.char)(unsafe.Pointer(carg2)))
defer C.free(unsafe.Pointer(carg2))
}
gerror = glib.UnsafeErrorFromGlibFull(unsafe.Pointer(carg1))
return debug, gerror
}
// ParseWarningDetails wraps gst_message_parse_warning_details
// The function returns the following values:
//
// - structure *Structure (nullable): A pointer to the returned details
//
// Returns the optional details structure, may be NULL if none
// The returned structure must not be freed.
func (message *Message) ParseWarningDetails() *Structure {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStructure // out, none, converted, nullable
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
C.gst_message_parse_warning_details(carg0, &carg1)
runtime.KeepAlive(message)
var structure *Structure
if carg1 != nil {
structure = UnsafeStructureFromGlibNone(unsafe.Pointer(carg1))
}
return structure
}
// SetBufferingStats wraps gst_message_set_buffering_stats
//
// The function takes the following parameters:
//
// - mode BufferingMode: a buffering mode
// - avgIn int: the average input rate
// - avgOut int: the average output rate
// - bufferingLeft int64: amount of buffering time left in milliseconds
//
// Configures the buffering stats values in @message.
func (message *Message) SetBufferingStats(mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstBufferingMode // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.GstBufferingMode(mode)
carg2 = C.gint(avgIn)
carg3 = C.gint(avgOut)
carg4 = C.gint64(bufferingLeft)
C.gst_message_set_buffering_stats(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(message)
runtime.KeepAlive(mode)
runtime.KeepAlive(avgIn)
runtime.KeepAlive(avgOut)
runtime.KeepAlive(bufferingLeft)
}
// SetGroupID wraps gst_message_set_group_id
//
// The function takes the following parameters:
//
// - groupId uint: the group id
//
// Sets the group id on the stream-start message.
//
// All streams that have the same group id are supposed to be played
// together, i.e. all streams inside a container file should have the
// same group id but different stream ids. The group id should change
// each time the stream is started, resulting in different group ids
// each time a file is played for example.
//
// MT safe.
func (message *Message) SetGroupID(groupId uint) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.guint(groupId)
C.gst_message_set_group_id(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(groupId)
}
// SetQosStats wraps gst_message_set_qos_stats
//
// The function takes the following parameters:
//
// - format Format: Units of the 'processed' and 'dropped' fields. Video sinks and video
// filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters
// will likely use GST_FORMAT_DEFAULT (samples).
// - processed uint64: Total number of units correctly processed since the last state
// change to READY or a flushing operation.
// - dropped uint64: Total number of units dropped since the last state change to READY
// or a flushing operation.
//
// Set the QoS stats representing the history of the current continuous pipeline
// playback period.
//
// When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
// invalid. Values of -1 for either @processed or @dropped mean unknown values.
//
// MT safe.
func (message *Message) SetQosStats(format Format, processed uint64, dropped uint64) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // in, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.GstFormat(format)
carg2 = C.guint64(processed)
carg3 = C.guint64(dropped)
C.gst_message_set_qos_stats(carg0, carg1, carg2, carg3)
runtime.KeepAlive(message)
runtime.KeepAlive(format)
runtime.KeepAlive(processed)
runtime.KeepAlive(dropped)
}
// SetQosValues wraps gst_message_set_qos_values
//
// The function takes the following parameters:
//
// - jitter int64: The difference of the running-time against the deadline.
// - proportion float64: Long term prediction of the ideal rate relative to normal rate
// to get optimal quality.
// - quality int: An element dependent integer value that specifies the current
// quality level of the element. The default maximum quality is 1000000.
//
// Set the QoS values that have been calculated/analysed from the QoS data
//
// MT safe.
func (message *Message) SetQosValues(jitter int64, proportion float64, quality int) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.gint64 // in, none, casted
var carg2 C.gdouble // in, none, casted
var carg3 C.gint // in, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.gint64(jitter)
carg2 = C.gdouble(proportion)
carg3 = C.gint(quality)
C.gst_message_set_qos_values(carg0, carg1, carg2, carg3)
runtime.KeepAlive(message)
runtime.KeepAlive(jitter)
runtime.KeepAlive(proportion)
runtime.KeepAlive(quality)
}
// SetSeqnum wraps gst_message_set_seqnum
//
// The function takes the following parameters:
//
// - seqnum uint32: A sequence number.
//
// Set the sequence number of a message.
//
// This function might be called by the creator of a message to indicate that
// the message relates to other messages or events. See gst_message_get_seqnum()
// for more information.
//
// MT safe.
func (message *Message) SetSeqnum(seqnum uint32) {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.guint32 // in, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.guint32(seqnum)
C.gst_message_set_seqnum(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(seqnum)
}
// SetStreamStatusObject wraps gst_message_set_stream_status_object
//
// The function takes the following parameters:
//
// - object *gobject.Value: the object controlling the streaming
//
// Configures the object handling the streaming thread. This is usually a
// GstTask object but other objects might be added in the future.
func (message *Message) SetStreamStatusObject(object *gobject.Value) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GValue // in, none, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(object))
C.gst_message_set_stream_status_object(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(object)
}
// StreamsSelectedAdd wraps gst_message_streams_selected_add
//
// The function takes the following parameters:
//
// - stream Stream: a #GstStream to add to @message
//
// Adds the @stream to the @message.
func (message *Message) StreamsSelectedAdd(stream Stream) {
var carg0 *C.GstMessage // in, none, converted
var carg1 *C.GstStream // in, none, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = (*C.GstStream)(UnsafeStreamToGlibNone(stream))
C.gst_message_streams_selected_add(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(stream)
}
// StreamsSelectedGetSize wraps gst_message_streams_selected_get_size
// The function returns the following values:
//
// - goret uint
//
// Returns the number of streams contained in the @message.
func (message *Message) StreamsSelectedGetSize() uint {
var carg0 *C.GstMessage // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_streams_selected_get_size(carg0)
runtime.KeepAlive(message)
var goret uint
goret = uint(cret)
return goret
}
// StreamsSelectedGetStream wraps gst_message_streams_selected_get_stream
//
// The function takes the following parameters:
//
// - idx uint: Index of the stream to retrieve
//
// The function returns the following values:
//
// - goret Stream
//
// Retrieves the #GstStream with index @index from the @message.
func (message *Message) StreamsSelectedGetStream(idx uint) Stream {
var carg0 *C.GstMessage // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.GstStream // return, full, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
carg1 = C.guint(idx)
cret = C.gst_message_streams_selected_get_stream(carg0, carg1)
runtime.KeepAlive(message)
runtime.KeepAlive(idx)
var goret Stream
goret = UnsafeStreamFromGlibFull(unsafe.Pointer(cret))
return goret
}
// WritableStructure wraps gst_message_writable_structure
// The function returns the following values:
//
// - goret *Structure
//
// Get a writable version of the structure.
func (message *Message) WritableStructure() *Structure {
var carg0 *C.GstMessage // in, none, converted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstMessage)(UnsafeMessageToGlibNone(message))
cret = C.gst_message_writable_structure(carg0)
runtime.KeepAlive(message)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Message) {}, message)
return goret
}
// Meta wraps GstMeta
//
// The #GstMeta structure should be included as the first member of a #GstBuffer
// metadata structure. The structure defines the API of the metadata and should
// be accessible to all elements using the metadata.
//
// A metadata API is registered with gst_meta_api_type_register() which takes a
// name for the metadata API and some tags associated with the metadata.
// With gst_meta_api_type_has_tag() one can check if a certain metadata API
// contains a given tag.
//
// Multiple implementations of a metadata API can be registered.
// To implement a metadata API, gst_meta_register() should be used. This
// function takes all parameters needed to create, free and transform metadata
// along with the size of the metadata. The function returns a #GstMetaInfo
// structure that contains the information for the implementation of the API.
//
// A specific implementation can be retrieved by name with gst_meta_get_info().
//
// See #GstBuffer for how the metadata can be added, retrieved and removed from
// buffers.
type Meta struct {
*meta
}
// meta is the struct that's finalized
type meta struct {
native *C.GstMeta
}
// UnsafeMetaFromGlibBorrow is used to convert raw C.GstMeta pointers to go. This is used by the bindings internally.
func UnsafeMetaFromGlibBorrow(p unsafe.Pointer) *Meta {
return &Meta{&meta{(*C.GstMeta)(p)}}
}
// UnsafeMetaFromGlibNone is used to convert raw C.GstMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaFromGlibNone(p unsafe.Pointer) *Meta {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.meta,
func (intern *meta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaFromGlibFull is used to convert raw C.GstMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaFromGlibFull(p unsafe.Pointer) *Meta {
wrapped := UnsafeMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.meta,
func (intern *meta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Meta] is expected to work anymore.
func UnsafeMetaFree(m *Meta) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMetaToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMetaToGlibNone(m *Meta) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMetaToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMetaToGlibFull(m *Meta) unsafe.Pointer {
runtime.SetFinalizer(m.meta, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // Meta is invalid from here on
return _p
}
// CompareSeqnum wraps gst_meta_compare_seqnum
//
// The function takes the following parameters:
//
// - meta2 *Meta: a #GstMeta
//
// The function returns the following values:
//
// - goret int
//
// Meta sequence number compare function. Can be used as #GCompareFunc
// or a #GCompareDataFunc.
func (meta1 *Meta) CompareSeqnum(meta2 *Meta) int {
var carg0 *C.GstMeta // in, none, converted
var carg1 *C.GstMeta // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstMeta)(UnsafeMetaToGlibNone(meta1))
carg1 = (*C.GstMeta)(UnsafeMetaToGlibNone(meta2))
cret = C.gst_meta_compare_seqnum(carg0, carg1)
runtime.KeepAlive(meta1)
runtime.KeepAlive(meta2)
var goret int
goret = int(cret)
return goret
}
// GetSeqnum wraps gst_meta_get_seqnum
// The function returns the following values:
//
// - goret uint64
//
// Gets seqnum for this meta.
func (meta *Meta) GetSeqnum() uint64 {
var carg0 *C.GstMeta // in, none, converted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstMeta)(UnsafeMetaToGlibNone(meta))
cret = C.gst_meta_get_seqnum(carg0)
runtime.KeepAlive(meta)
var goret uint64
goret = uint64(cret)
return goret
}
// Serialize wraps gst_meta_serialize
//
// The function takes the following parameters:
//
// - data *ByteArrayInterface: #GstByteArrayInterface to append serialization data
//
// The function returns the following values:
//
// - goret bool
//
// Serialize @meta into a format that can be stored or transmitted and later
// deserialized by gst_meta_deserialize().
//
// This is only supported for meta that implements #GstMetaInfo.serialize_func,
// %FALSE is returned otherwise.
//
// Upon failure, @data-&gt;data pointer could have been reallocated, but @data-&gt;len
// won't be modified. This is intended to be able to append multiple metas
// into the same #GByteArray.
//
// Since serialization size is often the same for every buffer, caller may want
// to remember the size of previous data to preallocate the next.
func (meta *Meta) Serialize(data *ByteArrayInterface) bool {
var carg0 *C.GstMeta // in, none, converted
var carg1 *C.GstByteArrayInterface // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstMeta)(UnsafeMetaToGlibNone(meta))
carg1 = (*C.GstByteArrayInterface)(UnsafeByteArrayInterfaceToGlibNone(data))
cret = C.gst_meta_serialize(carg0, carg1)
runtime.KeepAlive(meta)
runtime.KeepAlive(data)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MetaInfo wraps GstMetaInfo
//
// The #GstMetaInfo provides information about a specific metadata
// structure.
type MetaInfo struct {
*metaInfo
}
// metaInfo is the struct that's finalized
type metaInfo struct {
native *C.GstMetaInfo
}
// UnsafeMetaInfoFromGlibBorrow is used to convert raw C.GstMetaInfo pointers to go. This is used by the bindings internally.
func UnsafeMetaInfoFromGlibBorrow(p unsafe.Pointer) *MetaInfo {
return &MetaInfo{&metaInfo{(*C.GstMetaInfo)(p)}}
}
// UnsafeMetaInfoFromGlibNone is used to convert raw C.GstMetaInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaInfoFromGlibNone(p unsafe.Pointer) *MetaInfo {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMetaInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.metaInfo,
func (intern *metaInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaInfoFromGlibFull is used to convert raw C.GstMetaInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaInfoFromGlibFull(p unsafe.Pointer) *MetaInfo {
wrapped := UnsafeMetaInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.metaInfo,
func (intern *metaInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaInfoFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [MetaInfo] is expected to work anymore.
func UnsafeMetaInfoFree(m *MetaInfo) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMetaInfoToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMetaInfoToGlibNone(m *MetaInfo) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMetaInfoToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMetaInfoToGlibFull(m *MetaInfo) unsafe.Pointer {
runtime.SetFinalizer(m.metaInfo, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // MetaInfo is invalid from here on
return _p
}
// IsCustom wraps gst_meta_info_is_custom
// The function returns the following values:
//
// - goret bool
func (info *MetaInfo) IsCustom() bool {
var carg0 *C.GstMetaInfo // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstMetaInfo)(UnsafeMetaInfoToGlibNone(info))
cret = C.gst_meta_info_is_custom(carg0)
runtime.KeepAlive(info)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Register wraps gst_meta_info_register
// The function returns the following values:
//
// - goret *MetaInfo
//
// Registers a new meta.
//
// Use the structure returned by gst_meta_info_new(), it consumes it and the
// structure shouldnt be used after. The one returned by the function can be
// kept.
func (info *MetaInfo) Register() *MetaInfo {
var carg0 *C.GstMetaInfo // in, none, converted
var cret *C.GstMetaInfo // return, none, converted
carg0 = (*C.GstMetaInfo)(UnsafeMetaInfoToGlibNone(info))
cret = C.gst_meta_info_register(carg0)
runtime.KeepAlive(info)
var goret *MetaInfo
goret = UnsafeMetaInfoFromGlibNone(unsafe.Pointer(cret))
return goret
}
// MetaTransformCopy wraps GstMetaTransformCopy
//
// Extra data passed to a "gst-copy" transform #GstMetaTransformFunction.
type MetaTransformCopy struct {
*metaTransformCopy
}
// metaTransformCopy is the struct that's finalized
type metaTransformCopy struct {
native *C.GstMetaTransformCopy
}
// UnsafeMetaTransformCopyFromGlibBorrow is used to convert raw C.GstMetaTransformCopy pointers to go. This is used by the bindings internally.
func UnsafeMetaTransformCopyFromGlibBorrow(p unsafe.Pointer) *MetaTransformCopy {
return &MetaTransformCopy{&metaTransformCopy{(*C.GstMetaTransformCopy)(p)}}
}
// UnsafeMetaTransformCopyFromGlibNone is used to convert raw C.GstMetaTransformCopy pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaTransformCopyFromGlibNone(p unsafe.Pointer) *MetaTransformCopy {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeMetaTransformCopyFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.metaTransformCopy,
func (intern *metaTransformCopy) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaTransformCopyFromGlibFull is used to convert raw C.GstMetaTransformCopy pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMetaTransformCopyFromGlibFull(p unsafe.Pointer) *MetaTransformCopy {
wrapped := UnsafeMetaTransformCopyFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.metaTransformCopy,
func (intern *metaTransformCopy) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeMetaTransformCopyFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [MetaTransformCopy] is expected to work anymore.
func UnsafeMetaTransformCopyFree(m *MetaTransformCopy) {
C.free(unsafe.Pointer(m.native))
}
// UnsafeMetaTransformCopyToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMetaTransformCopyToGlibNone(m *MetaTransformCopy) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMetaTransformCopyToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMetaTransformCopyToGlibFull(m *MetaTransformCopy) unsafe.Pointer {
runtime.SetFinalizer(m.metaTransformCopy, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // MetaTransformCopy is invalid from here on
return _p
}
// MiniObject wraps GstMiniObject
//
// #GstMiniObject is a simple structure that can be used to implement refcounted
// types.
//
// Subclasses will include #GstMiniObject as the first member in their structure
// and then call gst_mini_object_init() to initialize the #GstMiniObject fields.
//
// gst_mini_object_ref() and gst_mini_object_unref() increment and decrement the
// refcount respectively. When the refcount of a mini-object reaches 0, the
// dispose function is called first and when this returns %TRUE, the free
// function of the miniobject is called.
//
// A copy can be made with gst_mini_object_copy().
//
// gst_mini_object_is_writable() will return %TRUE when the refcount of the
// object is exactly 1 and there is no parent or a single parent exists and is
// writable itself, meaning the current caller has the only reference to the
// object. gst_mini_object_make_writable() will return a writable version of
// the object, which might be a new copy when the refcount was not 1.
//
// Opaque data can be associated with a #GstMiniObject with
// gst_mini_object_set_qdata() and gst_mini_object_get_qdata(). The data is
// meant to be specific to the particular object and is not automatically copied
// with gst_mini_object_copy() or similar methods.
//
// A weak reference can be added and remove with gst_mini_object_weak_ref()
// and gst_mini_object_weak_unref() respectively.
type MiniObject struct {
*miniObject
}
// miniObject is the struct that's finalized
type miniObject struct {
native *C.GstMiniObject
}
var _ gobject.GoValueInitializer = (*MiniObject)(nil)
func marshalMiniObject(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeMiniObjectFromGlibBorrow(b), nil
}
func (r *MiniObject) InitGoValue(v *gobject.Value) {
v.Init(TypeMiniObject)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeMiniObjectFromGlibBorrow is used to convert raw C.GstMiniObject pointers to go. This is used by the bindings internally.
func UnsafeMiniObjectFromGlibBorrow(p unsafe.Pointer) *MiniObject {
return &MiniObject{&miniObject{(*C.GstMiniObject)(p)}}
}
// UnsafeMiniObjectFromGlibNone is used to convert raw C.GstMiniObject pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMiniObjectFromGlibNone(p unsafe.Pointer) *MiniObject {
C.gst_mini_object_ref((*C.GstMiniObject)(p))
wrapped := UnsafeMiniObjectFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.miniObject,
func (intern *miniObject) {
C.gst_mini_object_unref(intern.native)
},
)
return wrapped
}
// UnsafeMiniObjectFromGlibFull is used to convert raw C.GstMiniObject pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeMiniObjectFromGlibFull(p unsafe.Pointer) *MiniObject {
wrapped := UnsafeMiniObjectFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.miniObject,
func (intern *miniObject) {
C.gst_mini_object_unref(intern.native)
},
)
return wrapped
}
// UnsafeMiniObjectRef increases the refcount on the underlying resource. This is used by the bindings internally.
//
// When this is called without an associated call to [MiniObject.UnsafeMiniObjectUnref], then [MiniObject] will leak memory.
func UnsafeMiniObjectRef(m *MiniObject) {
C.gst_mini_object_ref(m.native)
}
// UnsafeMiniObjectUnref unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [MiniObject] is expected to work anymore.
func UnsafeMiniObjectUnref(m *MiniObject) {
C.gst_mini_object_unref(m.native)
}
// UnsafeMiniObjectToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeMiniObjectToGlibNone(m *MiniObject) unsafe.Pointer {
return unsafe.Pointer(m.native)
}
// UnsafeMiniObjectToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeMiniObjectToGlibFull(m *MiniObject) unsafe.Pointer {
runtime.SetFinalizer(m.miniObject, nil)
_p := unsafe.Pointer(m.native)
m.native = nil // MiniObject is invalid from here on
return _p
}
// AddParent wraps gst_mini_object_add_parent
//
// The function takes the following parameters:
//
// - parent *MiniObject: a parent #GstMiniObject
//
// This adds @parent as a parent for @object. Having one ore more parents affects the
// writability of @object: if a @parent is not writable, @object is also not
// writable, regardless of its refcount. @object is only writable if all
// the parents are writable and its own refcount is exactly 1.
//
// Note: This function does not take ownership of @parent and also does not
// take an additional reference. It is the responsibility of the caller to
// remove the parent again at a later time.
func (object *MiniObject) AddParent(parent *MiniObject) {
var carg0 *C.GstMiniObject // in, none, converted
var carg1 *C.GstMiniObject // in, none, converted
carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object))
carg1 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(parent))
C.gst_mini_object_add_parent(carg0, carg1)
runtime.KeepAlive(object)
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:
//
// - goret bool
//
// If @mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE
// lock on @object is the only one, this means that changes to the object will
// not be visible to any other object.
//
// If the LOCKABLE flag is not set, check if the refcount of @mini_object is
// exactly 1, meaning that no other reference exists to the object and that the
// object is therefore writable.
//
// Modification of a mini-object should only be done after verifying that it
// is writable.
func (miniObject *MiniObject) IsWritable() bool {
var carg0 *C.GstMiniObject // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(miniObject))
cret = C.gst_mini_object_is_writable(carg0)
runtime.KeepAlive(miniObject)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Lock wraps gst_mini_object_lock
//
// The function takes the following parameters:
//
// - flags LockFlags: #GstLockFlags
//
// The function returns the following values:
//
// - goret bool
//
// Lock the mini-object with the specified access mode in @flags.
func (object *MiniObject) Lock(flags LockFlags) bool {
var carg0 *C.GstMiniObject // in, none, converted
var carg1 C.GstLockFlags // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object))
carg1 = C.GstLockFlags(flags)
cret = C.gst_mini_object_lock(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveParent wraps gst_mini_object_remove_parent
//
// The function takes the following parameters:
//
// - parent *MiniObject: a parent #GstMiniObject
//
// This removes @parent as a parent for @object. See
// gst_mini_object_add_parent().
func (object *MiniObject) RemoveParent(parent *MiniObject) {
var carg0 *C.GstMiniObject // in, none, converted
var carg1 *C.GstMiniObject // in, none, converted
carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object))
carg1 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(parent))
C.gst_mini_object_remove_parent(carg0, carg1)
runtime.KeepAlive(object)
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:
//
// - flags LockFlags: #GstLockFlags
//
// Unlock the mini-object with the specified access mode in @flags.
func (object *MiniObject) Unlock(flags LockFlags) {
var carg0 *C.GstMiniObject // in, none, converted
var carg1 C.GstLockFlags // in, none, casted
carg0 = (*C.GstMiniObject)(UnsafeMiniObjectToGlibNone(object))
carg1 = C.GstLockFlags(flags)
C.gst_mini_object_unlock(carg0, carg1)
runtime.KeepAlive(object)
runtime.KeepAlive(flags)
}
// ObjectClass wraps GstObjectClass
//
// GStreamer base object class.
type ObjectClass struct {
*objectClass
}
// objectClass is the struct that's finalized
type objectClass struct {
native *C.GstObjectClass
}
// UnsafeObjectClassFromGlibBorrow is used to convert raw C.GstObjectClass pointers to go. This is used by the bindings internally.
func UnsafeObjectClassFromGlibBorrow(p unsafe.Pointer) *ObjectClass {
return &ObjectClass{&objectClass{(*C.GstObjectClass)(p)}}
}
// UnsafeObjectClassFromGlibNone is used to convert raw C.GstObjectClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeObjectClassFromGlibNone(p unsafe.Pointer) *ObjectClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeObjectClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.objectClass,
func (intern *objectClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeObjectClassFromGlibFull is used to convert raw C.GstObjectClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeObjectClassFromGlibFull(p unsafe.Pointer) *ObjectClass {
wrapped := UnsafeObjectClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.objectClass,
func (intern *objectClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeObjectClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ObjectClass] is expected to work anymore.
func UnsafeObjectClassFree(o *ObjectClass) {
C.free(unsafe.Pointer(o.native))
}
// UnsafeObjectClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeObjectClassToGlibNone(o *ObjectClass) unsafe.Pointer {
return unsafe.Pointer(o.native)
}
// UnsafeObjectClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeObjectClassToGlibFull(o *ObjectClass) unsafe.Pointer {
runtime.SetFinalizer(o.objectClass, nil)
_p := unsafe.Pointer(o.native)
o.native = nil // ObjectClass is invalid from here on
return _p
}
// PadClass wraps GstPadClass
type PadClass struct {
*padClass
}
// padClass is the struct that's finalized
type padClass struct {
native *C.GstPadClass
}
// UnsafePadClassFromGlibBorrow is used to convert raw C.GstPadClass pointers to go. This is used by the bindings internally.
func UnsafePadClassFromGlibBorrow(p unsafe.Pointer) *PadClass {
return &PadClass{&padClass{(*C.GstPadClass)(p)}}
}
// UnsafePadClassFromGlibNone is used to convert raw C.GstPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadClassFromGlibNone(p unsafe.Pointer) *PadClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padClass,
func (intern *padClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadClassFromGlibFull is used to convert raw C.GstPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadClassFromGlibFull(p unsafe.Pointer) *PadClass {
wrapped := UnsafePadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padClass,
func (intern *padClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PadClass] is expected to work anymore.
func UnsafePadClassFree(p *PadClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePadClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePadClassToGlibNone(p *PadClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePadClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePadClassToGlibFull(p *PadClass) unsafe.Pointer {
runtime.SetFinalizer(p.padClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PadClass is invalid from here on
return _p
}
// PadProbeInfo wraps GstPadProbeInfo
//
// Info passed in the #GstPadProbeCallback.
type PadProbeInfo struct {
*padProbeInfo
}
// padProbeInfo is the struct that's finalized
type padProbeInfo struct {
native *C.GstPadProbeInfo
}
// UnsafePadProbeInfoFromGlibBorrow is used to convert raw C.GstPadProbeInfo pointers to go. This is used by the bindings internally.
func UnsafePadProbeInfoFromGlibBorrow(p unsafe.Pointer) *PadProbeInfo {
return &PadProbeInfo{&padProbeInfo{(*C.GstPadProbeInfo)(p)}}
}
// UnsafePadProbeInfoFromGlibNone is used to convert raw C.GstPadProbeInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadProbeInfoFromGlibNone(p unsafe.Pointer) *PadProbeInfo {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePadProbeInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padProbeInfo,
func (intern *padProbeInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadProbeInfoFromGlibFull is used to convert raw C.GstPadProbeInfo pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadProbeInfoFromGlibFull(p unsafe.Pointer) *PadProbeInfo {
wrapped := UnsafePadProbeInfoFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padProbeInfo,
func (intern *padProbeInfo) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadProbeInfoFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PadProbeInfo] is expected to work anymore.
func UnsafePadProbeInfoFree(p *PadProbeInfo) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePadProbeInfoToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePadProbeInfoToGlibNone(p *PadProbeInfo) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePadProbeInfoToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePadProbeInfoToGlibFull(p *PadProbeInfo) unsafe.Pointer {
runtime.SetFinalizer(p.padProbeInfo, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PadProbeInfo is invalid from here on
return _p
}
// GetBuffer wraps gst_pad_probe_info_get_buffer
// The function returns the following values:
//
// - goret *Buffer
func (info *PadProbeInfo) GetBuffer() *Buffer {
var carg0 *C.GstPadProbeInfo // in, none, converted
var cret *C.GstBuffer // return, none, converted
carg0 = (*C.GstPadProbeInfo)(UnsafePadProbeInfoToGlibNone(info))
cret = C.gst_pad_probe_info_get_buffer(carg0)
runtime.KeepAlive(info)
var goret *Buffer
goret = UnsafeBufferFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetBufferList wraps gst_pad_probe_info_get_buffer_list
// The function returns the following values:
//
// - goret *BufferList
func (info *PadProbeInfo) GetBufferList() *BufferList {
var carg0 *C.GstPadProbeInfo // in, none, converted
var cret *C.GstBufferList // return, none, converted
carg0 = (*C.GstPadProbeInfo)(UnsafePadProbeInfoToGlibNone(info))
cret = C.gst_pad_probe_info_get_buffer_list(carg0)
runtime.KeepAlive(info)
var goret *BufferList
goret = UnsafeBufferListFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetEvent wraps gst_pad_probe_info_get_event
// The function returns the following values:
//
// - goret *Event
func (info *PadProbeInfo) GetEvent() *Event {
var carg0 *C.GstPadProbeInfo // in, none, converted
var cret *C.GstEvent // return, none, converted
carg0 = (*C.GstPadProbeInfo)(UnsafePadProbeInfoToGlibNone(info))
cret = C.gst_pad_probe_info_get_event(carg0)
runtime.KeepAlive(info)
var goret *Event
goret = UnsafeEventFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetQuery wraps gst_pad_probe_info_get_query
// The function returns the following values:
//
// - goret *Query
func (info *PadProbeInfo) GetQuery() *Query {
var carg0 *C.GstPadProbeInfo // in, none, converted
var cret *C.GstQuery // return, none, converted
carg0 = (*C.GstPadProbeInfo)(UnsafePadProbeInfoToGlibNone(info))
cret = C.gst_pad_probe_info_get_query(carg0)
runtime.KeepAlive(info)
var goret *Query
goret = UnsafeQueryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// PadTemplateClass wraps GstPadTemplateClass
type PadTemplateClass struct {
*padTemplateClass
}
// padTemplateClass is the struct that's finalized
type padTemplateClass struct {
native *C.GstPadTemplateClass
}
// UnsafePadTemplateClassFromGlibBorrow is used to convert raw C.GstPadTemplateClass pointers to go. This is used by the bindings internally.
func UnsafePadTemplateClassFromGlibBorrow(p unsafe.Pointer) *PadTemplateClass {
return &PadTemplateClass{&padTemplateClass{(*C.GstPadTemplateClass)(p)}}
}
// UnsafePadTemplateClassFromGlibNone is used to convert raw C.GstPadTemplateClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadTemplateClassFromGlibNone(p unsafe.Pointer) *PadTemplateClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePadTemplateClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padTemplateClass,
func (intern *padTemplateClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadTemplateClassFromGlibFull is used to convert raw C.GstPadTemplateClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePadTemplateClassFromGlibFull(p unsafe.Pointer) *PadTemplateClass {
wrapped := UnsafePadTemplateClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.padTemplateClass,
func (intern *padTemplateClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePadTemplateClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PadTemplateClass] is expected to work anymore.
func UnsafePadTemplateClassFree(p *PadTemplateClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePadTemplateClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePadTemplateClassToGlibNone(p *PadTemplateClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePadTemplateClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePadTemplateClassToGlibFull(p *PadTemplateClass) unsafe.Pointer {
runtime.SetFinalizer(p.padTemplateClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PadTemplateClass is invalid from here on
return _p
}
// ParamSpecArray wraps GstParamSpecArray
//
// A GParamSpec derived structure for arrays of values.
type ParamSpecArray struct {
*paramSpecArray
}
// paramSpecArray is the struct that's finalized
type paramSpecArray struct {
native *C.GstParamSpecArray
}
// UnsafeParamSpecArrayFromGlibBorrow is used to convert raw C.GstParamSpecArray pointers to go. This is used by the bindings internally.
func UnsafeParamSpecArrayFromGlibBorrow(p unsafe.Pointer) *ParamSpecArray {
return &ParamSpecArray{&paramSpecArray{(*C.GstParamSpecArray)(p)}}
}
// UnsafeParamSpecArrayFromGlibNone is used to convert raw C.GstParamSpecArray pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParamSpecArrayFromGlibNone(p unsafe.Pointer) *ParamSpecArray {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeParamSpecArrayFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.paramSpecArray,
func (intern *paramSpecArray) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParamSpecArrayFromGlibFull is used to convert raw C.GstParamSpecArray pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParamSpecArrayFromGlibFull(p unsafe.Pointer) *ParamSpecArray {
wrapped := UnsafeParamSpecArrayFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.paramSpecArray,
func (intern *paramSpecArray) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParamSpecArrayFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ParamSpecArray] is expected to work anymore.
func UnsafeParamSpecArrayFree(p *ParamSpecArray) {
C.free(unsafe.Pointer(p.native))
}
// UnsafeParamSpecArrayToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeParamSpecArrayToGlibNone(p *ParamSpecArray) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeParamSpecArrayToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeParamSpecArrayToGlibFull(p *ParamSpecArray) unsafe.Pointer {
runtime.SetFinalizer(p.paramSpecArray, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ParamSpecArray is invalid from here on
return _p
}
// ParamSpecFraction wraps GstParamSpecFraction
//
// A GParamSpec derived structure that contains the meta data for fractional
// properties.
type ParamSpecFraction struct {
*paramSpecFraction
}
// paramSpecFraction is the struct that's finalized
type paramSpecFraction struct {
native *C.GstParamSpecFraction
}
// UnsafeParamSpecFractionFromGlibBorrow is used to convert raw C.GstParamSpecFraction pointers to go. This is used by the bindings internally.
func UnsafeParamSpecFractionFromGlibBorrow(p unsafe.Pointer) *ParamSpecFraction {
return &ParamSpecFraction{&paramSpecFraction{(*C.GstParamSpecFraction)(p)}}
}
// UnsafeParamSpecFractionFromGlibNone is used to convert raw C.GstParamSpecFraction pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParamSpecFractionFromGlibNone(p unsafe.Pointer) *ParamSpecFraction {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeParamSpecFractionFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.paramSpecFraction,
func (intern *paramSpecFraction) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParamSpecFractionFromGlibFull is used to convert raw C.GstParamSpecFraction pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParamSpecFractionFromGlibFull(p unsafe.Pointer) *ParamSpecFraction {
wrapped := UnsafeParamSpecFractionFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.paramSpecFraction,
func (intern *paramSpecFraction) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParamSpecFractionFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ParamSpecFraction] is expected to work anymore.
func UnsafeParamSpecFractionFree(p *ParamSpecFraction) {
C.free(unsafe.Pointer(p.native))
}
// UnsafeParamSpecFractionToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeParamSpecFractionToGlibNone(p *ParamSpecFraction) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeParamSpecFractionToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeParamSpecFractionToGlibFull(p *ParamSpecFraction) unsafe.Pointer {
runtime.SetFinalizer(p.paramSpecFraction, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ParamSpecFraction is invalid from here on
return _p
}
// ParentBufferMeta wraps GstParentBufferMeta
//
// The #GstParentBufferMeta is a #GstMeta which can be attached to a #GstBuffer
// to hold a reference to another buffer that is only released when the child
// #GstBuffer is released.
//
// Typically, #GstParentBufferMeta is used when the child buffer is directly
// using the #GstMemory of the parent buffer, and wants to prevent the parent
// buffer from being returned to a buffer pool until the #GstMemory is available
// for re-use.
type ParentBufferMeta struct {
*parentBufferMeta
}
// parentBufferMeta is the struct that's finalized
type parentBufferMeta struct {
native *C.GstParentBufferMeta
}
// UnsafeParentBufferMetaFromGlibBorrow is used to convert raw C.GstParentBufferMeta pointers to go. This is used by the bindings internally.
func UnsafeParentBufferMetaFromGlibBorrow(p unsafe.Pointer) *ParentBufferMeta {
return &ParentBufferMeta{&parentBufferMeta{(*C.GstParentBufferMeta)(p)}}
}
// UnsafeParentBufferMetaFromGlibNone is used to convert raw C.GstParentBufferMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParentBufferMetaFromGlibNone(p unsafe.Pointer) *ParentBufferMeta {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeParentBufferMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.parentBufferMeta,
func (intern *parentBufferMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParentBufferMetaFromGlibFull is used to convert raw C.GstParentBufferMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParentBufferMetaFromGlibFull(p unsafe.Pointer) *ParentBufferMeta {
wrapped := UnsafeParentBufferMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.parentBufferMeta,
func (intern *parentBufferMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeParentBufferMetaFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ParentBufferMeta] is expected to work anymore.
func UnsafeParentBufferMetaFree(p *ParentBufferMeta) {
C.free(unsafe.Pointer(p.native))
}
// UnsafeParentBufferMetaToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeParentBufferMetaToGlibNone(p *ParentBufferMeta) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeParentBufferMetaToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeParentBufferMetaToGlibFull(p *ParentBufferMeta) unsafe.Pointer {
runtime.SetFinalizer(p.parentBufferMeta, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ParentBufferMeta is invalid from here on
return _p
}
// ParseContext wraps GstParseContext
//
// Opaque structure.
type ParseContext struct {
*parseContext
}
// parseContext is the struct that's finalized
type parseContext struct {
native *C.GstParseContext
}
var _ gobject.GoValueInitializer = (*ParseContext)(nil)
func marshalParseContext(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeParseContextFromGlibBorrow(b), nil
}
func (r *ParseContext) InitGoValue(v *gobject.Value) {
v.Init(TypeParseContext)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeParseContextFromGlibBorrow is used to convert raw C.GstParseContext pointers to go. This is used by the bindings internally.
func UnsafeParseContextFromGlibBorrow(p unsafe.Pointer) *ParseContext {
return &ParseContext{&parseContext{(*C.GstParseContext)(p)}}
}
// UnsafeParseContextFromGlibNone is used to convert raw C.GstParseContext pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParseContextFromGlibNone(p unsafe.Pointer) *ParseContext {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeParseContextFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.parseContext,
func (intern *parseContext) {
C.gst_parse_context_free(intern.native)
},
)
return wrapped
}
// UnsafeParseContextFromGlibFull is used to convert raw C.GstParseContext pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeParseContextFromGlibFull(p unsafe.Pointer) *ParseContext {
wrapped := UnsafeParseContextFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.parseContext,
func (intern *parseContext) {
C.gst_parse_context_free(intern.native)
},
)
return wrapped
}
// UnsafeParseContextFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ParseContext] is expected to work anymore.
func UnsafeParseContextFree(p *ParseContext) {
C.gst_parse_context_free(p.native)
}
// UnsafeParseContextToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeParseContextToGlibNone(p *ParseContext) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeParseContextToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeParseContextToGlibFull(p *ParseContext) unsafe.Pointer {
runtime.SetFinalizer(p.parseContext, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ParseContext is invalid from here on
return _p
}
// NewParseContext wraps gst_parse_context_new
// The function returns the following values:
//
// - goret *ParseContext
//
// Allocates a parse context for use with gst_parse_launch_full() or
// gst_parse_launchv_full().
//
// Free-function: gst_parse_context_free
func NewParseContext() *ParseContext {
var cret *C.GstParseContext // return, full, converted
cret = C.gst_parse_context_new()
var goret *ParseContext
goret = UnsafeParseContextFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Copy wraps gst_parse_context_copy
// The function returns the following values:
//
// - goret *ParseContext
//
// Copies the @context.
func (_context *ParseContext) Copy() *ParseContext {
var carg0 *C.GstParseContext // in, none, converted
var cret *C.GstParseContext // return, full, converted
carg0 = (*C.GstParseContext)(UnsafeParseContextToGlibNone(_context))
cret = C.gst_parse_context_copy(carg0)
runtime.KeepAlive(_context)
var goret *ParseContext
goret = UnsafeParseContextFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetMissingElements wraps gst_parse_context_get_missing_elements
// The function returns the following values:
//
// - goret []string
//
// Retrieve missing elements from a previous run of gst_parse_launch_full()
// or gst_parse_launchv_full(). Will only return results if an error code
// of %GST_PARSE_ERROR_NO_SUCH_ELEMENT was returned.
func (_context *ParseContext) GetMissingElements() []string {
var carg0 *C.GstParseContext // in, none, converted
var cret **C.gchar // return, transfer: full, C Pointers: 2, Name: array[utf8], scope: , array (inner: *typesystem.StringPrimitive, zero-terminated)
carg0 = (*C.GstParseContext)(UnsafeParseContextToGlibNone(_context))
cret = C.gst_parse_context_get_missing_elements(carg0)
runtime.KeepAlive(_context)
var goret []string
_ = goret
_ = cret
panic("unimplemented conversion of []string (gchar**)")
return goret
}
// PipelineClass wraps GstPipelineClass
type PipelineClass struct {
*pipelineClass
}
// pipelineClass is the struct that's finalized
type pipelineClass struct {
native *C.GstPipelineClass
}
// UnsafePipelineClassFromGlibBorrow is used to convert raw C.GstPipelineClass pointers to go. This is used by the bindings internally.
func UnsafePipelineClassFromGlibBorrow(p unsafe.Pointer) *PipelineClass {
return &PipelineClass{&pipelineClass{(*C.GstPipelineClass)(p)}}
}
// UnsafePipelineClassFromGlibNone is used to convert raw C.GstPipelineClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePipelineClassFromGlibNone(p unsafe.Pointer) *PipelineClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePipelineClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pipelineClass,
func (intern *pipelineClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePipelineClassFromGlibFull is used to convert raw C.GstPipelineClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePipelineClassFromGlibFull(p unsafe.Pointer) *PipelineClass {
wrapped := UnsafePipelineClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pipelineClass,
func (intern *pipelineClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePipelineClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PipelineClass] is expected to work anymore.
func UnsafePipelineClassFree(p *PipelineClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePipelineClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePipelineClassToGlibNone(p *PipelineClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePipelineClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePipelineClassToGlibFull(p *PipelineClass) unsafe.Pointer {
runtime.SetFinalizer(p.pipelineClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PipelineClass is invalid from here on
return _p
}
// PluginClass wraps GstPluginClass
type PluginClass struct {
*pluginClass
}
// pluginClass is the struct that's finalized
type pluginClass struct {
native *C.GstPluginClass
}
// UnsafePluginClassFromGlibBorrow is used to convert raw C.GstPluginClass pointers to go. This is used by the bindings internally.
func UnsafePluginClassFromGlibBorrow(p unsafe.Pointer) *PluginClass {
return &PluginClass{&pluginClass{(*C.GstPluginClass)(p)}}
}
// UnsafePluginClassFromGlibNone is used to convert raw C.GstPluginClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginClassFromGlibNone(p unsafe.Pointer) *PluginClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePluginClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginClass,
func (intern *pluginClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginClassFromGlibFull is used to convert raw C.GstPluginClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginClassFromGlibFull(p unsafe.Pointer) *PluginClass {
wrapped := UnsafePluginClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginClass,
func (intern *pluginClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PluginClass] is expected to work anymore.
func UnsafePluginClassFree(p *PluginClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePluginClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePluginClassToGlibNone(p *PluginClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePluginClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePluginClassToGlibFull(p *PluginClass) unsafe.Pointer {
runtime.SetFinalizer(p.pluginClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PluginClass is invalid from here on
return _p
}
// PluginDesc wraps GstPluginDesc
//
// A plugin should export a variable of this type called plugin_desc. The plugin
// loader will use the data provided there to initialize the plugin.
//
// The @licence parameter must be one of: LGPL, GPL, QPL, GPL/QPL, MPL,
// BSD, MIT/X11, Proprietary, unknown.
type PluginDesc struct {
*pluginDesc
}
// pluginDesc is the struct that's finalized
type pluginDesc struct {
native *C.GstPluginDesc
}
// UnsafePluginDescFromGlibBorrow is used to convert raw C.GstPluginDesc pointers to go. This is used by the bindings internally.
func UnsafePluginDescFromGlibBorrow(p unsafe.Pointer) *PluginDesc {
return &PluginDesc{&pluginDesc{(*C.GstPluginDesc)(p)}}
}
// UnsafePluginDescFromGlibNone is used to convert raw C.GstPluginDesc pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginDescFromGlibNone(p unsafe.Pointer) *PluginDesc {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePluginDescFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginDesc,
func (intern *pluginDesc) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginDescFromGlibFull is used to convert raw C.GstPluginDesc pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginDescFromGlibFull(p unsafe.Pointer) *PluginDesc {
wrapped := UnsafePluginDescFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginDesc,
func (intern *pluginDesc) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginDescFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PluginDesc] is expected to work anymore.
func UnsafePluginDescFree(p *PluginDesc) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePluginDescToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePluginDescToGlibNone(p *PluginDesc) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePluginDescToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePluginDescToGlibFull(p *PluginDesc) unsafe.Pointer {
runtime.SetFinalizer(p.pluginDesc, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PluginDesc is invalid from here on
return _p
}
// PluginFeatureClass wraps GstPluginFeatureClass
type PluginFeatureClass struct {
*pluginFeatureClass
}
// pluginFeatureClass is the struct that's finalized
type pluginFeatureClass struct {
native *C.GstPluginFeatureClass
}
// UnsafePluginFeatureClassFromGlibBorrow is used to convert raw C.GstPluginFeatureClass pointers to go. This is used by the bindings internally.
func UnsafePluginFeatureClassFromGlibBorrow(p unsafe.Pointer) *PluginFeatureClass {
return &PluginFeatureClass{&pluginFeatureClass{(*C.GstPluginFeatureClass)(p)}}
}
// UnsafePluginFeatureClassFromGlibNone is used to convert raw C.GstPluginFeatureClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginFeatureClassFromGlibNone(p unsafe.Pointer) *PluginFeatureClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePluginFeatureClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginFeatureClass,
func (intern *pluginFeatureClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginFeatureClassFromGlibFull is used to convert raw C.GstPluginFeatureClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePluginFeatureClassFromGlibFull(p unsafe.Pointer) *PluginFeatureClass {
wrapped := UnsafePluginFeatureClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pluginFeatureClass,
func (intern *pluginFeatureClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePluginFeatureClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PluginFeatureClass] is expected to work anymore.
func UnsafePluginFeatureClassFree(p *PluginFeatureClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePluginFeatureClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePluginFeatureClassToGlibNone(p *PluginFeatureClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePluginFeatureClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePluginFeatureClassToGlibFull(p *PluginFeatureClass) unsafe.Pointer {
runtime.SetFinalizer(p.pluginFeatureClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PluginFeatureClass is invalid from here on
return _p
}
// Poll wraps GstPoll
//
// A #GstPoll keeps track of file descriptors much like fd_set (used with
// select ()) or a struct pollfd array (used with poll ()). Once created with
// gst_poll_new(), the set can be used to wait for file descriptors to be
// readable and/or writable. It is possible to make this wait be controlled
// by specifying %TRUE for the @controllable flag when creating the set (or
// later calling gst_poll_set_controllable()).
//
// New file descriptors are added to the set using gst_poll_add_fd(), and
// removed using gst_poll_remove_fd(). Controlling which file descriptors
// should be waited for to become readable and/or writable are done using
// gst_poll_fd_ctl_read(), gst_poll_fd_ctl_write() and gst_poll_fd_ctl_pri().
//
// Use gst_poll_wait() to wait for the file descriptors to actually become
// readable and/or writable, or to timeout if no file descriptor is available
// in time. The wait can be controlled by calling gst_poll_restart() and
// gst_poll_set_flushing().
//
// Once the file descriptor set has been waited for, one can use
// gst_poll_fd_has_closed() to see if the file descriptor has been closed,
// gst_poll_fd_has_error() to see if it has generated an error,
// gst_poll_fd_can_read() to see if it is possible to read from the file
// descriptor, and gst_poll_fd_can_write() to see if it is possible to
// write to it.
type Poll struct {
*poll
}
// poll is the struct that's finalized
type poll struct {
native *C.GstPoll
}
// UnsafePollFromGlibBorrow is used to convert raw C.GstPoll pointers to go. This is used by the bindings internally.
func UnsafePollFromGlibBorrow(p unsafe.Pointer) *Poll {
return &Poll{&poll{(*C.GstPoll)(p)}}
}
// UnsafePollFromGlibNone is used to convert raw C.GstPoll pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePollFromGlibNone(p unsafe.Pointer) *Poll {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePollFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.poll,
func (intern *poll) {
C.gst_poll_free(intern.native)
},
)
return wrapped
}
// UnsafePollFromGlibFull is used to convert raw C.GstPoll pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePollFromGlibFull(p unsafe.Pointer) *Poll {
wrapped := UnsafePollFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.poll,
func (intern *poll) {
C.gst_poll_free(intern.native)
},
)
return wrapped
}
// UnsafePollFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Poll] is expected to work anymore.
func UnsafePollFree(p *Poll) {
C.gst_poll_free(p.native)
}
// UnsafePollToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePollToGlibNone(p *Poll) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePollToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePollToGlibFull(p *Poll) unsafe.Pointer {
runtime.SetFinalizer(p.poll, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // Poll is invalid from here on
return _p
}
// AddFd wraps gst_poll_add_fd
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Add a file descriptor to the file descriptor set.
func (set *Poll) AddFd(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_add_fd(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdCanRead wraps gst_poll_fd_can_read
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Check if @fd in @set has data to be read.
func (set *Poll) FdCanRead(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_fd_can_read(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdCanWrite wraps gst_poll_fd_can_write
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Check if @fd in @set can be used for writing.
func (set *Poll) FdCanWrite(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_fd_can_write(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdCtlPri wraps gst_poll_fd_ctl_pri
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
// - active bool: a new status.
//
// The function returns the following values:
//
// - goret bool
//
// Control whether the descriptor @fd in @set will be monitored for
// exceptional conditions (POLLPRI).
//
// Not implemented on Windows (will just return %FALSE there).
func (set *Poll) FdCtlPri(fd *PollFD, active bool) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var carg2 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
if active {
carg2 = C.TRUE
}
cret = C.gst_poll_fd_ctl_pri(carg0, carg1, carg2)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdCtlRead wraps gst_poll_fd_ctl_read
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
// - active bool: a new status.
//
// The function returns the following values:
//
// - goret bool
//
// Control whether the descriptor @fd in @set will be monitored for
// readability.
func (set *Poll) FdCtlRead(fd *PollFD, active bool) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var carg2 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
if active {
carg2 = C.TRUE
}
cret = C.gst_poll_fd_ctl_read(carg0, carg1, carg2)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdCtlWrite wraps gst_poll_fd_ctl_write
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
// - active bool: a new status.
//
// The function returns the following values:
//
// - goret bool
//
// Control whether the descriptor @fd in @set will be monitored for
// writability.
func (set *Poll) FdCtlWrite(fd *PollFD, active bool) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var carg2 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
if active {
carg2 = C.TRUE
}
cret = C.gst_poll_fd_ctl_write(carg0, carg1, carg2)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
runtime.KeepAlive(active)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdHasClosed wraps gst_poll_fd_has_closed
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Check if @fd in @set has closed the connection.
func (set *Poll) FdHasClosed(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_fd_has_closed(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdHasError wraps gst_poll_fd_has_error
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Check if @fd in @set has an error.
func (set *Poll) FdHasError(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_fd_has_error(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdHasPri wraps gst_poll_fd_has_pri
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Check if @fd in @set has an exceptional condition (POLLPRI).
//
// Not implemented on Windows (will just return %FALSE there).
func (set *Poll) FdHasPri(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_fd_has_pri(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FdIgnored wraps gst_poll_fd_ignored
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// Mark @fd as ignored so that the next call to gst_poll_wait() will yield
// the same result for @fd as last time. This function must be called if no
// operation (read/write/recv/send/etc.) will be performed on @fd before
// the next call to gst_poll_wait().
//
// The reason why this is needed is because the underlying implementation
// might not allow querying the fd more than once between calls to one of
// the re-enabling operations.
func (set *Poll) FdIgnored(fd *PollFD) {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
C.gst_poll_fd_ignored(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
}
// GetReadGpollfd wraps gst_poll_get_read_gpollfd
//
// The function takes the following parameters:
//
// - fd *glib.PollFD: a #GPollFD
//
// Get a GPollFD for the reading part of the control socket. This is useful when
// integrating with a GSource and GMainLoop.
func (set *Poll) GetReadGpollfd(fd *glib.PollFD) {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GPollFD // in, none, converted
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GPollFD)(glib.UnsafePollFDToGlibNone(fd))
C.gst_poll_get_read_gpollfd(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
}
// ReadControl wraps gst_poll_read_control
// The function returns the following values:
//
// - goret bool
//
// Read a byte from the control socket of the controllable @set.
//
// This function only works for timer #GstPoll objects created with
// gst_poll_new_timer().
func (set *Poll) ReadControl() bool {
var carg0 *C.GstPoll // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
cret = C.gst_poll_read_control(carg0)
runtime.KeepAlive(set)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveFd wraps gst_poll_remove_fd
//
// The function takes the following parameters:
//
// - fd *PollFD: a file descriptor.
//
// The function returns the following values:
//
// - goret bool
//
// Remove a file descriptor from the file descriptor set.
func (set *Poll) RemoveFd(fd *PollFD) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 *C.GstPollFD // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
cret = C.gst_poll_remove_fd(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(fd)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Restart wraps gst_poll_restart
//
// Restart any gst_poll_wait() that is in progress. This function is typically
// used after adding or removing descriptors to @set.
//
// If @set is not controllable, then this call will have no effect.
//
// This function only works for non-timer #GstPoll objects created with
// gst_poll_new().
func (set *Poll) Restart() {
var carg0 *C.GstPoll // in, none, converted
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
C.gst_poll_restart(carg0)
runtime.KeepAlive(set)
}
// SetControllable wraps gst_poll_set_controllable
//
// The function takes the following parameters:
//
// - controllable bool: new controllable state.
//
// The function returns the following values:
//
// - goret bool
//
// When @controllable is %TRUE, this function ensures that future calls to
// gst_poll_wait() will be affected by gst_poll_restart() and
// gst_poll_set_flushing().
//
// This function only works for non-timer #GstPoll objects created with
// gst_poll_new().
func (set *Poll) SetControllable(controllable bool) bool {
var carg0 *C.GstPoll // in, none, converted
var carg1 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
if controllable {
carg1 = C.TRUE
}
cret = C.gst_poll_set_controllable(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(controllable)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetFlushing wraps gst_poll_set_flushing
//
// The function takes the following parameters:
//
// - flushing bool: new flushing state.
//
// When @flushing is %TRUE, this function ensures that current and future calls
// to gst_poll_wait() will return -1, with errno set to EBUSY.
//
// Unsetting the flushing state will restore normal operation of @set.
//
// This function only works for non-timer #GstPoll objects created with
// gst_poll_new().
func (set *Poll) SetFlushing(flushing bool) {
var carg0 *C.GstPoll // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
if flushing {
carg1 = C.TRUE
}
C.gst_poll_set_flushing(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(flushing)
}
// Wait wraps gst_poll_wait
//
// The function takes the following parameters:
//
// - timeout ClockTime: a timeout in nanoseconds.
//
// The function returns the following values:
//
// - goret int
//
// Wait for activity on the file descriptors in @set. This function waits up to
// the specified @timeout. A timeout of #GST_CLOCK_TIME_NONE waits forever.
//
// For #GstPoll objects created with gst_poll_new(), this function can only be
// called from a single thread at a time. If called from multiple threads,
// -1 will be returned with errno set to EPERM.
//
// This is not true for timer #GstPoll objects created with
// gst_poll_new_timer(), where it is allowed to have multiple threads waiting
// simultaneously.
func (set *Poll) Wait(timeout ClockTime) int {
var carg0 *C.GstPoll // in, none, converted
var carg1 C.GstClockTime // in, none, casted, alias
var cret C.gint // return, none, casted
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
carg1 = C.GstClockTime(timeout)
cret = C.gst_poll_wait(carg0, carg1)
runtime.KeepAlive(set)
runtime.KeepAlive(timeout)
var goret int
goret = int(cret)
return goret
}
// WriteControl wraps gst_poll_write_control
// The function returns the following values:
//
// - goret bool
//
// Write a byte to the control socket of the controllable @set.
// This function is mostly useful for timer #GstPoll objects created with
// gst_poll_new_timer().
//
// It will make any current and future gst_poll_wait() function return with
// 1, meaning the control socket is set. After an equal amount of calls to
// gst_poll_read_control() have been performed, calls to gst_poll_wait() will
// block again until their timeout expired.
//
// This function only works for timer #GstPoll objects created with
// gst_poll_new_timer().
func (set *Poll) WriteControl() bool {
var carg0 *C.GstPoll // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstPoll)(UnsafePollToGlibNone(set))
cret = C.gst_poll_write_control(carg0)
runtime.KeepAlive(set)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PollFD wraps GstPollFD
//
// A file descriptor object.
type PollFD struct {
*pollFD
}
// pollFD is the struct that's finalized
type pollFD struct {
native *C.GstPollFD
}
// UnsafePollFDFromGlibBorrow is used to convert raw C.GstPollFD pointers to go. This is used by the bindings internally.
func UnsafePollFDFromGlibBorrow(p unsafe.Pointer) *PollFD {
return &PollFD{&pollFD{(*C.GstPollFD)(p)}}
}
// UnsafePollFDFromGlibNone is used to convert raw C.GstPollFD pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePollFDFromGlibNone(p unsafe.Pointer) *PollFD {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePollFDFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pollFD,
func (intern *pollFD) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePollFDFromGlibFull is used to convert raw C.GstPollFD pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePollFDFromGlibFull(p unsafe.Pointer) *PollFD {
wrapped := UnsafePollFDFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.pollFD,
func (intern *pollFD) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePollFDFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PollFD] is expected to work anymore.
func UnsafePollFDFree(p *PollFD) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePollFDToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePollFDToGlibNone(p *PollFD) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePollFDToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePollFDToGlibFull(p *PollFD) unsafe.Pointer {
runtime.SetFinalizer(p.pollFD, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PollFD is invalid from here on
return _p
}
// Init wraps gst_poll_fd_init
//
// Initializes @fd. Alternatively you can initialize it with
// #GST_POLL_FD_INIT.
func (fd *PollFD) Init() {
var carg0 *C.GstPollFD // in, none, converted
carg0 = (*C.GstPollFD)(UnsafePollFDToGlibNone(fd))
C.gst_poll_fd_init(carg0)
runtime.KeepAlive(fd)
}
// PresetInterface wraps GstPresetInterface
//
// #GstPreset interface.
type PresetInterface struct {
*presetInterface
}
// presetInterface is the struct that's finalized
type presetInterface struct {
native *C.GstPresetInterface
}
// UnsafePresetInterfaceFromGlibBorrow is used to convert raw C.GstPresetInterface pointers to go. This is used by the bindings internally.
func UnsafePresetInterfaceFromGlibBorrow(p unsafe.Pointer) *PresetInterface {
return &PresetInterface{&presetInterface{(*C.GstPresetInterface)(p)}}
}
// UnsafePresetInterfaceFromGlibNone is used to convert raw C.GstPresetInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePresetInterfaceFromGlibNone(p unsafe.Pointer) *PresetInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePresetInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.presetInterface,
func (intern *presetInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePresetInterfaceFromGlibFull is used to convert raw C.GstPresetInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePresetInterfaceFromGlibFull(p unsafe.Pointer) *PresetInterface {
wrapped := UnsafePresetInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.presetInterface,
func (intern *presetInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePresetInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [PresetInterface] is expected to work anymore.
func UnsafePresetInterfaceFree(p *PresetInterface) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePresetInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePresetInterfaceToGlibNone(p *PresetInterface) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePresetInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePresetInterfaceToGlibFull(p *PresetInterface) unsafe.Pointer {
runtime.SetFinalizer(p.presetInterface, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // PresetInterface is invalid from here on
return _p
}
// Promise wraps GstPromise
//
// The #GstPromise object implements the container for values that may
// be available later. i.e. a Future or a Promise in
// &lt;https://en.wikipedia.org/wiki/Futures_and_promises&gt;.
// As with all Future/Promise-like functionality, there is the concept of the
// producer of the value and the consumer of the value.
//
// A #GstPromise is created with gst_promise_new() by the consumer and passed
// to the producer to avoid thread safety issues with the change callback.
// A #GstPromise can be replied to with a value (or an error) by the producer
// with gst_promise_reply(). The exact value returned is defined by the API
// contract of the producer and %NULL may be a valid reply.
// gst_promise_interrupt() is for the consumer to
// indicate to the producer that the value is not needed anymore and producing
// that value can stop. The @GST_PROMISE_RESULT_EXPIRED state set by a call
// to gst_promise_expire() indicates to the consumer that a value will never
// be produced and is intended to be called by a third party that implements
// some notion of message handling such as #GstBus.
// A callback can also be installed at #GstPromise creation for
// result changes with gst_promise_new_with_change_func().
// The change callback can be used to chain #GstPromises's together as in the
// following example.
// |[&lt;!-- language="C" --&gt;
// const GstStructure *reply;
// GstPromise *p;
// if (gst_promise_wait (promise) != GST_PROMISE_RESULT_REPLIED)
// return; // interrupted or expired value
// reply = gst_promise_get_reply (promise);
// if (error in reply)
// return; // propagate error
// p = gst_promise_new_with_change_func (another_promise_change_func, user_data, notify);
// pass p to promise-using API
// ]|
//
// Each #GstPromise starts out with a #GstPromiseResult of
// %GST_PROMISE_RESULT_PENDING and only ever transitions once
// into one of the other #GstPromiseResult's.
//
// In order to support multi-threaded code, gst_promise_reply(),
// gst_promise_interrupt() and gst_promise_expire() may all be from
// different threads with some restrictions and the final result of the promise
// is whichever call is made first. There are two restrictions on ordering:
//
// 1. That gst_promise_reply() and gst_promise_interrupt() cannot be called
// after gst_promise_expire()
// 2. That gst_promise_reply() and gst_promise_interrupt()
// cannot be called twice.
//
// The change function set with gst_promise_new_with_change_func() is
// called directly from either the gst_promise_reply(),
// gst_promise_interrupt() or gst_promise_expire() and can be called
// from an arbitrary thread. #GstPromise using APIs can restrict this to
// a single thread or a subset of threads but that is entirely up to the API
// that uses #GstPromise.
type Promise struct {
*promise
}
// promise is the struct that's finalized
type promise struct {
native *C.GstPromise
}
var _ gobject.GoValueInitializer = (*Promise)(nil)
func marshalPromise(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafePromiseFromGlibBorrow(b), nil
}
func (r *Promise) InitGoValue(v *gobject.Value) {
v.Init(TypePromise)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafePromiseFromGlibBorrow is used to convert raw C.GstPromise pointers to go. This is used by the bindings internally.
func UnsafePromiseFromGlibBorrow(p unsafe.Pointer) *Promise {
return &Promise{&promise{(*C.GstPromise)(p)}}
}
// UnsafePromiseFromGlibNone is used to convert raw C.GstPromise pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePromiseFromGlibNone(p unsafe.Pointer) *Promise {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafePromiseFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.promise,
func (intern *promise) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePromiseFromGlibFull is used to convert raw C.GstPromise pointers to go while taking a reference. This is used by the bindings internally.
func UnsafePromiseFromGlibFull(p unsafe.Pointer) *Promise {
wrapped := UnsafePromiseFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.promise,
func (intern *promise) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafePromiseFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Promise] is expected to work anymore.
func UnsafePromiseFree(p *Promise) {
C.free(unsafe.Pointer(p.native))
}
// UnsafePromiseToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafePromiseToGlibNone(p *Promise) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafePromiseToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafePromiseToGlibFull(p *Promise) unsafe.Pointer {
runtime.SetFinalizer(p.promise, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // Promise is invalid from here on
return _p
}
// NewPromise wraps gst_promise_new
// The function returns the following values:
//
// - goret *Promise
func NewPromise() *Promise {
var cret *C.GstPromise // return, full, converted
cret = C.gst_promise_new()
var goret *Promise
goret = UnsafePromiseFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewPromiseWithChangeFunc wraps gst_promise_new_with_change_func
//
// The function takes the following parameters:
//
// - fn PromiseChangeFunc: a #GstPromiseChangeFunc to call
//
// The function returns the following values:
//
// - goret *Promise
//
// @func will be called exactly once when transitioning out of
// %GST_PROMISE_RESULT_PENDING into any of the other #GstPromiseResult
// states.
func NewPromiseWithChangeFunc(fn PromiseChangeFunc) *Promise {
var carg1 C.GstPromiseChangeFunc // callback, scope: notified, closure: carg2, destroy: carg3
var carg2 C.gpointer // implicit
var carg3 C.GDestroyNotify // implicit
var cret *C.GstPromise // return, full, converted
carg1 = (*[0]byte)(C._gotk4_gst1_PromiseChangeFunc)
carg2 = C.gpointer(userdata.Register(fn))
carg3 = (C.GDestroyNotify)((*[0]byte)(C.destroyUserdata))
cret = C.gst_promise_new_with_change_func(carg1, carg2, carg3)
runtime.KeepAlive(fn)
var goret *Promise
goret = UnsafePromiseFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Expire wraps gst_promise_expire
//
// Expire a @promise. This will wake up any waiters with
// %GST_PROMISE_RESULT_EXPIRED. Called by a message loop when the parent
// message is handled and/or destroyed (possibly unanswered).
func (promise *Promise) Expire() {
var carg0 *C.GstPromise // in, none, converted
carg0 = (*C.GstPromise)(UnsafePromiseToGlibNone(promise))
C.gst_promise_expire(carg0)
runtime.KeepAlive(promise)
}
// GetReply wraps gst_promise_get_reply
// The function returns the following values:
//
// - goret *Structure
//
// Retrieve the reply set on @promise. @promise must be in
// %GST_PROMISE_RESULT_REPLIED and the returned structure is owned by @promise
func (promise *Promise) GetReply() *Structure {
var carg0 *C.GstPromise // in, none, converted
var cret *C.GstStructure // return, none, converted
carg0 = (*C.GstPromise)(UnsafePromiseToGlibNone(promise))
cret = C.gst_promise_get_reply(carg0)
runtime.KeepAlive(promise)
var goret *Structure
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
return goret
}
// Interrupt wraps gst_promise_interrupt
//
// Interrupt waiting for a @promise. This will wake up any waiters with
// %GST_PROMISE_RESULT_INTERRUPTED. Called when the consumer does not want
// the value produced anymore.
func (promise *Promise) Interrupt() {
var carg0 *C.GstPromise // in, none, converted
carg0 = (*C.GstPromise)(UnsafePromiseToGlibNone(promise))
C.gst_promise_interrupt(carg0)
runtime.KeepAlive(promise)
}
// Reply wraps gst_promise_reply
//
// The function takes the following parameters:
//
// - s *Structure (nullable): a #GstStructure with the the reply contents
//
// Set a reply on @promise. This will wake up any waiters with
// %GST_PROMISE_RESULT_REPLIED. Called by the producer of the value to
// indicate success (or failure).
//
// If @promise has already been interrupted by the consumer, then this reply
// is not visible to the consumer.
func (promise *Promise) Reply(s *Structure) {
var carg0 *C.GstPromise // in, none, converted
var carg1 *C.GstStructure // in, full, converted, nullable
carg0 = (*C.GstPromise)(UnsafePromiseToGlibNone(promise))
if s != nil {
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(s))
}
C.gst_promise_reply(carg0, carg1)
runtime.KeepAlive(promise)
runtime.KeepAlive(s)
}
// Wait wraps gst_promise_wait
// The function returns the following values:
//
// - goret PromiseResult
//
// Wait for @promise to move out of the %GST_PROMISE_RESULT_PENDING state.
// If @promise is not in %GST_PROMISE_RESULT_PENDING then it will return
// immediately with the current result.
func (promise *Promise) Wait() PromiseResult {
var carg0 *C.GstPromise // in, none, converted
var cret C.GstPromiseResult // return, none, casted
carg0 = (*C.GstPromise)(UnsafePromiseToGlibNone(promise))
cret = C.gst_promise_wait(carg0)
runtime.KeepAlive(promise)
var goret PromiseResult
goret = PromiseResult(cret)
return goret
}
// ProtectionMeta wraps GstProtectionMeta
//
// Metadata type that holds information about a sample from a protection-protected
// track, including the information needed to decrypt it (if it is encrypted).
type ProtectionMeta struct {
*protectionMeta
}
// protectionMeta is the struct that's finalized
type protectionMeta struct {
native *C.GstProtectionMeta
}
// UnsafeProtectionMetaFromGlibBorrow is used to convert raw C.GstProtectionMeta pointers to go. This is used by the bindings internally.
func UnsafeProtectionMetaFromGlibBorrow(p unsafe.Pointer) *ProtectionMeta {
return &ProtectionMeta{&protectionMeta{(*C.GstProtectionMeta)(p)}}
}
// UnsafeProtectionMetaFromGlibNone is used to convert raw C.GstProtectionMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeProtectionMetaFromGlibNone(p unsafe.Pointer) *ProtectionMeta {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeProtectionMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.protectionMeta,
func (intern *protectionMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeProtectionMetaFromGlibFull is used to convert raw C.GstProtectionMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeProtectionMetaFromGlibFull(p unsafe.Pointer) *ProtectionMeta {
wrapped := UnsafeProtectionMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.protectionMeta,
func (intern *protectionMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeProtectionMetaFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ProtectionMeta] is expected to work anymore.
func UnsafeProtectionMetaFree(p *ProtectionMeta) {
C.free(unsafe.Pointer(p.native))
}
// UnsafeProtectionMetaToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeProtectionMetaToGlibNone(p *ProtectionMeta) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeProtectionMetaToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeProtectionMetaToGlibFull(p *ProtectionMeta) unsafe.Pointer {
runtime.SetFinalizer(p.protectionMeta, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ProtectionMeta is invalid from here on
return _p
}
// ProxyPadClass wraps GstProxyPadClass
type ProxyPadClass struct {
*proxyPadClass
}
// proxyPadClass is the struct that's finalized
type proxyPadClass struct {
native *C.GstProxyPadClass
}
// UnsafeProxyPadClassFromGlibBorrow is used to convert raw C.GstProxyPadClass pointers to go. This is used by the bindings internally.
func UnsafeProxyPadClassFromGlibBorrow(p unsafe.Pointer) *ProxyPadClass {
return &ProxyPadClass{&proxyPadClass{(*C.GstProxyPadClass)(p)}}
}
// UnsafeProxyPadClassFromGlibNone is used to convert raw C.GstProxyPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeProxyPadClassFromGlibNone(p unsafe.Pointer) *ProxyPadClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeProxyPadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.proxyPadClass,
func (intern *proxyPadClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeProxyPadClassFromGlibFull is used to convert raw C.GstProxyPadClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeProxyPadClassFromGlibFull(p unsafe.Pointer) *ProxyPadClass {
wrapped := UnsafeProxyPadClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.proxyPadClass,
func (intern *proxyPadClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeProxyPadClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ProxyPadClass] is expected to work anymore.
func UnsafeProxyPadClassFree(p *ProxyPadClass) {
C.free(unsafe.Pointer(p.native))
}
// UnsafeProxyPadClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeProxyPadClassToGlibNone(p *ProxyPadClass) unsafe.Pointer {
return unsafe.Pointer(p.native)
}
// UnsafeProxyPadClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeProxyPadClassToGlibFull(p *ProxyPadClass) unsafe.Pointer {
runtime.SetFinalizer(p.proxyPadClass, nil)
_p := unsafe.Pointer(p.native)
p.native = nil // ProxyPadClass is invalid from here on
return _p
}
// Query wraps GstQuery
//
// Queries can be performed on pads (gst_pad_query()) and elements
// (gst_element_query()). Please note that some queries might need a running
// pipeline to work.
//
// Queries can be created using the gst_query_new_*() functions.
// Query values can be set using gst_query_set_*(), and parsed using
// gst_query_parse_*() helpers.
//
// The following example shows how to query the duration of a pipeline:
// |[&lt;!-- language="C" --&gt;
// GstQuery *query;
// gboolean res;
// query = gst_query_new_duration (GST_FORMAT_TIME);
// res = gst_element_query (pipeline, query);
// if (res) {
// gint64 duration;
// gst_query_parse_duration (query, NULL, &amp;duration);
// g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration));
// } else {
// g_print ("duration query failed...");
// }
// gst_query_unref (query);
// ]|
type Query struct {
*query
}
// query is the struct that's finalized
type query struct {
native *C.GstQuery
}
var _ gobject.GoValueInitializer = (*Query)(nil)
func marshalQuery(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeQueryFromGlibBorrow(b), nil
}
func (r *Query) InitGoValue(v *gobject.Value) {
v.Init(TypeQuery)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeQueryFromGlibBorrow is used to convert raw C.GstQuery pointers to go. This is used by the bindings internally.
func UnsafeQueryFromGlibBorrow(p unsafe.Pointer) *Query {
return &Query{&query{(*C.GstQuery)(p)}}
}
// UnsafeQueryFromGlibNone is used to convert raw C.GstQuery pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeQueryFromGlibNone(p unsafe.Pointer) *Query {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeQueryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.query,
func (intern *query) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeQueryFromGlibFull is used to convert raw C.GstQuery pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeQueryFromGlibFull(p unsafe.Pointer) *Query {
wrapped := UnsafeQueryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.query,
func (intern *query) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeQueryFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Query] is expected to work anymore.
func UnsafeQueryFree(q *Query) {
C.free(unsafe.Pointer(q.native))
}
// UnsafeQueryToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeQueryToGlibNone(q *Query) unsafe.Pointer {
return unsafe.Pointer(q.native)
}
// UnsafeQueryToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeQueryToGlibFull(q *Query) unsafe.Pointer {
runtime.SetFinalizer(q.query, nil)
_p := unsafe.Pointer(q.native)
q.native = nil // Query is invalid from here on
return _p
}
// NewQueryAcceptCaps wraps gst_query_new_accept_caps
//
// The function takes the following parameters:
//
// - caps *Caps: a fixed #GstCaps
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying if @caps are accepted.
//
// Free-function: gst_query_unref()
func NewQueryAcceptCaps(caps *Caps) *Query {
var carg1 *C.GstCaps // in, none, converted
var cret *C.GstQuery // return, full, converted
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
cret = C.gst_query_new_accept_caps(carg1)
runtime.KeepAlive(caps)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryAllocation wraps gst_query_new_allocation
//
// The function takes the following parameters:
//
// - caps *Caps (nullable): the negotiated caps
// - needPool bool: return a pool
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the allocation properties.
//
// Free-function: gst_query_unref()
func NewQueryAllocation(caps *Caps, needPool bool) *Query {
var carg1 *C.GstCaps // in, none, converted, nullable
var carg2 C.gboolean // in
var cret *C.GstQuery // return, full, converted
if caps != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
if needPool {
carg2 = C.TRUE
}
cret = C.gst_query_new_allocation(carg1, carg2)
runtime.KeepAlive(caps)
runtime.KeepAlive(needPool)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryBitrate wraps gst_query_new_bitrate
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the bitrate.
//
// Free-function: gst_query_unref()
func NewQueryBitrate() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_bitrate()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryBuffering wraps gst_query_new_buffering
//
// The function takes the following parameters:
//
// - format Format: the default #GstFormat for the new query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the buffering status of
// a stream.
//
// Free-function: gst_query_unref()
func NewQueryBuffering(format Format) *Query {
var carg1 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(format)
cret = C.gst_query_new_buffering(carg1)
runtime.KeepAlive(format)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryCaps wraps gst_query_new_caps
//
// The function takes the following parameters:
//
// - filter *Caps: a filter
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the caps.
//
// The CAPS query should return the allowable caps for a pad in the context
// of the element's state, its link to other elements, and the devices or files
// it has opened. These caps must be a subset of the pad template caps. In the
// NULL state with no links, the CAPS query should ideally return the same caps
// as the pad template. In rare circumstances, an object property can affect
// the caps returned by the CAPS query, but this is discouraged.
//
// For most filters, the caps returned by CAPS query is directly affected by the
// allowed caps on other pads. For demuxers and decoders, the caps returned by
// the srcpad's getcaps function is directly related to the stream data. Again,
// the CAPS query should return the most specific caps it reasonably can, since this
// helps with autoplugging.
//
// The @filter is used to restrict the result caps, only the caps matching
// @filter should be returned from the CAPS query. Specifying a filter might
// greatly reduce the amount of processing an element needs to do.
//
// Free-function: gst_query_unref()
func NewQueryCaps(filter *Caps) *Query {
var carg1 *C.GstCaps // in, none, converted
var cret *C.GstQuery // return, full, converted
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(filter))
cret = C.gst_query_new_caps(carg1)
runtime.KeepAlive(filter)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryContext wraps gst_query_new_context
//
// The function takes the following parameters:
//
// - contextType string: Context type to query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the pipeline-local context.
//
// Free-function: gst_query_unref()
func NewQueryContext(contextType string) *Query {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstQuery // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(contextType)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_query_new_context(carg1)
runtime.KeepAlive(contextType)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryConvert wraps gst_query_new_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: the source #GstFormat for the new query
// - value int64: the value to convert
// - destFormat Format: the target #GstFormat
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new convert query object. Use gst_query_unref()
// when done with it. A convert query is used to ask for a conversion between
// one format and another.
//
// Free-function: gst_query_unref()
func NewQueryConvert(srcFormat Format, value int64, destFormat Format) *Query {
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(srcFormat)
carg2 = C.gint64(value)
carg3 = C.GstFormat(destFormat)
cret = C.gst_query_new_convert(carg1, carg2, carg3)
runtime.KeepAlive(srcFormat)
runtime.KeepAlive(value)
runtime.KeepAlive(destFormat)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryCustom wraps gst_query_new_custom
//
// The function takes the following parameters:
//
// - typ QueryType: the query type
// - structure *Structure (nullable): a structure for the query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new custom query object. Use gst_query_unref()
// when done with it.
//
// Free-function: gst_query_unref()
func NewQueryCustom(typ QueryType, structure *Structure) *Query {
var carg1 C.GstQueryType // in, none, casted
var carg2 *C.GstStructure // in, full, converted, nullable
var cret *C.GstQuery // return, full, converted
carg1 = C.GstQueryType(typ)
if structure != nil {
carg2 = (*C.GstStructure)(UnsafeStructureToGlibFull(structure))
}
cret = C.gst_query_new_custom(carg1, carg2)
runtime.KeepAlive(typ)
runtime.KeepAlive(structure)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryDrain wraps gst_query_new_drain
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the drain state.
//
// Free-function: gst_query_unref()
func NewQueryDrain() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_drain()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryDuration wraps gst_query_new_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat for this duration query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new stream duration query object to query in the given format.
// Use gst_query_unref() when done with it. A duration query will give the
// total length of the stream.
//
// Free-function: gst_query_unref()
func NewQueryDuration(format Format) *Query {
var carg1 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(format)
cret = C.gst_query_new_duration(carg1)
runtime.KeepAlive(format)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryFormats wraps gst_query_new_formats
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying formats of
// the stream.
//
// Free-function: gst_query_unref()
func NewQueryFormats() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_formats()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryLatency wraps gst_query_new_latency
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new latency query object.
// Use gst_query_unref() when done with it. A latency query is usually performed
// by sinks to compensate for additional latency introduced by elements in the
// pipeline.
//
// Free-function: gst_query_unref()
func NewQueryLatency() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_latency()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryPosition wraps gst_query_new_position
//
// The function takes the following parameters:
//
// - format Format: the default #GstFormat for the new query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query stream position query object. Use gst_query_unref()
// when done with it. A position query is used to query the current position
// of playback in the streams, in some format.
//
// Free-function: gst_query_unref()
func NewQueryPosition(format Format) *Query {
var carg1 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(format)
cret = C.gst_query_new_position(carg1)
runtime.KeepAlive(format)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryScheduling wraps gst_query_new_scheduling
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the scheduling properties.
//
// Free-function: gst_query_unref()
func NewQueryScheduling() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_scheduling()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQuerySeeking wraps gst_query_new_seeking
//
// The function takes the following parameters:
//
// - format Format: the default #GstFormat for the new query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying seeking properties of
// the stream.
//
// Free-function: gst_query_unref()
func NewQuerySeeking(format Format) *Query {
var carg1 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(format)
cret = C.gst_query_new_seeking(carg1)
runtime.KeepAlive(format)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQuerySegment wraps gst_query_new_segment
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat for the new query
//
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new segment query object. Use gst_query_unref()
// when done with it. A segment query is used to discover information about the
// currently configured segment for playback.
//
// Free-function: gst_query_unref()
func NewQuerySegment(format Format) *Query {
var carg1 C.GstFormat // in, none, casted
var cret *C.GstQuery // return, full, converted
carg1 = C.GstFormat(format)
cret = C.gst_query_new_segment(carg1)
runtime.KeepAlive(format)
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQuerySelectable wraps gst_query_new_selectable
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query object for querying the stream selection capability.
//
// Free-function: gst_query_unref()
func NewQuerySelectable() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_selectable()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewQueryURI wraps gst_query_new_uri
// The function returns the following values:
//
// - goret *Query
//
// Constructs a new query URI query object. Use gst_query_unref()
// when done with it. An URI query is used to query the current URI
// that is used by the source or sink.
//
// Free-function: gst_query_unref()
func NewQueryURI() *Query {
var cret *C.GstQuery // return, full, converted
cret = C.gst_query_new_uri()
var goret *Query
goret = UnsafeQueryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddAllocationMeta wraps gst_query_add_allocation_meta
//
// The function takes the following parameters:
//
// - api gobject.Type: the metadata API
// - params *Structure (nullable): API specific parameters
//
// Add @api with @params as one of the supported metadata API to @query.
func (query *Query) AddAllocationMeta(api gobject.Type, params *Structure) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GType // in, none, casted, alias
var carg2 *C.GstStructure // in, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GType(api)
if params != nil {
carg2 = (*C.GstStructure)(UnsafeStructureToGlibNone(params))
}
C.gst_query_add_allocation_meta(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(api)
runtime.KeepAlive(params)
}
// AddAllocationParam wraps gst_query_add_allocation_param
//
// The function takes the following parameters:
//
// - allocator Allocator (nullable): the memory allocator
// - params *AllocationParams (nullable): a #GstAllocationParams
//
// Add @allocator and its @params as a supported memory allocator.
func (query *Query) AddAllocationParam(allocator Allocator, params *AllocationParams) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstAllocator // in, none, converted, nullable
var carg2 *C.GstAllocationParams // in, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if allocator != nil {
carg1 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
}
if params != nil {
carg2 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
}
C.gst_query_add_allocation_param(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(allocator)
runtime.KeepAlive(params)
}
// AddAllocationPool wraps gst_query_add_allocation_pool
//
// The function takes the following parameters:
//
// - pool BufferPool (nullable): the #GstBufferPool
// - size uint: the buffer size
// - minBuffers uint: the min buffers
// - maxBuffers uint: the max buffers
//
// Set the pool parameters in @query.
func (query *Query) AddAllocationPool(pool BufferPool, size uint, minBuffers uint, maxBuffers uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstBufferPool // in, none, converted, nullable
var carg2 C.guint // in, none, casted
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if pool != nil {
carg1 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
}
carg2 = C.guint(size)
carg3 = C.guint(minBuffers)
carg4 = C.guint(maxBuffers)
C.gst_query_add_allocation_pool(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(pool)
runtime.KeepAlive(size)
runtime.KeepAlive(minBuffers)
runtime.KeepAlive(maxBuffers)
}
// AddBufferingRange wraps gst_query_add_buffering_range
//
// The function takes the following parameters:
//
// - start int64: start position of the range
// - stop int64: stop position of the range
//
// The function returns the following values:
//
// - goret bool
//
// Set the buffering-ranges array field in @query. The current last
// start position of the array should be inferior to @start.
func (query *Query) AddBufferingRange(start int64, stop int64) bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gint64 // in, none, casted
var carg2 C.gint64 // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.gint64(start)
carg2 = C.gint64(stop)
cret = C.gst_query_add_buffering_range(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(start)
runtime.KeepAlive(stop)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AddSchedulingMode wraps gst_query_add_scheduling_mode
//
// The function takes the following parameters:
//
// - mode PadMode: a #GstPadMode
//
// Add @mode as one of the supported scheduling modes to @query.
func (query *Query) AddSchedulingMode(mode PadMode) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstPadMode // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstPadMode(mode)
C.gst_query_add_scheduling_mode(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(mode)
}
// FindAllocationMeta wraps gst_query_find_allocation_meta
//
// The function takes the following parameters:
//
// - api gobject.Type: the metadata API
//
// The function returns the following values:
//
// - index uint: the index
// - goret bool
//
// Check if @query has metadata @api set. When this function returns %TRUE,
// @index will contain the index where the requested API and the parameters
// can be found.
func (query *Query) FindAllocationMeta(api gobject.Type) (uint, bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GType // in, none, casted, alias
var carg2 C.guint // out, none, casted
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GType(api)
cret = C.gst_query_find_allocation_meta(carg0, carg1, &carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(api)
var index uint
var goret bool
index = uint(carg2)
if cret != 0 {
goret = true
}
return index, goret
}
// GetNAllocationMetas wraps gst_query_get_n_allocation_metas
// The function returns the following values:
//
// - goret uint
//
// Retrieve the number of values currently stored in the
// meta API array of the query's structure.
func (query *Query) GetNAllocationMetas() uint {
var carg0 *C.GstQuery // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_n_allocation_metas(carg0)
runtime.KeepAlive(query)
var goret uint
goret = uint(cret)
return goret
}
// GetNAllocationParams wraps gst_query_get_n_allocation_params
// The function returns the following values:
//
// - goret uint
//
// Retrieve the number of values currently stored in the
// allocator params array of the query's structure.
//
// If no memory allocator is specified, the downstream element can handle
// the default memory allocator. The first memory allocator in the query
// should be generic and allow mapping to system memory, all following
// allocators should be ordered by preference with the preferred one first.
func (query *Query) GetNAllocationParams() uint {
var carg0 *C.GstQuery // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_n_allocation_params(carg0)
runtime.KeepAlive(query)
var goret uint
goret = uint(cret)
return goret
}
// GetNAllocationPools wraps gst_query_get_n_allocation_pools
// The function returns the following values:
//
// - goret uint
//
// Retrieve the number of values currently stored in the
// pool array of the query's structure.
func (query *Query) GetNAllocationPools() uint {
var carg0 *C.GstQuery // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_n_allocation_pools(carg0)
runtime.KeepAlive(query)
var goret uint
goret = uint(cret)
return goret
}
// GetNBufferingRanges wraps gst_query_get_n_buffering_ranges
// The function returns the following values:
//
// - goret uint
//
// Retrieve the number of values currently stored in the
// buffered-ranges array of the query's structure.
func (query *Query) GetNBufferingRanges() uint {
var carg0 *C.GstQuery // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_n_buffering_ranges(carg0)
runtime.KeepAlive(query)
var goret uint
goret = uint(cret)
return goret
}
// GetNSchedulingModes wraps gst_query_get_n_scheduling_modes
// The function returns the following values:
//
// - goret uint
//
// Retrieve the number of values currently stored in the
// scheduling mode array of the query's structure.
func (query *Query) GetNSchedulingModes() uint {
var carg0 *C.GstQuery // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_n_scheduling_modes(carg0)
runtime.KeepAlive(query)
var goret uint
goret = uint(cret)
return goret
}
// GetStructure wraps gst_query_get_structure
// The function returns the following values:
//
// - goret *Structure
//
// Get the structure of a query.
func (query *Query) GetStructure() *Structure {
var carg0 *C.GstQuery // in, none, converted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_get_structure(carg0)
runtime.KeepAlive(query)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Query) {}, query)
return goret
}
// HasSchedulingMode wraps gst_query_has_scheduling_mode
//
// The function takes the following parameters:
//
// - mode PadMode: the scheduling mode
//
// The function returns the following values:
//
// - goret bool
//
// Check if @query has scheduling mode set.
//
// &gt; When checking if upstream supports pull mode, it is usually not
// &gt; enough to just check for GST_PAD_MODE_PULL with this function, you
// &gt; also want to check whether the scheduling flags returned by
// &gt; gst_query_parse_scheduling() have the seeking flag set (meaning
// &gt; random access is supported, not only sequential pulls).
func (query *Query) HasSchedulingMode(mode PadMode) bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstPadMode // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstPadMode(mode)
cret = C.gst_query_has_scheduling_mode(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(mode)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasSchedulingModeWithFlags wraps gst_query_has_scheduling_mode_with_flags
//
// The function takes the following parameters:
//
// - mode PadMode: the scheduling mode
// - flags SchedulingFlags: #GstSchedulingFlags
//
// The function returns the following values:
//
// - goret bool
//
// Check if @query has scheduling mode set and @flags is set in
// query scheduling flags.
func (query *Query) HasSchedulingModeWithFlags(mode PadMode, flags SchedulingFlags) bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstPadMode // in, none, casted
var carg2 C.GstSchedulingFlags // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstPadMode(mode)
carg2 = C.GstSchedulingFlags(flags)
cret = C.gst_query_has_scheduling_mode_with_flags(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(mode)
runtime.KeepAlive(flags)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ParseAcceptCaps wraps gst_query_parse_accept_caps
// The function returns the following values:
//
// - caps *Caps: A pointer to the caps
//
// Get the caps from @query. The caps remains valid as long as @query remains
// valid.
func (query *Query) ParseAcceptCaps() *Caps {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstCaps // out, none, converted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_accept_caps(carg0, &carg1)
runtime.KeepAlive(query)
var caps *Caps
caps = UnsafeCapsFromGlibNone(unsafe.Pointer(carg1))
return caps
}
// ParseAcceptCapsResult wraps gst_query_parse_accept_caps_result
// The function returns the following values:
//
// - result bool: location for the result
//
// Parse the result from @query and store in @result.
func (query *Query) ParseAcceptCapsResult() bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // out
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_accept_caps_result(carg0, &carg1)
runtime.KeepAlive(query)
var result bool
if carg1 != 0 {
result = true
}
return result
}
// ParseAllocation wraps gst_query_parse_allocation
// The function returns the following values:
//
// - caps *Caps (nullable): The #GstCaps
// - needPool bool: Whether a #GstBufferPool is needed
//
// Parse an allocation query, writing the requested caps in @caps and
// whether a pool is needed in @need_pool, if the respective parameters
// are non-%NULL.
//
// Pool details can be retrieved using gst_query_get_n_allocation_pools() and
// gst_query_parse_nth_allocation_pool().
func (query *Query) ParseAllocation() (*Caps, bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstCaps // out, none, converted, nullable
var carg2 C.gboolean // out
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_allocation(carg0, &carg1, &carg2)
runtime.KeepAlive(query)
var caps *Caps
var needPool bool
if carg1 != nil {
caps = UnsafeCapsFromGlibNone(unsafe.Pointer(carg1))
}
if carg2 != 0 {
needPool = true
}
return caps, needPool
}
// ParseBitrate wraps gst_query_parse_bitrate
// The function returns the following values:
//
// - nominalBitrate uint: The resulting bitrate in bits per second
//
// Get the results of a bitrate query. See also gst_query_set_bitrate().
func (query *Query) ParseBitrate() uint {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_bitrate(carg0, &carg1)
runtime.KeepAlive(query)
var nominalBitrate uint
nominalBitrate = uint(carg1)
return nominalBitrate
}
// ParseBufferingPercent wraps gst_query_parse_buffering_percent
// The function returns the following values:
//
// - busy bool: if buffering is busy, or %NULL
// - percent int: a buffering percent, or %NULL
//
// Get the percentage of buffered data. This is a value between 0 and 100.
// The @busy indicator is %TRUE when the buffering is in progress.
func (query *Query) ParseBufferingPercent() (bool, int) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // out
var carg2 C.gint // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_buffering_percent(carg0, &carg1, &carg2)
runtime.KeepAlive(query)
var busy bool
var percent int
if carg1 != 0 {
busy = true
}
percent = int(carg2)
return busy, percent
}
// ParseBufferingRange wraps gst_query_parse_buffering_range
// The function returns the following values:
//
// - format Format: the format to set for the @segment_start
// and @segment_end values, or %NULL
// - start int64: the start to set, or %NULL
// - stop int64: the stop to set, or %NULL
// - estimatedTotal int64: estimated total amount of download
// time remaining in milliseconds, or %NULL
//
// Parse an available query, writing the format into @format, and
// other results into the passed parameters, if the respective parameters
// are non-%NULL
func (query *Query) ParseBufferingRange() (Format, int64, int64, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
var carg3 C.gint64 // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_buffering_range(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var format Format
var start int64
var stop int64
var estimatedTotal int64
format = Format(carg1)
start = int64(carg2)
stop = int64(carg3)
estimatedTotal = int64(carg4)
return format, start, stop, estimatedTotal
}
// ParseBufferingStats wraps gst_query_parse_buffering_stats
// The function returns the following values:
//
// - mode BufferingMode: a buffering mode, or %NULL
// - avgIn int: the average input rate, or %NULL
// - avgOut int: the average output rat, or %NULL
// - bufferingLeft int64: amount of buffering time left in
// milliseconds, or %NULL
//
// Extracts the buffering stats values from @query.
func (query *Query) ParseBufferingStats() (BufferingMode, int, int, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstBufferingMode // out, full, casted
var carg2 C.gint // out, full, casted
var carg3 C.gint // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_buffering_stats(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var mode BufferingMode
var avgIn int
var avgOut int
var bufferingLeft int64
mode = BufferingMode(carg1)
avgIn = int(carg2)
avgOut = int(carg3)
bufferingLeft = int64(carg4)
return mode, avgIn, avgOut, bufferingLeft
}
// ParseCaps wraps gst_query_parse_caps
// The function returns the following values:
//
// - filter *Caps: A pointer to the caps filter
//
// Get the filter from the caps @query. The caps remains valid as long as
// @query remains valid.
func (query *Query) ParseCaps() *Caps {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstCaps // out, none, converted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_caps(carg0, &carg1)
runtime.KeepAlive(query)
var filter *Caps
filter = UnsafeCapsFromGlibNone(unsafe.Pointer(carg1))
return filter
}
// ParseCapsResult wraps gst_query_parse_caps_result
// The function returns the following values:
//
// - caps *Caps (nullable): A pointer to the caps
//
// Get the caps result from @query. The caps remains valid as long as
// @query remains valid.
func (query *Query) ParseCapsResult() *Caps {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstCaps // out, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_caps_result(carg0, &carg1)
runtime.KeepAlive(query)
var caps *Caps
if carg1 != nil {
caps = UnsafeCapsFromGlibNone(unsafe.Pointer(carg1))
}
return caps
}
// ParseContext wraps gst_query_parse_context
// The function returns the following values:
//
// - _context *Context (nullable): A pointer to store the #GstContext
//
// Get the context from the context @query. The context remains valid as long as
// @query remains valid.
func (query *Query) ParseContext() *Context {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstContext // out, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_context(carg0, &carg1)
runtime.KeepAlive(query)
var _context *Context
if carg1 != nil {
_context = UnsafeContextFromGlibNone(unsafe.Pointer(carg1))
}
return _context
}
// ParseContextType wraps gst_query_parse_context_type
// The function returns the following values:
//
// - contextType string: the context type, or %NULL
// - goret bool
//
// Parse a context type from an existing GST_QUERY_CONTEXT query.
func (query *Query) ParseContextType() (string, bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.gchar // out, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_parse_context_type(carg0, &carg1)
runtime.KeepAlive(query)
var contextType string
var goret bool
contextType = C.GoString((*C.char)(unsafe.Pointer(carg1)))
if cret != 0 {
goret = true
}
return contextType, goret
}
// ParseConvert wraps gst_query_parse_convert
// The function returns the following values:
//
// - srcFormat Format: the storage for the #GstFormat of the
// source value, or %NULL
// - srcValue int64: the storage for the source value, or %NULL
// - destFormat Format: the storage for the #GstFormat of the
// destination value, or %NULL
// - destValue int64: the storage for the destination value,
// or %NULL
//
// Parse a convert query answer. Any of @src_format, @src_value, @dest_format,
// and @dest_value may be %NULL, in which case that value is omitted.
func (query *Query) ParseConvert() (Format, int64, Format, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
var carg3 C.GstFormat // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_convert(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var srcFormat Format
var srcValue int64
var destFormat Format
var destValue int64
srcFormat = Format(carg1)
srcValue = int64(carg2)
destFormat = Format(carg3)
destValue = int64(carg4)
return srcFormat, srcValue, destFormat, destValue
}
// ParseDuration wraps gst_query_parse_duration
// The function returns the following values:
//
// - format Format: the storage for the #GstFormat of the duration
// value, or %NULL.
// - duration int64: the storage for the total duration, or %NULL.
//
// Parse a duration query answer. Write the format of the duration into @format,
// and the value into @duration, if the respective variables are non-%NULL.
func (query *Query) ParseDuration() (Format, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_duration(carg0, &carg1, &carg2)
runtime.KeepAlive(query)
var format Format
var duration int64
format = Format(carg1)
duration = int64(carg2)
return format, duration
}
// ParseLatency wraps gst_query_parse_latency
// The function returns the following values:
//
// - live bool: storage for live or %NULL
// - minLatency ClockTime: the storage for the min latency or %NULL
// - maxLatency ClockTime: the storage for the max latency or %NULL
//
// Parse a latency query answer.
func (query *Query) ParseLatency() (bool, ClockTime, ClockTime) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // out
var carg2 C.GstClockTime // out, full, casted, alias
var carg3 C.GstClockTime // out, full, casted, alias
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_latency(carg0, &carg1, &carg2, &carg3)
runtime.KeepAlive(query)
var live bool
var minLatency ClockTime
var maxLatency ClockTime
if carg1 != 0 {
live = true
}
minLatency = ClockTime(carg2)
maxLatency = ClockTime(carg3)
return live, minLatency, maxLatency
}
// ParseNFormats wraps gst_query_parse_n_formats
// The function returns the following values:
//
// - nFormats uint: the number of formats in this query.
//
// Parse the number of formats in the formats @query.
func (query *Query) ParseNFormats() uint {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_n_formats(carg0, &carg1)
runtime.KeepAlive(query)
var nFormats uint
nFormats = uint(carg1)
return nFormats
}
// ParseNthAllocationMeta wraps gst_query_parse_nth_allocation_meta
//
// The function takes the following parameters:
//
// - index uint: position in the metadata API array to read
//
// The function returns the following values:
//
// - params *Structure: API specific parameters
// - goret gobject.Type
//
// Parse an available query and get the metadata API
// at @index of the metadata API array.
func (query *Query) ParseNthAllocationMeta(index uint) (*Structure, gobject.Type) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstStructure // out, none, converted
var cret C.GType // return, none, casted, alias
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
cret = C.gst_query_parse_nth_allocation_meta(carg0, carg1, &carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
var params *Structure
var goret gobject.Type
params = UnsafeStructureFromGlibNone(unsafe.Pointer(carg2))
goret = gobject.Type(cret)
return params, goret
}
// ParseNthAllocationParam wraps gst_query_parse_nth_allocation_param
//
// The function takes the following parameters:
//
// - index uint: position in the allocator array to read
//
// The function returns the following values:
//
// - allocator Allocator (nullable): variable to hold the result
// - params AllocationParams: parameters for the allocator
//
// Parse an available query and get the allocator and its params
// at @index of the allocator array.
func (query *Query) ParseNthAllocationParam(index uint) (Allocator, AllocationParams) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstAllocator // out, full, converted, nullable
var carg3 C.GstAllocationParams // out, transfer: none, C Pointers: 0, Name: AllocationParams, optional, caller-allocates
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
C.gst_query_parse_nth_allocation_param(carg0, carg1, &carg2, &carg3)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
var allocator Allocator
var params AllocationParams
if carg2 != nil {
allocator = UnsafeAllocatorFromGlibFull(unsafe.Pointer(carg2))
}
_ = params
_ = carg3
panic("unimplemented conversion of AllocationParams (GstAllocationParams)")
return allocator, params
}
// ParseNthAllocationPool wraps gst_query_parse_nth_allocation_pool
//
// The function takes the following parameters:
//
// - index uint: index to parse
//
// The function returns the following values:
//
// - pool BufferPool (nullable): the #GstBufferPool
// - size uint: the buffer size
// - minBuffers uint: the min buffers
// - maxBuffers uint: the max buffers
//
// Get the pool parameters in @query.
//
// Unref @pool with gst_object_unref() when it's not needed any more.
func (query *Query) ParseNthAllocationPool(index uint) (BufferPool, uint, uint, uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstBufferPool // out, full, converted, nullable
var carg3 C.guint // out, full, casted
var carg4 C.guint // out, full, casted
var carg5 C.guint // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
C.gst_query_parse_nth_allocation_pool(carg0, carg1, &carg2, &carg3, &carg4, &carg5)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
var pool BufferPool
var size uint
var minBuffers uint
var maxBuffers uint
if carg2 != nil {
pool = UnsafeBufferPoolFromGlibFull(unsafe.Pointer(carg2))
}
size = uint(carg3)
minBuffers = uint(carg4)
maxBuffers = uint(carg5)
return pool, size, minBuffers, maxBuffers
}
// ParseNthBufferingRange wraps gst_query_parse_nth_buffering_range
//
// The function takes the following parameters:
//
// - index uint: position in the buffered-ranges array to read
//
// The function returns the following values:
//
// - start int64: the start position to set, or %NULL
// - stop int64: the stop position to set, or %NULL
// - goret bool
//
// Parse an available query and get the start and stop values stored
// at the @index of the buffered ranges array.
func (query *Query) ParseNthBufferingRange(index uint) (int64, int64, bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.gint64 // out, full, casted
var carg3 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
cret = C.gst_query_parse_nth_buffering_range(carg0, carg1, &carg2, &carg3)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
var start int64
var stop int64
var goret bool
start = int64(carg2)
stop = int64(carg3)
if cret != 0 {
goret = true
}
return start, stop, goret
}
// ParseNthFormat wraps gst_query_parse_nth_format
//
// The function takes the following parameters:
//
// - nth uint: the nth format to retrieve.
//
// The function returns the following values:
//
// - format Format: a pointer to store the nth format
//
// Parse the format query and retrieve the @nth format from it into
// @format. If the list contains less elements than @nth, @format will be
// set to GST_FORMAT_UNDEFINED.
func (query *Query) ParseNthFormat(nth uint) Format {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 C.GstFormat // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(nth)
C.gst_query_parse_nth_format(carg0, carg1, &carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(nth)
var format Format
format = Format(carg2)
return format
}
// ParseNthSchedulingMode wraps gst_query_parse_nth_scheduling_mode
//
// The function takes the following parameters:
//
// - index uint: position in the scheduling modes array to read
//
// The function returns the following values:
//
// - goret PadMode
//
// Parse an available query and get the scheduling mode
// at @index of the scheduling modes array.
func (query *Query) ParseNthSchedulingMode(index uint) PadMode {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var cret C.GstPadMode // return, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
cret = C.gst_query_parse_nth_scheduling_mode(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
var goret PadMode
goret = PadMode(cret)
return goret
}
// ParsePosition wraps gst_query_parse_position
// The function returns the following values:
//
// - format Format: the storage for the #GstFormat of the
// position values (may be %NULL)
// - cur int64: the storage for the current position (may be %NULL)
//
// Parse a position query, writing the format into @format, and the position
// into @cur, if the respective parameters are non-%NULL.
func (query *Query) ParsePosition() (Format, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_position(carg0, &carg1, &carg2)
runtime.KeepAlive(query)
var format Format
var cur int64
format = Format(carg1)
cur = int64(carg2)
return format, cur
}
// ParseScheduling wraps gst_query_parse_scheduling
// The function returns the following values:
//
// - flags SchedulingFlags: #GstSchedulingFlags
// - minsize int: the suggested minimum size of pull requests
// - maxsize int: the suggested maximum size of pull requests:
// - align int: the suggested alignment of pull requests
//
// Set the scheduling properties.
func (query *Query) ParseScheduling() (SchedulingFlags, int, int, int) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstSchedulingFlags // out, full, casted
var carg2 C.gint // out, full, casted
var carg3 C.gint // out, full, casted
var carg4 C.gint // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_scheduling(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var flags SchedulingFlags
var minsize int
var maxsize int
var align int
flags = SchedulingFlags(carg1)
minsize = int(carg2)
maxsize = int(carg3)
align = int(carg4)
return flags, minsize, maxsize, align
}
// ParseSeeking wraps gst_query_parse_seeking
// The function returns the following values:
//
// - format Format: the format to set for the @segment_start
// and @segment_end values, or %NULL
// - seekable bool: the seekable flag to set, or %NULL
// - segmentStart int64: the segment_start to set, or %NULL
// - segmentEnd int64: the segment_end to set, or %NULL
//
// Parse a seeking query, writing the format into @format, and
// other results into the passed parameters, if the respective parameters
// are non-%NULL
func (query *Query) ParseSeeking() (Format, bool, int64, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // out, full, casted
var carg2 C.gboolean // out
var carg3 C.gint64 // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_seeking(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var format Format
var seekable bool
var segmentStart int64
var segmentEnd int64
format = Format(carg1)
if carg2 != 0 {
seekable = true
}
segmentStart = int64(carg3)
segmentEnd = int64(carg4)
return format, seekable, segmentStart, segmentEnd
}
// ParseSegment wraps gst_query_parse_segment
// The function returns the following values:
//
// - rate float64: the storage for the rate of the segment, or %NULL
// - format Format: the storage for the #GstFormat of the values,
// or %NULL
// - startValue int64: the storage for the start value, or %NULL
// - stopValue int64: the storage for the stop value, or %NULL
//
// Parse a segment query answer. Any of @rate, @format, @start_value, and
// @stop_value may be %NULL, which will cause this value to be omitted.
//
// See gst_query_set_segment() for an explanation of the function arguments.
func (query *Query) ParseSegment() (float64, Format, int64, int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gdouble // out, full, casted
var carg2 C.GstFormat // out, full, casted
var carg3 C.gint64 // out, full, casted
var carg4 C.gint64 // out, full, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_segment(carg0, &carg1, &carg2, &carg3, &carg4)
runtime.KeepAlive(query)
var rate float64
var format Format
var startValue int64
var stopValue int64
rate = float64(carg1)
format = Format(carg2)
startValue = int64(carg3)
stopValue = int64(carg4)
return rate, format, startValue, stopValue
}
// ParseSelectable wraps gst_query_parse_selectable
// The function returns the following values:
//
// - selectable bool: The resulting stream selection capability
//
// Get the results of a selectable query. See also gst_query_set_selectable().
func (query *Query) ParseSelectable() bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // out
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_selectable(carg0, &carg1)
runtime.KeepAlive(query)
var selectable bool
if carg1 != 0 {
selectable = true
}
return selectable
}
// ParseURI wraps gst_query_parse_uri
// The function returns the following values:
//
// - uri string (nullable): the storage for the current URI
// (may be %NULL)
//
// Parse an URI query, writing the URI into @uri as a newly
// allocated string, if the respective parameters are non-%NULL.
// Free the string with g_free() after usage.
func (query *Query) ParseURI() string {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.gchar // out, full, string, casted *C.gchar, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_uri(carg0, &carg1)
runtime.KeepAlive(query)
var uri string
if carg1 != nil {
uri = C.GoString((*C.char)(unsafe.Pointer(carg1)))
defer C.free(unsafe.Pointer(carg1))
}
return uri
}
// ParseURIRedirection wraps gst_query_parse_uri_redirection
// The function returns the following values:
//
// - uri string (nullable): the storage for the redirect URI
// (may be %NULL)
//
// Parse an URI query, writing the URI into @uri as a newly
// allocated string, if the respective parameters are non-%NULL.
// Free the string with g_free() after usage.
func (query *Query) ParseURIRedirection() string {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.gchar // out, full, string, casted *C.gchar, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_uri_redirection(carg0, &carg1)
runtime.KeepAlive(query)
var uri string
if carg1 != nil {
uri = C.GoString((*C.char)(unsafe.Pointer(carg1)))
defer C.free(unsafe.Pointer(carg1))
}
return uri
}
// ParseURIRedirectionPermanent wraps gst_query_parse_uri_redirection_permanent
// The function returns the following values:
//
// - permanent bool: if the URI redirection is permanent
// (may be %NULL)
//
// Parse an URI query, and set @permanent to %TRUE if there is a redirection
// and it should be considered permanent. If a redirection is permanent,
// applications should update their internal storage of the URI, otherwise
// they should make all future requests to the original URI.
func (query *Query) ParseURIRedirectionPermanent() bool {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // out
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
C.gst_query_parse_uri_redirection_permanent(carg0, &carg1)
runtime.KeepAlive(query)
var permanent bool
if carg1 != 0 {
permanent = true
}
return permanent
}
// RemoveNthAllocationMeta wraps gst_query_remove_nth_allocation_meta
//
// The function takes the following parameters:
//
// - index uint: position in the metadata API array to remove
//
// Remove the metadata API at @index of the metadata API array.
func (query *Query) RemoveNthAllocationMeta(index uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
C.gst_query_remove_nth_allocation_meta(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
}
// RemoveNthAllocationParam wraps gst_query_remove_nth_allocation_param
//
// The function takes the following parameters:
//
// - index uint: position in the allocation param array to remove
//
// Remove the allocation param at @index of the allocation param array.
func (query *Query) RemoveNthAllocationParam(index uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
C.gst_query_remove_nth_allocation_param(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
}
// RemoveNthAllocationPool wraps gst_query_remove_nth_allocation_pool
//
// The function takes the following parameters:
//
// - index uint: position in the allocation pool array to remove
//
// Remove the allocation pool at @index of the allocation pool array.
func (query *Query) RemoveNthAllocationPool(index uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
C.gst_query_remove_nth_allocation_pool(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
}
// SetAcceptCapsResult wraps gst_query_set_accept_caps_result
//
// The function takes the following parameters:
//
// - result bool: the result to set
//
// Set @result as the result for the @query.
func (query *Query) SetAcceptCapsResult(result bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if result {
carg1 = C.TRUE
}
C.gst_query_set_accept_caps_result(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(result)
}
// SetBitrate wraps gst_query_set_bitrate
//
// The function takes the following parameters:
//
// - nominalBitrate uint: the nominal bitrate in bits per second
//
// Set the results of a bitrate query. The nominal bitrate is the average
// bitrate expected over the length of the stream as advertised in file
// headers (or similar).
func (query *Query) SetBitrate(nominalBitrate uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(nominalBitrate)
C.gst_query_set_bitrate(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(nominalBitrate)
}
// SetBufferingPercent wraps gst_query_set_buffering_percent
//
// The function takes the following parameters:
//
// - busy bool: if buffering is busy
// - percent int: a buffering percent
//
// Set the percentage of buffered data. This is a value between 0 and 100.
// The @busy indicator is %TRUE when the buffering is in progress.
func (query *Query) SetBufferingPercent(busy bool, percent int) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // in
var carg2 C.gint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if busy {
carg1 = C.TRUE
}
carg2 = C.gint(percent)
C.gst_query_set_buffering_percent(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(busy)
runtime.KeepAlive(percent)
}
// SetBufferingRange wraps gst_query_set_buffering_range
//
// The function takes the following parameters:
//
// - format Format: the format to set for the @start and @stop values
// - start int64: the start to set
// - stop int64: the stop to set
// - estimatedTotal int64: estimated total amount of download time remaining in
// milliseconds
//
// Set the available query result fields in @query.
func (query *Query) SetBufferingRange(format Format, start int64, stop int64, estimatedTotal int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.gint64 // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstFormat(format)
carg2 = C.gint64(start)
carg3 = C.gint64(stop)
carg4 = C.gint64(estimatedTotal)
C.gst_query_set_buffering_range(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(format)
runtime.KeepAlive(start)
runtime.KeepAlive(stop)
runtime.KeepAlive(estimatedTotal)
}
// SetBufferingStats wraps gst_query_set_buffering_stats
//
// The function takes the following parameters:
//
// - mode BufferingMode: a buffering mode
// - avgIn int: the average input rate
// - avgOut int: the average output rate
// - bufferingLeft int64: amount of buffering time left in milliseconds
//
// Configures the buffering stats values in @query.
func (query *Query) SetBufferingStats(mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstBufferingMode // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstBufferingMode(mode)
carg2 = C.gint(avgIn)
carg3 = C.gint(avgOut)
carg4 = C.gint64(bufferingLeft)
C.gst_query_set_buffering_stats(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(mode)
runtime.KeepAlive(avgIn)
runtime.KeepAlive(avgOut)
runtime.KeepAlive(bufferingLeft)
}
// SetCapsResult wraps gst_query_set_caps_result
//
// The function takes the following parameters:
//
// - caps *Caps (nullable): A pointer to the caps
//
// Set the @caps result in @query.
func (query *Query) SetCapsResult(caps *Caps) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstCaps // in, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if caps != nil {
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
C.gst_query_set_caps_result(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(caps)
}
// SetContext wraps gst_query_set_context
//
// The function takes the following parameters:
//
// - _context *Context (nullable): the requested #GstContext
//
// Answer a context query by setting the requested context.
func (query *Query) SetContext(_context *Context) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.GstContext // in, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if _context != nil {
carg1 = (*C.GstContext)(UnsafeContextToGlibNone(_context))
}
C.gst_query_set_context(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(_context)
}
// SetConvert wraps gst_query_set_convert
//
// The function takes the following parameters:
//
// - srcFormat Format: the source #GstFormat
// - srcValue int64: the source value
// - destFormat Format: the destination #GstFormat
// - destValue int64: the destination value
//
// Answer a convert query by setting the requested values.
func (query *Query) SetConvert(srcFormat Format, srcValue int64, destFormat Format, destValue int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var carg3 C.GstFormat // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstFormat(srcFormat)
carg2 = C.gint64(srcValue)
carg3 = C.GstFormat(destFormat)
carg4 = C.gint64(destValue)
C.gst_query_set_convert(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(srcFormat)
runtime.KeepAlive(srcValue)
runtime.KeepAlive(destFormat)
runtime.KeepAlive(destValue)
}
// SetDuration wraps gst_query_set_duration
//
// The function takes the following parameters:
//
// - format Format: the #GstFormat for the duration
// - duration int64: the duration of the stream
//
// Answer a duration query by setting the requested value in the given format.
func (query *Query) SetDuration(format Format, duration int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstFormat(format)
carg2 = C.gint64(duration)
C.gst_query_set_duration(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(format)
runtime.KeepAlive(duration)
}
// SetFormatsv wraps gst_query_set_formatsv
//
// The function takes the following parameters:
//
// - formats []Format: an array containing @n_formats
// @GstFormat values.
//
// Set the formats query result fields in @query. The number of formats passed
// in the @formats array must be equal to @n_formats.
func (query *Query) SetFormatsv(formats []Format) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gint // implicit
var carg2 *C.GstFormat // in, transfer: none, C Pointers: 1, Name: array[Format], array (inner: *typesystem.Enum, length-by: carg1)
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
_ = formats
_ = carg2
_ = carg1
panic("unimplemented conversion of []Format (const GstFormat*)")
C.gst_query_set_formatsv(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(formats)
}
// SetLatency wraps gst_query_set_latency
//
// The function takes the following parameters:
//
// - live bool: if there is a live element upstream
// - minLatency ClockTime: the minimal latency of the upstream elements
// - maxLatency ClockTime: the maximal latency of the upstream elements
//
// Answer a latency query by setting the requested values in the given format.
func (query *Query) SetLatency(live bool, minLatency ClockTime, maxLatency ClockTime) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // in
var carg2 C.GstClockTime // in, none, casted, alias
var carg3 C.GstClockTime // in, none, casted, alias
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if live {
carg1 = C.TRUE
}
carg2 = C.GstClockTime(minLatency)
carg3 = C.GstClockTime(maxLatency)
C.gst_query_set_latency(carg0, carg1, carg2, carg3)
runtime.KeepAlive(query)
runtime.KeepAlive(live)
runtime.KeepAlive(minLatency)
runtime.KeepAlive(maxLatency)
}
// SetNthAllocationParam wraps gst_query_set_nth_allocation_param
//
// The function takes the following parameters:
//
// - index uint: position in the allocator array to set
// - allocator Allocator (nullable): new allocator to set
// - params *AllocationParams (nullable): parameters for the allocator
//
// Parse an available query and get the allocator and its params
// at @index of the allocator array.
func (query *Query) SetNthAllocationParam(index uint, allocator Allocator, params *AllocationParams) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstAllocator // in, none, converted, nullable
var carg3 *C.GstAllocationParams // in, none, converted, nullable
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
if allocator != nil {
carg2 = (*C.GstAllocator)(UnsafeAllocatorToGlibNone(allocator))
}
if params != nil {
carg3 = (*C.GstAllocationParams)(UnsafeAllocationParamsToGlibNone(params))
}
C.gst_query_set_nth_allocation_param(carg0, carg1, carg2, carg3)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
runtime.KeepAlive(allocator)
runtime.KeepAlive(params)
}
// SetNthAllocationPool wraps gst_query_set_nth_allocation_pool
//
// The function takes the following parameters:
//
// - index uint: index to modify
// - pool BufferPool (nullable): the #GstBufferPool
// - size uint: the buffer size
// - minBuffers uint: the min buffers
// - maxBuffers uint: the max buffers
//
// Set the pool parameters in @query.
func (query *Query) SetNthAllocationPool(index uint, pool BufferPool, size uint, minBuffers uint, maxBuffers uint) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstBufferPool // in, none, converted, nullable
var carg3 C.guint // in, none, casted
var carg4 C.guint // in, none, casted
var carg5 C.guint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.guint(index)
if pool != nil {
carg2 = (*C.GstBufferPool)(UnsafeBufferPoolToGlibNone(pool))
}
carg3 = C.guint(size)
carg4 = C.guint(minBuffers)
carg5 = C.guint(maxBuffers)
C.gst_query_set_nth_allocation_pool(carg0, carg1, carg2, carg3, carg4, carg5)
runtime.KeepAlive(query)
runtime.KeepAlive(index)
runtime.KeepAlive(pool)
runtime.KeepAlive(size)
runtime.KeepAlive(minBuffers)
runtime.KeepAlive(maxBuffers)
}
// SetPosition wraps gst_query_set_position
//
// The function takes the following parameters:
//
// - format Format: the requested #GstFormat
// - cur int64: the position to set
//
// Answer a position query by setting the requested value in the given format.
func (query *Query) SetPosition(format Format, cur int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstFormat(format)
carg2 = C.gint64(cur)
C.gst_query_set_position(carg0, carg1, carg2)
runtime.KeepAlive(query)
runtime.KeepAlive(format)
runtime.KeepAlive(cur)
}
// SetScheduling wraps gst_query_set_scheduling
//
// The function takes the following parameters:
//
// - flags SchedulingFlags: #GstSchedulingFlags
// - minsize int: the suggested minimum size of pull requests
// - maxsize int: the suggested maximum size of pull requests
// - align int: the suggested alignment of pull requests
//
// Set the scheduling properties.
func (query *Query) SetScheduling(flags SchedulingFlags, minsize int, maxsize int, align int) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstSchedulingFlags // in, none, casted
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var carg4 C.gint // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstSchedulingFlags(flags)
carg2 = C.gint(minsize)
carg3 = C.gint(maxsize)
carg4 = C.gint(align)
C.gst_query_set_scheduling(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(flags)
runtime.KeepAlive(minsize)
runtime.KeepAlive(maxsize)
runtime.KeepAlive(align)
}
// SetSeeking wraps gst_query_set_seeking
//
// The function takes the following parameters:
//
// - format Format: the format to set for the @segment_start and @segment_end values
// - seekable bool: the seekable flag to set
// - segmentStart int64: the segment_start to set
// - segmentEnd int64: the segment_end to set
//
// Set the seeking query result fields in @query.
func (query *Query) SetSeeking(format Format, seekable bool, segmentStart int64, segmentEnd int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gboolean // in
var carg3 C.gint64 // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.GstFormat(format)
if seekable {
carg2 = C.TRUE
}
carg3 = C.gint64(segmentStart)
carg4 = C.gint64(segmentEnd)
C.gst_query_set_seeking(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(format)
runtime.KeepAlive(seekable)
runtime.KeepAlive(segmentStart)
runtime.KeepAlive(segmentEnd)
}
// SetSegment wraps gst_query_set_segment
//
// The function takes the following parameters:
//
// - rate float64: the rate of the segment
// - format Format: the #GstFormat of the segment values (@start_value and @stop_value)
// - startValue int64: the start value
// - stopValue int64: the stop value
//
// Answer a segment query by setting the requested values. The normal
// playback segment of a pipeline is 0 to duration at the default rate of
// 1.0. If a seek was performed on the pipeline to play a different
// segment, this query will return the range specified in the last seek.
//
// @start_value and @stop_value will respectively contain the configured
// playback range start and stop values expressed in @format.
// The values are always between 0 and the duration of the media and
// @start_value &lt;= @stop_value. @rate will contain the playback rate. For
// negative rates, playback will actually happen from @stop_value to
// @start_value.
func (query *Query) SetSegment(rate float64, format Format, startValue int64, stopValue int64) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gdouble // in, none, casted
var carg2 C.GstFormat // in, none, casted
var carg3 C.gint64 // in, none, casted
var carg4 C.gint64 // in, none, casted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
carg1 = C.gdouble(rate)
carg2 = C.GstFormat(format)
carg3 = C.gint64(startValue)
carg4 = C.gint64(stopValue)
C.gst_query_set_segment(carg0, carg1, carg2, carg3, carg4)
runtime.KeepAlive(query)
runtime.KeepAlive(rate)
runtime.KeepAlive(format)
runtime.KeepAlive(startValue)
runtime.KeepAlive(stopValue)
}
// SetSelectable wraps gst_query_set_selectable
//
// The function takes the following parameters:
//
// - selectable bool: Whether the element can handle stream selection.
//
// Set the results of a selectable query. If the element answering the query can
// handle stream selection, @selectable should be set to %TRUE.
func (query *Query) SetSelectable(selectable bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if selectable {
carg1 = C.TRUE
}
C.gst_query_set_selectable(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(selectable)
}
// SetURI wraps gst_query_set_uri
//
// The function takes the following parameters:
//
// - uri string (nullable): the URI to set
//
// Answer a URI query by setting the requested URI.
func (query *Query) SetURI(uri string) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if uri != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uri)))
defer C.free(unsafe.Pointer(carg1))
}
C.gst_query_set_uri(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(uri)
}
// SetURIRedirection wraps gst_query_set_uri_redirection
//
// The function takes the following parameters:
//
// - uri string (nullable): the URI to set
//
// Answer a URI query by setting the requested URI redirection.
func (query *Query) SetURIRedirection(uri string) {
var carg0 *C.GstQuery // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if uri != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uri)))
defer C.free(unsafe.Pointer(carg1))
}
C.gst_query_set_uri_redirection(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(uri)
}
// SetURIRedirectionPermanent wraps gst_query_set_uri_redirection_permanent
//
// The function takes the following parameters:
//
// - permanent bool: whether the redirect is permanent or not
//
// Answer a URI query by setting the requested URI redirection
// to permanent or not.
func (query *Query) SetURIRedirectionPermanent(permanent bool) {
var carg0 *C.GstQuery // in, none, converted
var carg1 C.gboolean // in
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
if permanent {
carg1 = C.TRUE
}
C.gst_query_set_uri_redirection_permanent(carg0, carg1)
runtime.KeepAlive(query)
runtime.KeepAlive(permanent)
}
// WritableStructure wraps gst_query_writable_structure
// The function returns the following values:
//
// - goret *Structure
//
// Get the structure of a query. This method should be called with a writable
// @query so that the returned structure is guaranteed to be writable.
func (query *Query) WritableStructure() *Structure {
var carg0 *C.GstQuery // in, none, converted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstQuery)(UnsafeQueryToGlibNone(query))
cret = C.gst_query_writable_structure(carg0)
runtime.KeepAlive(query)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Query) {}, query)
return goret
}
// ReferenceTimestampMeta wraps GstReferenceTimestampMeta
//
// #GstReferenceTimestampMeta can be used to attach alternative timestamps and
// possibly durations to a #GstBuffer. These are generally not according to
// the pipeline clock and could be e.g. the NTP timestamp when the media was
// captured.
//
// The reference is stored as a #GstCaps in @reference. Examples of valid
// references would be
//
// * `timestamp/x-drivername-stream`: for timestamps that are locally
// generated by some driver named `drivername` when generating the stream,
// e.g. based on a frame counter
// * `timestamp/x-ntp, host=pool.ntp.org, port=123`: for timestamps based on a
// specific NTP server. Note that the host/port parameters might not always
// be given.
// * `timestamp/x-ptp, version=IEEE1588-2008, domain=1`: for timestamps based
// on a given PTP clock.
// * `timestamp/x-unix`: for timestamps based on the UNIX epoch according to
// the local clock.
//
// Since 1.24 it can be serialized using gst_meta_serialize() and
// gst_meta_deserialize().
type ReferenceTimestampMeta struct {
*referenceTimestampMeta
}
// referenceTimestampMeta is the struct that's finalized
type referenceTimestampMeta struct {
native *C.GstReferenceTimestampMeta
}
// UnsafeReferenceTimestampMetaFromGlibBorrow is used to convert raw C.GstReferenceTimestampMeta pointers to go. This is used by the bindings internally.
func UnsafeReferenceTimestampMetaFromGlibBorrow(p unsafe.Pointer) *ReferenceTimestampMeta {
return &ReferenceTimestampMeta{&referenceTimestampMeta{(*C.GstReferenceTimestampMeta)(p)}}
}
// UnsafeReferenceTimestampMetaFromGlibNone is used to convert raw C.GstReferenceTimestampMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeReferenceTimestampMetaFromGlibNone(p unsafe.Pointer) *ReferenceTimestampMeta {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeReferenceTimestampMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.referenceTimestampMeta,
func (intern *referenceTimestampMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeReferenceTimestampMetaFromGlibFull is used to convert raw C.GstReferenceTimestampMeta pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeReferenceTimestampMetaFromGlibFull(p unsafe.Pointer) *ReferenceTimestampMeta {
wrapped := UnsafeReferenceTimestampMetaFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.referenceTimestampMeta,
func (intern *referenceTimestampMeta) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeReferenceTimestampMetaFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ReferenceTimestampMeta] is expected to work anymore.
func UnsafeReferenceTimestampMetaFree(r *ReferenceTimestampMeta) {
C.free(unsafe.Pointer(r.native))
}
// UnsafeReferenceTimestampMetaToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeReferenceTimestampMetaToGlibNone(r *ReferenceTimestampMeta) unsafe.Pointer {
return unsafe.Pointer(r.native)
}
// UnsafeReferenceTimestampMetaToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeReferenceTimestampMetaToGlibFull(r *ReferenceTimestampMeta) unsafe.Pointer {
runtime.SetFinalizer(r.referenceTimestampMeta, nil)
_p := unsafe.Pointer(r.native)
r.native = nil // ReferenceTimestampMeta is invalid from here on
return _p
}
// RegistryClass wraps GstRegistryClass
type RegistryClass struct {
*registryClass
}
// registryClass is the struct that's finalized
type registryClass struct {
native *C.GstRegistryClass
}
// UnsafeRegistryClassFromGlibBorrow is used to convert raw C.GstRegistryClass pointers to go. This is used by the bindings internally.
func UnsafeRegistryClassFromGlibBorrow(p unsafe.Pointer) *RegistryClass {
return &RegistryClass{&registryClass{(*C.GstRegistryClass)(p)}}
}
// UnsafeRegistryClassFromGlibNone is used to convert raw C.GstRegistryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeRegistryClassFromGlibNone(p unsafe.Pointer) *RegistryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeRegistryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.registryClass,
func (intern *registryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeRegistryClassFromGlibFull is used to convert raw C.GstRegistryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeRegistryClassFromGlibFull(p unsafe.Pointer) *RegistryClass {
wrapped := UnsafeRegistryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.registryClass,
func (intern *registryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeRegistryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [RegistryClass] is expected to work anymore.
func UnsafeRegistryClassFree(r *RegistryClass) {
C.free(unsafe.Pointer(r.native))
}
// UnsafeRegistryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeRegistryClassToGlibNone(r *RegistryClass) unsafe.Pointer {
return unsafe.Pointer(r.native)
}
// UnsafeRegistryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeRegistryClassToGlibFull(r *RegistryClass) unsafe.Pointer {
runtime.SetFinalizer(r.registryClass, nil)
_p := unsafe.Pointer(r.native)
r.native = nil // RegistryClass is invalid from here on
return _p
}
// Sample wraps GstSample
//
// A #GstSample is a small object containing data, a type, timing and
// extra arbitrary information.
type Sample struct {
*sample
}
// sample is the struct that's finalized
type sample struct {
native *C.GstSample
}
var _ gobject.GoValueInitializer = (*Sample)(nil)
func marshalSample(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeSampleFromGlibBorrow(b), nil
}
func (r *Sample) InitGoValue(v *gobject.Value) {
v.Init(TypeSample)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeSampleFromGlibBorrow is used to convert raw C.GstSample pointers to go. This is used by the bindings internally.
func UnsafeSampleFromGlibBorrow(p unsafe.Pointer) *Sample {
return &Sample{&sample{(*C.GstSample)(p)}}
}
// UnsafeSampleFromGlibNone is used to convert raw C.GstSample pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSampleFromGlibNone(p unsafe.Pointer) *Sample {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeSampleFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.sample,
func (intern *sample) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSampleFromGlibFull is used to convert raw C.GstSample pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSampleFromGlibFull(p unsafe.Pointer) *Sample {
wrapped := UnsafeSampleFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.sample,
func (intern *sample) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSampleFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Sample] is expected to work anymore.
func UnsafeSampleFree(s *Sample) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeSampleToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeSampleToGlibNone(s *Sample) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeSampleToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeSampleToGlibFull(s *Sample) unsafe.Pointer {
runtime.SetFinalizer(s.sample, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // Sample is invalid from here on
return _p
}
// NewSample wraps gst_sample_new
//
// The function takes the following parameters:
//
// - buffer *Buffer (nullable): a #GstBuffer, or %NULL
// - caps *Caps (nullable): a #GstCaps, or %NULL
// - segment *Segment (nullable): a #GstSegment, or %NULL
// - info *Structure (nullable): a #GstStructure, or %NULL
//
// The function returns the following values:
//
// - goret *Sample
//
// Create a new #GstSample with the provided details.
//
// Free-function: gst_sample_unref
func NewSample(buffer *Buffer, caps *Caps, segment *Segment, info *Structure) *Sample {
var carg1 *C.GstBuffer // in, none, converted, nullable
var carg2 *C.GstCaps // in, none, converted, nullable
var carg3 *C.GstSegment // in, none, converted, nullable
var carg4 *C.GstStructure // in, full, converted, nullable
var cret *C.GstSample // return, full, converted
if buffer != nil {
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
}
if caps != nil {
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
}
if segment != nil {
carg3 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
}
if info != nil {
carg4 = (*C.GstStructure)(UnsafeStructureToGlibFull(info))
}
cret = C.gst_sample_new(carg1, carg2, carg3, carg4)
runtime.KeepAlive(buffer)
runtime.KeepAlive(caps)
runtime.KeepAlive(segment)
runtime.KeepAlive(info)
var goret *Sample
goret = UnsafeSampleFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetBuffer wraps gst_sample_get_buffer
// The function returns the following values:
//
// - goret *Buffer
//
// Get the buffer associated with @sample
func (sample *Sample) GetBuffer() *Buffer {
var carg0 *C.GstSample // in, none, converted
var cret *C.GstBuffer // return, borrow, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
cret = C.gst_sample_get_buffer(carg0)
runtime.KeepAlive(sample)
var goret *Buffer
goret = UnsafeBufferFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Sample) {}, sample)
return goret
}
// GetBufferList wraps gst_sample_get_buffer_list
// The function returns the following values:
//
// - goret *BufferList
//
// Get the buffer list associated with @sample
func (sample *Sample) GetBufferList() *BufferList {
var carg0 *C.GstSample // in, none, converted
var cret *C.GstBufferList // return, borrow, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
cret = C.gst_sample_get_buffer_list(carg0)
runtime.KeepAlive(sample)
var goret *BufferList
goret = UnsafeBufferListFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Sample) {}, sample)
return goret
}
// GetCaps wraps gst_sample_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Get the caps associated with @sample
func (sample *Sample) GetCaps() *Caps {
var carg0 *C.GstSample // in, none, converted
var cret *C.GstCaps // return, borrow, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
cret = C.gst_sample_get_caps(carg0)
runtime.KeepAlive(sample)
var goret *Caps
goret = UnsafeCapsFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Sample) {}, sample)
return goret
}
// GetInfo wraps gst_sample_get_info
// The function returns the following values:
//
// - goret *Structure
//
// Get extra information associated with @sample.
func (sample *Sample) GetInfo() *Structure {
var carg0 *C.GstSample // in, none, converted
var cret *C.GstStructure // return, borrow, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
cret = C.gst_sample_get_info(carg0)
runtime.KeepAlive(sample)
var goret *Structure
goret = UnsafeStructureFromGlibBorrow(unsafe.Pointer(cret))
runtime.AddCleanup(goret, func(_ *Sample) {}, sample)
return goret
}
// GetSegment wraps gst_sample_get_segment
// The function returns the following values:
//
// - goret *Segment
//
// Get the segment associated with @sample
func (sample *Sample) GetSegment() *Segment {
var carg0 *C.GstSample // in, none, converted
var cret *C.GstSegment // return, none, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
cret = C.gst_sample_get_segment(carg0)
runtime.KeepAlive(sample)
var goret *Segment
goret = UnsafeSegmentFromGlibNone(unsafe.Pointer(cret))
return goret
}
// SetBuffer wraps gst_sample_set_buffer
//
// The function takes the following parameters:
//
// - buffer *Buffer: A #GstBuffer
//
// Set the buffer associated with @sample. @sample must be writable.
func (sample *Sample) SetBuffer(buffer *Buffer) {
var carg0 *C.GstSample // in, none, converted
var carg1 *C.GstBuffer // in, none, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
carg1 = (*C.GstBuffer)(UnsafeBufferToGlibNone(buffer))
C.gst_sample_set_buffer(carg0, carg1)
runtime.KeepAlive(sample)
runtime.KeepAlive(buffer)
}
// SetBufferList wraps gst_sample_set_buffer_list
//
// The function takes the following parameters:
//
// - bufferList *BufferList: a #GstBufferList
//
// Set the buffer list associated with @sample. @sample must be writable.
func (sample *Sample) SetBufferList(bufferList *BufferList) {
var carg0 *C.GstSample // in, none, converted
var carg1 *C.GstBufferList // in, none, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
carg1 = (*C.GstBufferList)(UnsafeBufferListToGlibNone(bufferList))
C.gst_sample_set_buffer_list(carg0, carg1)
runtime.KeepAlive(sample)
runtime.KeepAlive(bufferList)
}
// SetCaps wraps gst_sample_set_caps
//
// The function takes the following parameters:
//
// - caps *Caps: A #GstCaps
//
// Set the caps associated with @sample. @sample must be writable.
func (sample *Sample) SetCaps(caps *Caps) {
var carg0 *C.GstSample // in, none, converted
var carg1 *C.GstCaps // in, none, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
carg1 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
C.gst_sample_set_caps(carg0, carg1)
runtime.KeepAlive(sample)
runtime.KeepAlive(caps)
}
// SetInfo wraps gst_sample_set_info
//
// The function takes the following parameters:
//
// - info *Structure: A #GstStructure
//
// The function returns the following values:
//
// - goret bool
//
// Set the info structure associated with @sample. @sample must be writable,
// and @info must not have a parent set already.
func (sample *Sample) SetInfo(info *Structure) bool {
var carg0 *C.GstSample // in, none, converted
var carg1 *C.GstStructure // in, full, converted
var cret C.gboolean // return
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibFull(info))
cret = C.gst_sample_set_info(carg0, carg1)
runtime.KeepAlive(sample)
runtime.KeepAlive(info)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetSegment wraps gst_sample_set_segment
//
// The function takes the following parameters:
//
// - segment *Segment: A #GstSegment
//
// Set the segment associated with @sample. @sample must be writable.
func (sample *Sample) SetSegment(segment *Segment) {
var carg0 *C.GstSample // in, none, converted
var carg1 *C.GstSegment // in, none, converted
carg0 = (*C.GstSample)(UnsafeSampleToGlibNone(sample))
carg1 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
C.gst_sample_set_segment(carg0, carg1)
runtime.KeepAlive(sample)
runtime.KeepAlive(segment)
}
// Segment wraps GstSegment
//
// This helper structure holds the relevant values for tracking the region of
// interest in a media file, called a segment.
//
// The structure can be used for two purposes:
//
// * performing seeks (handling seek events)
// * tracking playback regions (handling newsegment events)
//
// The segment is usually configured by the application with a seek event which
// is propagated upstream and eventually handled by an element that performs the seek.
//
// The configured segment is then propagated back downstream with a newsegment event.
// This information is then used to clip media to the segment boundaries.
//
// A segment structure is initialized with gst_segment_init(), which takes a #GstFormat
// that will be used as the format of the segment values. The segment will be configured
// with a start value of 0 and a stop/duration of -1, which is undefined. The default
// rate and applied_rate is 1.0.
//
// The public duration field contains the duration of the segment. When using
// the segment for seeking, the start and time members should normally be left
// to their default 0 value. The stop position is left to -1 unless explicitly
// configured to a different value after a seek event.
//
// The current position in the segment should be set by changing the position
// member in the structure.
//
// For elements that perform seeks, the current segment should be updated with the
// gst_segment_do_seek() and the values from the seek event. This method will update
// all the segment fields. The position field will contain the new playback position.
// If the start_type was different from GST_SEEK_TYPE_NONE, playback continues from
// the position position, possibly with updated flags or rate.
//
// For elements that want to use #GstSegment to track the playback region,
// update the segment fields with the information from the newsegment event.
// The gst_segment_clip() method can be used to check and clip
// the media data to the segment boundaries.
//
// For elements that want to synchronize to the pipeline clock, gst_segment_to_running_time()
// can be used to convert a timestamp to a value that can be used to synchronize
// to the clock. This function takes into account the base as well as
// any rate or applied_rate conversions.
//
// For elements that need to perform operations on media data in stream_time,
// gst_segment_to_stream_time() can be used to convert a timestamp and the segment
// info to stream time (which is always between 0 and the duration of the stream).
type Segment struct {
*segment
}
// segment is the struct that's finalized
type segment struct {
native *C.GstSegment
}
var _ gobject.GoValueInitializer = (*Segment)(nil)
func marshalSegment(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeSegmentFromGlibBorrow(b), nil
}
func (r *Segment) InitGoValue(v *gobject.Value) {
v.Init(TypeSegment)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeSegmentFromGlibBorrow is used to convert raw C.GstSegment pointers to go. This is used by the bindings internally.
func UnsafeSegmentFromGlibBorrow(p unsafe.Pointer) *Segment {
return &Segment{&segment{(*C.GstSegment)(p)}}
}
// UnsafeSegmentFromGlibNone is used to convert raw C.GstSegment pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSegmentFromGlibNone(p unsafe.Pointer) *Segment {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeSegmentFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.segment,
func (intern *segment) {
C.gst_segment_free(intern.native)
},
)
return wrapped
}
// UnsafeSegmentFromGlibFull is used to convert raw C.GstSegment pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSegmentFromGlibFull(p unsafe.Pointer) *Segment {
wrapped := UnsafeSegmentFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.segment,
func (intern *segment) {
C.gst_segment_free(intern.native)
},
)
return wrapped
}
// UnsafeSegmentFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Segment] is expected to work anymore.
func UnsafeSegmentFree(s *Segment) {
C.gst_segment_free(s.native)
}
// UnsafeSegmentToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeSegmentToGlibNone(s *Segment) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeSegmentToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeSegmentToGlibFull(s *Segment) unsafe.Pointer {
runtime.SetFinalizer(s.segment, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // Segment is invalid from here on
return _p
}
// NewSegment wraps gst_segment_new
// The function returns the following values:
//
// - goret *Segment
//
// Allocate a new #GstSegment structure and initialize it using
// gst_segment_init().
//
// Free-function: gst_segment_free
func NewSegment() *Segment {
var cret *C.GstSegment // return, full, converted
cret = C.gst_segment_new()
var goret *Segment
goret = UnsafeSegmentFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Clip wraps gst_segment_clip
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - start uint64: the start position in the segment
// - stop uint64: the stop position in the segment
//
// The function returns the following values:
//
// - clipStart uint64: the clipped start position in the segment
// - clipStop uint64: the clipped stop position in the segment
// - goret bool
//
// Clip the given @start and @stop values to the segment boundaries given
// in @segment. @start and @stop are compared and clipped to @segment
// start and stop values.
//
// If the function returns %FALSE, @start and @stop are known to fall
// outside of @segment and @clip_start and @clip_stop are not updated.
//
// When the function returns %TRUE, @clip_start and @clip_stop will be
// updated. If @clip_start or @clip_stop are different from @start or @stop
// respectively, the region fell partially in the segment.
//
// Note that when @stop is -1, @clip_stop will be set to the end of the
// segment. Depending on the use case, this may or may not be what you want.
func (segment *Segment) Clip(format Format, start uint64, stop uint64) (uint64, uint64, bool) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // in, none, casted
var carg4 C.guint64 // out, full, casted
var carg5 C.guint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(start)
carg3 = C.guint64(stop)
cret = C.gst_segment_clip(carg0, carg1, carg2, carg3, &carg4, &carg5)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(start)
runtime.KeepAlive(stop)
var clipStart uint64
var clipStop uint64
var goret bool
clipStart = uint64(carg4)
clipStop = uint64(carg5)
if cret != 0 {
goret = true
}
return clipStart, clipStop, goret
}
// Copy wraps gst_segment_copy
// The function returns the following values:
//
// - goret *Segment
//
// Create a copy of given @segment.
//
// Free-function: gst_segment_free
func (segment *Segment) Copy() *Segment {
var carg0 *C.GstSegment // in, none, converted
var cret *C.GstSegment // return, full, converted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
cret = C.gst_segment_copy(carg0)
runtime.KeepAlive(segment)
var goret *Segment
goret = UnsafeSegmentFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CopyInto wraps gst_segment_copy_into
//
// The function takes the following parameters:
//
// - dest *Segment: a #GstSegment
//
// Copy the contents of @src into @dest.
func (src *Segment) CopyInto(dest *Segment) {
var carg0 *C.GstSegment // in, none, converted
var carg1 *C.GstSegment // in, none, converted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(src))
carg1 = (*C.GstSegment)(UnsafeSegmentToGlibNone(dest))
C.gst_segment_copy_into(carg0, carg1)
runtime.KeepAlive(src)
runtime.KeepAlive(dest)
}
// DoSeek wraps gst_segment_do_seek
//
// The function takes the following parameters:
//
// - rate float64: the rate of the segment.
// - format Format: the format of the segment.
// - flags SeekFlags: the segment flags for the segment
// - startType SeekType: the seek method
// - start uint64: the seek start value
// - stopType SeekType: the seek method
// - stop uint64: the seek stop value
//
// The function returns the following values:
//
// - update bool: boolean holding whether position was updated.
// - goret bool
//
// Update the segment structure with the field values of a seek event (see
// gst_event_new_seek()).
//
// After calling this method, the segment field position and time will
// contain the requested new position in the segment. The new requested
// position in the segment depends on @rate and @start_type and @stop_type.
//
// For positive @rate, the new position in the segment is the new @segment
// start field when it was updated with a @start_type different from
// #GST_SEEK_TYPE_NONE. If no update was performed on @segment start position
// (#GST_SEEK_TYPE_NONE), @start is ignored and @segment position is
// unmodified.
//
// For negative @rate, the new position in the segment is the new @segment
// stop field when it was updated with a @stop_type different from
// #GST_SEEK_TYPE_NONE. If no stop was previously configured in the segment, the
// duration of the segment will be used to update the stop position.
// If no update was performed on @segment stop position (#GST_SEEK_TYPE_NONE),
// @stop is ignored and @segment position is unmodified.
//
// The applied rate of the segment will be set to 1.0 by default.
// If the caller can apply a rate change, it should update @segment
// rate and applied_rate after calling this function.
//
// @update will be set to %TRUE if a seek should be performed to the segment
// position field. This field can be %FALSE if, for example, only the @rate
// has been changed but not the playback position.
func (segment *Segment) DoSeek(rate float64, format Format, flags SeekFlags, startType SeekType, start uint64, stopType SeekType, stop uint64) (bool, bool) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.gdouble // in, none, casted
var carg2 C.GstFormat // in, none, casted
var carg3 C.GstSeekFlags // in, none, casted
var carg4 C.GstSeekType // in, none, casted
var carg5 C.guint64 // in, none, casted
var carg6 C.GstSeekType // in, none, casted
var carg7 C.guint64 // in, none, casted
var carg8 C.gboolean // out
var cret C.gboolean // return
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.gdouble(rate)
carg2 = C.GstFormat(format)
carg3 = C.GstSeekFlags(flags)
carg4 = C.GstSeekType(startType)
carg5 = C.guint64(start)
carg6 = C.GstSeekType(stopType)
carg7 = C.guint64(stop)
cret = C.gst_segment_do_seek(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7, &carg8)
runtime.KeepAlive(segment)
runtime.KeepAlive(rate)
runtime.KeepAlive(format)
runtime.KeepAlive(flags)
runtime.KeepAlive(startType)
runtime.KeepAlive(start)
runtime.KeepAlive(stopType)
runtime.KeepAlive(stop)
var update bool
var goret bool
if carg8 != 0 {
update = true
}
if cret != 0 {
goret = true
}
return update, goret
}
// Init wraps gst_segment_init
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
//
// The start/position fields are set to 0 and the stop/duration
// fields are set to -1 (unknown). The default rate of 1.0 and no
// flags are set.
//
// Initialize @segment to its default values.
func (segment *Segment) Init(format Format) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
C.gst_segment_init(carg0, carg1)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
}
// IsEqual wraps gst_segment_is_equal
//
// The function takes the following parameters:
//
// - s1 *Segment: a #GstSegment structure.
//
// The function returns the following values:
//
// - goret bool
//
// Checks for two segments being equal. Equality here is defined
// as perfect equality, including floating point values.
func (s0 *Segment) IsEqual(s1 *Segment) bool {
var carg0 *C.GstSegment // in, none, converted
var carg1 *C.GstSegment // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(s0))
carg1 = (*C.GstSegment)(UnsafeSegmentToGlibNone(s1))
cret = C.gst_segment_is_equal(carg0, carg1)
runtime.KeepAlive(s0)
runtime.KeepAlive(s1)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// OffsetRunningTime wraps gst_segment_offset_running_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - offset int64: the offset to apply in the segment
//
// The function returns the following values:
//
// - goret bool
//
// Adjust the values in @segment so that @offset is applied to all
// future running-time calculations.
func (segment *Segment) OffsetRunningTime(format Format, offset int64) bool {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.gint64 // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.gint64(offset)
cret = C.gst_segment_offset_running_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(offset)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// PositionFromRunningTime wraps gst_segment_position_from_running_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - runningTime uint64: the running_time in the segment
//
// The function returns the following values:
//
// - goret uint64
//
// Convert @running_time into a position in the segment so that
// gst_segment_to_running_time() with that position returns @running_time.
func (segment *Segment) PositionFromRunningTime(format Format, runningTime uint64) uint64 {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(runningTime)
cret = C.gst_segment_position_from_running_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(runningTime)
var goret uint64
goret = uint64(cret)
return goret
}
// PositionFromRunningTimeFull wraps gst_segment_position_from_running_time_full
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - runningTime uint64: the running-time
//
// The function returns the following values:
//
// - position uint64: the resulting position in the segment
// - goret int
//
// Translate @running_time to the segment position using the currently configured
// segment. Compared to gst_segment_position_from_running_time() this function can
// return negative segment position.
//
// This function is typically used by elements that need to synchronize buffers
// against the clock or each other.
//
// @running_time can be any value and the result of this function for values
// outside of the segment is extrapolated.
//
// When 1 is returned, @running_time resulted in a positive position returned
// in @position.
//
// When this function returns -1, the returned @position was &lt; 0, and the value
// in the position variable should be negated to get the real negative segment
// position.
func (segment *Segment) PositionFromRunningTimeFull(format Format, runningTime uint64) (uint64, int) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // out, full, casted
var cret C.gint // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(runningTime)
cret = C.gst_segment_position_from_running_time_full(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(runningTime)
var position uint64
var goret int
position = uint64(carg3)
goret = int(cret)
return position, goret
}
// PositionFromStreamTime wraps gst_segment_position_from_stream_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - streamTime uint64: the stream_time in the segment
//
// The function returns the following values:
//
// - goret uint64
//
// Convert @stream_time into a position in the segment so that
// gst_segment_to_stream_time() with that position returns @stream_time.
func (segment *Segment) PositionFromStreamTime(format Format, streamTime uint64) uint64 {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(streamTime)
cret = C.gst_segment_position_from_stream_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(streamTime)
var goret uint64
goret = uint64(cret)
return goret
}
// PositionFromStreamTimeFull wraps gst_segment_position_from_stream_time_full
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - streamTime uint64: the stream-time
//
// The function returns the following values:
//
// - position uint64: the resulting position in the segment
// - goret int
//
// Translate @stream_time to the segment position using the currently configured
// segment. Compared to gst_segment_position_from_stream_time() this function can
// return negative segment position.
//
// This function is typically used by elements that need to synchronize buffers
// against the clock or each other.
//
// @stream_time can be any value and the result of this function for values outside
// of the segment is extrapolated.
//
// When 1 is returned, @stream_time resulted in a positive position returned
// in @position.
//
// When this function returns -1, the returned @position should be negated
// to get the real negative segment position.
func (segment *Segment) PositionFromStreamTimeFull(format Format, streamTime uint64) (uint64, int) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // out, full, casted
var cret C.gint // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(streamTime)
cret = C.gst_segment_position_from_stream_time_full(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(streamTime)
var position uint64
var goret int
position = uint64(carg3)
goret = int(cret)
return position, goret
}
// SetRunningTime wraps gst_segment_set_running_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - runningTime uint64: the running_time in the segment
//
// The function returns the following values:
//
// - goret bool
//
// Adjust the start/stop and base values of @segment such that the next valid
// buffer will be one with @running_time.
func (segment *Segment) SetRunningTime(format Format, runningTime uint64) bool {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(runningTime)
cret = C.gst_segment_set_running_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(runningTime)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ToPosition wraps gst_segment_to_position
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - runningTime uint64: the running_time in the segment
//
// The function returns the following values:
//
// - goret uint64
//
// Convert @running_time into a position in the segment so that
// gst_segment_to_running_time() with that position returns @running_time.
//
// Deprecated: Use gst_segment_position_from_running_time() instead.
func (segment *Segment) ToPosition(format Format, runningTime uint64) uint64 {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(runningTime)
cret = C.gst_segment_to_position(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(runningTime)
var goret uint64
goret = uint64(cret)
return goret
}
// ToRunningTime wraps gst_segment_to_running_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - position uint64: the position in the segment
//
// The function returns the following values:
//
// - goret uint64
//
// Translate @position to the total running time using the currently configured
// segment. Position is a value between @segment start and stop time.
//
// This function is typically used by elements that need to synchronize to the
// global clock in a pipeline. The running time is a constantly increasing value
// starting from 0. When gst_segment_init() is called, this value will reset to
// 0.
//
// This function returns -1 if the position is outside of @segment start and stop.
func (segment *Segment) ToRunningTime(format Format, position uint64) uint64 {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(position)
cret = C.gst_segment_to_running_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var goret uint64
goret = uint64(cret)
return goret
}
// ToRunningTimeFull wraps gst_segment_to_running_time_full
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - position uint64: the position in the segment
//
// The function returns the following values:
//
// - runningTime uint64: result running-time
// - goret int
//
// Translate @position to the total running time using the currently configured
// segment. Compared to gst_segment_to_running_time() this function can return
// negative running-time.
//
// This function is typically used by elements that need to synchronize buffers
// against the clock or each other.
//
// @position can be any value and the result of this function for values outside
// of the segment is extrapolated.
//
// When 1 is returned, @position resulted in a positive running-time returned
// in @running_time.
//
// When this function returns -1, the returned @running_time should be negated
// to get the real negative running time.
func (segment *Segment) ToRunningTimeFull(format Format, position uint64) (uint64, int) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // out, full, casted
var cret C.gint // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(position)
cret = C.gst_segment_to_running_time_full(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var runningTime uint64
var goret int
runningTime = uint64(carg3)
goret = int(cret)
return runningTime, goret
}
// ToStreamTime wraps gst_segment_to_stream_time
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - position uint64: the position in the segment
//
// The function returns the following values:
//
// - goret uint64
//
// Translate @position to stream time using the currently configured
// segment. The @position value must be between @segment start and
// stop value.
//
// This function is typically used by elements that need to operate on
// the stream time of the buffers it receives, such as effect plugins.
// In those use cases, @position is typically the buffer timestamp or
// clock time that one wants to convert to the stream time.
// The stream time is always between 0 and the total duration of the
// media stream.
func (segment *Segment) ToStreamTime(format Format, position uint64) uint64 {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(position)
cret = C.gst_segment_to_stream_time(carg0, carg1, carg2)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var goret uint64
goret = uint64(cret)
return goret
}
// ToStreamTimeFull wraps gst_segment_to_stream_time_full
//
// The function takes the following parameters:
//
// - format Format: the format of the segment.
// - position uint64: the position in the segment
//
// The function returns the following values:
//
// - streamTime uint64: result stream-time
// - goret int
//
// Translate @position to the total stream time using the currently configured
// segment. Compared to gst_segment_to_stream_time() this function can return
// negative stream-time.
//
// This function is typically used by elements that need to synchronize buffers
// against the clock or each other.
//
// @position can be any value and the result of this function for values outside
// of the segment is extrapolated.
//
// When 1 is returned, @position resulted in a positive stream-time returned
// in @stream_time.
//
// When this function returns -1, the returned @stream_time should be negated
// to get the real negative stream time.
func (segment *Segment) ToStreamTimeFull(format Format, position uint64) (uint64, int) {
var carg0 *C.GstSegment // in, none, converted
var carg1 C.GstFormat // in, none, casted
var carg2 C.guint64 // in, none, casted
var carg3 C.guint64 // out, full, casted
var cret C.gint // return, none, casted
carg0 = (*C.GstSegment)(UnsafeSegmentToGlibNone(segment))
carg1 = C.GstFormat(format)
carg2 = C.guint64(position)
cret = C.gst_segment_to_stream_time_full(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(segment)
runtime.KeepAlive(format)
runtime.KeepAlive(position)
var streamTime uint64
var goret int
streamTime = uint64(carg3)
goret = int(cret)
return streamTime, goret
}
// SharedTaskPoolClass wraps GstSharedTaskPoolClass
//
// The #GstSharedTaskPoolClass object.
type SharedTaskPoolClass struct {
*sharedTaskPoolClass
}
// sharedTaskPoolClass is the struct that's finalized
type sharedTaskPoolClass struct {
native *C.GstSharedTaskPoolClass
}
// UnsafeSharedTaskPoolClassFromGlibBorrow is used to convert raw C.GstSharedTaskPoolClass pointers to go. This is used by the bindings internally.
func UnsafeSharedTaskPoolClassFromGlibBorrow(p unsafe.Pointer) *SharedTaskPoolClass {
return &SharedTaskPoolClass{&sharedTaskPoolClass{(*C.GstSharedTaskPoolClass)(p)}}
}
// UnsafeSharedTaskPoolClassFromGlibNone is used to convert raw C.GstSharedTaskPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSharedTaskPoolClassFromGlibNone(p unsafe.Pointer) *SharedTaskPoolClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeSharedTaskPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.sharedTaskPoolClass,
func (intern *sharedTaskPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSharedTaskPoolClassFromGlibFull is used to convert raw C.GstSharedTaskPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSharedTaskPoolClassFromGlibFull(p unsafe.Pointer) *SharedTaskPoolClass {
wrapped := UnsafeSharedTaskPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.sharedTaskPoolClass,
func (intern *sharedTaskPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSharedTaskPoolClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [SharedTaskPoolClass] is expected to work anymore.
func UnsafeSharedTaskPoolClassFree(s *SharedTaskPoolClass) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeSharedTaskPoolClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeSharedTaskPoolClassToGlibNone(s *SharedTaskPoolClass) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeSharedTaskPoolClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeSharedTaskPoolClassToGlibFull(s *SharedTaskPoolClass) unsafe.Pointer {
runtime.SetFinalizer(s.sharedTaskPoolClass, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // SharedTaskPoolClass is invalid from here on
return _p
}
// StaticCaps wraps GstStaticCaps
//
// Data structure to initialize #GstCaps from a string description usually
// used in conjunction with GST_STATIC_CAPS() and gst_static_caps_get() to
// instantiate a #GstCaps.
type StaticCaps struct {
*staticCaps
}
// staticCaps is the struct that's finalized
type staticCaps struct {
native *C.GstStaticCaps
}
var _ gobject.GoValueInitializer = (*StaticCaps)(nil)
func marshalStaticCaps(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeStaticCapsFromGlibBorrow(b), nil
}
func (r *StaticCaps) InitGoValue(v *gobject.Value) {
v.Init(TypeStaticCaps)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeStaticCapsFromGlibBorrow is used to convert raw C.GstStaticCaps pointers to go. This is used by the bindings internally.
func UnsafeStaticCapsFromGlibBorrow(p unsafe.Pointer) *StaticCaps {
return &StaticCaps{&staticCaps{(*C.GstStaticCaps)(p)}}
}
// UnsafeStaticCapsFromGlibNone is used to convert raw C.GstStaticCaps pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStaticCapsFromGlibNone(p unsafe.Pointer) *StaticCaps {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeStaticCapsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.staticCaps,
func (intern *staticCaps) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStaticCapsFromGlibFull is used to convert raw C.GstStaticCaps pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStaticCapsFromGlibFull(p unsafe.Pointer) *StaticCaps {
wrapped := UnsafeStaticCapsFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.staticCaps,
func (intern *staticCaps) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStaticCapsFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [StaticCaps] is expected to work anymore.
func UnsafeStaticCapsFree(s *StaticCaps) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeStaticCapsToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeStaticCapsToGlibNone(s *StaticCaps) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeStaticCapsToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeStaticCapsToGlibFull(s *StaticCaps) unsafe.Pointer {
runtime.SetFinalizer(s.staticCaps, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // StaticCaps is invalid from here on
return _p
}
// Cleanup wraps gst_static_caps_cleanup
//
// Cleans up the cached caps contained in @static_caps.
func (staticCaps *StaticCaps) Cleanup() {
var carg0 *C.GstStaticCaps // in, none, converted
carg0 = (*C.GstStaticCaps)(UnsafeStaticCapsToGlibNone(staticCaps))
C.gst_static_caps_cleanup(carg0)
runtime.KeepAlive(staticCaps)
}
// Get wraps gst_static_caps_get
// The function returns the following values:
//
// - goret *Caps
//
// Converts a #GstStaticCaps to a #GstCaps.
func (staticCaps *StaticCaps) Get() *Caps {
var carg0 *C.GstStaticCaps // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstStaticCaps)(UnsafeStaticCapsToGlibNone(staticCaps))
cret = C.gst_static_caps_get(carg0)
runtime.KeepAlive(staticCaps)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// StaticPadTemplate wraps GstStaticPadTemplate
//
// Structure describing the #GstStaticPadTemplate.
type StaticPadTemplate struct {
*staticPadTemplate
}
// staticPadTemplate is the struct that's finalized
type staticPadTemplate struct {
native *C.GstStaticPadTemplate
}
var _ gobject.GoValueInitializer = (*StaticPadTemplate)(nil)
func marshalStaticPadTemplate(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeStaticPadTemplateFromGlibBorrow(b), nil
}
func (r *StaticPadTemplate) InitGoValue(v *gobject.Value) {
v.Init(TypeStaticPadTemplate)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeStaticPadTemplateFromGlibBorrow is used to convert raw C.GstStaticPadTemplate pointers to go. This is used by the bindings internally.
func UnsafeStaticPadTemplateFromGlibBorrow(p unsafe.Pointer) *StaticPadTemplate {
return &StaticPadTemplate{&staticPadTemplate{(*C.GstStaticPadTemplate)(p)}}
}
// UnsafeStaticPadTemplateFromGlibNone is used to convert raw C.GstStaticPadTemplate pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStaticPadTemplateFromGlibNone(p unsafe.Pointer) *StaticPadTemplate {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeStaticPadTemplateFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.staticPadTemplate,
func (intern *staticPadTemplate) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStaticPadTemplateFromGlibFull is used to convert raw C.GstStaticPadTemplate pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStaticPadTemplateFromGlibFull(p unsafe.Pointer) *StaticPadTemplate {
wrapped := UnsafeStaticPadTemplateFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.staticPadTemplate,
func (intern *staticPadTemplate) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStaticPadTemplateFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [StaticPadTemplate] is expected to work anymore.
func UnsafeStaticPadTemplateFree(s *StaticPadTemplate) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeStaticPadTemplateToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeStaticPadTemplateToGlibNone(s *StaticPadTemplate) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeStaticPadTemplateToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeStaticPadTemplateToGlibFull(s *StaticPadTemplate) unsafe.Pointer {
runtime.SetFinalizer(s.staticPadTemplate, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // StaticPadTemplate is invalid from here on
return _p
}
// Get wraps gst_static_pad_template_get
// The function returns the following values:
//
// - goret PadTemplate
//
// Converts a #GstStaticPadTemplate into a #GstPadTemplate.
func (padTemplate *StaticPadTemplate) Get() PadTemplate {
var carg0 *C.GstStaticPadTemplate // in, none, converted
var cret *C.GstPadTemplate // return, none, converted
carg0 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(padTemplate))
cret = C.gst_static_pad_template_get(carg0)
runtime.KeepAlive(padTemplate)
var goret PadTemplate
goret = UnsafePadTemplateFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetCaps wraps gst_static_pad_template_get_caps
// The function returns the following values:
//
// - goret *Caps
//
// Gets the capabilities of the static pad template.
func (templ *StaticPadTemplate) GetCaps() *Caps {
var carg0 *C.GstStaticPadTemplate // in, none, converted
var cret *C.GstCaps // return, full, converted
carg0 = (*C.GstStaticPadTemplate)(UnsafeStaticPadTemplateToGlibNone(templ))
cret = C.gst_static_pad_template_get_caps(carg0)
runtime.KeepAlive(templ)
var goret *Caps
goret = UnsafeCapsFromGlibFull(unsafe.Pointer(cret))
return goret
}
// StreamClass wraps GstStreamClass
//
// GstStream class structure
type StreamClass struct {
*streamClass
}
// streamClass is the struct that's finalized
type streamClass struct {
native *C.GstStreamClass
}
// UnsafeStreamClassFromGlibBorrow is used to convert raw C.GstStreamClass pointers to go. This is used by the bindings internally.
func UnsafeStreamClassFromGlibBorrow(p unsafe.Pointer) *StreamClass {
return &StreamClass{&streamClass{(*C.GstStreamClass)(p)}}
}
// UnsafeStreamClassFromGlibNone is used to convert raw C.GstStreamClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStreamClassFromGlibNone(p unsafe.Pointer) *StreamClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeStreamClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.streamClass,
func (intern *streamClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStreamClassFromGlibFull is used to convert raw C.GstStreamClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStreamClassFromGlibFull(p unsafe.Pointer) *StreamClass {
wrapped := UnsafeStreamClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.streamClass,
func (intern *streamClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStreamClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [StreamClass] is expected to work anymore.
func UnsafeStreamClassFree(s *StreamClass) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeStreamClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeStreamClassToGlibNone(s *StreamClass) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeStreamClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeStreamClassToGlibFull(s *StreamClass) unsafe.Pointer {
runtime.SetFinalizer(s.streamClass, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // StreamClass is invalid from here on
return _p
}
// StreamCollectionClass wraps GstStreamCollectionClass
//
// GstStreamCollection class structure
type StreamCollectionClass struct {
*streamCollectionClass
}
// streamCollectionClass is the struct that's finalized
type streamCollectionClass struct {
native *C.GstStreamCollectionClass
}
// UnsafeStreamCollectionClassFromGlibBorrow is used to convert raw C.GstStreamCollectionClass pointers to go. This is used by the bindings internally.
func UnsafeStreamCollectionClassFromGlibBorrow(p unsafe.Pointer) *StreamCollectionClass {
return &StreamCollectionClass{&streamCollectionClass{(*C.GstStreamCollectionClass)(p)}}
}
// UnsafeStreamCollectionClassFromGlibNone is used to convert raw C.GstStreamCollectionClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStreamCollectionClassFromGlibNone(p unsafe.Pointer) *StreamCollectionClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeStreamCollectionClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.streamCollectionClass,
func (intern *streamCollectionClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStreamCollectionClassFromGlibFull is used to convert raw C.GstStreamCollectionClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStreamCollectionClassFromGlibFull(p unsafe.Pointer) *StreamCollectionClass {
wrapped := UnsafeStreamCollectionClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.streamCollectionClass,
func (intern *streamCollectionClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeStreamCollectionClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [StreamCollectionClass] is expected to work anymore.
func UnsafeStreamCollectionClassFree(s *StreamCollectionClass) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeStreamCollectionClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeStreamCollectionClassToGlibNone(s *StreamCollectionClass) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeStreamCollectionClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeStreamCollectionClassToGlibFull(s *StreamCollectionClass) unsafe.Pointer {
runtime.SetFinalizer(s.streamCollectionClass, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // StreamCollectionClass is invalid from here on
return _p
}
// Structure wraps GstStructure
//
// A #GstStructure is a collection of key/value pairs. The keys are expressed as
// GQuarks and the values can be of any GType.
//
// In addition to the key/value pairs, a #GstStructure also has a name. The name
// starts with a letter and can be filled by letters, numbers and any of
// "/-_.:".
//
// #GstStructure is used by various GStreamer subsystems to store information in
// a flexible and extensible way. A #GstStructure does not have a refcount
// because it usually is part of a higher level object such as #GstCaps,
// #GstMessage, #GstEvent, #GstQuery. It provides a means to enforce mutability
// using the refcount of the parent with the gst_structure_set_parent_refcount()
// method.
//
// A #GstStructure can be created with gst_structure_new_empty() or
// gst_structure_new(), which both take a name and an optional set of key/value
// pairs along with the types of the values.
//
// Field values can be changed with gst_structure_set_value() or
// gst_structure_set().
//
// Field values can be retrieved with gst_structure_get_value() or the more
// convenient gst_structure_get_*() functions.
//
// Fields can be removed with gst_structure_remove_field() or
// gst_structure_remove_fields().
//
// Strings in structures must be ASCII or UTF-8 encoded. Other encodings are not
// allowed. Strings may be %NULL however.
//
// ## The serialization format
//
// GstStructure serialization format serialize the GstStructure name,
// keys/GType/values in a comma separated list with the structure name as first
// field without value followed by separated key/value pairs in the form
// `key=value`, for example:
//
// ```
// a-structure, key=value
// ````
//
// The values type will be inferred if not explicitly specified with the
// `(GTypeName)value` syntax, for example the following struct will have one
// field called 'is-string' which has the string 'true' as a value:
//
// ```
// a-struct, field-is-string=(string)true, field-is-boolean=true
// ```
//
// *Note*: without specifying `(string), `field-is-string` type would have been
// inferred as boolean.
//
// *Note*: we specified `(string)` as a type even if `gchararray` is the actual
// GType name as for convenience some well known types have been aliased or
// abbreviated.
//
// To avoid specifying the type, you can give some hints to the "type system".
// For example to specify a value as a double, you should add a decimal (ie. `1`
// is an `int` while `1.0` is a `double`).
//
// *Note*: when a structure is serialized with #gst_structure_to_string, all
// values are explicitly typed.
//
// Some types have special delimiters:
//
// - [GstValueArray](GST_TYPE_ARRAY) are inside curly brackets (`{` and `}`).
// For example `a-structure, array={1, 2, 3}`
// - Ranges are inside brackets (`[` and `]`). For example `a-structure,
// range=[1, 6, 2]` 1 being the min value, 6 the maximum and 2 the step. To
// specify a #GST_TYPE_INT64_RANGE you need to explicitly specify it like:
// `a-structure, a-int64-range=(gint64) [1, 5]`
// - [GstValueList](GST_TYPE_LIST) are inside "less and greater than" (`&lt;` and
// `&gt;`). For example `a-structure, list=&lt;1, 2, 3&gt;
//
// Structures are delimited either by a null character `\0` or a semicolon `;`
// the latter allowing to store multiple structures in the same string (see
// #GstCaps).
//
// Quotes are used as "default" delimiters and can be used around any types that
// don't use other delimiters (for example `a-struct, i=(int)"1"`). They are use
// to allow adding spaces or special characters (such as delimiters,
// semicolumns, etc..) inside strings and you can use backslashes `\` to escape
// characters inside them, for example:
//
// ```
// a-struct, special="\"{[(;)]}\" can be used inside quotes"
// ```
//
// They also allow for nested structure, such as:
//
// ```
// a-struct, nested=(GstStructure)"nested-struct, nested=true"
// ```
//
// Since 1.20, nested structures and caps can be specified using brackets (`[`
// and `]`), for example:
//
// ```
// a-struct, nested=[nested-struct, nested=true]
// ```
//
// &gt; *note*: gst_structure_to_string() won't use that syntax for backward
// &gt; compatibility reason, gst_structure_serialize_full() has been added for
// &gt; that purpose.
type Structure struct {
*structure
}
// structure is the struct that's finalized
type structure struct {
native *C.GstStructure
}
var _ gobject.GoValueInitializer = (*Structure)(nil)
func marshalStructure(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeStructureFromGlibBorrow(b), nil
}
func (r *Structure) InitGoValue(v *gobject.Value) {
v.Init(TypeStructure)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeStructureFromGlibBorrow is used to convert raw C.GstStructure pointers to go. This is used by the bindings internally.
func UnsafeStructureFromGlibBorrow(p unsafe.Pointer) *Structure {
return &Structure{&structure{(*C.GstStructure)(p)}}
}
// UnsafeStructureFromGlibNone is used to convert raw C.GstStructure pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStructureFromGlibNone(p unsafe.Pointer) *Structure {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeStructureFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.structure,
func (intern *structure) {
C.gst_structure_free(intern.native)
},
)
return wrapped
}
// UnsafeStructureFromGlibFull is used to convert raw C.GstStructure pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeStructureFromGlibFull(p unsafe.Pointer) *Structure {
wrapped := UnsafeStructureFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.structure,
func (intern *structure) {
C.gst_structure_free(intern.native)
},
)
return wrapped
}
// UnsafeStructureFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Structure] is expected to work anymore.
func UnsafeStructureFree(s *Structure) {
C.gst_structure_free(s.native)
}
// UnsafeStructureToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeStructureToGlibNone(s *Structure) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeStructureToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeStructureToGlibFull(s *Structure) unsafe.Pointer {
runtime.SetFinalizer(s.structure, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // Structure is invalid from here on
return _p
}
// StructureFromString wraps gst_structure_from_string
//
// The function takes the following parameters:
//
// - str string: a string representation of a #GstStructure.
//
// The function returns the following values:
//
// - goret *Structure
//
// Creates a #GstStructure from a string representation.
// If end is not %NULL, a pointer to the place inside the given string
// where parsing ended will be returned.
//
// Free-function: gst_structure_free
func StructureFromString(str string) *Structure {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // skipped
var cret *C.GstStructure // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(str)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_from_string(carg1, &carg2)
runtime.KeepAlive(str)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewStructureEmpty wraps gst_structure_new_empty
//
// The function takes the following parameters:
//
// - name string: name of new structure
//
// The function returns the following values:
//
// - goret *Structure
//
// Creates a new, empty #GstStructure with the given @name.
//
// See gst_structure_set_name() for constraints on the @name parameter.
//
// Free-function: gst_structure_free
func NewStructureEmpty(name string) *Structure {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstStructure // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_new_empty(carg1)
runtime.KeepAlive(name)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewStructureFromString wraps gst_structure_new_from_string
//
// The function takes the following parameters:
//
// - str string: a string representation of a #GstStructure
//
// The function returns the following values:
//
// - goret *Structure
//
// Creates a #GstStructure from a string representation.
// If end is not %NULL, a pointer to the place inside the given string
// where parsing ended will be returned.
//
// The current implementation of serialization will lead to unexpected results
// when there are nested #GstCaps / #GstStructure deeper than one level unless
// the gst_structure_serialize() function is used (without
// #GST_SERIALIZE_FLAG_BACKWARD_COMPAT)
//
// Free-function: gst_structure_free
func NewStructureFromString(str string) *Structure {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstStructure // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(str)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_new_from_string(carg1)
runtime.KeepAlive(str)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewStructureIDEmpty wraps gst_structure_new_id_empty
//
// The function takes the following parameters:
//
// - quark glib.Quark: name of new structure
//
// The function returns the following values:
//
// - goret *Structure
//
// Creates a new, empty #GstStructure with the given name as a GQuark.
//
// Free-function: gst_structure_free
func NewStructureIDEmpty(quark glib.Quark) *Structure {
var carg1 C.GQuark // in, none, casted, alias
var cret *C.GstStructure // return, full, converted
carg1 = C.GQuark(quark)
cret = C.gst_structure_new_id_empty(carg1)
runtime.KeepAlive(quark)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// CanIntersect wraps gst_structure_can_intersect
//
// The function takes the following parameters:
//
// - struct2 *Structure: a #GstStructure
//
// The function returns the following values:
//
// - goret bool
//
// Tries intersecting @struct1 and @struct2 and reports whether the result
// would not be empty.
func (struct1 *Structure) CanIntersect(struct2 *Structure) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(struct1))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(struct2))
cret = C.gst_structure_can_intersect(carg0, carg1)
runtime.KeepAlive(struct1)
runtime.KeepAlive(struct2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Copy wraps gst_structure_copy
// The function returns the following values:
//
// - goret *Structure
//
// Duplicates a #GstStructure and all its fields and values.
//
// Free-function: gst_structure_free
func (structure *Structure) Copy() *Structure {
var carg0 *C.GstStructure // in, none, converted
var cret *C.GstStructure // return, full, converted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_structure_copy(carg0)
runtime.KeepAlive(structure)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// FilterAndMapInPlace wraps gst_structure_filter_and_map_in_place
//
// The function takes the following parameters:
//
// - fn StructureFilterMapFunc: a function to call for each field
//
// Calls the provided function once for each field in the #GstStructure. In
// contrast to gst_structure_foreach(), the function may modify the fields.
// In contrast to gst_structure_map_in_place(), the field is removed from
// the structure if %FALSE is returned from the function.
// The structure must be mutable.
func (structure *Structure) FilterAndMapInPlace(fn StructureFilterMapFunc) {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GstStructureFilterMapFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*[0]byte)(C._gotk4_gst1_StructureFilterMapFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
C.gst_structure_filter_and_map_in_place(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fn)
}
// Fixate wraps gst_structure_fixate
//
// Fixate all values in @structure using gst_value_fixate().
// @structure will be modified in-place and should be writable.
func (structure *Structure) Fixate() {
var carg0 *C.GstStructure // in, none, converted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
C.gst_structure_fixate(carg0)
runtime.KeepAlive(structure)
}
// FixateField wraps gst_structure_fixate_field
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given field with its fixated value.
func (structure *Structure) FixateField(fieldName string) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_fixate_field(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FixateFieldBoolean wraps gst_structure_fixate_field_boolean
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
// - target bool: the target value of the fixation
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given @field_name field to the given
// @target boolean if that field is not fixed yet.
func (structure *Structure) FixateFieldBoolean(fieldName string, target bool) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 C.gboolean // in
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
if target {
carg2 = C.TRUE
}
cret = C.gst_structure_fixate_field_boolean(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
runtime.KeepAlive(target)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FixateFieldNearestDouble wraps gst_structure_fixate_field_nearest_double
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
// - target float64: the target value of the fixation
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given field to the nearest
// double to @target that is a subset of the existing field.
func (structure *Structure) FixateFieldNearestDouble(fieldName string, target float64) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 C.double // in, none, casted, casted C.gdouble
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.double(target)
cret = C.gst_structure_fixate_field_nearest_double(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
runtime.KeepAlive(target)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FixateFieldNearestFraction wraps gst_structure_fixate_field_nearest_fraction
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
// - targetNumerator int: The numerator of the target value of the fixation
// - targetDenominator int: The denominator of the target value of the fixation
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given field to the nearest
// fraction to @target_numerator/@target_denominator that is a subset
// of the existing field.
func (structure *Structure) FixateFieldNearestFraction(fieldName string, targetNumerator int, targetDenominator int) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 C.gint // in, none, casted
var carg3 C.gint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.gint(targetNumerator)
carg3 = C.gint(targetDenominator)
cret = C.gst_structure_fixate_field_nearest_fraction(carg0, carg1, carg2, carg3)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
runtime.KeepAlive(targetNumerator)
runtime.KeepAlive(targetDenominator)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FixateFieldNearestInt wraps gst_structure_fixate_field_nearest_int
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
// - target int: the target value of the fixation
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given field to the nearest
// integer to @target that is a subset of the existing field.
func (structure *Structure) FixateFieldNearestInt(fieldName string, target int) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 C.int // in, none, casted, casted C.gint
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.int(target)
cret = C.gst_structure_fixate_field_nearest_int(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
runtime.KeepAlive(target)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FixateFieldString wraps gst_structure_fixate_field_string
//
// The function takes the following parameters:
//
// - fieldName string: a field in @structure
// - target string: the target value of the fixation
//
// The function returns the following values:
//
// - goret bool
//
// Fixates a #GstStructure by changing the given @field_name field to the given
// @target string if that field is not fixed yet.
func (structure *Structure) FixateFieldString(fieldName string, target string) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.char // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.char)(unsafe.Pointer(C.CString(fieldName)))
defer C.free(unsafe.Pointer(carg1))
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(target)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_structure_fixate_field_string(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldName)
runtime.KeepAlive(target)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ForEach wraps gst_structure_foreach
//
// The function takes the following parameters:
//
// - fn StructureForEachFunc: a function to call for each field
//
// The function returns the following values:
//
// - goret bool
//
// Calls the provided function once for each field in the #GstStructure. The
// function must not modify the fields. Also see gst_structure_map_in_place()
// and gst_structure_filter_and_map_in_place().
func (structure *Structure) ForEach(fn StructureForEachFunc) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GstStructureForeachFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*[0]byte)(C._gotk4_gst1_StructureForEachFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_structure_foreach(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// GetBoolean wraps gst_structure_get_boolean
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value bool: a pointer to a #gboolean to set
// - goret bool
//
// Sets the boolean pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetBoolean(fieldname string) (bool, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // out
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_boolean(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value bool
var goret bool
if carg2 != 0 {
value = true
}
if cret != 0 {
goret = true
}
return value, goret
}
// GetClockTime wraps gst_structure_get_clock_time
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value ClockTime: a pointer to a #GstClockTime to set
// - goret bool
//
// Sets the clock time pointed to by @value corresponding to the clock time
// of the given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetClockTime(fieldname string) (ClockTime, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GstClockTime // out, full, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_clock_time(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value ClockTime
var goret bool
value = ClockTime(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetDateTime wraps gst_structure_get_date_time
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value *DateTime: a pointer to a #GstDateTime to set
// - goret bool
//
// Sets the datetime pointed to by @value corresponding to the datetime of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
//
// On success @value will point to a reference of the datetime which
// should be unreffed with gst_date_time_unref() when no longer needed
// (note: this is inconsistent with e.g. gst_structure_get_string()
// which doesn't return a copy of the string).
func (structure *Structure) GetDateTime(fieldname string) (*DateTime, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstDateTime // out, full, converted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_date_time(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value *DateTime
var goret bool
value = UnsafeDateTimeFromGlibFull(unsafe.Pointer(carg2))
if cret != 0 {
goret = true
}
return value, goret
}
// GetDouble wraps gst_structure_get_double
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value float64: a pointer to a gdouble to set
// - goret bool
//
// Sets the double pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetDouble(fieldname string) (float64, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gdouble // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_double(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value float64
var goret bool
value = float64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetEnum wraps gst_structure_get_enum
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
// - enumtype gobject.Type: the enum type of a field
//
// The function returns the following values:
//
// - value int: a pointer to an int to set
// - goret bool
//
// Sets the int pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists,
// has the correct type and that the enumtype is correct.
func (structure *Structure) GetEnum(fieldname string, enumtype gobject.Type) (int, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GType // in, none, casted, alias
var carg3 C.gint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GType(enumtype)
cret = C.gst_structure_get_enum(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
runtime.KeepAlive(enumtype)
var value int
var goret bool
value = int(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetFieldType wraps gst_structure_get_field_type
//
// The function takes the following parameters:
//
// - fieldname string: the name of the field
//
// The function returns the following values:
//
// - goret gobject.Type
//
// Finds the field with the given name, and returns the type of the
// value it contains. If the field is not found, G_TYPE_INVALID is
// returned.
func (structure *Structure) GetFieldType(fieldname string) gobject.Type {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.GType // return, none, casted, alias
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_field_type(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var goret gobject.Type
goret = gobject.Type(cret)
return goret
}
// GetFlags wraps gst_structure_get_flags
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
// - flagsType gobject.Type: the flags type of a field
//
// The function returns the following values:
//
// - value uint: a pointer to an unsigned int to set
// - goret bool
//
// Sets the unsigned int pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists,
// has the correct type and that the flagstype is correct.
func (structure *Structure) GetFlags(fieldname string, flagsType gobject.Type) (uint, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GType // in, none, casted, alias
var carg3 C.guint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GType(flagsType)
cret = C.gst_structure_get_flags(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
runtime.KeepAlive(flagsType)
var value uint
var goret bool
value = uint(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetFlagset wraps gst_structure_get_flagset
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - valueFlags uint: a pointer to a guint for the flags field
// - valueMask uint: a pointer to a guint for the mask field
// - goret bool
//
// Read the GstFlagSet flags and mask out of the structure into the
// provided pointers.
func (structure *Structure) GetFlagset(fieldname string) (uint, uint, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint // out, full, casted
var carg3 C.guint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_flagset(carg0, carg1, &carg2, &carg3)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var valueFlags uint
var valueMask uint
var goret bool
valueFlags = uint(carg2)
valueMask = uint(carg3)
if cret != 0 {
goret = true
}
return valueFlags, valueMask, goret
}
// GetFraction wraps gst_structure_get_fraction
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - valueNumerator int: a pointer to an int to set
// - valueDenominator int: a pointer to an int to set
// - goret bool
//
// Sets the integers pointed to by @value_numerator and @value_denominator
// corresponding to the value of the given field. Caller is responsible
// for making sure the field exists and has the correct type.
func (structure *Structure) GetFraction(fieldname string) (int, int, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gint // out, full, casted
var carg3 C.gint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_fraction(carg0, carg1, &carg2, &carg3)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var valueNumerator int
var valueDenominator int
var goret bool
valueNumerator = int(carg2)
valueDenominator = int(carg3)
if cret != 0 {
goret = true
}
return valueNumerator, valueDenominator, goret
}
// GetInt wraps gst_structure_get_int
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value int: a pointer to an int to set
// - goret bool
//
// Sets the int pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetInt(fieldname string) (int, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_int(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value int
var goret bool
value = int(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetInt64 wraps gst_structure_get_int64
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value int64: a pointer to a #gint64 to set
// - goret bool
//
// Sets the #gint64 pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetInt64(fieldname string) (int64, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_int64(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value int64
var goret bool
value = int64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetName wraps gst_structure_get_name
// The function returns the following values:
//
// - goret string
//
// Get the name of @structure as a string.
func (structure *Structure) GetName() string {
var carg0 *C.GstStructure // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_structure_get_name(carg0)
runtime.KeepAlive(structure)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetNameID wraps gst_structure_get_name_id
// The function returns the following values:
//
// - goret glib.Quark
//
// Get the name of @structure as a GQuark.
func (structure *Structure) GetNameID() glib.Quark {
var carg0 *C.GstStructure // in, none, converted
var cret C.GQuark // return, none, casted, alias
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_structure_get_name_id(carg0)
runtime.KeepAlive(structure)
var goret glib.Quark
goret = glib.Quark(cret)
return goret
}
// GetString wraps gst_structure_get_string
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - goret string
//
// Finds the field corresponding to @fieldname, and returns the string
// contained in the field's value. Caller is responsible for making
// sure the field exists and has the correct type.
//
// The string should not be modified, and remains valid until the next
// call to a gst_structure_*() function with the given structure.
func (structure *Structure) GetString(fieldname string) string {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_string(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetUint wraps gst_structure_get_uint
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value uint: a pointer to a uint to set
// - goret bool
//
// Sets the uint pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetUint(fieldname string) (uint, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_uint(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value uint
var goret bool
value = uint(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetUint64 wraps gst_structure_get_uint64
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - value uint64: a pointer to a #guint64 to set
// - goret bool
//
// Sets the #guint64 pointed to by @value corresponding to the value of the
// given field. Caller is responsible for making sure the field exists
// and has the correct type.
func (structure *Structure) GetUint64(fieldname string) (uint64, bool) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_get_uint64(carg0, carg1, &carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var value uint64
var goret bool
value = uint64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// HasField wraps gst_structure_has_field
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
//
// The function returns the following values:
//
// - goret bool
//
// Check if @structure contains a field named @fieldname.
func (structure *Structure) HasField(fieldname string) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_has_field(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasFieldTyped wraps gst_structure_has_field_typed
//
// The function takes the following parameters:
//
// - fieldname string: the name of a field
// - typ gobject.Type: the type of a value
//
// The function returns the following values:
//
// - goret bool
//
// Check if @structure contains a field named @fieldname and with GType @type.
func (structure *Structure) HasFieldTyped(fieldname string, typ gobject.Type) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.GType // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
carg2 = C.GType(typ)
cret = C.gst_structure_has_field_typed(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// HasName wraps gst_structure_has_name
//
// The function takes the following parameters:
//
// - name string: structure name to check for
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the structure has the given name
func (structure *Structure) HasName(name string) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_structure_has_name(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(name)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IDHasField wraps gst_structure_id_has_field
//
// The function takes the following parameters:
//
// - field glib.Quark: #GQuark of the field name
//
// The function returns the following values:
//
// - goret bool
//
// Check if @structure contains a field named @field.
func (structure *Structure) IDHasField(field glib.Quark) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.GQuark(field)
cret = C.gst_structure_id_has_field(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(field)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IDHasFieldTyped wraps gst_structure_id_has_field_typed
//
// The function takes the following parameters:
//
// - field glib.Quark: #GQuark of the field name
// - typ gobject.Type: the type of a value
//
// The function returns the following values:
//
// - goret bool
//
// Check if @structure contains a field named @field and with GType @type.
func (structure *Structure) IDHasFieldTyped(field glib.Quark, typ gobject.Type) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
var carg2 C.GType // in, none, casted, alias
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.GQuark(field)
carg2 = C.GType(typ)
cret = C.gst_structure_id_has_field_typed(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(field)
runtime.KeepAlive(typ)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IDSetValue wraps gst_structure_id_set_value
//
// The function takes the following parameters:
//
// - field glib.Quark: a #GQuark representing a field
// - value *gobject.Value: the new value of the field
//
// Sets the field with the given GQuark @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) IDSetValue(field glib.Quark, value *gobject.Value) {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GQuark // in, none, casted, alias
var carg2 *C.GValue // in, none, converted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.GQuark(field)
carg2 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
C.gst_structure_id_set_value(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(field)
runtime.KeepAlive(value)
}
// Intersect wraps gst_structure_intersect
//
// The function takes the following parameters:
//
// - struct2 *Structure: a #GstStructure
//
// The function returns the following values:
//
// - goret *Structure
//
// Intersects @struct1 and @struct2 and returns the intersection.
func (struct1 *Structure) Intersect(struct2 *Structure) *Structure {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var cret *C.GstStructure // return, full, converted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(struct1))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(struct2))
cret = C.gst_structure_intersect(carg0, carg1)
runtime.KeepAlive(struct1)
runtime.KeepAlive(struct2)
var goret *Structure
goret = UnsafeStructureFromGlibFull(unsafe.Pointer(cret))
return goret
}
// IsEqual wraps gst_structure_is_equal
//
// The function takes the following parameters:
//
// - structure2 *Structure: a #GstStructure.
//
// The function returns the following values:
//
// - goret bool
//
// Tests if the two #GstStructure are equal.
func (structure1 *Structure) IsEqual(structure2 *Structure) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure1))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure2))
cret = C.gst_structure_is_equal(carg0, carg1)
runtime.KeepAlive(structure1)
runtime.KeepAlive(structure2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsSubset wraps gst_structure_is_subset
//
// The function takes the following parameters:
//
// - superset *Structure: a potentially greater #GstStructure
//
// The function returns the following values:
//
// - goret bool
//
// Checks if @subset is a subset of @superset, i.e. has the same
// structure name and for all fields that are existing in @superset,
// @subset has a value that is a subset of the value in @superset.
func (subset *Structure) IsSubset(superset *Structure) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.GstStructure // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(subset))
carg1 = (*C.GstStructure)(UnsafeStructureToGlibNone(superset))
cret = C.gst_structure_is_subset(carg0, carg1)
runtime.KeepAlive(subset)
runtime.KeepAlive(superset)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MapInPlace wraps gst_structure_map_in_place
//
// The function takes the following parameters:
//
// - fn StructureMapFunc: a function to call for each field
//
// The function returns the following values:
//
// - goret bool
//
// Calls the provided function once for each field in the #GstStructure. In
// contrast to gst_structure_foreach(), the function may modify but not delete the
// fields. The structure must be mutable.
func (structure *Structure) MapInPlace(fn StructureMapFunc) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GstStructureMapFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*[0]byte)(C._gotk4_gst1_StructureMapFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
cret = C.gst_structure_map_in_place(carg0, carg1, carg2)
runtime.KeepAlive(structure)
runtime.KeepAlive(fn)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// NFields wraps gst_structure_n_fields
// The function returns the following values:
//
// - goret int
//
// Get the number of fields in the structure.
func (structure *Structure) NFields() int {
var carg0 *C.GstStructure // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_structure_n_fields(carg0)
runtime.KeepAlive(structure)
var goret int
goret = int(cret)
return goret
}
// NthFieldName wraps gst_structure_nth_field_name
//
// The function takes the following parameters:
//
// - index uint: the index to get the name of
//
// The function returns the following values:
//
// - goret string
//
// Get the name of the given field number, counting from 0 onwards.
func (structure *Structure) NthFieldName(index uint) string {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.guint(index)
cret = C.gst_structure_nth_field_name(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(index)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// RemoveAllFields wraps gst_structure_remove_all_fields
//
// Removes all fields in a GstStructure.
func (structure *Structure) RemoveAllFields() {
var carg0 *C.GstStructure // in, none, converted
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
C.gst_structure_remove_all_fields(carg0)
runtime.KeepAlive(structure)
}
// RemoveField wraps gst_structure_remove_field
//
// The function takes the following parameters:
//
// - fieldname string: the name of the field to remove
//
// Removes the field with the given name. If the field with the given
// name does not exist, the structure is unchanged.
func (structure *Structure) RemoveField(fieldname string) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fieldname)))
defer C.free(unsafe.Pointer(carg1))
C.gst_structure_remove_field(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(fieldname)
}
// Serialize wraps gst_structure_serialize
//
// The function takes the following parameters:
//
// - flags SerializeFlags: The flags to use to serialize structure
//
// The function returns the following values:
//
// - goret string
//
// Converts @structure to a human-readable string representation.
//
// This version of the caps serialization function introduces support for nested
// structures and caps but the resulting strings won't be parsable with
// GStreamer prior to 1.20 unless #GST_SERIALIZE_FLAG_BACKWARD_COMPAT is passed
// as @flag.
//
// %GST_SERIALIZE_FLAG_STRICT flags is not allowed because it would make this
// function nullable which is an API break for bindings.
// Use gst_structure_serialize_full() instead.
//
// Free-function: g_free
//
// Deprecated: Use gst_structure_serialize_full() instead.
func (structure *Structure) Serialize(flags SerializeFlags) string {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GstSerializeFlags // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.GstSerializeFlags(flags)
cret = C.gst_structure_serialize(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(flags)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// SerializeFull wraps gst_structure_serialize_full
//
// The function takes the following parameters:
//
// - flags SerializeFlags: The flags to use to serialize structure
//
// The function returns the following values:
//
// - goret string
//
// Alias for gst_structure_serialize() but with nullable annotation because it
// can return %NULL when %GST_SERIALIZE_FLAG_STRICT flag is set.
func (structure *Structure) SerializeFull(flags SerializeFlags) string {
var carg0 *C.GstStructure // in, none, converted
var carg1 C.GstSerializeFlags // in, none, casted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = C.GstSerializeFlags(flags)
cret = C.gst_structure_serialize_full(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(flags)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// SetName wraps gst_structure_set_name
//
// The function takes the following parameters:
//
// - name string: the new name of the structure
//
// Sets the name of the structure to the given @name. The string
// provided is copied before being used. It must not be empty, start with a
// letter and can be followed by letters, numbers and any of "/-_.:".
func (structure *Structure) SetName(name string) {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(name)))
defer C.free(unsafe.Pointer(carg1))
C.gst_structure_set_name(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(name)
}
// SetParentRefcount wraps gst_structure_set_parent_refcount
//
// The function takes the following parameters:
//
// - refcount *int: a pointer to the parent's refcount
//
// The function returns the following values:
//
// - goret bool
//
// Sets the parent_refcount field of #GstStructure. This field is used to
// determine whether a structure is mutable or not. This function should only be
// called by code implementing parent objects of #GstStructure, as described in
// the MT Refcounting section of the design documents.
func (structure *Structure) SetParentRefcount(refcount *int) bool {
var carg0 *C.GstStructure // in, none, converted
var carg1 *C.gint // in, transfer: none, C Pointers: 1, Name: gint
var cret C.gboolean // return
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
_ = refcount
_ = carg1
panic("unimplemented conversion of *int (gint*)")
cret = C.gst_structure_set_parent_refcount(carg0, carg1)
runtime.KeepAlive(structure)
runtime.KeepAlive(refcount)
var goret bool
if cret != 0 {
goret = true
}
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:
//
// - goret string
//
// Converts @structure to a human-readable string representation.
//
// For debugging purposes its easier to do something like this: |[&lt;!--
// language="C" --&gt; GST_LOG ("structure is %" GST_PTR_FORMAT, structure);
// ]|
// This prints the structure in human readable form.
//
// This function will lead to unexpected results when there are nested #GstCaps
// / #GstStructure deeper than one level, you should user
// gst_structure_serialize_full() instead for those cases.
//
// Free-function: g_free
func (structure *Structure) ToString() string {
var carg0 *C.GstStructure // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstStructure)(UnsafeStructureToGlibNone(structure))
cret = C.gst_structure_to_string(carg0)
runtime.KeepAlive(structure)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// SystemClockClass wraps GstSystemClockClass
type SystemClockClass struct {
*systemClockClass
}
// systemClockClass is the struct that's finalized
type systemClockClass struct {
native *C.GstSystemClockClass
}
// UnsafeSystemClockClassFromGlibBorrow is used to convert raw C.GstSystemClockClass pointers to go. This is used by the bindings internally.
func UnsafeSystemClockClassFromGlibBorrow(p unsafe.Pointer) *SystemClockClass {
return &SystemClockClass{&systemClockClass{(*C.GstSystemClockClass)(p)}}
}
// UnsafeSystemClockClassFromGlibNone is used to convert raw C.GstSystemClockClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSystemClockClassFromGlibNone(p unsafe.Pointer) *SystemClockClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeSystemClockClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.systemClockClass,
func (intern *systemClockClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSystemClockClassFromGlibFull is used to convert raw C.GstSystemClockClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeSystemClockClassFromGlibFull(p unsafe.Pointer) *SystemClockClass {
wrapped := UnsafeSystemClockClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.systemClockClass,
func (intern *systemClockClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeSystemClockClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [SystemClockClass] is expected to work anymore.
func UnsafeSystemClockClassFree(s *SystemClockClass) {
C.free(unsafe.Pointer(s.native))
}
// UnsafeSystemClockClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeSystemClockClassToGlibNone(s *SystemClockClass) unsafe.Pointer {
return unsafe.Pointer(s.native)
}
// UnsafeSystemClockClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeSystemClockClassToGlibFull(s *SystemClockClass) unsafe.Pointer {
runtime.SetFinalizer(s.systemClockClass, nil)
_p := unsafe.Pointer(s.native)
s.native = nil // SystemClockClass is invalid from here on
return _p
}
// TagList wraps GstTagList
//
// List of tags and values used to describe media metadata.
//
// Strings in structures must be ASCII or UTF-8 encoded. Other encodings are
// not allowed. Strings must not be empty or %NULL.
type TagList struct {
*tagList
}
// tagList is the struct that's finalized
type tagList struct {
native *C.GstTagList
}
var _ gobject.GoValueInitializer = (*TagList)(nil)
func marshalTagList(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeTagListFromGlibBorrow(b), nil
}
func (r *TagList) InitGoValue(v *gobject.Value) {
v.Init(TypeTagList)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeTagListFromGlibBorrow is used to convert raw C.GstTagList pointers to go. This is used by the bindings internally.
func UnsafeTagListFromGlibBorrow(p unsafe.Pointer) *TagList {
return &TagList{&tagList{(*C.GstTagList)(p)}}
}
// UnsafeTagListFromGlibNone is used to convert raw C.GstTagList pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTagListFromGlibNone(p unsafe.Pointer) *TagList {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTagListFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tagList,
func (intern *tagList) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTagListFromGlibFull is used to convert raw C.GstTagList pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTagListFromGlibFull(p unsafe.Pointer) *TagList {
wrapped := UnsafeTagListFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tagList,
func (intern *tagList) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTagListFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TagList] is expected to work anymore.
func UnsafeTagListFree(t *TagList) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTagListToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTagListToGlibNone(t *TagList) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTagListToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTagListToGlibFull(t *TagList) unsafe.Pointer {
runtime.SetFinalizer(t.tagList, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TagList is invalid from here on
return _p
}
// NewTagListEmpty wraps gst_tag_list_new_empty
// The function returns the following values:
//
// - goret *TagList
//
// Creates a new empty GstTagList.
//
// Free-function: gst_tag_list_unref
func NewTagListEmpty() *TagList {
var cret *C.GstTagList // return, full, converted
cret = C.gst_tag_list_new_empty()
var goret *TagList
goret = UnsafeTagListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewTagListFromString wraps gst_tag_list_new_from_string
//
// The function takes the following parameters:
//
// - str string: a string created with gst_tag_list_to_string()
//
// The function returns the following values:
//
// - goret *TagList
//
// Deserializes a tag list.
func NewTagListFromString(str string) *TagList {
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstTagList // return, full, converted
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(str)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_tag_list_new_from_string(carg1)
runtime.KeepAlive(str)
var goret *TagList
goret = UnsafeTagListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AddValue wraps gst_tag_list_add_value
//
// The function takes the following parameters:
//
// - mode TagMergeMode: the mode to use
// - tag string: tag
// - value *gobject.Value: GValue for this tag
//
// Sets the GValue for a given tag using the specified mode.
func (list *TagList) AddValue(mode TagMergeMode, tag string, value *gobject.Value) {
var carg0 *C.GstTagList // in, none, converted
var carg1 C.GstTagMergeMode // in, none, casted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var carg3 *C.GValue // in, none, converted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg1 = C.GstTagMergeMode(mode)
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg2))
carg3 = (*C.GValue)(gobject.UnsafeValueToGlibUseAnyInstead(value))
C.gst_tag_list_add_value(carg0, carg1, carg2, carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(mode)
runtime.KeepAlive(tag)
runtime.KeepAlive(value)
}
// Copy wraps gst_tag_list_copy
// The function returns the following values:
//
// - goret *TagList
//
// Creates a new #GstTagList as a copy of the old @taglist. The new taglist
// will have a refcount of 1, owned by the caller, and will be writable as
// a result.
//
// Note that this function is the semantic equivalent of a gst_tag_list_ref()
// followed by a gst_tag_list_make_writable(). If you only want to hold on to a
// reference to the data, you should use gst_tag_list_ref().
//
// When you are finished with the taglist, call gst_tag_list_unref() on it.
func (taglist *TagList) Copy() *TagList {
var carg0 *C.GstTagList // in, none, converted
var cret *C.GstTagList // return, full, converted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(taglist))
cret = C.gst_tag_list_copy(carg0)
runtime.KeepAlive(taglist)
var goret *TagList
goret = UnsafeTagListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// ForEach wraps gst_tag_list_foreach
//
// The function takes the following parameters:
//
// - fn TagForEachFunc: function to be called for each tag
//
// Calls the given function for each tag inside the tag list. Note that if there
// is no tag, the function won't be called at all.
func (list *TagList) ForEach(fn TagForEachFunc) {
var carg0 *C.GstTagList // in, none, converted
var carg1 C.GstTagForeachFunc // callback, scope: call, closure: carg2
var carg2 C.gpointer // implicit
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg1 = (*[0]byte)(C._gotk4_gst1_TagForEachFunc)
carg2 = C.gpointer(userdata.Register(fn))
defer userdata.Delete(unsafe.Pointer(carg2))
C.gst_tag_list_foreach(carg0, carg1, carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(fn)
}
// GetBoolean wraps gst_tag_list_get_boolean
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value bool: 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) GetBoolean(tag string) (bool, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gboolean // out
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_boolean(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value bool
var goret bool
if carg2 != 0 {
value = true
}
if cret != 0 {
goret = true
}
return value, goret
}
// GetBooleanIndex wraps gst_tag_list_get_boolean_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 bool: 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) GetBooleanIndex(tag string, index uint) (bool, 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.gboolean // out
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_boolean_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value bool
var goret bool
if carg3 != 0 {
value = true
}
if cret != 0 {
goret = true
}
return value, goret
}
// GetDateTime wraps gst_tag_list_get_date_time
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value *DateTime: address of a #GstDateTime
// pointer variable to store the result into
// - goret bool
//
// Copies the first datetime for the given tag in the taglist into the variable
// pointed to by @value. Unref the date with gst_date_time_unref() when
// it is no longer needed.
//
// Free-function: gst_date_time_unref
func (list *TagList) GetDateTime(tag string) (*DateTime, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstDateTime // out, full, converted
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_date_time(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value *DateTime
var goret bool
value = UnsafeDateTimeFromGlibFull(unsafe.Pointer(carg2))
if cret != 0 {
goret = true
}
return value, goret
}
// GetDateTimeIndex wraps gst_tag_list_get_date_time_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 *DateTime: location for the result
// - goret bool
//
// Gets the datetime that is at the given index for the given tag in the given
// list and copies it into the variable pointed to by @value. Unref the datetime
// with gst_date_time_unref() when it is no longer needed.
//
// Free-function: gst_date_time_unref
func (list *TagList) GetDateTimeIndex(tag string, index uint) (*DateTime, 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.GstDateTime // out, full, converted
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_date_time_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value *DateTime
var goret bool
value = UnsafeDateTimeFromGlibFull(unsafe.Pointer(carg3))
if cret != 0 {
goret = true
}
return value, goret
}
// GetDouble wraps gst_tag_list_get_double
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value float64: 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) GetDouble(tag string) (float64, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gdouble // out, full, casted
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_double(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value float64
var goret bool
value = float64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetDoubleIndex wraps gst_tag_list_get_double_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 float64: 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) GetDoubleIndex(tag string, index uint) (float64, 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.gdouble // out, full, casted
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_double_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value float64
var goret bool
value = float64(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetFloat wraps gst_tag_list_get_float
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value float32: 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) GetFloat(tag string) (float32, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gfloat // out, full, casted
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_float(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value float32
var goret bool
value = float32(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetFloatIndex wraps gst_tag_list_get_float_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 float32: 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) GetFloatIndex(tag string, index uint) (float32, 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.gfloat // out, full, casted
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_float_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value float32
var goret bool
value = float32(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetInt wraps gst_tag_list_get_int
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value int: 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) GetInt(tag string) (int, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gint // out, full, casted
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_int(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value int
var goret bool
value = int(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetInt64 wraps gst_tag_list_get_int64
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value int64: 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) GetInt64(tag string) (int64, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.gint64 // out, full, casted
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_int64(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value int64
var goret bool
value = int64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetInt64Index wraps gst_tag_list_get_int64_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 int64: 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) GetInt64Index(tag string, index uint) (int64, 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.gint64 // out, full, casted
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_int64_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value int64
var goret bool
value = int64(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetIntIndex wraps gst_tag_list_get_int_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 int: 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) GetIntIndex(tag string, index uint) (int, 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.gint // out, full, casted
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_int_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value int
var goret bool
value = int(carg3)
if cret != 0 {
goret = true
}
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:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - sample *Sample: address of a GstSample
// pointer variable to store the result into
// - goret bool
//
// Copies the first sample for the given tag in the taglist into the variable
// pointed to by @sample. Free the sample with gst_sample_unref() when it is
// no longer needed. You can retrieve the buffer from the sample using
// gst_sample_get_buffer() and the associated caps (if any) with
// gst_sample_get_caps().
//
// Free-function: gst_sample_unref
func (list *TagList) GetSample(tag string) (*Sample, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.GstSample // out, full, converted
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_sample(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var sample *Sample
var goret bool
sample = UnsafeSampleFromGlibFull(unsafe.Pointer(carg2))
if cret != 0 {
goret = true
}
return sample, goret
}
// GetSampleIndex wraps gst_tag_list_get_sample_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:
//
// - sample *Sample: address of a GstSample
// pointer variable to store the result into
// - goret bool
//
// Gets the sample that is at the given index for the given tag in the given
// list and copies it into the variable pointed to by @sample. Free the sample
// with gst_sample_unref() when it is no longer needed. You can retrieve the
// buffer from the sample using gst_sample_get_buffer() and the associated
// caps (if any) with gst_sample_get_caps().
//
// Free-function: gst_sample_unref
func (list *TagList) GetSampleIndex(tag string, index uint) (*Sample, 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.GstSample // out, full, converted
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_sample_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var sample *Sample
var goret bool
sample = UnsafeSampleFromGlibFull(unsafe.Pointer(carg3))
if cret != 0 {
goret = true
}
return sample, goret
}
// GetScope wraps gst_tag_list_get_scope
// The function returns the following values:
//
// - goret TagScope
//
// Gets the scope of @list.
func (list *TagList) GetScope() TagScope {
var carg0 *C.GstTagList // in, none, converted
var cret C.GstTagScope // return, none, casted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
cret = C.gst_tag_list_get_scope(carg0)
runtime.KeepAlive(list)
var goret TagScope
goret = TagScope(cret)
return goret
}
// GetString wraps gst_tag_list_get_string
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value string: location for the result
// - goret bool
//
// Copies the contents for the given tag into the value, possibly merging
// multiple values into one if multiple values are associated with the tag.
//
// Use gst_tag_list_get_string_index (list, tag, 0, value) if you want
// to retrieve the first string associated with this tag unmodified.
//
// The resulting string in @value will be in UTF-8 encoding and should be
// freed by the caller using g_free when no longer needed. The
// returned string is also guaranteed to be non-%NULL and non-empty.
//
// Free-function: g_free
func (list *TagList) GetString(tag string) (string, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // out, full, string, casted *C.gchar
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_string(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value string
var goret bool
value = C.GoString((*C.char)(unsafe.Pointer(carg2)))
defer C.free(unsafe.Pointer(carg2))
if cret != 0 {
goret = true
}
return value, goret
}
// GetStringIndex wraps gst_tag_list_get_string_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 string: location for the result
// - goret bool
//
// Gets the value that is at the given index for the given tag in the given
// list.
//
// The resulting string in @value will be in UTF-8 encoding and should be
// freed by the caller using g_free when no longer needed. The
// returned string is also guaranteed to be non-%NULL and non-empty.
//
// Free-function: g_free
func (list *TagList) GetStringIndex(tag string, index uint) (string, 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.gchar // out, full, string, casted *C.gchar
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_string_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value string
var goret bool
value = C.GoString((*C.char)(unsafe.Pointer(carg3)))
defer C.free(unsafe.Pointer(carg3))
if cret != 0 {
goret = true
}
return value, goret
}
// GetTagSize wraps gst_tag_list_get_tag_size
//
// The function takes the following parameters:
//
// - tag string: the tag to query
//
// The function returns the following values:
//
// - goret uint
//
// Checks how many value are stored in this tag list for the given tag.
func (list *TagList) GetTagSize(tag string) uint {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.guint // return, none, casted
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_tag_size(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var goret uint
goret = uint(cret)
return goret
}
// GetUint wraps gst_tag_list_get_uint
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value uint: 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) GetUint(tag string) (uint, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint // out, full, casted
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_uint(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value uint
var goret bool
value = uint(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetUint64 wraps gst_tag_list_get_uint64
//
// The function takes the following parameters:
//
// - tag string: tag to read out
//
// The function returns the following values:
//
// - value uint64: 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) GetUint64(tag string) (uint64, bool) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 C.guint64 // out, full, casted
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_uint64(carg0, carg1, &carg2)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
var value uint64
var goret bool
value = uint64(carg2)
if cret != 0 {
goret = true
}
return value, goret
}
// GetUint64Index wraps gst_tag_list_get_uint64_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 uint64: 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) GetUint64Index(tag string, index uint) (uint64, 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.guint64 // out, full, casted
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_uint64_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value uint64
var goret bool
value = uint64(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// GetUintIndex wraps gst_tag_list_get_uint_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 uint: 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) GetUintIndex(tag string, index uint) (uint, 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.guint // out, full, casted
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_uint_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value uint
var goret bool
value = uint(carg3)
if cret != 0 {
goret = true
}
return value, goret
}
// Insert wraps gst_tag_list_insert
//
// The function takes the following parameters:
//
// - from *TagList: list to merge from
// - mode TagMergeMode: the mode to use
//
// Inserts the tags of the @from list into the first list using the given mode.
func (into *TagList) Insert(from *TagList, mode TagMergeMode) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.GstTagList // in, none, converted
var carg2 C.GstTagMergeMode // in, none, casted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(into))
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(from))
carg2 = C.GstTagMergeMode(mode)
C.gst_tag_list_insert(carg0, carg1, carg2)
runtime.KeepAlive(into)
runtime.KeepAlive(from)
runtime.KeepAlive(mode)
}
// IsEmpty wraps gst_tag_list_is_empty
// The function returns the following values:
//
// - goret bool
//
// Checks if the given taglist is empty.
func (list *TagList) IsEmpty() bool {
var carg0 *C.GstTagList // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
cret = C.gst_tag_list_is_empty(carg0)
runtime.KeepAlive(list)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsEqual wraps gst_tag_list_is_equal
//
// The function takes the following parameters:
//
// - list2 *TagList: a #GstTagList.
//
// The function returns the following values:
//
// - goret bool
//
// Checks if the two given taglists are equal.
func (list1 *TagList) IsEqual(list2 *TagList) bool {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.GstTagList // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list1))
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(list2))
cret = C.gst_tag_list_is_equal(carg0, carg1)
runtime.KeepAlive(list1)
runtime.KeepAlive(list2)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Merge wraps gst_tag_list_merge
//
// The function takes the following parameters:
//
// - list2 *TagList (nullable): second list to merge
// - mode TagMergeMode: the mode to use
//
// The function returns the following values:
//
// - goret *TagList
//
// Merges the two given lists into a new list. If one of the lists is %NULL, a
// copy of the other is returned. If both lists are %NULL, %NULL is returned.
//
// Free-function: gst_tag_list_unref
func (list1 *TagList) Merge(list2 *TagList, mode TagMergeMode) *TagList {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.GstTagList // in, none, converted, nullable
var carg2 C.GstTagMergeMode // in, none, casted
var cret *C.GstTagList // return, full, converted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list1))
if list2 != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(list2))
}
carg2 = C.GstTagMergeMode(mode)
cret = C.gst_tag_list_merge(carg0, carg1, carg2)
runtime.KeepAlive(list1)
runtime.KeepAlive(list2)
runtime.KeepAlive(mode)
var goret *TagList
goret = UnsafeTagListFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NTags wraps gst_tag_list_n_tags
// The function returns the following values:
//
// - goret int
//
// Get the number of tags in @list.
func (list *TagList) NTags() int {
var carg0 *C.GstTagList // in, none, converted
var cret C.gint // return, none, casted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
cret = C.gst_tag_list_n_tags(carg0)
runtime.KeepAlive(list)
var goret int
goret = int(cret)
return goret
}
// NthTagName wraps gst_tag_list_nth_tag_name
//
// The function takes the following parameters:
//
// - index uint: the index
//
// The function returns the following values:
//
// - goret string
//
// Get the name of the tag in @list at @index.
func (list *TagList) NthTagName(index uint) string {
var carg0 *C.GstTagList // in, none, converted
var carg1 C.guint // in, none, casted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg1 = C.guint(index)
cret = C.gst_tag_list_nth_tag_name(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(index)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// PeekStringIndex wraps gst_tag_list_peek_string_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 string: location for the result
// - goret bool
//
// Peeks at the value that is at the given index for the given tag in the given
// list.
//
// The resulting string in @value will be in UTF-8 encoding and doesn't need
// to be freed by the caller. The returned string is also guaranteed to
// be non-%NULL and non-empty.
func (list *TagList) PeekStringIndex(tag string, index uint) (string, 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.gchar // out, none, string, casted *C.gchar
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_peek_string_index(carg0, carg1, carg2, &carg3)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
runtime.KeepAlive(index)
var value string
var goret bool
value = C.GoString((*C.char)(unsafe.Pointer(carg3)))
if cret != 0 {
goret = true
}
return value, goret
}
// RemoveTag wraps gst_tag_list_remove_tag
//
// The function takes the following parameters:
//
// - tag string: tag to remove
//
// Removes the given tag from the taglist.
func (list *TagList) RemoveTag(tag string) {
var carg0 *C.GstTagList // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(tag)))
defer C.free(unsafe.Pointer(carg1))
C.gst_tag_list_remove_tag(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(tag)
}
// SetScope wraps gst_tag_list_set_scope
//
// The function takes the following parameters:
//
// - scope TagScope: new scope for @list
//
// Sets the scope of @list to @scope. By default the scope
// of a taglist is stream scope.
func (list *TagList) SetScope(scope TagScope) {
var carg0 *C.GstTagList // in, none, converted
var carg1 C.GstTagScope // in, none, casted
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
carg1 = C.GstTagScope(scope)
C.gst_tag_list_set_scope(carg0, carg1)
runtime.KeepAlive(list)
runtime.KeepAlive(scope)
}
// ToString wraps gst_tag_list_to_string
// The function returns the following values:
//
// - goret string
//
// Serializes a tag list to a string.
func (list *TagList) ToString() string {
var carg0 *C.GstTagList // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstTagList)(UnsafeTagListToGlibNone(list))
cret = C.gst_tag_list_to_string(carg0)
runtime.KeepAlive(list)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// TagSetterInterface wraps GstTagSetterInterface
//
// #GstTagSetterInterface interface.
type TagSetterInterface struct {
*tagSetterInterface
}
// tagSetterInterface is the struct that's finalized
type tagSetterInterface struct {
native *C.GstTagSetterInterface
}
// UnsafeTagSetterInterfaceFromGlibBorrow is used to convert raw C.GstTagSetterInterface pointers to go. This is used by the bindings internally.
func UnsafeTagSetterInterfaceFromGlibBorrow(p unsafe.Pointer) *TagSetterInterface {
return &TagSetterInterface{&tagSetterInterface{(*C.GstTagSetterInterface)(p)}}
}
// UnsafeTagSetterInterfaceFromGlibNone is used to convert raw C.GstTagSetterInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTagSetterInterfaceFromGlibNone(p unsafe.Pointer) *TagSetterInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTagSetterInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tagSetterInterface,
func (intern *tagSetterInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTagSetterInterfaceFromGlibFull is used to convert raw C.GstTagSetterInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTagSetterInterfaceFromGlibFull(p unsafe.Pointer) *TagSetterInterface {
wrapped := UnsafeTagSetterInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tagSetterInterface,
func (intern *tagSetterInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTagSetterInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TagSetterInterface] is expected to work anymore.
func UnsafeTagSetterInterfaceFree(t *TagSetterInterface) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTagSetterInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTagSetterInterfaceToGlibNone(t *TagSetterInterface) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTagSetterInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTagSetterInterfaceToGlibFull(t *TagSetterInterface) unsafe.Pointer {
runtime.SetFinalizer(t.tagSetterInterface, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TagSetterInterface is invalid from here on
return _p
}
// TaskClass wraps GstTaskClass
type TaskClass struct {
*taskClass
}
// taskClass is the struct that's finalized
type taskClass struct {
native *C.GstTaskClass
}
// UnsafeTaskClassFromGlibBorrow is used to convert raw C.GstTaskClass pointers to go. This is used by the bindings internally.
func UnsafeTaskClassFromGlibBorrow(p unsafe.Pointer) *TaskClass {
return &TaskClass{&taskClass{(*C.GstTaskClass)(p)}}
}
// UnsafeTaskClassFromGlibNone is used to convert raw C.GstTaskClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTaskClassFromGlibNone(p unsafe.Pointer) *TaskClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTaskClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.taskClass,
func (intern *taskClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTaskClassFromGlibFull is used to convert raw C.GstTaskClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTaskClassFromGlibFull(p unsafe.Pointer) *TaskClass {
wrapped := UnsafeTaskClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.taskClass,
func (intern *taskClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTaskClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TaskClass] is expected to work anymore.
func UnsafeTaskClassFree(t *TaskClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTaskClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTaskClassToGlibNone(t *TaskClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTaskClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTaskClassToGlibFull(t *TaskClass) unsafe.Pointer {
runtime.SetFinalizer(t.taskClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TaskClass is invalid from here on
return _p
}
// TaskPoolClass wraps GstTaskPoolClass
//
// The #GstTaskPoolClass object.
type TaskPoolClass struct {
*taskPoolClass
}
// taskPoolClass is the struct that's finalized
type taskPoolClass struct {
native *C.GstTaskPoolClass
}
// UnsafeTaskPoolClassFromGlibBorrow is used to convert raw C.GstTaskPoolClass pointers to go. This is used by the bindings internally.
func UnsafeTaskPoolClassFromGlibBorrow(p unsafe.Pointer) *TaskPoolClass {
return &TaskPoolClass{&taskPoolClass{(*C.GstTaskPoolClass)(p)}}
}
// UnsafeTaskPoolClassFromGlibNone is used to convert raw C.GstTaskPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTaskPoolClassFromGlibNone(p unsafe.Pointer) *TaskPoolClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTaskPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.taskPoolClass,
func (intern *taskPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTaskPoolClassFromGlibFull is used to convert raw C.GstTaskPoolClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTaskPoolClassFromGlibFull(p unsafe.Pointer) *TaskPoolClass {
wrapped := UnsafeTaskPoolClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.taskPoolClass,
func (intern *taskPoolClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTaskPoolClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TaskPoolClass] is expected to work anymore.
func UnsafeTaskPoolClassFree(t *TaskPoolClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTaskPoolClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTaskPoolClassToGlibNone(t *TaskPoolClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTaskPoolClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTaskPoolClassToGlibFull(t *TaskPoolClass) unsafe.Pointer {
runtime.SetFinalizer(t.taskPoolClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TaskPoolClass is invalid from here on
return _p
}
// TimedValue wraps GstTimedValue
//
// Structure for storing a timestamp and a value.
type TimedValue struct {
*timedValue
}
// timedValue is the struct that's finalized
type timedValue struct {
native *C.GstTimedValue
}
// UnsafeTimedValueFromGlibBorrow is used to convert raw C.GstTimedValue pointers to go. This is used by the bindings internally.
func UnsafeTimedValueFromGlibBorrow(p unsafe.Pointer) *TimedValue {
return &TimedValue{&timedValue{(*C.GstTimedValue)(p)}}
}
// UnsafeTimedValueFromGlibNone is used to convert raw C.GstTimedValue pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTimedValueFromGlibNone(p unsafe.Pointer) *TimedValue {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTimedValueFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.timedValue,
func (intern *timedValue) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTimedValueFromGlibFull is used to convert raw C.GstTimedValue pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTimedValueFromGlibFull(p unsafe.Pointer) *TimedValue {
wrapped := UnsafeTimedValueFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.timedValue,
func (intern *timedValue) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTimedValueFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TimedValue] is expected to work anymore.
func UnsafeTimedValueFree(t *TimedValue) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTimedValueToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTimedValueToGlibNone(t *TimedValue) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTimedValueToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTimedValueToGlibFull(t *TimedValue) unsafe.Pointer {
runtime.SetFinalizer(t.timedValue, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TimedValue is invalid from here on
return _p
}
// Toc wraps GstToc
//
// #GstToc functions are used to create/free #GstToc and #GstTocEntry structures.
// Also they are used to convert #GstToc into #GstStructure and vice versa.
//
// #GstToc lets you to inform other elements in pipeline or application that playing
// source has some kind of table of contents (TOC). These may be chapters, editions,
// angles or other types. For example: DVD chapters, Matroska chapters or cue sheet
// TOC. Such TOC will be useful for applications to display instead of just a
// playlist.
//
// Using TOC is very easy. Firstly, create #GstToc structure which represents root
// contents of the source. You can also attach TOC-specific tags to it. Then fill
// it with #GstTocEntry entries by appending them to the #GstToc using
// gst_toc_append_entry(), and appending subentries to a #GstTocEntry using
// gst_toc_entry_append_sub_entry().
//
// Note that root level of the TOC can contain only either editions or chapters. You
// should not mix them together at the same level. Otherwise you will get serialization
// /deserialization errors. Make sure that no one of the entries has negative start and
// stop values.
//
// Use gst_event_new_toc() to create a new TOC #GstEvent, and gst_event_parse_toc() to
// parse received TOC event. Use gst_event_new_toc_select() to create a new TOC select #GstEvent,
// and gst_event_parse_toc_select() to parse received TOC select event. The same rule for
// the #GstMessage: gst_message_new_toc() to create new TOC #GstMessage, and
// gst_message_parse_toc() to parse received TOC message.
//
// TOCs can have global scope or current scope. Global scope TOCs contain
// all entries that can possibly be selected using a toc select event, and
// are what an application is usually interested in. TOCs with current scope
// only contain the parts of the TOC relevant to the currently selected/playing
// stream; the current scope TOC is used by downstream elements such as muxers
// to write correct TOC entries when transcoding files, for example. When
// playing a DVD, the global TOC would contain a hierarchy of all titles,
// chapters and angles, for example, while the current TOC would only contain
// the chapters for the currently playing title if playback of a specific
// title was requested.
//
// Applications and plugins should not rely on TOCs having a certain kind of
// structure, but should allow for different alternatives. For example, a
// simple CUE sheet embedded in a file may be presented as a flat list of
// track entries, or could have a top-level edition node (or some other
// alternative type entry) with track entries underneath that node; or even
// multiple top-level edition nodes (or some other alternative type entries)
// each with track entries underneath, in case the source file has extracted
// a track listing from different sources).
type Toc struct {
*toc
}
// toc is the struct that's finalized
type toc struct {
native *C.GstToc
}
var _ gobject.GoValueInitializer = (*Toc)(nil)
func marshalToc(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeTocFromGlibBorrow(b), nil
}
func (r *Toc) InitGoValue(v *gobject.Value) {
v.Init(TypeToc)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeTocFromGlibBorrow is used to convert raw C.GstToc pointers to go. This is used by the bindings internally.
func UnsafeTocFromGlibBorrow(p unsafe.Pointer) *Toc {
return &Toc{&toc{(*C.GstToc)(p)}}
}
// UnsafeTocFromGlibNone is used to convert raw C.GstToc pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocFromGlibNone(p unsafe.Pointer) *Toc {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTocFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.toc,
func (intern *toc) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocFromGlibFull is used to convert raw C.GstToc pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocFromGlibFull(p unsafe.Pointer) *Toc {
wrapped := UnsafeTocFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.toc,
func (intern *toc) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Toc] is expected to work anymore.
func UnsafeTocFree(t *Toc) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTocToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTocToGlibNone(t *Toc) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTocToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTocToGlibFull(t *Toc) unsafe.Pointer {
runtime.SetFinalizer(t.toc, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // Toc is invalid from here on
return _p
}
// NewToc wraps gst_toc_new
//
// The function takes the following parameters:
//
// - scope TocScope: scope of this TOC
//
// The function returns the following values:
//
// - goret *Toc
//
// Create a new #GstToc structure.
func NewToc(scope TocScope) *Toc {
var carg1 C.GstTocScope // in, none, casted
var cret *C.GstToc // return, full, converted
carg1 = C.GstTocScope(scope)
cret = C.gst_toc_new(carg1)
runtime.KeepAlive(scope)
var goret *Toc
goret = UnsafeTocFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AppendEntry wraps gst_toc_append_entry
//
// The function takes the following parameters:
//
// - entry *TocEntry: A #GstTocEntry
//
// Appends the #GstTocEntry @entry to @toc.
func (toc *Toc) AppendEntry(entry *TocEntry) {
var carg0 *C.GstToc // in, none, converted
var carg1 *C.GstTocEntry // in, full, converted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
carg1 = (*C.GstTocEntry)(UnsafeTocEntryToGlibFull(entry))
C.gst_toc_append_entry(carg0, carg1)
runtime.KeepAlive(toc)
runtime.KeepAlive(entry)
}
// Dump wraps gst_toc_dump
func (toc *Toc) Dump() {
var carg0 *C.GstToc // in, none, converted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
C.gst_toc_dump(carg0)
runtime.KeepAlive(toc)
}
// FindEntry wraps gst_toc_find_entry
//
// The function takes the following parameters:
//
// - uid string: UID to find #GstTocEntry with.
//
// The function returns the following values:
//
// - goret *TocEntry
//
// Find #GstTocEntry with given @uid in the @toc.
func (toc *Toc) FindEntry(uid string) *TocEntry {
var carg0 *C.GstToc // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstTocEntry // return, none, converted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uid)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_toc_find_entry(carg0, carg1)
runtime.KeepAlive(toc)
runtime.KeepAlive(uid)
var goret *TocEntry
goret = UnsafeTocEntryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetScope wraps gst_toc_get_scope
// The function returns the following values:
//
// - goret TocScope
func (toc *Toc) GetScope() TocScope {
var carg0 *C.GstToc // in, none, converted
var cret C.GstTocScope // return, none, casted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
cret = C.gst_toc_get_scope(carg0)
runtime.KeepAlive(toc)
var goret TocScope
goret = TocScope(cret)
return goret
}
// GetTags wraps gst_toc_get_tags
// The function returns the following values:
//
// - goret *TagList
//
// Gets the tags for @toc.
func (toc *Toc) GetTags() *TagList {
var carg0 *C.GstToc // in, none, converted
var cret *C.GstTagList // return, none, converted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
cret = C.gst_toc_get_tags(carg0)
runtime.KeepAlive(toc)
var goret *TagList
goret = UnsafeTagListFromGlibNone(unsafe.Pointer(cret))
return goret
}
// MergeTags wraps gst_toc_merge_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): A #GstTagList or %NULL
// - mode TagMergeMode: A #GstTagMergeMode
//
// Merge @tags into the existing tags of @toc using @mode.
func (toc *Toc) MergeTags(tags *TagList, mode TagMergeMode) {
var carg0 *C.GstToc // in, none, converted
var carg1 *C.GstTagList // in, none, converted, nullable
var carg2 C.GstTagMergeMode // in, none, casted
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
if tags != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(tags))
}
carg2 = C.GstTagMergeMode(mode)
C.gst_toc_merge_tags(carg0, carg1, carg2)
runtime.KeepAlive(toc)
runtime.KeepAlive(tags)
runtime.KeepAlive(mode)
}
// SetTags wraps gst_toc_set_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): A #GstTagList or %NULL
//
// Set a #GstTagList with tags for the complete @toc.
func (toc *Toc) SetTags(tags *TagList) {
var carg0 *C.GstToc // in, none, converted
var carg1 *C.GstTagList // in, full, converted, nullable
carg0 = (*C.GstToc)(UnsafeTocToGlibNone(toc))
if tags != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibFull(tags))
}
C.gst_toc_set_tags(carg0, carg1)
runtime.KeepAlive(toc)
runtime.KeepAlive(tags)
}
// TocEntry wraps GstTocEntry
type TocEntry struct {
*tocEntry
}
// tocEntry is the struct that's finalized
type tocEntry struct {
native *C.GstTocEntry
}
var _ gobject.GoValueInitializer = (*TocEntry)(nil)
func marshalTocEntry(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeTocEntryFromGlibBorrow(b), nil
}
func (r *TocEntry) InitGoValue(v *gobject.Value) {
v.Init(TypeTocEntry)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeTocEntryFromGlibBorrow is used to convert raw C.GstTocEntry pointers to go. This is used by the bindings internally.
func UnsafeTocEntryFromGlibBorrow(p unsafe.Pointer) *TocEntry {
return &TocEntry{&tocEntry{(*C.GstTocEntry)(p)}}
}
// UnsafeTocEntryFromGlibNone is used to convert raw C.GstTocEntry pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocEntryFromGlibNone(p unsafe.Pointer) *TocEntry {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTocEntryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tocEntry,
func (intern *tocEntry) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocEntryFromGlibFull is used to convert raw C.GstTocEntry pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocEntryFromGlibFull(p unsafe.Pointer) *TocEntry {
wrapped := UnsafeTocEntryFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tocEntry,
func (intern *tocEntry) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocEntryFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TocEntry] is expected to work anymore.
func UnsafeTocEntryFree(t *TocEntry) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTocEntryToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTocEntryToGlibNone(t *TocEntry) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTocEntryToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTocEntryToGlibFull(t *TocEntry) unsafe.Pointer {
runtime.SetFinalizer(t.tocEntry, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TocEntry is invalid from here on
return _p
}
// NewTocEntry wraps gst_toc_entry_new
//
// The function takes the following parameters:
//
// - typ TocEntryType: entry type.
// - uid string: unique ID (UID) in the whole TOC.
//
// The function returns the following values:
//
// - goret *TocEntry
//
// Create new #GstTocEntry structure.
func NewTocEntry(typ TocEntryType, uid string) *TocEntry {
var carg1 C.GstTocEntryType // in, none, casted
var carg2 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstTocEntry // return, full, converted
carg1 = C.GstTocEntryType(typ)
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(uid)))
defer C.free(unsafe.Pointer(carg2))
cret = C.gst_toc_entry_new(carg1, carg2)
runtime.KeepAlive(typ)
runtime.KeepAlive(uid)
var goret *TocEntry
goret = UnsafeTocEntryFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AppendSubEntry wraps gst_toc_entry_append_sub_entry
//
// The function takes the following parameters:
//
// - subentry *TocEntry: A #GstTocEntry
//
// Appends the #GstTocEntry @subentry to @entry.
func (entry *TocEntry) AppendSubEntry(subentry *TocEntry) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 *C.GstTocEntry // in, full, converted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
carg1 = (*C.GstTocEntry)(UnsafeTocEntryToGlibFull(subentry))
C.gst_toc_entry_append_sub_entry(carg0, carg1)
runtime.KeepAlive(entry)
runtime.KeepAlive(subentry)
}
// GetEntryType wraps gst_toc_entry_get_entry_type
// The function returns the following values:
//
// - goret TocEntryType
func (entry *TocEntry) GetEntryType() TocEntryType {
var carg0 *C.GstTocEntry // in, none, converted
var cret C.GstTocEntryType // return, none, casted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_entry_type(carg0)
runtime.KeepAlive(entry)
var goret TocEntryType
goret = TocEntryType(cret)
return goret
}
// GetLoop wraps gst_toc_entry_get_loop
// The function returns the following values:
//
// - loopType TocLoopType: the storage for the loop_type
// value, leave %NULL if not need.
// - repeatCount int: the storage for the repeat_count
// value, leave %NULL if not need.
// - goret bool
//
// Get @loop_type and @repeat_count values from the @entry and write them into
// appropriate storages. Loops are e.g. used by sampled instruments. GStreamer
// is not automatically applying the loop. The application can process this
// meta data and use it e.g. to send a seek-event to loop a section.
func (entry *TocEntry) GetLoop() (TocLoopType, int, bool) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 C.GstTocLoopType // out, full, casted
var carg2 C.gint // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_loop(carg0, &carg1, &carg2)
runtime.KeepAlive(entry)
var loopType TocLoopType
var repeatCount int
var goret bool
loopType = TocLoopType(carg1)
repeatCount = int(carg2)
if cret != 0 {
goret = true
}
return loopType, repeatCount, goret
}
// GetParent wraps gst_toc_entry_get_parent
// The function returns the following values:
//
// - goret *TocEntry
//
// Gets the parent #GstTocEntry of @entry.
func (entry *TocEntry) GetParent() *TocEntry {
var carg0 *C.GstTocEntry // in, none, converted
var cret *C.GstTocEntry // return, none, converted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_parent(carg0)
runtime.KeepAlive(entry)
var goret *TocEntry
goret = UnsafeTocEntryFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetStartStopTimes wraps gst_toc_entry_get_start_stop_times
// The function returns the following values:
//
// - start int64: the storage for the start value, leave
// %NULL if not need.
// - stop int64: the storage for the stop value, leave
// %NULL if not need.
// - goret bool
//
// Get @start and @stop values from the @entry and write them into appropriate
// storages.
func (entry *TocEntry) GetStartStopTimes() (int64, int64, bool) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 C.gint64 // out, full, casted
var carg2 C.gint64 // out, full, casted
var cret C.gboolean // return
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_start_stop_times(carg0, &carg1, &carg2)
runtime.KeepAlive(entry)
var start int64
var stop int64
var goret bool
start = int64(carg1)
stop = int64(carg2)
if cret != 0 {
goret = true
}
return start, stop, goret
}
// GetTags wraps gst_toc_entry_get_tags
// The function returns the following values:
//
// - goret *TagList
//
// Gets the tags for @entry.
func (entry *TocEntry) GetTags() *TagList {
var carg0 *C.GstTocEntry // in, none, converted
var cret *C.GstTagList // return, none, converted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_tags(carg0)
runtime.KeepAlive(entry)
var goret *TagList
goret = UnsafeTagListFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetToc wraps gst_toc_entry_get_toc
// The function returns the following values:
//
// - goret *Toc
//
// Gets the parent #GstToc of @entry.
func (entry *TocEntry) GetToc() *Toc {
var carg0 *C.GstTocEntry // in, none, converted
var cret *C.GstToc // return, none, converted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_toc(carg0)
runtime.KeepAlive(entry)
var goret *Toc
goret = UnsafeTocFromGlibNone(unsafe.Pointer(cret))
return goret
}
// GetUid wraps gst_toc_entry_get_uid
// The function returns the following values:
//
// - goret string
//
// Gets the UID of @entry.
func (entry *TocEntry) GetUid() string {
var carg0 *C.GstTocEntry // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_get_uid(carg0)
runtime.KeepAlive(entry)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// IsAlternative wraps gst_toc_entry_is_alternative
// The function returns the following values:
//
// - goret bool
func (entry *TocEntry) IsAlternative() bool {
var carg0 *C.GstTocEntry // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_is_alternative(carg0)
runtime.KeepAlive(entry)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsSequence wraps gst_toc_entry_is_sequence
// The function returns the following values:
//
// - goret bool
func (entry *TocEntry) IsSequence() bool {
var carg0 *C.GstTocEntry // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
cret = C.gst_toc_entry_is_sequence(carg0)
runtime.KeepAlive(entry)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// MergeTags wraps gst_toc_entry_merge_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): A #GstTagList or %NULL
// - mode TagMergeMode: A #GstTagMergeMode
//
// Merge @tags into the existing tags of @entry using @mode.
func (entry *TocEntry) MergeTags(tags *TagList, mode TagMergeMode) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 *C.GstTagList // in, none, converted, nullable
var carg2 C.GstTagMergeMode // in, none, casted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
if tags != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibNone(tags))
}
carg2 = C.GstTagMergeMode(mode)
C.gst_toc_entry_merge_tags(carg0, carg1, carg2)
runtime.KeepAlive(entry)
runtime.KeepAlive(tags)
runtime.KeepAlive(mode)
}
// SetLoop wraps gst_toc_entry_set_loop
//
// The function takes the following parameters:
//
// - loopType TocLoopType: loop_type value to set.
// - repeatCount int: repeat_count value to set.
//
// Set @loop_type and @repeat_count values for the @entry.
func (entry *TocEntry) SetLoop(loopType TocLoopType, repeatCount int) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 C.GstTocLoopType // in, none, casted
var carg2 C.gint // in, none, casted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
carg1 = C.GstTocLoopType(loopType)
carg2 = C.gint(repeatCount)
C.gst_toc_entry_set_loop(carg0, carg1, carg2)
runtime.KeepAlive(entry)
runtime.KeepAlive(loopType)
runtime.KeepAlive(repeatCount)
}
// SetStartStopTimes wraps gst_toc_entry_set_start_stop_times
//
// The function takes the following parameters:
//
// - start int64: start value to set.
// - stop int64: stop value to set.
//
// Set @start and @stop values for the @entry.
func (entry *TocEntry) SetStartStopTimes(start int64, stop int64) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 C.gint64 // in, none, casted
var carg2 C.gint64 // in, none, casted
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
carg1 = C.gint64(start)
carg2 = C.gint64(stop)
C.gst_toc_entry_set_start_stop_times(carg0, carg1, carg2)
runtime.KeepAlive(entry)
runtime.KeepAlive(start)
runtime.KeepAlive(stop)
}
// SetTags wraps gst_toc_entry_set_tags
//
// The function takes the following parameters:
//
// - tags *TagList (nullable): A #GstTagList or %NULL
//
// Set a #GstTagList with tags for the complete @entry.
func (entry *TocEntry) SetTags(tags *TagList) {
var carg0 *C.GstTocEntry // in, none, converted
var carg1 *C.GstTagList // in, full, converted, nullable
carg0 = (*C.GstTocEntry)(UnsafeTocEntryToGlibNone(entry))
if tags != nil {
carg1 = (*C.GstTagList)(UnsafeTagListToGlibFull(tags))
}
C.gst_toc_entry_set_tags(carg0, carg1)
runtime.KeepAlive(entry)
runtime.KeepAlive(tags)
}
// TocSetterInterface wraps GstTocSetterInterface
//
// #GstTocSetterInterface interface.
type TocSetterInterface struct {
*tocSetterInterface
}
// tocSetterInterface is the struct that's finalized
type tocSetterInterface struct {
native *C.GstTocSetterInterface
}
// UnsafeTocSetterInterfaceFromGlibBorrow is used to convert raw C.GstTocSetterInterface pointers to go. This is used by the bindings internally.
func UnsafeTocSetterInterfaceFromGlibBorrow(p unsafe.Pointer) *TocSetterInterface {
return &TocSetterInterface{&tocSetterInterface{(*C.GstTocSetterInterface)(p)}}
}
// UnsafeTocSetterInterfaceFromGlibNone is used to convert raw C.GstTocSetterInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocSetterInterfaceFromGlibNone(p unsafe.Pointer) *TocSetterInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTocSetterInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tocSetterInterface,
func (intern *tocSetterInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocSetterInterfaceFromGlibFull is used to convert raw C.GstTocSetterInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTocSetterInterfaceFromGlibFull(p unsafe.Pointer) *TocSetterInterface {
wrapped := UnsafeTocSetterInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tocSetterInterface,
func (intern *tocSetterInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTocSetterInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TocSetterInterface] is expected to work anymore.
func UnsafeTocSetterInterfaceFree(t *TocSetterInterface) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTocSetterInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTocSetterInterfaceToGlibNone(t *TocSetterInterface) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTocSetterInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTocSetterInterfaceToGlibFull(t *TocSetterInterface) unsafe.Pointer {
runtime.SetFinalizer(t.tocSetterInterface, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TocSetterInterface is invalid from here on
return _p
}
// TracerClass wraps GstTracerClass
type TracerClass struct {
*tracerClass
}
// tracerClass is the struct that's finalized
type tracerClass struct {
native *C.GstTracerClass
}
// UnsafeTracerClassFromGlibBorrow is used to convert raw C.GstTracerClass pointers to go. This is used by the bindings internally.
func UnsafeTracerClassFromGlibBorrow(p unsafe.Pointer) *TracerClass {
return &TracerClass{&tracerClass{(*C.GstTracerClass)(p)}}
}
// UnsafeTracerClassFromGlibNone is used to convert raw C.GstTracerClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerClassFromGlibNone(p unsafe.Pointer) *TracerClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTracerClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerClass,
func (intern *tracerClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerClassFromGlibFull is used to convert raw C.GstTracerClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerClassFromGlibFull(p unsafe.Pointer) *TracerClass {
wrapped := UnsafeTracerClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerClass,
func (intern *tracerClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TracerClass] is expected to work anymore.
func UnsafeTracerClassFree(t *TracerClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTracerClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTracerClassToGlibNone(t *TracerClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTracerClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTracerClassToGlibFull(t *TracerClass) unsafe.Pointer {
runtime.SetFinalizer(t.tracerClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TracerClass is invalid from here on
return _p
}
// TracerFactoryClass wraps GstTracerFactoryClass
type TracerFactoryClass struct {
*tracerFactoryClass
}
// tracerFactoryClass is the struct that's finalized
type tracerFactoryClass struct {
native *C.GstTracerFactoryClass
}
// UnsafeTracerFactoryClassFromGlibBorrow is used to convert raw C.GstTracerFactoryClass pointers to go. This is used by the bindings internally.
func UnsafeTracerFactoryClassFromGlibBorrow(p unsafe.Pointer) *TracerFactoryClass {
return &TracerFactoryClass{&tracerFactoryClass{(*C.GstTracerFactoryClass)(p)}}
}
// UnsafeTracerFactoryClassFromGlibNone is used to convert raw C.GstTracerFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerFactoryClassFromGlibNone(p unsafe.Pointer) *TracerFactoryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTracerFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerFactoryClass,
func (intern *tracerFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerFactoryClassFromGlibFull is used to convert raw C.GstTracerFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerFactoryClassFromGlibFull(p unsafe.Pointer) *TracerFactoryClass {
wrapped := UnsafeTracerFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerFactoryClass,
func (intern *tracerFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerFactoryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TracerFactoryClass] is expected to work anymore.
func UnsafeTracerFactoryClassFree(t *TracerFactoryClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTracerFactoryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTracerFactoryClassToGlibNone(t *TracerFactoryClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTracerFactoryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTracerFactoryClassToGlibFull(t *TracerFactoryClass) unsafe.Pointer {
runtime.SetFinalizer(t.tracerFactoryClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TracerFactoryClass is invalid from here on
return _p
}
// TracerRecordClass wraps GstTracerRecordClass
type TracerRecordClass struct {
*tracerRecordClass
}
// tracerRecordClass is the struct that's finalized
type tracerRecordClass struct {
native *C.GstTracerRecordClass
}
// UnsafeTracerRecordClassFromGlibBorrow is used to convert raw C.GstTracerRecordClass pointers to go. This is used by the bindings internally.
func UnsafeTracerRecordClassFromGlibBorrow(p unsafe.Pointer) *TracerRecordClass {
return &TracerRecordClass{&tracerRecordClass{(*C.GstTracerRecordClass)(p)}}
}
// UnsafeTracerRecordClassFromGlibNone is used to convert raw C.GstTracerRecordClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerRecordClassFromGlibNone(p unsafe.Pointer) *TracerRecordClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTracerRecordClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerRecordClass,
func (intern *tracerRecordClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerRecordClassFromGlibFull is used to convert raw C.GstTracerRecordClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTracerRecordClassFromGlibFull(p unsafe.Pointer) *TracerRecordClass {
wrapped := UnsafeTracerRecordClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.tracerRecordClass,
func (intern *tracerRecordClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTracerRecordClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TracerRecordClass] is expected to work anymore.
func UnsafeTracerRecordClassFree(t *TracerRecordClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTracerRecordClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTracerRecordClassToGlibNone(t *TracerRecordClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTracerRecordClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTracerRecordClassToGlibFull(t *TracerRecordClass) unsafe.Pointer {
runtime.SetFinalizer(t.tracerRecordClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TracerRecordClass is invalid from here on
return _p
}
// TypeFind wraps GstTypeFind
//
// The following functions allow you to detect the media type of an unknown
// stream.
type TypeFind struct {
*typeFind
}
// typeFind is the struct that's finalized
type typeFind struct {
native *C.GstTypeFind
}
var _ gobject.GoValueInitializer = (*TypeFind)(nil)
func marshalTypeFind(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeTypeFindFromGlibBorrow(b), nil
}
func (r *TypeFind) InitGoValue(v *gobject.Value) {
v.Init(TypeTypeFind)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeTypeFindFromGlibBorrow is used to convert raw C.GstTypeFind pointers to go. This is used by the bindings internally.
func UnsafeTypeFindFromGlibBorrow(p unsafe.Pointer) *TypeFind {
return &TypeFind{&typeFind{(*C.GstTypeFind)(p)}}
}
// UnsafeTypeFindFromGlibNone is used to convert raw C.GstTypeFind pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTypeFindFromGlibNone(p unsafe.Pointer) *TypeFind {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTypeFindFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.typeFind,
func (intern *typeFind) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTypeFindFromGlibFull is used to convert raw C.GstTypeFind pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTypeFindFromGlibFull(p unsafe.Pointer) *TypeFind {
wrapped := UnsafeTypeFindFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.typeFind,
func (intern *typeFind) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTypeFindFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TypeFind] is expected to work anymore.
func UnsafeTypeFindFree(t *TypeFind) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTypeFindToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTypeFindToGlibNone(t *TypeFind) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTypeFindToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTypeFindToGlibFull(t *TypeFind) unsafe.Pointer {
runtime.SetFinalizer(t.typeFind, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TypeFind is invalid from here on
return _p
}
// GetLength wraps gst_type_find_get_length
// The function returns the following values:
//
// - goret uint64
//
// Get the length of the data stream.
func (find *TypeFind) GetLength() uint64 {
var carg0 *C.GstTypeFind // in, none, converted
var cret C.guint64 // return, none, casted
carg0 = (*C.GstTypeFind)(UnsafeTypeFindToGlibNone(find))
cret = C.gst_type_find_get_length(carg0)
runtime.KeepAlive(find)
var goret uint64
goret = uint64(cret)
return goret
}
// Peek wraps gst_type_find_peek
//
// The function takes the following parameters:
//
// - offset int64: The offset
// - size uint: The number of bytes to return
//
// The function returns the following values:
//
// - goret *uint8
//
// Returns the @size bytes of the stream to identify beginning at offset. If
// offset is a positive number, the offset is relative to the beginning of the
// stream, if offset is a negative number the offset is relative to the end of
// the stream. The returned memory is valid until the typefinding function
// returns and must not be freed.
func (find *TypeFind) Peek(offset int64, size uint) *uint8 {
var carg0 *C.GstTypeFind // in, none, converted
var carg1 C.gint64 // in, none, casted
var carg2 C.guint // in, none, casted
var cret *C.guint8 // return, transfer: none, C Pointers: 1, Name: guint8, scope:
carg0 = (*C.GstTypeFind)(UnsafeTypeFindToGlibNone(find))
carg1 = C.gint64(offset)
carg2 = C.guint(size)
cret = C.gst_type_find_peek(carg0, carg1, carg2)
runtime.KeepAlive(find)
runtime.KeepAlive(offset)
runtime.KeepAlive(size)
var goret *uint8
_ = goret
_ = cret
panic("unimplemented conversion of *uint8 (guint8*)")
return goret
}
// Suggest wraps gst_type_find_suggest
//
// The function takes the following parameters:
//
// - probability uint: The probability in percent that the suggestion is right
// - caps *Caps: The fixed #GstCaps to suggest
//
// If a #GstTypeFindFunction calls this function it suggests the caps with the
// given probability. A #GstTypeFindFunction may supply different suggestions
// in one call.
// It is up to the caller of the #GstTypeFindFunction to interpret these values.
func (find *TypeFind) Suggest(probability uint, caps *Caps) {
var carg0 *C.GstTypeFind // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.GstCaps // in, none, converted
carg0 = (*C.GstTypeFind)(UnsafeTypeFindToGlibNone(find))
carg1 = C.guint(probability)
carg2 = (*C.GstCaps)(UnsafeCapsToGlibNone(caps))
C.gst_type_find_suggest(carg0, carg1, carg2)
runtime.KeepAlive(find)
runtime.KeepAlive(probability)
runtime.KeepAlive(caps)
}
// SuggestEmptySimple wraps gst_type_find_suggest_empty_simple
//
// The function takes the following parameters:
//
// - probability uint: The probability in percent that the suggestion is right
// - mediaType string: the media type of the suggested caps
//
// If a #GstTypeFindFunction calls this function it suggests caps of the
// given @media_type with the given @probability.
//
// This function is similar to gst_type_find_suggest_simple(), but uses
// a #GstCaps with no fields.
func (find *TypeFind) SuggestEmptySimple(probability uint, mediaType string) {
var carg0 *C.GstTypeFind // in, none, converted
var carg1 C.guint // in, none, casted
var carg2 *C.char // in, none, string, casted *C.gchar
carg0 = (*C.GstTypeFind)(UnsafeTypeFindToGlibNone(find))
carg1 = C.guint(probability)
carg2 = (*C.char)(unsafe.Pointer(C.CString(mediaType)))
defer C.free(unsafe.Pointer(carg2))
C.gst_type_find_suggest_empty_simple(carg0, carg1, carg2)
runtime.KeepAlive(find)
runtime.KeepAlive(probability)
runtime.KeepAlive(mediaType)
}
// TypeFindFactoryClass wraps GstTypeFindFactoryClass
type TypeFindFactoryClass struct {
*typeFindFactoryClass
}
// typeFindFactoryClass is the struct that's finalized
type typeFindFactoryClass struct {
native *C.GstTypeFindFactoryClass
}
// UnsafeTypeFindFactoryClassFromGlibBorrow is used to convert raw C.GstTypeFindFactoryClass pointers to go. This is used by the bindings internally.
func UnsafeTypeFindFactoryClassFromGlibBorrow(p unsafe.Pointer) *TypeFindFactoryClass {
return &TypeFindFactoryClass{&typeFindFactoryClass{(*C.GstTypeFindFactoryClass)(p)}}
}
// UnsafeTypeFindFactoryClassFromGlibNone is used to convert raw C.GstTypeFindFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTypeFindFactoryClassFromGlibNone(p unsafe.Pointer) *TypeFindFactoryClass {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeTypeFindFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.typeFindFactoryClass,
func (intern *typeFindFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTypeFindFactoryClassFromGlibFull is used to convert raw C.GstTypeFindFactoryClass pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeTypeFindFactoryClassFromGlibFull(p unsafe.Pointer) *TypeFindFactoryClass {
wrapped := UnsafeTypeFindFactoryClassFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.typeFindFactoryClass,
func (intern *typeFindFactoryClass) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeTypeFindFactoryClassFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [TypeFindFactoryClass] is expected to work anymore.
func UnsafeTypeFindFactoryClassFree(t *TypeFindFactoryClass) {
C.free(unsafe.Pointer(t.native))
}
// UnsafeTypeFindFactoryClassToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeTypeFindFactoryClassToGlibNone(t *TypeFindFactoryClass) unsafe.Pointer {
return unsafe.Pointer(t.native)
}
// UnsafeTypeFindFactoryClassToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeTypeFindFactoryClassToGlibFull(t *TypeFindFactoryClass) unsafe.Pointer {
runtime.SetFinalizer(t.typeFindFactoryClass, nil)
_p := unsafe.Pointer(t.native)
t.native = nil // TypeFindFactoryClass is invalid from here on
return _p
}
// URIHandlerInterface wraps GstURIHandlerInterface
//
// Any #GstElement using this interface should implement these methods.
type URIHandlerInterface struct {
*uriHandlerInterface
}
// uriHandlerInterface is the struct that's finalized
type uriHandlerInterface struct {
native *C.GstURIHandlerInterface
}
// UnsafeURIHandlerInterfaceFromGlibBorrow is used to convert raw C.GstURIHandlerInterface pointers to go. This is used by the bindings internally.
func UnsafeURIHandlerInterfaceFromGlibBorrow(p unsafe.Pointer) *URIHandlerInterface {
return &URIHandlerInterface{&uriHandlerInterface{(*C.GstURIHandlerInterface)(p)}}
}
// UnsafeURIHandlerInterfaceFromGlibNone is used to convert raw C.GstURIHandlerInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeURIHandlerInterfaceFromGlibNone(p unsafe.Pointer) *URIHandlerInterface {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeURIHandlerInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.uriHandlerInterface,
func (intern *uriHandlerInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeURIHandlerInterfaceFromGlibFull is used to convert raw C.GstURIHandlerInterface pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeURIHandlerInterfaceFromGlibFull(p unsafe.Pointer) *URIHandlerInterface {
wrapped := UnsafeURIHandlerInterfaceFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.uriHandlerInterface,
func (intern *uriHandlerInterface) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeURIHandlerInterfaceFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [URIHandlerInterface] is expected to work anymore.
func UnsafeURIHandlerInterfaceFree(u *URIHandlerInterface) {
C.free(unsafe.Pointer(u.native))
}
// UnsafeURIHandlerInterfaceToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeURIHandlerInterfaceToGlibNone(u *URIHandlerInterface) unsafe.Pointer {
return unsafe.Pointer(u.native)
}
// UnsafeURIHandlerInterfaceToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeURIHandlerInterfaceToGlibFull(u *URIHandlerInterface) unsafe.Pointer {
runtime.SetFinalizer(u.uriHandlerInterface, nil)
_p := unsafe.Pointer(u.native)
u.native = nil // URIHandlerInterface is invalid from here on
return _p
}
// Uri wraps GstUri
//
// A #GstUri object can be used to parse and split a URI string into its
// constituent parts. Two #GstUri objects can be joined to make a new #GstUri
// using the algorithm described in RFC3986.
type Uri struct {
*uri
}
// uri is the struct that's finalized
type uri struct {
native *C.GstUri
}
var _ gobject.GoValueInitializer = (*Uri)(nil)
func marshalUri(p unsafe.Pointer) (interface{}, error) {
b := gobject.ValueFromNative(p).Boxed()
return UnsafeUriFromGlibBorrow(b), nil
}
func (r *Uri) InitGoValue(v *gobject.Value) {
v.Init(TypeUri)
v.SetBoxed(unsafe.Pointer(r.native))
}
// UnsafeUriFromGlibBorrow is used to convert raw C.GstUri pointers to go. This is used by the bindings internally.
func UnsafeUriFromGlibBorrow(p unsafe.Pointer) *Uri {
return &Uri{&uri{(*C.GstUri)(p)}}
}
// UnsafeUriFromGlibNone is used to convert raw C.GstUri pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeUriFromGlibNone(p unsafe.Pointer) *Uri {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeUriFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.uri,
func (intern *uri) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeUriFromGlibFull is used to convert raw C.GstUri pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeUriFromGlibFull(p unsafe.Pointer) *Uri {
wrapped := UnsafeUriFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.uri,
func (intern *uri) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeUriFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [Uri] is expected to work anymore.
func UnsafeUriFree(u *Uri) {
C.free(unsafe.Pointer(u.native))
}
// UnsafeUriToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeUriToGlibNone(u *Uri) unsafe.Pointer {
return unsafe.Pointer(u.native)
}
// UnsafeUriToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeUriToGlibFull(u *Uri) unsafe.Pointer {
runtime.SetFinalizer(u.uri, nil)
_p := unsafe.Pointer(u.native)
u.native = nil // Uri is invalid from here on
return _p
}
// NewUri wraps gst_uri_new
//
// The function takes the following parameters:
//
// - scheme string (nullable): The scheme for the new URI.
// - userinfo string (nullable): The user-info for the new URI.
// - host string (nullable): The host name for the new URI.
// - port uint: The port number for the new URI or %GST_URI_NO_PORT.
// - path string (nullable): The path for the new URI with '/' separating path
// elements.
// - query string (nullable): The query string for the new URI with '&amp;' separating
// query elements. Elements containing '&amp;' characters
// should encode them as "&amp;percnt;26".
// - fragment string (nullable): The fragment name for the new URI.
//
// The function returns the following values:
//
// - goret *Uri
//
// Creates a new #GstUri object with the given URI parts. The path and query
// strings will be broken down into their elements. All strings should not be
// escaped except where indicated.
func NewUri(scheme string, userinfo string, host string, port uint, path string, query string, fragment string) *Uri {
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.gchar // in, none, string, nullable-string
var carg3 *C.gchar // in, none, string, nullable-string
var carg4 C.guint // in, none, casted
var carg5 *C.gchar // in, none, string, nullable-string
var carg6 *C.gchar // in, none, string, nullable-string
var carg7 *C.gchar // in, none, string, nullable-string
var cret *C.GstUri // return, full, converted
if scheme != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(scheme)))
defer C.free(unsafe.Pointer(carg1))
}
if userinfo != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(userinfo)))
defer C.free(unsafe.Pointer(carg2))
}
if host != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(host)))
defer C.free(unsafe.Pointer(carg3))
}
carg4 = C.guint(port)
if path != "" {
carg5 = (*C.gchar)(unsafe.Pointer(C.CString(path)))
defer C.free(unsafe.Pointer(carg5))
}
if query != "" {
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(query)))
defer C.free(unsafe.Pointer(carg6))
}
if fragment != "" {
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(fragment)))
defer C.free(unsafe.Pointer(carg7))
}
cret = C.gst_uri_new(carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(scheme)
runtime.KeepAlive(userinfo)
runtime.KeepAlive(host)
runtime.KeepAlive(port)
runtime.KeepAlive(path)
runtime.KeepAlive(query)
runtime.KeepAlive(fragment)
var goret *Uri
goret = UnsafeUriFromGlibFull(unsafe.Pointer(cret))
return goret
}
// AppendPath wraps gst_uri_append_path
//
// The function takes the following parameters:
//
// - relativePath string (nullable): Relative path to append to the end of the current path.
//
// The function returns the following values:
//
// - goret bool
//
// Append a path onto the end of the path in the URI. The path is not
// normalized, call #gst_uri_normalize() to normalize the path.
func (uri *Uri) AppendPath(relativePath string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
if relativePath != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(relativePath)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_uri_append_path(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(relativePath)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// AppendPathSegment wraps gst_uri_append_path_segment
//
// The function takes the following parameters:
//
// - pathSegment string (nullable): The path segment string to append to the URI path.
//
// The function returns the following values:
//
// - goret bool
//
// Append a single path segment onto the end of the URI path.
func (uri *Uri) AppendPathSegment(pathSegment string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
if pathSegment != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(pathSegment)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_uri_append_path_segment(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(pathSegment)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Equal wraps gst_uri_equal
//
// The function takes the following parameters:
//
// - second *Uri: Second #GstUri to compare.
//
// The function returns the following values:
//
// - goret bool
//
// Compares two #GstUri objects to see if they represent the same normalized
// URI.
func (first *Uri) Equal(second *Uri) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.GstUri // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(first))
carg1 = (*C.GstUri)(UnsafeUriToGlibNone(second))
cret = C.gst_uri_equal(carg0, carg1)
runtime.KeepAlive(first)
runtime.KeepAlive(second)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// FromStringWithBase wraps gst_uri_from_string_with_base
//
// The function takes the following parameters:
//
// - uri string: The URI string to parse.
//
// The function returns the following values:
//
// - goret *Uri
//
// Like gst_uri_from_string() but also joins with a base URI.
func (base *Uri) FromStringWithBase(uri string) *Uri {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.GstUri // return, full, converted
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(base))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(uri)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_from_string_with_base(carg0, carg1)
runtime.KeepAlive(base)
runtime.KeepAlive(uri)
var goret *Uri
goret = UnsafeUriFromGlibFull(unsafe.Pointer(cret))
return goret
}
// GetFragment wraps gst_uri_get_fragment
// The function returns the following values:
//
// - goret string
//
// Get the fragment name from the URI or %NULL if it doesn't exist.
// If @uri is %NULL then returns %NULL.
func (uri *Uri) GetFragment() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_fragment(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetHost wraps gst_uri_get_host
// The function returns the following values:
//
// - goret string
//
// Get the host name from the URI or %NULL if it doesn't exist.
// If @uri is %NULL then returns %NULL.
func (uri *Uri) GetHost() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_host(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetPath wraps gst_uri_get_path
// The function returns the following values:
//
// - goret string
//
// Extract the path string from the URI object.
func (uri *Uri) GetPath() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_path(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetPathString wraps gst_uri_get_path_string
// The function returns the following values:
//
// - goret string
//
// Extract the path string from the URI object as a percent encoded URI path.
func (uri *Uri) GetPathString() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_path_string(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetPort wraps gst_uri_get_port
// The function returns the following values:
//
// - goret uint
//
// Get the port number from the URI or %GST_URI_NO_PORT if it doesn't exist.
// If @uri is %NULL then returns %GST_URI_NO_PORT.
func (uri *Uri) GetPort() uint {
var carg0 *C.GstUri // in, none, converted
var cret C.guint // return, none, casted
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_port(carg0)
runtime.KeepAlive(uri)
var goret uint
goret = uint(cret)
return goret
}
// GetQueryString wraps gst_uri_get_query_string
// The function returns the following values:
//
// - goret string
//
// Get a percent encoded URI query string from the @uri.
func (uri *Uri) GetQueryString() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_query_string(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// GetQueryValue wraps gst_uri_get_query_value
//
// The function takes the following parameters:
//
// - queryKey string: The key to lookup.
//
// The function returns the following values:
//
// - goret string
//
// Get the value associated with the @query_key key. Will return %NULL if the
// key has no value or if the key does not exist in the URI query table. Because
// %NULL is returned for both missing keys and keys with no value, you should
// use gst_uri_query_has_key() to determine if a key is present in the URI
// query.
func (uri *Uri) GetQueryValue(queryKey string) string {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(queryKey)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_get_query_value(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(queryKey)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetScheme wraps gst_uri_get_scheme
// The function returns the following values:
//
// - goret string
//
// Get the scheme name from the URI or %NULL if it doesn't exist.
// If @uri is %NULL then returns %NULL.
func (uri *Uri) GetScheme() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_scheme(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// GetUserinfo wraps gst_uri_get_userinfo
// The function returns the following values:
//
// - goret string
//
// Get the userinfo (usually in the form "username:password") from the URI
// or %NULL if it doesn't exist. If @uri is %NULL then returns %NULL.
func (uri *Uri) GetUserinfo() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, none, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_get_userinfo(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
return goret
}
// IsNormalized wraps gst_uri_is_normalized
// The function returns the following values:
//
// - goret bool
//
// Tests the @uri to see if it is normalized. A %NULL @uri is considered to be
// normalized.
func (uri *Uri) IsNormalized() bool {
var carg0 *C.GstUri // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_is_normalized(carg0)
runtime.KeepAlive(uri)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// IsWritable wraps gst_uri_is_writable
// The function returns the following values:
//
// - goret bool
//
// Check if it is safe to write to this #GstUri.
//
// Check if the refcount of @uri is exactly 1, meaning that no other
// reference exists to the #GstUri and that the #GstUri is therefore writable.
//
// Modification of a #GstUri should only be done after verifying that it is
// writable.
func (uri *Uri) IsWritable() bool {
var carg0 *C.GstUri // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_is_writable(carg0)
runtime.KeepAlive(uri)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// Join wraps gst_uri_join
//
// The function takes the following parameters:
//
// - refUri *Uri (nullable): The reference URI to join onto the
// base URI.
//
// The function returns the following values:
//
// - goret *Uri
//
// Join a reference URI onto a base URI using the method from RFC 3986.
// If either URI is %NULL then the other URI will be returned with the ref count
// increased.
func (baseUri *Uri) Join(refUri *Uri) *Uri {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.GstUri // in, none, converted, nullable
var cret *C.GstUri // return, full, converted
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(baseUri))
if refUri != nil {
carg1 = (*C.GstUri)(UnsafeUriToGlibNone(refUri))
}
cret = C.gst_uri_join(carg0, carg1)
runtime.KeepAlive(baseUri)
runtime.KeepAlive(refUri)
var goret *Uri
goret = UnsafeUriFromGlibFull(unsafe.Pointer(cret))
return goret
}
// MakeWritable wraps gst_uri_make_writable
// The function returns the following values:
//
// - goret *Uri
//
// Make the #GstUri writable.
//
// Checks if @uri is writable, and if so the original object is returned. If
// not, then a writable copy is made and returned. This gives away the
// reference to @uri and returns a reference to the new #GstUri.
// If @uri is %NULL then %NULL is returned.
func (uri *Uri) MakeWritable() *Uri {
var carg0 *C.GstUri // in, none, converted
var cret *C.GstUri // return, full, converted
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_make_writable(carg0)
runtime.KeepAlive(uri)
var goret *Uri
goret = UnsafeUriFromGlibFull(unsafe.Pointer(cret))
return goret
}
// NewWithBase wraps gst_uri_new_with_base
//
// The function takes the following parameters:
//
// - scheme string (nullable): The scheme for the new URI.
// - userinfo string (nullable): The user-info for the new URI.
// - host string (nullable): The host name for the new URI.
// - port uint: The port number for the new URI or %GST_URI_NO_PORT.
// - path string (nullable): The path for the new URI with '/' separating path
// elements.
// - query string (nullable): The query string for the new URI with '&amp;' separating
// query elements. Elements containing '&amp;' characters
// should encode them as "&amp;percnt;26".
// - fragment string (nullable): The fragment name for the new URI.
//
// The function returns the following values:
//
// - goret *Uri
//
// Like gst_uri_new(), but joins the new URI onto a base URI.
func (base *Uri) NewWithBase(scheme string, userinfo string, host string, port uint, path string, query string, fragment string) *Uri {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var carg2 *C.gchar // in, none, string, nullable-string
var carg3 *C.gchar // in, none, string, nullable-string
var carg4 C.guint // in, none, casted
var carg5 *C.gchar // in, none, string, nullable-string
var carg6 *C.gchar // in, none, string, nullable-string
var carg7 *C.gchar // in, none, string, nullable-string
var cret *C.GstUri // return, full, converted
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(base))
if scheme != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(scheme)))
defer C.free(unsafe.Pointer(carg1))
}
if userinfo != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(userinfo)))
defer C.free(unsafe.Pointer(carg2))
}
if host != "" {
carg3 = (*C.gchar)(unsafe.Pointer(C.CString(host)))
defer C.free(unsafe.Pointer(carg3))
}
carg4 = C.guint(port)
if path != "" {
carg5 = (*C.gchar)(unsafe.Pointer(C.CString(path)))
defer C.free(unsafe.Pointer(carg5))
}
if query != "" {
carg6 = (*C.gchar)(unsafe.Pointer(C.CString(query)))
defer C.free(unsafe.Pointer(carg6))
}
if fragment != "" {
carg7 = (*C.gchar)(unsafe.Pointer(C.CString(fragment)))
defer C.free(unsafe.Pointer(carg7))
}
cret = C.gst_uri_new_with_base(carg0, carg1, carg2, carg3, carg4, carg5, carg6, carg7)
runtime.KeepAlive(base)
runtime.KeepAlive(scheme)
runtime.KeepAlive(userinfo)
runtime.KeepAlive(host)
runtime.KeepAlive(port)
runtime.KeepAlive(path)
runtime.KeepAlive(query)
runtime.KeepAlive(fragment)
var goret *Uri
goret = UnsafeUriFromGlibFull(unsafe.Pointer(cret))
return goret
}
// Normalize wraps gst_uri_normalize
// The function returns the following values:
//
// - goret bool
//
// Normalization will remove extra path segments ("." and "..") from the URI. It
// will also convert the scheme and host name to lower case and any
// percent-encoded values to uppercase.
//
// The #GstUri object must be writable. Check with gst_uri_is_writable() or use
// gst_uri_make_writable() first.
func (uri *Uri) Normalize() bool {
var carg0 *C.GstUri // in, none, converted
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_normalize(carg0)
runtime.KeepAlive(uri)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// QueryHasKey wraps gst_uri_query_has_key
//
// The function takes the following parameters:
//
// - queryKey string: The key to lookup.
//
// The function returns the following values:
//
// - goret bool
//
// Check if there is a query table entry for the @query_key key.
func (uri *Uri) QueryHasKey(queryKey string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(queryKey)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_query_has_key(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(queryKey)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// RemoveQueryKey wraps gst_uri_remove_query_key
//
// The function takes the following parameters:
//
// - queryKey string: The key to remove.
//
// The function returns the following values:
//
// - goret bool
//
// Remove an entry from the query table by key.
func (uri *Uri) RemoveQueryKey(queryKey string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(queryKey)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_remove_query_key(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(queryKey)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetFragment wraps gst_uri_set_fragment
//
// The function takes the following parameters:
//
// - fragment string (nullable): The fragment string to set.
//
// The function returns the following values:
//
// - goret bool
//
// Sets the fragment string in the URI. Use a value of %NULL in @fragment to
// unset the fragment string.
func (uri *Uri) SetFragment(fragment string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
if fragment != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(fragment)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_uri_set_fragment(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(fragment)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetHost wraps gst_uri_set_host
//
// The function takes the following parameters:
//
// - host string: The new host string to set or %NULL to unset.
//
// The function returns the following values:
//
// - goret bool
//
// Set or unset the host for the URI.
func (uri *Uri) SetHost(host string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(host)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_set_host(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(host)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetPath wraps gst_uri_set_path
//
// The function takes the following parameters:
//
// - path string (nullable): The new path to set with path segments separated by '/', or use %NULL
// to unset the path.
//
// The function returns the following values:
//
// - goret bool
//
// Sets or unsets the path in the URI.
func (uri *Uri) SetPath(path string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
if path != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(path)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_uri_set_path(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(path)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetPathString wraps gst_uri_set_path_string
//
// The function takes the following parameters:
//
// - path string: The new percent encoded path to set with path segments separated by
// '/', or use %NULL to unset the path.
//
// The function returns the following values:
//
// - goret bool
//
// Sets or unsets the path in the URI.
func (uri *Uri) SetPathString(path string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(path)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_set_path_string(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(path)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetPort wraps gst_uri_set_port
//
// The function takes the following parameters:
//
// - port uint: The new port number to set or %GST_URI_NO_PORT to unset.
//
// The function returns the following values:
//
// - goret bool
//
// Set or unset the port number for the URI.
func (uri *Uri) SetPort(port uint) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 C.guint // in, none, casted
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = C.guint(port)
cret = C.gst_uri_set_port(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(port)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetQueryString wraps gst_uri_set_query_string
//
// The function takes the following parameters:
//
// - query string (nullable): The new percent encoded query string to use to populate the query
// table, or use %NULL to unset the query table.
//
// The function returns the following values:
//
// - goret bool
//
// Sets or unsets the query table in the URI.
func (uri *Uri) SetQueryString(query string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
if query != "" {
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(query)))
defer C.free(unsafe.Pointer(carg1))
}
cret = C.gst_uri_set_query_string(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(query)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetQueryValue wraps gst_uri_set_query_value
//
// The function takes the following parameters:
//
// - queryKey string: The key for the query entry.
// - queryValue string (nullable): The value for the key.
//
// The function returns the following values:
//
// - goret bool
//
// This inserts or replaces a key in the query table. A @query_value of %NULL
// indicates that the key has no associated value, but will still be present in
// the query string.
func (uri *Uri) SetQueryValue(queryKey string, queryValue string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var carg2 *C.gchar // in, none, string, nullable-string
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(queryKey)))
defer C.free(unsafe.Pointer(carg1))
if queryValue != "" {
carg2 = (*C.gchar)(unsafe.Pointer(C.CString(queryValue)))
defer C.free(unsafe.Pointer(carg2))
}
cret = C.gst_uri_set_query_value(carg0, carg1, carg2)
runtime.KeepAlive(uri)
runtime.KeepAlive(queryKey)
runtime.KeepAlive(queryValue)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetScheme wraps gst_uri_set_scheme
//
// The function takes the following parameters:
//
// - scheme string: The new scheme to set or %NULL to unset the scheme.
//
// The function returns the following values:
//
// - goret bool
//
// Set or unset the scheme for the URI.
func (uri *Uri) SetScheme(scheme string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(scheme)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_set_scheme(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(scheme)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// SetUserinfo wraps gst_uri_set_userinfo
//
// The function takes the following parameters:
//
// - userinfo string: The new user-information string to set or %NULL to unset.
//
// The function returns the following values:
//
// - goret bool
//
// Set or unset the user information for the URI.
func (uri *Uri) SetUserinfo(userinfo string) bool {
var carg0 *C.GstUri // in, none, converted
var carg1 *C.gchar // in, none, string, casted *C.gchar
var cret C.gboolean // return
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
carg1 = (*C.gchar)(unsafe.Pointer(C.CString(userinfo)))
defer C.free(unsafe.Pointer(carg1))
cret = C.gst_uri_set_userinfo(carg0, carg1)
runtime.KeepAlive(uri)
runtime.KeepAlive(userinfo)
var goret bool
if cret != 0 {
goret = true
}
return goret
}
// ToString wraps gst_uri_to_string
// The function returns the following values:
//
// - goret string
//
// Convert the URI to a string.
//
// Returns the URI as held in this object as a #gchar* nul-terminated string.
// The caller should g_free() the string once they are finished with it.
// The string is put together as described in RFC 3986.
func (uri *Uri) ToString() string {
var carg0 *C.GstUri // in, none, converted
var cret *C.gchar // return, full, string, casted *C.gchar
carg0 = (*C.GstUri)(UnsafeUriToGlibNone(uri))
cret = C.gst_uri_to_string(carg0)
runtime.KeepAlive(uri)
var goret string
goret = C.GoString((*C.char)(unsafe.Pointer(cret)))
defer C.free(unsafe.Pointer(cret))
return goret
}
// ValueTable wraps GstValueTable
//
// VTable for the #GValue @type.
type ValueTable struct {
*valueTable
}
// valueTable is the struct that's finalized
type valueTable struct {
native *C.GstValueTable
}
// UnsafeValueTableFromGlibBorrow is used to convert raw C.GstValueTable pointers to go. This is used by the bindings internally.
func UnsafeValueTableFromGlibBorrow(p unsafe.Pointer) *ValueTable {
return &ValueTable{&valueTable{(*C.GstValueTable)(p)}}
}
// UnsafeValueTableFromGlibNone is used to convert raw C.GstValueTable pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeValueTableFromGlibNone(p unsafe.Pointer) *ValueTable {
// FIXME: this has no ref function, what should we do here?
wrapped := UnsafeValueTableFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.valueTable,
func (intern *valueTable) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeValueTableFromGlibFull is used to convert raw C.GstValueTable pointers to go while taking a reference. This is used by the bindings internally.
func UnsafeValueTableFromGlibFull(p unsafe.Pointer) *ValueTable {
wrapped := UnsafeValueTableFromGlibBorrow(p)
runtime.SetFinalizer(
wrapped.valueTable,
func (intern *valueTable) {
C.free(unsafe.Pointer(intern.native))
},
)
return wrapped
}
// UnsafeValueTableFree unrefs/frees the underlying resource. This is used by the bindings internally.
//
// After this is called, no other method on [ValueTable] is expected to work anymore.
func UnsafeValueTableFree(v *ValueTable) {
C.free(unsafe.Pointer(v.native))
}
// UnsafeValueTableToGlibNone returns the underlying C pointer. This is used by the bindings internally.
func UnsafeValueTableToGlibNone(v *ValueTable) unsafe.Pointer {
return unsafe.Pointer(v.native)
}
// UnsafeValueTableToGlibFull returns the underlying C pointer and gives up ownership.
// This is used by the bindings internally.
func UnsafeValueTableToGlibFull(v *ValueTable) unsafe.Pointer {
runtime.SetFinalizer(v.valueTable, nil)
_p := unsafe.Pointer(v.native)
v.native = nil // ValueTable is invalid from here on
return _p
}