gst

package
v0.0.0-...-ccbbe8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ALLOCATOR_SYSMEM = "SystemMemory"

ALLOCATOR_SYSMEM: allocator name for the default system memory allocator.

View Source
const BUFFER_OFFSET_NONE = 18446744073709551615

BUFFER_OFFSET_NONE: constant for no-offset return results.

View Source
const CAN_INLINE = 1
View Source
const CAPS_FEATURE_MEMORY_SYSTEM_MEMORY = "memory:SystemMemory"
View Source
const DEBUG_BG_MASK = 240
View Source
const DEBUG_FG_MASK = 15
View Source
const DEBUG_FORMAT_MASK = 65280
View Source
const ELEMENT_FACTORY_KLASS_DECODER = "Decoder"
View Source
const ELEMENT_FACTORY_KLASS_DECRYPTOR = "Decryptor"
View Source
const ELEMENT_FACTORY_KLASS_DEMUXER = "Demuxer"
View Source
const ELEMENT_FACTORY_KLASS_DEPAYLOADER = "Depayloader"
View Source
const ELEMENT_FACTORY_KLASS_ENCODER = "Encoder"
View Source
const ELEMENT_FACTORY_KLASS_ENCRYPTOR = "Encryptor"
View Source
const ELEMENT_FACTORY_KLASS_FORMATTER = "Formatter"
View Source
const ELEMENT_FACTORY_KLASS_HARDWARE = "Hardware"

ELEMENT_FACTORY_KLASS_HARDWARE elements interacting with hardware devices should specify this classifier in their metadata. You may need to put the element in "READY" state to test if the hardware is present in the system.

View Source
const ELEMENT_FACTORY_KLASS_MEDIA_AUDIO = "Audio"
View Source
const ELEMENT_FACTORY_KLASS_MEDIA_IMAGE = "Image"
View Source
const ELEMENT_FACTORY_KLASS_MEDIA_METADATA = "Metadata"
View Source
const ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE = "Subtitle"
View Source
const ELEMENT_FACTORY_KLASS_MEDIA_VIDEO = "Video"
View Source
const ELEMENT_FACTORY_KLASS_MUXER = "Muxer"
View Source
const ELEMENT_FACTORY_KLASS_PARSER = "Parser"
View Source
const ELEMENT_FACTORY_KLASS_PAYLOADER = "Payloader"
View Source
const ELEMENT_FACTORY_KLASS_SINK = "Sink"
View Source
const ELEMENT_FACTORY_KLASS_SRC = "Source"
View Source
const ELEMENT_METADATA_AUTHOR = "author"

ELEMENT_METADATA_AUTHOR: name and contact details of the author(s). Use \n to separate multiple author details. E.g: "Joe Bloggs <joe.blogs at foo.com>".

View Source
const ELEMENT_METADATA_DESCRIPTION = "description"

ELEMENT_METADATA_DESCRIPTION: sentence describing the purpose of the element. E.g: "Write stream to a file".

View Source
const ELEMENT_METADATA_DOC_URI = "doc-uri"

ELEMENT_METADATA_DOC_URI: set uri pointing to user documentation. Applications can use this to show help for e.g. effects to users.

View Source
const ELEMENT_METADATA_ICON_NAME = "icon-name"

ELEMENT_METADATA_ICON_NAME elements that bridge to certain other products can include an icon of that used product. Application can show the icon in menus/selectors to help identifying specific elements.

View Source
const ELEMENT_METADATA_KLASS = "klass"

ELEMENT_METADATA_KLASS: 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".

View Source
const ELEMENT_METADATA_LONGNAME = "long-name"

ELEMENT_METADATA_LONGNAME: long English name of the element. E.g. "File Sink".

View Source
const ERROR_SYSTEM = "system error: %s"

ERROR_SYSTEM builds a string using errno describing the previously failed system call. To be used as the debug argument in T_ELEMENT_ERROR.

View Source
const EVENT_NUM_SHIFT = 8
View Source
const FLAG_SET_MASK_EXACT = 4294967295

FLAG_SET_MASK_EXACT: mask value with all bits set, for use as a GstFlagSet mask where all flag bits must match exactly.

View Source
const FORMAT_PERCENT_MAX = 1000000

FORMAT_PERCENT_MAX: PERCENT format is between 0 and this value.

View Source
const FORMAT_PERCENT_SCALE = 10000

FORMAT_PERCENT_SCALE: value used to scale down the reported PERCENT format value to its real value.

View Source
const FOURCC_FORMAT = "c%c%c%c"

FOURCC_FORMAT: can be used together with T_FOURCC_ARGS to properly output a #guint32 fourcc value in a printf\()-style text message.

printf ("fourcc: %" GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fcc));.
View Source
const GROUP_ID_INVALID = 0

GROUP_ID_INVALID: 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.

View Source
const LICENSE_UNKNOWN = "unknown"

LICENSE_UNKNOWN: to be used in GST_PLUGIN_DEFINE if unsure about the licence.

View Source
const META_TAG_MEMORY_STR = "memory"

META_TAG_MEMORY_STR: this metadata stays relevant as long as memory layout is unchanged.

View Source
const PARAM_CONDITIONALLY_AVAILABLE = 16384

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.

View Source
const PARAM_CONTROLLABLE = 512

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.

View Source
const PARAM_DOC_SHOW_DEFAULT = 8192

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.

View Source
const PARAM_MUTABLE_PAUSED = 2048

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.

View Source
const PARAM_MUTABLE_PLAYING = 4096

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.

View Source
const PARAM_MUTABLE_READY = 1024

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.

View Source
const PARAM_USER_SHIFT = 65536

PARAM_USER_SHIFT bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.

View Source
const PROTECTION_SYSTEM_ID_CAPS_FIELD = "protection-system"

PROTECTION_SYSTEM_ID_CAPS_FIELD: field name in a GstCaps that is used to signal the UUID of the protection system.

View Source
const PROTECTION_UNSPECIFIED_SYSTEM_ID = "unspecified-system-id"

PROTECTION_UNSPECIFIED_SYSTEM_ID: protection system value of the unspecified UUID. In some cases the system protection ID is not present in the contents or in their metadata, as encrypted WebM. This define is used to set the value of the "system_id" field in GstProtectionEvent, with this value, the application will use an external information to choose which protection system to use.

Example: The matroskademux uses this value in the case of encrypted WebM, the application will choose the appropriate protection system based on the information received through EME API.

View Source
const PTR_FORMAT = "paA"

PTR_FORMAT: printf format type used to debug GStreamer types. You can use this in combination with GStreamer's debug logging system as well as the functions gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf() to pretty-print the following types: Caps, Structure, CapsFeatures, TagList, DateTime, Buffer, BufferList, Message, Event, Query, Context, Pad, Object. All #GObject types will be printed as typename plus pointer, and everything else will simply be printed as pointer address.

This can only be used on types whose size is >= sizeof(gpointer).

View Source
const QUERY_NUM_SHIFT = 8
View Source
const SEGMENT_FORMAT = "paB"

SEGMENT_FORMAT: printf format type used to debug GStreamer segments. You can use this in combination with GStreamer's debug logging system as well as the functions gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf() to pretty-print Segment structures. This can only be used on pointers to GstSegment structures.

View Source
const SEGMENT_INSTANT_FLAGS = 912
View Source
const SEQNUM_INVALID = 0

SEQNUM_INVALID: 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.

View Source
const STIMEP_FORMAT = "paS"

STIMEP_FORMAT: printf format type used to debug GStreamer signed time value pointers. You can use this in combination with GStreamer's debug logging system as well as the functions gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf() to pretty-print signed time (pointers to ClockTimeDiff or #gint64).

View Source
const STIME_FORMAT = "c%"

STIME_FORMAT: string that can be used in printf-like format strings to display a signed ClockTimeDiff or #gint64 value in h:m:s format. Use GST_TIME_ARGS() to construct the matching arguments.

Example:

C printf("%" GST_STIME_FORMAT "\n", GST_STIME_ARGS(ts));.
View Source
const TAG_ALBUM = "album"

TAG_ALBUM: album containing this data (string)

The album name as it should be displayed, e.g. 'The Jazz Guitar'.

View Source
const TAG_ALBUM_ARTIST = "album-artist"

TAG_ALBUM_ARTIST: artist of the entire album, as it should be displayed.

View Source
const TAG_ALBUM_ARTIST_SORTNAME = "album-artist-sortname"

TAG_ALBUM_ARTIST_SORTNAME: artist of the entire album, as it should be sorted.

View Source
const TAG_ALBUM_GAIN = "replaygain-album-gain"

TAG_ALBUM_GAIN: album gain in db (double).

View Source
const TAG_ALBUM_PEAK = "replaygain-album-peak"

TAG_ALBUM_PEAK: peak of the album (double).

View Source
const TAG_ALBUM_SORTNAME = "album-sortname"

TAG_ALBUM_SORTNAME: album containing this data, as used for sorting (string)

The album name as it should be sorted, e.g. 'Jazz Guitar, The'.

View Source
const TAG_ALBUM_VOLUME_COUNT = "album-disc-count"

TAG_ALBUM_VOLUME_COUNT: count of discs inside collection this disc belongs to (unsigned integer).

View Source
const TAG_ALBUM_VOLUME_NUMBER = "album-disc-number"

TAG_ALBUM_VOLUME_NUMBER: disc number inside a collection (unsigned integer).

View Source
const TAG_APPLICATION_DATA = "application-data"

TAG_APPLICATION_DATA: arbitrary application data (sample)

Some formats allow applications to add their own arbitrary data into files. This data is application dependent.

View Source
const TAG_APPLICATION_NAME = "application-name"

TAG_APPLICATION_NAME: name of the application used to create the media (string).

View Source
const TAG_ARTIST = "artist"

TAG_ARTIST: person(s) responsible for the recording (string)

The artist name as it should be displayed, e.g. 'Jimi Hendrix' or 'The Guitar Heroes'.

View Source
const TAG_ARTIST_SORTNAME = "artist-sortname"

TAG_ARTIST_SORTNAME: person(s) responsible for the recording, as used for sorting (string)

The artist name as it should be sorted, e.g. 'Hendrix, Jimi' or 'Guitar Heroes, The'.

View Source
const TAG_ATTACHMENT = "attachment"

TAG_ATTACHMENT: generic file attachment (sample) (sample taglist should specify the content type and if possible set "filename" to the file name of the attachment).

View Source
const TAG_AUDIO_CODEC = "audio-codec"

TAG_AUDIO_CODEC: codec the audio data is stored in (string).

View Source
const TAG_BEATS_PER_MINUTE = "beats-per-minute"

TAG_BEATS_PER_MINUTE: number of beats per minute in audio (double).

View Source
const TAG_BITRATE = "bitrate"

TAG_BITRATE: exact or average bitrate in bits/s (unsigned integer).

View Source
const TAG_CODEC = "codec"

TAG_CODEC: codec the data is stored in (string).

View Source
const TAG_COMMENT = "comment"

TAG_COMMENT: free text commenting the data (string).

View Source
const TAG_COMPOSER = "composer"

TAG_COMPOSER: person(s) who composed the recording (string).

View Source
const TAG_COMPOSER_SORTNAME = "composer-sortname"

TAG_COMPOSER_SORTNAME composer's name, used for sorting (string).

View Source
const TAG_CONDUCTOR = "conductor"

TAG_CONDUCTOR: conductor/performer refinement (string).

View Source
const TAG_CONTACT = "contact"

TAG_CONTACT: contact information (string).

View Source
const TAG_CONTAINER_FORMAT = "container-format"

TAG_CONTAINER_FORMAT: container format the data is stored in (string).

View Source
const TAG_COPYRIGHT = "copyright"

TAG_COPYRIGHT: copyright notice of the data (string).

View Source
const TAG_COPYRIGHT_URI = "copyright-uri"

TAG_COPYRIGHT_URI: URI to location where copyright details can be found (string).

View Source
const TAG_DATE = "date"

TAG_DATE: date the data was created (#GDate structure).

View Source
const TAG_DATE_TIME = "datetime"

TAG_DATE_TIME: date and time the data was created (DateTime structure).

View Source
const TAG_DESCRIPTION = "description"

TAG_DESCRIPTION: short text describing the content of the data (string).

View Source
const TAG_DEVICE_MANUFACTURER = "device-manufacturer"

TAG_DEVICE_MANUFACTURER: manufacturer of the device used to create the media (string).

View Source
const TAG_DEVICE_MODEL = "device-model"

TAG_DEVICE_MODEL: model of the device used to create the media (string).

View Source
const TAG_DURATION = "duration"

TAG_DURATION: length in GStreamer time units (nanoseconds) (unsigned 64-bit integer).

View Source
const TAG_ENCODED_BY = "encoded-by"

TAG_ENCODED_BY: name of the person or organisation that encoded the file. May contain a copyright message if the person or organisation also holds the copyright (string)

Note: do not use this field to describe the encoding application. Use T_TAG_APPLICATION_NAME or T_TAG_COMMENT for that.

View Source
const TAG_ENCODER = "encoder"

TAG_ENCODER: encoder used to encode this stream (string).

View Source
const TAG_ENCODER_VERSION = "encoder-version"

TAG_ENCODER_VERSION: version of the encoder used to encode this stream (unsigned integer).

View Source
const TAG_EXTENDED_COMMENT = "extended-comment"

TAG_EXTENDED_COMMENT: key/value text commenting the data (string)

Must be in the form of 'key=comment' or 'key[lc]=comment' where 'lc' is an ISO-639 language code.

This tag is used for unknown Vorbis comment tags, unknown APE tags and certain ID3v2 comment fields.

View Source
const TAG_GENRE = "genre"

TAG_GENRE: genre this data belongs to (string).

View Source
const TAG_GEO_LOCATION_CAPTURE_DIRECTION = "geo-location-capture-direction"

TAG_GEO_LOCATION_CAPTURE_DIRECTION indicates the direction the device is pointing to when capturing a media. It is represented as degrees in floating point representation, 0 means the geographic north, and increases clockwise (double from 0 to 360)

See also T_TAG_GEO_LOCATION_MOVEMENT_DIRECTION.

View Source
const TAG_GEO_LOCATION_CITY = "geo-location-city"

TAG_GEO_LOCATION_CITY: city (english name) where the media has been produced (string).

View Source
const TAG_GEO_LOCATION_COUNTRY = "geo-location-country"

TAG_GEO_LOCATION_COUNTRY: country (english name) where the media has been produced (string).

View Source
const TAG_GEO_LOCATION_ELEVATION = "geo-location-elevation"

TAG_GEO_LOCATION_ELEVATION: geo elevation of where the media has been recorded or produced in meters according to WGS84 (zero is average sea level) (double).

View Source
const TAG_GEO_LOCATION_HORIZONTAL_ERROR = "geo-location-horizontal-error"

TAG_GEO_LOCATION_HORIZONTAL_ERROR represents the expected error on the horizontal positioning in meters (double).

View Source
const TAG_GEO_LOCATION_LATITUDE = "geo-location-latitude"

TAG_GEO_LOCATION_LATITUDE: geo latitude location of where the media has been recorded or produced in degrees according to WGS84 (zero at the equator, negative values for southern latitudes) (double).

View Source
const TAG_GEO_LOCATION_LONGITUDE = "geo-location-longitude"

TAG_GEO_LOCATION_LONGITUDE: geo longitude location of where the media has been recorded or produced in degrees according to WGS84 (zero at the prime meridian in Greenwich/UK, negative values for western longitudes). (double).

View Source
const TAG_GEO_LOCATION_MOVEMENT_DIRECTION = "geo-location-movement-direction"

TAG_GEO_LOCATION_MOVEMENT_DIRECTION indicates the movement direction of the device performing the capture of a media. It is represented as degrees in floating point representation, 0 means the geographic north, and increases clockwise (double from 0 to 360)

See also T_TAG_GEO_LOCATION_CAPTURE_DIRECTION.

View Source
const TAG_GEO_LOCATION_MOVEMENT_SPEED = "geo-location-movement-speed"

TAG_GEO_LOCATION_MOVEMENT_SPEED: speed of the capturing device when performing the capture. Represented in m/s. (double)

See also T_TAG_GEO_LOCATION_MOVEMENT_DIRECTION.

View Source
const TAG_GEO_LOCATION_NAME = "geo-location-name"

TAG_GEO_LOCATION_NAME: human readable descriptive location of where the media has been recorded or produced. (string).

View Source
const TAG_GEO_LOCATION_SUBLOCATION = "geo-location-sublocation"

TAG_GEO_LOCATION_SUBLOCATION: location 'smaller' than GST_TAG_GEO_LOCATION_CITY that specifies better where the media has been produced. (e.g. the neighborhood) (string).

This tag has been added as this is how it is handled/named in XMP's Iptc4xmpcore schema.

View Source
const TAG_GROUPING = "grouping"

TAG_GROUPING groups together media that are related and spans multiple tracks. An example are multiple pieces of a concerto. (string).

View Source
const TAG_HOMEPAGE = "homepage"

TAG_HOMEPAGE: homepage for this media (i.e. artist or movie homepage) (string).

View Source
const TAG_IMAGE = "image"

TAG_IMAGE: image (sample) (sample taglist should specify the content type and preferably also set "image-type" field as GstTagImageType).

View Source
const TAG_IMAGE_ORIENTATION = "image-orientation"

TAG_IMAGE_ORIENTATION represents the 'Orientation' tag from EXIF. Defines how the image should be rotated and mirrored for display. (string)

This tag has a predefined set of allowed values: "rotate-0" "rotate-90" "rotate-180" "rotate-270" "flip-rotate-0" "flip-rotate-90" "flip-rotate-180" "flip-rotate-270"

The naming is adopted according to a possible transformation to perform on the image to fix its orientation, obviously equivalent operations will yield the same result.

Rotations indicated by the values are in clockwise direction and 'flip' means an horizontal mirroring.

View Source
const TAG_INTERPRETED_BY = "interpreted-by"

TAG_INTERPRETED_BY: information about the people behind a remix and similar interpretations of another existing piece (string).

View Source
const TAG_ISRC = "isrc"

TAG_ISRC: international Standard Recording Code - see http://www.ifpi.org/isrc/ (string).

View Source
const TAG_KEYWORDS = "keywords"

TAG_KEYWORDS: comma separated keywords describing the content (string).

View Source
const TAG_LANGUAGE_CODE = "language-code"

TAG_LANGUAGE_CODE: ISO-639-2 or ISO-639-1 code for the language the content is in (string)

There is utility API in libgsttag in gst-plugins-base to obtain a translated language name from the language code: gst_tag_get_language_name().

View Source
const TAG_LANGUAGE_NAME = "language-name"

TAG_LANGUAGE_NAME: name of the language the content is in (string)

Free-form name of the language the content is in, if a language code is not available. This tag should not be set in addition to a language code. It is undefined what language or locale the language name is in.

View Source
const TAG_LICENSE = "license"

TAG_LICENSE: license of data (string).

View Source
const TAG_LICENSE_URI = "license-uri"

TAG_LICENSE_URI: URI to location where license details can be found (string).

View Source
const TAG_LOCATION = "location"

TAG_LOCATION: origin of media as a URI (location, where the original of the file or stream is hosted) (string).

View Source
const TAG_LYRICS = "lyrics"

TAG_LYRICS lyrics of the media (string).

View Source
const TAG_MAXIMUM_BITRATE = "maximum-bitrate"

TAG_MAXIMUM_BITRATE: maximum bitrate in bits/s (unsigned integer).

View Source
const TAG_MIDI_BASE_NOTE = "midi-base-note"

TAG_MIDI_BASE_NOTE: Midi note number (http://en.wikipedia.org/wiki/Note#Note_designation_in_accordance_with_octave_name) of the audio track. This is useful for sample instruments and in particular for multi-samples.

View Source
const TAG_MINIMUM_BITRATE = "minimum-bitrate"

TAG_MINIMUM_BITRATE: minimum bitrate in bits/s (unsigned integer).

View Source
const TAG_NOMINAL_BITRATE = "nominal-bitrate"

TAG_NOMINAL_BITRATE: nominal bitrate in bits/s (unsigned integer). The actual bitrate might be different from this target bitrate.

View Source
const TAG_ORGANIZATION = "organization"

TAG_ORGANIZATION: organization (string).

View Source
const TAG_PERFORMER = "performer"

TAG_PERFORMER: person(s) performing (string).

View Source
const TAG_PREVIEW_IMAGE = "preview-image"

TAG_PREVIEW_IMAGE: image that is meant for preview purposes, e.g. small icon-sized version (sample) (sample taglist should specify the content type).

View Source
const TAG_PRIVATE_DATA = "private-data"

TAG_PRIVATE_DATA: any private data that may be contained in tags (sample).

It is represented by Sample in which Buffer contains the binary data and the sample's info Structure may contain any extra information that identifies the origin or meaning of the data.

Private frames in ID3v2 tags ('PRIV' frames) will be represented using this tag, in which case the GstStructure will be named "ID3PrivateFrame" and contain a field named "owner" of type string which contains the owner-identification string from the tag.

View Source
const TAG_PUBLISHER = "publisher"

TAG_PUBLISHER: name of the label or publisher (string).

View Source
const TAG_REFERENCE_LEVEL = "replaygain-reference-level"

TAG_REFERENCE_LEVEL: reference level of track and album gain values (double).

View Source
const TAG_SERIAL = "serial"

TAG_SERIAL: serial number of track (unsigned integer).

View Source
const TAG_SHOW_EPISODE_NUMBER = "show-episode-number"

TAG_SHOW_EPISODE_NUMBER: number of the episode within a season/show (unsigned integer).

View Source
const TAG_SHOW_NAME = "show-name"

TAG_SHOW_NAME: name of the show, used for displaying (string).

View Source
const TAG_SHOW_SEASON_NUMBER = "show-season-number"

TAG_SHOW_SEASON_NUMBER: number of the season of a show/series (unsigned integer).

View Source
const TAG_SHOW_SORTNAME = "show-sortname"

TAG_SHOW_SORTNAME: name of the show, used for sorting (string).

View Source
const TAG_SUBTITLE_CODEC = "subtitle-codec"

TAG_SUBTITLE_CODEC: codec/format the subtitle data is stored in (string).

View Source
const TAG_TITLE = "title"

TAG_TITLE: commonly used title (string)

The title as it should be displayed, e.g. 'The Doll House'.

View Source
const TAG_TITLE_SORTNAME = "title-sortname"

TAG_TITLE_SORTNAME: commonly used title, as used for sorting (string)

The title as it should be sorted, e.g. 'Doll House, The'.

View Source
const TAG_TRACK_COUNT = "track-count"

TAG_TRACK_COUNT: count of tracks inside collection this track belongs to (unsigned integer).

View Source
const TAG_TRACK_GAIN = "replaygain-track-gain"

TAG_TRACK_GAIN: track gain in db (double).

View Source
const TAG_TRACK_NUMBER = "track-number"

TAG_TRACK_NUMBER: track number inside a collection (unsigned integer).

View Source
const TAG_TRACK_PEAK = "replaygain-track-peak"

TAG_TRACK_PEAK: peak of the track (double).

View Source
const TAG_USER_RATING = "user-rating"

TAG_USER_RATING: rating attributed by a person (likely the application user). The higher the value, the more the user likes this media (unsigned int from 0 to 100).

View Source
const TAG_VERSION = "version"

TAG_VERSION: version of this data (string).

View Source
const TAG_VIDEO_CODEC = "video-codec"

TAG_VIDEO_CODEC: codec the video data is stored in (string).

View Source
const TIMEP_FORMAT = "paT"

TIMEP_FORMAT: printf format type used to debug GStreamer ClockTime pointers. You can use this in combination with GStreamer's debug logging system as well as the functions gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf() to pretty-print ClockTime pointers. This can only be used on pointers to GstClockTime values.

View Source
const TIME_FORMAT = "u:%02u:%02u.%09u"

TIME_FORMAT: string that can be used in printf-like format strings to display a ClockTime value in h:m:s format. Use GST_TIME_ARGS() to construct the matching arguments.

Example:

C printf("%" GST_TIME_FORMAT "\n", GST_TIME_ARGS(ts));.
View Source
const TOC_REPEAT_COUNT_INFINITE = -1

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.

View Source
const URI_NO_PORT = 0

URI_NO_PORT: value for Uri<!-- -->.port to indicate no port number.

View Source
const VALUE_EQUAL = 0

VALUE_EQUAL indicates that the first value provided to a comparison function (gst_value_compare()) is equal to the second one.

View Source
const VALUE_GREATER_THAN = 1

VALUE_GREATER_THAN indicates that the first value provided to a comparison function (gst_value_compare()) is greater than the second one.

View Source
const VALUE_LESS_THAN = -1

VALUE_LESS_THAN indicates that the first value provided to a comparison function (gst_value_compare()) is lesser than the second one.

View Source
const VALUE_UNORDERED = 2

VALUE_UNORDERED indicates that the comparison function (gst_value_compare()) can not determine a order for the two provided values.

View Source
const VERSION_MAJOR = 1

VERSION_MAJOR: major version of GStreamer at compile time:.

View Source
const VERSION_MICRO = 3

VERSION_MICRO: micro version of GStreamer at compile time:.

View Source
const VERSION_MINOR = 20

VERSION_MINOR: minor version of GStreamer at compile time:.

View Source
const VERSION_NANO = 0

VERSION_NANO: nano version of GStreamer at compile time: Actual releases have 0, GIT versions have 1, prerelease versions have 2-...

Variables

View Source
var (
	GTypeDebugColorMode  = coreglib.Type(C.gst_debug_color_mode_get_type())
	GTypePluginAPIFlags  = coreglib.Type(C.gst_plugin_api_flags_get_type())
	GTypeSerializeFlags  = coreglib.Type(C.gst_serialize_flags_get_type())
	GTypeStackTraceFlags = coreglib.Type(C.gst_stack_trace_flags_get_type())
	GTypeStreamFlags     = coreglib.Type(C.gst_stream_flags_get_type())
)

GType values.

View Source
var (
	GTypeAllocatorFlags   = coreglib.Type(C.gst_allocator_flags_get_type())
	GTypeAllocator        = coreglib.Type(C.gst_allocator_get_type())
	GTypeAllocationParams = coreglib.Type(C.gst_allocation_params_get_type())
)

GType values.

View Source
var (
	GTypeBinFlags = coreglib.Type(C.gst_bin_flags_get_type())
	GTypeBin      = coreglib.Type(C.gst_bin_get_type())
)

GType values.

View Source
var (
	GTypeBufferCopyFlags = coreglib.Type(C.gst_buffer_copy_flags_get_type())
	GTypeBufferFlags     = coreglib.Type(C.gst_buffer_flags_get_type())
	GTypeBuffer          = coreglib.Type(C.gst_buffer_get_type())
)

GType values.

View Source
var (
	GTypeBufferPoolAcquireFlags = coreglib.Type(C.gst_buffer_pool_acquire_flags_get_type())
	GTypeBufferPool             = coreglib.Type(C.gst_buffer_pool_get_type())
)

GType values.

View Source
var (
	GTypeBusSyncReply = coreglib.Type(C.gst_bus_sync_reply_get_type())
	GTypeBusFlags     = coreglib.Type(C.gst_bus_flags_get_type())
	GTypeBus          = coreglib.Type(C.gst_bus_get_type())
)

GType values.

View Source
var (
	GTypeCapsIntersectMode = coreglib.Type(C.gst_caps_intersect_mode_get_type())
	GTypeCapsFlags         = coreglib.Type(C.gst_caps_flags_get_type())
	GTypeCaps              = coreglib.Type(C.gst_caps_get_type())
)

GType values.

View Source
var (
	GTypeClockEntryType = coreglib.Type(C.gst_clock_entry_type_get_type())
	GTypeClockReturn    = coreglib.Type(C.gst_clock_return_get_type())
	GTypeClockFlags     = coreglib.Type(C.gst_clock_flags_get_type())
	GTypeClock          = coreglib.Type(C.gst_clock_get_type())
)

GType values.

View Source
var (
	GTypeState             = coreglib.Type(C.gst_state_get_type())
	GTypeStateChange       = coreglib.Type(C.gst_state_change_get_type())
	GTypeStateChangeReturn = coreglib.Type(C.gst_state_change_return_get_type())
	GTypeElementFlags      = coreglib.Type(C.gst_element_flags_get_type())
	GTypeElement           = coreglib.Type(C.gst_element_get_type())
)

GType values.

View Source
var (
	GTypeCoreError     = coreglib.Type(C.gst_core_error_get_type())
	GTypeLibraryError  = coreglib.Type(C.gst_library_error_get_type())
	GTypeResourceError = coreglib.Type(C.gst_resource_error_get_type())
	GTypeStreamError   = coreglib.Type(C.gst_stream_error_get_type())
)

GType values.

View Source
var (
	GTypeEventType      = coreglib.Type(C.gst_event_type_get_type())
	GTypeQOSType        = coreglib.Type(C.gst_qos_type_get_type())
	GTypeEventTypeFlags = coreglib.Type(C.gst_event_type_flags_get_type())
	GTypeEvent          = coreglib.Type(C.gst_event_get_type())
)

GType values.

View Source
var (
	GTypeGhostPad = coreglib.Type(C.gst_ghost_pad_get_type())
	GTypeProxyPad = coreglib.Type(C.gst_proxy_pad_get_type())
)

GType values.

View Source
var (
	GTypeDebugLevel      = coreglib.Type(C.gst_debug_level_get_type())
	GTypeDebugColorFlags = coreglib.Type(C.gst_debug_color_flags_get_type())
)

GType values.

View Source
var (
	GTypeIteratorItem   = coreglib.Type(C.gst_iterator_item_get_type())
	GTypeIteratorResult = coreglib.Type(C.gst_iterator_result_get_type())
	GTypeIterator       = coreglib.Type(C.gst_iterator_get_type())
)

GType values.

View Source
var (
	GTypeMapFlags    = coreglib.Type(C.gst_map_flags_get_type())
	GTypeMemoryFlags = coreglib.Type(C.gst_memory_flags_get_type())
	GTypeMemory      = coreglib.Type(C.gst_memory_get_type())
)

GType values.

View Source
var (
	GTypeProgressType        = coreglib.Type(C.gst_progress_type_get_type())
	GTypeStreamStatusType    = coreglib.Type(C.gst_stream_status_type_get_type())
	GTypeStructureChangeType = coreglib.Type(C.gst_structure_change_type_get_type())
	GTypeMessageType         = coreglib.Type(C.gst_message_type_get_type())
	GTypeMessage             = coreglib.Type(C.gst_message_get_type())
)

GType values.

View Source
var (
	GTypeLockFlags       = coreglib.Type(C.gst_lock_flags_get_type())
	GTypeMiniObjectFlags = coreglib.Type(C.gst_mini_object_flags_get_type())
	GTypeMiniObject      = coreglib.Type(C.gst_mini_object_get_type())
)

GType values.

View Source
var (
	GTypeObjectFlags = coreglib.Type(C.gst_object_flags_get_type())
	GTypeGstObject   = coreglib.Type(C.gst_object_get_type())
)

GType values.

View Source
var (
	GTypeFlowReturn     = coreglib.Type(C.gst_flow_return_get_type())
	GTypePadDirection   = coreglib.Type(C.gst_pad_direction_get_type())
	GTypePadLinkReturn  = coreglib.Type(C.gst_pad_link_return_get_type())
	GTypePadMode        = coreglib.Type(C.gst_pad_mode_get_type())
	GTypePadProbeReturn = coreglib.Type(C.gst_pad_probe_return_get_type())
	GTypePadFlags       = coreglib.Type(C.gst_pad_flags_get_type())
	GTypePadLinkCheck   = coreglib.Type(C.gst_pad_link_check_get_type())
	GTypePadProbeType   = coreglib.Type(C.gst_pad_probe_type_get_type())
	GTypePad            = coreglib.Type(C.gst_pad_get_type())
)

GType values.

View Source
var (
	GTypePadPresence      = coreglib.Type(C.gst_pad_presence_get_type())
	GTypePadTemplateFlags = coreglib.Type(C.gst_pad_template_flags_get_type())
	GTypePadTemplate      = coreglib.Type(C.gst_pad_template_get_type())
)

GType values.

View Source
var (
	GTypeParseError   = coreglib.Type(C.gst_parse_error_get_type())
	GTypeParseFlags   = coreglib.Type(C.gst_parse_flags_get_type())
	GTypeParseContext = coreglib.Type(C.gst_parse_context_get_type())
)

GType values.

View Source
var (
	GTypePipelineFlags = coreglib.Type(C.gst_pipeline_flags_get_type())
	GTypePipeline      = coreglib.Type(C.gst_pipeline_get_type())
)

GType values.

View Source
var (
	GTypePluginError           = coreglib.Type(C.gst_plugin_error_get_type())
	GTypePluginDependencyFlags = coreglib.Type(C.gst_plugin_dependency_flags_get_type())
	GTypePluginFlags           = coreglib.Type(C.gst_plugin_flags_get_type())
	GTypePlugin                = coreglib.Type(C.gst_plugin_get_type())
)

GType values.

View Source
var (
	GTypeRank          = coreglib.Type(C.gst_rank_get_type())
	GTypePluginFeature = coreglib.Type(C.gst_plugin_feature_get_type())
)

GType values.

View Source
var (
	GTypePromiseResult = coreglib.Type(C.gst_promise_result_get_type())
	GTypePromise       = coreglib.Type(C.gst_promise_get_type())
)

GType values.

View Source
var (
	GTypeBufferingMode   = coreglib.Type(C.gst_buffering_mode_get_type())
	GTypeQueryType       = coreglib.Type(C.gst_query_type_get_type())
	GTypeQueryTypeFlags  = coreglib.Type(C.gst_query_type_flags_get_type())
	GTypeSchedulingFlags = coreglib.Type(C.gst_scheduling_flags_get_type())
	GTypeQuery           = coreglib.Type(C.gst_query_get_type())
)

GType values.

View Source
var (
	GTypeSeekType     = coreglib.Type(C.gst_seek_type_get_type())
	GTypeSeekFlags    = coreglib.Type(C.gst_seek_flags_get_type())
	GTypeSegmentFlags = coreglib.Type(C.gst_segment_flags_get_type())
	GTypeSegment      = coreglib.Type(C.gst_segment_get_type())
)

GType values.

View Source
var (
	GTypeStreamType = coreglib.Type(C.gst_stream_type_get_type())
	GTypeStream     = coreglib.Type(C.gst_stream_get_type())
)

GType values.

View Source
var (
	GTypeClockType   = coreglib.Type(C.gst_clock_type_get_type())
	GTypeSystemClock = coreglib.Type(C.gst_system_clock_get_type())
)

GType values.

View Source
var (
	GTypeTaskState = coreglib.Type(C.gst_task_state_get_type())
	GTypeTask      = coreglib.Type(C.gst_task_get_type())
)

GType values.

View Source
var (
	GTypeTocEntryType = coreglib.Type(C.gst_toc_entry_type_get_type())
	GTypeTocScope     = coreglib.Type(C.gst_toc_scope_get_type())
	GTypeToc          = coreglib.Type(C.gst_toc_get_type())
	GTypeTocEntry     = coreglib.Type(C.gst_toc_entry_get_type())
)

GType values.

View Source
var (
	GTypeTracerValueScope = coreglib.Type(C.gst_tracer_value_scope_get_type())
	GTypeTracerRecord     = coreglib.Type(C.gst_tracer_record_get_type())
)

GType values.

View Source
var (
	GTypeURIError   = coreglib.Type(C.gst_uri_error_get_type())
	GTypeURIType    = coreglib.Type(C.gst_uri_type_get_type())
	GTypeURIHandler = coreglib.Type(C.gst_uri_handler_get_type())
	GTypeURI        = coreglib.Type(C.gst_uri_get_type())
)

GType values.

View Source
var (
	GTypeBitmask       = coreglib.Type(C.gst_bitmask_get_type())
	GTypeDoubleRange   = coreglib.Type(C.gst_double_range_get_type())
	GTypeFlagSet       = coreglib.Type(C.gst_flagset_get_type())
	GTypeFraction      = coreglib.Type(C.gst_fraction_get_type())
	GTypeFractionRange = coreglib.Type(C.gst_fraction_range_get_type())
	GTypeInt64Range    = coreglib.Type(C.gst_int64_range_get_type())
	GTypeIntRange      = coreglib.Type(C.gst_int_range_get_type())
	GTypeValueArray    = coreglib.Type(C.gst_value_array_get_type())
	GTypeValueList     = coreglib.Type(C.gst_value_list_get_type())
)

GType values.

View Source
var (
	GTypeAtomicQueue = coreglib.Type(C.gst_atomic_queue_get_type())
)

GType values.

View Source
var (
	GTypeBufferList = coreglib.Type(C.gst_buffer_list_get_type())
)

GType values.

View Source
var (
	GTypeCapsFeatures = coreglib.Type(C.gst_caps_features_get_type())
)

GType values.

View Source
var (
	GTypeChildProxy = coreglib.Type(C.gst_child_proxy_get_type())
)

GType values.

View Source
var (
	GTypeContext = coreglib.Type(C.gst_context_get_type())
)

GType values.

View Source
var (
	GTypeControlBinding = coreglib.Type(C.gst_control_binding_get_type())
)

GType values.

View Source
var (
	GTypeControlSource = coreglib.Type(C.gst_control_source_get_type())
)

GType values.

View Source
var (
	GTypeDateTime = coreglib.Type(C.gst_date_time_get_type())
)

GType values.

View Source
var (
	GTypeDebugGraphDetails = coreglib.Type(C.gst_debug_graph_details_get_type())
)

GType values.

View Source
var (
	GTypeDevice = coreglib.Type(C.gst_device_get_type())
)

GType values.

View Source
var (
	GTypeDeviceMonitor = coreglib.Type(C.gst_device_monitor_get_type())
)

GType values.

View Source
var (
	GTypeDeviceProvider = coreglib.Type(C.gst_device_provider_get_type())
)

GType values.

View Source
var (
	GTypeDeviceProviderFactory = coreglib.Type(C.gst_device_provider_factory_get_type())
)

GType values.

View Source
var (
	GTypeDynamicTypeFactory = coreglib.Type(C.gst_dynamic_type_factory_get_type())
)

GType values.

View Source
var (
	GTypeElementFactory = coreglib.Type(C.gst_element_factory_get_type())
)

GType values.

View Source
var (
	GTypeFormat = coreglib.Type(C.gst_format_get_type())
)

GType values.

View Source
var (
	GTypeGapFlags = coreglib.Type(C.gst_gap_flags_get_type())
)

GType values.

View Source
var (
	GTypeMetaFlags = coreglib.Type(C.gst_meta_flags_get_type())
)

GType values.

View Source
var (
	GTypePreset = coreglib.Type(C.gst_preset_get_type())
)

GType values.

View Source
var (
	GTypeRegistry = coreglib.Type(C.gst_registry_get_type())
)

GType values.

View Source
var (
	GTypeSample = coreglib.Type(C.gst_sample_get_type())
)

GType values.

View Source
var (
	GTypeSearchMode = coreglib.Type(C.gst_search_mode_get_type())
)

GType values.

View Source
var (
	GTypeSharedTaskPool = coreglib.Type(C.gst_shared_task_pool_get_type())
)

GType values.

View Source
var (
	GTypeStreamCollection = coreglib.Type(C.gst_stream_collection_get_type())
)

GType values.

View Source
var (
	GTypeStructure = coreglib.Type(C.gst_structure_get_type())
)

GType values.

View Source
var (
	GTypeTagSetter = coreglib.Type(C.gst_tag_setter_get_type())
)

GType values.

View Source
var (
	GTypeTaskPool = coreglib.Type(C.gst_task_pool_get_type())
)

GType values.

View Source
var (
	GTypeTocLoopType = coreglib.Type(C.gst_toc_loop_type_get_type())
)

GType values.

View Source
var (
	GTypeTocSetter = coreglib.Type(C.gst_toc_setter_get_type())
)

GType values.

View Source
var (
	GTypeTracer = coreglib.Type(C.gst_tracer_get_type())
)

GType values.

View Source
var (
	GTypeTracerFactory = coreglib.Type(C.gst_tracer_factory_get_type())
)

GType values.

View Source
var (
	GTypeTracerValueFlags = coreglib.Type(C.gst_tracer_value_flags_get_type())
)

GType values.

View Source
var (
	GTypeTypeFindFactory = coreglib.Type(C.gst_type_find_factory_get_type())
)

GType values.

View Source
var (
	GTypeTypeFindProbability = coreglib.Type(C.gst_type_find_probability_get_type())
)

GType values.

Functions

func AllocatorRegister

func AllocatorRegister(name string, allocator Allocatorrer)

AllocatorRegister registers the memory allocator with name.

The function takes the following parameters:

  • name of the allocator.
  • allocator: Allocator.

func BufferGetMaxMemory

func BufferGetMaxMemory() uint

BufferGetMaxMemory gets the maximum amount of memory blocks that a buffer can hold. This is a compile time constant that can be queried with the function.

When more memory blocks are added, existing memory blocks will be merged together to make room for the new block.

The function returns the following values:

  • guint: maximum amount of memory blocks that a buffer can hold.

func BufferPoolConfigAddOption

func BufferPoolConfigAddOption(config *Structure, option string)

BufferPoolConfigAddOption 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().

The function takes the following parameters:

  • config: BufferPool configuration.
  • option to add.

func BufferPoolConfigGetAllocator

func BufferPoolConfigGetAllocator(config *Structure) (Allocatorrer, *AllocationParams, bool)

BufferPoolConfigGetAllocator gets the allocator and params from config.

The function takes the following parameters:

  • config: BufferPool configuration.

The function returns the following values:

  • allocator (optional) or NULL.
  • params (optional) or NULL.
  • ok: TRUE, if the values are set.

func BufferPoolConfigGetOption

func BufferPoolConfigGetOption(config *Structure, index uint) string

BufferPoolConfigGetOption parses an available config and gets the option at index of the options API array.

The function takes the following parameters:

  • config: BufferPool configuration.
  • index: position in the option array to read.

The function returns the following values:

  • utf8 (optional): option at index.

func BufferPoolConfigHasOption

func BufferPoolConfigHasOption(config *Structure, option string) bool

BufferPoolConfigHasOption checks if config contains option.

The function takes the following parameters:

  • config: BufferPool configuration.
  • option: option.

The function returns the following values:

  • ok: TRUE if the options array contains option.

func BufferPoolConfigNOptions

func BufferPoolConfigNOptions(config *Structure) uint

BufferPoolConfigNOptions retrieves the number of values currently stored in the options array of the config structure.

The function takes the following parameters:

  • config: BufferPool configuration.

The function returns the following values:

  • guint options array size as a #guint.

func BufferPoolConfigSetAllocator

func BufferPoolConfigSetAllocator(config *Structure, allocator Allocatorrer, params *AllocationParams)

BufferPoolConfigSetAllocator 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 AllocationParams.

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.

The function takes the following parameters:

  • config: BufferPool configuration.
  • allocator (optional): Allocator.
  • params (optional): AllocationParams.

func BufferPoolConfigSetParams

func BufferPoolConfigSetParams(config *Structure, caps *Caps, size, minBuffers, maxBuffers uint)

BufferPoolConfigSetParams configures config with the given parameters.

The function takes the following parameters:

  • config: BufferPool configuration.
  • caps (optional) for the buffers.
  • size of each buffer, not including prefix and padding.
  • minBuffers: minimum amount of buffers to allocate.
  • maxBuffers: maximum amount of buffers to allocate or 0 for unlimited.

func BufferPoolConfigValidateParams

func BufferPoolConfigValidateParams(config *Structure, caps *Caps, size, minBuffers, maxBuffers uint) bool

BufferPoolConfigValidateParams 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.

The function takes the following parameters:

  • config: BufferPool configuration.
  • caps (optional): excepted caps of buffers.
  • size: expected size of each buffer, not including prefix and padding.
  • minBuffers: expected minimum amount of buffers to allocate.
  • maxBuffers: expect maximum amount of buffers to allocate or 0 for unlimited.

The function returns the following values:

  • ok: TRUE, if the parameters are valid in this context.

func ClockIDCompareFunc

func ClockIDCompareFunc(id1, id2 unsafe.Pointer) int

ClockIDCompareFunc compares the two ClockID instances. This function can be used as a GCompareFunc when sorting ids.

The function takes the following parameters:

  • id1 (optional): ClockID.
  • id2 (optional) to compare with.

The function returns the following values:

  • gint: negative value if a < b; zero if a = b; positive value if a > b.

func ClockIDUnschedule

func ClockIDUnschedule(id ClockID)

ClockIDUnschedule 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 ClockID.

The function takes the following parameters:

  • id to unschedule.

func ClockIDUsesClock

func ClockIDUsesClock(id ClockID, clock Clocker) bool

ClockIDUsesClock: 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.

The function takes the following parameters:

  • id to check.
  • clock to compare against.

The function returns the following values:

  • ok: whether the clock id uses the same underlying Clock clock.

func ClockIDWait

func ClockIDWait(id ClockID) (ClockTimeDiff, ClockReturn)

ClockIDWait 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 T_CLOCK_OK or T_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 T_CLOCK_EARLY). Negative values indicate how much time was spent waiting on the clock before this function returned.

The function takes the following parameters:

  • id to wait on.

The function returns the following values:

  • jitter (optional): pointer that will contain the jitter, can be NULL.
  • clockReturn: result of the blocking wait. T_CLOCK_EARLY will be returned if the current clock time is past the time of id, T_CLOCK_OK if id was scheduled in time. T_CLOCK_UNSCHEDULED if id was unscheduled with gst_clock_id_unschedule().

func CoreErrorQuark

func CoreErrorQuark() glib.Quark

The function returns the following values:

func DebugAddRingBufferLogger

func DebugAddRingBufferLogger(maxSizePerThread, threadTimeout uint)

DebugAddRingBufferLogger 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.

The function takes the following parameters:

  • maxSizePerThread: maximum size of log per thread in bytes.
  • threadTimeout: timeout for threads in seconds.

func DebugBinToDotData

func DebugBinToDotData(bin *Bin, details DebugGraphDetails) string

DebugBinToDotData: 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.

The function takes the following parameters:

  • bin: top-level pipeline that should be analyzed.
  • details: type of DebugGraphDetails to use.

The function returns the following values:

  • utf8: string containing the pipeline in graphviz dot format.

func DebugBinToDotFile

func DebugBinToDotFile(bin *Bin, details DebugGraphDetails, fileName string)

DebugBinToDotFile: 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.

The function takes the following parameters:

  • bin: top-level pipeline that should be analyzed.
  • details: type of DebugGraphDetails to use.
  • fileName: output base filename (e.g. "myplayer").

func DebugBinToDotFileWithTs

func DebugBinToDotFileWithTs(bin *Bin, details DebugGraphDetails, fileName string)

DebugBinToDotFileWithTs: 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.

The function takes the following parameters:

  • bin: top-level pipeline that should be analyzed.
  • details: type of DebugGraphDetails to use.
  • fileName: output base filename (e.g. "myplayer").

func DebugConstructTermColor

func DebugConstructTermColor(colorinfo uint) string

DebugConstructTermColor constructs a string that can be used for getting the desired color in color terminals. You need to free the string after use.

The function takes the following parameters:

  • colorinfo: color info.

The function returns the following values:

  • utf8: string containing the color definition.

func DebugConstructWinColor

func DebugConstructWinColor(colorinfo uint) int

DebugConstructWinColor 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.

The function takes the following parameters:

  • colorinfo: color info.

The function returns the following values:

  • gint: integer containing the color definition.

func DebugGetStackTrace

func DebugGetStackTrace(flags StackTraceFlags) string

The function takes the following parameters:

  • flags: set of StackTraceFlags to determine how the stack trace should look like. Pass T_STACK_TRACE_SHOW_NONE to retrieve a minimal backtrace.

The function returns the following values:

  • utf8 (optional): stack trace, if libunwind or glibc backtrace are present, else NULL.

func DebugIsActive

func DebugIsActive() bool

DebugIsActive checks if debugging output is activated.

The function returns the following values:

  • ok: TRUE, if debugging is activated.

func DebugIsColored

func DebugIsColored() bool

DebugIsColored checks if the debugging output should be colored.

The function returns the following values:

  • ok: TRUE, if the debug output should be colored.

func DebugLevelGetName

func DebugLevelGetName(level DebugLevel) string

DebugLevelGetName: get the string representation of a debugging level.

The function takes the following parameters:

  • level to get the name for.

The function returns the following values:

  • utf8: name.

func DebugLogLiteral

func DebugLogLiteral(category *DebugCategory, level DebugLevel, file, function string, line int, object *coreglib.Object, messageString string)

DebugLogLiteral logs the given message using the currently registered debugging handlers.

The function takes the following parameters:

  • category to log.
  • level of the message is in.
  • file that emitted the message, usually the __FILE__ identifier.
  • function that emitted the message.
  • line from that the message was emitted, usually __LINE__.
  • object (optional) this message relates to, or NULL if none.
  • messageString: message string.

func DebugPrintStackTrace

func DebugPrintStackTrace()

DebugPrintStackTrace: if libunwind, glibc backtrace or DbgHelp are present a stack trace is printed.

func DebugRemoveLogFunctionByData

func DebugRemoveLogFunctionByData(data unsafe.Pointer) uint

DebugRemoveLogFunctionByData removes all registered instances of log functions with the given user data.

The function takes the following parameters:

  • data (optional): user data of the log function to remove.

The function returns the following values:

  • guint: how many instances of the function were removed.

func DebugRemoveRingBufferLogger

func DebugRemoveRingBufferLogger()

DebugRemoveRingBufferLogger removes any previously added ring buffer logger with gst_debug_add_ring_buffer_logger().

func DebugRingBufferLoggerGetLogs

func DebugRingBufferLoggerGetLogs() []string

DebugRingBufferLoggerGetLogs fetches the current logs per thread from the ring buffer logger. See gst_debug_add_ring_buffer_logger() for details.

The function returns the following values:

  • utf8s: NULL-terminated array of strings with the debug output per thread.

func DebugSetActive

func DebugSetActive(active bool)

DebugSetActive: if activated, debugging messages are sent to the debugging handlers. It makes sense to deactivate it for speed issues. > This function is not threadsafe. It makes sense to only call it during initialization.

The function takes the following parameters:

  • active: whether to use debugging output or not.

func DebugSetColorMode

func DebugSetColorMode(mode DebugColorMode)

DebugSetColorMode changes the coloring mode for debug output.

This function may be called before gst_init().

The function takes the following parameters:

  • mode: coloring mode for debug output. See GstDebugColorMode.

func DebugSetColorModeFromString

func DebugSetColorModeFromString(mode string)

DebugSetColorModeFromString changes the coloring mode for debug output.

This function may be called before gst_init().

The function takes the following parameters:

  • mode: coloring mode for debug output. One of the following: "on", "auto", "off", "disable", "unix".

func DebugSetColored

func DebugSetColored(colored bool)

DebugSetColored 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().

The function takes the following parameters:

  • colored: whether to use colored output or not.

func DebugSetDefaultThreshold

func DebugSetDefaultThreshold(level DebugLevel)

DebugSetDefaultThreshold sets the default threshold to the given level and updates all categories to use this threshold.

This function may be called before gst_init().

The function takes the following parameters:

  • level to set.

func DebugSetThresholdForName

func DebugSetThresholdForName(name string, level DebugLevel)

DebugSetThresholdForName sets all categories which match the given glob style pattern to the given level.

The function takes the following parameters:

  • name of the categories to set.
  • level to set them to.

func DebugSetThresholdFromString

func DebugSetThresholdFromString(list string, reset bool)

DebugSetThresholdFromString 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.

The function takes the following parameters:

  • list: comma-separated list of "category:level" pairs to be used as debug logging levels.
  • reset: 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.

func DebugUnsetThresholdForName

func DebugUnsetThresholdForName(name string)

DebugUnsetThresholdForName resets all categories with the given name back to the default level.

The function takes the following parameters:

  • name of the categories to set.

func Deinit

func Deinit()

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 DeviceProviderRegister

func DeviceProviderRegister(plugin *Plugin, name string, rank uint, typ coreglib.Type) bool

DeviceProviderRegister: create a new device providerfactory capable of instantiating objects of the type and add the factory to plugin.

The function takes the following parameters:

  • plugin (optional) to register the device provider with, or NULL for a static device provider.
  • name of device providers of this type.
  • rank of device provider (higher rank means more importance when autoplugging).
  • typ: GType of device provider to register.

The function returns the following values:

  • ok: TRUE, if the registering succeeded, FALSE on error.

func DynamicTypeFactoryLoad

func DynamicTypeFactoryLoad(factoryname string) coreglib.Type

The function takes the following parameters:

The function returns the following values:

func DynamicTypeRegister

func DynamicTypeRegister(plugin *Plugin, typ coreglib.Type) bool

DynamicTypeRegister registers a new DynamicTypeFactory in the registry.

The function takes the following parameters:

  • plugin to register dyn_type for.
  • typ to register dynamically.

The function returns the following values:

func ElementRegister

func ElementRegister(plugin *Plugin, name string, rank uint, typ coreglib.Type) bool

ElementRegister: create a new elementfactory capable of instantiating objects of the type and add the factory to plugin.

The function takes the following parameters:

  • plugin (optional) to register the element with, or NULL for a static element.
  • name of elements of this type.
  • rank of element (higher rank means more importance when autoplugging).
  • typ: GType of element to register.

The function returns the following values:

  • ok: TRUE, if the registering succeeded, FALSE on error.

func ElementStateChangeReturnGetName

func ElementStateChangeReturnGetName(stateRet StateChangeReturn) string

ElementStateChangeReturnGetName gets a string representing the given state change result.

The function takes the following parameters:

  • stateRet to get the name of.

The function returns the following values:

  • utf8: string with the name of the state result.

func ElementStateGetName

func ElementStateGetName(state State) string

ElementStateGetName gets a string representing the given state.

The function takes the following parameters:

  • state to get the name of.

The function returns the following values:

  • utf8: string with the name of the state.

func ElementTypeSetSkipDocumentation

func ElementTypeSetSkipDocumentation(typ coreglib.Type)

ElementTypeSetSkipDocumentation marks type as "documentation should be skipped". Can be useful for dynamically registered element to be excluded from plugin documentation system.

Example:

GType my_type;
GTypeInfo my_type_info;

// Fill "my_type_info"
...

my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
   &my_type_info, 0);
gst_element_type_set_skip_documentation (my_type);
gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);.

The function takes the following parameters:

  • typ of element.

func ErrorGetMessage

func ErrorGetMessage(domain glib.Quark, code int) string

ErrorGetMessage: get a string describing the error message in the current locale.

The function takes the following parameters:

  • domain: GStreamer error domain this error belongs to.
  • code: error code belonging to the domain.

The function returns the following values:

  • utf8: newly allocated string describing the error message (in UTF-8 encoding).

func EventTypeGetName

func EventTypeGetName(typ EventType) string

EventTypeGetName: get a printable name for the given event type. Do not modify or free.

The function takes the following parameters:

  • typ: event type.

The function returns the following values:

  • utf8: reference to the static name of the event.

func EventTypeToQuark

func EventTypeToQuark(typ EventType) glib.Quark

EventTypeToQuark: get the unique quark for the given event type.

The function takes the following parameters:

  • typ: event type.

The function returns the following values:

  • quark associated with the event type.

func FilenameToURI

func FilenameToURI(filename string) (string, error)

FilenameToURI: 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.

The function takes the following parameters:

  • filename: absolute or relative file name path.

The function returns the following values:

  • utf8: newly-allocated URI string, or NULL on error. The caller must free the URI string with g_free() when no longer needed.

func FlagSetRegister

func FlagSetRegister(flagsType coreglib.Type) coreglib.Type

FlagSetRegister: create a new sub-class of T_TYPE_FLAG_SET which will pretty-print the human-readable flags when serializing, for easier debugging.

The function takes the following parameters:

  • flagsType of a TYPE_FLAGS type.

The function returns the following values:

func FlowGetName

func FlowGetName(ret FlowReturn) string

FlowGetName gets a string representing the given flow return.

The function takes the following parameters:

  • ret to get the name of.

The function returns the following values:

  • utf8: static string with the name of the flow return.

func FlowToQuark

func FlowToQuark(ret FlowReturn) glib.Quark

FlowToQuark: get the unique quark for the given GstFlowReturn.

The function takes the following parameters:

  • ret to get the quark of.

The function returns the following values:

  • quark associated with the flow return or 0 if an invalid return was specified.

func FormatGetName

func FormatGetName(format Format) string

FormatGetName: get a printable name for the given format. Do not modify or free.

The function takes the following parameters:

  • format: Format.

The function returns the following values:

  • utf8 (optional): reference to the static name of the format or NULL if the format is unknown.

func FormatToQuark

func FormatToQuark(format Format) glib.Quark

FormatToQuark: get the unique quark for the given format.

The function takes the following parameters:

  • format: Format.

The function returns the following values:

  • quark associated with the format or 0 if the format is unknown.

func FormatsContains

func FormatsContains(formats []Format, format Format) bool

FormatsContains: see if the given format is inside the format array.

The function takes the following parameters:

  • formats: format array to search.
  • format to find.

The function returns the following values:

  • ok: TRUE if the format is found inside the array.

func GetMainExecutablePath

func GetMainExecutablePath() string

GetMainExecutablePath: 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.

The function returns the following values:

  • utf8 (optional): path of the executable that initialized GStreamer, or NULL if it could not be determined.

func GhostPadActivateModeDefault

func GhostPadActivateModeDefault(pad *Pad, parent GstObjector, mode PadMode, active bool) bool

GhostPadActivateModeDefault: invoke the default activate mode function of a ghost pad.

The function takes the following parameters:

  • pad to activate or deactivate.
  • parent (optional) of pad or NULL.
  • mode: requested activation mode.
  • active: whether the pad should be active or not.

The function returns the following values:

  • ok: TRUE if the operation was successful.

func GhostPadInternalActivateModeDefault

func GhostPadInternalActivateModeDefault(pad *Pad, parent GstObjector, mode PadMode, active bool) bool

GhostPadInternalActivateModeDefault: invoke the default activate mode function of a proxy pad that is owned by a ghost pad.

The function takes the following parameters:

  • pad to activate or deactivate.
  • parent (optional) of pad or NULL.
  • mode: requested activation mode.
  • active: whether the pad should be active or not.

The function returns the following values:

  • ok: TRUE if the operation was successful.

func Init

func Init()

Init binds to the gst_init() function. Argument parsing is not supported.

func IsCapsFeatures

func IsCapsFeatures(obj unsafe.Pointer) bool

IsCapsFeatures checks if obj is a CapsFeatures.

The function takes the following parameters:

The function returns the following values:

  • ok: TRUE if obj is a CapsFeatures FALSE otherwise.

func IsInitialized

func IsInitialized() bool

IsInitialized: use this function to check if GStreamer has been initialized with gst_init() or gst_init_check().

The function returns the following values:

  • ok: TRUE if initialization has been done, FALSE otherwise.

func LibraryErrorQuark

func LibraryErrorQuark() glib.Quark

The function returns the following values:

func MessageTypeGetName

func MessageTypeGetName(typ MessageType) string

MessageTypeGetName: get a printable name for the given message type. Do not modify or free.

The function takes the following parameters:

  • typ: message type.

The function returns the following values:

  • utf8: reference to the static name of the message.

func MessageTypeToQuark

func MessageTypeToQuark(typ MessageType) glib.Quark

MessageTypeToQuark: get the unique quark for the given message type.

The function takes the following parameters:

  • typ: message type.

The function returns the following values:

  • quark associated with the message type.

func MetaApiTypeGetTags

func MetaApiTypeGetTags(api coreglib.Type) []string

The function takes the following parameters:

  • api: API.

The function returns the following values:

  • utf8s: array of tags as strings.

func MetaApiTypeHasTag

func MetaApiTypeHasTag(api coreglib.Type, tag glib.Quark) bool

MetaApiTypeHasTag: check if api was registered with tag.

The function takes the following parameters:

  • api: API.
  • tag to check.

The function returns the following values:

  • ok: TRUE if api was registered with tag.

func MetaApiTypeRegister

func MetaApiTypeRegister(api string, tags []string) coreglib.Type

MetaApiTypeRegister: register and return a GType for the api and associate it with tags.

The function takes the following parameters:

  • api: API to register.
  • tags for api.

The function returns the following values:

  • gType: unique GType for api.

func ObjectCheckUniqueness

func ObjectCheckUniqueness(list []GstObjector, name string) bool

ObjectCheckUniqueness checks to see if there is any object named name in list. This function does not do any locking of any kind. You might want to protect the provided list with the lock of the owner of the list. This function will lock each Object in the list to compare the name, so be careful when passing a list with a locked object.

The function takes the following parameters:

  • list of Object to check through.
  • name to search for.

The function returns the following values:

  • ok: TRUE if a Object named name does not appear in list, FALSE if it does.

    MT safe. Grabs and releases the LOCK of each object in the list.

func PadLinkGetName

func PadLinkGetName(ret PadLinkReturn) string

PadLinkGetName gets a string representing the given pad-link return.

The function takes the following parameters:

  • ret to get the name of.

The function returns the following values:

  • utf8: static string with the name of the pad-link return.

func PadModeGetName

func PadModeGetName(mode PadMode) string

PadModeGetName: return the name of a pad mode, for use in debug messages mostly.

The function takes the following parameters:

  • mode: pad mode.

The function returns the following values:

  • utf8: short mnemonic for pad mode mode.

func ParentBufferMetaApiGetType

func ParentBufferMetaApiGetType() coreglib.Type

The function returns the following values:

func ParseErrorQuark

func ParseErrorQuark() glib.Quark

ParseErrorQuark: get the error quark used by the parsing subsystem.

The function returns the following values:

  • quark of the parse errors.

func PluginErrorQuark

func PluginErrorQuark() glib.Quark

PluginErrorQuark: get the error quark.

The function returns the following values:

  • quark: error quark used in GError messages.

func PluginFeatureListDebug

func PluginFeatureListDebug(list []PluginFeaturer)

PluginFeatureListDebug: debug the plugin feature names in list.

The function takes the following parameters:

  • list of plugin features.

func PluginFeatureRankCompareFunc

func PluginFeatureRankCompareFunc(p1, p2 unsafe.Pointer) int

PluginFeatureRankCompareFunc compares the two given PluginFeature instances. This function can be used as a Func when sorting by rank and then by name.

The function takes the following parameters:

  • p1 (optional): PluginFeature.
  • p2 (optional): PluginFeature.

The function returns the following values:

  • gint: negative value if the rank of p1 > the rank of p2 or the ranks are equal but the name of p1 comes before the name of p2; zero if the rank and names are equal; positive value if the rank of p1 < the rank of p2 or the ranks are equal but the name of p2 comes before the name of p1.

func PluginRegisterStaticFull

func PluginRegisterStaticFull(majorVersion, minorVersion int, name, description string, initFullFunc PluginInitFullFunc, version, license, source, pkg, origin string) bool

PluginRegisterStaticFull 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 PluginInitFullFunc 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.

The function takes the following parameters:

  • majorVersion: major version number of the GStreamer core that the plugin was compiled for, you can just use GST_VERSION_MAJOR here.
  • minorVersion: minor version number of the GStreamer core that the plugin was compiled for, you can just use GST_VERSION_MINOR here.
  • name: 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 of the plugin.
  • initFullFunc: pointer to the init function with user data of this plugin.
  • version string of the plugin.
  • license: effective license of plugin. Must be one of the approved licenses (see PluginDesc above) or the plugin will not be registered.
  • source module plugin belongs to.
  • pkg: shipped package plugin belongs to.
  • origin: URL to provider of plugin.

The function returns the following values:

  • ok: TRUE if the plugin was registered correctly, otherwise FALSE.

func PresetGetAppDir

func PresetGetAppDir() string

PresetGetAppDir gets the directory for application specific presets if set by the application.

The function returns the following values:

  • filename (optional): directory or NULL, don't free or modify the string.

func PresetSetAppDir

func PresetSetAppDir(appDir string) bool

PresetSetAppDir 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.

The function takes the following parameters:

  • appDir: application specific preset dir.

The function returns the following values:

  • ok: TRUE for success, FALSE if the dir already has been set.

func ProtectionFilterSystemsByAvailableDecryptors

func ProtectionFilterSystemsByAvailableDecryptors(systemIdentifiers []string) []string

ProtectionFilterSystemsByAvailableDecryptors iterates the supplied list of UUIDs and checks the GstRegistry for all the decryptors supporting one of the supplied UUIDs.

The function takes the following parameters:

  • systemIdentifiers: 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:

  • utf8s (optional): A null terminated array containing all the system_identifiers supported by the set of available decryptors, or NULL if no matches were found.

func ProtectionMetaApiGetType

func ProtectionMetaApiGetType() coreglib.Type

The function returns the following values:

func ProtectionSelectSystem

func ProtectionSelectSystem(systemIdentifiers []string) string

ProtectionSelectSystem 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.

The function takes the following parameters:

  • systemIdentifiers: 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:

  • utf8 (optional): one of the strings from system_identifiers that indicates the highest ranked element that implements the protection system indicated by that system ID, or NULL if no element has been found.

func ProxyPadGetrangeDefault

func ProxyPadGetrangeDefault(pad *Pad, parent GstObjector, offset uint64, size uint) (*Buffer, FlowReturn)

ProxyPadGetrangeDefault: invoke the default getrange function of the proxy pad.

The function takes the following parameters:

  • pad: src Pad, returns T_FLOW_ERROR if not.
  • parent of pad.
  • offset: start offset of the buffer.
  • size: length of the buffer.

The function returns the following values:

  • buffer: pointer to hold the Buffer, returns T_FLOW_ERROR if NULL.
  • flowReturn from the pad.

func QueryTypeGetName

func QueryTypeGetName(typ QueryType) string

QueryTypeGetName: get a printable name for the given query type. Do not modify or free.

The function takes the following parameters:

  • typ: query type.

The function returns the following values:

  • utf8: reference to the static name of the query.

func QueryTypeToQuark

func QueryTypeToQuark(typ QueryType) glib.Quark

QueryTypeToQuark: get the unique quark for the given query type.

The function takes the following parameters:

  • typ: query type.

The function returns the following values:

  • quark associated with the query type.

func ReferenceTimestampMetaApiGetType

func ReferenceTimestampMetaApiGetType() coreglib.Type

The function returns the following values:

func RegistryForkIsEnabled

func RegistryForkIsEnabled() bool

RegistryForkIsEnabled: 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.

The function returns the following values:

  • ok: TRUE if GStreamer will use the child helper process when rebuilding the registry.

func RegistryForkSetEnabled

func RegistryForkSetEnabled(enabled bool)

RegistryForkSetEnabled 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.

The function takes the following parameters:

  • enabled: whether rebuilding the registry can use a temporary child helper process.

func ResourceErrorQuark

func ResourceErrorQuark() glib.Quark

The function returns the following values:

func SegtrapIsEnabled

func SegtrapIsEnabled() bool

SegtrapIsEnabled: 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.

The function returns the following values:

  • ok: TRUE if GStreamer is allowed to install a custom SIGSEGV handler.

func SegtrapSetEnabled

func SegtrapSetEnabled(enabled bool)

SegtrapSetEnabled applications might want to disable/enable the SIGSEGV handling of the GStreamer core. See gst_segtrap_is_enabled() for more information.

The function takes the following parameters:

  • enabled: whether a custom SIGSEGV handler should be installed.

func StateChangeGetName

func StateChangeGetName(transition StateChange) string

StateChangeGetName gets a string representing the given state transition.

The function takes the following parameters:

  • transition to get the name of.

The function returns the following values:

  • utf8: string with the name of the state result.

func StaticCapsGetType

func StaticCapsGetType() coreglib.Type

The function returns the following values:

func StaticPadTemplateGetType

func StaticPadTemplateGetType() coreglib.Type

The function returns the following values:

func StreamErrorQuark

func StreamErrorQuark() glib.Quark

The function returns the following values:

func StreamTypeGetName

func StreamTypeGetName(stype StreamType) string

StreamTypeGetName: get a descriptive string for a given StreamType.

The function takes the following parameters:

  • stype: StreamType.

The function returns the following values:

  • utf8: string describing the stream type.

func SystemClockSetDefault

func SystemClockSetDefault(newClock Clocker)

SystemClockSetDefault 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.

The function takes the following parameters:

  • newClock (optional): Clock.

func TaskCleanupAll

func TaskCleanupAll()

TaskCleanupAll: 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 TocEntryTypeGetNick

func TocEntryTypeGetNick(typ TocEntryType) string

TocEntryTypeGetNick converts type to a string representation.

The function takes the following parameters:

  • typ: TocEntryType.

The function returns the following values:

  • utf8 returns a human-readable string for type. This string is only for debugging purpose and should not be displayed in a user interface.

func TracerRegister

func TracerRegister(plugin *Plugin, name string, typ coreglib.Type) bool

TracerRegister: create a new tracer-factory capable of instantiating objects of the type and add the factory to plugin.

The function takes the following parameters:

  • plugin (optional) or NULL for a static typefind function.
  • name for registering.
  • typ: GType of tracer to register.

The function returns the following values:

  • ok: TRUE, if the registering succeeded, FALSE on error.

func TypeFindGetType

func TypeFindGetType() coreglib.Type

The function returns the following values:

func TypeFindRegister

func TypeFindRegister(plugin *Plugin, name string, rank uint, fn TypeFindFunction, extensions string, possibleCaps *Caps) bool

TypeFindRegister registers a new typefind function to be used for typefinding. After registering this function will be available for typefinding. This function is typically called during an element's plugin initialization.

The function takes the following parameters:

  • plugin (optional) or NULL for a static typefind function.
  • name for registering.
  • rank (or importance) of this typefind function.
  • fn to use.
  • extensions (optional): optional comma-separated list of extensions that could belong to this type.
  • possibleCaps (optional): optionally the caps that could be returned when typefinding succeeds.

The function returns the following values:

  • ok: TRUE on success, FALSE otherwise.

func TypeMarkAsPluginApi

func TypeMarkAsPluginApi(typ coreglib.Type, flags PluginAPIFlags)

TypeMarkAsPluginApi 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.

The function takes the following parameters:

  • typ: GType.
  • flags: set of PluginAPIFlags to further inform cache generation.

func URIConstruct deprecated

func URIConstruct(protocol, location string) string

URIConstruct constructs a URI for a given valid protocol and location.

Free-function: g_free

Deprecated: Use GstURI instead.

The function takes the following parameters:

  • protocol: protocol for URI.
  • location: location for URI.

The function returns the following values:

  • utf8: new string for this URI. Returns NULL if the given URI protocol is not valid, or the given location is NULL.

func URIErrorQuark

func URIErrorQuark() glib.Quark

The function returns the following values:

func URIGetLocation

func URIGetLocation(uri string) string

URIGetLocation extracts the location out of a given valid URI, ie. the protocol and "://" are stripped from the URI, which means that the location returned includes the hostname if one is specified. The returned string must be freed using g_free().

Free-function: g_free.

The function takes the following parameters:

  • uri: URI string.

The function returns the following values:

  • utf8 (optional): location for this URI. Returns NULL if the URI isn't valid. If the URI does not contain a location, an empty string is returned.

func URIGetProtocol

func URIGetProtocol(uri string) string

URIGetProtocol extracts the protocol out of a given valid URI. The returned string must be freed using g_free().

The function takes the following parameters:

  • uri: URI string.

The function returns the following values:

  • utf8 (optional): protocol for this URI.

func URIHasProtocol

func URIHasProtocol(uri, protocol string) bool

URIHasProtocol checks if the protocol of a given valid URI matches protocol.

The function takes the following parameters:

  • uri: URI string.
  • protocol string (e.g. "http").

The function returns the following values:

  • ok: TRUE if the protocol matches.

func URIIsValid

func URIIsValid(uri string) bool

URIIsValid tests if the given string is a valid URI identifier. URIs start with a valid scheme followed by ":" and maybe a string identifying the location.

The function takes the following parameters:

  • uri: URI string.

The function returns the following values:

  • ok: TRUE if the string is a valid URI.

func URIJoinStrings

func URIJoinStrings(baseUri, refUri string) string

URIJoinStrings: this is a convenience function to join two URI strings and return the result. The returned string should be g_free()'d after use.

The function takes the following parameters:

  • baseUri: percent-encoded base URI.
  • refUri: percent-encoded reference URI to join to the base_uri.

The function returns the following values:

  • utf8: string representing the percent-encoded join of the two URIs.

func URIProtocolIsSupported

func URIProtocolIsSupported(typ URIType, protocol string) bool

URIProtocolIsSupported checks if an element exists that supports the given URI protocol. Note that a positive return value does not imply that a subsequent call to gst_element_make_from_uri() is guaranteed to work.

The function takes the following parameters:

  • typ: whether to check for a source or a sink.
  • protocol: protocol that should be checked for (e.g. "http" or "smb").

The function returns the following values:

  • ok: TRUE.

func URIProtocolIsValid

func URIProtocolIsValid(protocol string) bool

URIProtocolIsValid tests if the given string is a valid protocol identifier. Protocols must consist of alphanumeric characters, '+', '-' and '.' and must start with a alphabetic character. See RFC 3986 Section 3.1.

The function takes the following parameters:

  • protocol: string.

The function returns the following values:

  • ok: TRUE if the string is a valid protocol identifier, FALSE otherwise.

func UpdateRegistry

func UpdateRegistry() bool

UpdateRegistry 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.

The function returns the following values:

  • ok: TRUE if the registry has been updated successfully (does not imply that there were changes), otherwise FALSE.

func UtilArrayBinarySearch

func UtilArrayBinarySearch(array unsafe.Pointer, numElements, elementSize uint, searchFunc glib.CompareDataFunc, mode SearchMode, searchData unsafe.Pointer) unsafe.Pointer

UtilArrayBinarySearch 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)).

The function takes the following parameters:

  • array (optional): sorted input array.
  • numElements: number of elements in the array.
  • elementSize: size of every element in bytes.
  • searchFunc: function to compare two elements, search_data will always be passed as second argument.
  • mode: search mode that should be used.
  • searchData (optional): element that should be found.

The function returns the following values:

  • gpointer (optional) address of the found element or NULL if nothing was found.

func UtilDoubleToFraction

func UtilDoubleToFraction(src float64) (destN, destD int)

UtilDoubleToFraction transforms a #gdouble to a fraction and simplifies the result.

The function takes the following parameters:

  • src to transform.

The function returns the following values:

  • destN: pointer to a #gint to hold the result numerator.
  • destD: pointer to a #gint to hold the result denominator.

func UtilDumpBuffer

func UtilDumpBuffer(buf *Buffer)

UtilDumpBuffer dumps the buffer memory into a hex representation. Useful for debugging.

The function takes the following parameters:

  • buf whose memory to dump.

func UtilDumpMem

func UtilDumpMem(mem []byte)

UtilDumpMem dumps the memory block into a hex representation. Useful for debugging.

The function takes the following parameters:

  • mem: pointer to the memory to dump.

func UtilFractionAdd

func UtilFractionAdd(aN, aD, bN, bD int) (resN, resD int, ok bool)

UtilFractionAdd adds the fractions a_n/a_d and b_n/b_d and stores the result in res_n and res_d.

The function takes the following parameters:

  • aN: numerator of first value.
  • aD: denominator of first value.
  • bN: numerator of second value.
  • bD: denominator of second value.

The function returns the following values:

  • resN: pointer to #gint to hold the result numerator.
  • resD: pointer to #gint to hold the result denominator.
  • ok: FALSE on overflow, TRUE otherwise.

func UtilFractionCompare

func UtilFractionCompare(aN, aD, bN, bD int) int

UtilFractionCompare compares the fractions a_n/a_d and b_n/b_d and returns -1 if a < b, 0 if a = b and 1 if a > b.

The function takes the following parameters:

  • aN: numerator of first value.
  • aD: denominator of first value.
  • bN: numerator of second value.
  • bD: denominator of second value.

The function returns the following values:

  • gint: -1 if a < b; 0 if a = b; 1 if a > b.

func UtilFractionMultiply

func UtilFractionMultiply(aN, aD, bN, bD int) (resN, resD int, ok bool)

UtilFractionMultiply multiplies the fractions a_n/a_d and b_n/b_d and stores the result in res_n and res_d.

The function takes the following parameters:

  • aN: numerator of first value.
  • aD: denominator of first value.
  • bN: numerator of second value.
  • bD: denominator of second value.

The function returns the following values:

  • resN: pointer to #gint to hold the result numerator.
  • resD: pointer to #gint to hold the result denominator.
  • ok: FALSE on overflow, TRUE otherwise.

func UtilFractionToDouble

func UtilFractionToDouble(srcN, srcD int) float64

UtilFractionToDouble transforms a fraction to a #gdouble.

The function takes the following parameters:

  • srcN: fraction numerator as #gint.
  • srcD: fraction denominator #gint.

The function returns the following values:

  • dest: pointer to a #gdouble for the result.

func UtilGdoubleToGuint64

func UtilGdoubleToGuint64(value float64) uint64

The function takes the following parameters:

  • value value to convert guint64 double.

The function returns the following values:

  • guint64: value casted to #guint64.

func UtilGreatestCommonDivisor

func UtilGreatestCommonDivisor(a, b int) int

UtilGreatestCommonDivisor calculates the greatest common divisor of a and b.

The function takes the following parameters:

  • a: first value as #gint.
  • b: second value as #gint.

The function returns the following values:

  • gint: greatest common divisor of a and b.

func UtilGreatestCommonDivisorInt64

func UtilGreatestCommonDivisorInt64(a, b int64) int64

UtilGreatestCommonDivisorInt64 calculates the greatest common divisor of a and b.

The function takes the following parameters:

  • a: first value as #gint64.
  • b: second value as #gint64.

The function returns the following values:

  • gint64: greatest common divisor of a and b.

func UtilGroupIDNext

func UtilGroupIDNext() uint

UtilGroupIDNext: 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).

The function returns the following values:

  • guint: constantly incrementing unsigned integer, which might overflow back to 0 at some point.

func UtilGuint64ToGdouble

func UtilGuint64ToGdouble(value uint64) float64

The function takes the following parameters:

  • value value to convert to double.

The function returns the following values:

  • gdouble: value casted to #gdouble.

func UtilSeqnumCompare

func UtilSeqnumCompare(s1, s2 uint32) int32

UtilSeqnumCompare: compare two sequence numbers, handling wraparound.

The current implementation just returns (gint32)(s1 - s2).

The function takes the following parameters:

  • s1: sequence number.
  • s2: another sequence number.

The function returns the following values:

  • gint32: negative number if s1 is before s2, 0 if they are equal, or a positive number if s1 is after s2.

func UtilSeqnumNext

func UtilSeqnumNext() uint32

UtilSeqnumNext: 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).

The function returns the following values:

  • guint32: constantly incrementing 32-bit unsigned integer, which might overflow at some point. Use gst_util_seqnum_compare() to make sure you handle wraparound correctly.

func UtilSetObjectArg

func UtilSetObjectArg(object *coreglib.Object, name, value string)

UtilSetObjectArg 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.

The function takes the following parameters:

  • object to set the argument of.
  • name of the argument to set.
  • value: string value to set.

func UtilSetValueFromString

func UtilSetValueFromString(valueStr string) coreglib.Value

UtilSetValueFromString converts the string to the type of the value and sets the value with it.

Note that this function is dangerous as it does not return any indication if the conversion worked or not.

The function takes the following parameters:

  • valueStr: string to get the value from.

The function returns the following values:

  • value to set.

func UtilUint64Scale

func UtilUint64Scale(val, num, denom uint64) uint64

UtilUint64Scale: 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.

The function takes the following parameters:

  • val: number to scale.
  • num: numerator of the scale ratio.
  • denom: denominator of the scale ratio.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer it is truncated. See also gst_util_uint64_scale_round(), gst_util_uint64_scale_ceil(), gst_util_uint64_scale_int(), gst_util_uint64_scale_int_round(), gst_util_uint64_scale_int_ceil().

func UtilUint64ScaleCeil

func UtilUint64ScaleCeil(val, num, denom uint64) uint64

UtilUint64ScaleCeil: 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.

The function takes the following parameters:

  • val: number to scale.
  • num: numerator of the scale ratio.
  • denom: denominator of the scale ratio.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded up. See also gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_int(), gst_util_uint64_scale_int_round(), gst_util_uint64_scale_int_ceil().

func UtilUint64ScaleInt

func UtilUint64ScaleInt(val uint64, num, denom int) uint64

UtilUint64ScaleInt: 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.

The function takes the following parameters:

  • val: guint64 (such as a ClockTime) to scale.
  • num: numerator of the scale factor.
  • denom: denominator of the scale factor.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is truncated. See also gst_util_uint64_scale_int_round(), gst_util_uint64_scale_int_ceil(), gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_ceil().

func UtilUint64ScaleIntCeil

func UtilUint64ScaleIntCeil(val uint64, num, denom int) uint64

UtilUint64ScaleIntCeil: 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.

The function takes the following parameters:

  • val: guint64 (such as a ClockTime) to scale.
  • num: numerator of the scale factor.
  • denom: denominator of the scale factor.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded up. See also gst_util_uint64_scale_int(), gst_util_uint64_scale_int_round(), gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_ceil().

func UtilUint64ScaleIntRound

func UtilUint64ScaleIntRound(val uint64, num, denom int) uint64

UtilUint64ScaleIntRound: 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.

The function takes the following parameters:

  • val: guint64 (such as a ClockTime) to scale.
  • num: numerator of the scale factor.
  • denom: denominator of the scale factor.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded to the nearest integer (half-way cases are rounded up). See also gst_util_uint64_scale_int(), gst_util_uint64_scale_int_ceil(), gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_ceil().

func UtilUint64ScaleRound

func UtilUint64ScaleRound(val, num, denom uint64) uint64

UtilUint64ScaleRound: 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.

The function takes the following parameters:

  • val: number to scale.
  • num: numerator of the scale ratio.
  • denom: denominator of the scale ratio.

The function returns the following values:

  • guint64: val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded to the nearest integer (half-way cases are rounded up). See also gst_util_uint64_scale(), gst_util_uint64_scale_ceil(), gst_util_uint64_scale_int(), gst_util_uint64_scale_int_round(), gst_util_uint64_scale_int_ceil().

func ValueArrayAppendAndTakeValue

func ValueArrayAppendAndTakeValue(value, appendValue *coreglib.Value)

ValueArrayAppendAndTakeValue appends append_value to the GstValueArray in value.

The function takes the following parameters:

  • value of type T_TYPE_ARRAY.
  • appendValue: value to append.

func ValueArrayAppendValue

func ValueArrayAppendValue(value, appendValue *coreglib.Value)

ValueArrayAppendValue appends append_value to the GstValueArray in value.

The function takes the following parameters:

  • value of type T_TYPE_ARRAY.
  • appendValue: value to append.

func ValueArrayGetSize

func ValueArrayGetSize(value *coreglib.Value) uint

ValueArrayGetSize gets the number of values contained in value.

The function takes the following parameters:

  • value of type T_TYPE_ARRAY.

The function returns the following values:

  • guint: number of values.

func ValueArrayGetValue

func ValueArrayGetValue(value *coreglib.Value, index uint) *coreglib.Value

ValueArrayGetValue gets the value that is a member of the array contained in value and has the index index.

The function takes the following parameters:

  • value of type T_TYPE_ARRAY.
  • index of value to get from the array.

The function returns the following values:

  • ret: value at the given index.

func ValueArrayInit

func ValueArrayInit(value *coreglib.Value, prealloc uint) *coreglib.Value

ValueArrayInit initializes and pre-allocates a #GValue of type T_TYPE_ARRAY.

The function takes the following parameters:

  • value: zero-filled (uninitialized) #GValue structure.
  • prealloc: number of entries to pre-allocate in the array.

The function returns the following values:

  • ret structure that has been passed in.

func ValueArrayPrependValue

func ValueArrayPrependValue(value, prependValue *coreglib.Value)

ValueArrayPrependValue prepends prepend_value to the GstValueArray in value.

The function takes the following parameters:

  • value of type T_TYPE_ARRAY.
  • prependValue: value to prepend.

func ValueCanCompare

func ValueCanCompare(value1, value2 *coreglib.Value) bool

ValueCanCompare determines if value1 and value2 can be compared.

The function takes the following parameters:

  • value1: value to compare.
  • value2: another value to compare.

The function returns the following values:

  • ok: TRUE if the values can be compared.

func ValueCanIntersect

func ValueCanIntersect(value1, value2 *coreglib.Value) bool

ValueCanIntersect determines if intersecting two values will produce a valid result. Two values will produce a valid intersection if they have the same type.

The function takes the following parameters:

  • value1: value to intersect.
  • value2: another value to intersect.

The function returns the following values:

  • ok: TRUE if the values can intersect.

func ValueCanSubtract

func ValueCanSubtract(minuend, subtrahend *coreglib.Value) bool

ValueCanSubtract checks if it's possible to subtract subtrahend from minuend.

The function takes the following parameters:

  • minuend: value to subtract from.
  • subtrahend: value to subtract.

The function returns the following values:

  • ok: TRUE if a subtraction is possible.

func ValueCanUnion

func ValueCanUnion(value1, value2 *coreglib.Value) bool

ValueCanUnion 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.

The function takes the following parameters:

  • value1: value to union.
  • value2: another value to union.

The function returns the following values:

  • ok: TRUE if there is a function allowing the two values to be unioned.

func ValueCompare

func ValueCompare(value1, value2 *coreglib.Value) int

ValueCompare 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.

The function takes the following parameters:

  • value1: value to compare.
  • value2: another value to compare.

The function returns the following values:

  • gint: comparison result.

func ValueDeserialize

func ValueDeserialize(src string) (coreglib.Value, bool)

ValueDeserialize tries to deserialize a string into the type specified by the given GValue. If the operation succeeds, TRUE is returned, FALSE otherwise.

The function takes the following parameters:

  • src: string to deserialize.

The function returns the following values:

  • dest to fill with contents of deserialization.
  • ok: TRUE on success.

func ValueFixate

func ValueFixate(dest, src *coreglib.Value) bool

ValueFixate: 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.

The function takes the following parameters:

  • dest: #GValue destination.
  • src to fixate.

The function returns the following values:

  • ok: TRUE if dest contains a fixated version of src.

func ValueFractionMultiply

func ValueFractionMultiply(product, factor1, factor2 *coreglib.Value) bool

ValueFractionMultiply multiplies the two #GValue items containing a T_TYPE_FRACTION and sets product to the product of the two fractions.

The function takes the following parameters:

  • product: GValue initialized to T_TYPE_FRACTION.
  • factor1: GValue initialized to T_TYPE_FRACTION.
  • factor2: GValue initialized to T_TYPE_FRACTION.

The function returns the following values:

  • ok: FALSE in case of an error (like integer overflow), TRUE otherwise.

func ValueFractionSubtract

func ValueFractionSubtract(dest, minuend, subtrahend *coreglib.Value) bool

ValueFractionSubtract subtracts the subtrahend from the minuend and sets dest to the result.

The function takes the following parameters:

  • dest: GValue initialized to T_TYPE_FRACTION.
  • minuend: GValue initialized to T_TYPE_FRACTION.
  • subtrahend: GValue initialized to T_TYPE_FRACTION.

The function returns the following values:

  • ok: FALSE in case of an error (like integer overflow), TRUE otherwise.

func ValueGetBitmask

func ValueGetBitmask(value *coreglib.Value) uint64

ValueGetBitmask gets the bitmask specified by value.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_BITMASK.

The function returns the following values:

  • guint64: bitmask.

func ValueGetDoubleRangeMax

func ValueGetDoubleRangeMax(value *coreglib.Value) float64

ValueGetDoubleRangeMax gets the maximum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_DOUBLE_RANGE.

The function returns the following values:

  • gdouble: maximum of the range.

func ValueGetDoubleRangeMin

func ValueGetDoubleRangeMin(value *coreglib.Value) float64

ValueGetDoubleRangeMin gets the minimum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_DOUBLE_RANGE.

The function returns the following values:

  • gdouble: minimum of the range.

func ValueGetFlagsetFlags

func ValueGetFlagsetFlags(value *coreglib.Value) uint

ValueGetFlagsetFlags: retrieve the flags field of a GstFlagSet value.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_FLAG_SET.

The function returns the following values:

  • guint flags field of the flagset instance.

func ValueGetFlagsetMask

func ValueGetFlagsetMask(value *coreglib.Value) uint

ValueGetFlagsetMask: retrieve the mask field of a GstFlagSet value.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_FLAG_SET.

The function returns the following values:

  • guint: mask field of the flagset instance.

func ValueGetFractionDenominator

func ValueGetFractionDenominator(value *coreglib.Value) int

ValueGetFractionDenominator gets the denominator of the fraction specified by value.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_FRACTION.

The function returns the following values:

  • gint: denominator of the fraction.

func ValueGetFractionNumerator

func ValueGetFractionNumerator(value *coreglib.Value) int

ValueGetFractionNumerator gets the numerator of the fraction specified by value.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_FRACTION.

The function returns the following values:

  • gint: numerator of the fraction.

func ValueGetFractionRangeMax

func ValueGetFractionRangeMax(value *coreglib.Value) *coreglib.Value

ValueGetFractionRangeMax gets the maximum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_FRACTION_RANGE.

The function returns the following values:

  • ret (optional): maximum of the range.

func ValueGetFractionRangeMin

func ValueGetFractionRangeMin(value *coreglib.Value) *coreglib.Value

ValueGetFractionRangeMin gets the minimum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_FRACTION_RANGE.

The function returns the following values:

  • ret (optional): minimum of the range.

func ValueGetInt64RangeMax

func ValueGetInt64RangeMax(value *coreglib.Value) int64

ValueGetInt64RangeMax gets the maximum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT64_RANGE.

The function returns the following values:

  • gint64: maximum of the range.

func ValueGetInt64RangeMin

func ValueGetInt64RangeMin(value *coreglib.Value) int64

ValueGetInt64RangeMin gets the minimum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT64_RANGE.

The function returns the following values:

  • gint64: minimum of the range.

func ValueGetInt64RangeStep

func ValueGetInt64RangeStep(value *coreglib.Value) int64

ValueGetInt64RangeStep gets the step of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT64_RANGE.

The function returns the following values:

  • gint64: step of the range.

func ValueGetIntRangeMax

func ValueGetIntRangeMax(value *coreglib.Value) int

ValueGetIntRangeMax gets the maximum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT_RANGE.

The function returns the following values:

  • gint: maximum of the range.

func ValueGetIntRangeMin

func ValueGetIntRangeMin(value *coreglib.Value) int

ValueGetIntRangeMin gets the minimum of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT_RANGE.

The function returns the following values:

  • gint: minimum of the range.

func ValueGetIntRangeStep

func ValueGetIntRangeStep(value *coreglib.Value) int

ValueGetIntRangeStep gets the step of the range specified by value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT_RANGE.

The function returns the following values:

  • gint: step of the range.

func ValueInitAndCopy

func ValueInitAndCopy(src *coreglib.Value) coreglib.Value

ValueInitAndCopy initialises the target value to be of the same type as source and then copies the contents from source to target.

The function takes the following parameters:

  • src: source value.

The function returns the following values:

  • dest: target value.

func ValueIntersect

func ValueIntersect(value1, value2 *coreglib.Value) (coreglib.Value, bool)

ValueIntersect 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.

The function takes the following parameters:

  • value1: value to intersect.
  • value2: another value to intersect.

The function returns the following values:

  • dest (optional): a uninitialized #GValue that will hold the calculated intersection value. May be NULL if the resulting set if not needed.
  • ok: TRUE if the intersection is non-empty.

func ValueIsFixed

func ValueIsFixed(value *coreglib.Value) bool

ValueIsFixed 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.

The function takes the following parameters:

  • value to check.

The function returns the following values:

  • ok: true if the value is "fixed".

func ValueIsSubset

func ValueIsSubset(value1, value2 *coreglib.Value) bool

ValueIsSubset: check that value1 is a subset of value2.

The function takes the following parameters:

  • value1: #GValue.
  • value2: #GValue.

The function returns the following values:

  • ok: TRUE is value1 is a subset of value2.

func ValueListAppendAndTakeValue

func ValueListAppendAndTakeValue(value, appendValue *coreglib.Value)

ValueListAppendAndTakeValue appends append_value to the GstValueList in value.

The function takes the following parameters:

  • value of type T_TYPE_LIST.
  • appendValue: value to append.

func ValueListAppendValue

func ValueListAppendValue(value, appendValue *coreglib.Value)

ValueListAppendValue appends append_value to the GstValueList in value.

The function takes the following parameters:

  • value of type T_TYPE_LIST.
  • appendValue: value to append.

func ValueListConcat

func ValueListConcat(value1, value2 *coreglib.Value) coreglib.Value

ValueListConcat concatenates copies of value1 and value2 into a list. Values that are not of type T_TYPE_LIST are treated as if they were lists of length 1. dest will be initialized to the type T_TYPE_LIST.

The function takes the following parameters:

  • value1: #GValue.
  • value2: #GValue.

The function returns the following values:

  • dest: uninitialized #GValue to take the result.

func ValueListGetSize

func ValueListGetSize(value *coreglib.Value) uint

ValueListGetSize gets the number of values contained in value.

The function takes the following parameters:

  • value of type T_TYPE_LIST.

The function returns the following values:

  • guint: number of values.

func ValueListGetValue

func ValueListGetValue(value *coreglib.Value, index uint) *coreglib.Value

ValueListGetValue gets the value that is a member of the list contained in value and has the index index.

The function takes the following parameters:

  • value of type T_TYPE_LIST.
  • index of value to get from the list.

The function returns the following values:

  • ret: value at the given index.

func ValueListInit

func ValueListInit(value *coreglib.Value, prealloc uint) *coreglib.Value

ValueListInit initializes and pre-allocates a #GValue of type T_TYPE_LIST.

The function takes the following parameters:

  • value: zero-filled (uninitialized) #GValue structure.
  • prealloc: number of entries to pre-allocate in the list.

The function returns the following values:

  • ret structure that has been passed in.

func ValueListMerge

func ValueListMerge(value1, value2 *coreglib.Value) coreglib.Value

ValueListMerge merges copies of value1 and value2. Values that are not of type T_TYPE_LIST are treated as if they were lists of length 1.

The result will be put into dest and will either be a list that will not contain any duplicates, or a non-list type (if value1 and value2 were equal).

The function takes the following parameters:

  • value1: #GValue.
  • value2: #GValue.

The function returns the following values:

  • dest: uninitialized #GValue to take the result.

func ValueListPrependValue

func ValueListPrependValue(value, prependValue *coreglib.Value)

ValueListPrependValue prepends prepend_value to the GstValueList in value.

The function takes the following parameters:

  • value of type T_TYPE_LIST.
  • prependValue: value to prepend.

func ValueRegister

func ValueRegister(table *ValueTable)

ValueRegister registers functions to perform calculations on #GValue items of a given type. Each type can only be added once.

The function takes the following parameters:

  • table: structure containing functions to register.

func ValueSerialize

func ValueSerialize(value *coreglib.Value) string

ValueSerialize 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.

The function takes the following parameters:

  • value to serialize.

The function returns the following values:

  • utf8 (optional): serialization for value or NULL if none exists.

func ValueSetBitmask

func ValueSetBitmask(value *coreglib.Value, bitmask uint64)

ValueSetBitmask sets value to the bitmask specified by bitmask.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_BITMASK.
  • bitmask: bitmask.

func ValueSetCaps

func ValueSetCaps(value *coreglib.Value, caps *Caps)

ValueSetCaps sets the contents of value to caps. A reference to the provided caps will be taken by the value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_CAPS.
  • caps to set the value to.

func ValueSetCapsFeatures

func ValueSetCapsFeatures(value *coreglib.Value, features *CapsFeatures)

ValueSetCapsFeatures sets the contents of value to features.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_CAPS_FEATURES.
  • features to set the value to.

func ValueSetDoubleRange

func ValueSetDoubleRange(value *coreglib.Value, start, end float64)

ValueSetDoubleRange sets value to the range specified by start and end.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_DOUBLE_RANGE.
  • start of the range.
  • end of the range.

func ValueSetFlagset

func ValueSetFlagset(value *coreglib.Value, flags, mask uint)

ValueSetFlagset 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".

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_FLAG_SET.
  • flags: value of the flags set or unset.
  • mask indicate which flags bits must match for comparisons.

func ValueSetFraction

func ValueSetFraction(value *coreglib.Value, numerator, denominator int)

ValueSetFraction 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.

The function takes the following parameters:

  • value: GValue initialized to T_TYPE_FRACTION.
  • numerator of the fraction.
  • denominator of the fraction.

func ValueSetFractionRange

func ValueSetFractionRange(value, start, end *coreglib.Value)

ValueSetFractionRange sets value to the range specified by start and end.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_FRACTION_RANGE.
  • start of the range (a GST_TYPE_FRACTION GValue).
  • end of the range (a GST_TYPE_FRACTION GValue).

func ValueSetFractionRangeFull

func ValueSetFractionRangeFull(value *coreglib.Value, numeratorStart, denominatorStart, numeratorEnd, denominatorEnd int)

ValueSetFractionRangeFull sets value to the range specified by numerator_start/denominator_start and numerator_end/denominator_end.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_FRACTION_RANGE.
  • numeratorStart: numerator start of the range.
  • denominatorStart: denominator start of the range.
  • numeratorEnd: numerator end of the range.
  • denominatorEnd: denominator end of the range.

func ValueSetInt64Range

func ValueSetInt64Range(value *coreglib.Value, start, end int64)

ValueSetInt64Range sets value to the range specified by start and end.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT64_RANGE.
  • start of the range.
  • end of the range.

func ValueSetInt64RangeStep

func ValueSetInt64RangeStep(value *coreglib.Value, start, end, step int64)

ValueSetInt64RangeStep sets value to the range specified by start, end and step.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT64_RANGE.
  • start of the range.
  • end of the range.
  • step of the range.

func ValueSetIntRange

func ValueSetIntRange(value *coreglib.Value, start, end int)

ValueSetIntRange sets value to the range specified by start and end.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT_RANGE.
  • start of the range.
  • end of the range.

func ValueSetIntRangeStep

func ValueSetIntRangeStep(value *coreglib.Value, start, end, step int)

ValueSetIntRangeStep sets value to the range specified by start, end and step.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_INT_RANGE.
  • start of the range.
  • end of the range.
  • step of the range.

func ValueSetStructure

func ValueSetStructure(value *coreglib.Value, structure *Structure)

ValueSetStructure sets the contents of value to structure.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_STRUCTURE.
  • structure to set the value to.

func ValueSubtract

func ValueSubtract(minuend, subtrahend *coreglib.Value) (coreglib.Value, bool)

ValueSubtract subtracts subtrahend from minuend and stores the result in dest. Note that this means subtraction as in sets, not as in mathematics.

The function takes the following parameters:

  • minuend: value to subtract from.
  • subtrahend: value to subtract.

The function returns the following values:

  • dest (optional): 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.
  • ok: TRUE if the subtraction is not empty.

func ValueUnion

func ValueUnion(value1, value2 *coreglib.Value) (coreglib.Value, bool)

ValueUnion creates a GValue corresponding to the union of value1 and value2.

The function takes the following parameters:

  • value1: value to union.
  • value2: another value to union.

The function returns the following values:

  • dest: destination value.
  • ok: TRUE if the union succeeded.

func Version

func Version() (major, minor, micro, nano uint)

Version gets the version number of the GStreamer library.

The function returns the following values:

  • major: pointer to a guint to store the major version number.
  • minor: pointer to a guint to store the minor version number.
  • micro: pointer to a guint to store the micro version number.
  • nano: pointer to a guint to store the nano version number.

func VersionString

func VersionString() string

VersionString: this function returns a string that is useful for describing this version of GStreamer to the outside world: user agent strings, logging, ...

The function returns the following values:

  • utf8: newly allocated string describing this version of GStreamer.

Types

type AllocationParams

type AllocationParams struct {
	// contains filtered or unexported fields
}

AllocationParams parameters to control the allocation of memory

An instance of this type is always passed by reference.

func NewAllocationParams

func NewAllocationParams() *AllocationParams

NewAllocationParams constructs a struct AllocationParams.

func (*AllocationParams) Align

func (a *AllocationParams) Align() uint

Align: desired alignment of the memory.

func (*AllocationParams) Copy

func (params *AllocationParams) Copy() *AllocationParams

Copy: create a copy of params.

The function returns the following values:

  • allocationParams (optional): new AllocationParams.

func (*AllocationParams) Flags

func (a *AllocationParams) Flags() MemoryFlags

Flags flags to control allocation.

func (*AllocationParams) Init

func (params *AllocationParams) Init()

Init: initialize params to its default values.

func (*AllocationParams) Padding

func (a *AllocationParams) Padding() uint

Padding: desired padding.

func (*AllocationParams) Prefix

func (a *AllocationParams) Prefix() uint

Prefix: desired prefix.

func (*AllocationParams) SetAlign

func (a *AllocationParams) SetAlign(align uint)

Align: desired alignment of the memory.

func (*AllocationParams) SetPadding

func (a *AllocationParams) SetPadding(padding uint)

Padding: desired padding.

func (*AllocationParams) SetPrefix

func (a *AllocationParams) SetPrefix(prefix uint)

Prefix: desired prefix.

type Allocator

type Allocator struct {
	GstObject
	// contains filtered or unexported fields
}

Allocator: 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.

func BaseAllocator

func BaseAllocator(obj Allocatorrer) *Allocator

BaseAllocator returns the underlying base object.

func (*Allocator) Alloc

func (allocator *Allocator) Alloc(size uint, params *AllocationParams) *Memory

Alloc: 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 T_MEMORY_FLAG_ZERO_PREFIXED and T_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.

The function takes the following parameters:

  • size of the visible memory area.
  • params (optional): optional parameters.

The function returns the following values:

  • memory (optional): new Memory.

func (*Allocator) SetDefault

func (allocator *Allocator) SetDefault()

SetDefault: set the default allocator.

type AllocatorClass

type AllocatorClass struct {
	// contains filtered or unexported fields
}

AllocatorClass is used to create new memory.

An instance of this type is always passed by reference.

func (*AllocatorClass) ObjectClass

func (a *AllocatorClass) ObjectClass() *ObjectClass

ObjectClass: object parent class.

type AllocatorFlags

type AllocatorFlags C.guint

AllocatorFlags flags for allocators.

const (
	// AllocatorFlagCustomAlloc: allocator has a custom alloc function.
	AllocatorFlagCustomAlloc AllocatorFlags = 0b10000
	// AllocatorFlagLast: first flag that can be used for custom purposes.
	AllocatorFlagLast AllocatorFlags = 0b100000000000000000000
)

func (AllocatorFlags) Has

func (a AllocatorFlags) Has(other AllocatorFlags) bool

Has returns true if a contains other.

func (AllocatorFlags) String

func (a AllocatorFlags) String() string

String returns the names in string for AllocatorFlags.

type AllocatorOverrides

type AllocatorOverrides struct {
	// Alloc: 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
	// T_MEMORY_FLAG_ZERO_PREFIXED and T_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.
	//
	// The function takes the following parameters:
	//
	//    - size of the visible memory area.
	//    - params (optional): optional parameters.
	//
	// The function returns the following values:
	//
	//    - memory (optional): new Memory.
	//
	Alloc func(size uint, params *AllocationParams) *Memory
}

AllocatorOverrides contains methods that are overridable.

type Allocatorrer

type Allocatorrer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Allocatorrer describes types inherited from class Allocator.

To get the original type, the caller must assert this to an interface or another type.

func AllocatorFind

func AllocatorFind(name string) Allocatorrer

AllocatorFind: find a previously registered allocator with name. When name is NULL, the default allocator will be returned.

The function takes the following parameters:

  • name (optional) of the allocator.

The function returns the following values:

  • allocator (optional) or NULL when the allocator with name was not registered.

type AtomicQueue

type AtomicQueue struct {
	// contains filtered or unexported fields
}

AtomicQueue object implements a queue that can be used from multiple threads without performing any blocking operations.

An instance of this type is always passed by reference.

func NewAtomicQueue

func NewAtomicQueue(initialSize uint) *AtomicQueue

NewAtomicQueue constructs a struct AtomicQueue.

func (*AtomicQueue) Length

func (queue *AtomicQueue) Length() uint

Length: get the amount of items in the queue.

The function returns the following values:

  • guint: number of elements in the queue.

func (*AtomicQueue) Peek

func (queue *AtomicQueue) Peek() unsafe.Pointer

Peek the head element of the queue without removing it from the queue.

The function returns the following values:

  • gpointer (optional): head element of queue or NULL when the queue is empty.

func (*AtomicQueue) Pop

func (queue *AtomicQueue) Pop() unsafe.Pointer

Pop: get the head element of the queue.

The function returns the following values:

  • gpointer (optional): head element of queue or NULL when the queue is empty.

func (*AtomicQueue) Push

func (queue *AtomicQueue) Push(data unsafe.Pointer)

Push: append data to the tail of the queue.

The function takes the following parameters:

  • data (optional): data.

type Bin

type Bin struct {
	Element

	ChildProxy
	// contains filtered or unexported fields
}

Bin is an element that can contain other Element, allowing them to be managed as a group. Pads from the child elements can be ghosted to the bin, see GhostPad. This makes the bin look like any other elements and enables creation of higher-level abstraction elements.

A new Bin is created with gst_bin_new(). Use a Pipeline 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 Bin::element-added signal is fired whenever a new element is added to the bin. Likewise the Bin::element-removed signal is fired whenever an element is removed from the bin.

A Bin internally intercepts every Message 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 Bin 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 Bin implements the following default behaviour for answering to a Query:

* 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 Bin will by default forward any event sent to it to all sink ( GST_EVENT_TYPE_DOWNSTREAM ) or source ( GST_EVENT_TYPE_UPSTREAM ) 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.

func NewBin

func NewBin(name string) *Bin

NewBin creates a new bin with the given name.

The function takes the following parameters:

  • name (optional) of the new bin.

The function returns the following values:

  • bin: new Bin.

func ParseBinFromDescription

func ParseBinFromDescription(binDescription string, ghostUnlinkedPads bool) (*Bin, error)

ParseBinFromDescription: this is a convenience wrapper around gst_parse_launch() to create a Bin 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).

The function takes the following parameters:

  • binDescription: command line describing the bin.
  • ghostUnlinkedPads: whether to automatically create ghost pads for unlinked source or sink pads within the bin.

The function returns the following values:

  • bin: a newly-created bin, or NULL if an error occurred.

func (*Bin) Add

func (bin *Bin) Add(element Elementer) bool

Add 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.

> When you add an element to an already-running pipeline, you will have to > take care to set the state of the newly-added element to the desired > state (usually PLAYING or PAUSED, same you set the pipeline to originally) > with gst_element_set_state(), or use gst_element_sync_state_with_parent(). > The bin or pipeline will not take care of this for you.

The function takes the following parameters:

  • element to add.

The function returns the following values:

  • ok: TRUE if the element could be added, FALSE if the bin does not want to accept the element.

func (*Bin) AddMany

func (bin *Bin) AddMany(elements ...Elementer) bool

func (*Bin) ByInterface

func (bin *Bin) ByInterface(iface coreglib.Type) Elementer

ByInterface 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.

The function takes the following parameters:

  • iface of an interface.

The function returns the following values:

  • element (optional) inside the bin implementing the interface.

func (*Bin) ByName

func (bin *Bin) ByName(name string) Elementer

ByName gets the element with the given name from a bin. This function recurses into child bins.

The function takes the following parameters:

  • name: element name to search for.

The function returns the following values:

  • element (optional) with the given name.

func (*Bin) ByNameRecurseUp

func (bin *Bin) ByNameRecurseUp(name string) Elementer

ByNameRecurseUp gets the element with the given name from this bin. If the element is not found, a recursion is performed on the parent bin.

The function takes the following parameters:

  • name: element name to search for.

The function returns the following values:

  • element (optional) with the given name.

func (*Bin) ConnectDeepElementAdded

func (bin *Bin) ConnectDeepElementAdded(f func(subBin *Bin, element Elementer)) coreglib.SignalHandle

ConnectDeepElementAdded will be emitted after the element was added to sub_bin.

func (*Bin) ConnectDeepElementRemoved

func (bin *Bin) ConnectDeepElementRemoved(f func(subBin *Bin, element Elementer)) coreglib.SignalHandle

ConnectDeepElementRemoved will be emitted after the element was removed from sub_bin.

func (*Bin) ConnectDoLatency

func (bin *Bin) ConnectDoLatency(f func() (ok bool)) coreglib.SignalHandle

ConnectDoLatency will be emitted when the bin needs to perform latency calculations. This signal is only emitted for toplevel bins or when Bin:async-handling is enabled.

Only one signal handler is invoked. If no signals are connected, the default handler is invoked, which will query and distribute the lowest possible latency to all sinks.

Connect to this signal if the default latency calculations are not sufficient, like when you need different latencies for different sinks in the same pipeline.

func (*Bin) ConnectElementAdded

func (bin *Bin) ConnectElementAdded(f func(element Elementer)) coreglib.SignalHandle

ConnectElementAdded will be emitted after the element was added to the bin.

func (*Bin) ConnectElementRemoved

func (bin *Bin) ConnectElementRemoved(f func(element Elementer)) coreglib.SignalHandle

ConnectElementRemoved will be emitted after the element was removed from the bin.

func (*Bin) FindUnlinkedPad

func (bin *Bin) FindUnlinkedPad(direction PadDirection) *Pad

FindUnlinkedPad: 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.

The function takes the following parameters:

  • direction: whether to look for an unlinked source or sink pad.

The function returns the following values:

  • pad (optional): unlinked pad of the given direction.

func (*Bin) IterateAllByElementFactoryName

func (bin *Bin) IterateAllByElementFactoryName(factoryName string) *Iterator

IterateAllByElementFactoryName 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 Element.

The function takes the following parameters:

  • factoryName: name of the ElementFactory.

The function returns the following values:

  • iterator (optional) of Element for all elements in the bin with the given element factory name.

func (*Bin) IterateAllByInterface

func (bin *Bin) IterateAllByInterface(iface coreglib.Type) *Iterator

IterateAllByInterface 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 Element.

The function takes the following parameters:

  • iface of an interface.

The function returns the following values:

  • iterator (optional) of Element for all elements in the bin implementing the given interface.

func (*Bin) IterateElements

func (bin *Bin) IterateElements() *Iterator

IterateElements gets an iterator for the elements in this bin.

The function returns the following values:

  • iterator (optional) of Element.

func (*Bin) IterateRecurse

func (bin *Bin) IterateRecurse() *Iterator

IterateRecurse gets an iterator for the elements in this bin. This iterator recurses into GstBin children.

The function returns the following values:

  • iterator (optional) of Element.

func (*Bin) IterateSinks

func (bin *Bin) IterateSinks() *Iterator

IterateSinks gets an iterator for all elements in the bin that have the T_ELEMENT_FLAG_SINK flag set.

The function returns the following values:

  • iterator (optional) of Element.

func (*Bin) IterateSorted

func (bin *Bin) IterateSorted() *Iterator

IterateSorted 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.

The function returns the following values:

  • iterator (optional) of Element.

func (*Bin) IterateSources

func (bin *Bin) IterateSources() *Iterator

IterateSources gets an iterator for all elements in the bin that have the T_ELEMENT_FLAG_SOURCE flag set.

The function returns the following values:

  • iterator (optional) of Element.

func (*Bin) RecalculateLatency

func (bin *Bin) RecalculateLatency() bool

RecalculateLatency 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 T_MESSAGE_LATENCY is posted on the bus.

This function simply emits the Bin::do-latency signal so any custom latency calculations will be performed.

The function returns the following values:

  • ok: TRUE if the latency could be queried and reconfigured.

func (*Bin) Remove

func (bin *Bin) Remove(element Elementer) bool

Remove 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.

The function takes the following parameters:

  • element to remove.

The function returns the following values:

  • ok: TRUE if the element could be removed, FALSE if the bin does not want to remove the element.

func (*Bin) SetSuppressedFlags

func (bin *Bin) SetSuppressedFlags(flags ElementFlags)

SetSuppressedFlags suppresses the given flags on the bin. ElementFlags 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.

The function takes the following parameters:

  • flags to suppress.

func (*Bin) SuppressedFlags

func (bin *Bin) SuppressedFlags() ElementFlags

The function returns the following values:

  • elementFlags bin's suppressed ElementFlags.

func (*Bin) SyncChildrenStates

func (bin *Bin) SyncChildrenStates() bool

SyncChildrenStates synchronizes the state of every child of bin with the state of bin. See also gst_element_sync_state_with_parent().

The function returns the following values:

  • ok: TRUE if syncing the state was successful for all children, otherwise FALSE.

type BinClass

type BinClass struct {
	// contains filtered or unexported fields
}

BinClass subclasses can override BinClass::add_element and BinClass::remove_element to update the list of children in the bin.

The BinClass::handle_message method can be overridden to implement custom message handling.

BinClass::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. Bin implementations that override this message should chain up to the parent class implementation so the Bin::deep-element-added signal is emitted on all parents.

An instance of this type is always passed by reference.

func (*BinClass) ParentClass

func (b *BinClass) ParentClass() *ElementClass

ParentClass: bin parent class.

type BinFlags

type BinFlags C.guint

BinFlags 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().

const (
	// BinFlagNoResync: don't resync a state change when elements are added or
	// linked in the bin.
	BinFlagNoResync BinFlags = 0b100000000000000
	// BinFlagStreamsAware 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 = 0b1000000000000000
	// BinFlagLast: last enum in the series of flags for bins. Derived classes
	// can use this as first value in a list of flags.
	BinFlagLast BinFlags = 0b10000000000000000000
)

func (BinFlags) Has

func (b BinFlags) Has(other BinFlags) bool

Has returns true if b contains other.

func (BinFlags) String

func (b BinFlags) String() string

String returns the names in string for BinFlags.

type BinOverrides

type BinOverrides struct {
	// AddElement: method to add an element to the bin.
	//
	// The function takes the following parameters:
	//
	//    - element to be added.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the element was added.
	//
	AddElement func(element Elementer) bool
	// DeepElementAdded: method called when an element was added somewhere in
	// the bin hierarchy.
	//
	// The function takes the following parameters:
	//
	//    - subBin to which the element was added.
	//    - child: element that was added.
	//
	DeepElementAdded func(subBin *Bin, child Elementer)
	// DeepElementRemoved: method called when an element was removed somewhere
	// in the bin hierarchy.
	//
	// The function takes the following parameters:
	//
	//    - subBin from which the element was removed.
	//    - child: element that was removed.
	//
	DeepElementRemoved func(subBin *Bin, child Elementer)
	// The function returns the following values:
	//
	DoLatency func() bool
	// ElementAdded: method called when an element was added to the bin.
	//
	// The function takes the following parameters:
	//
	//    - child: element that was added.
	//
	ElementAdded func(child Elementer)
	// ElementRemoved: method called when an element was removed from the bin.
	//
	// The function takes the following parameters:
	//
	//    - child: element that was removed.
	//
	ElementRemoved func(child Elementer)
	// HandleMessage: method to handle a message from the children.
	//
	// The function takes the following parameters:
	//
	//    - message to be handled.
	//
	HandleMessage func(message *Message)
	// RemoveElement: method to remove an element from the bin.
	//
	// The function takes the following parameters:
	//
	//    - element to be removed.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the element was removed.
	//
	RemoveElement func(element Elementer) bool
}

BinOverrides contains methods that are overridable.

type Bitmask

type Bitmask struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Bitmask: fundamental type that describes a 64-bit bitmask.

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer 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 Memory 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 Memory 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 T_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 ClockTime 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 T_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 BufferFlags 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 Meta.

An element should either unref the buffer or push it out on a src pad using gst_pad_push() (see Pad).

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 BufferPool will be returned to the pool when the refcount drops to 0.

The ParentBufferMeta is a meta which can be attached to a Buffer to hold a reference to another buffer that is only released when the child Buffer is released.

Typically, ParentBufferMeta is used when the child buffer is directly using the Memory of the parent buffer, and wants to prevent the parent buffer from being returned to a buffer pool until the Memory is available for re-use. (Since: 1.6)

An instance of this type is always passed by reference.

func NewBuffer

func NewBuffer() *Buffer

NewBuffer constructs a struct Buffer.

func NewBufferAllocate

func NewBufferAllocate(allocator Allocatorrer, size uint, params *AllocationParams) *Buffer

NewBufferAllocate constructs a struct Buffer.

func NewBufferMemdup

func NewBufferMemdup(data []byte) *Buffer

NewBufferMemdup constructs a struct Buffer.

func NewBufferWrapped

func NewBufferWrapped(data []byte) *Buffer

NewBufferWrapped constructs a struct Buffer.

func NewBufferWrappedBytes

func NewBufferWrappedBytes(bytes *glib.Bytes) *Buffer

NewBufferWrappedBytes constructs a struct Buffer.

func (*Buffer) AddCustomMeta

func (buffer *Buffer) AddCustomMeta(name string) *CustomMeta

AddCustomMeta creates and adds a CustomMeta for the desired name. name must have been successfully registered with gst_meta_register_custom().

The function takes the following parameters:

  • name: registered name of the desired custom meta.

The function returns the following values:

  • customMeta (optional) that was added to the buffer.

func (*Buffer) AddMeta

func (buffer *Buffer) AddMeta(info *MetaInfo, params unsafe.Pointer) *Meta

AddMeta adds metadata for info to buffer using the parameters in params.

The function takes the following parameters:

  • info: MetaInfo.
  • params (optional) for info.

The function returns the following values:

  • meta (optional): metadata for the api in info on buffer.

func (*Buffer) AddParentBufferMeta

func (buffer *Buffer) AddParentBufferMeta(ref *Buffer) *ParentBufferMeta

AddParentBufferMeta adds a ParentBufferMeta to buffer that holds a reference on ref until the buffer is freed.

The function takes the following parameters:

  • ref to ref.

The function returns the following values:

  • parentBufferMeta (optional) that was added to the buffer.

func (*Buffer) AddProtectionMeta

func (buffer *Buffer) AddProtectionMeta(info *Structure) *ProtectionMeta

AddProtectionMeta attaches protection metadata to a Buffer.

The function takes the following parameters:

  • info holding cryptographic information relating to the sample contained in buffer. This function takes ownership of info.

The function returns the following values:

  • protectionMeta: pointer to the added ProtectionMeta if successful.

func (*Buffer) AddReferenceTimestampMeta

func (buffer *Buffer) AddReferenceTimestampMeta(reference *Caps, timestamp ClockTime, duration ClockTime) *ReferenceTimestampMeta

AddReferenceTimestampMeta adds a ReferenceTimestampMeta to buffer that holds a timestamp and optionally duration based on a specific timestamp reference. See the documentation of ReferenceTimestampMeta for details.

The function takes the following parameters:

  • reference: identifier for the timestamp reference.
  • timestamp: timestamp.
  • duration: duration, or GST_CLOCK_TIME_NONE.

The function returns the following values:

  • referenceTimestampMeta (optional) that was added to the buffer.

func (*Buffer) AllMemory

func (buffer *Buffer) AllMemory() *Memory

AllMemory gets all the memory blocks in buffer. The memory blocks will be merged into one large Memory.

The function returns the following values:

  • memory (optional) that contains the merged memory.

func (*Buffer) Append

func (buf1 *Buffer) Append(buf2 *Buffer) *Buffer

Append appends all the memory from buf2 to buf1. The result buffer will contain a concatenation of the memory of buf1 and buf2.

The function takes the following parameters:

  • buf2: second source Buffer to append.

The function returns the following values:

  • buffer: new Buffer that contains the memory of the two source buffers.

func (*Buffer) AppendMemory

func (buffer *Buffer) AppendMemory(mem *Memory)

AppendMemory 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.

The function takes the following parameters:

  • mem: Memory.

func (*Buffer) AppendRegion

func (buf1 *Buffer) AppendRegion(buf2 *Buffer, offset int, size int) *Buffer

AppendRegion 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.

The function takes the following parameters:

  • buf2: second source Buffer to append.
  • offset in buf2.
  • size or -1 of buf2.

The function returns the following values:

  • buffer: new Buffer that contains the memory of the two source buffers.

func (*Buffer) CopyDeep

func (buf *Buffer) CopyDeep() *Buffer

CopyDeep creates a copy of the given buffer. This will make a newly allocated copy of the data the source buffer contains.

The function returns the following values:

  • buffer: new copy of buf.

func (*Buffer) CopyInto

func (dest *Buffer) CopyInto(src *Buffer, flags BufferCopyFlags, offset uint, size uint) bool

CopyInto 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.

The function takes the following parameters:

  • src: source Buffer.
  • flags indicating what metadata fields should be copied.
  • offset to copy from.
  • size: total size to copy. If -1, all data is copied.

The function returns the following values:

  • ok: TRUE if the copying succeeded, FALSE otherwise.

func (*Buffer) CopyRegion

func (parent *Buffer) CopyRegion(flags BufferCopyFlags, offset uint, size uint) *Buffer

CopyRegion 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 T_CLOCK_TIME_NONE and T_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 T_CLOCK_TIME_NONE and T_BUFFER_OFFSET_NONE.

The function takes the following parameters:

  • flags: BufferCopyFlags.
  • offset into parent Buffer at which the new sub-buffer begins.
  • size of the new Buffer sub-buffer, in bytes. If -1, all data is copied.

The function returns the following values:

  • buffer: new Buffer or NULL if the arguments were invalid.

func (*Buffer) CustomMeta

func (buffer *Buffer) CustomMeta(name string) *CustomMeta

CustomMeta finds the first CustomMeta on buffer for the desired name.

The function takes the following parameters:

  • name: registered name of the custom meta to retrieve.

The function returns the following values:

  • customMeta (optional): CustomMeta.

func (*Buffer) Dts

func (b *Buffer) Dts() ClockTime

Dts: decoding timestamp of the buffer, can be T_CLOCK_TIME_NONE when the dts is not known or relevant. The dts contains the timestamp when the media should be processed.

func (*Buffer) Duration

func (b *Buffer) Duration() ClockTime

Duration: duration in time of the buffer data, can be T_CLOCK_TIME_NONE when the duration is not known or relevant.

func (*Buffer) ExtractDup

func (buffer *Buffer) ExtractDup(offset uint, size uint) []byte

ExtractDup extracts a copy of at most size bytes the data at offset into newly-allocated memory. dest must be freed using g_free() when done.

The function takes the following parameters:

  • offset to extract.
  • size to extract.

The function returns the following values:

  • dest: pointer where the destination array will be written. Might be NULL if the size is 0.

func (*Buffer) Fill

func (buffer *Buffer) Fill(offset uint, src []byte) uint

Fill copies size bytes from src to buffer at offset.

The function takes the following parameters:

  • offset to fill.
  • src: source address.

The function returns the following values:

  • gsize: amount of bytes copied. This value can be lower than size when buffer did not contain enough data.

func (*Buffer) FindMemory

func (buffer *Buffer) FindMemory(offset uint, size uint) (idx uint, length uint, skip uint, ok bool)

FindMemory 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.

The function takes the following parameters:

  • offset: offset.
  • size: size.

The function returns the following values:

  • idx: pointer to index.
  • length: pointer to length.
  • skip: pointer to skip.
  • ok: TRUE when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.

func (*Buffer) Flags

func (buffer *Buffer) Flags() BufferFlags

Flags gets the BufferFlags flags set on this buffer.

The function returns the following values:

  • bufferFlags flags set on this buffer.

func (*Buffer) ForEachMeta

func (buffer *Buffer) ForEachMeta(fn BufferForEachMetaFunc) bool

ForEachMeta 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.

The function takes the following parameters:

  • fn to call.

The function returns the following values:

  • ok: FALSE when func returned FALSE for one of the metadata.

func (*Buffer) HasFlags

func (buffer *Buffer) HasFlags(flags BufferFlags) bool

HasFlags gives the status of a specific flag on a buffer.

The function takes the following parameters:

  • flags flag to check.

The function returns the following values:

  • ok: TRUE if all flags in flags are found on buffer.

func (*Buffer) InsertMemory

func (buffer *Buffer) InsertMemory(idx int, mem *Memory)

InsertMemory 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.

The function takes the following parameters:

  • idx: index to add the memory at, or -1 to append it to the end.
  • mem: Memory.

func (*Buffer) IsAllMemoryWritable

func (buffer *Buffer) IsAllMemoryWritable() bool

IsAllMemoryWritable 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.

The function returns the following values:

  • ok: TRUE if all memory blocks in buffer are writable.

func (*Buffer) IsMemoryRangeWritable

func (buffer *Buffer) IsMemoryRangeWritable(idx uint, length int) bool

IsMemoryRangeWritable 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.

The function takes the following parameters:

  • idx: index.
  • length: length, should not be 0.

The function returns the following values:

  • ok: TRUE if the memory range is writable.

func (*Buffer) Map

func (buffer *Buffer) Map(flags MapFlags) (*MapInfo, bool)

Map fills info with the MapInfo of all merged memory blocks in buffer.

flags describe the desired access of the memory. When flags is T_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.

The function takes the following parameters:

  • flags for the mapping.

The function returns the following values:

  • info about the mapping.
  • ok: TRUE if the map succeeded and info contains valid data.

func (*Buffer) MapRange

func (buffer *Buffer) MapRange(idx uint, length int, flags MapFlags) (*MapInfo, bool)

MapRange fills info with the MapInfo 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 T_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.

The function takes the following parameters:

  • idx: index.
  • length: length.
  • flags for the mapping.

The function returns the following values:

  • info about the mapping.
  • ok: TRUE if the map succeeded and info contains valid data.

func (*Buffer) Memcmp

func (buffer *Buffer) Memcmp(offset uint, mem []byte) int

Memcmp compares size bytes starting from offset in buffer with the memory in mem.

The function takes the following parameters:

  • offset in buffer.
  • mem: memory to compare.

The function returns the following values:

  • gint: 0 if the memory is equal.

func (*Buffer) Memory

func (buffer *Buffer) Memory(idx uint) *Memory

Memory gets the memory block at index idx in buffer.

The function takes the following parameters:

  • idx: index.

The function returns the following values:

  • memory (optional) that contains the data of the memory block at idx.

func (*Buffer) MemoryRange

func (buffer *Buffer) MemoryRange(idx uint, length int) *Memory

MemoryRange gets length memory blocks in buffer starting at idx. The memory blocks will be merged into one large Memory.

If length is -1, all memory starting from idx is merged.

The function takes the following parameters:

  • idx: index.
  • length: length.

The function returns the following values:

  • memory (optional) that contains the merged data of length blocks starting at idx.

func (*Buffer) Memset

func (buffer *Buffer) Memset(offset uint, val byte, size uint) uint

Memset fills buf with size bytes with val starting from offset.

The function takes the following parameters:

  • offset in buffer.
  • val: value to set.
  • size to set.

The function returns the following values:

  • gsize: amount of bytes filled. This value can be lower than size when buffer did not contain enough data.

func (*Buffer) Meta

func (buffer *Buffer) Meta(api coreglib.Type) *Meta

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->info.api member for the API type.

The function takes the following parameters:

  • api of an API.

The function returns the following values:

  • meta (optional): metadata for api on buffer.

func (*Buffer) MiniObject

func (b *Buffer) MiniObject() *MiniObject

MiniObject: parent structure.

func (*Buffer) NMemory

func (buffer *Buffer) NMemory() uint

NMemory gets the amount of memory blocks that this buffer has. This amount is never larger than what gst_buffer_get_max_memory() returns.

The function returns the following values:

  • guint: number of memory blocks this buffer is made of.

func (*Buffer) NMeta

func (buffer *Buffer) NMeta(apiType coreglib.Type) uint

The function takes the following parameters:

  • apiType of an API.

The function returns the following values:

  • guint: number of metas of type api_type on buffer.

func (*Buffer) Offset

func (b *Buffer) Offset() uint64

Offset: media specific offset for the buffer data. For video frames, this is the frame number of this buffer. For audio samples, this is the offset of the first sample in this buffer. For file data or compressed data this is the byte offset of the first byte in this buffer.

func (*Buffer) OffsetEnd

func (b *Buffer) OffsetEnd() uint64

OffsetEnd: last offset contained in this buffer. It has the same format as offset.

func (*Buffer) PeekMemory

func (buffer *Buffer) PeekMemory(idx uint) *Memory

PeekMemory 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.

The function takes the following parameters:

  • idx: index.

The function returns the following values:

  • memory (optional) at idx.

func (*Buffer) Pool

func (b *Buffer) Pool() *BufferPool

Pool: pointer to the pool owner of the buffer.

func (*Buffer) PrependMemory

func (buffer *Buffer) PrependMemory(mem *Memory)

PrependMemory 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.

The function takes the following parameters:

  • mem: Memory.

func (*Buffer) Pts

func (b *Buffer) Pts() ClockTime

Pts: presentation timestamp of the buffer, can be T_CLOCK_TIME_NONE when the pts is not known or relevant. The pts contains the timestamp when the media should be presented to the user.

func (*Buffer) ReferenceTimestampMeta

func (buffer *Buffer) ReferenceTimestampMeta(reference *Caps) *ReferenceTimestampMeta

ReferenceTimestampMeta finds the first ReferenceTimestampMeta 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 ReferenceTimestampMeta metadata items.

The function takes the following parameters:

  • reference (optional) Caps.

The function returns the following values:

  • referenceTimestampMeta (optional) or NULL when there is no such metadata on buffer.

func (*Buffer) RemoveAllMemory

func (buffer *Buffer) RemoveAllMemory()

RemoveAllMemory removes all the memory blocks in buffer.

func (*Buffer) RemoveMemory

func (buffer *Buffer) RemoveMemory(idx uint)

RemoveMemory removes the memory block in b at index i.

The function takes the following parameters:

  • idx: index.

func (*Buffer) RemoveMemoryRange

func (buffer *Buffer) RemoveMemoryRange(idx uint, length int)

RemoveMemoryRange removes length memory blocks in buffer starting from idx.

length can be -1, in which case all memory starting from idx is removed.

The function takes the following parameters:

  • idx: index.
  • length: length.

func (*Buffer) RemoveMeta

func (buffer *Buffer) RemoveMeta(meta *Meta) bool

RemoveMeta removes the metadata for meta on buffer.

The function takes the following parameters:

  • meta: Meta.

The function returns the following values:

  • ok: TRUE if the metadata existed and was removed, FALSE if no such metadata was on buffer.

func (*Buffer) ReplaceAllMemory

func (buffer *Buffer) ReplaceAllMemory(mem *Memory)

ReplaceAllMemory replaces all memory in buffer with mem.

The function takes the following parameters:

  • mem: Memory.

func (*Buffer) ReplaceMemory

func (buffer *Buffer) ReplaceMemory(idx uint, mem *Memory)

ReplaceMemory replaces the memory block at index idx in buffer with mem.

The function takes the following parameters:

  • idx: index.
  • mem: Memory.

func (*Buffer) ReplaceMemoryRange

func (buffer *Buffer) ReplaceMemoryRange(idx uint, length int, mem *Memory)

ReplaceMemoryRange 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.

The function takes the following parameters:

  • idx: index.
  • length: length, should not be 0.
  • mem: Memory.

func (*Buffer) Resize

func (buffer *Buffer) Resize(offset int, size int)

Resize sets the offset and total size of the memory blocks in buffer.

The function takes the following parameters:

  • offset adjustment.
  • size: new size or -1 to just adjust the offset.

func (*Buffer) ResizeRange

func (buffer *Buffer) ResizeRange(idx uint, length int, offset int, size int) bool

ResizeRange sets the total size of the length memory blocks starting at idx in buffer.

The function takes the following parameters:

  • idx: index.
  • length: length.
  • offset adjustment.
  • size: new size or -1 to just adjust the offset.

The function returns the following values:

  • ok: TRUE if resizing succeeded, FALSE otherwise.

func (*Buffer) SetFlags

func (buffer *Buffer) SetFlags(flags BufferFlags) bool

SetFlags sets one or more buffer flags on a buffer.

The function takes the following parameters:

  • flags to set.

The function returns the following values:

  • ok: TRUE if flags were successfully set on buffer.

func (*Buffer) SetOffset

func (b *Buffer) SetOffset(offset uint64)

Offset: media specific offset for the buffer data. For video frames, this is the frame number of this buffer. For audio samples, this is the offset of the first sample in this buffer. For file data or compressed data this is the byte offset of the first byte in this buffer.

func (*Buffer) SetOffsetEnd

func (b *Buffer) SetOffsetEnd(offsetEnd uint64)

OffsetEnd: last offset contained in this buffer. It has the same format as offset.

func (*Buffer) SetPts

func (b *Buffer) SetPts(dur ClockTime)

func (*Buffer) SetSize

func (buffer *Buffer) SetSize(size int)

SetSize sets the total size of the memory blocks in buffer.

The function takes the following parameters:

  • size: new size.

func (*Buffer) Size

func (buffer *Buffer) Size() uint

Size gets the total size of the memory blocks in buffer.

The function returns the following values:

  • gsize: total size of the memory blocks in buffer.

func (*Buffer) Sizes

func (buffer *Buffer) Sizes() (offset uint, maxsize uint, gsize uint)

Sizes 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().

The function returns the following values:

  • offset (optional): pointer to the offset.
  • maxsize (optional): pointer to the maxsize.
  • gsize: total size of the memory blocks in buffer.

func (*Buffer) SizesRange

func (buffer *Buffer) SizesRange(idx uint, length int) (offset uint, maxsize uint, gsize uint)

SizesRange 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().

The function takes the following parameters:

  • idx: index.
  • length: length.

The function returns the following values:

  • offset (optional): pointer to the offset.
  • maxsize (optional): pointer to the maxsize.
  • gsize: total size of length memory blocks starting at idx in buffer.

func (*Buffer) Unmap

func (buffer *Buffer) Unmap(info *MapInfo)

Unmap releases the memory previously mapped with gst_buffer_map().

The function takes the following parameters:

  • info: MapInfo.

func (*Buffer) UnsetFlags

func (buffer *Buffer) UnsetFlags(flags BufferFlags) bool

UnsetFlags clears one or more buffer flags.

The function takes the following parameters:

  • flags to clear.

The function returns the following values:

  • ok: true if flags is successfully cleared from buffer.

type BufferCopyFlags

type BufferCopyFlags C.guint

BufferCopyFlags: set of flags that can be provided to the gst_buffer_copy_into() function to specify which items should be copied.

const (
	// BufferCopyCopyNone: copy nothing.
	BufferCopyCopyNone BufferCopyFlags = 0b0
	// BufferCopyCopyFlags: flag indicating that buffer flags should be copied.
	BufferCopyCopyFlags BufferCopyFlags = 0b1
	// BufferCopyCopyTimestamps: flag indicating that buffer pts, dts, duration,
	// offset and offset_end should be copied.
	BufferCopyCopyTimestamps BufferCopyFlags = 0b10
	// BufferCopyCopyMeta: flag indicating that buffer meta should be copied.
	BufferCopyCopyMeta BufferCopyFlags = 0b100
	// BufferCopyCopyMemory: 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.
	BufferCopyCopyMemory BufferCopyFlags = 0b1000
	// BufferCopyCopyMerge: flag indicating that buffer memory should be merged.
	BufferCopyCopyMerge BufferCopyFlags = 0b10000
	// BufferCopyCopyDeep: flag indicating that memory should always be copied
	// instead of reffed.
	BufferCopyCopyDeep BufferCopyFlags = 0b100000
)

func (BufferCopyFlags) Has

func (b BufferCopyFlags) Has(other BufferCopyFlags) bool

Has returns true if b contains other.

func (BufferCopyFlags) String

func (b BufferCopyFlags) String() string

String returns the names in string for BufferCopyFlags.

type BufferFlags

type BufferFlags C.guint

BufferFlags: set of buffer flags used to describe properties of a Buffer.

const (
	// BufferFlagLive: buffer is live data and should be discarded in the PAUSED
	// state.
	BufferFlagLive BufferFlags = 0b10000
	// BufferFlagDecodeOnly: 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 = 0b100000
	// BufferFlagDiscont: 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 = 0b1000000
	// BufferFlagResync: buffer timestamps might have a discontinuity and this
	// buffer is a good point to resynchronize.
	BufferFlagResync BufferFlags = 0b10000000
	// BufferFlagCorrupted: buffer data is corrupted.
	BufferFlagCorrupted BufferFlags = 0b100000000
	// BufferFlagMarker: 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.
	BufferFlagMarker BufferFlags = 0b1000000000
	// BufferFlagHeader: buffer contains header information that is needed to
	// decode the following data.
	BufferFlagHeader BufferFlags = 0b10000000000
	// BufferFlagGap: 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 = 0b100000000000
	// BufferFlagDroppable: buffer can be dropped without breaking the stream,
	// for example to reduce bandwidth.
	BufferFlagDroppable BufferFlags = 0b1000000000000
	// BufferFlagDeltaUnit: unit cannot be decoded independently.
	BufferFlagDeltaUnit BufferFlags = 0b10000000000000
	// BufferFlagTagMemory: flag is set when memory of the buffer is
	// added/removed.
	BufferFlagTagMemory BufferFlags = 0b100000000000000
	// BufferFlagSyncAfter elements which write to disk or permanent storage
	// should ensure the data is synced after writing the contents of this
	// buffer.
	BufferFlagSyncAfter BufferFlags = 0b1000000000000000
	// BufferFlagNonDroppable: 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 = 0b10000000000000000
	// BufferFlagLast: additional media specific flags can be added starting
	// from this flag.
	BufferFlagLast BufferFlags = 0b100000000000000000000
)

func (BufferFlags) Has

func (b BufferFlags) Has(other BufferFlags) bool

Has returns true if b contains other.

func (BufferFlags) String

func (b BufferFlags) String() string

String returns the names in string for BufferFlags.

type BufferForEachMetaFunc

type BufferForEachMetaFunc func(buffer *Buffer) (meta *Meta, ok bool)

BufferForEachMetaFunc: 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 BufferList

type BufferList struct {
	// contains filtered or unexported fields
}

BufferList: 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.

An instance of this type is always passed by reference.

func NewBufferList

func NewBufferList() *BufferList

NewBufferList constructs a struct BufferList.

func NewBufferListSized

func NewBufferListSized(size uint) *BufferList

NewBufferListSized constructs a struct BufferList.

func (*BufferList) CalculateSize

func (list *BufferList) CalculateSize() uint

CalculateSize calculates the size of the data contained in list by adding the size of all buffers.

The function returns the following values:

  • gsize: size of the data contained in list in bytes.

func (*BufferList) CopyDeep

func (list *BufferList) CopyDeep() *BufferList

CopyDeep creates a copy of the given buffer list. This will make a newly allocated copy of the buffers that the source buffer list contains.

The function returns the following values:

  • bufferList: new copy of list.

func (*BufferList) ForEach

func (list *BufferList) ForEach(fn BufferListFunc) bool

ForEach 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.

The function takes the following parameters:

  • fn to call.

The function returns the following values:

  • ok: TRUE when func returned TRUE for each buffer in list or when list is empty.

func (*BufferList) Get

func (list *BufferList) Get(idx uint) *Buffer

Get gets the buffer at idx.

You must make sure that idx does not exceed the number of buffers available.

The function takes the following parameters:

  • idx: index.

The function returns the following values:

  • buffer (optional) at idx in group or NULL when there is no buffer. The buffer remains valid as long as list is valid and buffer is not removed from the list.

func (*BufferList) Insert

func (list *BufferList) Insert(idx int, buffer *Buffer)

Insert 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.

The function takes the following parameters:

  • idx: index.
  • buffer: Buffer.

func (*BufferList) Length

func (list *BufferList) Length() uint

Length returns the number of buffers in list.

The function returns the following values:

  • guint: number of buffers in the buffer list.

func (*BufferList) Remove

func (list *BufferList) Remove(idx uint, length uint)

Remove removes length buffers starting from idx in list. The following buffers are moved to close the gap.

The function takes the following parameters:

  • idx: index.
  • length: amount to remove.

func (*BufferList) Writable

func (list *BufferList) Writable(idx uint) *Buffer

Writable 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.

The function takes the following parameters:

  • idx: index.

The function returns the following values:

  • buffer (optional) at idx in group. The returned buffer remains valid as long as list is valid and the buffer is not removed from the list.

type BufferListFunc

type BufferListFunc func(idx uint) (buffer *Buffer, ok bool)

BufferListFunc: 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 BufferPool

type BufferPool struct {
	GstObject
	// contains filtered or unexported fields
}

BufferPool is an object that can be used to pre-allocate and recycle buffers of the same size and with the same properties.

A BufferPool 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.

func NewBufferPool

func NewBufferPool() *BufferPool

NewBufferPool creates a new BufferPool instance.

The function returns the following values:

  • bufferPool: new BufferPool instance.

func (*BufferPool) AcquireBuffer

func (pool *BufferPool) AcquireBuffer(params *BufferPoolAcquireParams) (*Buffer, FlowReturn)

AcquireBuffer acquires a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer.

params can contain optional parameters to influence the allocation.

The function takes the following parameters:

  • params (optional): parameters.

The function returns the following values:

  • buffer: location for a Buffer.
  • flowReturn such as GST_FLOW_FLUSHING when the pool is inactive.

func (*BufferPool) Config

func (pool *BufferPool) Config() *Structure

Config 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.

The function returns the following values:

  • structure: copy of the current configuration of pool.

func (*BufferPool) HasOption

func (pool *BufferPool) HasOption(option string) bool

HasOption checks if the bufferpool supports option.

The function takes the following parameters:

  • option: option.

The function returns the following values:

  • ok: TRUE if the buffer pool contains option.

func (*BufferPool) IsActive

func (pool *BufferPool) IsActive() bool

IsActive checks if pool is active. A pool can be activated with the gst_buffer_pool_set_active() call.

The function returns the following values:

  • ok: TRUE when the pool is active.

func (*BufferPool) Options

func (pool *BufferPool) Options() []string

Options 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().

The function returns the following values:

  • utf8s: NULL terminated array of strings.

func (*BufferPool) ReleaseBuffer

func (pool *BufferPool) ReleaseBuffer(buffer *Buffer)

ReleaseBuffer 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.

The function takes the following parameters:

  • buffer: Buffer.

func (*BufferPool) SetActive

func (pool *BufferPool) SetActive(active bool) bool

SetActive 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.

The function takes the following parameters:

  • active: new active state.

The function returns the following values:

  • ok: FALSE when the pool was not configured or when preallocation of the buffers failed.

func (*BufferPool) SetConfig

func (pool *BufferPool) SetConfig(config *Structure) bool

SetConfig 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 Structure 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.

The function takes the following parameters:

  • config: Structure.

The function returns the following values:

  • ok: TRUE when the configuration could be set.

func (*BufferPool) SetFlushing

func (pool *BufferPool) SetFlushing(flushing bool)

SetFlushing enables or disables the flushing state of a pool without freeing or allocating buffers.

The function takes the following parameters:

  • flushing: whether to start or stop flushing.

type BufferPoolAcquireFlags

type BufferPoolAcquireFlags C.guint

BufferPoolAcquireFlags: additional flags to control the allocation of a buffer.

const (
	// BufferPoolAcquireFlagNone: no flags.
	BufferPoolAcquireFlagNone BufferPoolAcquireFlags = 0b0
	// BufferPoolAcquireFlagKeyUnit: buffer is keyframe.
	BufferPoolAcquireFlagKeyUnit BufferPoolAcquireFlags = 0b1
	// BufferPoolAcquireFlagDontwait: 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 T_FLOW_EOS
	// instead of blocking.
	BufferPoolAcquireFlagDontwait BufferPoolAcquireFlags = 0b10
	// BufferPoolAcquireFlagDiscont: buffer is discont.
	BufferPoolAcquireFlagDiscont BufferPoolAcquireFlags = 0b100
	// BufferPoolAcquireFlagLast: last flag, subclasses can use private flags
	// starting from this value.
	BufferPoolAcquireFlagLast BufferPoolAcquireFlags = 0b10000000000000000
)

func (BufferPoolAcquireFlags) Has

Has returns true if b contains other.

func (BufferPoolAcquireFlags) String

func (b BufferPoolAcquireFlags) String() string

String returns the names in string for BufferPoolAcquireFlags.

type BufferPoolAcquireParams

type BufferPoolAcquireParams struct {
	// contains filtered or unexported fields
}

BufferPoolAcquireParams 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.

An instance of this type is always passed by reference.

func (*BufferPoolAcquireParams) Flags

Flags: additional flags.

func (*BufferPoolAcquireParams) Format

func (b *BufferPoolAcquireParams) Format() Format

Format: format of start and stop.

func (*BufferPoolAcquireParams) SetStart

func (b *BufferPoolAcquireParams) SetStart(start int64)

Start: start position.

func (*BufferPoolAcquireParams) SetStop

func (b *BufferPoolAcquireParams) SetStop(stop int64)

Stop: stop position.

func (*BufferPoolAcquireParams) Start

func (b *BufferPoolAcquireParams) Start() int64

Start: start position.

func (*BufferPoolAcquireParams) Stop

func (b *BufferPoolAcquireParams) Stop() int64

Stop: stop position.

type BufferPoolClass

type BufferPoolClass struct {
	// contains filtered or unexported fields
}

BufferPoolClass class.

An instance of this type is always passed by reference.

func (*BufferPoolClass) ObjectClass

func (b *BufferPoolClass) ObjectClass() *ObjectClass

ObjectClass: object parent class.

type BufferPoolOverrides

type BufferPoolOverrides struct {
	// AcquireBuffer acquires a buffer from pool. buffer should point to a
	// memory location that can hold a pointer to the new buffer.
	//
	// params can contain optional parameters to influence the allocation.
	//
	// The function takes the following parameters:
	//
	//    - params (optional): parameters.
	//
	// The function returns the following values:
	//
	//    - buffer: location for a Buffer.
	//    - flowReturn such as GST_FLOW_FLUSHING when the pool is inactive.
	//
	AcquireBuffer func(params *BufferPoolAcquireParams) (*Buffer, FlowReturn)
	// AllocBuffer: allocate a buffer. the default implementation allocates
	// buffers from the configured memory allocator and with the configured
	// parameters. All metadata that is present on the allocated buffer will be
	// marked as T_META_FLAG_POOLED and T_META_FLAG_LOCKED and will not be
	// removed from the buffer in BufferPoolClass::reset_buffer. The buffer
	// should have the T_BUFFER_FLAG_TAG_MEMORY cleared.
	//
	// The function takes the following parameters:
	//
	//    - params (optional): parameters.
	//
	// The function returns the following values:
	//
	//    - buffer: location for a Buffer.
	//    - flowReturn to indicate whether the allocation was successful.
	//
	AllocBuffer func(params *BufferPoolAcquireParams) (*Buffer, FlowReturn)
	// FlushStart: enter the flushing state.
	FlushStart func()
	// FlushStop: leave the flushing state.
	FlushStop func()
	// FreeBuffer: free a buffer. The default implementation unrefs the buffer.
	//
	// The function takes the following parameters:
	//
	//    - buffer to free.
	//
	FreeBuffer func(buffer *Buffer)
	// Options 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().
	//
	// The function returns the following values:
	//
	//    - utf8s: NULL terminated array of strings.
	//
	Options func() []string
	// ReleaseBuffer 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.
	//
	// The function takes the following parameters:
	//
	//    - buffer: Buffer.
	//
	ReleaseBuffer func(buffer *Buffer)
	// ResetBuffer: reset the buffer to its state when it was freshly allocated.
	// The default implementation will clear the flags, timestamps and will
	// remove the metadata without the T_META_FLAG_POOLED flag (even the
	// metadata with T_META_FLAG_LOCKED). If the T_BUFFER_FLAG_TAG_MEMORY was
	// set, this function can also try to restore the memory and clear the
	// T_BUFFER_FLAG_TAG_MEMORY again.
	//
	// The function takes the following parameters:
	//
	//    - buffer to reset.
	//
	ResetBuffer func(buffer *Buffer)
	// SetConfig 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 Structure 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.
	//
	// The function takes the following parameters:
	//
	//    - config: Structure.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE when the configuration could be set.
	//
	SetConfig func(config *Structure) bool
	// Start the bufferpool. The default implementation will preallocate
	// min-buffers buffers and put them in the queue.
	//
	// The function returns the following values:
	//
	//    - ok: whether the pool could be started.
	//
	Start func() bool
	// Stop the bufferpool. the default implementation will free the
	// preallocated buffers. This function is called when all the buffers are
	// returned to the pool.
	//
	// The function returns the following values:
	//
	//    - ok: whether the pool could be stopped.
	//
	Stop func() bool
}

BufferPoolOverrides contains methods that are overridable.

type BufferingMode

type BufferingMode C.gint

BufferingMode: different types of buffering methods.

const (
	// BufferingStream: small amount of data is buffered.
	BufferingStream BufferingMode = iota
	// BufferingDownload: stream is being downloaded.
	BufferingDownload
	// BufferingTimeshift: stream is being downloaded in a ringbuffer.
	BufferingTimeshift
	// BufferingLive: stream is a live stream.
	BufferingLive
)

func (BufferingMode) String

func (b BufferingMode) String() string

String returns the name in string for BufferingMode.

type Bus

type Bus struct {
	GstObject
	// contains filtered or unexported fields
}

Bus is an object responsible for delivering Message packets in a first-in first-out way from the streaming threads (see Task) 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 Loop.

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 Pipeline has one bus.

Note that a Pipeline will set its bus into flushing state when changing from READY to NULL state.

func NewBus

func NewBus() *Bus

NewBus creates a new Bus instance.

The function returns the following values:

  • bus: new Bus instance.

func (*Bus) AddSignalWatch

func (bus *Bus) AddSignalWatch()

AddSignalWatch 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) AddSignalWatchFull

func (bus *Bus) AddSignalWatchFull(priority int)

AddSignalWatchFull 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 Loop 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.

The function takes the following parameters:

  • priority of the watch.

func (*Bus) AddWatch

func (bus *Bus) AddWatch(priority int, fn BusFunc) uint

AddWatch 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 Loop 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.

The function takes the following parameters:

  • priority of the watch.
  • fn: function to call when a message is received.

The function returns the following values:

  • guint: event source id or 0 if bus already got an event source.

func (*Bus) AsyncSignalFunc

func (bus *Bus) AsyncSignalFunc(message *Message, data unsafe.Pointer) bool

AsyncSignalFunc: helper BusFunc that can be used to convert all asynchronous messages into signals.

The function takes the following parameters:

  • message: Message received.
  • data (optional): user data.

The function returns the following values:

  • ok: TRUE.

func (*Bus) ConnectMessage

func (bus *Bus) ConnectMessage(f func(message *Message)) coreglib.SignalHandle

ConnectMessage has been posted on the bus. This signal is emitted from a #GSource added to the mainloop. this signal will only be emitted when there is a Loop running.

func (*Bus) ConnectSyncMessage

func (bus *Bus) ConnectSyncMessage(f func(message *Message)) coreglib.SignalHandle

ConnectSyncMessage: message has been posted on the bus. This signal is emitted from the thread that posted the message so one has to be careful with locking.

This signal will not be emitted by default, you have to call gst_bus_enable_sync_message_emission() before.

func (*Bus) CreateWatch

func (bus *Bus) CreateWatch() *glib.Source

CreateWatch: 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.

The function returns the following values:

  • source (optional) that can be added to a Loop.

func (*Bus) DisableSyncMessageEmission

func (bus *Bus) DisableSyncMessageEmission()

DisableSyncMessageEmission 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) EnableSyncMessageEmission

func (bus *Bus) EnableSyncMessageEmission()

EnableSyncMessageEmission 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 Loop.

func (*Bus) HavePending

func (bus *Bus) HavePending() bool

HavePending checks if there are pending messages on the bus that should be handled.

The function returns the following values:

  • ok: TRUE if there are messages on the bus to be handled, FALSE otherwise.

func (*Bus) Peek

func (bus *Bus) Peek() *Message

Peek peeks the message on the top of the bus' queue. The message will remain on the bus' message queue.

The function returns the following values:

  • message (optional) that is on the bus, or NULL if the bus is empty.

func (*Bus) Poll

func (bus *Bus) Poll(events MessageType, timeout ClockTime) *Message

Poll 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 T_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 Loop 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.

The function takes the following parameters:

  • events: mask of MessageType, representing the set of message types to poll for (note special handling of extended message types below).
  • timeout: poll timeout, as a ClockTime, or T_CLOCK_TIME_NONE to poll indefinitely.

The function returns the following values:

  • message (optional) that was received, or NULL if the poll timed out.

func (*Bus) Pop

func (bus *Bus) Pop() *Message

Pop gets a message from the bus.

The function returns the following values:

  • message (optional) that is on the bus, or NULL if the bus is empty.

func (*Bus) PopFiltered

func (bus *Bus) PopFiltered(types MessageType) *Message

PopFiltered 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 T_MESSAGE_EXTENDED in the events mask.

The function takes the following parameters:

  • types: message types to take into account.

The function returns the following values:

  • message (optional): next Message matching type that is on the bus, or NULL if the bus is empty or there is no message matching type.

func (*Bus) Post

func (bus *Bus) Post(message *Message) bool

Post posts a message on the given bus. Ownership of the message is taken by the bus.

The function takes the following parameters:

  • message to post.

The function returns the following values:

  • ok: TRUE if the message could be posted, FALSE if the bus is flushing.

func (*Bus) RemoveSignalWatch

func (bus *Bus) RemoveSignalWatch()

RemoveSignalWatch removes a signal watch previously added with gst_bus_add_signal_watch().

func (*Bus) RemoveWatch

func (bus *Bus) RemoveWatch() bool

RemoveWatch removes an installed bus watch from bus.

The function returns the following values:

  • ok: TRUE on success or FALSE if bus has no event source.

func (*Bus) SetFlushing

func (bus *Bus) SetFlushing(flushing bool)

SetFlushing: 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.

The function takes the following parameters:

  • flushing: whether or not to flush the bus.

func (*Bus) SetSyncHandler

func (bus *Bus) SetSyncHandler(fn BusSyncHandler)

SetSyncHandler 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.

The function takes the following parameters:

  • fn (optional): handler function to install.

func (*Bus) SyncSignalHandler

func (bus *Bus) SyncSignalHandler(message *Message, data unsafe.Pointer) BusSyncReply

SyncSignalHandler: helper BusSyncHandler that can be used to convert all synchronous messages into signals.

The function takes the following parameters:

  • message: Message received.
  • data (optional): user data.

The function returns the following values:

  • busSyncReply: GST_BUS_PASS.

func (*Bus) TimedPop

func (bus *Bus) TimedPop(timeout ClockTime) *Message

TimedPop 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 T_CLOCK_TIME_NONE, this function will block forever until a message was posted on the bus.

The function takes the following parameters:

  • timeout: timeout.

The function returns the following values:

  • message (optional) that is on the bus after the specified timeout or NULL if the bus is empty after the timeout expired.

func (*Bus) TimedPopFiltered

func (bus *Bus) TimedPopFiltered(timeout ClockTime, types MessageType) *Message

TimedPopFiltered 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 T_CLOCK_TIME_NONE, this function will block forever until a matching message was posted on the bus.

The function takes the following parameters:

  • timeout in nanoseconds, or GST_CLOCK_TIME_NONE to wait forever.
  • types: message types to take into account, GST_MESSAGE_ANY for any type.

The function returns the following values:

  • message (optional) matching the filter in types, or NULL if no matching message was found on the bus until the timeout expired.

type BusClass

type BusClass struct {
	// contains filtered or unexported fields
}

BusClass: GStreamer bus class.

An instance of this type is always passed by reference.

func (*BusClass) ParentClass

func (b *BusClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

type BusFlags

type BusFlags C.guint

BusFlags: standard flags that a bus may have.

const (
	// BusFlushing bus is currently dropping all messages.
	BusFlushing BusFlags = 0b10000
	// BusFlagLast: offset to define more flags.
	BusFlagLast BusFlags = 0b100000
)

func (BusFlags) Has

func (b BusFlags) Has(other BusFlags) bool

Has returns true if b contains other.

func (BusFlags) String

func (b BusFlags) String() string

String returns the names in string for BusFlags.

type BusFunc

type BusFunc func(bus *Bus, message *Message) (ok bool)

BusFunc 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 Func which means that returning FALSE will remove the #GSource from the mainloop.

type BusOverrides

type BusOverrides struct {
	// Message: message has been posted on the bus.
	//
	// The function takes the following parameters:
	//
	//    - message that has been posted asynchronously.
	//
	Message func(message *Message)
	// SyncMessage: message has been posted on the bus.
	//
	// The function takes the following parameters:
	//
	//    - message that has been posted synchronously.
	//
	SyncMessage func(message *Message)
}

BusOverrides contains methods that are overridable.

type BusSyncHandler

type BusSyncHandler func(bus *Bus, message *Message) (busSyncReply BusSyncReply)

BusSyncHandler: 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 BusSyncReply

type BusSyncReply C.gint

BusSyncReply: result values for a GstBusSyncHandler.

const (
	// BusDrop: drop the message.
	BusDrop BusSyncReply = iota
	// BusPass pass the message to the async queue.
	BusPass
	// BusAsync pass message to async queue, continue if message is handled.
	BusAsync
)

func (BusSyncReply) String

func (b BusSyncReply) String() string

String returns the name in string for BusSyncReply.

type Caps

type Caps struct {
	// contains filtered or unexported fields
}

Caps (capabilities) are lightweight refcounted objects describing media types. They are composed of an array of Structure.

Caps are exposed on PadTemplate to describe all possible types a given pad can handle. They are also stored in the Registry along with a description of the Element.

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 Caps 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 Caps 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 Caps / Structure serialization into string had limited support for nested Caps / Structure 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.

An instance of this type is always passed by reference.

func BufferPoolConfigGetParams

func BufferPoolConfigGetParams(config *Structure) (caps *Caps, size, minBuffers, maxBuffers uint, ok bool)

BufferPoolConfigGetParams gets the configuration values from config.

The function takes the following parameters:

  • config: BufferPool configuration.

The function returns the following values:

  • caps (optional) of buffers.
  • size (optional) of each buffer, not including prefix and padding.
  • minBuffers (optional): minimum amount of buffers to allocate.
  • maxBuffers (optional): maximum amount of buffers to allocate or 0 for unlimited.
  • ok: TRUE if all parameters could be fetched.

func CapsFromString

func CapsFromString(str string) *Caps

CapsFromString converts caps from a string representation.

The implementation of serialization up to 1.20 would lead to unexpected results when there were nested Caps / Structure deeper than one level.

The function takes the following parameters:

  • str: string to convert to Caps.

The function returns the following values:

  • caps (optional): newly allocated Caps.

func NewCapsAny

func NewCapsAny() *Caps

NewCapsAny constructs a struct Caps.

func NewCapsEmpty

func NewCapsEmpty() *Caps

NewCapsEmpty constructs a struct Caps.

func NewCapsEmptySimple

func NewCapsEmptySimple(mediaType string) *Caps

NewCapsEmptySimple constructs a struct Caps.

func ValueGetCaps

func ValueGetCaps(value *coreglib.Value) *Caps

ValueGetCaps gets the contents of value. The reference count of the returned Caps will not be modified, therefore the caller must take one before getting rid of the value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_CAPS.

The function returns the following values:

  • caps contents of value.

func (*Caps) Append

func (caps1 *Caps) Append(caps2 *Caps)

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.

The function takes the following parameters:

  • caps2 to append.

func (*Caps) AppendStructure

func (caps *Caps) AppendStructure(structure *Structure)

AppendStructure appends structure to caps. The structure is not copied; caps becomes the owner of structure.

The function takes the following parameters:

  • structure to append.

func (*Caps) AppendStructureFull

func (caps *Caps) AppendStructureFull(structure *Structure, features *CapsFeatures)

AppendStructureFull appends structure with features to caps. The structure is not copied; caps becomes the owner of structure.

The function takes the following parameters:

  • structure to append.
  • features (optional) to append.

func (*Caps) CanIntersect

func (caps1 *Caps) CanIntersect(caps2 *Caps) bool

CanIntersect tries intersecting caps1 and caps2 and reports whether the result would not be empty.

The function takes the following parameters:

  • caps2 to intersect.

The function returns the following values:

  • ok: TRUE if intersection would be not empty.

func (*Caps) Copy

func (caps *Caps) Copy() *Caps

Copy creates a new Caps 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().

The function returns the following values:

  • ret: new Caps.

func (*Caps) CopyNth

func (caps *Caps) CopyNth(nth uint) *Caps

CopyNth creates a new Caps and appends a copy of the nth structure contained in caps.

The function takes the following parameters:

  • nth structure to copy.

The function returns the following values:

  • ret: new Caps.

func (*Caps) Features

func (caps *Caps) Features(index uint) *CapsFeatures

Features 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 Caps 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().

The function takes the following parameters:

  • index of the structure.

The function returns the following values:

  • capsFeatures (optional): pointer to the CapsFeatures corresponding to index.

func (*Caps) FilterAndMapInPlace

func (caps *Caps) FilterAndMapInPlace(fn CapsFilterMapFunc)

FilterAndMapInPlace calls the provided function once for each structure and caps feature in the Caps. In contrast to gst_caps_foreach(), the function may modify the structure and features. In contrast to gst_caps_filter_and_map_in_place(), the structure and features are removed from the caps if FALSE is returned from the function. The caps must be mutable.

The function takes the following parameters:

  • fn: function to call for each field.

func (*Caps) Fixate

func (caps *Caps) Fixate() *Caps

Fixate 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.

The function returns the following values:

  • ret: fixated caps.

func (*Caps) ForEach

func (caps *Caps) ForEach(fn CapsForEachFunc) bool

ForEach calls the provided function once for each structure and caps feature in the Caps. The function must not modify the fields. Also see gst_caps_map_in_place() and gst_caps_filter_and_map_in_place().

The function takes the following parameters:

  • fn: function to call for each field.

The function returns the following values:

  • ok: TRUE if the supplied function returns TRUE for each call, FALSE otherwise.

func (*Caps) Intersect

func (caps1 *Caps) Intersect(caps2 *Caps) *Caps

Intersect creates a new Caps that contains all the formats that are common to both caps1 and caps2. Defaults to GST_CAPS_INTERSECT_ZIG_ZAG mode.

The function takes the following parameters:

  • caps2 to intersect.

The function returns the following values:

  • caps: new Caps.

func (*Caps) IntersectFull

func (caps1 *Caps) IntersectFull(caps2 *Caps, mode CapsIntersectMode) *Caps

IntersectFull creates a new Caps that contains all the formats that are common to both caps1 and caps2, the order is defined by the CapsIntersectMode used.

The function takes the following parameters:

  • caps2 to intersect.
  • mode: intersection algorithm/mode to use.

The function returns the following values:

  • caps: new Caps.

func (*Caps) IsAlwaysCompatible

func (caps1 *Caps) IsAlwaysCompatible(caps2 *Caps) bool

IsAlwaysCompatible: given Caps 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.

The function takes the following parameters:

  • caps2 to test.

The function returns the following values:

  • ok: TRUE if caps1 is a subset of caps2.

func (*Caps) IsAny

func (caps *Caps) IsAny() bool

IsAny determines if caps represents any media format.

The function returns the following values:

  • ok: TRUE if caps represents any format.

func (*Caps) IsEmpty

func (caps *Caps) IsEmpty() bool

IsEmpty determines if caps represents no media formats.

The function returns the following values:

  • ok: TRUE if caps represents no formats.

func (*Caps) IsEqual

func (caps1 *Caps) IsEqual(caps2 *Caps) bool

IsEqual checks if the given caps represent the same set of caps.

The function takes the following parameters:

  • caps2: another Caps.

The function returns the following values:

  • ok: TRUE if both caps are equal.

func (*Caps) IsEqualFixed

func (caps1 *Caps) IsEqualFixed(caps2 *Caps) bool

IsEqualFixed tests if two Caps are equal. This function only works on fixed Caps.

The function takes the following parameters:

  • caps2 to test.

The function returns the following values:

  • ok: TRUE if the arguments represent the same format.

func (*Caps) IsFixed

func (caps *Caps) IsFixed() bool

IsFixed: fixed Caps 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.

The function returns the following values:

  • ok: TRUE if caps is fixed.

func (*Caps) IsStrictlyEqual

func (caps1 *Caps) IsStrictlyEqual(caps2 *Caps) bool

IsStrictlyEqual checks if the given caps are exactly the same set of caps.

The function takes the following parameters:

  • caps2: another Caps.

The function returns the following values:

  • ok: TRUE if both caps are strictly equal.

func (*Caps) IsSubset

func (subset *Caps) IsSubset(superset *Caps) bool

IsSubset checks if all caps represented by subset are also represented by superset.

The function takes the following parameters:

  • superset: potentially greater Caps.

The function returns the following values:

  • ok: TRUE if subset is a subset of superset.

func (*Caps) IsSubsetStructure

func (caps *Caps) IsSubsetStructure(structure *Structure) bool

IsSubsetStructure checks if structure is a subset of caps. See gst_caps_is_subset() for more information.

The function takes the following parameters:

  • structure: potential Structure subset of caps.

The function returns the following values:

  • ok: TRUE if structure is a subset of caps.

func (*Caps) IsSubsetStructureFull

func (caps *Caps) IsSubsetStructureFull(structure *Structure, features *CapsFeatures) bool

IsSubsetStructureFull checks if structure is a subset of caps. See gst_caps_is_subset() for more information.

The function takes the following parameters:

  • structure: potential Structure subset of caps.
  • features (optional) for structure.

The function returns the following values:

  • ok: TRUE if structure is a subset of caps.

func (*Caps) MapInPlace

func (caps *Caps) MapInPlace(fn CapsMapFunc) bool

MapInPlace calls the provided function once for each structure and caps feature in the Caps. In contrast to gst_caps_foreach(), the function may modify but not delete the structures and features. The caps must be mutable.

The function takes the following parameters:

  • fn: function to call for each field.

The function returns the following values:

  • ok: TRUE if the supplied function returns TRUE for each call, FALSE otherwise.

func (*Caps) Merge

func (caps1 *Caps) Merge(caps2 *Caps) *Caps

Merge 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.

The function takes the following parameters:

  • caps2 to merge in.

The function returns the following values:

  • caps: merged caps.

func (*Caps) MergeStructure

func (caps *Caps) MergeStructure(structure *Structure) *Caps

MergeStructure appends structure to caps if it is not already expressed by caps.

The function takes the following parameters:

  • structure to merge.

The function returns the following values:

  • ret: merged caps.

func (*Caps) MergeStructureFull

func (caps *Caps) MergeStructureFull(structure *Structure, features *CapsFeatures) *Caps

MergeStructureFull appends structure with features to caps if its not already expressed by caps.

The function takes the following parameters:

  • structure to merge.
  • features (optional) to merge.

The function returns the following values:

  • ret: merged caps.

func (*Caps) MiniObject

func (c *Caps) MiniObject() *MiniObject

MiniObject: parent type.

func (*Caps) Normalize

func (caps *Caps) Normalize() *Caps

Normalize returns a Caps that represents the same set of formats as caps, but contains no lists. Each list is expanded into separate Structure.

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().

The function returns the following values:

  • ret: normalized Caps.

func (*Caps) RemoveStructure

func (caps *Caps) RemoveStructure(idx uint)

RemoveStructure removes the structure with the given index from the list of structures contained in caps.

The function takes the following parameters:

  • idx: index of the structure to remove.

func (*Caps) Serialize

func (caps *Caps) Serialize(flags SerializeFlags) string

Serialize converts caps to a string representation. This string representation can be converted back to a Caps 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 T_SERIALIZE_FLAG_BACKWARD_COMPAT is passed as flag.

The function takes the following parameters:

  • flags: SerializeFlags.

The function returns the following values:

  • utf8: newly allocated string representing caps.

func (*Caps) SetFeatures

func (caps *Caps) SetFeatures(index uint, features *CapsFeatures)

SetFeatures sets the features for the structure at index.

The function takes the following parameters:

  • index of the structure.
  • features (optional) to set.

func (*Caps) SetFeaturesSimple

func (caps *Caps) SetFeaturesSimple(features *CapsFeatures)

SetFeaturesSimple sets the features for all the structures of caps.

The function takes the following parameters:

  • features (optional) to set.

func (*Caps) SetValue

func (caps *Caps) SetValue(field string, value *coreglib.Value)

SetValue 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.

The function takes the following parameters:

  • field: name of the field to set.
  • value to set the field to.

func (*Caps) Simplify

func (caps *Caps) Simplify() *Caps

Simplify 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.

The function returns the following values:

  • ret: simplified caps.

func (*Caps) Size

func (caps *Caps) Size() uint

Size gets the number of structures contained in caps.

The function returns the following values:

  • guint: number of structures that caps contains.

func (*Caps) StealStructure

func (caps *Caps) StealStructure(index uint) *Structure

StealStructure retrieves the structure with the given index from the list of structures contained in caps. The caller becomes the owner of the returned structure.

The function takes the following parameters:

  • index: index of the structure to retrieve.

The function returns the following values:

  • structure (optional): pointer to the Structure corresponding to index.

func (*Caps) String

func (caps *Caps) String() string

String converts caps to a string representation. This string representation can be converted back to a Caps 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 Caps / Structure deeper than one level.

The function returns the following values:

  • utf8: newly allocated string representing caps.

func (*Caps) Structure

func (caps *Caps) Structure(index uint) *Structure

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 Caps 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().

The function takes the following parameters:

  • index of the structure.

The function returns the following values:

  • structure: pointer to the Structure corresponding to index.

func (*Caps) Subtract

func (minuend *Caps) Subtract(subtrahend *Caps) *Caps

Subtract subtracts the subtrahend from the minuend. > This function does not work reliably if optional properties for caps > are included on one caps and omitted on the other.

The function takes the following parameters:

  • subtrahend to subtract.

The function returns the following values:

  • caps: resulting caps.

func (*Caps) Truncate

func (caps *Caps) Truncate() *Caps

Truncate 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.

The function returns the following values:

  • ret: truncated caps.

type CapsFeatures

type CapsFeatures struct {
	// contains filtered or unexported fields
}

CapsFeatures can optionally be set on a Caps to add requirements for additional features for a specific Structure. 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 CapsFeatures are equivalent with the CapsFeatures that only contain T_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY CapsFeatures as created by gst_caps_features_new_any() are equal to any other CapsFeatures and can be used to specify that any CapsFeatures would be supported, e.g. for elements that don't touch buffer memory. Caps with ANY CapsFeatures are considered non-fixed and during negotiation some CapsFeatures have to be selected.

Examples for caps features would be the requirement of a specific Memory types or the requirement of having a specific Meta on the buffer. Features are given as a string of the format memory:GstMemoryTypeName or meta:GstMetaAPIName.

An instance of this type is always passed by reference.

func CapsFeaturesFromString

func CapsFeaturesFromString(features string) *CapsFeatures

CapsFeaturesFromString creates a CapsFeatures from a string representation.

The function takes the following parameters:

  • features: string representation of a CapsFeatures.

The function returns the following values:

  • capsFeatures (optional): new CapsFeatures or NULL when the string could not be parsed.

func NewCapsFeaturesAny

func NewCapsFeaturesAny() *CapsFeatures

NewCapsFeaturesAny constructs a struct CapsFeatures.

func NewCapsFeaturesEmpty

func NewCapsFeaturesEmpty() *CapsFeatures

NewCapsFeaturesEmpty constructs a struct CapsFeatures.

func NewCapsFeaturesSingle

func NewCapsFeaturesSingle(feature string) *CapsFeatures

NewCapsFeaturesSingle constructs a struct CapsFeatures.

func ValueGetCapsFeatures

func ValueGetCapsFeatures(value *coreglib.Value) *CapsFeatures

ValueGetCapsFeatures gets the contents of value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_CAPS_FEATURES.

The function returns the following values:

  • capsFeatures contents of value.

func (*CapsFeatures) Add

func (features *CapsFeatures) Add(feature string)

Add adds feature to features.

The function takes the following parameters:

  • feature: feature.

func (*CapsFeatures) AddID

func (features *CapsFeatures) AddID(feature glib.Quark)

AddID adds feature to features.

The function takes the following parameters:

  • feature: feature.

func (*CapsFeatures) Contains

func (features *CapsFeatures) Contains(feature string) bool

Contains checks if features contains feature.

The function takes the following parameters:

  • feature: feature.

The function returns the following values:

  • ok: TRUE if features contains feature.

func (*CapsFeatures) ContainsID

func (features *CapsFeatures) ContainsID(feature glib.Quark) bool

ContainsID checks if features contains feature.

The function takes the following parameters:

  • feature: feature.

The function returns the following values:

  • ok: TRUE if features contains feature.

func (*CapsFeatures) Copy

func (features *CapsFeatures) Copy() *CapsFeatures

Copy duplicates a CapsFeatures and all its values.

The function returns the following values:

  • capsFeatures: new CapsFeatures.

func (*CapsFeatures) IsAny

func (features *CapsFeatures) IsAny() bool

IsAny checks if features is GST_CAPS_FEATURES_ANY.

The function returns the following values:

  • ok: TRUE if features is GST_CAPS_FEATURES_ANY.

func (*CapsFeatures) IsEqual

func (features1 *CapsFeatures) IsEqual(features2 *CapsFeatures) bool

IsEqual checks if features1 and features2 are equal.

The function takes the following parameters:

  • features2: CapsFeatures.

The function returns the following values:

  • ok: TRUE if features1 and features2 are equal.

func (*CapsFeatures) Nth

func (features *CapsFeatures) Nth(i uint) string

Nth returns the i-th feature of features.

The function takes the following parameters:

  • i: index of the feature.

The function returns the following values:

  • utf8 (optional): i-th feature of features.

func (*CapsFeatures) NthID

func (features *CapsFeatures) NthID(i uint) glib.Quark

NthID returns the i-th feature of features.

The function takes the following parameters:

  • i: index of the feature.

The function returns the following values:

  • quark: i-th feature of features.

func (*CapsFeatures) Remove

func (features *CapsFeatures) Remove(feature string)

Remove removes feature from features.

The function takes the following parameters:

  • feature: feature.

func (*CapsFeatures) RemoveID

func (features *CapsFeatures) RemoveID(feature glib.Quark)

RemoveID removes feature from features.

The function takes the following parameters:

  • feature: feature.

func (*CapsFeatures) SetParentRefcount

func (features *CapsFeatures) SetParentRefcount(refcount *int) bool

SetParentRefcount sets the parent_refcount field of CapsFeatures. 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 CapsFeatures, as described in the MT refcounting design document (additional/design/MT-refcounting.md).

The function takes the following parameters:

  • refcount: pointer to the parent's refcount.

The function returns the following values:

  • ok: TRUE if the parent refcount could be set.

func (*CapsFeatures) Size

func (features *CapsFeatures) Size() uint

Size returns the number of features in features.

The function returns the following values:

  • guint: number of features in features.

func (*CapsFeatures) String

func (features *CapsFeatures) String() string

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.

The function returns the following values:

  • utf8: pointer to string allocated by g_malloc().

type CapsFilterMapFunc

type CapsFilterMapFunc func(features *CapsFeatures, structure *Structure) (ok bool)

CapsFilterMapFunc: 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 CapsFlags

type CapsFlags C.guint

CapsFlags: extra flags for a caps.

const (
	// CapsFlagAny caps has no specific content, but can contain anything.
	CapsFlagAny CapsFlags = 0b10000
)

func (CapsFlags) Has

func (c CapsFlags) Has(other CapsFlags) bool

Has returns true if c contains other.

func (CapsFlags) String

func (c CapsFlags) String() string

String returns the names in string for CapsFlags.

type CapsForEachFunc

type CapsForEachFunc func(features *CapsFeatures, structure *Structure) (ok bool)

CapsForEachFunc: function that will be called in gst_caps_foreach(). The function may not modify features or structure.

type CapsIntersectMode

type CapsIntersectMode C.gint

CapsIntersectMode 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.

const (
	// CapsIntersectZigZag zig-zags over both caps.
	CapsIntersectZigZag CapsIntersectMode = iota
	// CapsIntersectFirst keeps the first caps order.
	CapsIntersectFirst
)

func (CapsIntersectMode) String

func (c CapsIntersectMode) String() string

String returns the name in string for CapsIntersectMode.

type CapsMapFunc

type CapsMapFunc func(features *CapsFeatures, structure *Structure) (ok bool)

CapsMapFunc: function that will be called in gst_caps_map_in_place(). The function may modify features and structure.

type ChildProxier

type ChildProxier interface {
	coreglib.Objector

	// ChildAdded emits the ChildProxy::child-added signal.
	ChildAdded(child *coreglib.Object, name string)
	// ChildRemoved emits the ChildProxy::child-removed signal.
	ChildRemoved(child *coreglib.Object, name string)
	// ChildByIndex fetches a child by its number.
	ChildByIndex(index uint) *coreglib.Object
	// ChildByName looks up a child element by the given name.
	ChildByName(name string) *coreglib.Object
	// ChildrenCount gets the number of child objects this parent contains.
	ChildrenCount() uint
	// Property gets a single property using the GstChildProxy mechanism.
	Property(name string) coreglib.Value
	// SetProperty sets a single property using the GstChildProxy mechanism.
	SetProperty(name string, value *coreglib.Value)

	// Child-added will be emitted after the object was added to the
	// child_proxy.
	ConnectChildAdded(func(object *coreglib.Object, name string)) coreglib.SignalHandle
	// Child-removed will be emitted after the object was removed from the
	// child_proxy.
	ConnectChildRemoved(func(object *coreglib.Object, name string)) coreglib.SignalHandle
}

ChildProxier describes ChildProxy's interface methods.

type ChildProxy

type ChildProxy struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

ChildProxy: this interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple Pad or some kind of voice objects. Another use case are container elements like Bin. 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 ChildProxy interface.

ChildProxy wraps an interface. This means the user can get the underlying type by calling Cast().

func (*ChildProxy) ChildAdded

func (parent *ChildProxy) ChildAdded(child *coreglib.Object, name string)

ChildAdded emits the ChildProxy::child-added signal.

The function takes the following parameters:

  • child: newly added child.
  • name of the new child.

func (*ChildProxy) ChildByIndex

func (parent *ChildProxy) ChildByIndex(index uint) *coreglib.Object

ChildByIndex fetches a child by its number.

The function takes the following parameters:

  • index child's position in the child list.

The function returns the following values:

  • object (optional): child object or NULL if not found (index too high).

func (*ChildProxy) ChildByName

func (parent *ChildProxy) ChildByName(name string) *coreglib.Object

ChildByName looks up a child element by the given name.

This virtual method has a default implementation that uses Object together with gst_object_get_name(). If the interface is to be used with #GObjects, this methods needs to be overridden.

The function takes the following parameters:

  • name child's name.

The function returns the following values:

  • object (optional): child object or NULL if not found.

func (*ChildProxy) ChildRemoved

func (parent *ChildProxy) ChildRemoved(child *coreglib.Object, name string)

ChildRemoved emits the ChildProxy::child-removed signal.

The function takes the following parameters:

  • child: removed child.
  • name of the old child.

func (*ChildProxy) ChildrenCount

func (parent *ChildProxy) ChildrenCount() uint

ChildrenCount gets the number of child objects this parent contains.

The function returns the following values:

  • guint: number of child objects.

func (*ChildProxy) ConnectChildAdded

func (parent *ChildProxy) ConnectChildAdded(f func(object *coreglib.Object, name string)) coreglib.SignalHandle

ConnectChildAdded will be emitted after the object was added to the child_proxy.

func (*ChildProxy) ConnectChildRemoved

func (parent *ChildProxy) ConnectChildRemoved(f func(object *coreglib.Object, name string)) coreglib.SignalHandle

ConnectChildRemoved will be emitted after the object was removed from the child_proxy.

func (*ChildProxy) Property

func (object *ChildProxy) Property(name string) coreglib.Value

Property gets a single property using the GstChildProxy mechanism. You are responsible for freeing it by calling g_value_unset().

The function takes the following parameters:

  • name of the property.

The function returns the following values:

  • value that should take the result.

func (*ChildProxy) SetProperty

func (object *ChildProxy) SetProperty(name string, value *coreglib.Value)

SetProperty sets a single property using the GstChildProxy mechanism.

The function takes the following parameters:

  • name of the property to set.
  • value: new #GValue for the property.

type ChildProxyInterface

type ChildProxyInterface struct {
	// contains filtered or unexported fields
}

ChildProxyInterface interface.

An instance of this type is always passed by reference.

type Clock

type Clock struct {
	GstObject
	// contains filtered or unexported fields
}

Clock: 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 SystemClock.

The Clock 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 T_EVENT_SEGMENT events and the element's base time, see Pipeline.

A clock implementation can support periodic and single shot clock notifications both synchronous and asynchronous.

One first needs to create a ClockID 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 ClockID 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 T_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 ClockID that has been unscheduled cannot be used again for any wait operation, a new ClockID 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 ClockID from multiple threads. However, registering the same ClockID 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 ClockID, 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 ClockID has to keep a handle to the ClockID 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 T_CLOCK_FLAG_CAN_SET_MASTER flag set, it can be slaved to another Clock 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 Pipeline. 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 Clock:timeout, Clock:window-size and Clock:window-threshold properties. The Clock:timeout property defines the interval to sample the master clock and run the calibration functions. Clock:window-size defines the number of samples to use when calibrating and Clock:window-threshold defines the minimum number of samples before the calibration is performed.

func BaseClock

func BaseClock(obj Clocker) *Clock

BaseClock returns the underlying base object.

func (*Clock) AddObservation

func (clock *Clock) AddObservation(slave, master ClockTime) (float64, bool)

AddObservation: 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.

The function takes the following parameters:

  • slave: time on the slave.
  • master: time on the master.

The function returns the following values:

  • rSquared: pointer to hold the result.
  • ok: TRUE if enough observations were added to run the regression algorithm.

func (*Clock) AddObservationUnapplied

func (clock *Clock) AddObservationUnapplied(slave, master ClockTime) (rSquared float64, internal, external, rateNum, rateDenom ClockTime, ok bool)

AddObservationUnapplied: 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.

The function takes the following parameters:

  • slave: time on the slave.
  • master: time on the master.

The function returns the following values:

  • rSquared: pointer to hold the result.
  • internal (optional): location to store the internal time.
  • external (optional): location to store the external time.
  • rateNum (optional): location to store the rate numerator.
  • rateDenom (optional): location to store the rate denominator.
  • ok: TRUE if enough observations were added to run the regression algorithm.

func (*Clock) AdjustUnlocked

func (clock *Clock) AdjustUnlocked(internal ClockTime) ClockTime

AdjustUnlocked 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().

The function takes the following parameters:

  • internal: clock time.

The function returns the following values:

  • clockTime: converted time of the clock.

func (*Clock) AdjustWithCalibration

func (clock *Clock) AdjustWithCalibration(internalTarget, cinternal, cexternal, cnum, cdenom ClockTime) ClockTime

AdjustWithCalibration 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.

The function takes the following parameters:

  • internalTarget: clock time.
  • cinternal: reference internal time.
  • cexternal: reference external time.
  • cnum: numerator of the rate of the clock relative to its internal time.
  • cdenom: denominator of the rate of the clock.

The function returns the following values:

  • clockTime: converted time of the clock.

func (*Clock) Calibration

func (clock *Clock) Calibration() (internal, external, rateNum, rateDenom ClockTime)

Calibration 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.

The function returns the following values:

  • internal (optional): location to store the internal time.
  • external (optional): location to store the external time.
  • rateNum (optional): location to store the rate numerator.
  • rateDenom (optional): location to store the rate denominator.

func (*Clock) ConnectSynced

func (clock *Clock) ConnectSynced(f func(synced bool)) coreglib.SignalHandle

ConnectSynced: signaled on clocks with GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC set once the clock is synchronized, or when it completely lost synchronization. This signal will not be emitted on clocks without the flag.

This signal will be emitted from an arbitrary thread, most likely not the application's main thread.

func (*Clock) InternalTime

func (clock *Clock) InternalTime() ClockTime

InternalTime gets the current internal time of the given clock. The time is returned unadjusted for the offset and the rate.

The function returns the following values:

  • clockTime: internal time of the clock. Or GST_CLOCK_TIME_NONE when given invalid input.

func (*Clock) IsSynced

func (clock *Clock) IsSynced() bool

IsSynced checks if the clock is currently synced, by looking at whether GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is set.

The function returns the following values:

  • ok: TRUE if the clock is currently synced.

func (*Clock) Master

func (clock *Clock) Master() Clocker

Master gets the master clock that clock is slaved to or NULL when the clock is not slaved to any master clock.

The function returns the following values:

  • ret (optional): master Clock or NULL when this clock is not slaved to a master clock.

func (*Clock) NewPeriodicID

func (clock *Clock) NewPeriodicID(startTime, interval ClockTime) ClockID

NewPeriodicID 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.

The function takes the following parameters:

  • startTime: requested start time.
  • interval: requested interval.

The function returns the following values:

  • clockID that can be used to request the time notification.

func (*Clock) NewSingleShotID

func (clock *Clock) NewSingleShotID(time ClockTime) ClockID

NewSingleShotID gets a ClockID from clock to trigger a single shot notification at the requested time.

The function takes the following parameters:

  • time: requested time.

The function returns the following values:

  • clockID that can be used to request the time notification.

func (*Clock) PeriodicIDReinit

func (clock *Clock) PeriodicIDReinit(id ClockID, startTime, interval ClockTime) bool

PeriodicIDReinit reinitializes the provided periodic id to the provided start time and interval. Does not modify the reference count.

The function takes the following parameters:

  • id: ClockID.
  • startTime: requested start time.
  • interval: requested interval.

The function returns the following values:

  • ok: TRUE if the GstClockID could be reinitialized to the provided time, else FALSE.

func (*Clock) Resolution

func (clock *Clock) Resolution() ClockTime

Resolution gets the accuracy of the clock. The accuracy of the clock is the granularity of the values returned by gst_clock_get_time().

The function returns the following values:

  • clockTime: resolution of the clock in units of ClockTime.

func (*Clock) SetCalibration

func (clock *Clock) SetCalibration(internal, external, rateNum, rateDenom ClockTime)

SetCalibration 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.

The function takes the following parameters:

  • internal: reference internal time.
  • external: reference external time.
  • rateNum: numerator of the rate of the clock relative to its internal time.
  • rateDenom: denominator of the rate of the clock.

func (*Clock) SetMaster

func (clock *Clock) SetMaster(master Clocker) bool

SetMaster 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.

The function takes the following parameters:

  • master (optional) Clock.

The function returns the following values:

  • ok: TRUE if the clock is capable of being slaved to a master clock. Trying to set a master on a clock without the T_CLOCK_FLAG_CAN_SET_MASTER flag will make this function return FALSE.

func (*Clock) SetResolution

func (clock *Clock) SetResolution(resolution ClockTime) ClockTime

SetResolution 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 T_CLOCK_FLAG_CAN_SET_RESOLUTION flag set.

The function takes the following parameters:

  • resolution to set.

The function returns the following values:

  • clockTime: new resolution of the clock.

func (*Clock) SetSynced

func (clock *Clock) SetSynced(synced bool)

SetSynced sets clock to synced and emits the Clock::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.

The function takes the following parameters:

  • synced: if the clock is synced.

func (*Clock) SetTimeout

func (clock *Clock) SetTimeout(timeout ClockTime)

SetTimeout sets the amount of time, in nanoseconds, to sample master and slave clocks.

The function takes the following parameters:

  • timeout: timeout.

func (*Clock) SingleShotIDReinit

func (clock *Clock) SingleShotIDReinit(id ClockID, time ClockTime) bool

SingleShotIDReinit reinitializes the provided single shot id to the provided time. Does not modify the reference count.

The function takes the following parameters:

  • id: ClockID.
  • time: requested time.

The function returns the following values:

  • ok: TRUE if the GstClockID could be reinitialized to the provided time, else FALSE.

func (*Clock) Time

func (clock *Clock) Time() ClockTime

Time gets the current time of the given clock. The time is always monotonically increasing and adjusted according to the current offset and rate.

The function returns the following values:

  • clockTime: time of the clock. Or GST_CLOCK_TIME_NONE when given invalid input.

func (*Clock) Timeout

func (clock *Clock) Timeout() ClockTime

Timeout gets the amount of time that master and slave clocks are sampled.

The function returns the following values:

  • clockTime: interval between samples.

func (*Clock) UnadjustUnlocked

func (clock *Clock) UnadjustUnlocked(external ClockTime) ClockTime

UnadjustUnlocked 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().

The function takes the following parameters:

  • external clock time.

The function returns the following values:

  • clockTime: internal time of the clock corresponding to external.

func (*Clock) UnadjustWithCalibration

func (clock *Clock) UnadjustWithCalibration(externalTarget, cinternal, cexternal, cnum, cdenom ClockTime) ClockTime

UnadjustWithCalibration 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.

The function takes the following parameters:

  • externalTarget: clock time.
  • cinternal: reference internal time.
  • cexternal: reference external time.
  • cnum: numerator of the rate of the clock relative to its internal time.
  • cdenom: denominator of the rate of the clock.

The function returns the following values:

  • clockTime: converted time of the clock.

func (*Clock) WaitForSync

func (clock *Clock) WaitForSync(timeout ClockTime) bool

WaitForSync 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 Clock::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.

The function takes the following parameters:

  • timeout for waiting or GST_CLOCK_TIME_NONE.

The function returns the following values:

  • ok: TRUE if waiting was successful, or FALSE on timeout.

type ClockCallback

type ClockCallback func(clock Clocker, time ClockTime, id ClockID) (ok bool)

ClockCallback: function prototype of the callback.

type ClockClass

type ClockClass struct {
	// contains filtered or unexported fields
}

ClockClass: GStreamer clock class. Override the vmethods to implement the clock functionality.

An instance of this type is always passed by reference.

func (*ClockClass) ParentClass

func (c *ClockClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

type ClockEntry

type ClockEntry struct {
	// contains filtered or unexported fields
}

ClockEntry: 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.

An instance of this type is always passed by reference.

func (*ClockEntry) Refcount

func (c *ClockEntry) Refcount() int

Refcount: reference counter (read-only).

func (*ClockEntry) SetRefcount

func (c *ClockEntry) SetRefcount(refcount int)

Refcount: reference counter (read-only).

type ClockEntryType

type ClockEntryType C.gint

ClockEntryType: type of the clock entry.

const (
	// ClockEntrySingle: single shot timeout.
	ClockEntrySingle ClockEntryType = iota
	// ClockEntryPeriodic: periodic timeout request.
	ClockEntryPeriodic
)

func (ClockEntryType) String

func (c ClockEntryType) String() string

String returns the name in string for ClockEntryType.

type ClockFlags

type ClockFlags C.guint

ClockFlags capabilities of this clock.

const (
	// ClockFlagCanDoSingleSync: clock can do a single sync timeout request.
	ClockFlagCanDoSingleSync ClockFlags = 0b10000
	// ClockFlagCanDoSingleAsync: clock can do a single async timeout request.
	ClockFlagCanDoSingleAsync ClockFlags = 0b100000
	// ClockFlagCanDoPeriodicSync: clock can do sync periodic timeout requests.
	ClockFlagCanDoPeriodicSync ClockFlags = 0b1000000
	// ClockFlagCanDoPeriodicAsync: clock can do async periodic timeout
	// callbacks.
	ClockFlagCanDoPeriodicAsync ClockFlags = 0b10000000
	// ClockFlagCanSetResolution clock's resolution can be changed.
	ClockFlagCanSetResolution ClockFlags = 0b100000000
	// ClockFlagCanSetMaster: clock can be slaved to a master clock.
	ClockFlagCanSetMaster ClockFlags = 0b1000000000
	// ClockFlagNeedsStartupSync: clock needs to be synced before it can be
	// used.
	ClockFlagNeedsStartupSync ClockFlags = 0b10000000000
	// ClockFlagLast subclasses can add additional flags starting from this
	// flag.
	ClockFlagLast ClockFlags = 0b1000000000000
)

func (ClockFlags) Has

func (c ClockFlags) Has(other ClockFlags) bool

Has returns true if c contains other.

func (ClockFlags) String

func (c ClockFlags) String() string

String returns the names in string for ClockFlags.

type ClockID

type ClockID = unsafe.Pointer

ClockID: datatype to hold the handle to an outstanding sync or async clock callback.

type ClockOverrides

type ClockOverrides struct {
	// ChangeResolution: change the resolution of the clock. Not all values
	// might be acceptable.
	//
	// The function takes the following parameters:
	//
	//    - oldResolution previous resolution.
	//    - newResolution: new resolution.
	//
	// The function returns the following values:
	//
	//    - clockTime: new resolution.
	//
	ChangeResolution func(oldResolution, newResolution ClockTime) ClockTime
	// InternalTime gets the current internal time of the given clock. The time
	// is returned unadjusted for the offset and the rate.
	//
	// The function returns the following values:
	//
	//    - clockTime: internal time of the clock. Or GST_CLOCK_TIME_NONE when
	//      given invalid input.
	//
	InternalTime func() ClockTime
	// Resolution gets the accuracy of the clock. The accuracy of the clock is
	// the granularity of the values returned by gst_clock_get_time().
	//
	// The function returns the following values:
	//
	//    - clockTime: resolution of the clock in units of ClockTime.
	//
	Resolution func() ClockTime
	// Unschedule: unblock a blocking or async wait operation.
	//
	// The function takes the following parameters:
	//
	//    - entry to unschedule.
	//
	Unschedule func(entry *ClockEntry)
	// Wait: perform a blocking wait on the given ClockEntry and return the
	// jitter.
	//
	// The function takes the following parameters:
	//
	//    - entry to wait on.
	//
	// The function returns the following values:
	//
	//    - jitter (optional): pointer that will contain the jitter.
	//    - clockReturn: result of the blocking wait. T_CLOCK_EARLY will be
	//      returned if the current clock time is past the time of id, T_CLOCK_OK
	//      if id was scheduled in time. T_CLOCK_UNSCHEDULED if id was
	//      unscheduled with gst_clock_id_unschedule().
	//
	Wait func(entry *ClockEntry) (ClockTimeDiff, ClockReturn)
	// WaitAsync: perform an asynchronous wait on the given ClockEntry.
	//
	// The function takes the following parameters:
	//
	//    - entry to wait on.
	//
	// The function returns the following values:
	//
	//    - clockReturn: result of the non blocking wait.
	//
	WaitAsync func(entry *ClockEntry) ClockReturn
}

ClockOverrides contains methods that are overridable.

type ClockReturn

type ClockReturn C.gint

ClockReturn: return value of a clock operation.

const (
	// ClockOK: operation succeeded.
	ClockOK ClockReturn = iota
	// ClockEarly: operation was scheduled too late.
	ClockEarly
	// ClockUnscheduled: clockID was unscheduled.
	ClockUnscheduled
	// ClockBusy: clockID is busy.
	ClockBusy
	// ClockBadtime: bad time was provided to a function.
	ClockBadtime
	// ClockError: error occurred.
	ClockError
	// ClockUnsupported: operation is not supported.
	ClockUnsupported
	// ClockDone: clockID is done waiting.
	ClockDone
)

func ClockIDWaitAsync

func ClockIDWaitAsync(id ClockID, fn ClockCallback) ClockReturn

ClockIDWaitAsync registers a callback on the given ClockID id with the given function and user_data. When passing a ClockID 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.

The function takes the following parameters:

  • id to wait on.
  • fn: callback function.

The function returns the following values:

  • clockReturn: result of the non blocking wait.

func (ClockReturn) String

func (c ClockReturn) String() string

String returns the name in string for ClockReturn.

type ClockTime

type ClockTime = uint64

ClockTime: datatype to hold a time, measured in nanoseconds.

func ClockIDGetTime

func ClockIDGetTime(id ClockID) ClockTime

ClockIDGetTime gets the time of the clock ID.

The function takes the following parameters:

  • id to query.

The function returns the following values:

  • clockTime: time of the given clock id.

func UtilGetTimestamp

func UtilGetTimestamp() ClockTime

UtilGetTimestamp: get a timestamp as GstClockTime to be used for interval measurements. The timestamp should not be interpreted in any other way.

The function returns the following values:

  • clockTime: timestamp.

type ClockTimeDiff

type ClockTimeDiff = int64

ClockTimeDiff: datatype to hold a time difference, measured in nanoseconds.

type ClockType

type ClockType C.gint

ClockType: different kind of clocks.

const (
	// ClockTypeRealtime: time since Epoch.
	ClockTypeRealtime ClockType = iota
	// ClockTypeMonotonic: monotonic time since some unspecified starting point.
	ClockTypeMonotonic
	// ClockTypeOther: some other time source is used (Since: 1.0.5).
	ClockTypeOther
	// ClockTypeTai: time since Epoch, but using International Atomic Time as
	// reference (Since: 1.18).
	ClockTypeTai
)

func (ClockType) String

func (c ClockType) String() string

String returns the name in string for ClockType.

type Clocker

type Clocker interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Clocker describes types inherited from class Clock.

To get the original type, the caller must assert this to an interface or another type.

func ClockIDGetClock

func ClockIDGetClock(id ClockID) Clocker

ClockIDGetClock: this function returns the underlying clock.

The function takes the following parameters:

  • id: ClockID.

The function returns the following values:

  • clock (optional) or NULL when the underlying clock has been freed.

func SystemClockObtain

func SystemClockObtain() Clocker

SystemClockObtain: 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.

The function returns the following values:

  • clock: default clock.

    MT safe.

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context 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 ElementClass::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.

Context can be persistent. A persistent Context 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.

An instance of this type is always passed by reference.

func NewContext

func NewContext(contextType string, persistent bool) *Context

NewContext constructs a struct Context.

func (*Context) ContextType

func (context *Context) ContextType() string

ContextType gets the type of context.

The function returns the following values:

  • utf8: type of the context.

func (*Context) HasContextType

func (context *Context) HasContextType(contextType string) bool

HasContextType checks if context has context_type.

The function takes the following parameters:

  • contextType: context type to check.

The function returns the following values:

  • ok: TRUE if context has context_type.

func (*Context) IsPersistent

func (context *Context) IsPersistent() bool

IsPersistent checks if context is persistent.

The function returns the following values:

  • ok: TRUE if the context is persistent.

func (*Context) Structure

func (context *Context) Structure() *Structure

Structure accesses the structure of the context.

The function returns the following values:

  • structure of the context. The structure is still owned by the context, which means that you should not modify it, free it and that the pointer becomes invalid when you free the context.

func (*Context) WritableStructure

func (context *Context) WritableStructure() *Structure

WritableStructure gets a writable version of the structure.

The function returns the following values:

  • structure of the context. The structure is still owned by the context, which means that you should not free it and that the pointer becomes invalid when you free the context. This function checks if context is writable.

type ControlBinding

type ControlBinding struct {
	GstObject
	// contains filtered or unexported fields
}

ControlBinding: base class for value mapping objects that attaches control sources to #GObject properties. Such an object is taking one or more ControlSource instances, combines them and maps the resulting value to the type and value range of the bound property.

func BaseControlBinding

func BaseControlBinding(obj ControlBindinger) *ControlBinding

BaseControlBinding returns the underlying base object.

func (*ControlBinding) GValueArray

func (binding *ControlBinding) GValueArray(timestamp, interval ClockTime, values []coreglib.Value) bool

GValueArray gets a number of #GValues for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of #GValue.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

The function takes the following parameters:

  • timestamp: time that should be processed.
  • interval: time spacing between subsequent values.
  • values: array to put control-values in.

The function returns the following values:

  • ok: TRUE if the given array could be filled, FALSE otherwise.

func (*ControlBinding) IsDisabled

func (binding *ControlBinding) IsDisabled() bool

IsDisabled checks if the control binding is disabled.

The function returns the following values:

  • ok: TRUE if the binding is inactive.

func (*ControlBinding) SetDisabled

func (binding *ControlBinding) SetDisabled(disabled bool)

SetDisabled: this function is used to disable a control binding for some time, i.e. gst_object_sync_values() will do nothing.

The function takes the following parameters:

  • disabled: boolean that specifies whether to disable the controller or not.

func (*ControlBinding) SyncValues

func (binding *ControlBinding) SyncValues(object GstObjector, timestamp, lastSync ClockTime) bool

SyncValues sets the property of the object, according to the ControlSources 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.

The function takes the following parameters:

  • object that has controlled properties.
  • timestamp: time that should be processed.
  • lastSync: last time this was called.

The function returns the following values:

  • ok: TRUE if the controller value could be applied to the object property, FALSE otherwise.

func (*ControlBinding) Value

func (binding *ControlBinding) Value(timestamp ClockTime) *coreglib.Value

Value gets the value for the given controlled property at the requested time.

The function takes the following parameters:

  • timestamp: time the control-change should be read from.

The function returns the following values:

  • value (optional): GValue of the property at the given time, or NULL if the property isn't controlled.

type ControlBindingClass

type ControlBindingClass struct {
	// contains filtered or unexported fields
}

ControlBindingClass class structure of ControlBinding.

An instance of this type is always passed by reference.

func (*ControlBindingClass) ParentClass

func (c *ControlBindingClass) ParentClass() *ObjectClass

ParentClass: parent class.

type ControlBindingOverrides

type ControlBindingOverrides struct {
	// GValueArray gets a number of #GValues for the given controlled property
	// starting at the requested time. The array values need to hold enough
	// space for n_values of #GValue.
	//
	// This function is useful if one wants to e.g. draw a graph of the control
	// curve or apply a control curve sample by sample.
	//
	// The function takes the following parameters:
	//
	//    - timestamp: time that should be processed.
	//    - interval: time spacing between subsequent values.
	//    - values: array to put control-values in.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the given array could be filled, FALSE otherwise.
	//
	GValueArray func(timestamp, interval ClockTime, values []coreglib.Value) bool
	// Value gets the value for the given controlled property at the requested
	// time.
	//
	// The function takes the following parameters:
	//
	//    - timestamp: time the control-change should be read from.
	//
	// The function returns the following values:
	//
	//    - value (optional): GValue of the property at the given time, or NULL
	//      if the property isn't controlled.
	//
	Value func(timestamp ClockTime) *coreglib.Value
	// SyncValues sets the property of the object, according to the
	// ControlSources 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.
	//
	// The function takes the following parameters:
	//
	//    - object that has controlled properties.
	//    - timestamp: time that should be processed.
	//    - lastSync: last time this was called.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the controller value could be applied to the object
	//      property, FALSE otherwise.
	//
	SyncValues func(object GstObjector, timestamp, lastSync ClockTime) bool
}

ControlBindingOverrides contains methods that are overridable.

type ControlBindinger

type ControlBindinger interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

ControlBindinger describes types inherited from class ControlBinding.

To get the original type, the caller must assert this to an interface or another type.

type ControlSource

type ControlSource struct {
	GstObject
	// contains filtered or unexported fields
}

ControlSource 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 ControlSource 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 ControlSource one has to implement ControlSourceGetValue and ControlSourceGetValueArray functions. These are then used by gst_control_source_get_value() and gst_control_source_get_value_array() to get values for specific timestamps.

func BaseControlSource

func BaseControlSource(obj ControlSourcer) *ControlSource

BaseControlSource returns the underlying base object.

func (*ControlSource) ControlSourceGetValue

func (self *ControlSource) ControlSourceGetValue(timestamp ClockTime) (float64, bool)

ControlSourceGetValue gets the value for this ControlSource at a given timestamp.

The function takes the following parameters:

  • timestamp: time for which the value should be returned.

The function returns the following values:

  • value: value.
  • ok: FALSE if the value couldn't be returned, TRUE otherwise.

func (*ControlSource) ControlSourceGetValueArray

func (self *ControlSource) ControlSourceGetValueArray(timestamp, interval ClockTime, values []float64) bool

ControlSourceGetValueArray gets an array of values for for this ControlSource. Values that are undefined contain NANs.

The function takes the following parameters:

  • timestamp: first timestamp.
  • interval: time steps.
  • values: array to put control-values in.

The function returns the following values:

  • ok: TRUE if the given array could be filled, FALSE otherwise.

type ControlSourceClass

type ControlSourceClass struct {
	// contains filtered or unexported fields
}

ControlSourceClass class structure of ControlSource.

An instance of this type is always passed by reference.

func (*ControlSourceClass) ParentClass

func (c *ControlSourceClass) ParentClass() *ObjectClass

ParentClass: parent class.

type ControlSourceOverrides

type ControlSourceOverrides struct {
}

ControlSourceOverrides contains methods that are overridable.

type ControlSourcer

type ControlSourcer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

ControlSourcer describes types inherited from class ControlSource.

To get the original type, the caller must assert this to an interface or another type.

type CoreError

type CoreError C.gint

CoreError: core errors are errors inside the core GStreamer library.

const (
	// CoreErrorFailed: 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: do not use this except as a placeholder for deciding
	// where to go while developing code.
	CoreErrorTooLaZY CoreError = 2
	// CoreErrorNotImplemented: use this when you do not want to implement this
	// functionality yet.
	CoreErrorNotImplemented CoreError = 3
	// CoreErrorStateChange: used for state change errors.
	CoreErrorStateChange CoreError = 4
	// CoreErrorPad: used for pad-related errors.
	CoreErrorPad CoreError = 5
	// CoreErrorThread: used for thread-related errors.
	CoreErrorThread CoreError = 6
	// CoreErrorNegotiation: used for negotiation-related errors.
	CoreErrorNegotiation CoreError = 7
	// CoreErrorEvent: used for event-related errors.
	CoreErrorEvent CoreError = 8
	// CoreErrorSeek: used for seek-related errors.
	CoreErrorSeek CoreError = 9
	// CoreErrorCaps: used for caps-related errors.
	CoreErrorCaps CoreError = 10
	// CoreErrorTag: used for negotiation-related errors.
	CoreErrorTag CoreError = 11
	// CoreErrorMissingPlugin: used if a plugin is missing.
	CoreErrorMissingPlugin CoreError = 12
	// CoreErrorClock: used for clock related errors.
	CoreErrorClock CoreError = 13
	// CoreErrorDisabled: used if functionality has been disabled at compile
	// time.
	CoreErrorDisabled CoreError = 14
	// CoreErrorNumErrors: number of core error types.
	CoreErrorNumErrors CoreError = 15
)

func (CoreError) String

func (c CoreError) String() string

String returns the name in string for CoreError.

type CustomMeta

type CustomMeta struct {
	// contains filtered or unexported fields
}

CustomMeta: simple typing wrapper around Meta

An instance of this type is always passed by reference.

func (*CustomMeta) HasName

func (meta *CustomMeta) HasName(name string) bool

HasName checks whether the name of the custom meta is name.

The function takes the following parameters:

The function returns the following values:

  • ok: whether name is the name of the custom meta.

func (*CustomMeta) Meta

func (c *CustomMeta) Meta() *Meta

func (*CustomMeta) Structure

func (meta *CustomMeta) Structure() *Structure

Structure: retrieve the Structure backing a custom meta, the structure's mutability is conditioned to the writability of the Buffer meta is attached to.

The function returns the following values:

  • structure backing meta.

type CustomMetaTransformFunction

type CustomMetaTransformFunction func(transbuf *Buffer, meta *CustomMeta, buffer *Buffer, typ glib.Quark, data unsafe.Pointer) (ok bool)

CustomMetaTransformFunction: function called for each meta in buffer as a result of performing a transformation on 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 DateTime

type DateTime struct {
	// contains filtered or unexported fields
}

DateTime: struct to store date, time and timezone information altogether. DateTime 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

An instance of this type is always passed by reference.

func NewDateTime

func NewDateTime(tzoffset float32, year int, month int, day int, hour int, minute int, seconds float64) *DateTime

NewDateTime constructs a struct DateTime.

func NewDateTimeFromGDateTime

func NewDateTimeFromGDateTime(dt *glib.DateTime) *DateTime

NewDateTimeFromGDateTime constructs a struct DateTime.

func NewDateTimeFromISO8601String

func NewDateTimeFromISO8601String(str string) *DateTime

NewDateTimeFromISO8601String constructs a struct DateTime.

func NewDateTimeFromUnixEpochLocalTime

func NewDateTimeFromUnixEpochLocalTime(secs int64) *DateTime

NewDateTimeFromUnixEpochLocalTime constructs a struct DateTime.

func NewDateTimeFromUnixEpochLocalTimeUsecs

func NewDateTimeFromUnixEpochLocalTimeUsecs(usecs int64) *DateTime

NewDateTimeFromUnixEpochLocalTimeUsecs constructs a struct DateTime.

func NewDateTimeFromUnixEpochUTC

func NewDateTimeFromUnixEpochUTC(secs int64) *DateTime

NewDateTimeFromUnixEpochUTC constructs a struct DateTime.

func NewDateTimeFromUnixEpochUTCUsecs

func NewDateTimeFromUnixEpochUTCUsecs(usecs int64) *DateTime

NewDateTimeFromUnixEpochUTCUsecs constructs a struct DateTime.

func NewDateTimeLocalTime

func NewDateTimeLocalTime(year int, month int, day int, hour int, minute int, seconds float64) *DateTime

NewDateTimeLocalTime constructs a struct DateTime.

func NewDateTimeNowLocalTime

func NewDateTimeNowLocalTime() *DateTime

NewDateTimeNowLocalTime constructs a struct DateTime.

func NewDateTimeNowUTC

func NewDateTimeNowUTC() *DateTime

NewDateTimeNowUTC constructs a struct DateTime.

func NewDateTimeY

func NewDateTimeY(year int) *DateTime

NewDateTimeY constructs a struct DateTime.

func NewDateTimeYM

func NewDateTimeYM(year int, month int) *DateTime

NewDateTimeYM constructs a struct DateTime.

func NewDateTimeYmd

func NewDateTimeYmd(year int, month int, day int) *DateTime

NewDateTimeYmd constructs a struct DateTime.

func (*DateTime) Day

func (datetime *DateTime) Day() int

Day returns the day of the month of this DateTime.

The function returns the following values:

  • gint: day of this DateTime, or -1 if none is set.

func (*DateTime) HasDay

func (datetime *DateTime) HasDay() bool

The function returns the following values:

  • ok: TRUE if datetime<!-- -->'s day field is set, otherwise FALSE.

func (*DateTime) HasMonth

func (datetime *DateTime) HasMonth() bool

The function returns the following values:

  • ok: TRUE if datetime<!-- -->'s month field is set, otherwise FALSE.

func (*DateTime) HasSecond

func (datetime *DateTime) HasSecond() bool

The function returns the following values:

  • ok: TRUE if datetime<!-- -->'s second field is set, otherwise FALSE.

func (*DateTime) HasTime

func (datetime *DateTime) HasTime() bool

The function returns the following values:

  • ok: TRUE if datetime<!-- -->'s hour and minute fields are set, otherwise FALSE.

func (*DateTime) HasYear

func (datetime *DateTime) HasYear() bool

The function returns the following values:

  • ok: TRUE if datetime<!-- -->'s year field is set (which should always be the case), otherwise FALSE.

func (*DateTime) Hour

func (datetime *DateTime) Hour() int

Hour retrieves the hour of the day represented by datetime in the gregorian calendar. The return is in the range of 0 to 23.

The function returns the following values:

  • gint: hour of the day, or -1 if none is set.

func (*DateTime) Microsecond

func (datetime *DateTime) Microsecond() int

Microsecond retrieves the fractional part of the seconds in microseconds represented by datetime in the gregorian calendar.

The function returns the following values:

  • gint: microsecond of the second, or -1 if none is set.

func (*DateTime) Minute

func (datetime *DateTime) Minute() int

Minute retrieves the minute of the hour represented by datetime in the gregorian calendar.

The function returns the following values:

  • gint: minute of the hour, or -1 if none is set.

func (*DateTime) Month

func (datetime *DateTime) Month() int

Month returns the month of this DateTime. January is 1, February is 2, etc..

The function returns the following values:

  • gint: month of this DateTime, or -1 if none is set.

func (*DateTime) Second

func (datetime *DateTime) Second() int

Second retrieves the second of the minute represented by datetime in the gregorian calendar.

The function returns the following values:

  • gint: second represented by datetime, or -1 if none is set.

func (*DateTime) TimeZoneOffset

func (datetime *DateTime) TimeZoneOffset() float32

TimeZoneOffset 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.

The function returns the following values:

  • gfloat: offset from UTC in hours, or G_MAXDOUBLE if none is set.

func (*DateTime) ToGDateTime

func (datetime *DateTime) ToGDateTime() *glib.DateTime

ToGDateTime creates a new Time from a fully defined DateTime object.

The function returns the following values:

  • dateTime (optional): newly created Time, or NULL on error or if datetime does not have a year, month, day, hour, minute and second.

func (*DateTime) ToISO8601String

func (datetime *DateTime) ToISO8601String() string

ToISO8601String: 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.

The function returns the following values:

  • utf8 (optional): newly allocated string formatted according to ISO 8601 and only including the datetime fields that are valid, or NULL in case there was an error.

func (*DateTime) Year

func (datetime *DateTime) Year() int

Year returns the year of this DateTime. Call gst_date_time_has_year() before, to avoid warnings.

The function returns the following values:

  • gint: year of this DateTime.

type DebugCategory

type DebugCategory struct {
	// contains filtered or unexported fields
}

DebugCategory: this is the struct that describes the categories. Once initialized with T_DEBUG_CATEGORY_INIT, its values can't be changed anymore.

An instance of this type is always passed by reference.

func DebugGetAllCategories

func DebugGetAllCategories() []*DebugCategory

DebugGetAllCategories returns a snapshot of a all categories that are currently in use . This list may change anytime. The caller has to free the list after use.

The function returns the following values:

  • sList: list of debug categories.

func (*DebugCategory) Color

func (category *DebugCategory) Color() uint

Color returns the color of a debug category used when printing output in this category.

The function returns the following values:

  • guint: color of the category.

func (*DebugCategory) Description

func (category *DebugCategory) Description() string

Description returns the description of a debug category.

The function returns the following values:

  • utf8: description of the category.

func (*DebugCategory) Name

func (category *DebugCategory) Name() string

Name returns the name of a debug category.

The function returns the following values:

  • utf8: name of the category.

func (*DebugCategory) ResetThreshold

func (category *DebugCategory) ResetThreshold()

ResetThreshold 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 (*DebugCategory) SetThreshold

func (category *DebugCategory) SetThreshold(level DebugLevel)

SetThreshold 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. > Do not use this function in production code, because other functions may > change the threshold of categories as side effect. It is however a nice > function to use when debugging (even from gdb).

The function takes the following parameters:

  • level threshold to set.

func (*DebugCategory) Threshold

func (category *DebugCategory) Threshold() DebugLevel

Threshold returns the threshold of a DebugCategory.

The function returns the following values:

  • debugLevel that is used as threshold.

type DebugColorFlags

type DebugColorFlags C.guint

DebugColorFlags: these are some terminal style flags you can use when creating your debugging categories to make them stand out in debugging output.

const (
	// DebugFgBlack: use black as foreground color.
	DebugFgBlack DebugColorFlags = 0b0
	// DebugFgRed: use red as foreground color.
	DebugFgRed DebugColorFlags = 0b1
	// DebugFgGreen: use green as foreground color.
	DebugFgGreen DebugColorFlags = 0b10
	// DebugFgYellow: use yellow as foreground color.
	DebugFgYellow DebugColorFlags = 0b11
	// DebugFgBlue: use blue as foreground color.
	DebugFgBlue DebugColorFlags = 0b100
	// DebugFgMagenta: use magenta as foreground color.
	DebugFgMagenta DebugColorFlags = 0b101
	// DebugFgCyan: use cyan as foreground color.
	DebugFgCyan DebugColorFlags = 0b110
	// DebugFgWhite: use white as foreground color.
	DebugFgWhite DebugColorFlags = 0b111
	// DebugBgBlack: use black as background color.
	DebugBgBlack DebugColorFlags = 0b0
	// DebugBgRed: use red as background color.
	DebugBgRed DebugColorFlags = 0b10000
	// DebugBgGreen: use green as background color.
	DebugBgGreen DebugColorFlags = 0b100000
	// DebugBgYellow: use yellow as background color.
	DebugBgYellow DebugColorFlags = 0b110000
	// DebugBgBlue: use blue as background color.
	DebugBgBlue DebugColorFlags = 0b1000000
	// DebugBgMagenta: use magenta as background color.
	DebugBgMagenta DebugColorFlags = 0b1010000
	// DebugBgCyan: use cyan as background color.
	DebugBgCyan DebugColorFlags = 0b1100000
	// DebugBgWhite: use white as background color.
	DebugBgWhite DebugColorFlags = 0b1110000
	// DebugBold: make the output bold.
	DebugBold DebugColorFlags = 0b100000000
	// DebugUnderline: underline the output.
	DebugUnderline DebugColorFlags = 0b1000000000
)

func (DebugColorFlags) Has

func (d DebugColorFlags) Has(other DebugColorFlags) bool

Has returns true if d contains other.

func (DebugColorFlags) String

func (d DebugColorFlags) String() string

String returns the names in string for DebugColorFlags.

type DebugColorMode

type DebugColorMode C.gint
const (
	// DebugColorModeOff: do not use colors in logs.
	DebugColorModeOff DebugColorMode = iota
	// DebugColorModeOn: paint logs in a platform-specific way.
	DebugColorModeOn
	// DebugColorModeUnix: paint logs with UNIX terminal color codes no matter
	// what platform GStreamer is running on.
	DebugColorModeUnix
)

func DebugGetColorMode

func DebugGetColorMode() DebugColorMode

DebugGetColorMode changes the coloring mode for debug output.

The function returns the following values:

  • debugColorMode: see GstDebugColorMode for possible values.

func (DebugColorMode) String

func (d DebugColorMode) String() string

String returns the name in string for DebugColorMode.

type DebugGraphDetails

type DebugGraphDetails C.guint

DebugGraphDetails: available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE() and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().

const (
	// DebugGraphShowMediaType: show caps-name on edges.
	DebugGraphShowMediaType DebugGraphDetails = 0b1
	// DebugGraphShowCapsDetails: show caps-details on edges.
	DebugGraphShowCapsDetails DebugGraphDetails = 0b10
	// DebugGraphShowNonDefaultParams: show modified parameters on elements.
	DebugGraphShowNonDefaultParams DebugGraphDetails = 0b100
	// DebugGraphShowStates: show element states.
	DebugGraphShowStates DebugGraphDetails = 0b1000
	// DebugGraphShowFullParams: show full element parameter values even if they
	// are very long.
	DebugGraphShowFullParams DebugGraphDetails = 0b10000
	// DebugGraphShowAll: show all the typical details that one might want.
	DebugGraphShowAll DebugGraphDetails = 0b1111
	// DebugGraphShowVerbose: show all details regardless of how large or
	// verbose they make the resulting output.
	DebugGraphShowVerbose DebugGraphDetails = 0b11111111111111111111111111111111
)

func (DebugGraphDetails) Has

Has returns true if d contains other.

func (DebugGraphDetails) String

func (d DebugGraphDetails) String() string

String returns the names in string for DebugGraphDetails.

type DebugLevel

type DebugLevel C.gint

DebugLevel: level defines the importance of a debugging message. The more important a message is, the greater the probability that the debugging system outputs it.

const (
	// LevelNone: no debugging level specified or desired. Used to deactivate
	// debugging output.
	LevelNone DebugLevel = 0
	// LevelError: 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: 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: 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: 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: 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: 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: tracing-related messages. Examples for this are
	// referencing/dereferencing of objects.
	LevelTrace DebugLevel = 7
	// LevelMemdump: 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: number of defined debugging levels.
	LevelCount DebugLevel = 10
)

func DebugGetDefaultThreshold

func DebugGetDefaultThreshold() DebugLevel

DebugGetDefaultThreshold returns the default threshold that is used for new categories.

The function returns the following values:

  • debugLevel: default threshold level.

func (DebugLevel) String

func (d DebugLevel) String() string

String returns the name in string for DebugLevel.

type Device

type Device struct {
	GstObject
	// contains filtered or unexported fields
}

Device are objects representing a device, they contain relevant metadata about the device, such as its class and the Caps representing the media types it can produce or handle.

Device are created by DeviceProvider objects which can be aggregated by DeviceMonitor objects.

func BaseDevice

func BaseDevice(obj Devicer) *Device

BaseDevice returns the underlying base object.

func (*Device) Caps

func (device *Device) Caps() *Caps

Caps: getter for the Caps that this device supports.

The function returns the following values:

  • caps (optional) supported by this device. Unref with gst_caps_unref() when done.

func (*Device) ConnectRemoved

func (device *Device) ConnectRemoved(f func()) coreglib.SignalHandle

func (*Device) CreateElement

func (device *Device) CreateElement(name string) Elementer

CreateElement creates the element with all of the required parameters set to use this device.

The function takes the following parameters:

  • name (optional) of new element, or NULL to automatically create a unique name.

The function returns the following values:

  • element (optional): new Element configured to use this device.

func (*Device) DeviceClass

func (device *Device) DeviceClass() string

DeviceClass 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 DeviceProvider that produced this device.

The function returns the following values:

  • utf8: device class. Free with g_free() after use.

func (*Device) DisplayName

func (device *Device) DisplayName() string

DisplayName gets the user-friendly name of the device.

The function returns the following values:

  • utf8: device name. Free with g_free() after use.

func (*Device) HasClasses

func (device *Device) HasClasses(classes string) bool

HasClasses: check if device matches all of the given classes.

The function takes the following parameters:

  • classes: "/"-separated list of device classes to match, only match if all classes are matched.

The function returns the following values:

  • ok: TRUE if device matches.

func (*Device) HasClassesv

func (device *Device) HasClassesv(classes []string) bool

HasClassesv: check if factory matches all of the given classes.

The function takes the following parameters:

  • classes: NULL terminated array of classes to match, only match if all classes are matched.

The function returns the following values:

  • ok: TRUE if device matches.

func (*Device) Properties

func (device *Device) Properties() *Structure

Properties gets the extra properties of a device.

The function returns the following values:

  • structure (optional): extra properties or NULL when there are none. Free with gst_structure_free() after use.

func (*Device) ReconfigureElement

func (device *Device) ReconfigureElement(element Elementer) bool

ReconfigureElement 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.

The function takes the following parameters:

  • element: Element.

The function returns the following values:

  • ok: TRUE if the element could be reconfigured to use this device, FALSE otherwise.

type DeviceClass

type DeviceClass struct {
	// contains filtered or unexported fields
}

DeviceClass class structure for a Device object.

An instance of this type is always passed by reference.

func (*DeviceClass) ParentClass

func (d *DeviceClass) ParentClass() *ObjectClass

ParentClass: parent ObjectClass structure.

type DeviceMonitor

type DeviceMonitor struct {
	GstObject
	// contains filtered or unexported fields
}

DeviceMonitor applications should create a DeviceMonitor when they want to probe, list and monitor devices of a specific type. The DeviceMonitor will create the appropriate DeviceProvider objects and manage them. It will then post messages on its Bus 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, &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, &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;
}.

func NewDeviceMonitor

func NewDeviceMonitor() *DeviceMonitor

NewDeviceMonitor: create a new DeviceMonitor.

The function returns the following values:

  • deviceMonitor: new device monitor.

func (*DeviceMonitor) AddFilter

func (monitor *DeviceMonitor) AddFilter(classes string, caps *Caps) uint

AddFilter adds a filter for which Device will be monitored, any device that matches all these classes and the Caps 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 Caps 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 DeviceMonitor is started.

The function takes the following parameters:

  • classes (optional): device classes to use as filter or NULL for any class.
  • caps (optional) to filter or NULL for ANY.

The function returns the following values:

  • guint: id of the new filter or 0 if no provider matched the filter's classes.

func (*DeviceMonitor) Bus

func (monitor *DeviceMonitor) Bus() *Bus

Bus gets the Bus of this DeviceMonitor.

The function returns the following values:

  • bus: Bus.

func (*DeviceMonitor) Devices

func (monitor *DeviceMonitor) Devices() []Devicer

Devices gets a list of devices from all of the relevant monitors. This may actually probe the hardware if the monitor is not currently started.

The function returns the following values:

  • list (optional) of Device.

func (*DeviceMonitor) Providers

func (monitor *DeviceMonitor) Providers() []string

Providers: get a list of the currently selected device provider factories.

This.

The function returns the following values:

  • utf8s: A list of device provider factory names that are currently being monitored by monitor or NULL when nothing is being monitored.

func (*DeviceMonitor) RemoveFilter

func (monitor *DeviceMonitor) RemoveFilter(filterId uint) bool

RemoveFilter removes a filter from the DeviceMonitor using the id that was returned by gst_device_monitor_add_filter().

The function takes the following parameters:

  • filterId: id of the filter.

The function returns the following values:

  • ok: TRUE of the filter id was valid, FALSE otherwise.

func (*DeviceMonitor) SetShowAllDevices

func (monitor *DeviceMonitor) SetShowAllDevices(showAll bool)

SetShowAllDevices: set if all devices should be visible, even those devices from hidden providers. Setting show_all to true might show some devices multiple times.

The function takes the following parameters:

  • showAll: show all devices.

func (*DeviceMonitor) ShowAllDevices

func (monitor *DeviceMonitor) ShowAllDevices() bool

ShowAllDevices: get if monitor is currently showing all devices, even those from hidden providers.

The function returns the following values:

  • ok: TRUE when all devices will be shown.

func (*DeviceMonitor) Start

func (monitor *DeviceMonitor) Start() bool

Start 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.

The function returns the following values:

  • ok: TRUE if the device monitoring could be started, i.e. at least a single device provider was started successfully.

func (*DeviceMonitor) Stop

func (monitor *DeviceMonitor) Stop()

Stop stops monitoring the devices.

type DeviceMonitorClass

type DeviceMonitorClass struct {
	// contains filtered or unexported fields
}

DeviceMonitorClass: opaque device monitor class structure.

An instance of this type is always passed by reference.

func (*DeviceMonitorClass) ParentClass

func (d *DeviceMonitorClass) ParentClass() *ObjectClass

ParentClass: parent ObjectClass structure.

type DeviceMonitorOverrides

type DeviceMonitorOverrides struct {
}

DeviceMonitorOverrides contains methods that are overridable.

type DeviceOverrides

type DeviceOverrides struct {
	// CreateElement creates the element with all of the required parameters set
	// to use this device.
	//
	// The function takes the following parameters:
	//
	//    - name (optional) of new element, or NULL to automatically create a
	//      unique name.
	//
	// The function returns the following values:
	//
	//    - element (optional): new Element configured to use this device.
	//
	CreateElement func(name string) Elementer
	// ReconfigureElement 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.
	//
	// The function takes the following parameters:
	//
	//    - element: Element.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the element could be reconfigured to use this device,
	//      FALSE otherwise.
	//
	ReconfigureElement func(element Elementer) bool
}

DeviceOverrides contains methods that are overridable.

type DeviceProvider

type DeviceProvider struct {
	GstObject
	// contains filtered or unexported fields
}

DeviceProvider 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 DeviceProvider subclass is a singleton, a plugin should normally provide a single subclass for all devices.

Applications would normally use a DeviceMonitor to monitor devices from all relevant providers.

func BaseDeviceProvider

func BaseDeviceProvider(obj DeviceProviderer) *DeviceProvider

BaseDeviceProvider returns the underlying base object.

func (*DeviceProvider) Bus

func (provider *DeviceProvider) Bus() *Bus

Bus gets the Bus of this DeviceProvider.

The function returns the following values:

  • bus: Bus.

func (*DeviceProvider) CanMonitor

func (provider *DeviceProvider) CanMonitor() bool

The function returns the following values:

func (*DeviceProvider) ConnectProviderHidden

func (provider *DeviceProvider) ConnectProviderHidden(f func(object string)) coreglib.SignalHandle

func (*DeviceProvider) ConnectProviderUnhidden

func (provider *DeviceProvider) ConnectProviderUnhidden(f func(object string)) coreglib.SignalHandle

func (*DeviceProvider) DeviceAdd

func (provider *DeviceProvider) DeviceAdd(device Devicer)

DeviceAdd posts a message on the provider's Bus 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()).

The function takes the following parameters:

  • device that has been added.

func (*DeviceProvider) DeviceChanged

func (provider *DeviceProvider) DeviceChanged(device, changedDevice Devicer)

DeviceChanged: 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. Device is immutable for MT. safety purposes so this is an "atomic" way of letting the application know when a device was modified.

The function takes the following parameters:

  • device: new version of changed_device.
  • changedDevice: old version of the device that has been updated.

func (*DeviceProvider) DeviceRemove

func (provider *DeviceProvider) DeviceRemove(device Devicer)

DeviceRemove posts a message on the provider's Bus to inform applications that a device has been removed.

This is for use by subclasses.

The function takes the following parameters:

  • device that has been removed.

func (*DeviceProvider) Devices

func (provider *DeviceProvider) Devices() []Devicer

Devices gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.

If the provider has been started, this will returned the same Device objedcts that have been returned by the T_MESSAGE_DEVICE_ADDED messages.

The function returns the following values:

  • list of Device.

func (*DeviceProvider) Factory

func (provider *DeviceProvider) Factory() *DeviceProviderFactory

Factory retrieves the factory that was used to create this device provider.

The function returns the following values:

  • deviceProviderFactory (optional) used for creating this device provider. no refcounting is needed.

func (*DeviceProvider) HiddenProviders

func (provider *DeviceProvider) HiddenProviders() []string

HiddenProviders: get the provider factory names of the DeviceProvider instances that are hidden by provider.

The function returns the following values:

  • utf8s: a list of hidden providers factory names or NULL when nothing is hidden by provider. Free with g_strfreev.

func (*DeviceProvider) HideProvider

func (provider *DeviceProvider) HideProvider(name string)

HideProvider: 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.

The function takes the following parameters:

  • name: provider factory name.

func (*DeviceProvider) IsStarted

func (provider *DeviceProvider) IsStarted() bool

IsStarted: this function can be used to know if the provider was successfully started.

The function returns the following values:

func (*DeviceProvider) Metadata

func (provider *DeviceProvider) Metadata(key string) string

Metadata: get metadata with key in provider.

The function takes the following parameters:

  • key to get.

The function returns the following values:

  • utf8: metadata for key.

func (*DeviceProvider) Start

func (provider *DeviceProvider) Start() bool

Start starts providering the devices. This will cause T_MESSAGE_DEVICE_ADDED and T_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus when devices are added or removed from the system.

Since the DeviceProvider 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 T_MESSAGE_DEVICE_ADDED messages and will no longer probe.

The function returns the following values:

  • ok: TRUE if the device providering could be started.

func (*DeviceProvider) Stop

func (provider *DeviceProvider) Stop()

Stop decreases the use-count by one. If the use count reaches zero, this DeviceProvider will stop providering the devices. This needs to be called the same number of times that gst_device_provider_start() was called.

func (*DeviceProvider) UnhideProvider

func (provider *DeviceProvider) UnhideProvider(name string)

UnhideProvider: 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.

The function takes the following parameters:

  • name: provider factory name.

type DeviceProviderClass

type DeviceProviderClass struct {
	// contains filtered or unexported fields
}

DeviceProviderClass: structure of the base DeviceProviderClass

An instance of this type is always passed by reference.

func (*DeviceProviderClass) AddMetadata

func (klass *DeviceProviderClass) AddMetadata(key string, value string)

AddMetadata: set key with value as metadata in klass.

The function takes the following parameters:

  • key to set.
  • value to set.

func (*DeviceProviderClass) AddStaticMetadata

func (klass *DeviceProviderClass) AddStaticMetadata(key string, value string)

AddStaticMetadata: 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.).

The function takes the following parameters:

  • key to set.
  • value to set.

func (*DeviceProviderClass) Factory

Factory: pointer to the DeviceProviderFactory that creates this provider.

func (*DeviceProviderClass) Metadata

func (klass *DeviceProviderClass) Metadata(key string) string

Metadata: get metadata with key in klass.

The function takes the following parameters:

  • key to get.

The function returns the following values:

  • utf8 (optional): metadata for key.

func (*DeviceProviderClass) ParentClass

func (d *DeviceProviderClass) ParentClass() *ObjectClass

ParentClass: parent ObjectClass structure.

func (*DeviceProviderClass) SetMetadata

func (klass *DeviceProviderClass) SetMetadata(longname string, classification string, description string, author string)

SetMetadata sets the detailed information for a DeviceProviderClass.

> This function is for use in _class_init functions only.

The function takes the following parameters:

  • longname: long English name of the device provider. E.g. "File Sink".
  • classification: 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: sentence describing the purpose of the device provider. E.g: "Write stream to a file".
  • author: name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;".

func (*DeviceProviderClass) SetStaticMetadata

func (klass *DeviceProviderClass) SetStaticMetadata(longname string, classification string, description string, author string)

SetStaticMetadata sets the detailed information for a DeviceProviderClass.

> 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.).

The function takes the following parameters:

  • longname: long English name of the element. E.g. "File Sink".
  • classification: 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: sentence describing the purpose of the element. E.g: "Write stream to a file".
  • author: name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;".

type DeviceProviderFactory

type DeviceProviderFactory struct {
	PluginFeature
	// contains filtered or unexported fields
}

DeviceProviderFactory is used to create instances of device providers. A GstDeviceProviderfactory can be added to a Plugin as it is also a PluginFeature.

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.

func DeviceProviderFactoryFind

func DeviceProviderFactoryFind(name string) *DeviceProviderFactory

DeviceProviderFactoryFind: search for an device provider factory of the given name. Refs the returned device provider factory; caller is responsible for unreffing.

The function takes the following parameters:

  • name of factory to find.

The function returns the following values:

  • deviceProviderFactory (optional) if found, NULL otherwise.

func DeviceProviderFactoryListGetDeviceProviders

func DeviceProviderFactoryListGetDeviceProviders(minrank Rank) []*DeviceProviderFactory

DeviceProviderFactoryListGetDeviceProviders: get a list of factories with a rank greater or equal to minrank. The list of factories is returned by decreasing rank.

The function takes the following parameters:

  • minrank: minimum rank.

The function returns the following values:

  • list: a #GList of DeviceProviderFactory device providers. Use gst_plugin_feature_list_free() after usage.

func (*DeviceProviderFactory) DeviceProviderType

func (factory *DeviceProviderFactory) DeviceProviderType() coreglib.Type

DeviceProviderType: 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().

The function returns the following values:

  • gType for device providers managed by this factory.

func (*DeviceProviderFactory) Get

func (factory *DeviceProviderFactory) Get() DeviceProviderer

Get returns the device provider of the type defined by the given device providerfactory.

The function returns the following values:

  • deviceProvider (optional) or NULL if the device provider couldn't be created.

func (*DeviceProviderFactory) HasClasses

func (factory *DeviceProviderFactory) HasClasses(classes string) bool

HasClasses: check if factory matches all of the given classes.

The function takes the following parameters:

  • classes (optional): "/" separate list of classes to match, only match if all classes are matched.

The function returns the following values:

  • ok: TRUE if factory matches or if classes is NULL.

func (*DeviceProviderFactory) HasClassesv

func (factory *DeviceProviderFactory) HasClassesv(classes []string) bool

HasClassesv: check if factory matches all of the given classes.

The function takes the following parameters:

  • classes (optional): NULL terminated array of classes to match, only match if all classes are matched.

The function returns the following values:

  • ok: TRUE if factory matches.

func (*DeviceProviderFactory) Metadata

func (factory *DeviceProviderFactory) Metadata(key string) string

Metadata: get the metadata on factory with key.

The function takes the following parameters:

  • key: key.

The function returns the following values:

  • utf8 (optional): metadata with key on factory or NULL when there was no metadata with the given key.

func (*DeviceProviderFactory) MetadataKeys

func (factory *DeviceProviderFactory) MetadataKeys() []string

MetadataKeys: get the available keys for the metadata on factory.

The function returns the following values:

  • utf8s (optional): a NULL-terminated array of key strings, or NULL when there is no metadata. Free with g_strfreev() when no longer needed.

type DeviceProviderOverrides

type DeviceProviderOverrides struct {
	// Start starts providering the devices. This will cause
	// T_MESSAGE_DEVICE_ADDED and T_MESSAGE_DEVICE_REMOVED messages to be posted
	// on the provider's bus when devices are added or removed from the system.
	//
	// Since the DeviceProvider 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
	// T_MESSAGE_DEVICE_ADDED messages and will no longer probe.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the device providering could be started.
	//
	Start func() bool
	// Stop decreases the use-count by one. If the use count reaches zero, this
	// DeviceProvider will stop providering the devices. This needs to be called
	// the same number of times that gst_device_provider_start() was called.
	Stop func()
}

DeviceProviderOverrides contains methods that are overridable.

type DeviceProviderer

type DeviceProviderer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

DeviceProviderer describes types inherited from class DeviceProvider.

To get the original type, the caller must assert this to an interface or another type.

func DeviceProviderFactoryGetByName

func DeviceProviderFactoryGetByName(factoryname string) DeviceProviderer

DeviceProviderFactoryGetByName returns the device provider of the type defined by the given device provider factory.

The function takes the following parameters:

  • factoryname: named factory to instantiate.

The function returns the following values:

  • deviceProvider (optional) or NULL if unable to create device provider.

type Devicer

type Devicer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Devicer describes types inherited from class Device.

To get the original type, the caller must assert this to an interface or another type.

type DoubleRange

type DoubleRange struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

DoubleRange: fundamental type that describes a #gdouble range.

type DynamicTypeFactory

type DynamicTypeFactory struct {
	PluginFeature
	// contains filtered or unexported fields
}

DynamicTypeFactory 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

static gboolean
plugin_init (GstPlugin * plugin)
{
  return gst_dynamic_type_register (plugin, GST_TYPE_CUSTOM_CAPS_FIELD);
}.

type Element

type Element struct {
	GstObject
	// contains filtered or unexported fields
}

Element 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 Element subclasses.

The name of a Element 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 Pad). These pads link to pads on other elements. Buffer flow between these linked pads. A Element has a #GList of Pad 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 PadTemplate. 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 Caps. 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 State). 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 StateChange. To get a string representation of a State, use gst_element_state_get_name().

You can get and set a Clock on an element using gst_element_get_clock() and gst_element_set_clock(). Some elements can provide a clock for the pipeline if the T_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 T_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 Pipeline so the clock functions are only to be used in very specific situations.

func BaseElement

func BaseElement(obj Elementer) *Element

BaseElement returns the underlying base object.

func (*Element) AbortState

func (element *Element) AbortState()

AbortState: 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) AddPad

func (element *Element) AddPad(pad *Pad) bool

AddPad 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 Element::pad-added signal on the element.

The function takes the following parameters:

  • pad to add to the element.

The function returns the following values:

  • ok: TRUE if the pad could be added. This function can fail when a pad with the same name already existed or the pad already had another parent.

    MT safe.

func (*Element) AddPropertyDeepNotifyWatch

func (element *Element) AddPropertyDeepNotifyWatch(propertyName string, includeValue bool) uint32

The function takes the following parameters:

  • propertyName (optional): name of property to watch for changes, or NULL to watch all properties.
  • includeValue: whether to include the new property value in the message.

The function returns the following values:

  • gulong: watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.

func (*Element) AddPropertyNotifyWatch

func (element *Element) AddPropertyNotifyWatch(propertyName string, includeValue bool) uint32

The function takes the following parameters:

  • propertyName (optional): name of property to watch for changes, or NULL to watch all properties.
  • includeValue: whether to include the new property value in the message.

The function returns the following values:

  • gulong: watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.

func (*Element) BaseTime

func (element *Element) BaseTime() ClockTime

BaseTime 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.

The function returns the following values:

  • clockTime: base time of the element.

    MT safe.

func (*Element) Bus

func (element *Element) Bus() *Bus

Bus returns the bus of the element. Note that only a Pipeline will provide a bus for the application.

The function returns the following values:

  • bus (optional) element's Bus. unref after usage.

    MT safe.

func (*Element) CallAsync

func (element *Element) CallAsync(fn ElementCallAsyncFunc)

CallAsync 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.

The function takes the following parameters:

  • fn: function to call asynchronously from another thread.

func (*Element) ChangeState

func (element *Element) ChangeState(transition StateChange) StateChangeReturn

ChangeState: perform transition on element.

This function must be called with STATE_LOCK held and is mainly used internally.

The function takes the following parameters:

  • transition: requested transition.

The function returns the following values:

  • stateChangeReturn of the state transition.

func (*Element) Clock

func (element *Element) Clock() Clocker

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.

The function returns the following values:

  • clock (optional) of the element. unref after usage.

    MT safe.

func (*Element) CompatiblePad

func (element *Element) CompatiblePad(pad *Pad, caps *Caps) *Pad

CompatiblePad 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.

The function takes the following parameters:

  • pad to find a compatible one for.
  • caps (optional) to use as a filter.

The function returns the following values:

  • ret (optional) to which a link can be made, or NULL if one cannot be found. gst_object_unref() after usage.

func (*Element) CompatiblePadTemplate

func (element *Element) CompatiblePadTemplate(compattempl *PadTemplate) *PadTemplate

CompatiblePadTemplate retrieves a pad template from element that is compatible with compattempl. Pads from compatible templates can be linked together.

The function takes the following parameters:

  • compattempl to find a compatible template for.

The function returns the following values:

  • padTemplate (optional): compatible PadTemplate, or NULL if none was found. No unreferencing is necessary.

func (*Element) ConnectNoMorePads

func (element *Element) ConnectNoMorePads(f func()) coreglib.SignalHandle

ConnectNoMorePads: this signals that the element will not generate more dynamic pads. Note that this signal will usually be emitted from the context of the streaming thread.

func (*Element) ConnectPadAdded

func (element *Element) ConnectPadAdded(f func(newPad *Pad)) coreglib.SignalHandle

ConnectPadAdded: new Pad has been added to the element. Note that this signal will usually be emitted from the context of the streaming thread. Also keep in mind that if you add new elements to the pipeline in the signal handler you will need to set them to the desired target state with gst_element_set_state() or gst_element_sync_state_with_parent().

func (*Element) ConnectPadRemoved

func (element *Element) ConnectPadRemoved(f func(oldPad *Pad)) coreglib.SignalHandle

ConnectPadRemoved has been removed from the element.

func (*Element) Context

func (element *Element) Context(contextType string) *Context

Context gets the context with context_type set on the element or NULL.

MT safe.

The function takes the following parameters:

  • contextType: name of a context to retrieve.

The function returns the following values:

  • context (optional) or NULL.

func (*Element) ContextUnlocked

func (element *Element) ContextUnlocked(contextType string) *Context

ContextUnlocked gets the context with context_type set on the element or NULL.

The function takes the following parameters:

  • contextType: name of a context to retrieve.

The function returns the following values:

  • context (optional) or NULL.

func (*Element) Contexts

func (element *Element) Contexts() []*Context

Contexts gets the contexts set on the element.

MT safe.

The function returns the following values:

  • list: list of Context.

func (*Element) ContinueState

func (element *Element) ContinueState(ret StateChangeReturn) StateChangeReturn

ContinueState: 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.

The function takes the following parameters:

  • ret previous state return value.

The function returns the following values:

  • stateChangeReturn: result of the commit state change.

    MT safe.

func (*Element) CreateAllPads

func (element *Element) CreateAllPads()

CreateAllPads creates a pad for each pad template that is always available. This function is only useful during object initialization of subclasses of Element.

func (*Element) CurrentClockTime

func (element *Element) CurrentClockTime() ClockTime

CurrentClockTime 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.

The function returns the following values:

  • clockTime: clock time of the element, or GST_CLOCK_TIME_NONE if there is no clock.

func (*Element) CurrentRunningTime

func (element *Element) CurrentRunningTime() ClockTime

CurrentRunningTime 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.

The function returns the following values:

  • clockTime: running time of the element, or GST_CLOCK_TIME_NONE if the element has no clock or its base time has not been set.

func (*Element) Factory

func (element *Element) Factory() *ElementFactory

Factory retrieves the factory that was used to create this element.

The function returns the following values:

  • elementFactory (optional) used for creating this element or NULL if element has not been registered (static element). no refcounting is needed.

func (*Element) ForEachPad

func (element *Element) ForEachPad(fn ElementForEachPadFunc) bool

ForEachPad: 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.

The function takes the following parameters:

  • fn: function to call for each pad.

The function returns the following values:

  • ok: FALSE if element had no pads or if one of the calls to func returned FALSE.

func (*Element) ForEachSinkPad

func (element *Element) ForEachSinkPad(fn ElementForEachPadFunc) bool

ForEachSinkPad: 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.

The function takes the following parameters:

  • fn: function to call for each sink pad.

The function returns the following values:

  • ok: FALSE if element had no sink pads or if one of the calls to func returned FALSE.

func (*Element) ForEachSrcPad

func (element *Element) ForEachSrcPad(fn ElementForEachPadFunc) bool

ForEachSrcPad: 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.

The function takes the following parameters:

  • fn: function to call for each source pad.

The function returns the following values:

  • ok: FALSE if element had no source pads or if one of the calls to func returned FALSE.

func (*Element) GetRequestPad deprecated

func (element *Element) GetRequestPad(name string) *Pad

GetRequestPad: 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: Prefer using gst_element_request_pad_simple() which provides the exact same functionality.

The function takes the following parameters:

  • name of the request Pad to retrieve.

The function returns the following values:

  • pad (optional): requested Pad if found, otherwise NULL. Release after usage.

func (*Element) IsLockedState

func (element *Element) IsLockedState() bool

IsLockedState 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 T_STATE_NULL.

MT safe.

The function returns the following values:

  • ok: TRUE, if the element's state is locked.

func (*Element) IteratePads

func (element *Element) IteratePads() *Iterator

IteratePads 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.

The function returns the following values:

  • iterator of Pad.

    MT safe.

func (*Element) IterateSinkPads

func (element *Element) IterateSinkPads() *Iterator

IterateSinkPads 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.

The function returns the following values:

  • iterator of Pad.

    MT safe.

func (*Element) IterateSrcPads

func (element *Element) IterateSrcPads() *Iterator

IterateSrcPads 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.

The function returns the following values:

  • iterator of Pad.

    MT safe.

func (src *Element) Link(dest Elementer) bool

Link 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.

The function takes the following parameters:

  • dest containing the destination pad.

The function returns the following values:

  • ok: TRUE if the elements could be linked, FALSE otherwise.

func (*Element) LinkFiltered

func (src *Element) LinkFiltered(dest Elementer, filter *Caps) bool

LinkFiltered 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.

The function takes the following parameters:

  • dest containing the destination pad.
  • filter (optional) to filter the link, or NULL for no filter.

The function returns the following values:

  • ok: TRUE if the pads could be linked, FALSE otherwise.

func (*Element) LinkPads

func (src *Element) LinkPads(srcpadname string, dest Elementer, destpadname string) bool

LinkPads 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.

The function takes the following parameters:

  • srcpadname (optional): name of the Pad in source element or NULL for any pad.
  • dest containing the destination pad.
  • destpadname (optional): name of the Pad in destination element, or NULL for any pad.

The function returns the following values:

  • ok: TRUE if the pads could be linked, FALSE otherwise.

func (*Element) LinkPadsFiltered

func (src *Element) LinkPadsFiltered(srcpadname string, dest Elementer, destpadname string, filter *Caps) bool

LinkPadsFiltered 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.

The function takes the following parameters:

  • srcpadname (optional): name of the Pad in source element or NULL for any pad.
  • dest containing the destination pad.
  • destpadname (optional): name of the Pad in destination element or NULL for any pad.
  • filter (optional) to filter the link, or NULL for no filter.

The function returns the following values:

  • ok: TRUE if the pads could be linked, FALSE otherwise.

func (*Element) LinkPadsFull

func (src *Element) LinkPadsFull(srcpadname string, dest Elementer, destpadname string, flags PadLinkCheck) bool

LinkPadsFull 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().

The function takes the following parameters:

  • srcpadname (optional): name of the Pad in source element or NULL for any pad.
  • dest containing the destination pad.
  • destpadname (optional): name of the Pad in destination element, or NULL for any pad.
  • flags to be performed when linking pads.

The function returns the following values:

  • ok: TRUE if the pads could be linked, FALSE otherwise.

func (*Element) LostState

func (element *Element) LostState()

LostState 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) MessageFull

func (element *Element) MessageFull(typ MessageType, domain glib.Quark, code int, text, debug, file, function string, line int)

MessageFull: post an error, warning or info message on the bus from inside an element.

type must be of T_MESSAGE_ERROR, T_MESSAGE_WARNING or T_MESSAGE_INFO.

MT safe.

The function takes the following parameters:

  • typ: MessageType.
  • domain: GStreamer GError domain this message belongs to.
  • code: GError code belonging to the domain.
  • text (optional): allocated text string to be used as a replacement for the default message connected to code, or NULL.
  • debug (optional): allocated debug message to be used as a replacement for the default debugging information, or NULL.
  • file: source code file where the error was generated.
  • function: source code function where the error was generated.
  • line: source code line where the error was generated.

func (*Element) MessageFullWithDetails

func (element *Element) MessageFullWithDetails(typ MessageType, domain glib.Quark, code int, text, debug, file, function string, line int, structure *Structure)

MessageFullWithDetails: post an error, warning or info message on the bus from inside an element.

type must be of T_MESSAGE_ERROR, T_MESSAGE_WARNING or T_MESSAGE_INFO.

The function takes the following parameters:

  • typ: MessageType.
  • domain: GStreamer GError domain this message belongs to.
  • code: GError code belonging to the domain.
  • text (optional): allocated text string to be used as a replacement for the default message connected to code, or NULL.
  • debug (optional): allocated debug message to be used as a replacement for the default debugging information, or NULL.
  • file: source code file where the error was generated.
  • function: source code function where the error was generated.
  • line: source code line where the error was generated.
  • structure: optional details structure.

func (*Element) Metadata

func (element *Element) Metadata(key string) string

Metadata: get metadata with key in klass.

The function takes the following parameters:

  • key to get.

The function returns the following values:

  • utf8: metadata for key.

func (*Element) NoMorePads

func (element *Element) NoMorePads()

NoMorePads: 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 T_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 Element::no-more-pads signal.

MT safe.

func (*Element) PadTemplate

func (element *Element) PadTemplate(name string) *PadTemplate

PadTemplate retrieves a padtemplate from element with the given name.

The function takes the following parameters:

  • name of the PadTemplate to get.

The function returns the following values:

  • padTemplate (optional) with the given name, or NULL if none was found. No unreferencing is necessary.

func (*Element) PadTemplateList

func (element *Element) PadTemplateList() []*PadTemplate

PadTemplateList retrieves a list of the pad templates associated with element. The list must not be modified by the calling code.

The function returns the following values:

  • list of pad templates.

func (*Element) PostMessage

func (element *Element) PostMessage(message *Message) bool

PostMessage: post a message on the element's Bus. 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.

The function takes the following parameters:

  • message to post.

The function returns the following values:

  • ok: TRUE if the message was successfully posted. The function returns FALSE if the element did not have a bus.

    MT safe.

func (*Element) ProvideClock

func (element *Element) ProvideClock() Clocker

ProvideClock: get the clock provided by the given element. > An element is only required to provide a clock in the PAUSED > state. Some elements can provide a clock in other states.

The function returns the following values:

  • clock (optional): gstClock provided by the element or NULL if no clock could be provided. Unref after usage.

    MT safe.

func (*Element) Query

func (element *Element) Query(query *Query) bool

Query 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.

The function takes the following parameters:

  • query: Query.

The function returns the following values:

  • ok: TRUE if the query could be performed.

    MT safe.

func (*Element) QueryConvert

func (element *Element) QueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool)

QueryConvert queries an element to convert src_val in src_format to dest_format.

The function takes the following parameters:

  • srcFormat to convert from.
  • srcVal: value to convert.
  • destFormat to convert to.

The function returns the following values:

  • destVal: pointer to the result.
  • ok: TRUE if the query could be performed.

func (*Element) QueryDuration

func (element *Element) QueryDuration(format Format) (int64, bool)

QueryDuration 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.

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • duration (optional): location in which to store the total duration, or NULL.
  • ok: TRUE if the query could be performed.

func (*Element) QueryPosition

func (element *Element) QueryPosition(format Format) (int64, bool)

QueryPosition 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().

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • cur (optional): location in which to store the current position, or NULL.
  • ok: TRUE if the query could be performed.

func (*Element) ReleaseRequestPad

func (element *Element) ReleaseRequestPad(pad *Pad)

ReleaseRequestPad 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.

The function takes the following parameters:

  • pad to release.

func (*Element) RemovePad

func (element *Element) RemovePad(pad *Pad) bool

RemovePad 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 Element::pad-removed signal on the element.

The function takes the following parameters:

  • pad to remove from the element.

The function returns the following values:

  • ok: TRUE if the pad could be removed. Can return FALSE if the pad does not belong to the provided element.

    MT safe.

func (*Element) RemovePropertyNotifyWatch

func (element *Element) RemovePropertyNotifyWatch(watchId uint32)

The function takes the following parameters:

  • watchId: watch id to remove.

func (*Element) RequestPad

func (element *Element) RequestPad(templ *PadTemplate, name string, caps *Caps) *Pad

RequestPad 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().

The function takes the following parameters:

  • templ of which we want a pad of.
  • name (optional) of the request Pad to retrieve. Can be NULL.
  • caps (optional) of the pad we want to request. Can be NULL.

The function returns the following values:

  • pad (optional): requested Pad if found, otherwise NULL. Release after usage.

func (*Element) RequestPadSimple

func (element *Element) RequestPadSimple(name string) *Pad

RequestPadSimple 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.

The function takes the following parameters:

  • name of the request Pad to retrieve.

The function returns the following values:

  • pad (optional): requested Pad if found, otherwise NULL. Release after usage.

func (*Element) Seek

func (element *Element) Seek(rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64) bool

Seek 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.

The function takes the following parameters:

  • rate: new playback rate.
  • format of the seek values.
  • flags: optional seek flags.
  • startType: type and flags for the new start position.
  • start: value of the new start position.
  • stopType: type and flags for the new stop position.
  • stop: value of the new stop position.

The function returns the following values:

  • ok: TRUE if the event was handled. Flushing seeks will trigger a preroll, which will emit GST_MESSAGE_ASYNC_DONE.

func (*Element) SeekSimple

func (element *Element) SeekSimple(format Format, seekFlags SeekFlags, seekPos int64) bool

SeekSimple: 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.

The function takes the following parameters:

  • format to execute the seek in, such as T_FORMAT_TIME.
  • seekFlags: seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here.
  • seekPos: position to seek to (relative to the start); if you are doing a seek in T_FORMAT_TIME this value is in nanoseconds - multiply with T_SECOND to convert seconds to nanoseconds or with T_MSECOND to convert milliseconds to nanoseconds.

The function returns the following values:

  • ok: TRUE if the seek operation succeeded. Flushing seeks will trigger a preroll, which will emit GST_MESSAGE_ASYNC_DONE.

func (*Element) SendEvent

func (element *Element) SendEvent(event *Event) bool

SendEvent 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.

The function takes the following parameters:

  • event to send to the element.

The function returns the following values:

  • ok: TRUE if the event was handled. Events that trigger a preroll (such as flushing seeks and steps) will emit GST_MESSAGE_ASYNC_DONE.

func (*Element) SetBaseTime

func (element *Element) SetBaseTime(time ClockTime)

SetBaseTime: set the base time of an element. See gst_element_get_base_time().

MT safe.

The function takes the following parameters:

  • time: base time to set.

func (*Element) SetBus

func (element *Element) SetBus(bus *Bus)

SetBus sets the bus of the element. Increases the refcount on the bus. For internal use only, unless you're testing elements.

MT safe.

The function takes the following parameters:

  • bus (optional) to set.

func (*Element) SetClock

func (element *Element) SetClock(clock Clocker) bool

SetClock sets the clock for the element. This function increases the refcount on the clock. Any previously set clock on the object is unreffed.

The function takes the following parameters:

  • clock (optional) to set for the element.

The function returns the following values:

  • ok: TRUE if the element accepted the clock. An element can refuse a clock when it, for example, is not able to slave its internal clock to the clock or when it requires a specific clock to operate.

    MT safe.

func (*Element) SetContext

func (element *Element) SetContext(context *Context)

SetContext sets the context of the element. Increases the refcount of the context.

MT safe.

The function takes the following parameters:

  • context to set.

func (*Element) SetLockedState

func (element *Element) SetLockedState(lockedState bool) bool

SetLockedState 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.

The function takes the following parameters:

  • lockedState: TRUE to lock the element's state.

The function returns the following values:

  • ok: TRUE if the state was changed, FALSE if bad parameters were given or the elements state-locking needed no change.

func (*Element) SetStartTime

func (element *Element) SetStartTime(time ClockTime)

SetStartTime: 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 Pipeline will manage the start_time and base_time on its children. Setting the start_time to T_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.

The function takes the following parameters:

  • time: base time to set.

func (*Element) SetState

func (element *Element) SetState(state State) StateChangeReturn

SetState 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 T_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 T_STATE_CHANGE_ASYNC.

The function takes the following parameters:

  • state element's new State.

The function returns the following values:

  • stateChangeReturn: result of the state change using StateChangeReturn.

    MT safe.

func (*Element) StartTime

func (element *Element) StartTime() ClockTime

StartTime 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 Pipeline.

MT safe.

The function returns the following values:

  • clockTime: start time of the element.

func (*Element) State

func (element *Element) State(timeout ClockTime) (state, pending State, stateChangeReturn StateChangeReturn)

State 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.

The function takes the following parameters:

  • timeout to specify the timeout for an async state change or GST_CLOCK_TIME_NONE for infinite timeout.

The function returns the following values:

  • state (optional): pointer to State to hold the state. Can be NULL.

  • pending (optional): pointer to State to hold the pending state. Can be NULL.

  • stateChangeReturn: GST_STATE_CHANGE_SUCCESS if the element has no more pending state and the last state change succeeded, GST_STATE_CHANGE_ASYNC if the element is still performing a state change or GST_STATE_CHANGE_FAILURE if the last state change failed.

    MT safe.

func (*Element) StaticPad

func (element *Element) StaticPad(name string) *Pad

StaticPad retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

The function takes the following parameters:

  • name of the static Pad to retrieve.

The function returns the following values:

  • pad (optional): requested Pad if found, otherwise NULL. unref after usage.

    MT safe.

func (*Element) SyncStateWithParent

func (element *Element) SyncStateWithParent() bool

SyncStateWithParent 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.

The function returns the following values:

  • ok: TRUE, if the element's state could be synced to the parent's state.

    MT safe.

func (src *Element) Unlink(dest Elementer)

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().

The function takes the following parameters:

  • dest: sink Element to unlink.

func (*Element) UnlinkPads

func (src *Element) UnlinkPads(srcpadname string, dest Elementer, destpadname string)

UnlinkPads unlinks the two named pads of the source and destination elements.

This is a convenience function for gst_pad_unlink().

The function takes the following parameters:

  • srcpadname: name of the Pad in source element.
  • dest containing the destination pad.
  • destpadname: name of the Pad in destination element.

type ElementCallAsyncFunc

type ElementCallAsyncFunc func(element Elementer)

ElementCallAsyncFunc: callback prototype used in #gst_element_call_async.

type ElementClass

type ElementClass struct {
	// contains filtered or unexported fields
}

ElementClass: GStreamer element class. Override the vmethods to implement the element functionality.

An instance of this type is always passed by reference.

func (*ElementClass) AddMetadata

func (klass *ElementClass) AddMetadata(key string, value string)

AddMetadata: set key with value as metadata in klass.

The function takes the following parameters:

  • key to set.
  • value to set.

func (*ElementClass) AddPadTemplate

func (klass *ElementClass) AddPadTemplate(templ *PadTemplate)

AddPadTemplate 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()).

The function takes the following parameters:

  • templ to add to the element class.

func (*ElementClass) AddStaticMetadata

func (klass *ElementClass) AddStaticMetadata(key string, value string)

AddStaticMetadata: 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.).

The function takes the following parameters:

  • key to set.
  • value to set.

func (*ElementClass) AddStaticPadTemplate

func (klass *ElementClass) AddStaticPadTemplate(staticTempl *StaticPadTemplate)

AddStaticPadTemplate 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.

The function takes the following parameters:

  • staticTempl to add as pad template to the element class.

func (*ElementClass) AddStaticPadTemplateWithGType

func (klass *ElementClass) AddStaticPadTemplateWithGType(staticTempl *StaticPadTemplate, padType coreglib.Type)

AddStaticPadTemplateWithGType 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.

The function takes the following parameters:

  • staticTempl to add as pad template to the element class.
  • padType of the pad to create.

func (*ElementClass) Elementfactory

func (e *ElementClass) Elementfactory() *ElementFactory

Elementfactory that creates these elements.

func (*ElementClass) Metadata

func (klass *ElementClass) Metadata(key string) string

Metadata: get metadata with key in klass.

The function takes the following parameters:

  • key to get.

The function returns the following values:

  • utf8: metadata for key.

func (*ElementClass) Numpadtemplates

func (e *ElementClass) Numpadtemplates() int

Numpadtemplates: number of padtemplates.

func (*ElementClass) PadTemplCookie

func (e *ElementClass) PadTemplCookie() uint32

PadTemplCookie: changed whenever the padtemplates change.

func (*ElementClass) PadTemplate

func (elementClass *ElementClass) PadTemplate(name string) *PadTemplate

PadTemplate retrieves a padtemplate from element_class with the given name. > If you use this function in the InitFunc of an object class > that has subclasses, make sure to pass the g_class parameter of the > InitFunc here.

The function takes the following parameters:

  • name of the PadTemplate to get.

The function returns the following values:

  • padTemplate (optional) with the given name, or NULL if none was found. No unreferencing is necessary.

func (*ElementClass) PadTemplateList

func (elementClass *ElementClass) PadTemplateList() []*PadTemplate

PadTemplateList retrieves a list of the pad templates associated with element_class. The list must not be modified by the calling code. > If you use this function in the InitFunc of an object class > that has subclasses, make sure to pass the g_class parameter of the > InitFunc here.

The function returns the following values:

  • list of pad templates.

func (*ElementClass) ParentClass

func (e *ElementClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

func (*ElementClass) SetMetadata

func (klass *ElementClass) SetMetadata(longname string, classification string, description string, author string)

SetMetadata sets the detailed information for a ElementClass. > This function is for use in _class_init functions only.

The function takes the following parameters:

  • longname: long English name of the element. E.g. "File Sink".
  • classification: 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: sentence describing the purpose of the element. E.g: "Write stream to a file".
  • author: name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;".

func (*ElementClass) SetStaticMetadata

func (klass *ElementClass) SetStaticMetadata(longname string, classification string, description string, author string)

SetStaticMetadata sets the detailed information for a ElementClass.

> 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.).

The function takes the following parameters:

  • longname: long English name of the element. E.g. "File Sink".
  • classification: 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: sentence describing the purpose of the element. E.g: "Write stream to a file".
  • author: name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;".

type ElementFactory

type ElementFactory struct {
	PluginFeature
	// contains filtered or unexported fields
}

ElementFactory is used to create instances of elements. A GstElementFactory can be added to a Plugin as it is also a PluginFeature.

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

#include <gst/gst.h>

GstElement *src;
GstElementFactory *srcfactory;

gst_init (&argc, &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);
...

func ElementFactoryFind

func ElementFactoryFind(name string) *ElementFactory

ElementFactoryFind: search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.

The function takes the following parameters:

  • name of factory to find.

The function returns the following values:

  • elementFactory (optional) if found, NULL otherwise.

func ElementFactoryListFilter

func ElementFactoryListFilter(list []*ElementFactory, caps *Caps, direction PadDirection, subsetonly bool) []*ElementFactory

ElementFactoryListFilter: filter out all the elementfactories in list that can handle caps in the given direction.

If subsetonly is TRUE, then only the elements whose pads templates are a complete superset of caps will be returned. Else any element whose pad templates caps can intersect with caps will be returned.

The function takes the following parameters:

  • list of ElementFactory to filter.
  • caps: Caps.
  • direction to filter on.
  • subsetonly: whether to filter on caps subsets or not.

The function returns the following values:

  • ret of ElementFactory elements that match the given requisites. Use #gst_plugin_feature_list_free after usage.

func ElementFactoryListGetElements

func ElementFactoryListGetElements(typ ElementFactoryListType, minrank Rank) []*ElementFactory

ElementFactoryListGetElements: get a list of factories that match the given type. Only elements with a rank greater or equal to minrank will be returned. The list of factories is returned by decreasing rank.

The function takes the following parameters:

  • typ: ElementFactoryListType.
  • minrank: minimum rank.

The function returns the following values:

  • list of ElementFactory elements. Use gst_plugin_feature_list_free() after usage.

func (*ElementFactory) CanSinkAllCaps

func (factory *ElementFactory) CanSinkAllCaps(caps *Caps) bool

CanSinkAllCaps checks if the factory can sink all possible capabilities.

The function takes the following parameters:

  • caps to check.

The function returns the following values:

  • ok: TRUE if the caps are fully compatible.

func (*ElementFactory) CanSinkAnyCaps

func (factory *ElementFactory) CanSinkAnyCaps(caps *Caps) bool

CanSinkAnyCaps checks if the factory can sink any possible capability.

The function takes the following parameters:

  • caps to check.

The function returns the following values:

  • ok: TRUE if the caps have a common subset.

func (*ElementFactory) CanSrcAllCaps

func (factory *ElementFactory) CanSrcAllCaps(caps *Caps) bool

CanSrcAllCaps checks if the factory can src all possible capabilities.

The function takes the following parameters:

  • caps to check.

The function returns the following values:

  • ok: TRUE if the caps are fully compatible.

func (*ElementFactory) CanSrcAnyCaps

func (factory *ElementFactory) CanSrcAnyCaps(caps *Caps) bool

CanSrcAnyCaps checks if the factory can src any possible capability.

The function takes the following parameters:

  • caps to check.

The function returns the following values:

  • ok: TRUE if the caps have a common subset.

func (*ElementFactory) Create

func (factory *ElementFactory) Create(name string) Elementer

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.

The function takes the following parameters:

  • name (optional) of new element, or NULL to automatically create a unique name.

The function returns the following values:

  • element (optional): new Element or NULL if the element couldn't be created.

func (*ElementFactory) CreateWithProperties

func (factory *ElementFactory) CreateWithProperties(names []string, values []coreglib.Value) Elementer

CreateWithProperties: create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.

The function takes the following parameters:

  • names (optional): array of properties names.
  • values (optional): array of associated properties values.

The function returns the following values:

  • element (optional): new Element or NULL if the element couldn't be created.

func (*ElementFactory) ElementType

func (factory *ElementFactory) ElementType() coreglib.Type

ElementType: 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().

The function returns the following values:

  • gType for elements managed by this factory or 0 if the factory is not loaded.

func (*ElementFactory) HasInterface

func (factory *ElementFactory) HasInterface(interfacename string) bool

HasInterface: check if factory implements the interface with name interfacename.

The function takes the following parameters:

  • interfacename: interface name.

The function returns the following values:

  • ok: TRUE when factory implement the interface.

func (*ElementFactory) ListIsType

func (factory *ElementFactory) ListIsType(typ ElementFactoryListType) bool

ListIsType: check if factory is of the given types.

The function takes the following parameters:

  • typ: ElementFactoryListType.

The function returns the following values:

  • ok: TRUE if factory is of type.

func (*ElementFactory) Metadata

func (factory *ElementFactory) Metadata(key string) string

Metadata: get the metadata on factory with key.

The function takes the following parameters:

  • key: key.

The function returns the following values:

  • utf8 (optional): metadata with key on factory or NULL when there was no metadata with the given key.

func (*ElementFactory) MetadataKeys

func (factory *ElementFactory) MetadataKeys() []string

MetadataKeys: get the available keys for the metadata on factory.

The function returns the following values:

  • utf8s (optional): a NULL-terminated array of key strings, or NULL when there is no metadata. Free with g_strfreev() when no longer needed.

func (*ElementFactory) NumPadTemplates

func (factory *ElementFactory) NumPadTemplates() uint

NumPadTemplates gets the number of pad_templates in this factory.

The function returns the following values:

  • guint: number of pad_templates.

func (*ElementFactory) SkipDocumentation

func (factory *ElementFactory) SkipDocumentation() bool

SkipDocumentation queries whether registered element managed by factory needs to be excluded from documentation system or not.

The function returns the following values:

  • ok: TRUE if documentation should be skipped.

func (*ElementFactory) StaticPadTemplates

func (factory *ElementFactory) StaticPadTemplates() []*StaticPadTemplate

StaticPadTemplates gets the #GList of StaticPadTemplate for this factory.

The function returns the following values:

  • list: the static pad templates.

func (*ElementFactory) URIProtocols

func (factory *ElementFactory) URIProtocols() []string

URIProtocols 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.

The function returns the following values:

  • utf8s: supported protocols or NULL.

func (*ElementFactory) URIType

func (factory *ElementFactory) URIType() URIType

URIType gets the type of URIs the element supports or T_URI_UNKNOWN if none.

The function returns the following values:

  • uriType: type of URIs this element supports.

type ElementFactoryListType

type ElementFactoryListType = uint64

ElementFactoryListType: type defining the type of an element factory.

type ElementFlags

type ElementFlags C.guint

ElementFlags: standard flags that an element may have.

const (
	// ElementFlagLockedState: ignore state changes from parent.
	ElementFlagLockedState ElementFlags = 0b10000
	// ElementFlagSink: element is a sink.
	ElementFlagSink ElementFlags = 0b100000
	// ElementFlagSource: element is a source.
	ElementFlagSource ElementFlags = 0b1000000
	// ElementFlagProvideClock: element can provide a clock.
	ElementFlagProvideClock ElementFlags = 0b10000000
	// ElementFlagRequireClock: element requires a clock.
	ElementFlagRequireClock ElementFlags = 0b100000000
	// ElementFlagIndexable: element can use an index.
	ElementFlagIndexable ElementFlags = 0b1000000000
	// ElementFlagLast: offset to define more flags.
	ElementFlagLast ElementFlags = 0b100000000000000
)

func (ElementFlags) Has

func (e ElementFlags) Has(other ElementFlags) bool

Has returns true if e contains other.

func (ElementFlags) String

func (e ElementFlags) String() string

String returns the names in string for ElementFlags.

type ElementForEachPadFunc

type ElementForEachPadFunc func(element Elementer, pad *Pad) (ok bool)

ElementForEachPadFunc: function called for each pad when using gst_element_foreach_sink_pad(), gst_element_foreach_src_pad(), or gst_element_foreach_pad().

type ElementOverrides

type ElementOverrides struct {
	// ChangeState: perform transition on element.
	//
	// This function must be called with STATE_LOCK held and is mainly used
	// internally.
	//
	// The function takes the following parameters:
	//
	//    - transition: requested transition.
	//
	// The function returns the following values:
	//
	//    - stateChangeReturn of the state transition.
	//
	ChangeState func(transition StateChange) StateChangeReturn
	// State 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.
	//
	// The function takes the following parameters:
	//
	//    - timeout to specify the timeout for an async state change or
	//      GST_CLOCK_TIME_NONE for infinite timeout.
	//
	// The function returns the following values:
	//
	//    - state (optional): pointer to State to hold the state. Can be NULL.
	//    - pending (optional): pointer to State to hold the pending state. Can
	//      be NULL.
	//    - stateChangeReturn: GST_STATE_CHANGE_SUCCESS if the element has no
	//      more pending state and the last state change succeeded,
	//      GST_STATE_CHANGE_ASYNC if the element is still performing a state
	//      change or GST_STATE_CHANGE_FAILURE if the last state change failed.
	//
	//      MT safe.
	//
	State func(timeout ClockTime) (state, pending State, stateChangeReturn StateChangeReturn)
	// NoMorePads: 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
	// T_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 Element::no-more-pads signal.
	//
	// MT safe.
	NoMorePads func()
	// The function takes the following parameters:
	//
	PadAdded func(pad *Pad)
	// The function takes the following parameters:
	//
	PadRemoved func(pad *Pad)
	// PostMessage: post a message on the element's Bus. 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.
	//
	// The function takes the following parameters:
	//
	//    - message to post.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the message was successfully posted. The function returns
	//      FALSE if the element did not have a bus.
	//
	//      MT safe.
	//
	PostMessage func(message *Message) bool
	// ProvideClock: get the clock provided by the given element. > An element
	// is only required to provide a clock in the PAUSED > state. Some elements
	// can provide a clock in other states.
	//
	// The function returns the following values:
	//
	//    - clock (optional): gstClock provided by the element or NULL if no
	//      clock could be provided. Unref after usage.
	//
	//      MT safe.
	//
	ProvideClock func() Clocker
	// Query 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.
	//
	// The function takes the following parameters:
	//
	//    - query: Query.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the query could be performed.
	//
	//      MT safe.
	//
	Query func(query *Query) bool
	// The function takes the following parameters:
	//
	ReleasePad func(pad *Pad)
	// SendEvent 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.
	//
	// The function takes the following parameters:
	//
	//    - event to send to the element.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the event was handled. Events that trigger a preroll
	//      (such as flushing seeks and steps) will emit GST_MESSAGE_ASYNC_DONE.
	//
	SendEvent func(event *Event) bool
	// SetBus sets the bus of the element. Increases the refcount on the bus.
	// For internal use only, unless you're testing elements.
	//
	// MT safe.
	//
	// The function takes the following parameters:
	//
	//    - bus (optional) to set.
	//
	SetBus func(bus *Bus)
	// SetClock sets the clock for the element. This function increases the
	// refcount on the clock. Any previously set clock on the object is
	// unreffed.
	//
	// The function takes the following parameters:
	//
	//    - clock (optional) to set for the element.
	//
	// The function returns the following values:
	//
	//    - ok: TRUE if the element accepted the clock. An element can refuse a
	//      clock when it, for example, is not able to slave its internal clock
	//      to the clock or when it requires a specific clock to operate.
	//
	//      MT safe.
	//
	SetClock func(clock Clocker) bool
	// SetContext sets the context of the element. Increases the refcount of the
	// context.
	//
	// MT safe.
	//
	// The function takes the following parameters:
	//
	//    - context to set.
	//
	SetContext func(context *Context)
	// SetState 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 T_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
	// T_STATE_CHANGE_ASYNC.
	//
	// The function takes the following parameters:
	//
	//    - state element's new State.
	//
	// The function returns the following values:
	//
	//    - stateChangeReturn: result of the state change using
	//      StateChangeReturn.
	//
	//      MT safe.
	//
	SetState func(state State) StateChangeReturn
	// The function takes the following parameters:
	//
	//    - oldstate
	//    - newstate
	//    - pending
	//
	StateChanged func(oldstate, newstate, pending State)
}

ElementOverrides contains methods that are overridable.

type Elementer

type Elementer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Elementer describes types inherited from class Element.

To get the original type, the caller must assert this to an interface or another type.

func ElementFactoryMake

func ElementFactoryMake(factoryname, name string) Elementer

ElementFactoryMake: 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.

The function takes the following parameters:

  • factoryname: named factory to instantiate.
  • name (optional) of new element, or NULL to automatically create a unique name.

The function returns the following values:

  • element (optional): new Element or NULL if unable to create element.

func ElementFactoryMakeWithProperties

func ElementFactoryMakeWithProperties(factoryname string, names []string, values []coreglib.Value) Elementer

ElementFactoryMakeWithProperties: create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.

The function takes the following parameters:

  • factoryname: named factory to instantiate.
  • names (optional): array of properties names.
  • values (optional): array of associated properties values.

The function returns the following values:

  • element (optional): new Element or NULL if the element couldn't be created.

func ElementMakeFromURI

func ElementMakeFromURI(typ URIType, uri, elementname string) (Elementer, error)

ElementMakeFromURI creates an element for handling the given URI.

The function takes the following parameters:

  • typ: whether to create a source or a sink.
  • uri: URI to create an element for.
  • elementname (optional): name of created element, can be NULL.

The function returns the following values:

  • element: new element or NULL if none could be created.

func ParseBinFromDescriptionFull

func ParseBinFromDescriptionFull(binDescription string, ghostUnlinkedPads bool, context *ParseContext, flags ParseFlags) (Elementer, error)

ParseBinFromDescriptionFull: this is a convenience wrapper around gst_parse_launch() to create a Bin 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).

The function takes the following parameters:

  • binDescription: command line describing the bin.
  • ghostUnlinkedPads: whether to automatically create ghost pads for unlinked source or sink pads within the bin.
  • context (optional): parse context allocated with gst_parse_context_new(), or NULL.
  • flags: parsing options, or T_PARSE_FLAG_NONE.

The function returns the following values:

  • element: newly-created element, which is guaranteed to be a bin unless T_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS was passed, or NULL if an error occurred.

func ParseLaunch

func ParseLaunch(pipelineDescription string) (Elementer, error)

ParseLaunch: 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().

The function takes the following parameters:

  • pipelineDescription: command line describing the pipeline.

The function returns the following values:

  • element: new element on success, NULL on failure. If more than one toplevel element is specified by the pipeline_description, all elements are put into a Pipeline, which than is returned.

func ParseLaunchFull

func ParseLaunchFull(pipelineDescription string, context *ParseContext, flags ParseFlags) (Elementer, error)

ParseLaunchFull: 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().

The function takes the following parameters:

  • pipelineDescription: command line describing the pipeline.
  • context (optional): parse context allocated with gst_parse_context_new(), or NULL.
  • flags: parsing options, or T_PARSE_FLAG_NONE.

The function returns the following values:

  • element: new element on success, NULL on failure. If more than one toplevel element is specified by the pipeline_description, all elements are put into a Pipeline, which then is returned (unless the GST_PARSE_FLAG_PLACE_IN_BIN flag is set, in which case they are put in a Bin instead).

func ParseLaunchv

func ParseLaunchv(argv []string) (Elementer, error)

ParseLaunchv: create a new element based on command line syntax. error will contain an error message if an erroneous pipeline is specified. An error does not mean that the pipeline could not be constructed.

The function takes the following parameters:

  • argv: null-terminated array of arguments.

The function returns the following values:

  • element: new element on success and NULL on failure.

func ParseLaunchvFull

func ParseLaunchvFull(argv []string, context *ParseContext, flags ParseFlags) (Elementer, error)

ParseLaunchvFull: create a new element based on command line syntax. error will contain an error message if an erroneous pipeline is specified. An error does not mean that the pipeline could not be constructed.

The function takes the following parameters:

  • argv: null-terminated array of arguments.
  • context (optional): parse context allocated with gst_parse_context_new(), or NULL.
  • flags: parsing options, or T_PARSE_FLAG_NONE.

The function returns the following values:

  • element: new element on success; on failure, either NULL or a partially-constructed bin or element will be returned and error will be set (unless you passed T_PARSE_FLAG_FATAL_ERRORS in flags, then NULL will always be returned on failure).

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event: 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.

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");
...

An instance of this type is always passed by reference.

func NewEventBufferSize

func NewEventBufferSize(format Format, minsize int64, maxsize int64, async bool) *Event

NewEventBufferSize constructs a struct Event.

func NewEventCaps

func NewEventCaps(caps *Caps) *Event

NewEventCaps constructs a struct Event.

func NewEventCustom

func NewEventCustom(typ EventType, structure *Structure) *Event

NewEventCustom constructs a struct Event.

func NewEventEos

func NewEventEos() *Event

NewEventEos constructs a struct Event.

func NewEventFlushStart

func NewEventFlushStart() *Event

NewEventFlushStart constructs a struct Event.

func NewEventFlushStop

func NewEventFlushStop(resetTime bool) *Event

NewEventFlushStop constructs a struct Event.

func NewEventGap

func NewEventGap(timestamp ClockTime, duration ClockTime) *Event

NewEventGap constructs a struct Event.

func NewEventInstantRateChange

func NewEventInstantRateChange(rateMultiplier float64, newFlags SegmentFlags) *Event

NewEventInstantRateChange constructs a struct Event.

func NewEventInstantRateSyncTime

func NewEventInstantRateSyncTime(rateMultiplier float64, runningTime ClockTime, upstreamRunningTime ClockTime) *Event

NewEventInstantRateSyncTime constructs a struct Event.

func NewEventLatency

func NewEventLatency(latency ClockTime) *Event

NewEventLatency constructs a struct Event.

func NewEventNavigation

func NewEventNavigation(structure *Structure) *Event

NewEventNavigation constructs a struct Event.

func NewEventProtection

func NewEventProtection(systemId string, data *Buffer, origin string) *Event

NewEventProtection constructs a struct Event.

func NewEventQos

func NewEventQos(typ QOSType, proportion float64, diff ClockTimeDiff, timestamp ClockTime) *Event

NewEventQos constructs a struct Event.

func NewEventReconfigure

func NewEventReconfigure() *Event

NewEventReconfigure constructs a struct Event.

func NewEventSeek

func NewEventSeek(rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64) *Event

NewEventSeek constructs a struct Event.

func NewEventSegment

func NewEventSegment(segment *Segment) *Event

NewEventSegment constructs a struct Event.

func NewEventSegmentDone

func NewEventSegmentDone(format Format, position int64) *Event

NewEventSegmentDone constructs a struct Event.

func NewEventSelectStreams

func NewEventSelectStreams(streams []string) *Event

NewEventSelectStreams constructs a struct Event.

func NewEventSinkMessage

func NewEventSinkMessage(name string, msg *Message) *Event

NewEventSinkMessage constructs a struct Event.

func NewEventStep

func NewEventStep(format Format, amount uint64, rate float64, flush bool, intermediate bool) *Event

NewEventStep constructs a struct Event.

func NewEventStreamCollection

func NewEventStreamCollection(collection *StreamCollection) *Event

NewEventStreamCollection constructs a struct Event.

func NewEventStreamGroupDone

func NewEventStreamGroupDone(groupId uint) *Event

NewEventStreamGroupDone constructs a struct Event.

func NewEventStreamStart

func NewEventStreamStart(streamId string) *Event

NewEventStreamStart constructs a struct Event.

func NewEventToc

func NewEventToc(toc *Toc, updated bool) *Event

NewEventToc constructs a struct Event.

func NewEventTocSelect

func NewEventTocSelect(uid string) *Event

NewEventTocSelect constructs a struct Event.

func (*Event) CopySegment

func (event *Event) CopySegment(segment *Segment)

CopySegment parses a segment event and copies the Segment into the location given by segment.

The function takes the following parameters:

  • segment: pointer to a Segment.

func (*Event) HasName

func (event *Event) HasName(name string) bool

HasName checks if event has the given name. This function is usually used to check the name of a custom event.

The function takes the following parameters:

  • name to check.

The function returns the following values:

  • ok: TRUE if name matches the name of the event structure.

func (*Event) HasNameID

func (event *Event) HasNameID(name glib.Quark) bool

HasNameID checks if event has the given name. This function is usually used to check the name of a custom event.

The function takes the following parameters:

  • name to check as a GQuark.

The function returns the following values:

  • ok: TRUE if name matches the name of the event structure.

func (*Event) MiniObject

func (e *Event) MiniObject() *MiniObject

MiniObject: parent structure.

func (*Event) ParseBufferSize

func (event *Event) ParseBufferSize() (format Format, minsize int64, maxsize int64, async bool)

ParseBufferSize: get the format, minsize, maxsize and async-flag in the buffersize event.

The function returns the following values:

  • format: pointer to store the format in.
  • minsize: pointer to store the minsize in.
  • maxsize: pointer to store the maxsize in.
  • async: pointer to store the async-flag in.

func (*Event) ParseCaps

func (event *Event) ParseCaps() *Caps

ParseCaps: get the caps from event. The caps remains valid as long as event remains valid.

The function returns the following values:

  • caps: pointer to the caps.

func (*Event) ParseFlushStop

func (event *Event) ParseFlushStop() bool

ParseFlushStop: parse the FLUSH_STOP event and retrieve the reset_time member.

The function returns the following values:

  • resetTime: if time should be reset.

func (*Event) ParseGap

func (event *Event) ParseGap() (timestamp ClockTime, duration ClockTime)

ParseGap: extract timestamp and duration from a new GAP event.

The function returns the following values:

  • timestamp (optional): location where to store the start time (pts) of the gap, or NULL.
  • duration (optional): location where to store the duration of the gap, or NULL.

func (*Event) ParseGapFlags

func (event *Event) ParseGapFlags() GapFlags

ParseGapFlags: retrieve the gap flags that may have been set on a gap event with gst_event_set_gap_flags().

The function returns the following values:

  • flags or NULL.

func (*Event) ParseGroupID

func (event *Event) ParseGroupID() (uint, bool)

The function returns the following values:

  • groupId address of variable where to store the group id.
  • ok: TRUE if a group id was set on the event and could be parsed, FALSE otherwise.

func (*Event) ParseInstantRateChange

func (event *Event) ParseInstantRateChange() (float64, SegmentFlags)

ParseInstantRateChange: extract rate and flags from an instant-rate-change event.

The function returns the following values:

  • rateMultiplier (optional): location in which to store the rate multiplier of the instant-rate-change event, or NULL.
  • newFlags (optional): location in which to store the new segment flags of the instant-rate-change event, or NULL.

func (*Event) ParseInstantRateSyncTime

func (event *Event) ParseInstantRateSyncTime() (rateMultiplier float64, runningTime ClockTime, upstreamRunningTime ClockTime)

ParseInstantRateSyncTime: extract the rate multiplier and running times from an instant-rate-sync-time event.

The function returns the following values:

  • rateMultiplier (optional): location where to store the rate of the instant-rate-sync-time event, or NULL.
  • runningTime (optional): location in which to store the running time of the instant-rate-sync-time event, or NULL.
  • upstreamRunningTime (optional): location in which to store the upstream running time of the instant-rate-sync-time event, or NULL.

func (*Event) ParseLatency

func (event *Event) ParseLatency() ClockTime

ParseLatency: get the latency in the latency event.

The function returns the following values:

  • latency: pointer to store the latency in.

func (*Event) ParseProtection

func (event *Event) ParseProtection() (systemId string, data *Buffer, origin string)

ParseProtection 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.

The function returns the following values:

  • systemId (optional): pointer to store the UUID string uniquely identifying a content protection system.
  • data (optional): pointer to store a Buffer holding protection system specific information.
  • origin (optional): pointer to store a value that indicates where the protection information carried by event was extracted from.

func (*Event) ParseQos

func (event *Event) ParseQos() (QOSType, float64, ClockTimeDiff, ClockTime)

ParseQos: 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.

The function returns the following values:

  • typ: pointer to store the QoS type in.
  • proportion: pointer to store the proportion in.
  • diff: pointer to store the diff in.
  • timestamp: pointer to store the timestamp in.

func (*Event) ParseSeek

func (event *Event) ParseSeek() (rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64)

ParseSeek parses a seek event and stores the results in the given result locations.

The function returns the following values:

  • rate: result location for the rate.
  • format: result location for the stream format.
  • flags: result location for the SeekFlags.
  • startType: result location for the SeekType of the start position.
  • start: result location for the start position expressed in format.
  • stopType: result location for the SeekType of the stop position.
  • stop: result location for the stop position expressed in format.

func (*Event) ParseSeekTrickmodeInterval

func (event *Event) ParseSeekTrickmodeInterval() ClockTime

ParseSeekTrickmodeInterval: retrieve the trickmode interval that may have been set on a seek event with gst_event_set_seek_trickmode_interval().

The function returns the following values:

func (*Event) ParseSegment

func (event *Event) ParseSegment() *Segment

ParseSegment 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.

The function returns the following values:

  • segment: pointer to a Segment.

func (*Event) ParseSegmentDone

func (event *Event) ParseSegmentDone() (Format, int64)

ParseSegmentDone extracts the position and format from the segment done message.

The function returns the following values:

  • format (optional): result location for the format, or NULL.
  • position (optional): result location for the position, or NULL.

func (*Event) ParseSelectStreams

func (event *Event) ParseSelectStreams() []string

ParseSelectStreams: parse the SELECT_STREAMS event and retrieve the contained streams.

The function returns the following values:

  • streams: streams.

func (*Event) ParseSinkMessage

func (event *Event) ParseSinkMessage() *Message

ParseSinkMessage: parse the sink-message event. Unref msg after usage.

The function returns the following values:

  • msg: pointer to store the Message in.

func (*Event) ParseStep

func (event *Event) ParseStep() (format Format, amount uint64, rate float64, flush bool, intermediate bool)

ParseStep: parse the step event.

The function returns the following values:

  • format (optional): pointer to store the format in.
  • amount (optional): pointer to store the amount in.
  • rate (optional): pointer to store the rate in.
  • flush (optional): pointer to store the flush boolean in.
  • intermediate (optional): pointer to store the intermediate boolean in.

func (*Event) ParseStream

func (event *Event) ParseStream() *Stream

ParseStream: parse a stream-start event and extract the Stream from it.

The function returns the following values:

  • stream address of variable to store the stream.

func (*Event) ParseStreamCollection

func (event *Event) ParseStreamCollection() *StreamCollection

ParseStreamCollection: retrieve new StreamCollection from STREAM_COLLECTION event event.

The function returns the following values:

  • collection: pointer to store the collection.

func (*Event) ParseStreamFlags

func (event *Event) ParseStreamFlags() StreamFlags

The function returns the following values:

  • flags address of variable where to store the stream flags.

func (*Event) ParseStreamGroupDone

func (event *Event) ParseStreamGroupDone() uint

ParseStreamGroupDone: parse a stream-group-done event and store the result in the given group_id location.

The function returns the following values:

  • groupId address of variable to store the group id into.

func (*Event) ParseStreamStart

func (event *Event) ParseStreamStart() string

ParseStreamStart: 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.

The function returns the following values:

  • streamId: pointer to store the stream-id.

func (*Event) ParseToc

func (event *Event) ParseToc() (*Toc, bool)

ParseToc: parse a TOC event and store the results in the given toc and updated locations.

The function returns the following values:

  • toc: pointer to Toc structure.
  • updated: pointer to store TOC updated flag.

func (*Event) ParseTocSelect

func (event *Event) ParseTocSelect() string

ParseTocSelect: parse a TOC select event and store the results in the given uid location.

The function returns the following values:

  • uid (optional): storage for the selection UID.

func (*Event) RunningTimeOffset

func (event *Event) RunningTimeOffset() int64

RunningTimeOffset: retrieve the accumulated running time offset of the event.

Events passing through Pads 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.

The function returns the following values:

  • gint64 event's running time offset

    MT safe.

func (*Event) Seqnum

func (event *Event) Seqnum() uint32

Seqnum: 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.

The function returns the following values:

  • guint32 event's sequence number.

    MT safe.

func (*Event) SetGapFlags

func (event *Event) SetGapFlags(flags GapFlags)

SetGapFlags sets flags on event to give additional information about the reason for the T_EVENT_GAP.

The function takes the following parameters:

  • flags: GapFlags.

func (*Event) SetGroupID

func (event *Event) SetGroupID(groupId uint)

SetGroupID: 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.

The function takes the following parameters:

  • groupId: group id to set.

func (*Event) SetRunningTimeOffset

func (event *Event) SetRunningTimeOffset(offset int64)

SetRunningTimeOffset: set the running time offset of a event. See gst_event_get_running_time_offset() for more information.

MT safe.

The function takes the following parameters:

  • offset: the new running time offset.

func (*Event) SetSeekTrickmodeInterval

func (event *Event) SetSeekTrickmodeInterval(interval ClockTime)

SetSeekTrickmodeInterval 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.

The function takes the following parameters:

func (*Event) SetSeqnum

func (event *Event) SetSeqnum(seqnum uint32)

SetSeqnum: 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.

The function takes the following parameters:

  • seqnum: sequence number.

func (*Event) SetStream

func (event *Event) SetStream(stream *Stream)

SetStream: set the stream on the stream-start event.

The function takes the following parameters:

  • stream object to set.

func (*Event) SetStreamFlags

func (event *Event) SetStreamFlags(flags StreamFlags)

The function takes the following parameters:

  • flags: stream flags to set.

func (*Event) SetTimestamp

func (e *Event) SetTimestamp(timestamp uint64)

Timestamp: timestamp of the event.

func (*Event) Structure

func (event *Event) Structure() *Structure

Structure access the structure of the event.

The function returns the following values:

  • structure (optional) of the event. The structure is still owned by the event, which means that you should not free it and that the pointer becomes invalid when you free the event.

    MT safe.

func (*Event) Timestamp

func (e *Event) Timestamp() uint64

Timestamp: timestamp of the event.

func (*Event) Type

func (e *Event) Type() EventType

Type of the event.

func (*Event) WritableStructure

func (event *Event) WritableStructure() *Structure

WritableStructure: get a writable version of the structure.

The function returns the following values:

  • structure of the event. The structure is still owned by the event, which means that you should not free it and that the pointer becomes invalid when you free the event. This function checks if event is writable and will never return NULL.

    MT safe.

type EventType

type EventType C.gint

EventType 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 Structure. Specific custom events are distinguished by the name of the structure.

const (
	// EventUnknown: unknown event.
	EventUnknown EventType = 0
	// EventFlushStart: start a flush operation. This event clears all data from
	// the pipeline and unblock all streaming threads.
	EventFlushStart EventType = 2563
	// EventFlushStop: stop a flush operation. This event resets the
	// running-time of the pipeline.
	EventFlushStop EventType = 5127
	// EventStreamStart: 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 event. Notify the pad of a new media type.
	EventCaps EventType = 12814
	// EventSegment: 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: new StreamCollection is available (Since: 1.10).
	EventStreamCollection EventType = 19230
	// EventTag: new set of metadata tags has been found in the stream.
	EventTag EventType = 20510
	// EventBuffersize: notification of buffering requirements. Currently not
	// used yet.
	EventBuffersize EventType = 23054
	// EventSinkMessage: event that sinks turn into a message. Used to send
	// messages that should be emitted in sync with rendering.
	EventSinkMessage EventType = 25630
	// EventStreamGroupDone 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: 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: event which indicates that a new table of contents (TOC) was
	// found or updated.
	EventToc EventType = 30750
	// EventProtection: event which indicates that new or updated encryption
	// information has been found in the stream.
	EventProtection EventType = 33310
	// EventSegmentDone marks the end of a segment playback.
	EventSegmentDone EventType = 38406
	// EventGap marks a gap in the datastream.
	EventGap EventType = 40966
	// EventInstantRateChange: notify downstream that a playback rate override
	// should be applied as soon as possible. (Since: 1.18).
	EventInstantRateChange EventType = 46090
	// EventQos: quality message. Used to indicate to upstream elements that the
	// downstream elements should adjust their processing rate.
	EventQos EventType = 48641
	// EventSeek: request for a new playback position and rate.
	EventSeek EventType = 51201
	// EventNavigation: navigation events are usually used for communicating
	// user requests, such as mouse or keyboard movements, to upstream elements.
	EventNavigation EventType = 53761
	// EventLatency: notification of new latency adjustment. Sinks will use the
	// latency information to adjust their synchronisation.
	EventLatency EventType = 56321
	// EventStep: request for stepping through the media. Sinks will usually
	// execute the step operation.
	EventStep EventType = 58881
	// EventReconfigure: request for upstream renegotiating caps and
	// reconfiguring.
	EventReconfigure EventType = 61441
	// EventTocSelect: request for a new playback position based on TOC entry's
	// UID.
	EventTocSelect EventType = 64001
	// EventSelectStreams: request to select one or more streams (Since: 1.10).
	EventSelectStreams EventType = 66561
	// EventInstantRateSyncTime: 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: upstream custom event.
	EventCustomUpstream EventType = 69121
	// EventCustomDownstream: downstream custom event that travels in the data
	// flow.
	EventCustomDownstream EventType = 71686
	// EventCustomDownstreamOob: custom out-of-band downstream event.
	EventCustomDownstreamOob EventType = 74242
	// EventCustomDownstreamSticky: custom sticky downstream event.
	EventCustomDownstreamSticky EventType = 76830
	// EventCustomBoth: custom upstream or downstream event. In-band when
	// travelling downstream.
	EventCustomBoth EventType = 79367
	// EventCustomBothOob: custom upstream or downstream out-of-band event.
	EventCustomBothOob EventType = 81923
)

func (EventType) String

func (e EventType) String() string

String returns the name in string for EventType.

type EventTypeFlags

type EventTypeFlags C.guint

EventTypeFlags indicate the aspects of the different EventType values. You can get the type flags of a EventType with the gst_event_type_get_flags() function.

const (
	// EventTypeUpstream: set if the event can travel upstream.
	EventTypeUpstream EventTypeFlags = 0b1
	// EventTypeDownstream: set if the event can travel downstream.
	EventTypeDownstream EventTypeFlags = 0b10
	// EventTypeSerialized: set if the event should be serialized with data
	// flow.
	EventTypeSerialized EventTypeFlags = 0b100
	// EventTypeSticky: set if the event is sticky on the pads.
	EventTypeSticky EventTypeFlags = 0b1000
	// EventTypeStickyMulti: multiple sticky events can be on a pad, each
	// identified by the event name.
	EventTypeStickyMulti EventTypeFlags = 0b10000
)

func EventTypeGetFlags

func EventTypeGetFlags(typ EventType) EventTypeFlags

EventTypeGetFlags gets the EventTypeFlags associated with type.

The function takes the following parameters:

  • typ: EventType.

The function returns the following values:

  • eventTypeFlags: EventTypeFlags.

func (EventTypeFlags) Has

func (e EventTypeFlags) Has(other EventTypeFlags) bool

Has returns true if e contains other.

func (EventTypeFlags) String

func (e EventTypeFlags) String() string

String returns the names in string for EventTypeFlags.

type FlagSet

type FlagSet struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

FlagSet: fundamental type that describes a 32-bit flag bitfield, with 32-bit mask indicating which of the bits in the field are explicitly set.

type FlowReturn

type FlowReturn C.gint

FlowReturn: result of passing data to a pad.

Note that the custom return values should not be exposed outside of the element scope.

const (
	// FlowCustomSuccess2: pre-defined custom success code.
	FlowCustomSuccess2 FlowReturn = 102
	// FlowCustomSuccess1: pre-defined custom success code (define your custom
	// success code to this to avoid compiler warnings).
	FlowCustomSuccess1 FlowReturn = 101
	// FlowCustomSuccess elements can use values starting from this (and higher)
	// to define custom success codes.
	FlowCustomSuccess FlowReturn = 100
	// FlowOK: data passing was ok.
	FlowOK FlowReturn = 0
	// FlowNotLinked: pad is not linked.
	FlowNotLinked FlowReturn = -1
	// FlowFlushing: pad is flushing.
	FlowFlushing FlowReturn = -2
	// FlowEos: pad is EOS.
	FlowEos FlowReturn = -3
	// FlowNotNegotiated: pad is not negotiated.
	FlowNotNegotiated FlowReturn = -4
	// FlowError: some (fatal) error occurred. Element generating this error
	// should post an error message using GST_ELEMENT_ERROR() with more details.
	FlowError FlowReturn = -5
	// FlowNotSupported: this operation is not supported.
	FlowNotSupported FlowReturn = -6
	// FlowCustomError elements can use values starting from this (and lower) to
	// define custom error codes.
	FlowCustomError FlowReturn = -100
	// FlowCustomError1: pre-defined custom error code (define your custom error
	// code to this to avoid compiler warnings).
	FlowCustomError1 FlowReturn = -101
	// FlowCustomError2: pre-defined custom error code.
	FlowCustomError2 FlowReturn = -102
)

func ProxyPadChainDefault

func ProxyPadChainDefault(pad *Pad, parent GstObjector, buffer *Buffer) FlowReturn

ProxyPadChainDefault: invoke the default chain function of the proxy pad.

The function takes the following parameters:

  • pad: sink Pad, returns GST_FLOW_ERROR if not.
  • parent (optional) of pad or NULL.
  • buffer to send, return GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the pad.

func ProxyPadChainListDefault

func ProxyPadChainListDefault(pad *Pad, parent GstObjector, list *BufferList) FlowReturn

ProxyPadChainListDefault: invoke the default chain list function of the proxy pad.

The function takes the following parameters:

  • pad: sink Pad, returns GST_FLOW_ERROR if not.
  • parent (optional) of pad or NULL.
  • list to send, return GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the pad.

func (FlowReturn) String

func (f FlowReturn) String() string

String returns the name in string for FlowReturn.

type Format

type Format C.gint

Format: standard predefined formats.

const (
	// FormatUndefined: undefined format.
	FormatUndefined Format = iota
	// FormatDefault: 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
	// FormatBytes: bytes.
	FormatBytes
	// FormatTime: time in nanoseconds.
	FormatTime
	// FormatBuffers buffers (few, if any, elements implement this as of May
	// 2009).
	FormatBuffers
	// FormatPercent: percentage of stream (few, if any, elements implement this
	// as of May 2009).
	FormatPercent
)

func FormatGetByNick

func FormatGetByNick(nick string) Format

FormatGetByNick: return the format registered with the given nick.

The function takes the following parameters:

  • nick of the format.

The function returns the following values:

  • format with nick or GST_FORMAT_UNDEFINED if the format was not registered.

func FormatRegister

func FormatRegister(nick, description string) Format

FormatRegister: create a new GstFormat based on the nick or return an already registered format with that nick.

The function takes the following parameters:

  • nick of the new format.
  • description of the new format.

The function returns the following values:

  • format: new GstFormat or an already registered format with the same nick.

    MT safe.

func (Format) String

func (f Format) String() string

String returns the name in string for Format.

type FormatDefinition

type FormatDefinition struct {
	// contains filtered or unexported fields
}

FormatDefinition: format definition

An instance of this type is always passed by reference.

func FormatGetDetails

func FormatGetDetails(format Format) *FormatDefinition

FormatGetDetails: get details about the given format.

The function takes the following parameters:

  • format to get details of.

The function returns the following values:

  • formatDefinition (optional) for format or NULL on failure.

    MT safe.

func (*FormatDefinition) Description

func (f *FormatDefinition) Description() string

Description: longer description of the format.

func (*FormatDefinition) Nick

func (f *FormatDefinition) Nick() string

Nick: short nick of the format.

func (*FormatDefinition) Quark

func (f *FormatDefinition) Quark() glib.Quark

Quark: quark for the nick.

func (*FormatDefinition) Value

func (f *FormatDefinition) Value() Format

Value: unique id of this format.

type Fraction

type Fraction struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Fraction: fundamental type that describes a fraction of an integer numerator over an integer denominator.

type FractionRange

type FractionRange struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

FractionRange: fundamental type that describes a FractionRange range.

type GapFlags

type GapFlags C.guint

GapFlags: different flags that can be set on T_EVENT_GAP events. See gst_event_set_gap_flags() for details.

const (
	// GapFlagMissingData signals missing data, for example because of packet
	// loss.
	GapFlagMissingData GapFlags = 0b1
)

func (GapFlags) Has

func (g GapFlags) Has(other GapFlags) bool

Has returns true if g contains other.

func (GapFlags) String

func (g GapFlags) String() string

String returns the names in string for GapFlags.

type GhostPad

type GhostPad struct {
	ProxyPad
	// contains filtered or unexported fields
}

GhostPad ghostPads are useful when organizing pipelines with Bin 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 Element. 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.

func NewGhostPad

func NewGhostPad(name string, target *Pad) *GhostPad

NewGhostPad: 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.

The function takes the following parameters:

  • name (optional) of the new pad, or NULL to assign a default name.
  • target: pad to ghost.

The function returns the following values:

  • ghostPad (optional): new Pad, or NULL in case of an error.

func NewGhostPadFromTemplate

func NewGhostPadFromTemplate(name string, target *Pad, templ *PadTemplate) *GhostPad

NewGhostPadFromTemplate: 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.

The function takes the following parameters:

  • name (optional) of the new pad, or NULL to assign a default name.
  • target: pad to ghost.
  • templ to use on the ghostpad.

The function returns the following values:

  • ghostPad (optional): new Pad, or NULL in case of an error.

func NewGhostPadNoTarget

func NewGhostPadNoTarget(name string, dir PadDirection) *GhostPad

NewGhostPadNoTarget: 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.

The function takes the following parameters:

  • name (optional) of the new pad, or NULL to assign a default name.
  • dir: direction of the ghostpad.

The function returns the following values:

  • ghostPad (optional): new Pad, or NULL in case of an error.

func NewGhostPadNoTargetFromTemplate

func NewGhostPadNoTargetFromTemplate(name string, templ *PadTemplate) *GhostPad

NewGhostPadNoTargetFromTemplate: create a new ghostpad based on templ, without setting a target. The direction will be taken from the templ.

The function takes the following parameters:

  • name (optional) of the new pad, or NULL to assign a default name.
  • templ to create the ghostpad from.

The function returns the following values:

  • ghostPad (optional): new Pad, or NULL in case of an error.

func (*GhostPad) Construct deprecated

func (gpad *GhostPad) Construct() bool

Construct: finish initialization of a newly allocated ghost pad.

This function is most useful in language bindings and when subclassing GhostPad; 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.

The function returns the following values:

  • ok: TRUE if the construction succeeds, FALSE otherwise.

func (*GhostPad) SetTarget

func (gpad *GhostPad) SetTarget(newtarget *Pad) bool

SetTarget: 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.

The function takes the following parameters:

  • newtarget (optional): new pad target.

The function returns the following values:

  • ok: TRUE if the new target could be set. This function can return FALSE when the internal pads could not be linked.

func (*GhostPad) Target

func (gpad *GhostPad) Target() *Pad

Target: get the target pad of gpad. Unref target pad after usage.

The function returns the following values:

  • pad (optional): target Pad, can be NULL if the ghostpad has no target set. Unref target pad after usage.

type GhostPadClass

type GhostPadClass struct {
	// contains filtered or unexported fields
}

GhostPadClass: instance of this type is always passed by reference.

func (*GhostPadClass) ParentClass

func (g *GhostPadClass) ParentClass() *ProxyPadClass

type GhostPadOverrides

type GhostPadOverrides struct {
}

GhostPadOverrides contains methods that are overridable.

type GstObject

type GstObject struct {
	coreglib.InitiallyUnowned
	// contains filtered or unexported fields
}

GstObject provides a root for the object hierarchy tree filed in by the GStreamer library. It is currently a thin wrapper on top of Unowned. It is an abstract class that is not very usable on its own.

Object 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 Object which is #GObject (e.g. g_object_ref() becomes gst_object_ref()).

Since Object derives from Unowned, 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, Object 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 Element? 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 ControlSource. csource = gst_interpolation_control_source_new (); g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);

  • Attach the ControlSource 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.

func BaseGstObject

func BaseGstObject(obj GstObjector) *GstObject

BaseGstObject returns the underlying base object.

func (*GstObject) AddControlBinding

func (object *GstObject) AddControlBinding(binding ControlBindinger) bool

AddControlBinding: attach the ControlBinding to the object. If there already was a ControlBinding 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()).

The function takes the following parameters:

  • binding that should be used.

The function returns the following values:

  • ok: FALSE if the given binding has not been setup for this object or has been setup for a non suitable property, TRUE otherwise.

func (*GstObject) ControlBinding

func (object *GstObject) ControlBinding(propertyName string) ControlBindinger

ControlBinding gets the corresponding ControlBinding for the property. This should be unreferenced again after use.

The function takes the following parameters:

  • propertyName: name of the property.

The function returns the following values:

  • controlBinding (optional) for property_name or NULL if the property is not controlled.

func (*GstObject) ControlRate

func (object *GstObject) ControlRate() ClockTime

ControlRate: obtain the control-rate for this object. Audio processing Element 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.

The function returns the following values:

  • clockTime: control rate in nanoseconds.

func (*GstObject) DefaultError

func (source *GstObject) DefaultError(err error, debug string)

DefaultError: 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.

The function takes the following parameters:

  • err: GError.
  • debug (optional): additional debug information string, or NULL.

func (*GstObject) GValueArray

func (object *GstObject) GValueArray(propertyName string, timestamp, interval ClockTime, values []coreglib.Value) bool

GValueArray gets a number of #GValues for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of #GValue.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

The function takes the following parameters:

  • propertyName: name of the property to get.
  • timestamp: time that should be processed.
  • interval: time spacing between subsequent values.
  • values: array to put control-values in.

The function returns the following values:

  • ok: TRUE if the given array could be filled, FALSE otherwise.

func (*GstObject) HasActiveControlBindings

func (object *GstObject) HasActiveControlBindings() bool

HasActiveControlBindings: check if the object has active controlled properties.

The function returns the following values:

  • ok: TRUE if the object has active controlled properties.

func (*GstObject) HasAncestor deprecated

func (object *GstObject) HasAncestor(ancestor GstObjector) bool

HasAncestor: check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a Element is inside a Pipeline.

Deprecated: Use gst_object_has_as_ancestor() instead.

MT safe. Grabs and releases object's locks.

The function takes the following parameters:

  • ancestor to check as ancestor.

The function returns the following values:

  • ok: TRUE if ancestor is an ancestor of object.

func (*GstObject) HasAsAncestor

func (object *GstObject) HasAsAncestor(ancestor GstObjector) bool

HasAsAncestor: check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a Element is inside a Pipeline.

The function takes the following parameters:

  • ancestor to check as ancestor.

The function returns the following values:

  • ok: TRUE if ancestor is an ancestor of object.

    MT safe. Grabs and releases object's locks.

func (*GstObject) HasAsParent

func (object *GstObject) HasAsParent(parent GstObjector) bool

HasAsParent: check if parent is the parent of object. E.g. a Element can check if it owns a given Pad.

The function takes the following parameters:

  • parent to check as parent.

The function returns the following values:

  • ok: FALSE if either object or parent is NULL. TRUE if parent is the parent of object. Otherwise FALSE.

    MT safe. Grabs and releases object's locks.

func (*GstObject) Name

func (object *GstObject) Name() string

Name 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.

The function returns the following values:

  • utf8 (optional): name of object. g_free() after usage.

    MT safe. This function grabs and releases object's LOCK.

func (*GstObject) Parent

func (object *GstObject) Parent() GstObjector

Parent returns the parent of object. This function increases the refcount of the parent object so you should gst_object_unref() it after usage.

The function returns the following values:

  • ret (optional): parent of object, this can be NULL if object has no parent. unref after usage.

    MT safe. Grabs and releases object's LOCK.

func (*GstObject) PathString

func (object *GstObject) PathString() string

PathString generates a string describing the path of object in the object hierarchy. Only useful (or used) for debugging.

Free-function: g_free.

The function returns the following values:

  • utf8: string describing the path of object. You must g_free() the string after usage.

    MT safe. Grabs and releases the Object's LOCK for all objects in the hierarchy.

func (*GstObject) RemoveControlBinding

func (object *GstObject) RemoveControlBinding(binding ControlBindinger) bool

RemoveControlBinding removes the corresponding ControlBinding. If it was the last ref of the binding, it will be disposed.

The function takes the following parameters:

  • binding: binding.

The function returns the following values:

  • ok: TRUE if the binding could be removed.

func (*GstObject) SetControlBindingDisabled

func (object *GstObject) SetControlBindingDisabled(propertyName string, disabled bool)

SetControlBindingDisabled: 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.

The function takes the following parameters:

  • propertyName: property to disable.
  • disabled: boolean that specifies whether to disable the controller or not.

func (*GstObject) SetControlBindingsDisabled

func (object *GstObject) SetControlBindingsDisabled(disabled bool)

SetControlBindingsDisabled: this function is used to disable all controlled properties of the object for some time, i.e. gst_object_sync_values() will do nothing.

The function takes the following parameters:

  • disabled: boolean that specifies whether to disable the controller or not.

func (*GstObject) SetControlRate

func (object *GstObject) SetControlRate(controlRate ClockTime)

SetControlRate: change the control-rate for this object. Audio processing Element 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.

The function takes the following parameters:

  • controlRate: new control-rate in nanoseconds.

func (*GstObject) SetName

func (object *GstObject) SetName(name string) bool

SetName 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.

The function takes the following parameters:

  • name (optional): new name of object.

The function returns the following values:

  • ok: TRUE if the name could be set. Since Objects that have a parent cannot be renamed, this function returns FALSE in those cases.

    MT safe. This function grabs and releases object's LOCK.

func (*GstObject) SetParent

func (object *GstObject) SetParent(parent GstObjector) bool

SetParent 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()).

The function takes the following parameters:

  • parent: new parent of object.

The function returns the following values:

  • ok: TRUE if parent could be set or FALSE when object already had a parent or object and parent are the same.

    MT safe. Grabs and releases object's LOCK.

func (*GstObject) SuggestNextSync

func (object *GstObject) SuggestNextSync() ClockTime

SuggestNextSync returns a suggestion for timestamps where buffers should be split to get best controller results.

The function returns the following values:

  • clockTime returns the suggested timestamp or GST_CLOCK_TIME_NONE if no control-rate was set.

func (*GstObject) SyncValues

func (object *GstObject) SyncValues(timestamp ClockTime) bool

SyncValues sets the properties of the object, according to the ControlSources 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.

The function takes the following parameters:

  • timestamp: time that should be processed.

The function returns the following values:

  • ok: TRUE if the controller values could be applied to the object properties, FALSE otherwise.

func (*GstObject) Unparent

func (object *GstObject) Unparent()

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 (*GstObject) Value

func (object *GstObject) Value(propertyName string, timestamp ClockTime) *coreglib.Value

Value gets the value for the given controlled property at the requested time.

The function takes the following parameters:

  • propertyName: name of the property to get.
  • timestamp: time the control-change should be read from.

The function returns the following values:

  • value (optional): GValue of the property at the given time, or NULL if the property isn't controlled.

type GstObjectOverrides

type GstObjectOverrides struct {
}

GstObjectOverrides contains methods that are overridable.

type GstObjector

type GstObjector interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

GstObjector describes types inherited from class GstObject.

To get the original type, the caller must assert this to an interface or another type.

type Int64Range

type Int64Range struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Int64Range: fundamental type that describes a #gint64 range.

type IntRange

type IntRange struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

IntRange: fundamental type that describes a #gint range.

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

Iterator 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:

GstIterator *it = _get_iterator(object);
GValue item = G_VALUE_INIT;
done = FALSE;
while (!done) {
  switch (gst_iterator_next (it, &item)) {
    case GST_ITERATOR_OK:
      ...get/use/change item here...
      g_value_reset (&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 (&item);
gst_iterator_free (it);

An instance of this type is always passed by reference.

func FormatIterateDefinitions

func FormatIterateDefinitions() *Iterator

FormatIterateDefinitions: iterate all the registered formats. The format definition is read only.

The function returns the following values:

  • iterator: gstIterator of FormatDefinition.

func NewIteratorSingle

func NewIteratorSingle(typ coreglib.Type, object *coreglib.Value) *Iterator

NewIteratorSingle constructs a struct Iterator.

func ProxyPadIterateInternalLinksDefault

func ProxyPadIterateInternalLinksDefault(pad *Pad, parent GstObjector) *Iterator

ProxyPadIterateInternalLinksDefault: invoke the default iterate internal links function of the proxy pad.

The function takes the following parameters:

  • pad to get the internal links of.
  • parent (optional) of pad or NULL.

The function returns the following values:

  • iterator (optional) of Pad, or NULL if pad has no parent. Unref each returned pad with gst_object_unref().

func (*Iterator) Copy

func (it *Iterator) Copy() *Iterator

Copy the iterator and its state.

The function returns the following values:

  • iterator: new copy of it.

func (*Iterator) Fold

Fold 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.

The function takes the following parameters:

  • fn: fold function.
  • ret: seed value passed to the fold function.

The function returns the following values:

  • iteratorResult as described above.

    MT safe.

func (*Iterator) ForEach

ForEach: iterate over all element of it and call the given function func for each element.

The function takes the following parameters:

  • fn: function to call for each element.

The function returns the following values:

  • iteratorResult: result call to gst_iterator_fold(). The iterator will not be freed.

    MT safe.

func (*Iterator) Next

func (it *Iterator) Next() (coreglib.Value, IteratorResult)

Next: get the next item from the iterator in elem.

Only when this function returns GST_ITERATOR_OK, elem will contain a valid value. elem must have been initialized to the type of the iterator or initialized to zeroes with g_value_unset(). The caller is responsible for unsetting or resetting elem with g_value_unset() or g_value_reset() after usage.

When this function returns GST_ITERATOR_DONE, no more elements can be retrieved from it.

A return value of GST_ITERATOR_RESYNC indicates that the element list was concurrently updated. The user of it should call gst_iterator_resync() to get the newly updated list.

A return value of GST_ITERATOR_ERROR indicates an unrecoverable fatal error.

The function returns the following values:

  • elem: pointer to hold next element.

  • iteratorResult: result of the iteration. Unset elem after usage.

    MT safe.

func (*Iterator) Push

func (it *Iterator) Push(other *Iterator)

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.

The function takes the following parameters:

  • other to push.

func (*Iterator) Resync

func (it *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.

type IteratorFoldFunction

type IteratorFoldFunction func(item, ret *coreglib.Value) (ok bool)

IteratorFoldFunction: function to be passed to gst_iterator_fold().

type IteratorForEachFunction

type IteratorForEachFunction func(item *coreglib.Value)

IteratorForEachFunction: function that is called by gst_iterator_foreach() for every element.

type IteratorItem

type IteratorItem C.gint

IteratorItem: result of a IteratorItemFunction.

const (
	// IteratorItemSkip: skip this item.
	IteratorItemSkip IteratorItem = iota
	// IteratorItemPass: return item.
	IteratorItemPass
	// IteratorItemEnd: stop after this item.
	IteratorItemEnd
)

func (IteratorItem) String

func (i IteratorItem) String() string

String returns the name in string for IteratorItem.

type IteratorResult

type IteratorResult C.gint

IteratorResult: result of gst_iterator_next().

const (
	// IteratorDone: no more items in the iterator.
	IteratorDone IteratorResult = iota
	// IteratorOK: item was retrieved.
	IteratorOK
	// IteratorResync: datastructure changed while iterating.
	IteratorResync
	// IteratorError: error happened.
	IteratorError
)

func (IteratorResult) String

func (i IteratorResult) String() string

String returns the name in string for IteratorResult.

type LibraryError

type LibraryError C.gint

LibraryError: library errors are for errors from the library being used by elements (initializing, finalizing, settings, ...).

const (
	// LibraryErrorFailed: 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: do not use this except as a placeholder for deciding
	// where to go while developing code.
	LibraryErrorTooLaZY LibraryError = 2
	// LibraryErrorInit: used when the library could not be opened.
	LibraryErrorInit LibraryError = 3
	// LibraryErrorShutdown: used when the library could not be closed.
	LibraryErrorShutdown LibraryError = 4
	// LibraryErrorSettings: used when the library doesn't accept settings.
	LibraryErrorSettings LibraryError = 5
	// LibraryErrorEncode: used when the library generated an encoding error.
	LibraryErrorEncode LibraryError = 6
	// LibraryErrorNumErrors: number of library error types.
	LibraryErrorNumErrors LibraryError = 7
)

func (LibraryError) String

func (l LibraryError) String() string

String returns the name in string for LibraryError.

type LockFlags

type LockFlags C.guint

LockFlags flags used when locking miniobjects.

const (
	// LockFlagRead: lock for read access.
	LockFlagRead LockFlags = 0b1
	// LockFlagWrite: lock for write access.
	LockFlagWrite LockFlags = 0b10
	// LockFlagExclusive: lock for exclusive access.
	LockFlagExclusive LockFlags = 0b100
	// LockFlagLast: first flag that can be used for custom purposes.
	LockFlagLast LockFlags = 0b100000000
)

func (LockFlags) Has

func (l LockFlags) Has(other LockFlags) bool

Has returns true if l contains other.

func (LockFlags) String

func (l LockFlags) String() string

String returns the names in string for LockFlags.

type MapFlags

type MapFlags C.guint

MapFlags flags used when mapping memory.

const (
	// MapRead: map for read access.
	MapRead MapFlags = 0b1
	// MapWrite: map for write access.
	MapWrite MapFlags = 0b10
	// MapFlagLast: first flag that can be used for custom purposes.
	MapFlagLast MapFlags = 0b10000000000000000
)

func (MapFlags) Has

func (m MapFlags) Has(other MapFlags) bool

Has returns true if m contains other.

func (MapFlags) String

func (m MapFlags) String() string

String returns the names in string for MapFlags.

type MapInfo

type MapInfo struct {
	// contains filtered or unexported fields
}

MapInfo: structure containing the result of a map operation such as gst_memory_map(). It contains the data and size.

An instance of this type is always passed by reference.

func (*MapInfo) Bytes

func (m *MapInfo) Bytes() []byte

Bytes returns a byte slice of the data inside this map info.

func (*MapInfo) Data

func (m *MapInfo) Data() unsafe.Pointer

Data returns a pointer to the raw data inside this map.

func (*MapInfo) Flags

func (m *MapInfo) Flags() MapFlags

Flags returns the flags set on this map.

func (*MapInfo) MaxSize

func (m *MapInfo) MaxSize() int64

MaxSize returns the maximum size of this map.

func (*MapInfo) Reader

func (m *MapInfo) Reader() io.Reader

Reader returns a Reader for the contents of this map's memory.

func (*MapInfo) Size

func (m *MapInfo) Size() int64

Size returrns the size of this map.

func (*MapInfo) WriteAt

func (m *MapInfo) WriteAt(offset int, data []byte)

WriteAt writes the given data sequence directly to the map's memory at the given offset.

func (*MapInfo) WriteData

func (m *MapInfo) WriteData(data []byte)

WriteData writes the given sequence directly to the map's memory.

func (*MapInfo) Writer

func (m *MapInfo) Writer() io.Writer

Writer returns a writer that will copy the contents passed to Write directly to the map's memory sequentially. An error will be returned if an attempt is made to write more data than the map can hold.

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory is a lightweight refcounted object that wraps a region of memory. They are typically used to manage the data of a Buffer.

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.

An instance of this type is always passed by reference.

func (*Memory) Align

func (m *Memory) Align() uint

Align: alignment of the memory.

func (*Memory) Allocator

func (m *Memory) Allocator() Allocatorrer

Allocator: pointer to the Allocator.

func (*Memory) Copy

func (mem *Memory) Copy(offset int, size int) *Memory

Copy: 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.

The function takes the following parameters:

  • offset to copy from.
  • size to copy, or -1 to copy to the end of the memory region.

The function returns the following values:

  • memory: new Memory.

func (*Memory) IsSpan

func (mem1 *Memory) IsSpan(mem2 *Memory) (uint, bool)

IsSpan: 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.

The function takes the following parameters:

  • mem2: Memory.

The function returns the following values:

  • offset: pointer to a result offset.
  • ok: TRUE if the memory is contiguous and of a common parent.

func (*Memory) IsType

func (mem *Memory) IsType(memType string) bool

IsType: check if mem if allocated with an allocator for mem_type.

The function takes the following parameters:

  • memType: memory type.

The function returns the following values:

  • ok: TRUE if mem was allocated from an allocator for mem_type.

func (*Memory) MakeMapped

func (mem *Memory) MakeMapped(flags MapFlags) (*MapInfo, *Memory)

MakeMapped: create a Memory 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 Memory.

The function takes the following parameters:

  • flags: mapping flags.

The function returns the following values:

  • info: pointer for info.
  • memory (optional) object mapped with flags or NULL when a mapping is not possible.

func (*Memory) Map

func (mem *Memory) Map(flags MapFlags) (*MapInfo, bool)

Map: 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.

The function takes the following parameters:

  • flags: mapping flags.

The function returns the following values:

  • info: pointer for info.
  • ok: TRUE if the map operation was successful.

func (*Memory) Maxsize

func (m *Memory) Maxsize() uint

Maxsize: maximum size allocated.

func (*Memory) MiniObject

func (m *Memory) MiniObject() *MiniObject

MiniObject: parent structure.

func (*Memory) Offset

func (m *Memory) Offset() uint

Offset: offset where valid data starts.

func (*Memory) Parent

func (m *Memory) Parent() *Memory

Parent: parent memory block.

func (*Memory) Resize

func (mem *Memory) Resize(offset int, size uint)

Resize the memory region. mem should be writable and offset + size should be less than the maxsize of mem.

T_MEMORY_FLAG_ZERO_PREFIXED and T_MEMORY_FLAG_ZERO_PADDED will be cleared when offset or padding is increased respectively.

The function takes the following parameters:

  • offset: new offset.
  • size: new size.

func (*Memory) SetAlign

func (m *Memory) SetAlign(align uint)

Align: alignment of the memory.

func (*Memory) SetMaxsize

func (m *Memory) SetMaxsize(maxsize uint)

Maxsize: maximum size allocated.

func (*Memory) SetOffset

func (m *Memory) SetOffset(offset uint)

Offset: offset where valid data starts.

func (*Memory) SetSize

func (m *Memory) SetSize(size uint)

Size: size of valid data.

func (*Memory) Share

func (mem *Memory) Share(offset int, size int) *Memory

Share: 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.

The function takes the following parameters:

  • offset to share from.
  • size to share, or -1 to share to the end of the memory region.

The function returns the following values:

  • memory: new Memory.

func (*Memory) Size

func (m *Memory) Size() uint

Size: size of valid data.

func (*Memory) Sizes

func (mem *Memory) Sizes() (offset uint, maxsize uint, gsize uint)

Sizes: get the current size, offset and maxsize of mem.

The function returns the following values:

  • offset (optional): pointer to offset.
  • maxsize (optional): pointer to maxsize.
  • gsize: current size of mem.

func (*Memory) Unmap

func (mem *Memory) Unmap(info *MapInfo)

Unmap: release the memory obtained with gst_memory_map().

The function takes the following parameters:

  • info: MapInfo.

type MemoryFlags

type MemoryFlags C.guint

MemoryFlags flags for wrapped memory.

const (
	// MemoryFlagReadonly: memory is readonly. It is not allowed to map the
	// memory with T_MAP_WRITE.
	MemoryFlagReadonly MemoryFlags = 0b10
	// MemoryFlagNoShare: 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 = 0b10000
	// MemoryFlagZeroPrefixed: memory prefix is filled with 0 bytes.
	MemoryFlagZeroPrefixed MemoryFlags = 0b100000
	// MemoryFlagZeroPadded: memory padding is filled with 0 bytes.
	MemoryFlagZeroPadded MemoryFlags = 0b1000000
	// MemoryFlagPhysicallyContiguous: memory is physically contiguous. (Since:
	// 1.2).
	MemoryFlagPhysicallyContiguous MemoryFlags = 0b10000000
	// MemoryFlagNotMappable: memory can't be mapped via gst_memory_map()
	// without any preconditions. (Since: 1.2).
	MemoryFlagNotMappable MemoryFlags = 0b100000000
	// MemoryFlagLast: first flag that can be used for custom purposes.
	MemoryFlagLast MemoryFlags = 0b100000000000000000000
)

func (MemoryFlags) Has

func (m MemoryFlags) Has(other MemoryFlags) bool

Has returns true if m contains other.

func (MemoryFlags) String

func (m MemoryFlags) String() string

String returns the names in string for MemoryFlags.

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message messages are implemented as a subclass of MiniObject with a generic Structure 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 Bus.

The basic use pattern of posting a message on a Bus is as follows:

gst_bus_post (bus, gst_message_new_eos());

A Element usually posts messages on the bus provided by the parent container using gst_element_post_message().

An instance of this type is always passed by reference.

func NewMessageApplication

func NewMessageApplication(src GstObjector, structure *Structure) *Message

NewMessageApplication constructs a struct Message.

func NewMessageAsyncDone

func NewMessageAsyncDone(src GstObjector, runningTime ClockTime) *Message

NewMessageAsyncDone constructs a struct Message.

func NewMessageAsyncStart

func NewMessageAsyncStart(src GstObjector) *Message

NewMessageAsyncStart constructs a struct Message.

func NewMessageBuffering

func NewMessageBuffering(src GstObjector, percent int) *Message

NewMessageBuffering constructs a struct Message.

func NewMessageClockLost

func NewMessageClockLost(src GstObjector, clock Clocker) *Message

NewMessageClockLost constructs a struct Message.

func NewMessageClockProvide

func NewMessageClockProvide(src GstObjector, clock Clocker, ready bool) *Message

NewMessageClockProvide constructs a struct Message.

func NewMessageCustom

func NewMessageCustom(typ MessageType, src GstObjector, structure *Structure) *Message

NewMessageCustom constructs a struct Message.

func NewMessageDeviceAdded

func NewMessageDeviceAdded(src GstObjector, device Devicer) *Message

NewMessageDeviceAdded constructs a struct Message.

func NewMessageDeviceChanged

func NewMessageDeviceChanged(src GstObjector, device Devicer, changedDevice Devicer) *Message

NewMessageDeviceChanged constructs a struct Message.

func NewMessageDeviceRemoved

func NewMessageDeviceRemoved(src GstObjector, device Devicer) *Message

NewMessageDeviceRemoved constructs a struct Message.

func NewMessageDurationChanged

func NewMessageDurationChanged(src GstObjector) *Message

NewMessageDurationChanged constructs a struct Message.

func NewMessageElement

func NewMessageElement(src GstObjector, structure *Structure) *Message

NewMessageElement constructs a struct Message.

func NewMessageEos

func NewMessageEos(src GstObjector) *Message

NewMessageEos constructs a struct Message.

func NewMessageError

func NewMessageError(src GstObjector, err error, debug string) *Message

NewMessageError constructs a struct Message.

func NewMessageErrorWithDetails

func NewMessageErrorWithDetails(src GstObjector, err error, debug string, details *Structure) *Message

NewMessageErrorWithDetails constructs a struct Message.

func NewMessageHaveContext

func NewMessageHaveContext(src GstObjector, context *Context) *Message

NewMessageHaveContext constructs a struct Message.

func NewMessageInfo

func NewMessageInfo(src GstObjector, err error, debug string) *Message

NewMessageInfo constructs a struct Message.

func NewMessageInfoWithDetails

func NewMessageInfoWithDetails(src GstObjector, err error, debug string, details *Structure) *Message

NewMessageInfoWithDetails constructs a struct Message.

func NewMessageInstantRateRequest

func NewMessageInstantRateRequest(src GstObjector, rateMultiplier float64) *Message

NewMessageInstantRateRequest constructs a struct Message.

func NewMessageLatency

func NewMessageLatency(src GstObjector) *Message

NewMessageLatency constructs a struct Message.

func NewMessageNeedContext

func NewMessageNeedContext(src GstObjector, contextType string) *Message

NewMessageNeedContext constructs a struct Message.

func NewMessageNewClock

func NewMessageNewClock(src GstObjector, clock Clocker) *Message

NewMessageNewClock constructs a struct Message.

func NewMessageProgress

func NewMessageProgress(src GstObjector, typ ProgressType, code string, text string) *Message

NewMessageProgress constructs a struct Message.

func NewMessagePropertyNotify

func NewMessagePropertyNotify(src GstObjector, propertyName string, val *coreglib.Value) *Message

NewMessagePropertyNotify constructs a struct Message.

func NewMessageQos

func NewMessageQos(src GstObjector, live bool, runningTime uint64, streamTime uint64, timestamp uint64, duration uint64) *Message

NewMessageQos constructs a struct Message.

func NewMessageRequestState

func NewMessageRequestState(src GstObjector, state State) *Message

NewMessageRequestState constructs a struct Message.

func NewMessageResetTime

func NewMessageResetTime(src GstObjector, runningTime ClockTime) *Message

NewMessageResetTime constructs a struct Message.

func NewMessageSegmentDone

func NewMessageSegmentDone(src GstObjector, format Format, position int64) *Message

NewMessageSegmentDone constructs a struct Message.

func NewMessageSegmentStart

func NewMessageSegmentStart(src GstObjector, format Format, position int64) *Message

NewMessageSegmentStart constructs a struct Message.

func NewMessageStateChanged

func NewMessageStateChanged(src GstObjector, oldstate State, newstate State, pending State) *Message

NewMessageStateChanged constructs a struct Message.

func NewMessageStateDirty

func NewMessageStateDirty(src GstObjector) *Message

NewMessageStateDirty constructs a struct Message.

func NewMessageStepDone

func NewMessageStepDone(src GstObjector, format Format, amount uint64, rate float64, flush bool, intermediate bool, duration uint64, eos bool) *Message

NewMessageStepDone constructs a struct Message.

func NewMessageStepStart

func NewMessageStepStart(src GstObjector, active bool, format Format, amount uint64, rate float64, flush bool, intermediate bool) *Message

NewMessageStepStart constructs a struct Message.

func NewMessageStreamCollection

func NewMessageStreamCollection(src GstObjector, collection *StreamCollection) *Message

NewMessageStreamCollection constructs a struct Message.

func NewMessageStreamStart

func NewMessageStreamStart(src GstObjector) *Message

NewMessageStreamStart constructs a struct Message.

func NewMessageStreamStatus

func NewMessageStreamStatus(src GstObjector, typ StreamStatusType, owner Elementer) *Message

NewMessageStreamStatus constructs a struct Message.

func NewMessageStreamsSelected

func NewMessageStreamsSelected(src GstObjector, collection *StreamCollection) *Message

NewMessageStreamsSelected constructs a struct Message.

func NewMessageStructureChange

func NewMessageStructureChange(src GstObjector, typ StructureChangeType, owner Elementer, busy bool) *Message

NewMessageStructureChange constructs a struct Message.

func NewMessageToc

func NewMessageToc(src GstObjector, toc *Toc, updated bool) *Message

NewMessageToc constructs a struct Message.

func NewMessageWarning

func NewMessageWarning(src GstObjector, err error, debug string) *Message

NewMessageWarning constructs a struct Message.

func NewMessageWarningWithDetails

func NewMessageWarningWithDetails(src GstObjector, err error, debug string, details *Structure) *Message

NewMessageWarningWithDetails constructs a struct Message.

func (*Message) HasName

func (message *Message) HasName(name string) bool

HasName checks if message has the given name. This function is usually used to check the name of a custom message.

The function takes the following parameters:

  • name to check.

The function returns the following values:

  • ok: TRUE if name matches the name of the message structure.

func (*Message) MiniObject

func (m *Message) MiniObject() *MiniObject

MiniObject: parent structure.

func (*Message) NumRedirectEntries

func (message *Message) NumRedirectEntries() uint

The function returns the following values:

  • gsize: number of entries stored in the message.

func (*Message) ParseAsyncDone

func (message *Message) ParseAsyncDone() ClockTime

ParseAsyncDone: extract the running_time from the async_done message.

MT safe.

The function returns the following values:

  • runningTime (optional): result location for the running_time or NULL.

func (*Message) ParseBuffering

func (message *Message) ParseBuffering() int

ParseBuffering extracts the buffering percent from the GstMessage. see also gst_message_new_buffering().

MT safe.

The function returns the following values:

  • percent (optional): return location for the percent.

func (*Message) ParseBufferingStats

func (message *Message) ParseBufferingStats() (mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64)

ParseBufferingStats extracts the buffering stats values from message.

The function returns the following values:

  • mode (optional): buffering mode, or NULL.
  • avgIn (optional): average input rate, or NULL.
  • avgOut (optional): average output rate, or NULL.
  • bufferingLeft (optional): amount of buffering time left in milliseconds, or NULL.

func (*Message) ParseClockLost

func (message *Message) ParseClockLost() Clocker

ParseClockLost extracts the lost clock from the GstMessage. The clock object returned remains valid until the message is freed.

MT safe.

The function returns the following values:

  • clock (optional): pointer to hold the lost clock.

func (*Message) ParseClockProvide

func (message *Message) ParseClockProvide() (Clocker, bool)

ParseClockProvide extracts the clock and ready flag from the GstMessage. The clock object returned remains valid until the message is freed.

MT safe.

The function returns the following values:

  • clock (optional): pointer to hold a clock object, or NULL.
  • ready (optional): pointer to hold the ready flag, or NULL.

func (*Message) ParseContextType

func (message *Message) ParseContextType() (string, bool)

ParseContextType: parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.

The function returns the following values:

  • contextType (optional): context type, or NULL.
  • ok indicating if the parsing succeeded.

func (*Message) ParseDeviceAdded

func (message *Message) ParseDeviceAdded() Devicer

ParseDeviceAdded parses a device-added message. The device-added message is produced by DeviceProvider or a DeviceMonitor. It announces the appearance of monitored devices.

The function returns the following values:

  • device (optional): location where to store a pointer to the new Device, or NULL.

func (*Message) ParseDeviceChanged

func (message *Message) ParseDeviceChanged() (device Devicer, changedDevice Devicer)

ParseDeviceChanged parses a device-changed message. The device-changed message is produced by DeviceProvider or a DeviceMonitor. 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.

The function returns the following values:

  • device (optional): location where to store a pointer to the updated version of the Device, or NULL.
  • changedDevice (optional): location where to store a pointer to the old version of the Device, or NULL.

func (*Message) ParseDeviceRemoved

func (message *Message) ParseDeviceRemoved() Devicer

ParseDeviceRemoved parses a device-removed message. The device-removed message is produced by DeviceProvider or a DeviceMonitor. It announces the disappearance of monitored devices.

The function returns the following values:

  • device (optional): location where to store a pointer to the removed Device, or NULL.

func (*Message) ParseError

func (message *Message) ParseError() (error, string)

ParseError 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:

...
switch (GST_MESSAGE_TYPE (msg)) {
  case GST_MESSAGE_ERROR: {
    GError *err = NULL;
    gchar *dbg_info = NULL;

    gst_message_parse_error (msg, &err, &dbg_info);
    g_printerr ("ERROR from element s: s\n",
        GST_OBJECT_NAME (msg->src), err->message);
    g_printerr ("Debugging info: s\n", (dbg_info) ? dbg_info : "none");
    g_error_free (err);
    g_free (dbg_info);
    break;
  }
  ...
}
...

MT safe.

The function returns the following values:

  • gerror (optional): location for the GError.
  • debug (optional): location for the debug message, or NULL.

func (*Message) ParseErrorDetails

func (message *Message) ParseErrorDetails() *Structure

ParseErrorDetails returns the optional details structure, may be NULL if none. The returned structure must not be freed.

The function returns the following values:

  • structure: pointer to the returned details.

func (*Message) ParseGroupID

func (message *Message) ParseGroupID() (uint, bool)

ParseGroupID: extract the group from the STREAM_START message.

The function returns the following values:

  • groupId (optional): result location for the group id or NULL.

  • ok: TRUE if the message had a group id set, FALSE otherwise

    MT safe.

func (*Message) ParseHaveContext

func (message *Message) ParseHaveContext() *Context

ParseHaveContext: extract the context from the HAVE_CONTEXT message.

MT safe.

The function returns the following values:

  • context (optional): result location for the context or NULL.

func (*Message) ParseInfo

func (message *Message) ParseInfo() (error, string)

ParseInfo 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.

The function returns the following values:

  • gerror (optional): location for the GError.
  • debug (optional): location for the debug message, or NULL.

func (*Message) ParseInfoDetails

func (message *Message) ParseInfoDetails() *Structure

ParseInfoDetails returns the optional details structure, may be NULL if none The returned structure must not be freed.

The function returns the following values:

  • structure: pointer to the returned details structure.

func (*Message) ParseInstantRateRequest

func (message *Message) ParseInstantRateRequest() float64

ParseInstantRateRequest parses the rate_multiplier from the instant-rate-request message.

The function returns the following values:

  • rateMultiplier (optional): return location for the rate, or NULL.

func (*Message) ParseNewClock

func (message *Message) ParseNewClock() Clocker

ParseNewClock extracts the new clock from the GstMessage. The clock object returned remains valid until the message is freed.

MT safe.

The function returns the following values:

  • clock (optional): pointer to hold the selected new clock.

func (*Message) ParseProgress

func (message *Message) ParseProgress() (typ ProgressType, code string, text string)

ParseProgress parses the progress type, code and text.

The function returns the following values:

  • typ (optional): location for the type.
  • code (optional): location for the code.
  • text (optional): location for the text.

func (*Message) ParsePropertyNotify

func (message *Message) ParsePropertyNotify() (GstObjector, string, *coreglib.Value)

ParsePropertyNotify parses a property-notify message. These will be posted on the bus only when set up with gst_element_add_property_notify_watch() or gst_element_add_property_deep_notify_watch().

The function returns the following values:

  • object (optional): location where to store a pointer to the object whose property got changed, or NULL.
  • propertyName (optional): return location for the name of the property that got changed, or NULL.
  • propertyValue (optional): return location for the new value of the property that got changed, or NULL. This will only be set if the property notify watch was told to include the value when it was set up.

func (*Message) ParseQos

func (message *Message) ParseQos() (live bool, runningTime uint64, streamTime uint64, timestamp uint64, duration uint64)

ParseQos: 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.

The function returns the following values:

  • live (optional): if the message was generated by a live element.
  • runningTime (optional): running time of the buffer that generated the message.
  • streamTime (optional): stream time of the buffer that generated the message.
  • timestamp (optional) timestamps of the buffer that generated the message.
  • duration (optional) of the buffer that generated the message.

func (*Message) ParseQosStats

func (message *Message) ParseQosStats() (format Format, processed uint64, dropped uint64)

ParseQosStats: 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.

The function returns the following values:

  • format (optional) 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 (optional): total number of units correctly processed since the last state change to READY or a flushing operation.
  • dropped (optional): total number of units dropped since the last state change to READY or a flushing operation.

func (*Message) ParseQosValues

func (message *Message) ParseQosValues() (int64, float64, int)

ParseQosValues: extract the QoS values that have been calculated/analysed from the QoS data

MT safe.

The function returns the following values:

  • jitter (optional): difference of the running-time against the deadline.
  • proportion (optional): long term prediction of the ideal rate relative to normal rate to get optimal quality.
  • quality (optional): element dependent integer value that specifies the current quality level of the element. The default maximum quality is 1000000.

func (*Message) ParseRequestState

func (message *Message) ParseRequestState() State

ParseRequestState: extract the requested state from the request_state message.

MT safe.

The function returns the following values:

  • state (optional): result location for the requested state or NULL.

func (*Message) ParseResetTime

func (message *Message) ParseResetTime() ClockTime

ParseResetTime: extract the running-time from the RESET_TIME message.

MT safe.

The function returns the following values:

  • runningTime (optional): result location for the running_time or NULL.

func (*Message) ParseSegmentDone

func (message *Message) ParseSegmentDone() (Format, int64)

ParseSegmentDone extracts the position and format from the segment done message.

MT safe.

The function returns the following values:

  • format (optional): result location for the format, or NULL.
  • position (optional): result location for the position, or NULL.

func (*Message) ParseSegmentStart

func (message *Message) ParseSegmentStart() (Format, int64)

ParseSegmentStart extracts the position and format from the segment start message.

MT safe.

The function returns the following values:

  • format (optional): result location for the format, or NULL.
  • position (optional): result location for the position, or NULL.

func (*Message) ParseStateChanged

func (message *Message) ParseStateChanged() (oldstate State, newstate State, pending State)

ParseStateChanged extracts the old and new states from the GstMessage.

Typical usage of this function might be:

...
switch (GST_MESSAGE_TYPE (msg)) {
  case GST_MESSAGE_STATE_CHANGED: {
    GstState old_state, new_state;

    gst_message_parse_state_changed (msg, &old_state, &new_state, NULL);
    g_print ("Element s changed state from s to s.\n",
        GST_OBJECT_NAME (msg->src),
        gst_element_state_get_name (old_state),
        gst_element_state_get_name (new_state));
    break;
  }
  ...
}
...

MT safe.

The function returns the following values:

  • oldstate (optional) previous state, or NULL.
  • newstate (optional): new (current) state, or NULL.
  • pending (optional) (target) state, or NULL.

func (*Message) ParseStepDone

func (message *Message) ParseStepDone() (format Format, amount uint64, rate float64, flush bool, intermediate bool, duration uint64, eos bool)

ParseStepDone: extract the values the step_done message.

MT safe.

The function returns the following values:

  • format (optional): result location for the format.
  • amount (optional): result location for the amount.
  • rate (optional): result location for the rate.
  • flush (optional): result location for the flush flag.
  • intermediate (optional): result location for the intermediate flag.
  • duration (optional): result location for the duration.
  • eos (optional): result location for the EOS flag.

func (*Message) ParseStepStart

func (message *Message) ParseStepStart() (active bool, format Format, amount uint64, rate float64, flush bool, intermediate bool)

ParseStepStart: extract the values from step_start message.

MT safe.

The function returns the following values:

  • active (optional): result location for the active flag.
  • format (optional): result location for the format.
  • amount (optional): result location for the amount.
  • rate (optional): result location for the rate.
  • flush (optional): result location for the flush flag.
  • intermediate (optional): result location for the intermediate flag.

func (*Message) ParseStreamCollection

func (message *Message) ParseStreamCollection() *StreamCollection

ParseStreamCollection parses a stream-collection message.

The function returns the following values:

  • collection (optional): location where to store a pointer to the StreamCollection, or NULL.

func (*Message) ParseStreamStatus

func (message *Message) ParseStreamStatus() (StreamStatusType, Elementer)

ParseStreamStatus 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.

The function returns the following values:

  • typ: pointer to hold the status type.
  • owner element of the message source.

func (*Message) ParseStreamsSelected

func (message *Message) ParseStreamsSelected() *StreamCollection

ParseStreamsSelected parses a streams-selected message.

The function returns the following values:

  • collection (optional): location where to store a pointer to the StreamCollection, or NULL.

func (*Message) ParseStructureChange

func (message *Message) ParseStructureChange() (StructureChangeType, Elementer, bool)

ParseStructureChange extracts the change type and completion status from the GstMessage.

MT safe.

The function returns the following values:

  • typ: pointer to hold the change type.
  • owner (optional) element of the message source.
  • busy (optional): pointer to hold whether the change is in progress or has been completed.

func (*Message) ParseToc

func (message *Message) ParseToc() (*Toc, bool)

ParseToc: extract the TOC from the Message. The TOC returned in the output argument is a copy; the caller must free it with gst_toc_unref() when done.

MT safe.

The function returns the following values:

  • toc: return location for the TOC.
  • updated: return location for the updated flag.

func (*Message) ParseWarning

func (message *Message) ParseWarning() (error, string)

ParseWarning 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.

The function returns the following values:

  • gerror (optional): location for the GError.
  • debug (optional): location for the debug message, or NULL.

func (*Message) ParseWarningDetails

func (message *Message) ParseWarningDetails() *Structure

ParseWarningDetails returns the optional details structure, may be NULL if none The returned structure must not be freed.

The function returns the following values:

  • structure: pointer to the returned details structure.

func (*Message) Seqnum

func (message *Message) Seqnum() uint32

Seqnum: 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.

The function returns the following values:

  • guint32 message's sequence number.

    MT safe.

func (*Message) SetBufferingStats

func (message *Message) SetBufferingStats(mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64)

SetBufferingStats configures the buffering stats values in message.

The function takes the following parameters:

  • mode: buffering mode.
  • avgIn: average input rate.
  • avgOut: average output rate.
  • bufferingLeft: amount of buffering time left in milliseconds.

func (*Message) SetGroupID

func (message *Message) SetGroupID(groupId uint)

SetGroupID 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.

The function takes the following parameters:

  • groupId: group id.

func (*Message) SetQosStats

func (message *Message) SetQosStats(format Format, processed uint64, dropped uint64)

SetQosStats: 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.

The function takes the following parameters:

  • 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: total number of units correctly processed since the last state change to READY or a flushing operation.
  • dropped: total number of units dropped since the last state change to READY or a flushing operation.

func (*Message) SetQosValues

func (message *Message) SetQosValues(jitter int64, proportion float64, quality int)

SetQosValues: set the QoS values that have been calculated/analysed from the QoS data

MT safe.

The function takes the following parameters:

  • jitter: difference of the running-time against the deadline.
  • proportion: long term prediction of the ideal rate relative to normal rate to get optimal quality.
  • quality: element dependent integer value that specifies the current quality level of the element. The default maximum quality is 1000000.

func (*Message) SetSeqnum

func (message *Message) SetSeqnum(seqnum uint32)

SetSeqnum: 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.

The function takes the following parameters:

  • seqnum: sequence number.

func (*Message) SetStreamStatusObject

func (message *Message) SetStreamStatusObject(object *coreglib.Value)

SetStreamStatusObject configures the object handling the streaming thread. This is usually a GstTask object but other objects might be added in the future.

The function takes the following parameters:

  • object controlling the streaming.

func (*Message) SetTimestamp

func (m *Message) SetTimestamp(timestamp uint64)

Timestamp: timestamp of the message.

func (*Message) Src

func (m *Message) Src() GstObjector

Src: src of the message.

func (*Message) StreamStatusObject

func (message *Message) StreamStatusObject() *coreglib.Value

StreamStatusObject extracts the object managing the streaming thread from message.

The function returns the following values:

  • value (optional): GValue containing the object that manages the streaming thread. This object is usually of type GstTask but other types can be added in the future. The object remains valid as long as message is valid.

func (*Message) StreamsSelectedAdd

func (message *Message) StreamsSelectedAdd(stream *Stream)

StreamsSelectedAdd adds the stream to the message.

The function takes the following parameters:

  • stream to add to message.

func (*Message) StreamsSelectedGetSize

func (message *Message) StreamsSelectedGetSize() uint

StreamsSelectedGetSize returns the number of streams contained in the message.

The function returns the following values:

  • guint: number of streams contained within.

func (*Message) StreamsSelectedGetStream

func (message *Message) StreamsSelectedGetStream(idx uint) *Stream

StreamsSelectedGetStream retrieves the Stream with index index from the message.

The function takes the following parameters:

  • idx: index of the stream to retrieve.

The function returns the following values:

  • stream (optional): Stream.

func (*Message) Structure

func (message *Message) Structure() *Structure

Structure access the structure of the message.

The function returns the following values:

  • structure (optional) of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes invalid when you free the message.

    MT safe.

func (*Message) Timestamp

func (m *Message) Timestamp() uint64

Timestamp: timestamp of the message.

func (*Message) Type

func (m *Message) Type() MessageType

Type of the message.

func (*Message) WritableStructure

func (message *Message) WritableStructure() *Structure

WritableStructure: get a writable version of the structure.

The function returns the following values:

  • structure of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes invalid when you free the message. This function checks if message is writable and will never return NULL.

    MT safe.

type MessageType

type MessageType C.guint

MessageType: different message types that are available.

const (
	// MessageUnknown: undefined message.
	MessageUnknown MessageType = 0b0
	// MessageEos: 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 = 0b1
	// MessageError: 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 = 0b10
	// MessageWarning: warning occurred.
	MessageWarning MessageType = 0b100
	// MessageInfo: info message occurred.
	MessageInfo MessageType = 0b1000
	// MessageTag: tag was found.
	MessageTag MessageType = 0b10000
	// MessageBuffering: 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 = 0b100000
	// MessageStateChanged: state change happened.
	MessageStateChanged MessageType = 0b1000000
	// MessageStateDirty: element changed state in a streaming thread. This
	// message is deprecated.
	MessageStateDirty MessageType = 0b10000000
	// MessageStepDone: stepping operation finished.
	MessageStepDone MessageType = 0b100000000
	// MessageClockProvide: element notifies its capability of providing a
	// clock. This message is used internally and never forwarded to the
	// application.
	MessageClockProvide MessageType = 0b1000000000
	// MessageClockLost: 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 = 0b10000000000
	// MessageNewClock: new clock was selected in the pipeline.
	MessageNewClock MessageType = 0b100000000000
	// MessageStructureChange: structure of the pipeline changed. This message
	// is used internally and never forwarded to the application.
	MessageStructureChange MessageType = 0b1000000000000
	// MessageStreamStatus status about a stream, emitted when it starts, stops,
	// errors, etc..
	MessageStreamStatus MessageType = 0b10000000000000
	// MessageApplication: message posted by the application, possibly via an
	// application-specific element.
	MessageApplication MessageType = 0b100000000000000
	// MessageElement: element-specific message, see the specific element's
	// documentation.
	MessageElement MessageType = 0b1000000000000000
	// MessageSegmentStart: pipeline started playback of a segment. This message
	// is used internally and never forwarded to the application.
	MessageSegmentStart MessageType = 0b10000000000000000
	// MessageSegmentDone: 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 = 0b100000000000000000
	// MessageDurationChanged: duration of a pipeline changed. The application
	// can get the new duration with a duration query.
	MessageDurationChanged MessageType = 0b1000000000000000000
	// MessageLatency: posted by elements when their latency changes. The
	// application should recalculate and distribute a new latency.
	MessageLatency MessageType = 0b10000000000000000000
	// MessageAsyncStart: posted by elements when they start an ASYNC
	// StateChange. This message is not forwarded to the application but is used
	// internally.
	MessageAsyncStart MessageType = 0b100000000000000000000
	// MessageAsyncDone: posted by elements when they complete an ASYNC
	// StateChange. The application will only receive this message from the
	// toplevel pipeline.
	MessageAsyncDone MessageType = 0b1000000000000000000000
	// MessageRequestState: 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 = 0b10000000000000000000000
	// MessageStepStart: stepping operation was started.
	MessageStepStart MessageType = 0b100000000000000000000000
	// MessageQos: buffer was dropped or an element changed its processing
	// strategy for Quality of Service reasons.
	MessageQos MessageType = 0b1000000000000000000000000
	// MessageProgress progress message.
	MessageProgress MessageType = 0b10000000000000000000000000
	// MessageToc: new table of contents (TOC) was found or previously found TOC
	// was updated.
	MessageToc MessageType = 0b100000000000000000000000000
	// MessageResetTime: 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 = 0b1000000000000000000000000000
	// MessageStreamStart: 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 = 0b10000000000000000000000000000
	// MessageNeedContext: message indicating that an element wants a specific
	// context (Since: 1.2).
	MessageNeedContext MessageType = 0b100000000000000000000000000000
	// MessageHaveContext: message indicating that an element created a context
	// (Since: 1.2).
	MessageHaveContext MessageType = 0b1000000000000000000000000000000
	// MessageExtended: 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 = 0b10000000000000000000000000000000
	// MessageDeviceAdded: message indicating a Device was added to a
	// DeviceProvider (Since: 1.4).
	MessageDeviceAdded MessageType = 0b10000000000000000000000000000001
	// MessageDeviceRemoved: message indicating a Device was removed from a
	// DeviceProvider (Since: 1.4).
	MessageDeviceRemoved MessageType = 0b10000000000000000000000000000010
	// MessagePropertyNotify: message indicating a #GObject property has changed
	// (Since: 1.10).
	MessagePropertyNotify MessageType = 0b10000000000000000000000000000011
	// MessageStreamCollection: message indicating a new StreamCollection is
	// available (Since: 1.10).
	MessageStreamCollection MessageType = 0b10000000000000000000000000000100
	// MessageStreamsSelected: message indicating the active selection of
	// Streams has changed (Since: 1.10).
	MessageStreamsSelected MessageType = 0b10000000000000000000000000000101
	// MessageRedirect: 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 = 0b10000000000000000000000000000110
	// MessageDeviceChanged: message indicating a Device was changed a
	// DeviceProvider (Since: 1.16).
	MessageDeviceChanged MessageType = 0b10000000000000000000000000000111
	// MessageInstantRateRequest: 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 = 0b10000000000000000000000000001000
	// MessageAny: mask for all of the above messages.
	MessageAny MessageType = 0b11111111111111111111111111111111
)

func (MessageType) Has

func (m MessageType) Has(other MessageType) bool

Has returns true if m contains other.

func (MessageType) String

func (m MessageType) String() string

String returns the names in string for MessageType.

type Meta

type Meta struct {
	// contains filtered or unexported fields
}

Meta structure should be included as the first member of a Buffer 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 MetaInfo 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 Buffer for how the metadata can be added, retrieved and removed from buffers.

An instance of this type is always passed by reference.

func (*Meta) CompareSeqnum

func (meta1 *Meta) CompareSeqnum(meta2 *Meta) int

CompareSeqnum: meta sequence number compare function. Can be used as Func or a DataFunc.

The function takes the following parameters:

  • meta2: Meta.

The function returns the following values:

  • gint: negative number if meta1 comes before meta2, 0 if both metas have an equal sequence number, or a positive integer if meta1 comes after meta2.

func (*Meta) Flags

func (m *Meta) Flags() MetaFlags

Flags: extra flags for the metadata.

func (*Meta) Info

func (m *Meta) Info() *MetaInfo

Info: pointer to the MetaInfo.

func (*Meta) Seqnum

func (meta *Meta) Seqnum() uint64

Seqnum gets seqnum for this meta.

The function returns the following values:

type MetaFlags

type MetaFlags C.guint

MetaFlags: extra metadata flags.

const (
	// MetaFlagNone: no flags.
	MetaFlagNone MetaFlags = 0b0
	// MetaFlagReadonly: metadata should not be modified.
	MetaFlagReadonly MetaFlags = 0b1
	// MetaFlagPooled: metadata is managed by a bufferpool.
	MetaFlagPooled MetaFlags = 0b10
	// MetaFlagLocked: metadata should not be removed.
	MetaFlagLocked MetaFlags = 0b100
	// MetaFlagLast: additional flags can be added starting from this flag.
	MetaFlagLast MetaFlags = 0b10000000000000000
)

func (MetaFlags) Has

func (m MetaFlags) Has(other MetaFlags) bool

Has returns true if m contains other.

func (MetaFlags) String

func (m MetaFlags) String() string

String returns the names in string for MetaFlags.

type MetaInfo

type MetaInfo struct {
	// contains filtered or unexported fields
}

MetaInfo provides information about a specific metadata structure.

An instance of this type is always passed by reference.

func MetaGetInfo

func MetaGetInfo(impl string) *MetaInfo

MetaGetInfo: lookup a previously registered meta info structure by its implementation name impl.

The function takes the following parameters:

  • impl: name.

The function returns the following values:

  • metaInfo (optional) with impl, or NULL when no such metainfo exists.

func MetaRegisterCustom

func MetaRegisterCustom(name string, tags []string, transformFunc CustomMetaTransformFunction) *MetaInfo

MetaRegisterCustom: register a new custom Meta implementation, backed by an opaque structure holding a Structure.

The registered info can be retrieved later with gst_meta_get_info() by using name as the key.

The backing Structure can be retrieved with gst_custom_meta_get_structure(), its mutability is conditioned by the writability of the buffer the meta is attached to.

When transform_func is NULL, the meta and its backing Structure will always be copied when the transform operation is copy, other operations are discarded, copy regions are ignored.

The function takes the following parameters:

  • name of the Meta implementation.
  • tags for api.
  • transformFunc (optional): MetaTransformFunction.

The function returns the following values:

  • metaInfo that can be used to access metadata.

func ParentBufferMetaGetInfo

func ParentBufferMetaGetInfo() *MetaInfo

ParentBufferMetaGetInfo gets the global MetaInfo describing the ParentBufferMeta meta.

The function returns the following values:

  • metaInfo: MetaInfo.

func ProtectionMetaGetInfo

func ProtectionMetaGetInfo() *MetaInfo

The function returns the following values:

func ReferenceTimestampMetaGetInfo

func ReferenceTimestampMetaGetInfo() *MetaInfo

ReferenceTimestampMetaGetInfo gets the global MetaInfo describing the ReferenceTimestampMeta meta.

The function returns the following values:

  • metaInfo: MetaInfo.

func (*MetaInfo) IsCustom

func (info *MetaInfo) IsCustom() bool

The function returns the following values:

  • ok: whether info was registered as a CustomMeta with gst_meta_register_custom().

type MetaTransformCopy

type MetaTransformCopy struct {
	// contains filtered or unexported fields
}

MetaTransformCopy: extra data passed to a "gst-copy" transform MetaTransformFunction.

An instance of this type is always passed by reference.

func NewMetaTransformCopy

func NewMetaTransformCopy(region bool, offset, size uint) MetaTransformCopy

NewMetaTransformCopy creates a new MetaTransformCopy instance from the given fields. Beware that this function allocates on the Go heap; be careful when using it!

func (*MetaTransformCopy) Offset

func (m *MetaTransformCopy) Offset() uint

Offset: offset to copy, 0 if region is FALSE, otherwise > 0.

func (*MetaTransformCopy) Region

func (m *MetaTransformCopy) Region() bool

Region: TRUE if only region is copied.

func (*MetaTransformCopy) SetOffset

func (m *MetaTransformCopy) SetOffset(offset uint)

Offset: offset to copy, 0 if region is FALSE, otherwise > 0.

func (*MetaTransformCopy) SetRegion

func (m *MetaTransformCopy) SetRegion(region bool)

Region: TRUE if only region is copied.

func (*MetaTransformCopy) SetSize

func (m *MetaTransformCopy) SetSize(size uint)

Size: size to copy, -1 or the buffer size when region is FALSE.

func (*MetaTransformCopy) Size

func (m *MetaTransformCopy) Size() uint

Size: size to copy, -1 or the buffer size when region is FALSE.

type MiniObject

type MiniObject struct {
	// contains filtered or unexported fields
}

MiniObject is a simple structure that can be used to implement refcounted types.

Subclasses will include MiniObject as the first member in their structure and then call gst_mini_object_init() to initialize the MiniObject 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 MiniObject 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.

An instance of this type is always passed by reference.

func (*MiniObject) AddParent

func (object *MiniObject) AddParent(parent *MiniObject)

AddParent: 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.

The function takes the following parameters:

  • parent MiniObject.

func (*MiniObject) IsWritable

func (miniObject *MiniObject) IsWritable() bool

IsWritable: 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.

The function returns the following values:

  • ok: TRUE if the object is writable.

func (*MiniObject) Lock

func (object *MiniObject) Lock(flags LockFlags) bool

Lock the mini-object with the specified access mode in flags.

The function takes the following parameters:

  • flags: LockFlags.

The function returns the following values:

  • ok: TRUE if object could be locked.

func (*MiniObject) Qdata

func (object *MiniObject) Qdata(quark glib.Quark) unsafe.Pointer

Qdata: this function gets back user data pointers stored via gst_mini_object_set_qdata().

The function takes the following parameters:

  • quark naming the user data pointer.

The function returns the following values:

  • gpointer (optional): user data pointer set, or NULL.

func (*MiniObject) RemoveParent

func (object *MiniObject) RemoveParent(parent *MiniObject)

RemoveParent: this removes parent as a parent for object. See gst_mini_object_add_parent().

The function takes the following parameters:

  • parent MiniObject.

func (*MiniObject) StealQdata

func (object *MiniObject) StealQdata(quark glib.Quark) unsafe.Pointer

StealQdata: 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).

The function takes the following parameters:

  • quark naming the user data pointer.

The function returns the following values:

  • gpointer (optional): user data pointer set, or NULL.

func (*MiniObject) Unlock

func (object *MiniObject) Unlock(flags LockFlags)

Unlock the mini-object with the specified access mode in flags.

The function takes the following parameters:

  • flags: LockFlags.

type MiniObjectFlags

type MiniObjectFlags C.guint

MiniObjectFlags flags for the mini object.

const (
	// MiniObjectFlagLockable: object can be locked and unlocked with
	// gst_mini_object_lock() and gst_mini_object_unlock().
	MiniObjectFlagLockable MiniObjectFlags = 0b1
	// MiniObjectFlagLockReadonly: object is permanently locked in READONLY
	// mode. Only read locks can be performed on the object.
	MiniObjectFlagLockReadonly MiniObjectFlags = 0b10
	// MiniObjectFlagMayBeLeaked: 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 = 0b100
	// MiniObjectFlagLast: first flag that can be used by subclasses.
	MiniObjectFlagLast MiniObjectFlags = 0b10000
)

func (MiniObjectFlags) Has

func (m MiniObjectFlags) Has(other MiniObjectFlags) bool

Has returns true if m contains other.

func (MiniObjectFlags) String

func (m MiniObjectFlags) String() string

String returns the names in string for MiniObjectFlags.

type MiniObjectNotify

type MiniObjectNotify func(obj *MiniObject)

MiniObjectNotify 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 ObjectClass

type ObjectClass struct {
	// contains filtered or unexported fields
}

ObjectClass: GStreamer base object class.

An instance of this type is always passed by reference.

func (*ObjectClass) PathStringSeparator

func (o *ObjectClass) PathStringSeparator() string

PathStringSeparator: separator used by gst_object_get_path_string().

type ObjectFlags

type ObjectFlags C.guint

ObjectFlags: standard flags that an gstobject may have.

const (
	// ObjectFlagMayBeLeaked: 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 = 0b1
	// ObjectFlagLast subclasses can add additional flags starting from this
	// flag.
	ObjectFlagLast ObjectFlags = 0b10000
)

func (ObjectFlags) Has

func (o ObjectFlags) Has(other ObjectFlags) bool

Has returns true if o contains other.

func (ObjectFlags) String

func (o ObjectFlags) String() string

String returns the names in string for ObjectFlags.

type Pad

type Pad struct {
	GstObject
	// contains filtered or unexported fields
}

Pad is linked to other elements via "pads", which are extremely light-weight generic link points.

Pads have a PadDirection, source pads produce data, sink pads consume data.

Pads are typically created from a PadTemplate with gst_pad_new_from_template() and are then added to a Element. 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 Element 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 Element 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 Event 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.

func NewPad

func NewPad(name string, direction PadDirection) *Pad

NewPad 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.

The function takes the following parameters:

  • name (optional) of the new pad.
  • direction of the pad.

The function returns the following values:

  • pad: new Pad.

    MT safe.

func NewPadFromStaticTemplate

func NewPadFromStaticTemplate(templ *StaticPadTemplate, name string) *Pad

NewPadFromStaticTemplate 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.

The function takes the following parameters:

  • templ to use.
  • name of the pad.

The function returns the following values:

  • pad: new Pad.

func NewPadFromTemplate

func NewPadFromTemplate(templ *PadTemplate, name string) *Pad

NewPadFromTemplate 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.

The function takes the following parameters:

  • templ: pad template to use.
  • name (optional) of the pad.

The function returns the following values:

  • pad: new Pad.

func (*Pad) ActivateMode

func (pad *Pad) ActivateMode(mode PadMode, active bool) bool

ActivateMode 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.

The function takes the following parameters:

  • mode: requested activation mode.
  • active: whether or not the pad should be active.

The function returns the following values:

  • ok: TRUE if the operation was successful.

    MT safe.

func (*Pad) AddProbe

func (pad *Pad) AddProbe(mask PadProbeType, callback PadProbeCallback) uint32

AddProbe: 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.

The function takes the following parameters:

  • mask: probe mask.
  • callback that will be called with notifications of the pad state.

The function returns the following values:

  • gulong: id or 0 if no probe is pending. The id can be used to remove the probe with gst_pad_remove_probe(). When using GST_PAD_PROBE_TYPE_IDLE it can happen that the probe can be run immediately and if the probe returns GST_PAD_PROBE_REMOVE this functions returns 0.

    MT safe.

func (*Pad) AllowedCaps

func (pad *Pad) AllowedCaps() *Caps

AllowedCaps 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.

The function returns the following values:

  • caps (optional): allowed Caps of the pad link. Unref the caps when you no longer need it. This function returns NULL when pad has no peer.

    MT safe.

func (srcpad *Pad) CanLink(sinkpad *Pad) bool

CanLink checks if the source pad and the sink pad are compatible so they can be linked.

The function takes the following parameters:

  • sinkpad: sink Pad.

The function returns the following values:

  • ok: TRUE if the pads can be linked.

func (*Pad) Chain

func (pad *Pad) Chain(buffer *Buffer) FlowReturn

Chain a buffer to pad.

The function returns T_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 T_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. T_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.

The function takes the following parameters:

  • buffer to send, return GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the pad.

    MT safe.

func (*Pad) ChainList

func (pad *Pad) ChainList(list *BufferList) FlowReturn

ChainList: chain a bufferlist to pad.

The function returns T_FLOW_FLUSHING if the pad was flushing.

If pad was not negotiated properly with a CAPS event, this function returns T_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. T_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.

The function takes the following parameters:

  • list to send, return GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the pad.

func (*Pad) CheckReconfigure

func (pad *Pad) CheckReconfigure() bool

CheckReconfigure: check and clear the T_PAD_FLAG_NEED_RECONFIGURE flag on pad and return TRUE if the flag was set.

The function returns the following values:

  • ok: TRUE is the GST_PAD_FLAG_NEED_RECONFIGURE flag was set on pad.

func (*Pad) ConnectLinked

func (pad *Pad) ConnectLinked(f func(peer *Pad)) coreglib.SignalHandle

ConnectLinked signals that a pad has been linked to the peer pad.

func (*Pad) ConnectUnlinked

func (pad *Pad) ConnectUnlinked(f func(peer *Pad)) coreglib.SignalHandle

ConnectUnlinked signals that a pad has been unlinked from the peer pad.

func (*Pad) CreateStreamID

func (pad *Pad) CreateStreamID(parent Elementer, streamId string) string

CreateStreamID creates a stream-id for the source Pad pad by combining the upstream information with the optional stream_id of the stream of pad. pad must have a parent Element 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.

The function takes the following parameters:

  • parent: parent Element of pad.
  • streamId (optional): stream-id.

The function returns the following values:

  • utf8: stream-id for pad. g_free() after usage.

func (*Pad) CurrentCaps

func (pad *Pad) CurrentCaps() *Caps

CurrentCaps gets the capabilities currently configured on pad with the last T_EVENT_CAPS event.

The function returns the following values:

  • caps (optional): current caps of the pad with incremented ref-count or NULL when pad has no caps. Unref after usage.

func (*Pad) Direction

func (pad *Pad) Direction() PadDirection

Direction gets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK.

The function returns the following values:

  • padDirection of the pad.

    MT safe.

func (*Pad) ElementPrivate

func (pad *Pad) ElementPrivate() unsafe.Pointer

ElementPrivate gets the private data of a pad. No locking is performed in this function.

The function returns the following values:

  • gpointer (optional) to the private data.

func (*Pad) EventDefault

func (pad *Pad) EventDefault(parent GstObjector, event *Event) bool

EventDefault 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.

The function takes the following parameters:

  • parent (optional) of pad or NULL.
  • event to handle.

The function returns the following values:

  • ok: TRUE if the event was sent successfully.

func (*Pad) Forward

func (pad *Pad) Forward(forward PadForwardFunction) bool

Forward 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.

The function takes the following parameters:

  • forward: PadForwardFunction.

The function returns the following values:

  • ok: TRUE if one of the dispatcher functions returned TRUE.

func (*Pad) HasCurrentCaps

func (pad *Pad) HasCurrentCaps() bool

HasCurrentCaps: check if pad has caps set on it with a T_EVENT_CAPS event.

The function returns the following values:

  • ok: TRUE when pad has caps associated with it.

func (*Pad) IsActive

func (pad *Pad) IsActive() bool

IsActive: query if a pad is active.

The function returns the following values:

  • ok: TRUE if the pad is active.

    MT safe.

func (*Pad) IsBlocked

func (pad *Pad) IsBlocked() bool

IsBlocked 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()).

The function returns the following values:

  • ok: TRUE if the pad is blocked.

    MT safe.

func (*Pad) IsBlocking

func (pad *Pad) IsBlocking() bool

IsBlocking checks if the pad is blocking or not. This is a guaranteed state of whether the pad is actually blocking on a Buffer or a Event.

The function returns the following values:

  • ok: TRUE if the pad is blocking.

    MT safe.

func (*Pad) IsLinked

func (pad *Pad) IsLinked() bool

IsLinked checks if a pad is linked to another pad or not.

The function returns the following values:

  • ok: TRUE if the pad is linked, FALSE otherwise.

    MT safe.

func (pad *Pad) IterateInternalLinks() *Iterator

IterateInternalLinks gets an iterator for the pads to which the given pad is linked to inside of the parent element.

Each Pad element yielded by the iterator will have its refcount increased, so unref after use.

Free-function: gst_iterator_free.

The function returns the following values:

  • iterator (optional): new Iterator of Pad or NULL when the pad does not have an iterator function configured. Use gst_iterator_free() after usage.

func (*Pad) IterateInternalLinksDefault

func (pad *Pad) IterateInternalLinksDefault(parent GstObjector) *Iterator

IterateInternalLinksDefault: 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().

The function takes the following parameters:

  • parent (optional) of pad or NULL.

The function returns the following values:

  • iterator (optional) of Pad, or NULL if pad has no parent. Unref each returned pad with gst_object_unref().

func (*Pad) LastFlowReturn

func (pad *Pad) LastFlowReturn() FlowReturn

LastFlowReturn gets the FlowReturn return from the last data passed by this pad.

The function returns the following values:

func (srcpad *Pad) Link(sinkpad *Pad) PadLinkReturn

Link links the source pad and the sink pad.

The function takes the following parameters:

  • sinkpad: sink Pad to link.

The function returns the following values:

  • padLinkReturn: result code indicating if the connection worked or what went wrong.

    MT Safe.

func (*Pad) LinkFull

func (srcpad *Pad) LinkFull(sinkpad *Pad, flags PadLinkCheck) PadLinkReturn

LinkFull 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 PadLinkCheck for more information.

MT Safe.

The function takes the following parameters:

  • sinkpad: sink Pad to link.
  • flags checks to validate when linking.

The function returns the following values:

  • padLinkReturn: result code indicating if the connection worked or what went wrong.

func (*Pad) LinkMaybeGhosting

func (src *Pad) LinkMaybeGhosting(sink *Pad) bool

LinkMaybeGhosting links src to sink, creating any GhostPad's in between as necessary.

This is a convenience function to save having to create and add intermediate GhostPad's as required for linking across Bin boundaries.

If src or sink pads don't have parent elements or do not share a common ancestor, the link will fail.

The function takes the following parameters:

  • sink: Pad.

The function returns the following values:

  • ok: whether the link succeeded.

func (*Pad) LinkMaybeGhostingFull

func (src *Pad) LinkMaybeGhostingFull(sink *Pad, flags PadLinkCheck) bool

LinkMaybeGhostingFull links src to sink, creating any GhostPad's in between as necessary.

This is a convenience function to save having to create and add intermediate GhostPad's as required for linking across Bin 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.

The function takes the following parameters:

  • sink: Pad.
  • flags: some PadLinkCheck flags.

The function returns the following values:

  • ok: whether the link succeeded.

func (*Pad) MarkReconfigure

func (pad *Pad) MarkReconfigure()

MarkReconfigure: mark a pad for needing reconfiguration. The next call to gst_pad_check_reconfigure() will return TRUE after this call.

func (*Pad) NeedsReconfigure

func (pad *Pad) NeedsReconfigure() bool

NeedsReconfigure: check the T_PAD_FLAG_NEED_RECONFIGURE flag on pad and return TRUE if the flag was set.

The function returns the following values:

  • ok: TRUE is the GST_PAD_FLAG_NEED_RECONFIGURE flag is set on pad.

func (*Pad) Offset

func (pad *Pad) Offset() int64

Offset: get the offset applied to the running time of pad. pad has to be a source pad.

The function returns the following values:

  • gint64: offset.

func (*Pad) PadTemplate

func (pad *Pad) PadTemplate() *PadTemplate

PadTemplate gets the template for pad.

The function returns the following values:

  • padTemplate (optional) from which this pad was instantiated, or NULL if this pad has no template. Unref after usage.

func (*Pad) PadTemplateCaps

func (pad *Pad) PadTemplateCaps() *Caps

PadTemplateCaps gets the capabilities for pad's template.

The function returns the following values:

  • caps of this pad template. Unref after usage.

func (*Pad) ParentElement

func (pad *Pad) ParentElement() Elementer

ParentElement gets the parent of pad, cast to a Element. If a pad has no parent or its parent is not an element, return NULL.

The function returns the following values:

  • element (optional): parent of the pad. The caller has a reference on the parent, so unref when you're finished with it.

    MT safe.

func (*Pad) PauseTask

func (pad *Pad) PauseTask() bool

PauseTask: 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.

The function returns the following values:

  • ok: TRUE if the task could be paused or FALSE when the pad has no task.

func (*Pad) Peer

func (pad *Pad) Peer() *Pad

Peer gets the peer of pad. This function refs the peer pad so you need to unref it after use.

The function returns the following values:

  • ret (optional): peer Pad. Unref after usage.

    MT safe.

func (*Pad) PeerQuery

func (pad *Pad) PeerQuery(query *Query) bool

PeerQuery performs gst_pad_query() on the peer of pad.

The caller is responsible for both the allocation and deallocation of the query structure.

The function takes the following parameters:

  • query to perform.

The function returns the following values:

  • ok: TRUE if the query could be performed. This function returns FALSE if pad has no peer.

func (*Pad) PeerQueryAcceptCaps

func (pad *Pad) PeerQueryAcceptCaps(caps *Caps) bool

PeerQueryAcceptCaps: check if the peer of pad accepts caps. If pad has no peer, this function returns TRUE.

The function takes the following parameters:

  • caps to check on the pad.

The function returns the following values:

  • ok: TRUE if the peer of pad can accept the caps or pad has no peer.

func (*Pad) PeerQueryCaps

func (pad *Pad) PeerQueryCaps(filter *Caps) *Caps

PeerQueryCaps 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.

The function takes the following parameters:

  • filter (optional) filter, or NULL.

The function returns the following values:

  • caps of the peer pad with incremented ref-count. When there is no peer pad, this function returns filter or, when filter is NULL, ANY caps.

func (*Pad) PeerQueryConvert

func (pad *Pad) PeerQueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool)

PeerQueryConvert queries the peer pad of a given sink pad to convert src_val in src_format to dest_format.

The function takes the following parameters:

  • srcFormat to convert from.
  • srcVal: value to convert.
  • destFormat to convert to.

The function returns the following values:

  • destVal: pointer to the result.
  • ok: TRUE if the query could be performed.

func (*Pad) PeerQueryDuration

func (pad *Pad) PeerQueryDuration(format Format) (int64, bool)

PeerQueryDuration queries the peer pad of a given sink pad for the total stream duration.

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • duration (optional): location in which to store the total duration, or NULL.
  • ok: TRUE if the query could be performed.

func (*Pad) PeerQueryPosition

func (pad *Pad) PeerQueryPosition(format Format) (int64, bool)

PeerQueryPosition queries the peer of a given sink pad for the stream position.

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • cur (optional): location in which to store the current position, or NULL.
  • ok: TRUE if the query could be performed.

func (*Pad) ProxyQueryAcceptCaps

func (pad *Pad) ProxyQueryAcceptCaps(query *Query) bool

ProxyQueryAcceptCaps 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.

The function takes the following parameters:

  • query: ACCEPT_CAPS Query.

The function returns the following values:

  • ok: TRUE if query could be executed.

func (*Pad) ProxyQueryCaps

func (pad *Pad) ProxyQueryCaps(query *Query) bool

ProxyQueryCaps 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.

The function takes the following parameters:

  • query: CAPS Query.

The function returns the following values:

  • ok: TRUE if query could be executed.

func (*Pad) PullRange

func (pad *Pad) PullRange(offset uint64, size uint) (*Buffer, FlowReturn)

PullRange 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 T_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 Buffer will be placed in buffer when this function returns T_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 Buffer, the buffer will be filled with the result data when this function returns T_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.

The function takes the following parameters:

  • offset: start offset of the buffer.
  • size: length of the buffer.

The function returns the following values:

  • buffer: pointer to hold the Buffer, returns GST_FLOW_ERROR if NULL.

  • flowReturn from the peer pad.

    MT safe.

func (*Pad) Push

func (pad *Pad) Push(buffer *Buffer) FlowReturn

Push 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, T_FLOW_NOT_LINKED will be returned.

In all cases, success or failure, the caller loses its reference to buffer after calling this function.

The function takes the following parameters:

  • buffer to push returns GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the peer pad.

    MT safe.

func (*Pad) PushEvent

func (pad *Pad) PushEvent(event *Event) bool

PushEvent 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.

The function takes the following parameters:

  • event to send to the pad.

The function returns the following values:

  • ok: TRUE if the event was handled.

    MT safe.

func (*Pad) PushList

func (pad *Pad) PushList(list *BufferList) FlowReturn

PushList 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, T_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 Buffer and chained via gst_pad_chain().

In all cases, success or failure, the caller loses its reference to list after calling this function.

The function takes the following parameters:

  • list to push returns GST_FLOW_ERROR if not.

The function returns the following values:

  • flowReturn from the peer pad.

    MT safe.

func (*Pad) Query

func (pad *Pad) Query(query *Query) bool

Query 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.

The function takes the following parameters:

  • query to perform.

The function returns the following values:

  • ok: TRUE if the query could be performed.

func (*Pad) QueryAcceptCaps

func (pad *Pad) QueryAcceptCaps(caps *Caps) bool

QueryAcceptCaps: check if the given pad accepts the caps.

The function takes the following parameters:

  • caps to check on the pad.

The function returns the following values:

  • ok: TRUE if the pad can accept the caps.

func (*Pad) QueryCaps

func (pad *Pad) QueryCaps(filter *Caps) *Caps

QueryCaps 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 Caps, use gst_caps_make_writable() before modifying the caps.

The function takes the following parameters:

  • filter (optional): suggested Caps, or NULL.

The function returns the following values:

  • caps of the pad with incremented ref-count.

func (*Pad) QueryConvert

func (pad *Pad) QueryConvert(srcFormat Format, srcVal int64, destFormat Format) (int64, bool)

QueryConvert queries a pad to convert src_val in src_format to dest_format.

The function takes the following parameters:

  • srcFormat to convert from.
  • srcVal: value to convert.
  • destFormat to convert to.

The function returns the following values:

  • destVal: pointer to the result.
  • ok: TRUE if the query could be performed.

func (*Pad) QueryDefault

func (pad *Pad) QueryDefault(parent GstObjector, query *Query) bool

QueryDefault 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.

The function takes the following parameters:

  • parent (optional) of pad or NULL.
  • query to handle.

The function returns the following values:

  • ok: TRUE if the query was performed successfully.

func (*Pad) QueryDuration

func (pad *Pad) QueryDuration(format Format) (int64, bool)

QueryDuration queries a pad for the total stream duration.

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • duration (optional): location in which to store the total duration, or NULL.
  • ok: TRUE if the query could be performed.

func (*Pad) QueryPosition

func (pad *Pad) QueryPosition(format Format) (int64, bool)

QueryPosition queries a pad for the stream position.

The function takes the following parameters:

  • format: Format requested.

The function returns the following values:

  • cur (optional): location in which to store the current position, or NULL.
  • ok: TRUE if the query could be performed.

func (*Pad) Range

func (pad *Pad) Range(offset uint64, size uint) (*Buffer, FlowReturn)

Range: when pad is flushing this function returns T_FLOW_FLUSHING immediately and buffer is NULL.

Calls the getrange function of pad, see PadGetRangeFunction for a description of a getrange function. If pad has no getrange function installed (see gst_pad_set_getrange_function()) this function returns T_FLOW_NOT_SUPPORTED.

If buffer points to a variable holding NULL, a valid new Buffer will be placed in buffer when this function returns T_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 Buffer, the buffer will be filled with the result data when this function returns T_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 T_FLOW_OK, buffer will be unchanged.

This is a lowlevel function. Usually gst_pad_pull_range() is used.

The function takes the following parameters:

  • offset: start offset of the buffer.
  • size: length of the buffer.

The function returns the following values:

  • buffer: pointer to hold the Buffer, returns T_FLOW_ERROR if NULL.

  • flowReturn from the pad.

    MT safe.

func (*Pad) RemoveProbe

func (pad *Pad) RemoveProbe(id uint32)

RemoveProbe: remove the probe with id from pad.

MT safe.

The function takes the following parameters:

  • id: probe id to remove.

func (*Pad) SendEvent

func (pad *Pad) SendEvent(event *Event) bool

SendEvent 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 T_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 T_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 EventTypeFlags, gst_event_type_get_flags(), T_EVENT_IS_UPSTREAM, T_EVENT_IS_DOWNSTREAM, and T_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.

The function takes the following parameters:

  • event to send to the pad.

The function returns the following values:

  • ok: TRUE if the event was handled.

func (*Pad) SetActive

func (pad *Pad) SetActive(active bool) bool

SetActive 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.

The function takes the following parameters:

  • active: whether or not the pad should be active.

The function returns the following values:

  • ok: TRUE if the operation was successful.

    MT safe.

func (*Pad) SetElementPrivate

func (pad *Pad) SetElementPrivate(priv unsafe.Pointer)

SetElementPrivate: 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.

The function takes the following parameters:

  • priv (optional): private data to attach to the pad.

func (*Pad) SetOffset

func (pad *Pad) SetOffset(offset int64)

SetOffset: set the offset that will be applied to the running time of pad.

The function takes the following parameters:

  • offset: offset.
func (pad *Pad) SingleInternalLink() *Pad

SingleInternalLink: if there is a single internal link of the given pad, this function will return it. Otherwise, it will return NULL.

The function returns the following values:

  • ret (optional) or NULL if pad has none or more than one internal links. Unref returned pad with gst_object_unref().

func (*Pad) StartTask

func (pad *Pad) StartTask(fn TaskFunction) bool

StartTask starts a task that repeatedly calls func with user_data. This function is mostly used in pad activation functions to start the dataflow. The T_PAD_STREAM_LOCK of pad will automatically be acquired before func is called.

The function takes the following parameters:

  • fn: task function to call.

The function returns the following values:

  • ok: TRUE if the task could be started.

func (*Pad) StickyEvent

func (pad *Pad) StickyEvent(eventType EventType, idx uint) *Event

StickyEvent returns a new reference of the sticky event of type event_type from the event.

The function takes the following parameters:

  • eventType that should be retrieved.
  • idx: index of the event.

The function returns the following values:

  • event (optional) of type event_type or NULL when no event of event_type was on pad. Unref after usage.

func (*Pad) StickyEventsForEach

func (pad *Pad) StickyEventsForEach(foreachFunc PadStickyEventsForEachFunction)

StickyEventsForEach iterates all sticky events on pad and calls foreach_func for every event. If foreach_func returns FALSE the iteration is immediately stopped.

The function takes the following parameters:

  • foreachFunc that should be called for every event.

func (*Pad) StopTask

func (pad *Pad) StopTask() bool

StopTask: 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.

The function returns the following values:

  • ok: TRUE if the task could be stopped or FALSE on error.

func (*Pad) StoreStickyEvent

func (pad *Pad) StoreStickyEvent(event *Event) FlowReturn

StoreStickyEvent: store the sticky event on pad.

The function takes the following parameters:

  • event: Event.

The function returns the following values:

  • flowReturn on success, T_FLOW_FLUSHING when the pad was flushing or T_FLOW_EOS when the pad was EOS.

func (*Pad) Stream

func (pad *Pad) Stream() *Stream

Stream returns the current Stream 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().

The function returns the following values:

  • stream (optional): current Stream for pad, or NULL. unref the returned stream when no longer needed.

func (*Pad) StreamID

func (pad *Pad) StreamID() string

StreamID 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.

The function returns the following values:

  • utf8 (optional): newly-allocated copy of the stream-id for pad, or NULL. g_free() the returned string when no longer needed.

func (*Pad) TaskState

func (pad *Pad) TaskState() TaskState

TaskState: get pad task state. If no task is currently set, T_TASK_STOPPED is returned.

The function returns the following values:

  • taskState: current state of pad's task.
func (srcpad *Pad) Unlink(sinkpad *Pad) bool

Unlink unlinks the source pad from the sink pad. Will emit the Pad::unlinked signal on both pads.

The function takes the following parameters:

  • sinkpad: sink Pad to unlink.

The function returns the following values:

  • ok: TRUE if the pads were unlinked. This function returns FALSE if the pads were not linked together.

    MT safe.

func (*Pad) UseFixedCaps

func (pad *Pad) UseFixedCaps()

UseFixedCaps: 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.

type PadClass

type PadClass struct {
	// contains filtered or unexported fields
}

PadClass: instance of this type is always passed by reference.

func (*PadClass) ParentClass

func (p *PadClass) ParentClass() *ObjectClass

type PadDirection

type PadDirection C.gint

PadDirection: direction of a pad.

const (
	// PadUnknown: direction is unknown.
	PadUnknown PadDirection = iota
	// PadSrc: pad is a source pad.
	PadSrc
	// PadSink: pad is a sink pad.
	PadSink
)

func (PadDirection) String

func (p PadDirection) String() string

String returns the name in string for PadDirection.

type PadFlags

type PadFlags C.guint

PadFlags: pad state flags.

const (
	// PadFlagBlocked is dataflow on a pad blocked.
	PadFlagBlocked PadFlags = 0b10000
	// PadFlagFlushing is pad flushing.
	PadFlagFlushing PadFlags = 0b100000
	// PadFlagEos is pad in EOS state.
	PadFlagEos PadFlags = 0b1000000
	// PadFlagBlocking is pad currently blocking on a buffer or event.
	PadFlagBlocking PadFlags = 0b10000000
	// PadFlagNeedParent: ensure that there is a parent object before calling
	// into the pad callbacks.
	PadFlagNeedParent PadFlags = 0b100000000
	// PadFlagNeedReconfigure: pad should be reconfigured/renegotiated. The flag
	// has to be unset manually after reconfiguration happened.
	PadFlagNeedReconfigure PadFlags = 0b1000000000
	// PadFlagPendingEvents: pad has pending events.
	PadFlagPendingEvents PadFlags = 0b10000000000
	// PadFlagFixedCaps: 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 = 0b100000000000
	// PadFlagProxyCaps: default event and query handler will forward all events
	// and queries to the internally linked pads instead of discarding them.
	PadFlagProxyCaps PadFlags = 0b1000000000000
	// PadFlagProxyAllocation: default query handler will forward allocation
	// queries to the internally linked pads instead of discarding them.
	PadFlagProxyAllocation PadFlags = 0b10000000000000
	// PadFlagProxyScheduling: default query handler will forward scheduling
	// queries to the internally linked pads instead of discarding them.
	PadFlagProxyScheduling PadFlags = 0b100000000000000
	// PadFlagAcceptIntersect: 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 = 0b1000000000000000
	// PadFlagAcceptTemplate: 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 = 0b10000000000000000
	// PadFlagLast: offset to define more flags.
	PadFlagLast PadFlags = 0b100000000000000000000
)

func (PadFlags) Has

func (p PadFlags) Has(other PadFlags) bool

Has returns true if p contains other.

func (PadFlags) String

func (p PadFlags) String() string

String returns the names in string for PadFlags.

type PadForwardFunction

type PadForwardFunction func(pad *Pad) (ok bool)

PadForwardFunction: forward function is called for all internally linked pads, see gst_pad_forward().

type PadLinkCheck

type PadLinkCheck C.guint

PadLinkCheck: 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.

> Only disable some of the checks if you are 100% certain you know the link > will not fail because of hierarchy/caps compatibility failures. If uncertain, > use the default checks (GST_PAD_LINK_CHECK_DEFAULT) or the regular methods > for linking the pads.

const (
	// PadLinkCheckNothing: don't check hierarchy or caps compatibility.
	PadLinkCheckNothing PadLinkCheck = 0b0
	// PadLinkCheckHierarchy: 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 = 0b1
	// PadLinkCheckTemplateCaps: 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 = 0b10
	// PadLinkCheckCaps: check if the pads are compatible by comparing the caps
	// returned by gst_pad_query_caps().
	PadLinkCheckCaps PadLinkCheck = 0b100
	// PadLinkCheckNoReconfigure disables pushing a reconfigure event when pads
	// are linked.
	PadLinkCheckNoReconfigure PadLinkCheck = 0b1000
	// PadLinkCheckDefault: default checks done when linking pads (i.e. the ones
	// used by gst_pad_link()).
	PadLinkCheckDefault PadLinkCheck = 0b101
)

func (PadLinkCheck) Has

func (p PadLinkCheck) Has(other PadLinkCheck) bool

Has returns true if p contains other.

func (PadLinkCheck) String

func (p PadLinkCheck) String() string

String returns the names in string for PadLinkCheck.

type PadLinkReturn

type PadLinkReturn C.gint

PadLinkReturn: result values from gst_pad_link and friends.

const (
	// PadLinkOK: link succeeded.
	PadLinkOK PadLinkReturn = 0
	// PadLinkWrongHierarchy pads have no common grandparent.
	PadLinkWrongHierarchy PadLinkReturn = -1
	// PadLinkWasLinked: pad was already linked.
	PadLinkWasLinked PadLinkReturn = -2
	// PadLinkWrongDirection pads have wrong direction.
	PadLinkWrongDirection PadLinkReturn = -3
	// PadLinkNoformat pads do not have common format.
	PadLinkNoformat PadLinkReturn = -4
	// PadLinkNosched pads cannot cooperate in scheduling.
	PadLinkNosched PadLinkReturn = -5
	// PadLinkRefused: refused for some reason.
	PadLinkRefused PadLinkReturn = -6
)

func (PadLinkReturn) String

func (p PadLinkReturn) String() string

String returns the name in string for PadLinkReturn.

type PadMode

type PadMode C.gint

PadMode 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.

const (
	// PadModeNone: pad will not handle dataflow.
	PadModeNone PadMode = iota
	// PadModePush: pad handles dataflow in downstream push mode.
	PadModePush
	// PadModePull: pad handles dataflow in upstream pull mode.
	PadModePull
)

func (PadMode) String

func (p PadMode) String() string

String returns the name in string for PadMode.

type PadOverrides

type PadOverrides struct {
	// The function takes the following parameters:
	//
	Linked func(peer *Pad)
	// The function takes the following parameters:
	//
	Unlinked func(peer *Pad)
}

PadOverrides contains methods that are overridable.

type PadPresence

type PadPresence C.gint

PadPresence indicates when this pad will become available.

const (
	// PadAlways: pad is always available.
	PadAlways PadPresence = iota
	// PadSometimes: pad will become available depending on the media stream.
	PadSometimes
	// PadRequest: pad is only available on request with
	// gst_element_request_pad().
	PadRequest
)

func (PadPresence) String

func (p PadPresence) String() string

String returns the name in string for PadPresence.

type PadProbeCallback

type PadProbeCallback func(pad *Pad, info *PadProbeInfo) (padProbeReturn PadProbeReturn)

PadProbeCallback: 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 PadProbeInfo

type PadProbeInfo struct {
	// contains filtered or unexported fields
}

PadProbeInfo: info passed in the PadProbeCallback.

An instance of this type is always passed by reference.

func (*PadProbeInfo) Buffer

func (info *PadProbeInfo) Buffer() *Buffer

The function returns the following values:

  • buffer (optional) from the probe.

func (*PadProbeInfo) BufferList

func (info *PadProbeInfo) BufferList() *BufferList

The function returns the following values:

  • bufferList (optional) from the probe.

func (*PadProbeInfo) Data

func (p *PadProbeInfo) Data() unsafe.Pointer

Data: type specific data, check the type field to know the datatype. This field can be NULL.

func (*PadProbeInfo) Event

func (info *PadProbeInfo) Event() *Event

The function returns the following values:

  • event (optional) from the probe.

func (*PadProbeInfo) ID

func (p *PadProbeInfo) ID() uint32

ID: id of the probe.

func (*PadProbeInfo) Offset

func (p *PadProbeInfo) Offset() uint64

Offset: offset of pull probe, this field is valid when type contains T_PAD_PROBE_TYPE_PULL.

func (*PadProbeInfo) Query

func (info *PadProbeInfo) Query() *Query

The function returns the following values:

  • query (optional) from the probe.

func (*PadProbeInfo) SetID

func (p *PadProbeInfo) SetID(id uint32)

ID: id of the probe.

func (*PadProbeInfo) SetOffset

func (p *PadProbeInfo) SetOffset(offset uint64)

Offset: offset of pull probe, this field is valid when type contains T_PAD_PROBE_TYPE_PULL.

func (*PadProbeInfo) SetSize

func (p *PadProbeInfo) SetSize(size uint)

Size: size of pull probe, this field is valid when type contains T_PAD_PROBE_TYPE_PULL.

func (*PadProbeInfo) Size

func (p *PadProbeInfo) Size() uint

Size: size of pull probe, this field is valid when type contains T_PAD_PROBE_TYPE_PULL.

func (*PadProbeInfo) Type

func (p *PadProbeInfo) Type() PadProbeType

Type: current probe type.

type PadProbeReturn

type PadProbeReturn C.gint

PadProbeReturn: different return values for the PadProbeCallback.

const (
	// PadProbeDrop: 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 = iota
	// PadProbeOK: 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
	// PadProbeRemove: 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
	// PadProbePass 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
	// PadProbeHandled: 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 FlowReturn value by using the
	// T_PAD_PROBE_INFO_FLOW_RETURN() accessor. Note that the resulting query
	// must contain valid entries. Since: 1.6.
	PadProbeHandled
)

func (PadProbeReturn) String

func (p PadProbeReturn) String() string

String returns the name in string for PadProbeReturn.

type PadProbeType

type PadProbeType C.guint

PadProbeType: 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.

const (
	// PadProbeTypeInvalid: invalid probe type.
	PadProbeTypeInvalid PadProbeType = 0b0
	// PadProbeTypeIdle: probe idle pads and block while the callback is called.
	PadProbeTypeIdle PadProbeType = 0b1
	// PadProbeTypeBlock: probe and block pads.
	PadProbeTypeBlock PadProbeType = 0b10
	// PadProbeTypeBuffer: probe buffers.
	PadProbeTypeBuffer PadProbeType = 0b10000
	// PadProbeTypeBufferList: probe buffer lists.
	PadProbeTypeBufferList PadProbeType = 0b100000
	// PadProbeTypeEventDownstream: probe downstream events.
	PadProbeTypeEventDownstream PadProbeType = 0b1000000
	// PadProbeTypeEventUpstream: probe upstream events.
	PadProbeTypeEventUpstream PadProbeType = 0b10000000
	// PadProbeTypeEventFlush: 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 = 0b100000000
	// PadProbeTypeQueryDownstream: probe downstream queries.
	PadProbeTypeQueryDownstream PadProbeType = 0b1000000000
	// PadProbeTypeQueryUpstream: probe upstream queries.
	PadProbeTypeQueryUpstream PadProbeType = 0b10000000000
	// PadProbeTypePush: probe push.
	PadProbeTypePush PadProbeType = 0b1000000000000
	// PadProbeTypePull: probe pull.
	PadProbeTypePull PadProbeType = 0b10000000000000
	// PadProbeTypeBlocking: probe and block at the next opportunity, at data
	// flow or when idle.
	PadProbeTypeBlocking PadProbeType = 0b11
	// PadProbeTypeDataDownstream: probe downstream data (buffers, buffer lists,
	// and events).
	PadProbeTypeDataDownstream PadProbeType = 0b1110000
	// PadProbeTypeDataUpstream: probe upstream data (events).
	PadProbeTypeDataUpstream PadProbeType = 0b10000000
	// PadProbeTypeDataBoth: probe upstream and downstream data (buffers, buffer
	// lists, and events).
	PadProbeTypeDataBoth PadProbeType = 0b11110000
	// PadProbeTypeBlockDownstream: probe and block downstream data (buffers,
	// buffer lists, and events).
	PadProbeTypeBlockDownstream PadProbeType = 0b1110010
	// PadProbeTypeBlockUpstream: probe and block upstream data (events).
	PadProbeTypeBlockUpstream PadProbeType = 0b10000010
	// PadProbeTypeEventBoth: probe upstream and downstream events.
	PadProbeTypeEventBoth PadProbeType = 0b11000000
	// PadProbeTypeQueryBoth: probe upstream and downstream queries.
	PadProbeTypeQueryBoth PadProbeType = 0b11000000000
	// PadProbeTypeAllBoth: probe upstream events and queries and downstream
	// buffers, buffer lists, events and queries.
	PadProbeTypeAllBoth PadProbeType = 0b11011110000
	// PadProbeTypeScheduling: probe push and pull.
	PadProbeTypeScheduling PadProbeType = 0b11000000000000
)

func (PadProbeType) Has

func (p PadProbeType) Has(other PadProbeType) bool

Has returns true if p contains other.

func (PadProbeType) String

func (p PadProbeType) String() string

String returns the names in string for PadProbeType.

type PadStickyEventsForEachFunction

type PadStickyEventsForEachFunction func(pad *Pad, event *Event) (ok bool)

PadStickyEventsForEachFunction: callback used by gst_pad_sticky_events_foreach().

When this function returns TRUE, the next event will be returned. When FALSE is returned, gst_pad_sticky_events_foreach() will return.

When event is set to NULL, the item will be removed from the list of sticky events. event can be replaced by assigning a new reference to it. This function is responsible for unreffing the old event when removing or modifying.

type PadTemplate

type PadTemplate struct {
	GstObject
	// contains filtered or unexported fields
}

PadTemplate 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 Caps 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 PadPresence 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 PadTemplate 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 PadTemplate from a StaticPadTemplate 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.

static void
my_element_class_init (GstMyElementClass *klass)
{
  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);

  gst_element_class_add_static_pad_template (gstelement_class, &my_template);
}.

func NewPadTemplate

func NewPadTemplate(nameTemplate string, direction PadDirection, presence PadPresence, caps *Caps) *PadTemplate

NewPadTemplate creates a new pad template with a name according to the given template and with the given arguments.

The function takes the following parameters:

  • nameTemplate: name template.
  • direction of the template.
  • presence of the pad.
  • caps set for the template.

The function returns the following values:

  • padTemplate (optional): new PadTemplate.

func NewPadTemplateFromStaticPadTemplateWithGType

func NewPadTemplateFromStaticPadTemplateWithGType(padTemplate *StaticPadTemplate, padType coreglib.Type) *PadTemplate

NewPadTemplateFromStaticPadTemplateWithGType converts a StaticPadTemplate into a PadTemplate with a type.

The function takes the following parameters:

  • padTemplate: static pad template.
  • padType of the pad to create.

The function returns the following values:

  • padTemplate (optional): new PadTemplate.

func NewPadTemplateWithGType

func NewPadTemplateWithGType(nameTemplate string, direction PadDirection, presence PadPresence, caps *Caps, padType coreglib.Type) *PadTemplate

NewPadTemplateWithGType creates a new pad template with a name according to the given template and with the given arguments.

The function takes the following parameters:

  • nameTemplate: name template.
  • direction of the template.
  • presence of the pad.
  • caps set for the template.
  • padType of the pad to create.

The function returns the following values:

  • padTemplate (optional): new PadTemplate.

func (*PadTemplate) Caps

func (templ *PadTemplate) Caps() *Caps

Caps gets the capabilities of the pad template.

The function returns the following values:

  • caps of the pad template. Unref after usage.

func (*PadTemplate) ConnectPadCreated

func (templ *PadTemplate) ConnectPadCreated(f func(pad *Pad)) coreglib.SignalHandle

ConnectPadCreated: this signal is fired when an element creates a pad from this template.

func (*PadTemplate) DocumentationCaps

func (templ *PadTemplate) DocumentationCaps() *Caps

DocumentationCaps: see gst_pad_template_set_documentation_caps().

The function returns the following values:

  • caps to document. For convenience, this will return gst_pad_template_get_caps() when no documentation caps were set.

func (*PadTemplate) PadCreated

func (templ *PadTemplate) PadCreated(pad *Pad)

PadCreated: emit the pad-created signal for this template when created by this pad.

The function takes the following parameters:

  • pad that created it.

func (*PadTemplate) SetDocumentationCaps

func (templ *PadTemplate) SetDocumentationCaps(caps *Caps)

SetDocumentationCaps: 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.

The function takes the following parameters:

  • caps: documented capabilities.

type PadTemplateClass

type PadTemplateClass struct {
	// contains filtered or unexported fields
}

PadTemplateClass: instance of this type is always passed by reference.

func (*PadTemplateClass) ParentClass

func (p *PadTemplateClass) ParentClass() *ObjectClass

type PadTemplateFlags

type PadTemplateFlags C.guint

PadTemplateFlags flags for the padtemplate.

const (
	// PadTemplateFlagLast: first flag that can be used by subclasses.
	PadTemplateFlagLast PadTemplateFlags = 0b100000000
)

func (PadTemplateFlags) Has

func (p PadTemplateFlags) Has(other PadTemplateFlags) bool

Has returns true if p contains other.

func (PadTemplateFlags) String

func (p PadTemplateFlags) String() string

String returns the names in string for PadTemplateFlags.

type PadTemplateOverrides

type PadTemplateOverrides struct {
	// PadCreated: emit the pad-created signal for this template when created by
	// this pad.
	//
	// The function takes the following parameters:
	//
	//    - pad that created it.
	//
	PadCreated func(pad *Pad)
}

PadTemplateOverrides contains methods that are overridable.

type ParamSpecArray

type ParamSpecArray struct {
	// contains filtered or unexported fields
}

ParamSpecArray: GParamSpec derived structure for arrays of values.

An instance of this type is always passed by reference.

type ParamSpecFraction

type ParamSpecFraction struct {
	// contains filtered or unexported fields
}

ParamSpecFraction: GParamSpec derived structure that contains the meta data for fractional properties.

An instance of this type is always passed by reference.

func (*ParamSpecFraction) DefDen

func (p *ParamSpecFraction) DefDen() int

DefDen: default denominator.

func (*ParamSpecFraction) DefNum

func (p *ParamSpecFraction) DefNum() int

DefNum: default numerator.

func (*ParamSpecFraction) MaxDen

func (p *ParamSpecFraction) MaxDen() int

MaxDen: maximal denominator.

func (*ParamSpecFraction) MaxNum

func (p *ParamSpecFraction) MaxNum() int

MaxNum: maximal numerator.

func (*ParamSpecFraction) MinDen

func (p *ParamSpecFraction) MinDen() int

MinDen: minimal denominator.

func (*ParamSpecFraction) MinNum

func (p *ParamSpecFraction) MinNum() int

MinNum: minimal numerator.

func (*ParamSpecFraction) SetDefDen

func (p *ParamSpecFraction) SetDefDen(defDen int)

DefDen: default denominator.

func (*ParamSpecFraction) SetDefNum

func (p *ParamSpecFraction) SetDefNum(defNum int)

DefNum: default numerator.

func (*ParamSpecFraction) SetMaxDen

func (p *ParamSpecFraction) SetMaxDen(maxDen int)

MaxDen: maximal denominator.

func (*ParamSpecFraction) SetMaxNum

func (p *ParamSpecFraction) SetMaxNum(maxNum int)

MaxNum: maximal numerator.

func (*ParamSpecFraction) SetMinDen

func (p *ParamSpecFraction) SetMinDen(minDen int)

MinDen: minimal denominator.

func (*ParamSpecFraction) SetMinNum

func (p *ParamSpecFraction) SetMinNum(minNum int)

MinNum: minimal numerator.

type ParentBufferMeta

type ParentBufferMeta struct {
	// contains filtered or unexported fields
}

ParentBufferMeta is a Meta which can be attached to a Buffer to hold a reference to another buffer that is only released when the child Buffer is released.

Typically, ParentBufferMeta is used when the child buffer is directly using the Memory of the parent buffer, and wants to prevent the parent buffer from being returned to a buffer pool until the Memory is available for re-use.

An instance of this type is always passed by reference.

func (*ParentBufferMeta) Buffer

func (p *ParentBufferMeta) Buffer() *Buffer

Buffer on which a reference is being held.

func (*ParentBufferMeta) Parent

func (p *ParentBufferMeta) Parent() *Meta

Parent: parent Meta structure.

type ParseContext

type ParseContext struct {
	// contains filtered or unexported fields
}

ParseContext: opaque structure.

An instance of this type is always passed by reference.

func NewParseContext

func NewParseContext() *ParseContext

NewParseContext constructs a struct ParseContext.

func (*ParseContext) Copy

func (context *ParseContext) Copy() *ParseContext

Copy copies the context.

The function returns the following values:

  • parseContext (optional): copied ParseContext.

func (*ParseContext) MissingElements

func (context *ParseContext) MissingElements() []string

MissingElements: 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.

The function returns the following values:

  • utf8s (optional): a NULL-terminated array of element factory name strings of missing elements. Free with g_strfreev() when no longer needed.

type ParseError

type ParseError C.gint

ParseError: different parsing errors that can occur.

const (
	// ParseErrorSyntax: syntax error occurred.
	ParseErrorSyntax ParseError = iota
	// ParseErrorNoSuchElement: description contained an unknown element.
	ParseErrorNoSuchElement
	// ParseErrorNoSuchProperty: element did not have a specified property.
	ParseErrorNoSuchProperty
	// ParseErrorLink: there was an error linking two pads.
	ParseErrorLink
	// ParseErrorCouldNotSetProperty: there was an error setting a property.
	ParseErrorCouldNotSetProperty
	// ParseErrorEmptyBin: empty bin was specified.
	ParseErrorEmptyBin
	// ParseErrorEmpty: empty description was specified.
	ParseErrorEmpty
	// ParseErrorDelayedLink: delayed link did not get resolved.
	ParseErrorDelayedLink
)

func (ParseError) String

func (p ParseError) String() string

String returns the name in string for ParseError.

type ParseFlags

type ParseFlags C.guint

ParseFlags: parsing options.

const (
	// ParseFlagNone: do not use any special parsing options.
	ParseFlagNone ParseFlags = 0b0
	// ParseFlagFatalErrors always return NULL when an error occurs (default
	// behaviour is to return partially constructed bins or elements in some
	// cases).
	ParseFlagFatalErrors ParseFlags = 0b1
	// ParseFlagNoSingleElementBins: if a bin only has a single element, just
	// return the element.
	ParseFlagNoSingleElementBins ParseFlags = 0b10
	// ParseFlagPlaceInBin: if more than one toplevel element is described by
	// the pipeline description string, put them in a Bin instead of a Pipeline.
	// (Since: 1.10).
	ParseFlagPlaceInBin ParseFlags = 0b100
)

func (ParseFlags) Has

func (p ParseFlags) Has(other ParseFlags) bool

Has returns true if p contains other.

func (ParseFlags) String

func (p ParseFlags) String() string

String returns the names in string for ParseFlags.

type Pipeline

type Pipeline struct {
	Bin
	// contains filtered or unexported fields
}

Pipeline is a special Bin used as the toplevel container for the filter graph. The Pipeline will manage the selection and distribution of a global Clock as well as provide a Bus 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 Element objects (if not otherwise referenced).

Elements are added and removed from the pipeline using the Bin methods like gst_bin_add() and gst_bin_remove() (see Bin).

Before changing the state of the Pipeline (see Element) a Bus should be retrieved with gst_pipeline_get_bus(). This Bus should then be used to receive Message from the elements in the pipeline. Listening to the Bus is necessary for retrieving error messages from the Pipeline and otherwise the Pipeline might stop without any indication, why. Furthermore, the Pipeline posts messages even if nobody listens on the Bus, which will pile up and use up memory.

By default, a Pipeline will automatically flush the pending Bus messages when going to the NULL state to ensure that no circular references exist when no messages are read from the Bus. This behaviour can be changed with gst_pipeline_set_auto_flush_bus().

When the Pipeline 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 T_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 SystemClock 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 Pipeline 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.

func NewPipeline

func NewPipeline(name string) *Pipeline

NewPipeline: create a new pipeline with the given name.

The function takes the following parameters:

  • name (optional) of new pipeline.

The function returns the following values:

  • pipeline: newly created GstPipeline

    MT safe.

func (*Pipeline) AutoClock

func (pipeline *Pipeline) AutoClock()

AutoClock: 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) AutoFlushBus

func (pipeline *Pipeline) AutoFlushBus() bool

AutoFlushBus: check if pipeline will automatically flush messages when going to the NULL state.

The function returns the following values:

  • ok: whether the pipeline will automatically flush its bus when going from READY to NULL state or not.

    MT safe.

func (*Pipeline) Bus

func (pipeline *Pipeline) Bus() *Bus

Bus gets the Bus of pipeline. The bus allows applications to receive Message packets.

The function returns the following values:

  • bus unref after usage.

    MT safe.

func (*Pipeline) Delay

func (pipeline *Pipeline) Delay() ClockTime

Delay: get the configured delay (see gst_pipeline_set_delay()).

The function returns the following values:

  • clockTime: configured delay.

    MT safe.

func (*Pipeline) Latency

func (pipeline *Pipeline) Latency() ClockTime

Latency gets the latency that should be configured on the pipeline. See gst_pipeline_set_latency().

The function returns the following values:

  • clockTime: latency to configure on the pipeline or GST_CLOCK_TIME_NONE.

func (*Pipeline) PipelineClock

func (pipeline *Pipeline) PipelineClock() Clocker

PipelineClock 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.

The function returns the following values:

  • clock unref after usage.

func (*Pipeline) SetAutoFlushBus

func (pipeline *Pipeline) SetAutoFlushBus(autoFlush bool)

SetAutoFlushBus: 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.

The function takes the following parameters:

  • autoFlush: whether or not to automatically flush the bus when the pipeline goes from READY to NULL state.

func (*Pipeline) SetDelay

func (pipeline *Pipeline) SetDelay(delay ClockTime)

SetDelay: 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 T_CLOCK_TIME_NONE.

This option is used for tuning purposes and should normally not be used.

MT safe.

The function takes the following parameters:

  • delay: delay.

func (*Pipeline) SetLatency

func (pipeline *Pipeline) SetLatency(latency ClockTime)

SetLatency 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.

The function takes the following parameters:

  • latency to configure.

func (*Pipeline) UseClock

func (pipeline *Pipeline) UseClock(clock Clocker)

UseClock: 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.

The function takes the following parameters:

  • clock (optional) to use.

type PipelineClass

type PipelineClass struct {
	// contains filtered or unexported fields
}

PipelineClass: instance of this type is always passed by reference.

func (*PipelineClass) ParentClass

func (p *PipelineClass) ParentClass() *BinClass

type PipelineFlags

type PipelineFlags C.guint

PipelineFlags: pipeline flags.

const (
	// PipelineFlagFixedClock: pipeline works with a fixed clock.
	PipelineFlagFixedClock PipelineFlags = 0b10000000000000000000
	// PipelineFlagLast: offset to define more flags.
	PipelineFlagLast PipelineFlags = 0b100000000000000000000000
)

func (PipelineFlags) Has

func (p PipelineFlags) Has(other PipelineFlags) bool

Has returns true if p contains other.

func (PipelineFlags) String

func (p PipelineFlags) String() string

String returns the names in string for PipelineFlags.

type PipelineOverrides

type PipelineOverrides struct {
}

PipelineOverrides contains methods that are overridable.

type Plugin

type Plugin struct {
	GstObject
	// contains filtered or unexported fields
}

Plugin: GStreamer is extensible, so Element instances can be loaded at runtime. A plugin system can provide one or more of the basic GStreamer PluginFeature subclasses.

A plugin should export a symbol gst_plugin_desc that is a struct of type PluginDesc. the plugin loader will check the version of the core library the plugin was linked against and will create a new Plugin. It will then call the PluginInitFunc function that was provided in the gst_plugin_desc.

Once you have a handle to a Plugin (e.g. from the Registry), you can add any object that subclasses PluginFeature.

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.

func PluginLoadByName

func PluginLoadByName(name string) *Plugin

PluginLoadByName: load the named plugin. Refs the plugin.

The function takes the following parameters:

  • name of plugin to load.

The function returns the following values:

  • plugin (optional): reference to a loaded plugin, or NULL on error.

func PluginLoadFile

func PluginLoadFile(filename string) (*Plugin, error)

PluginLoadFile loads the given plugin and refs it. Caller needs to unref after use.

The function takes the following parameters:

  • filename: plugin filename to load.

The function returns the following values:

  • plugin: reference to the existing loaded GstPlugin, a reference to the newly-loaded GstPlugin, or NULL if an error occurred.

func (*Plugin) AddDependency

func (plugin *Plugin) AddDependency(envVars, paths, names []string, flags PluginDependencyFlags)

AddDependency: 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.

The function takes the following parameters:

  • envVars (optional): 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 (optional): NULL-terminated array of directories/paths where dependent files may be, or NULL.
  • names (optional): 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: optional flags, or T_PLUGIN_DEPENDENCY_FLAG_NONE.

func (*Plugin) AddDependencySimple

func (plugin *Plugin) AddDependencySimple(envVars, paths, names string, flags PluginDependencyFlags)

AddDependencySimple: 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).

The function takes the following parameters:

  • envVars (optional): 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 (optional): one ore more directory paths (separated by ':' or ';' or ','), or NULL. Example: "/usr/lib/mystuff/plugins".
  • names (optional): one or more file names or file name suffixes (separated by commas), or NULL.
  • flags: optional flags, or T_PLUGIN_DEPENDENCY_FLAG_NONE.

func (*Plugin) CacheData

func (plugin *Plugin) CacheData() *Structure

CacheData 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.

The function returns the following values:

  • structure (optional): cached data as a Structure or NULL.

func (*Plugin) Description

func (plugin *Plugin) Description() string

Description: get the long descriptive name of the plugin.

The function returns the following values:

  • utf8: long name of the plugin.

func (*Plugin) Filename

func (plugin *Plugin) Filename() string

Filename: get the filename of the plugin.

The function returns the following values:

  • filename (optional) of the plugin.

func (*Plugin) IsLoaded

func (plugin *Plugin) IsLoaded() bool

IsLoaded queries if the plugin is loaded into memory.

The function returns the following values:

  • ok: TRUE is loaded, FALSE otherwise.

func (*Plugin) License

func (plugin *Plugin) License() string

License: get the license of the plugin.

The function returns the following values:

  • utf8: license of the plugin.

func (*Plugin) Load

func (plugin *Plugin) Load() *Plugin

Load 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;.

The function returns the following values:

  • ret (optional): reference to a loaded plugin, or NULL on error.

func (*Plugin) Name

func (plugin *Plugin) Name() string

Name: get the short name of the plugin.

The function returns the following values:

  • utf8: name of the plugin.

func (*Plugin) Origin

func (plugin *Plugin) Origin() string

Origin: get the URL where the plugin comes from.

The function returns the following values:

  • utf8: origin of the plugin.

func (*Plugin) Package

func (plugin *Plugin) Package() string

Package: get the package the plugin belongs to.

The function returns the following values:

  • utf8: package of the plugin.

func (*Plugin) ReleaseDateString

func (plugin *Plugin) ReleaseDateString() string

ReleaseDateString: 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.

The function returns the following values:

  • utf8 (optional): date string of the plugin, or NULL if not available.

func (*Plugin) SetCacheData

func (plugin *Plugin) SetCacheData(cacheData *Structure)

SetCacheData 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.

The function takes the following parameters:

  • cacheData: structure containing the data to cache.

func (*Plugin) Source

func (plugin *Plugin) Source() string

Source: get the source module the plugin belongs to.

The function returns the following values:

  • utf8: source of the plugin.

func (*Plugin) Version

func (plugin *Plugin) Version() string

Version: get the version of the plugin.

The function returns the following values:

  • utf8: version of the plugin.

type PluginAPIFlags

type PluginAPIFlags C.guint
const (
	// PluginApiFlagIgnoreEnumMembers: 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 = 0b1
)

func TypeIsPluginApi

func TypeIsPluginApi(typ coreglib.Type) (PluginAPIFlags, bool)

TypeIsPluginApi checks if type is plugin API. See gst_type_mark_as_plugin_api() for details.

The function takes the following parameters:

  • typ: GType.

The function returns the following values:

  • flags (optional): what PluginAPIFlags the plugin was marked with.
  • ok: TRUE if type is plugin API or FALSE otherwise.

func (PluginAPIFlags) Has

func (p PluginAPIFlags) Has(other PluginAPIFlags) bool

Has returns true if p contains other.

func (PluginAPIFlags) String

func (p PluginAPIFlags) String() string

String returns the names in string for PluginAPIFlags.

type PluginDependencyFlags

type PluginDependencyFlags C.guint

PluginDependencyFlags flags used in connection with gst_plugin_add_dependency().

const (
	// PluginDependencyFlagNone: no special flags.
	PluginDependencyFlagNone PluginDependencyFlags = 0b0
	// PluginDependencyFlagRecurse: recurse into subdirectories.
	PluginDependencyFlagRecurse PluginDependencyFlags = 0b1
	// PluginDependencyFlagPathsAreDefaultOnly: use paths argument only if none
	// of the environment variables is set.
	PluginDependencyFlagPathsAreDefaultOnly PluginDependencyFlags = 0b10
	// PluginDependencyFlagFileNameIsSuffix: interpret filename argument as
	// filter suffix and check all matching files in the directory.
	PluginDependencyFlagFileNameIsSuffix PluginDependencyFlags = 0b100
	// PluginDependencyFlagFileNameIsPrefix: interpret filename argument as
	// filter prefix and check all matching files in the directory. Since: 1.8.
	PluginDependencyFlagFileNameIsPrefix PluginDependencyFlags = 0b1000
	// PluginDependencyFlagPathsAreRelativeToExe: interpret non-absolute paths
	// as relative to the main executable directory. Since 1.14.
	PluginDependencyFlagPathsAreRelativeToExe PluginDependencyFlags = 0b10000
)

func (PluginDependencyFlags) Has

Has returns true if p contains other.

func (PluginDependencyFlags) String

func (p PluginDependencyFlags) String() string

String returns the names in string for PluginDependencyFlags.

type PluginDesc

type PluginDesc struct {
	// contains filtered or unexported fields
}

PluginDesc: 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.

An instance of this type is always passed by reference.

type PluginError

type PluginError C.gint

PluginError: plugin loading errors.

const (
	// PluginErrorModule: plugin could not be loaded.
	PluginErrorModule PluginError = iota
	// PluginErrorDependencies: plugin has unresolved dependencies.
	PluginErrorDependencies
	// PluginErrorNameMismatch: plugin has already be loaded from a different
	// file.
	PluginErrorNameMismatch
)

func (PluginError) String

func (p PluginError) String() string

String returns the name in string for PluginError.

type PluginFeature

type PluginFeature struct {
	GstObject
	// contains filtered or unexported fields
}

PluginFeature: this is a base class for anything that can be added to a Plugin.

func BasePluginFeature

func BasePluginFeature(obj PluginFeaturer) *PluginFeature

BasePluginFeature returns the underlying base object.

func (*PluginFeature) CheckVersion

func (feature *PluginFeature) CheckVersion(minMajor, minMinor, minMicro uint) bool

CheckVersion checks whether the given plugin feature is at least the required version.

The function takes the following parameters:

  • minMajor: minimum required major version.
  • minMinor: minimum required minor version.
  • minMicro: minimum required micro version.

The function returns the following values:

  • ok: TRUE if the plugin feature has at least the required version, otherwise FALSE.

func (*PluginFeature) Load

func (feature *PluginFeature) Load() PluginFeaturer

Load 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:

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;.

The function returns the following values:

  • pluginFeature (optional): reference to the loaded feature, or NULL on error.

func (*PluginFeature) Plugin

func (feature *PluginFeature) Plugin() *Plugin

Plugin: get the plugin that provides this feature.

The function returns the following values:

  • plugin (optional) that provides this feature, or NULL. Unref with gst_object_unref() when no longer needed.

func (*PluginFeature) PluginName

func (feature *PluginFeature) PluginName() string

PluginName: get the name of the plugin that provides this feature.

The function returns the following values:

  • utf8 (optional): name of the plugin that provides this feature, or NULL if the feature is not associated with a plugin.

func (*PluginFeature) Rank

func (feature *PluginFeature) Rank() uint

Rank gets the rank of a plugin feature.

The function returns the following values:

  • guint: rank of the feature.

func (*PluginFeature) SetRank

func (feature *PluginFeature) SetRank(rank uint)

SetRank specifies a rank for a plugin feature, so that autoplugging uses the most appropriate feature.

The function takes the following parameters:

  • rank value - higher number means more priority rank.

type PluginFeatureFilter

type PluginFeatureFilter func(feature PluginFeaturer) (ok bool)

PluginFeatureFilter: function that can be used with e.g. gst_registry_feature_filter() to get a list of pluginfeature that match certain criteria.

type PluginFeaturer

type PluginFeaturer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

PluginFeaturer describes types inherited from class PluginFeature.

To get the original type, the caller must assert this to an interface or another type.

func PluginFeatureListCopy

func PluginFeatureListCopy(list []PluginFeaturer) []PluginFeaturer

PluginFeatureListCopy copies the list of features. Caller should call gst_plugin_feature_list_free when done with the list.

The function takes the following parameters:

  • list: list of PluginFeature.

The function returns the following values:

  • ret: copy of list, with each feature's reference count incremented.

type PluginFilter

type PluginFilter func(plugin *Plugin) (ok bool)

PluginFilter: function that can be used with e.g. gst_registry_plugin_filter() to get a list of plugins that match certain criteria.

type PluginFlags

type PluginFlags C.guint

PluginFlags: plugin loading state.

const (
	// PluginFlagCached: temporarily loaded plugins.
	PluginFlagCached PluginFlags = 0b10000
	// PluginFlagBlacklisted: plugin won't be scanned (again).
	PluginFlagBlacklisted PluginFlags = 0b100000
)

func (PluginFlags) Has

func (p PluginFlags) Has(other PluginFlags) bool

Has returns true if p contains other.

func (PluginFlags) String

func (p PluginFlags) String() string

String returns the names in string for PluginFlags.

type PluginInitFullFunc

type PluginInitFullFunc func(plugin *Plugin) (ok bool)

PluginInitFullFunc: plugin should provide a pointer to a function of either PluginInitFunc or this type in the plugin_desc struct. The function will be called by the loader at startup. One would then register each PluginFeature. This version allows user data to be passed to init function (useful for bindings).

type PollFD

type PollFD struct {
	// contains filtered or unexported fields
}

PollFD: file descriptor object.

An instance of this type is always passed by reference.

func (*PollFD) Fd

func (p *PollFD) Fd() int

Fd: file descriptor.

func (*PollFD) Init

func (fd *PollFD) Init()

Init initializes fd. Alternatively you can initialize it with T_POLL_FD_INIT.

func (*PollFD) SetFd

func (p *PollFD) SetFd(fd int)

Fd: file descriptor.

type Preset

type Preset struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Preset: 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".

Preset wraps an interface. This means the user can get the underlying type by calling Cast().

func (*Preset) DeletePreset

func (preset *Preset) DeletePreset(name string) bool

DeletePreset: delete the given preset.

The function takes the following parameters:

  • name: preset name to remove.

The function returns the following values:

  • ok: TRUE for success, FALSE if e.g. there is no preset with that name.

func (*Preset) IsEditable

func (preset *Preset) IsEditable() bool

IsEditable: check if one can add new presets, change existing ones and remove presets.

The function returns the following values:

  • ok: TRUE if presets are editable or FALSE if they are static.

func (*Preset) LoadPreset

func (preset *Preset) LoadPreset(name string) bool

LoadPreset: load the given preset.

The function takes the following parameters:

  • name: preset name to load.

The function returns the following values:

  • ok: TRUE for success, FALSE if e.g. there is no preset with that name.

func (*Preset) Meta

func (preset *Preset) Meta(name, tag string) (string, bool)

Meta 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.

The function takes the following parameters:

  • name: preset name.
  • tag: meta data item name.

The function returns the following values:

  • value: value.
  • ok: TRUE for success, FALSE if e.g. there is no preset with that name or no value for the given tag.

func (*Preset) PresetNames

func (preset *Preset) PresetNames() []string

PresetNames: get a copy of preset names as a NULL terminated string array.

The function returns the following values:

  • utf8s: list with names, use g_strfreev() after usage.

func (*Preset) PropertyNames

func (preset *Preset) PropertyNames() []string

PropertyNames: get a the names of the GObject properties that can be used for presets.

The function returns the following values:

  • utf8s: an array of property names which should be freed with g_strfreev() after use.

func (*Preset) RenamePreset

func (preset *Preset) RenamePreset(oldName, newName string) bool

RenamePreset renames a preset. If there is already a preset by the new_name it will be overwritten.

The function takes the following parameters:

  • oldName: current preset name.
  • newName: new preset name.

The function returns the following values:

  • ok: TRUE for success, FALSE if e.g. there is no preset with old_name.

func (*Preset) SavePreset

func (preset *Preset) SavePreset(name string) bool

SavePreset: 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.

The function takes the following parameters:

  • name: preset name to save.

The function returns the following values:

  • ok: TRUE for success, FALSE.

func (*Preset) SetMeta

func (preset *Preset) SetMeta(name, tag, value string) bool

SetMeta 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.

The function takes the following parameters:

  • name: preset name.
  • tag: meta data item name.
  • value (optional): new value.

The function returns the following values:

  • ok: TRUE for success, FALSE if e.g. there is no preset with that name.

type PresetInterface

type PresetInterface struct {
	// contains filtered or unexported fields
}

PresetInterface interface.

An instance of this type is always passed by reference.

type Presetter

type Presetter interface {
	coreglib.Objector

	// DeletePreset: delete the given preset.
	DeletePreset(name string) bool
	// Meta gets the value for an existing meta data tag.
	Meta(name, tag string) (string, bool)
	// PresetNames: get a copy of preset names as a NULL terminated string
	// array.
	PresetNames() []string
	// PropertyNames: get a the names of the GObject properties that can be used
	// for presets.
	PropertyNames() []string
	// IsEditable: check if one can add new presets, change existing ones and
	// remove presets.
	IsEditable() bool
	// LoadPreset: load the given preset.
	LoadPreset(name string) bool
	// RenamePreset renames a preset.
	RenamePreset(oldName, newName string) bool
	// SavePreset: save the current object settings as a preset under the given
	// name.
	SavePreset(name string) bool
	// SetMeta sets a new value for an existing meta data item or adds a new
	// item.
	SetMeta(name, tag, value string) bool
}

Presetter describes Preset's interface methods.

type ProgressType

type ProgressType C.gint

ProgressType: type of a GST_MESSAGE_PROGRESS. The progress messages inform the application of the status of asynchronous tasks.

const (
	// ProgressTypeStart: new task started.
	ProgressTypeStart ProgressType = iota
	// ProgressTypeContinue: task completed and a new one continues.
	ProgressTypeContinue
	// ProgressTypeComplete: task completed.
	ProgressTypeComplete
	// ProgressTypeCanceled: task was canceled.
	ProgressTypeCanceled
	// ProgressTypeError: task caused an error. An error message is also posted
	// on the bus.
	ProgressTypeError
)

func (ProgressType) String

func (p ProgressType) String() string

String returns the name in string for ProgressType.

type Promise

type Promise struct {
	// contains filtered or unexported fields
}

Promise object implements the container for values that may be available later. i.e. a Future or a Promise in <https://en.wikipedia.org/wiki/Futures_and_promises>. As with all Future/Promise-like functionality, there is the concept of the producer of the value and the consumer of the value.

A Promise is created with gst_promise_new() by the consumer and passed to the producer to avoid thread safety issues with the change callback. A Promise 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 Bus. A callback can also be installed at Promise creation for result changes with gst_promise_new_with_change_func(). The change callback can be used to chain Promises's together as in the following example.

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 Promise starts out with a PromiseResult of GST_PROMISE_RESULT_PENDING and only ever transitions once into one of the other PromiseResult'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. Promise using APIs can restrict this to a single thread or a subset of threads but that is entirely up to the API that uses Promise.

An instance of this type is always passed by reference.

func NewPromise

func NewPromise() *Promise

NewPromise constructs a struct Promise.

func NewPromiseWithChangeFunc

func NewPromiseWithChangeFunc(fn PromiseChangeFunc) *Promise

NewPromiseWithChangeFunc constructs a struct Promise.

func (*Promise) Expire

func (promise *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) GetReply

func (promise *Promise) GetReply() *Structure

GetReply: retrieve the reply set on promise. promise must be in GST_PROMISE_RESULT_REPLIED and the returned structure is owned by promise.

The function returns the following values:

  • structure (optional): reply set on promise.

func (*Promise) Interrupt

func (promise *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) Parent

func (p *Promise) Parent() *MiniObject

Parent: parent MiniObject.

func (*Promise) Reply

func (promise *Promise) Reply(s *Structure)

Reply: 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.

The function takes the following parameters:

  • s (optional) with the the reply contents.

func (*Promise) Wait

func (promise *Promise) Wait() 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.

The function returns the following values:

  • promiseResult: result of the promise.

type PromiseChangeFunc

type PromiseChangeFunc func(promise *Promise)

type PromiseResult

type PromiseResult C.gint

PromiseResult: result of a Promise.

const (
	// PromiseResultPending: initial state. Waiting for transition to any other
	// state.
	PromiseResultPending PromiseResult = iota
	// PromiseResultInterrupted: interrupted by the consumer as it doesn't want
	// the value anymore.
	PromiseResultInterrupted
	// PromiseResultReplied: producer marked a reply.
	PromiseResultReplied
	// PromiseResultExpired: promise expired (the carrying object lost all refs)
	// and the promise will never be fulfilled.
	PromiseResultExpired
)

func (PromiseResult) String

func (p PromiseResult) String() string

String returns the name in string for PromiseResult.

type ProtectionMeta

type ProtectionMeta struct {
	// contains filtered or unexported fields
}

ProtectionMeta: metadata type that holds information about a sample from a protection-protected track, including the information needed to decrypt it (if it is encrypted).

An instance of this type is always passed by reference.

func (*ProtectionMeta) Info

func (p *ProtectionMeta) Info() *Structure

Info: cryptographic information needed to decrypt the sample.

func (*ProtectionMeta) Meta

func (p *ProtectionMeta) Meta() *Meta

Meta: parent Meta.

type ProxyPad

type ProxyPad struct {
	Pad
	// contains filtered or unexported fields
}

func (*ProxyPad) Internal

func (pad *ProxyPad) Internal() *ProxyPad

Internal: get the internal pad of pad. Unref target pad after usage.

The internal pad of a GhostPad is the internally used pad of opposite direction, which is used to link to the target.

The function returns the following values:

  • proxyPad (optional): target ProxyPad, can be NULL. Unref target pad after usage.

type ProxyPadClass

type ProxyPadClass struct {
	// contains filtered or unexported fields
}

ProxyPadClass: instance of this type is always passed by reference.

func (*ProxyPadClass) ParentClass

func (p *ProxyPadClass) ParentClass() *PadClass

type ProxyPadOverrides

type ProxyPadOverrides struct {
}

ProxyPadOverrides contains methods that are overridable.

type QOSType

type QOSType C.gint

QOSType: different types of QoS events that can be given to the gst_event_new_qos() method.

const (
	// QosTypeOverflow: 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 = iota
	// QosTypeUnderflow: qoS event type that is produced when upstream elements
	// are producing data too slowly and need to speed up their production rate.
	QosTypeUnderflow
	// QosTypeThrottle: qoS event type that is produced when the application
	// enabled throttling to limit the data rate.
	QosTypeThrottle
)

func (QOSType) String

func (q QOSType) String() string

String returns the name in string for QOSType.

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query 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:

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, &duration);
  g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration));
} else {
  g_print ("duration query failed...");
}
gst_query_unref (query);

An instance of this type is always passed by reference.

func NewQueryAcceptCaps

func NewQueryAcceptCaps(caps *Caps) *Query

NewQueryAcceptCaps constructs a struct Query.

func NewQueryAllocation

func NewQueryAllocation(caps *Caps, needPool bool) *Query

NewQueryAllocation constructs a struct Query.

func NewQueryBitrate

func NewQueryBitrate() *Query

NewQueryBitrate constructs a struct Query.

func NewQueryBuffering

func NewQueryBuffering(format Format) *Query

NewQueryBuffering constructs a struct Query.

func NewQueryCaps

func NewQueryCaps(filter *Caps) *Query

NewQueryCaps constructs a struct Query.

func NewQueryContext

func NewQueryContext(contextType string) *Query

NewQueryContext constructs a struct Query.

func NewQueryConvert

func NewQueryConvert(srcFormat Format, value int64, destFormat Format) *Query

NewQueryConvert constructs a struct Query.

func NewQueryCustom

func NewQueryCustom(typ QueryType, structure *Structure) *Query

NewQueryCustom constructs a struct Query.

func NewQueryDrain

func NewQueryDrain() *Query

NewQueryDrain constructs a struct Query.

func NewQueryDuration

func NewQueryDuration(format Format) *Query

NewQueryDuration constructs a struct Query.

func NewQueryFormats

func NewQueryFormats() *Query

NewQueryFormats constructs a struct Query.

func NewQueryLatency

func NewQueryLatency() *Query

NewQueryLatency constructs a struct Query.

func NewQueryPosition

func NewQueryPosition(format Format) *Query

NewQueryPosition constructs a struct Query.

func NewQueryScheduling

func NewQueryScheduling() *Query

NewQueryScheduling constructs a struct Query.

func NewQuerySeeking

func NewQuerySeeking(format Format) *Query

NewQuerySeeking constructs a struct Query.

func NewQuerySegment

func NewQuerySegment(format Format) *Query

NewQuerySegment constructs a struct Query.

func NewQueryURI

func NewQueryURI() *Query

NewQueryURI constructs a struct Query.

func (*Query) AddAllocationMeta

func (query *Query) AddAllocationMeta(api coreglib.Type, params *Structure)

AddAllocationMeta: add api with params as one of the supported metadata API to query.

The function takes the following parameters:

  • api: metadata API.
  • params (optional): API specific parameters.

func (*Query) AddAllocationParam

func (query *Query) AddAllocationParam(allocator Allocatorrer, params *AllocationParams)

AddAllocationParam: add allocator and its params as a supported memory allocator.

The function takes the following parameters:

  • allocator (optional): memory allocator.
  • params (optional): AllocationParams.

func (*Query) AddAllocationPool

func (query *Query) AddAllocationPool(pool *BufferPool, size uint, minBuffers uint, maxBuffers uint)

AddAllocationPool: set the pool parameters in query.

The function takes the following parameters:

  • pool (optional): BufferPool.
  • size: buffer size.
  • minBuffers: min buffers.
  • maxBuffers: max buffers.

func (*Query) AddBufferingRange

func (query *Query) AddBufferingRange(start int64, stop int64) bool

AddBufferingRange: set the buffering-ranges array field in query. The current last start position of the array should be inferior to start.

The function takes the following parameters:

  • start position of the range.
  • stop position of the range.

The function returns the following values:

  • ok indicating if the range was added or not.

func (*Query) AddSchedulingMode

func (query *Query) AddSchedulingMode(mode PadMode)

AddSchedulingMode: add mode as one of the supported scheduling modes to query.

The function takes the following parameters:

  • mode: PadMode.

func (*Query) FindAllocationMeta

func (query *Query) FindAllocationMeta(api coreglib.Type) (uint, bool)

FindAllocationMeta: 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.

The function takes the following parameters:

  • api: metadata API.

The function returns the following values:

  • index (optional): index.
  • ok: TRUE when api is in the list of metadata.

func (*Query) HasSchedulingMode

func (query *Query) HasSchedulingMode(mode PadMode) bool

HasSchedulingMode: check if query has scheduling mode set.

> When checking if upstream supports pull mode, it is usually not > enough to just check for GST_PAD_MODE_PULL with this function, you > also want to check whether the scheduling flags returned by > gst_query_parse_scheduling() have the seeking flag set (meaning > random access is supported, not only sequential pulls).

The function takes the following parameters:

  • mode: scheduling mode.

The function returns the following values:

  • ok: TRUE when mode is in the list of scheduling modes.

func (*Query) HasSchedulingModeWithFlags

func (query *Query) HasSchedulingModeWithFlags(mode PadMode, flags SchedulingFlags) bool

HasSchedulingModeWithFlags: check if query has scheduling mode set and flags is set in query scheduling flags.

The function takes the following parameters:

  • mode: scheduling mode.
  • flags: SchedulingFlags.

The function returns the following values:

  • ok: TRUE when mode is in the list of scheduling modes and flags are compatible with query flags.

func (*Query) MiniObject

func (q *Query) MiniObject() *MiniObject

MiniObject: parent MiniObject type.

func (*Query) NAllocationMetas

func (query *Query) NAllocationMetas() uint

NAllocationMetas: retrieve the number of values currently stored in the meta API array of the query's structure.

The function returns the following values:

  • guint: metadata API array size as a #guint.

func (*Query) NAllocationParams

func (query *Query) NAllocationParams() uint

NAllocationParams: 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.

The function returns the following values:

  • guint: allocator array size as a #guint.

func (*Query) NAllocationPools

func (query *Query) NAllocationPools() uint

NAllocationPools: retrieve the number of values currently stored in the pool array of the query's structure.

The function returns the following values:

  • guint: pool array size as a #guint.

func (*Query) NBufferingRanges

func (query *Query) NBufferingRanges() uint

NBufferingRanges: retrieve the number of values currently stored in the buffered-ranges array of the query's structure.

The function returns the following values:

  • guint: range array size as a #guint.

func (*Query) NSchedulingModes

func (query *Query) NSchedulingModes() uint

NSchedulingModes: retrieve the number of values currently stored in the scheduling mode array of the query's structure.

The function returns the following values:

  • guint: scheduling mode array size as a #guint.

func (*Query) ParseAcceptCaps

func (query *Query) ParseAcceptCaps() *Caps

ParseAcceptCaps: get the caps from query. The caps remains valid as long as query remains valid.

The function returns the following values:

  • caps: pointer to the caps.

func (*Query) ParseAcceptCapsResult

func (query *Query) ParseAcceptCapsResult() bool

ParseAcceptCapsResult: parse the result from query and store in result.

The function returns the following values:

  • result (optional): location for the result.

func (*Query) ParseAllocation

func (query *Query) ParseAllocation() (*Caps, bool)

ParseAllocation: 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().

The function returns the following values:

  • caps (optional): Caps.
  • needPool (optional): whether a BufferPool is needed.

func (*Query) ParseBitrate

func (query *Query) ParseBitrate() uint

ParseBitrate: get the results of a bitrate query. See also gst_query_set_bitrate().

The function returns the following values:

  • nominalBitrate (optional): resulting bitrate in bits per second.

func (*Query) ParseBufferingPercent

func (query *Query) ParseBufferingPercent() (bool, int)

ParseBufferingPercent: 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.

The function returns the following values:

  • busy (optional): if buffering is busy, or NULL.
  • percent (optional): buffering percent, or NULL.

func (*Query) ParseBufferingRange

func (query *Query) ParseBufferingRange() (format Format, start int64, stop int64, estimatedTotal int64)

ParseBufferingRange: parse an available query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-NULL.

The function returns the following values:

  • format (optional) to set for the segment_start and segment_end values, or NULL.
  • start (optional) to set, or NULL.
  • stop (optional) to set, or NULL.
  • estimatedTotal (optional): estimated total amount of download time remaining in milliseconds, or NULL.

func (*Query) ParseBufferingStats

func (query *Query) ParseBufferingStats() (mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64)

ParseBufferingStats extracts the buffering stats values from query.

The function returns the following values:

  • mode (optional): buffering mode, or NULL.
  • avgIn (optional): average input rate, or NULL.
  • avgOut (optional): average output rat, or NULL.
  • bufferingLeft (optional): amount of buffering time left in milliseconds, or NULL.

func (*Query) ParseCaps

func (query *Query) ParseCaps() *Caps

ParseCaps: get the filter from the caps query. The caps remains valid as long as query remains valid.

The function returns the following values:

  • filter: pointer to the caps filter.

func (*Query) ParseCapsResult

func (query *Query) ParseCapsResult() *Caps

ParseCapsResult: get the caps result from query. The caps remains valid as long as query remains valid.

The function returns the following values:

  • caps: pointer to the caps.

func (*Query) ParseContext

func (query *Query) ParseContext() *Context

ParseContext: get the context from the context query. The context remains valid as long as query remains valid.

The function returns the following values:

  • context: pointer to store the Context.

func (*Query) ParseContextType

func (query *Query) ParseContextType() (string, bool)

ParseContextType: parse a context type from an existing GST_QUERY_CONTEXT query.

The function returns the following values:

  • contextType (optional): context type, or NULL.
  • ok indicating if the parsing succeeded.

func (*Query) ParseConvert

func (query *Query) ParseConvert() (srcFormat Format, srcValue int64, destFormat Format, destValue int64)

ParseConvert: 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.

The function returns the following values:

  • srcFormat (optional): storage for the Format of the source value, or NULL.
  • srcValue (optional): storage for the source value, or NULL.
  • destFormat (optional): storage for the Format of the destination value, or NULL.
  • destValue (optional): storage for the destination value, or NULL.

func (*Query) ParseDuration

func (query *Query) ParseDuration() (Format, int64)

ParseDuration: 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.

The function returns the following values:

  • format (optional): storage for the Format of the duration value, or NULL.
  • duration (optional): storage for the total duration, or NULL.

func (*Query) ParseLatency

func (query *Query) ParseLatency() (live bool, minLatency ClockTime, maxLatency ClockTime)

ParseLatency: parse a latency query answer.

The function returns the following values:

  • live (optional): storage for live or NULL.
  • minLatency (optional): storage for the min latency or NULL.
  • maxLatency (optional): storage for the max latency or NULL.

func (*Query) ParseNFormats

func (query *Query) ParseNFormats() uint

ParseNFormats: parse the number of formats in the formats query.

The function returns the following values:

  • nFormats (optional): number of formats in this query.

func (*Query) ParseNthAllocationMeta

func (query *Query) ParseNthAllocationMeta(index uint) (*Structure, coreglib.Type)

ParseNthAllocationMeta: parse an available query and get the metadata API at index of the metadata API array.

The function takes the following parameters:

  • index: position in the metadata API array to read.

The function returns the following values:

  • params (optional): API specific parameters.
  • gType of the metadata API at index.

func (*Query) ParseNthAllocationParam

func (query *Query) ParseNthAllocationParam(index uint) (Allocatorrer, *AllocationParams)

ParseNthAllocationParam: parse an available query and get the allocator and its params at index of the allocator array.

The function takes the following parameters:

  • index: position in the allocator array to read.

The function returns the following values:

  • allocator (optional): variable to hold the result.
  • params (optional) parameters for the allocator.

func (*Query) ParseNthAllocationPool

func (query *Query) ParseNthAllocationPool(index uint) (pool *BufferPool, size uint, minBuffers uint, maxBuffers uint)

ParseNthAllocationPool: get the pool parameters in query.

Unref pool with gst_object_unref() when it's not needed any more.

The function takes the following parameters:

  • index to parse.

The function returns the following values:

  • pool (optional): BufferPool.
  • size (optional): buffer size.
  • minBuffers (optional): min buffers.
  • maxBuffers (optional): max buffers.

func (*Query) ParseNthBufferingRange

func (query *Query) ParseNthBufferingRange(index uint) (start int64, stop int64, ok bool)

ParseNthBufferingRange: parse an available query and get the start and stop values stored at the index of the buffered ranges array.

The function takes the following parameters:

  • index: position in the buffered-ranges array to read.

The function returns the following values:

  • start (optional) position to set, or NULL.
  • stop (optional) position to set, or NULL.
  • ok indicating if the parsing succeeded.

func (*Query) ParseNthFormat

func (query *Query) ParseNthFormat(nth uint) Format

ParseNthFormat: 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.

The function takes the following parameters:

  • nth format to retrieve.

The function returns the following values:

  • format (optional): pointer to store the nth format.

func (*Query) ParseNthSchedulingMode

func (query *Query) ParseNthSchedulingMode(index uint) PadMode

ParseNthSchedulingMode: parse an available query and get the scheduling mode at index of the scheduling modes array.

The function takes the following parameters:

  • index: position in the scheduling modes array to read.

The function returns the following values:

  • padMode of the scheduling mode at index.

func (*Query) ParsePosition

func (query *Query) ParsePosition() (Format, int64)

ParsePosition: parse a position query, writing the format into format, and the position into cur, if the respective parameters are non-NULL.

The function returns the following values:

  • format (optional): storage for the Format of the position values (may be NULL).
  • cur (optional): storage for the current position (may be NULL).

func (*Query) ParseScheduling

func (query *Query) ParseScheduling() (flags SchedulingFlags, minsize int, maxsize int, align int)

ParseScheduling: set the scheduling properties.

The function returns the following values:

  • flags (optional): SchedulingFlags.
  • minsize (optional): suggested minimum size of pull requests.
  • maxsize (optional): suggested maximum size of pull requests:.
  • align (optional): suggested alignment of pull requests.

func (*Query) ParseSeeking

func (query *Query) ParseSeeking() (format Format, seekable bool, segmentStart int64, segmentEnd int64)

ParseSeeking: parse a seeking query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-NULL.

The function returns the following values:

  • format (optional) to set for the segment_start and segment_end values, or NULL.
  • seekable (optional) flag to set, or NULL.
  • segmentStart (optional): segment_start to set, or NULL.
  • segmentEnd (optional): segment_end to set, or NULL.

func (*Query) ParseSegment

func (query *Query) ParseSegment() (rate float64, format Format, startValue int64, stopValue int64)

ParseSegment: 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.

The function returns the following values:

  • rate (optional): storage for the rate of the segment, or NULL.
  • format (optional): storage for the Format of the values, or NULL.
  • startValue (optional): storage for the start value, or NULL.
  • stopValue (optional): storage for the stop value, or NULL.

func (*Query) ParseURI

func (query *Query) ParseURI() string

ParseURI: 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.

The function returns the following values:

  • uri (optional): storage for the current URI (may be NULL).

func (*Query) ParseURIRedirection

func (query *Query) ParseURIRedirection() string

ParseURIRedirection: 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.

The function returns the following values:

  • uri (optional): storage for the redirect URI (may be NULL).

func (*Query) ParseURIRedirectionPermanent

func (query *Query) ParseURIRedirectionPermanent() bool

ParseURIRedirectionPermanent: 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.

The function returns the following values:

  • permanent (optional): if the URI redirection is permanent (may be NULL).

func (*Query) RemoveNthAllocationMeta

func (query *Query) RemoveNthAllocationMeta(index uint)

RemoveNthAllocationMeta: remove the metadata API at index of the metadata API array.

The function takes the following parameters:

  • index: position in the metadata API array to remove.

func (*Query) RemoveNthAllocationParam

func (query *Query) RemoveNthAllocationParam(index uint)

RemoveNthAllocationParam: remove the allocation param at index of the allocation param array.

The function takes the following parameters:

  • index: position in the allocation param array to remove.

func (*Query) RemoveNthAllocationPool

func (query *Query) RemoveNthAllocationPool(index uint)

RemoveNthAllocationPool: remove the allocation pool at index of the allocation pool array.

The function takes the following parameters:

  • index: position in the allocation pool array to remove.

func (*Query) SetAcceptCapsResult

func (query *Query) SetAcceptCapsResult(result bool)

SetAcceptCapsResult: set result as the result for the query.

The function takes the following parameters:

  • result to set.

func (*Query) SetBitrate

func (query *Query) SetBitrate(nominalBitrate uint)

SetBitrate: 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).

The function takes the following parameters:

  • nominalBitrate: nominal bitrate in bits per second.

func (*Query) SetBufferingPercent

func (query *Query) SetBufferingPercent(busy bool, percent int)

SetBufferingPercent: 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.

The function takes the following parameters:

  • busy: if buffering is busy.
  • percent: buffering percent.

func (*Query) SetBufferingRange

func (query *Query) SetBufferingRange(format Format, start int64, stop int64, estimatedTotal int64)

SetBufferingRange: set the available query result fields in query.

The function takes the following parameters:

  • format to set for the start and stop values.
  • start to set.
  • stop to set.
  • estimatedTotal: estimated total amount of download time remaining in milliseconds.

func (*Query) SetBufferingStats

func (query *Query) SetBufferingStats(mode BufferingMode, avgIn int, avgOut int, bufferingLeft int64)

SetBufferingStats configures the buffering stats values in query.

The function takes the following parameters:

  • mode: buffering mode.
  • avgIn: average input rate.
  • avgOut: average output rate.
  • bufferingLeft: amount of buffering time left in milliseconds.

func (*Query) SetCapsResult

func (query *Query) SetCapsResult(caps *Caps)

SetCapsResult: set the caps result in query.

The function takes the following parameters:

  • caps: pointer to the caps.

func (*Query) SetContext

func (query *Query) SetContext(context *Context)

SetContext: answer a context query by setting the requested context.

The function takes the following parameters:

  • context: requested Context.

func (*Query) SetConvert

func (query *Query) SetConvert(srcFormat Format, srcValue int64, destFormat Format, destValue int64)

SetConvert: answer a convert query by setting the requested values.

The function takes the following parameters:

  • srcFormat: source Format.
  • srcValue: source value.
  • destFormat: destination Format.
  • destValue: destination value.

func (*Query) SetDuration

func (query *Query) SetDuration(format Format, duration int64)

SetDuration: answer a duration query by setting the requested value in the given format.

The function takes the following parameters:

  • format for the duration.
  • duration of the stream.

func (*Query) SetFormatsv

func (query *Query) SetFormatsv(formats []Format)

SetFormatsv: set the formats query result fields in query. The number of formats passed in the formats array must be equal to n_formats.

The function takes the following parameters:

  • formats: array containing n_formats GstFormat values.

func (*Query) SetLatency

func (query *Query) SetLatency(live bool, minLatency ClockTime, maxLatency ClockTime)

SetLatency: answer a latency query by setting the requested values in the given format.

The function takes the following parameters:

  • live: if there is a live element upstream.
  • minLatency: minimal latency of the upstream elements.
  • maxLatency: maximal latency of the upstream elements.

func (*Query) SetNthAllocationParam

func (query *Query) SetNthAllocationParam(index uint, allocator Allocatorrer, params *AllocationParams)

SetNthAllocationParam: parse an available query and get the allocator and its params at index of the allocator array.

The function takes the following parameters:

  • index: position in the allocator array to set.
  • allocator (optional): new allocator to set.
  • params (optional) parameters for the allocator.

func (*Query) SetNthAllocationPool

func (query *Query) SetNthAllocationPool(index uint, pool *BufferPool, size uint, minBuffers uint, maxBuffers uint)

SetNthAllocationPool: set the pool parameters in query.

The function takes the following parameters:

  • index to modify.
  • pool (optional): BufferPool.
  • size: buffer size.
  • minBuffers: min buffers.
  • maxBuffers: max buffers.

func (*Query) SetPosition

func (query *Query) SetPosition(format Format, cur int64)

SetPosition: answer a position query by setting the requested value in the given format.

The function takes the following parameters:

  • format: requested Format.
  • cur: position to set.

func (*Query) SetScheduling

func (query *Query) SetScheduling(flags SchedulingFlags, minsize int, maxsize int, align int)

SetScheduling: set the scheduling properties.

The function takes the following parameters:

  • flags: SchedulingFlags.
  • minsize: suggested minimum size of pull requests.
  • maxsize: suggested maximum size of pull requests.
  • align: suggested alignment of pull requests.

func (*Query) SetSeeking

func (query *Query) SetSeeking(format Format, seekable bool, segmentStart int64, segmentEnd int64)

SetSeeking: set the seeking query result fields in query.

The function takes the following parameters:

  • format to set for the segment_start and segment_end values.
  • seekable flag to set.
  • segmentStart: segment_start to set.
  • segmentEnd: segment_end to set.

func (*Query) SetSegment

func (query *Query) SetSegment(rate float64, format Format, startValue int64, stopValue int64)

SetSegment: 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 <= stop_value. rate will contain the playback rate. For negative rates, playback will actually happen from stop_value to start_value.

The function takes the following parameters:

  • rate of the segment.
  • format of the segment values (start_value and stop_value).
  • startValue: start value.
  • stopValue: stop value.

func (*Query) SetURI

func (query *Query) SetURI(uri string)

SetURI: answer a URI query by setting the requested URI.

The function takes the following parameters:

  • uri: URI to set.

func (*Query) SetURIRedirection

func (query *Query) SetURIRedirection(uri string)

SetURIRedirection: answer a URI query by setting the requested URI redirection.

The function takes the following parameters:

  • uri: URI to set.

func (*Query) SetURIRedirectionPermanent

func (query *Query) SetURIRedirectionPermanent(permanent bool)

SetURIRedirectionPermanent: answer a URI query by setting the requested URI redirection to permanent or not.

The function takes the following parameters:

  • permanent: whether the redirect is permanent or not.

func (*Query) Structure

func (query *Query) Structure() *Structure

Structure: get the structure of a query.

The function returns the following values:

  • structure (optional) of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.

func (*Query) Type

func (q *Query) Type() QueryType

Type: QueryType.

func (*Query) WritableStructure

func (query *Query) WritableStructure() *Structure

WritableStructure: 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.

The function returns the following values:

  • structure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.

type QueryType

type QueryType C.gint

QueryType: standard predefined Query types.

const (
	// QueryUnknown: unknown query type.
	QueryUnknown QueryType = 0
	// QueryPosition: current position in stream.
	QueryPosition QueryType = 2563
	// QueryDuration: total duration of the stream.
	QueryDuration QueryType = 5123
	// QueryLatency: latency of stream.
	QueryLatency QueryType = 7683
	// QueryJitter: current jitter of stream.
	QueryJitter QueryType = 10243
	// QueryRate: current rate of the stream.
	QueryRate QueryType = 12803
	// QuerySeeking: seeking capabilities.
	QuerySeeking QueryType = 15363
	// QuerySegment: segment start/stop positions.
	QuerySegment QueryType = 17923
	// QueryConvert: convert values between formats.
	QueryConvert QueryType = 20483
	// QueryFormats: query supported formats for convert.
	QueryFormats QueryType = 23043
	// QueryBuffering: query available media for efficient seeking.
	QueryBuffering QueryType = 28163
	// QueryCustom: custom application or element defined query.
	QueryCustom QueryType = 30723
	// QueryURI: query the URI of the source or sink.
	QueryURI QueryType = 33283
	// QueryAllocation: buffer allocation properties.
	QueryAllocation QueryType = 35846
	// QueryScheduling: scheduling properties.
	QueryScheduling QueryType = 38401
	// QueryAcceptCaps: accept caps query.
	QueryAcceptCaps QueryType = 40963
	// QueryCaps caps query.
	QueryCaps QueryType = 43523
	// QueryDrain: wait till all serialized data is consumed downstream.
	QueryDrain QueryType = 46086
	// QueryContext: query the pipeline-local context from downstream or
	// upstream (since 1.2).
	QueryContext QueryType = 48643
	// QueryBitrate: bitrate query (since 1.16).
	QueryBitrate QueryType = 51202
)

func (QueryType) String

func (q QueryType) String() string

String returns the name in string for QueryType.

type QueryTypeFlags

type QueryTypeFlags C.guint

QueryTypeFlags indicate the aspects of the different QueryType values. You can get the type flags of a QueryType with the gst_query_type_get_flags() function.

const (
	// QueryTypeUpstream: set if the query can travel upstream.
	QueryTypeUpstream QueryTypeFlags = 0b1
	// QueryTypeDownstream: set if the query can travel downstream.
	QueryTypeDownstream QueryTypeFlags = 0b10
	// QueryTypeSerialized: set if the query should be serialized with data
	// flow.
	QueryTypeSerialized QueryTypeFlags = 0b100
)

func QueryTypeGetFlags

func QueryTypeGetFlags(typ QueryType) QueryTypeFlags

QueryTypeGetFlags gets the QueryTypeFlags associated with type.

The function takes the following parameters:

  • typ: QueryType.

The function returns the following values:

  • queryTypeFlags: QueryTypeFlags.

func (QueryTypeFlags) Has

func (q QueryTypeFlags) Has(other QueryTypeFlags) bool

Has returns true if q contains other.

func (QueryTypeFlags) String

func (q QueryTypeFlags) String() string

String returns the names in string for QueryTypeFlags.

type Rank

type Rank C.gint

Rank: 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 PluginFeature. Any value is valid, including values bigger than GST_RANK_PRIMARY.

const (
	// RankNone will be chosen last or not at all.
	RankNone Rank = 0
	// RankMarginal: unlikely to be chosen.
	RankMarginal Rank = 64
	// RankSecondary: likely to be chosen.
	RankSecondary Rank = 128
	// RankPrimary will be chosen first.
	RankPrimary Rank = 256
)

func (Rank) String

func (r Rank) String() string

String returns the name in string for Rank.

type ReferenceTimestampMeta

type ReferenceTimestampMeta struct {
	// contains filtered or unexported fields
}

ReferenceTimestampMeta can be used to attach alternative timestamps and possibly durations to a Buffer. 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 Caps 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, or timestamp/x-ntp, host=pool.ntp.org, port=123 for timestamps based on a specific NTP server.

An instance of this type is always passed by reference.

func (*ReferenceTimestampMeta) Duration

func (r *ReferenceTimestampMeta) Duration() ClockTime

Duration: duration, or GST_CLOCK_TIME_NONE.

func (*ReferenceTimestampMeta) Parent

func (r *ReferenceTimestampMeta) Parent() *Meta

Parent: parent Meta structure.

func (*ReferenceTimestampMeta) Reference

func (r *ReferenceTimestampMeta) Reference() *Caps

Reference: identifier for the timestamp reference.

func (*ReferenceTimestampMeta) Timestamp

func (r *ReferenceTimestampMeta) Timestamp() ClockTime

Timestamp: timestamp.

type Registry

type Registry struct {
	GstObject
	// contains filtered or unexported fields
}

Registry: one registry holds the metadata of a set of plugins.

<emphasis role="bold">Design:</emphasis>

The Registry object is a list of plugins and some functions for dealing with them. Each Plugin 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.

func RegistryGet

func RegistryGet() *Registry

RegistryGet 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.

The function returns the following values:

  • registry: Registry.

func (*Registry) AddFeature

func (registry *Registry) AddFeature(feature PluginFeaturer) bool

AddFeature: 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()).

The function takes the following parameters:

  • feature to add.

The function returns the following values:

  • ok: TRUE on success.

    MT safe.

func (*Registry) AddPlugin

func (registry *Registry) AddPlugin(plugin *Plugin) bool

AddPlugin: 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()).

The function takes the following parameters:

  • plugin to add.

The function returns the following values:

  • ok: TRUE on success.

    MT safe.

func (*Registry) CheckFeatureVersion

func (registry *Registry) CheckFeatureVersion(featureName string, minMajor, minMinor, minMicro uint) bool

CheckFeatureVersion checks whether a plugin feature by the given name exists in registry and whether its version is at least the version required.

The function takes the following parameters:

  • featureName: name of the feature (e.g. "oggdemux").
  • minMajor: minimum major version number.
  • minMinor: minimum minor version number.
  • minMicro: minimum micro version number.

The function returns the following values:

  • ok: TRUE if the feature could be found and the version is the same as the required version or newer, and FALSE otherwise.

func (*Registry) ConnectFeatureAdded

func (registry *Registry) ConnectFeatureAdded(f func(feature PluginFeaturer)) coreglib.SignalHandle

ConnectFeatureAdded signals that a feature has been added to the registry (possibly replacing a previously-added one by the same name).

func (*Registry) ConnectPluginAdded

func (registry *Registry) ConnectPluginAdded(f func(plugin *Plugin)) coreglib.SignalHandle

ConnectPluginAdded signals that a plugin has been added to the registry (possibly replacing a previously-added one by the same name).

func (*Registry) FeatureFilter

func (registry *Registry) FeatureFilter(filter PluginFeatureFilter, first bool) []PluginFeaturer

FeatureFilter runs a filter against all features of the plugins in the registry and returns a GList with the results. If the first flag is set, only the first match is returned (as a list with a single object).

The function takes the following parameters:

  • filter to use.
  • first: only return first match.

The function returns the following values:

  • list of PluginFeature. Use gst_plugin_feature_list_free() after usage.

    MT safe.

func (*Registry) FeatureList

func (registry *Registry) FeatureList(typ coreglib.Type) []PluginFeaturer

FeatureList retrieves a #GList of PluginFeature of type.

The function takes the following parameters:

  • typ: #GType.

The function returns the following values:

  • list of PluginFeature of type. Use gst_plugin_feature_list_free() after use

    MT safe.

func (*Registry) FeatureListByPlugin

func (registry *Registry) FeatureListByPlugin(name string) []PluginFeaturer

FeatureListByPlugin retrieves a #GList of features of the plugin with name name.

The function takes the following parameters:

  • name: plugin name.

The function returns the following values:

  • list of PluginFeature. Use gst_plugin_feature_list_free() after usage.

func (*Registry) FeatureListCookie

func (registry *Registry) FeatureListCookie() uint32

FeatureListCookie returns the registry's feature list cookie. This changes every time a feature is added or removed from the registry.

The function returns the following values:

  • guint32: feature list cookie.

func (*Registry) FindFeature

func (registry *Registry) FindFeature(name string, typ coreglib.Type) PluginFeaturer

FindFeature: find the pluginfeature with the given name and type in the registry.

The function takes the following parameters:

  • name: pluginfeature name to find.
  • typ: pluginfeature type to find.

The function returns the following values:

  • pluginFeature (optional): pluginfeature with the given name and type or NULL if the plugin was not found. gst_object_unref() after usage.

    MT safe.

func (*Registry) FindPlugin

func (registry *Registry) FindPlugin(name string) *Plugin

FindPlugin: find the plugin with the given name in the registry. The plugin will be reffed; caller is responsible for unreffing.

The function takes the following parameters:

  • name: plugin name to find.

The function returns the following values:

  • plugin (optional) with the given name or NULL if the plugin was not found. gst_object_unref() after usage.

    MT safe.

func (*Registry) Lookup

func (registry *Registry) Lookup(filename string) *Plugin

Lookup: look up a plugin in the given registry with the given filename. If found, plugin is reffed.

The function takes the following parameters:

  • filename: name of the file to look up.

The function returns the following values:

  • plugin (optional) if found, or NULL if not. gst_object_unref() after usage.

func (*Registry) LookupFeature

func (registry *Registry) LookupFeature(name string) PluginFeaturer

LookupFeature: find a PluginFeature with name in registry.

The function takes the following parameters:

  • name: PluginFeature name.

The function returns the following values:

  • pluginFeature (optional) with its refcount incremented, use gst_object_unref() after usage.

    MT safe.

func (*Registry) PluginFilter

func (registry *Registry) PluginFilter(filter PluginFilter, first bool) []*Plugin

PluginFilter runs a filter against all plugins in the registry and returns a #GList with the results. If the first flag is set, only the first match is returned (as a list with a single object). Every plugin is reffed; use gst_plugin_list_free() after use, which will unref again.

The function takes the following parameters:

  • filter to use.
  • first: only return first match.

The function returns the following values:

  • list of Plugin. Use gst_plugin_list_free() after usage.

    MT safe.

func (*Registry) PluginList

func (registry *Registry) PluginList() []*Plugin

PluginList: get a copy of all plugins registered in the given registry. The refcount of each element in the list in incremented.

The function returns the following values:

  • list of Plugin. Use gst_plugin_list_free() after usage.

    MT safe.

func (*Registry) RemoveFeature

func (registry *Registry) RemoveFeature(feature PluginFeaturer)

RemoveFeature: remove the feature from the registry.

MT safe.

The function takes the following parameters:

  • feature to remove.

func (*Registry) RemovePlugin

func (registry *Registry) RemovePlugin(plugin *Plugin)

RemovePlugin: remove the plugin from the registry.

MT safe.

The function takes the following parameters:

  • plugin to remove.

func (*Registry) ScanPath

func (registry *Registry) ScanPath(path string) bool

ScanPath: scan the given path for plugins to add to the registry. The syntax of the path is specific to the registry.

The function takes the following parameters:

  • path to scan.

The function returns the following values:

  • ok: TRUE if registry changed.

type RegistryClass

type RegistryClass struct {
	// contains filtered or unexported fields
}

RegistryClass: instance of this type is always passed by reference.

func (*RegistryClass) ParentClass

func (r *RegistryClass) ParentClass() *ObjectClass

type RegistryOverrides

type RegistryOverrides struct {
}

RegistryOverrides contains methods that are overridable.

type ResourceError

type ResourceError C.gint

ResourceError: 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.

const (
	// ResourceErrorFailed: 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: do not use this except as a placeholder for
	// deciding where to go while developing code.
	ResourceErrorTooLaZY ResourceError = 2
	// ResourceErrorNotFound: used when the resource could not be found.
	ResourceErrorNotFound ResourceError = 3
	// ResourceErrorBusy: used when resource is busy.
	ResourceErrorBusy ResourceError = 4
	// ResourceErrorOpenRead: used when resource fails to open for reading.
	ResourceErrorOpenRead ResourceError = 5
	// ResourceErrorOpenWrite: used when resource fails to open for writing.
	ResourceErrorOpenWrite ResourceError = 6
	// ResourceErrorOpenReadWrite: used when resource cannot be opened for both
	// reading and writing, or either (but unspecified which).
	ResourceErrorOpenReadWrite ResourceError = 7
	// ResourceErrorClose: used when the resource can't be closed.
	ResourceErrorClose ResourceError = 8
	// ResourceErrorRead: used when the resource can't be read from.
	ResourceErrorRead ResourceError = 9
	// ResourceErrorWrite: used when the resource can't be written to.
	ResourceErrorWrite ResourceError = 10
	// ResourceErrorSeek: used when a seek on the resource fails.
	ResourceErrorSeek ResourceError = 11
	// ResourceErrorSync: used when a synchronize on the resource fails.
	ResourceErrorSync ResourceError = 12
	// ResourceErrorSettings: used when settings can't be manipulated on.
	ResourceErrorSettings ResourceError = 13
	// ResourceErrorNoSpaceLeft: used when the resource has no space left.
	ResourceErrorNoSpaceLeft ResourceError = 14
	// ResourceErrorNotAuthorized: used when the resource can't be opened due to
	// missing authorization. (Since: 1.2.4).
	ResourceErrorNotAuthorized ResourceError = 15
	// ResourceErrorNumErrors: number of resource error types.
	ResourceErrorNumErrors ResourceError = 16
)

func (ResourceError) String

func (r ResourceError) String() string

String returns the name in string for ResourceError.

type Sample

type Sample struct {
	// contains filtered or unexported fields
}

Sample is a small object containing data, a type, timing and extra arbitrary information.

An instance of this type is always passed by reference.

func NewSample

func NewSample(buffer *Buffer, caps *Caps, segment *Segment, info *Structure) *Sample

NewSample constructs a struct Sample.

func (*Sample) Buffer

func (sample *Sample) Buffer() *Buffer

Buffer: get the buffer associated with sample.

The function returns the following values:

  • buffer (optional) of sample or NULL when there is no buffer. The buffer remains valid as long as sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with gst_buffer_ref().

func (*Sample) BufferList

func (sample *Sample) BufferList() *BufferList

BufferList: get the buffer list associated with sample.

The function returns the following values:

  • bufferList (optional): buffer list of sample or NULL when there is no buffer list. The buffer list remains valid as long as sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer list with gst_mini_object_ref ().

func (*Sample) Caps

func (sample *Sample) Caps() *Caps

Caps: get the caps associated with sample.

The function returns the following values:

  • caps (optional) of sample or NULL when there is no caps. The caps remain valid as long as sample is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with gst_caps_ref().

func (*Sample) Info

func (sample *Sample) Info() *Structure

Info: get extra information associated with sample.

The function returns the following values:

  • structure (optional): extra info of sample. The info remains valid as long as sample is valid.

func (*Sample) Segment

func (sample *Sample) Segment() *Segment

Segment: get the segment associated with sample.

The function returns the following values:

  • segment of sample. The segment remains valid as long as sample is valid.

func (*Sample) SetBuffer

func (sample *Sample) SetBuffer(buffer *Buffer)

SetBuffer: set the buffer associated with sample. sample must be writable.

The function takes the following parameters:

  • buffer: Buffer.

func (*Sample) SetBufferList

func (sample *Sample) SetBufferList(bufferList *BufferList)

SetBufferList: set the buffer list associated with sample. sample must be writable.

The function takes the following parameters:

  • bufferList: BufferList.

func (*Sample) SetCaps

func (sample *Sample) SetCaps(caps *Caps)

SetCaps: set the caps associated with sample. sample must be writable.

The function takes the following parameters:

  • caps: Caps.

func (*Sample) SetInfo

func (sample *Sample) SetInfo(info *Structure) bool

SetInfo: set the info structure associated with sample. sample must be writable, and info must not have a parent set already.

The function takes the following parameters:

  • info: Structure.

The function returns the following values:

func (*Sample) SetSegment

func (sample *Sample) SetSegment(segment *Segment)

SetSegment: set the segment associated with sample. sample must be writable.

The function takes the following parameters:

  • segment: Segment.

type SchedulingFlags

type SchedulingFlags C.guint

SchedulingFlags: different scheduling flags.

const (
	// SchedulingFlagSeekable: if seeking is possible.
	SchedulingFlagSeekable SchedulingFlags = 0b1
	// SchedulingFlagSequential: if sequential access is recommended.
	SchedulingFlagSequential SchedulingFlags = 0b10
	// SchedulingFlagBandwidthLimited: if bandwidth is limited and buffering
	// possible (since 1.2).
	SchedulingFlagBandwidthLimited SchedulingFlags = 0b100
)

func (SchedulingFlags) Has

func (s SchedulingFlags) Has(other SchedulingFlags) bool

Has returns true if s contains other.

func (SchedulingFlags) String

func (s SchedulingFlags) String() string

String returns the names in string for SchedulingFlags.

type SearchMode

type SearchMode C.gint

SearchMode: different search modes.

const (
	// SearchModeExact: only search for exact matches.
	SearchModeExact SearchMode = iota
	// SearchModeBefore: search for an exact match or the element just before.
	SearchModeBefore
	// SearchModeAfter: search for an exact match or the element just after.
	SearchModeAfter
)

func (SearchMode) String

func (s SearchMode) String() string

String returns the name in string for SearchMode.

type SeekFlags

type SeekFlags C.guint

SeekFlags 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 > 1.0) or fast reverse (rate < -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.

const (
	// SeekFlagNone: no flag.
	SeekFlagNone SeekFlags = 0b0
	// SeekFlagFlush: flush pipeline.
	SeekFlagFlush SeekFlags = 0b1
	// SeekFlagAccurate: accurate position is requested, this might be
	// considerably slower for some formats.
	SeekFlagAccurate SeekFlags = 0b10
	// SeekFlagKeyUnit: seek to the nearest keyframe. This might be faster but
	// less accurate.
	SeekFlagKeyUnit SeekFlags = 0b100
	// SeekFlagSegment: perform a segment seek.
	SeekFlagSegment SeekFlags = 0b1000
	// SeekFlagTrickmode: when doing fast forward or fast reverse playback,
	// allow elements to skip frames instead of generating all frames. (Since:
	// 1.6).
	SeekFlagTrickmode SeekFlags = 0b10000
	// SeekFlagSkip: deprecated backward compatibility flag, replaced by
	// GST_SEEK_FLAG_TRICKMODE.
	SeekFlagSkip SeekFlags = 0b10000
	// SeekFlagSnapBefore: 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 = 0b100000
	// SeekFlagSnapAfter: 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 = 0b1000000
	// SeekFlagSnapNearest: 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 = 0b1100000
	// SeekFlagTrickmodeKeyUnits: 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 = 0b10000000
	// SeekFlagTrickmodeNoAudio: 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 = 0b100000000
	// SeekFlagTrickmodeForwardPredicted: 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 = 0b1000000000
	// SeekFlagInstantRateChange 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 = 0b10000000000
)

func (SeekFlags) Has

func (s SeekFlags) Has(other SeekFlags) bool

Has returns true if s contains other.

func (SeekFlags) String

func (s SeekFlags) String() string

String returns the names in string for SeekFlags.

type SeekType

type SeekType C.gint

SeekType: different types of seek events. When constructing a seek event with gst_event_new_seek() or when doing gst_segment_do_seek ().

const (
	// SeekTypeNone: no change in position is required.
	SeekTypeNone SeekType = iota
	// SeekTypeSet: absolute position is requested.
	SeekTypeSet
	// SeekTypeEnd: relative position to duration is requested.
	SeekTypeEnd
)

func (SeekType) String

func (s SeekType) String() string

String returns the name in string for SeekType.

type Segment

type Segment struct {
	// contains filtered or unexported fields
}

Segment: 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 Format 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 Segment 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).

An instance of this type is always passed by reference.

func NewSegment

func NewSegment() *Segment

NewSegment constructs a struct Segment.

func (*Segment) AppliedRate

func (s *Segment) AppliedRate() float64

AppliedRate: applied rate is the rate that has been applied to the stream. The effective/resulting playback rate of a stream is rate * applied_rate. The applied rate can be set by source elements when a server is sending the stream with an already modified playback speed rate. Filter elements that modify the stream in a way that modifies the playback speed should also modify the applied rate. For example the #videorate element when its #videorate:rate property is set will set the applied rate of the segment it pushed downstream. Also #scaletempo applies the input segment rate to the stream and outputs a segment with rate=1.0 and applied_rate=<inputsegment.rate>.

func (*Segment) Base

func (s *Segment) Base() uint64

Base: running time (plus elapsed time, see offset) of the segment start (GstSegment.start) (stop (GstSegment.stop) if rate < 0.0).

func (*Segment) Clip

func (segment *Segment) Clip(format Format, start uint64, stop uint64) (clipStart uint64, clipStop uint64, ok 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.

The function takes the following parameters:

  • format of the segment.
  • start position in the segment.
  • stop position in the segment.

The function returns the following values:

  • clipStart (optional): clipped start position in the segment.
  • clipStop (optional): clipped stop position in the segment.
  • ok: TRUE if the given start and stop times fall partially or completely in segment, FALSE if the values are completely outside of the segment.

func (*Segment) Copy

func (segment *Segment) Copy() *Segment

Copy: create a copy of given segment.

Free-function: gst_segment_free.

The function returns the following values:

  • ret: new Segment, free with gst_segment_free().

func (*Segment) CopyInto

func (src *Segment) CopyInto(dest *Segment)

CopyInto: copy the contents of src into dest.

The function takes the following parameters:

  • dest: Segment.

func (*Segment) DoSeek

func (segment *Segment) DoSeek(rate float64, format Format, flags SeekFlags, startType SeekType, start uint64, stopType SeekType, stop uint64) (update bool, ok bool)

DoSeek: 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 T_SEEK_TYPE_NONE. If no update was performed on segment start position (T_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 T_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 (T_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.

The function takes the following parameters:

  • rate of the segment.
  • format of the segment.
  • flags: segment flags for the segment.
  • startType: seek method.
  • start: seek start value.
  • stopType: seek method.
  • stop: seek stop value.

The function returns the following values:

  • update (optional): boolean holding whether position was updated.
  • ok: TRUE if the seek could be performed.

func (*Segment) Duration

func (s *Segment) Duration() uint64

Duration: duration of the segment is the maximum absolute difference between Segment.start and Segment.stop if stop is not set, otherwise it should be the difference between those two values. This should be set by elements that know the overall stream duration (like demuxers) and will be used when seeking with T_SEEK_TYPE_END.

func (*Segment) Flags

func (s *Segment) Flags() SegmentFlags

Flags flags for this segment.

func (*Segment) Format

func (s *Segment) Format() Format

Format: unit used for all of the segment's values.

func (*Segment) Init

func (segment *Segment) Init(format Format)

Init: 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.

The function takes the following parameters:

  • format of the segment.

func (*Segment) IsEqual

func (s0 *Segment) IsEqual(s1 *Segment) bool

IsEqual checks for two segments being equal. Equality here is defined as perfect equality, including floating point values.

The function takes the following parameters:

  • s1: Segment structure.

The function returns the following values:

  • ok: TRUE if the segments are equal, FALSE otherwise.

func (*Segment) Offset

func (s *Segment) Offset() uint64

Offset: offset expresses the elapsed time (in buffer timestamps) before a seek with its start (stop if rate < 0.0) seek type set to T_SEEK_TYPE_NONE, the value is set to the position of the segment at the time of the seek.

func (*Segment) OffsetRunningTime

func (segment *Segment) OffsetRunningTime(format Format, offset int64) bool

OffsetRunningTime: adjust the values in segment so that offset is applied to all future running-time calculations.

The function takes the following parameters:

  • format of the segment.
  • offset to apply in the segment.

The function returns the following values:

  • ok: TRUE if the segment could be updated successfully. If FALSE is returned, offset is not in segment.

func (*Segment) Position

func (s *Segment) Position() uint64

Position: buffer timestamp position in the segment is supposed to be updated by elements such as sources, demuxers or parsers to track progress by setting it to the last pushed buffer' end time (timestamp (GstBuffer.pts) + Buffer.duration) for that specific segment. The position is used when reconfiguring the segment with #gst_segment_do_seek when the seek is only updating the segment (see offset (GstSegment.offset)).

func (*Segment) PositionFromRunningTime

func (segment *Segment) PositionFromRunningTime(format Format, runningTime uint64) uint64

PositionFromRunningTime: convert running_time into a position in the segment so that gst_segment_to_running_time() with that position returns running_time.

The function takes the following parameters:

  • format of the segment.
  • runningTime: running_time in the segment.

The function returns the following values:

  • guint64: position in the segment for running_time. This function returns -1 when running_time is -1 or when it is not inside segment.

func (*Segment) PositionFromRunningTimeFull

func (segment *Segment) PositionFromRunningTimeFull(format Format, runningTime uint64) (uint64, int)

PositionFromRunningTimeFull: 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 < 0, and the value in the position variable should be negated to get the real negative segment position.

The function takes the following parameters:

  • format of the segment.
  • runningTime: running-time.

The function returns the following values:

  • position: resulting position in the segment.
  • gint: 1 or -1 on success, 0 on failure.

func (*Segment) PositionFromStreamTime

func (segment *Segment) PositionFromStreamTime(format Format, streamTime uint64) uint64

PositionFromStreamTime: convert stream_time into a position in the segment so that gst_segment_to_stream_time() with that position returns stream_time.

The function takes the following parameters:

  • format of the segment.
  • streamTime: stream_time in the segment.

The function returns the following values:

  • guint64: position in the segment for stream_time. This function returns -1 when stream_time is -1 or when it is not inside segment.

func (*Segment) PositionFromStreamTimeFull

func (segment *Segment) PositionFromStreamTimeFull(format Format, streamTime uint64) (uint64, int)

PositionFromStreamTimeFull: 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.

The function takes the following parameters:

  • format of the segment.
  • streamTime: stream-time.

The function returns the following values:

  • position: resulting position in the segment.
  • gint: 1 or -1 on success, 0 on failure.

func (*Segment) Rate

func (s *Segment) Rate() float64

Rate: playback rate of the segment is set in response to a seek event and, without any seek, the value should be 1.0. This value is used by elements that synchronize buffer [running times](additional/design/synchronisation.md#running-time) on the clock (usually the sink elements), leading to consuming buffers faster (for a value > 1.0) or slower (for 0.0 < value < 1.0) than normal playback speed. The rate also defines the playback direction, meaning that when the value is lower than 0.0, the playback happens in reverse, and the stream-time (additional/design/synchronisation.md#stream-time) is going backward. The rate value should never be 0.0.

func (*Segment) SetAppliedRate

func (s *Segment) SetAppliedRate(appliedRate float64)

AppliedRate: applied rate is the rate that has been applied to the stream. The effective/resulting playback rate of a stream is rate * applied_rate. The applied rate can be set by source elements when a server is sending the stream with an already modified playback speed rate. Filter elements that modify the stream in a way that modifies the playback speed should also modify the applied rate. For example the #videorate element when its #videorate:rate property is set will set the applied rate of the segment it pushed downstream. Also #scaletempo applies the input segment rate to the stream and outputs a segment with rate=1.0 and applied_rate=<inputsegment.rate>.

func (*Segment) SetBase

func (s *Segment) SetBase(base uint64)

Base: running time (plus elapsed time, see offset) of the segment start (GstSegment.start) (stop (GstSegment.stop) if rate < 0.0).

func (*Segment) SetDuration

func (s *Segment) SetDuration(duration uint64)

Duration: duration of the segment is the maximum absolute difference between Segment.start and Segment.stop if stop is not set, otherwise it should be the difference between those two values. This should be set by elements that know the overall stream duration (like demuxers) and will be used when seeking with T_SEEK_TYPE_END.

func (*Segment) SetOffset

func (s *Segment) SetOffset(offset uint64)

Offset: offset expresses the elapsed time (in buffer timestamps) before a seek with its start (stop if rate < 0.0) seek type set to T_SEEK_TYPE_NONE, the value is set to the position of the segment at the time of the seek.

func (*Segment) SetPosition

func (s *Segment) SetPosition(position uint64)

Position: buffer timestamp position in the segment is supposed to be updated by elements such as sources, demuxers or parsers to track progress by setting it to the last pushed buffer' end time (timestamp (GstBuffer.pts) + Buffer.duration) for that specific segment. The position is used when reconfiguring the segment with #gst_segment_do_seek when the seek is only updating the segment (see offset (GstSegment.offset)).

func (*Segment) SetRate

func (s *Segment) SetRate(rate float64)

Rate: playback rate of the segment is set in response to a seek event and, without any seek, the value should be 1.0. This value is used by elements that synchronize buffer [running times](additional/design/synchronisation.md#running-time) on the clock (usually the sink elements), leading to consuming buffers faster (for a value > 1.0) or slower (for 0.0 < value < 1.0) than normal playback speed. The rate also defines the playback direction, meaning that when the value is lower than 0.0, the playback happens in reverse, and the stream-time (additional/design/synchronisation.md#stream-time) is going backward. The rate value should never be 0.0.

func (*Segment) SetRunningTime

func (segment *Segment) SetRunningTime(format Format, runningTime uint64) bool

SetRunningTime: adjust the start/stop and base values of segment such that the next valid buffer will be one with running_time.

The function takes the following parameters:

  • format of the segment.
  • runningTime: running_time in the segment.

The function returns the following values:

  • ok: TRUE if the segment could be updated successfully. If FALSE is returned, running_time is -1 or not in segment.

func (*Segment) SetStart

func (s *Segment) SetStart(start uint64)

Start: start time of the segment (in buffer timestamps) (PTS) (GstBuffer.pts), that is the timestamp of the first buffer to output inside the segment (last one during reverse playback). For example decoders will clip (gst_segment_clip) out the buffers before the start time.

func (*Segment) SetStop

func (s *Segment) SetStop(stop uint64)

Stop: stop time of the segment (in buffer timestamps) (PTS) (GstBuffer.pts), that is the timestamp of the last buffer to output inside the segment (first one during reverse playback). For example decoders will clip (gst_segment_clip) out buffers after the stop time.

func (*Segment) SetTime

func (s *Segment) SetTime(time uint64)

Time: stream time of the segment start (GstSegment.start) (stop (GstSegment.stop) if rate < 0.0).

func (*Segment) Start

func (s *Segment) Start() uint64

Start: start time of the segment (in buffer timestamps) (PTS) (GstBuffer.pts), that is the timestamp of the first buffer to output inside the segment (last one during reverse playback). For example decoders will clip (gst_segment_clip) out the buffers before the start time.

func (*Segment) Stop

func (s *Segment) Stop() uint64

Stop: stop time of the segment (in buffer timestamps) (PTS) (GstBuffer.pts), that is the timestamp of the last buffer to output inside the segment (first one during reverse playback). For example decoders will clip (gst_segment_clip) out buffers after the stop time.

func (*Segment) Time

func (s *Segment) Time() uint64

Time: stream time of the segment start (GstSegment.start) (stop (GstSegment.stop) if rate < 0.0).

func (*Segment) ToPosition deprecated

func (segment *Segment) ToPosition(format Format, runningTime uint64) uint64

ToPosition: 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.

The function takes the following parameters:

  • format of the segment.
  • runningTime: running_time in the segment.

The function returns the following values:

  • guint64: position in the segment for running_time. This function returns -1 when running_time is -1 or when it is not inside segment.

func (*Segment) ToRunningTime

func (segment *Segment) ToRunningTime(format Format, position uint64) uint64

ToRunningTime: 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.

The function takes the following parameters:

  • format of the segment.
  • position in the segment.

The function returns the following values:

  • guint64: position as the total running time or -1 when an invalid position was given.

func (*Segment) ToRunningTimeFull

func (segment *Segment) ToRunningTimeFull(format Format, position uint64) (uint64, int)

ToRunningTimeFull: 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.

The function takes the following parameters:

  • format of the segment.
  • position in the segment.

The function returns the following values:

  • runningTime (optional): result running-time.
  • gint: 1 or -1 on success, 0 on failure.

func (*Segment) ToStreamTime

func (segment *Segment) ToStreamTime(format Format, position uint64) uint64

ToStreamTime: 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.

The function takes the following parameters:

  • format of the segment.
  • position in the segment.

The function returns the following values:

  • guint64: position in stream_time or -1 when an invalid position was given.

func (*Segment) ToStreamTimeFull

func (segment *Segment) ToStreamTimeFull(format Format, position uint64) (uint64, int)

ToStreamTimeFull: 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.

The function takes the following parameters:

  • format of the segment.
  • position in the segment.

The function returns the following values:

  • streamTime: result stream-time.
  • gint: 1 or -1 on success, 0 on failure.

type SegmentFlags

type SegmentFlags C.guint

SegmentFlags flags for the GstSegment structure. Currently mapped to the corresponding values of the seek flags.

const (
	// SegmentFlagNone: no flags.
	SegmentFlagNone SegmentFlags = 0b0
	// SegmentFlagReset: reset the pipeline running_time to the segment
	// running_time.
	SegmentFlagReset SegmentFlags = 0b1
	// SegmentFlagTrickmode: perform skip playback (Since: 1.6).
	SegmentFlagTrickmode SegmentFlags = 0b10000
	// SegmentFlagSkip: deprecated backward compatibility flag, replaced by
	// GST_SEGMENT_FLAG_TRICKMODE.
	SegmentFlagSkip SegmentFlags = 0b10000
	// SegmentFlagSegment: send SEGMENT_DONE instead of EOS.
	SegmentFlagSegment SegmentFlags = 0b1000
	// SegmentFlagTrickmodeKeyUnits: decode only keyframes, where possible
	// (Since: 1.6).
	SegmentFlagTrickmodeKeyUnits SegmentFlags = 0b10000000
	// SegmentFlagTrickmodeForwardPredicted: decode only keyframes or forward
	// predicted frames, where possible (Since: 1.18).
	SegmentFlagTrickmodeForwardPredicted SegmentFlags = 0b1000000000
	// SegmentFlagTrickmodeNoAudio: do not decode any audio, where possible
	// (Since: 1.6).
	SegmentFlagTrickmodeNoAudio SegmentFlags = 0b100000000
)

func (SegmentFlags) Has

func (s SegmentFlags) Has(other SegmentFlags) bool

Has returns true if s contains other.

func (SegmentFlags) String

func (s SegmentFlags) String() string

String returns the names in string for SegmentFlags.

type SerializeFlags

type SerializeFlags C.guint
const (
	// SerializeFlagNone: no special flags specified.
	SerializeFlagNone SerializeFlags = 0b0
	// SerializeFlagBackwardCompat: serialize using the old format for nested
	// structures.
	SerializeFlagBackwardCompat SerializeFlags = 0b1
)

func (SerializeFlags) Has

func (s SerializeFlags) Has(other SerializeFlags) bool

Has returns true if s contains other.

func (SerializeFlags) String

func (s SerializeFlags) String() string

String returns the names in string for SerializeFlags.

type SharedTaskPool

type SharedTaskPool struct {
	TaskPool
	// contains filtered or unexported fields
}

SharedTaskPool object.

func NewSharedTaskPool

func NewSharedTaskPool() *SharedTaskPool

NewSharedTaskPool: 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 SharedTaskPool 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.

The function returns the following values:

  • sharedTaskPool: new SharedTaskPool. gst_object_unref() after usage.

func (*SharedTaskPool) MaxThreads

func (pool *SharedTaskPool) MaxThreads() uint

The function returns the following values:

  • guint: maximum number of threads pool is configured to spawn.

func (*SharedTaskPool) SetMaxThreads

func (pool *SharedTaskPool) SetMaxThreads(maxThreads uint)

SetMaxThreads: 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.

The function takes the following parameters:

  • maxThreads: maximum number of threads to spawn.

type SharedTaskPoolClass

type SharedTaskPoolClass struct {
	// contains filtered or unexported fields
}

SharedTaskPoolClass object.

An instance of this type is always passed by reference.

func (*SharedTaskPoolClass) ParentClass

func (s *SharedTaskPoolClass) ParentClass() *TaskPoolClass

type SharedTaskPoolOverrides

type SharedTaskPoolOverrides struct {
}

SharedTaskPoolOverrides contains methods that are overridable.

type StackTraceFlags

type StackTraceFlags C.guint
const (
	// StackTraceShowNone: try to retrieve the minimum information available,
	// which may be none on some platforms (Since: 1.18).
	StackTraceShowNone StackTraceFlags = 0b0
	// StackTraceShowFull: try to retrieve as much information as possible,
	// including source information when getting the stack trace.
	StackTraceShowFull StackTraceFlags = 0b1
)

func (StackTraceFlags) Has

func (s StackTraceFlags) Has(other StackTraceFlags) bool

Has returns true if s contains other.

func (StackTraceFlags) String

func (s StackTraceFlags) String() string

String returns the names in string for StackTraceFlags.

type State

type State C.gint

State: possible states an element can be in. States can be changed using gst_element_set_state() and checked using gst_element_get_state().

const (
	// StateVoidPending: no pending state.
	StateVoidPending State = iota
	// StateNull: NULL state or initial state of an element.
	StateNull
	// StateReady: element is ready to go to PAUSED.
	StateReady
	// StatePaused: element is PAUSED, it is ready to accept and process data.
	// Sink elements however only accept one buffer and then block.
	StatePaused
	// StatePlaying: element is PLAYING, the Clock is running and the data is
	// flowing.
	StatePlaying
)

func (State) String

func (s State) String() string

String returns the name in string for State.

type StateChange

type StateChange C.gint

StateChange: these are the different state changes an element goes through. GST_STATE_NULL &rArr; GST_STATE_PLAYING is called an upwards state change and GST_STATE_PLAYING &rArr; GST_STATE_NULL a downwards state change.

const (
	// StateChangeNullToReady: 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: 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: state change from PAUSED to PLAYING. * Most
	// elements ignore this state change. * The pipeline selects a Clock and
	// distributes this to all the children before setting them to PLAYING. This
	// means that it is only allowed to synchronize on the Clock in the PLAYING
	// state. * The pipeline uses the Clock 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: state change from PLAYING to PAUSED. * Most
	// elements ignore this state change. * The pipeline calculates the
	// running_time based on the last selected Clock and the base_time. It
	// stores this information to continue playback when going back to the
	// PLAYING state. * Sinks unblock any Clock wait calls. * When a sink does
	// not have a pending buffer to play, it returns T_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 Bin containers. * Live sources stop
	// generating data and return GST_STATE_CHANGE_NO_PREROLL.
	StateChangePlayingToPaused StateChange = 35
	// StateChangePausedToReady: 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: state change from READY to NULL. * Elements close
	// devices * Elements reset any internal state.
	StateChangeReadyToNull StateChange = 17
	// StateChangeNullToNull: state change from NULL to NULL. (Since: 1.14).
	StateChangeNullToNull StateChange = 9
	// StateChangeReadyToReady: 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: 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: state change from PLAYING to PLAYING.
	// (Since: 1.14).
	StateChangePlayingToPlaying StateChange = 36
)

func (StateChange) String

func (s StateChange) String() string

String returns the name in string for StateChange.

type StateChangeReturn

type StateChangeReturn C.gint

StateChangeReturn: possible return values from a state change function such as gst_element_set_state(). Only GST_STATE_CHANGE_FAILURE is a real failure.

const (
	// StateChangeFailure: state change failed.
	StateChangeFailure StateChangeReturn = iota
	// StateChangeSuccess: state change succeeded.
	StateChangeSuccess
	// StateChangeAsync: state change will happen asynchronously.
	StateChangeAsync
	// StateChangeNoPreroll: state change succeeded but the element cannot
	// produce data in GST_STATE_PAUSED. This typically happens with live
	// sources.
	StateChangeNoPreroll
)

func (StateChangeReturn) String

func (s StateChangeReturn) String() string

String returns the name in string for StateChangeReturn.

type StaticCaps

type StaticCaps struct {
	// contains filtered or unexported fields
}

StaticCaps: data structure to initialize Caps from a string description usually used in conjunction with GST_STATIC_CAPS() and gst_static_caps_get() to instantiate a Caps.

An instance of this type is always passed by reference.

func (*StaticCaps) Caps

func (s *StaticCaps) Caps() *Caps

Caps: cached Caps.

func (*StaticCaps) Cleanup

func (staticCaps *StaticCaps) Cleanup()

Cleanup cleans up the cached caps contained in static_caps.

func (*StaticCaps) Get

func (staticCaps *StaticCaps) Get() *Caps

Get converts a StaticCaps to a Caps.

The function returns the following values:

  • caps (optional): pointer to the Caps. Since the core holds an additional ref to the returned caps, use gst_caps_make_writable() on the returned caps to modify it.

func (*StaticCaps) String

func (s *StaticCaps) String() string

String: string describing a caps.

type StaticPadTemplate

type StaticPadTemplate struct {
	// contains filtered or unexported fields
}

StaticPadTemplate: structure describing the StaticPadTemplate.

An instance of this type is always passed by reference.

func (*StaticPadTemplate) Caps

func (templ *StaticPadTemplate) Caps() *Caps

Caps gets the capabilities of the static pad template.

The function returns the following values:

  • caps of the static pad template. Unref after usage. Since the core holds an additional ref to the returned caps, use gst_caps_make_writable() on the returned caps to modify it.

func (*StaticPadTemplate) Direction

func (s *StaticPadTemplate) Direction() PadDirection

Direction: direction of the template.

func (*StaticPadTemplate) Get

func (padTemplate *StaticPadTemplate) Get() *PadTemplate

Get converts a StaticPadTemplate into a PadTemplate.

The function returns the following values:

  • padTemplate (optional): new PadTemplate.

func (*StaticPadTemplate) NameTemplate

func (s *StaticPadTemplate) NameTemplate() string

NameTemplate: name of the template.

func (*StaticPadTemplate) Presence

func (s *StaticPadTemplate) Presence() PadPresence

Presence: presence of the template.

func (*StaticPadTemplate) StaticCaps

func (s *StaticPadTemplate) StaticCaps() *StaticCaps

StaticCaps caps of the template.

type Stream

type Stream struct {
	GstObject
	// contains filtered or unexported fields
}

Stream: high-level object representing a single stream. It might be backed, or not, by an actual flow of data in a pipeline (Pad).

A Stream 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 Stream contains all the information pertinent to a stream, such as stream-id, tags, caps, type, ...

Elements can subclass a Stream for internal usage (to contain information pertinent to streams of data).

func NewStream

func NewStream(streamId string, caps *Caps, typ StreamType, flags StreamFlags) *Stream

NewStream: create a new Stream for the given stream_id, caps, type and flags.

The function takes the following parameters:

  • streamId (optional): id for the new stream. If NULL, a new one will be automatically generated.
  • caps (optional) of the stream.
  • typ of the stream.
  • flags of the stream.

The function returns the following values:

  • stream: new Stream.

func (*Stream) Caps

func (stream *Stream) Caps() *Caps

Caps: retrieve the caps for stream, if any.

The function returns the following values:

  • caps (optional) for stream.

func (*Stream) SetCaps

func (stream *Stream) SetCaps(caps *Caps)

SetCaps: set the caps for the Stream.

The function takes the following parameters:

  • caps (optional): Caps.

func (*Stream) SetStreamFlags

func (stream *Stream) SetStreamFlags(flags StreamFlags)

SetStreamFlags: set the flags for the stream.

The function takes the following parameters:

  • flags to set on stream.

func (*Stream) SetStreamType

func (stream *Stream) SetStreamType(streamType StreamType)

SetStreamType: set the stream type of stream.

The function takes the following parameters:

  • streamType: type to set on stream.

func (*Stream) StreamFlags

func (stream *Stream) StreamFlags() StreamFlags

StreamFlags: retrieve the current stream flags for stream.

The function returns the following values:

  • streamFlags for stream.

func (*Stream) StreamID

func (stream *Stream) StreamID() string

StreamID returns the stream ID of stream.

The function returns the following values:

  • utf8 (optional): stream ID of stream. Only valid during the lifetime of stream.

func (*Stream) StreamType

func (stream *Stream) StreamType() StreamType

StreamType: retrieve the stream type for stream.

The function returns the following values:

  • streamType for stream.

type StreamClass

type StreamClass struct {
	// contains filtered or unexported fields
}

StreamClass: gstStream class structure

An instance of this type is always passed by reference.

func (*StreamClass) ParentClass

func (s *StreamClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

type StreamCollection

type StreamCollection struct {
	GstObject
	// contains filtered or unexported fields
}

StreamCollection: collection of Stream that are available.

A StreamCollection 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 StreamCollection is immutable. Updates are made by sending a new StreamCollection message, which may or may not share some of the Stream 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 StreamCollection.

Applications can activate streams from a collection by using the T_EVENT_SELECT_STREAMS event on a pipeline, bin or element.

func NewStreamCollection

func NewStreamCollection(upstreamId string) *StreamCollection

NewStreamCollection: create a new StreamCollection.

The function takes the following parameters:

  • upstreamId (optional): stream id of the parent stream.

The function returns the following values:

  • streamCollection: new StreamCollection.

func (*StreamCollection) AddStream

func (collection *StreamCollection) AddStream(stream *Stream) bool

AddStream: add the given stream to the collection.

The function takes the following parameters:

  • stream to add.

The function returns the following values:

  • ok: TRUE if the stream was properly added, else FALSE.

func (*StreamCollection) Size

func (collection *StreamCollection) Size() uint

Size: get the number of streams this collection contains.

The function returns the following values:

  • guint: number of streams that collection contains.

func (*StreamCollection) Stream

func (collection *StreamCollection) Stream(index uint) *Stream

Stream: retrieve the Stream with index index from the collection.

The caller should not modify the returned Stream.

The function takes the following parameters:

  • index: index of the stream to retrieve.

The function returns the following values:

  • stream (optional): Stream.

func (*StreamCollection) UpstreamID

func (collection *StreamCollection) UpstreamID() string

UpstreamID returns the upstream id of the collection.

The function returns the following values:

  • utf8 (optional): upstream id.

type StreamCollectionClass

type StreamCollectionClass struct {
	// contains filtered or unexported fields
}

StreamCollectionClass: gstStreamCollection class structure

An instance of this type is always passed by reference.

func (*StreamCollectionClass) ParentClass

func (s *StreamCollectionClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

type StreamCollectionOverrides

type StreamCollectionOverrides struct {
}

StreamCollectionOverrides contains methods that are overridable.

type StreamError

type StreamError C.gint

StreamError: stream errors are for anything related to the stream being processed: format errors, media type errors, ... They're typically used by decoders, demuxers, converters, ...

const (
	// StreamErrorFailed: 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: do not use this except as a placeholder for deciding
	// where to go while developing code.
	StreamErrorTooLaZY StreamError = 2
	// StreamErrorNotImplemented: use this when you do not want to implement
	// this functionality yet.
	StreamErrorNotImplemented StreamError = 3
	// StreamErrorTypeNotFound: used when the element doesn't know the stream's
	// type.
	StreamErrorTypeNotFound StreamError = 4
	// StreamErrorWrongType: used when the element doesn't handle this type of
	// stream.
	StreamErrorWrongType StreamError = 5
	// StreamErrorCodecNotFound: used when there's no codec to handle the
	// stream's type.
	StreamErrorCodecNotFound StreamError = 6
	// StreamErrorDecode: used when decoding fails.
	StreamErrorDecode StreamError = 7
	// StreamErrorEncode: used when encoding fails.
	StreamErrorEncode StreamError = 8
	// StreamErrorDemux: used when demuxing fails.
	StreamErrorDemux StreamError = 9
	// StreamErrorMux: used when muxing fails.
	StreamErrorMux StreamError = 10
	// StreamErrorFormat: used when the stream is of the wrong format (for
	// example, wrong caps).
	StreamErrorFormat StreamError = 11
	// StreamErrorDecrypt: used when the stream is encrypted and can't be
	// decrypted because this is not supported by the element.
	StreamErrorDecrypt StreamError = 12
	// StreamErrorDecryptNokey: used when the stream is encrypted and can't be
	// decrypted because no suitable key is available.
	StreamErrorDecryptNokey StreamError = 13
	// StreamErrorNumErrors: number of stream error types.
	StreamErrorNumErrors StreamError = 14
)

func (StreamError) String

func (s StreamError) String() string

String returns the name in string for StreamError.

type StreamFlags

type StreamFlags C.guint
const (
	// StreamFlagNone: this stream has no special attributes.
	StreamFlagNone StreamFlags = 0b0
	// StreamFlagSparse: 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 = 0b1
	// StreamFlagSelect: 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 = 0b10
	// StreamFlagUnselect: 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 = 0b100
)

func (StreamFlags) Has

func (s StreamFlags) Has(other StreamFlags) bool

Has returns true if s contains other.

func (StreamFlags) String

func (s StreamFlags) String() string

String returns the names in string for StreamFlags.

type StreamOverrides

type StreamOverrides struct {
}

StreamOverrides contains methods that are overridable.

type StreamStatusType

type StreamStatusType C.gint

StreamStatusType: type of a GST_MESSAGE_STREAM_STATUS. The stream status messages inform the application of new streaming threads and their status.

const (
	// StreamStatusTypeCreate: new thread need to be created.
	StreamStatusTypeCreate StreamStatusType = 0
	// StreamStatusTypeEnter: thread entered its loop function.
	StreamStatusTypeEnter StreamStatusType = 1
	// StreamStatusTypeLeave: thread left its loop function.
	StreamStatusTypeLeave StreamStatusType = 2
	// StreamStatusTypeDestroy: thread is destroyed.
	StreamStatusTypeDestroy StreamStatusType = 3
	// StreamStatusTypeStart: thread is started.
	StreamStatusTypeStart StreamStatusType = 8
	// StreamStatusTypePause: thread is paused.
	StreamStatusTypePause StreamStatusType = 9
	// StreamStatusTypeStop: thread is stopped.
	StreamStatusTypeStop StreamStatusType = 10
)

func (StreamStatusType) String

func (s StreamStatusType) String() string

String returns the name in string for StreamStatusType.

type StreamType

type StreamType C.guint

StreamType describes a high level classification set for flows of data in Stream 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.

const (
	// StreamTypeUnknown: stream is of unknown (unclassified) type.
	StreamTypeUnknown StreamType = 0b1
	// StreamTypeAudio: stream is of audio data.
	StreamTypeAudio StreamType = 0b10
	// StreamTypeVideo: stream carries video data.
	StreamTypeVideo StreamType = 0b100
	// StreamTypeContainer: stream is a muxed container type.
	StreamTypeContainer StreamType = 0b1000
	// StreamTypeText: stream contains subtitle / subpicture data.
	StreamTypeText StreamType = 0b10000
)

func (StreamType) Has

func (s StreamType) Has(other StreamType) bool

Has returns true if s contains other.

func (StreamType) String

func (s StreamType) String() string

String returns the names in string for StreamType.

type Structure

type Structure struct {
	// contains filtered or unexported fields
}

Structure 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 Structure also has a name. The name starts with a letter and can be filled by letters, numbers and any of "/-_.:".

Structure is used by various GStreamer subsystems to store information in a flexible and extensible way. A Structure does not have a refcount because it usually is part of a higher level object such as Caps, Message, Event, Query. It provides a means to enforce mutability using the refcount of the parent with the gst_structure_set_parent_refcount() method.

A Structure 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 T_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" (< and >). For example `a-structure, list=<1, 2, 3>

Structures are delimited either by a null character \0 or a semicolon ; the latter allowing to store multiple structures in the same string (see Caps).

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]

> *note*: gst_structure_to_string() won't use that syntax for backward > compatibility reason, gst_structure_serialize() has been added for > that purpose.

An instance of this type is always passed by reference.

func NewStructureEmpty

func NewStructureEmpty(name string) *Structure

NewStructureEmpty constructs a struct Structure.

func NewStructureFromString

func NewStructureFromString(str string) *Structure

NewStructureFromString constructs a struct Structure.

func NewStructureIDEmpty

func NewStructureIDEmpty(quark glib.Quark) *Structure

NewStructureIDEmpty constructs a struct Structure.

func ValueGetStructure

func ValueGetStructure(value *coreglib.Value) *Structure

ValueGetStructure gets the contents of value.

The function takes the following parameters:

  • value: GValue initialized to GST_TYPE_STRUCTURE.

The function returns the following values:

  • structure contents of value.

func (*Structure) Boolean

func (structure *Structure) Boolean(fieldname string) (value bool, ok bool)

Boolean 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a #gboolean to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a boolean, this function returns FALSE.

func (*Structure) CanIntersect

func (struct1 *Structure) CanIntersect(struct2 *Structure) bool

CanIntersect tries intersecting struct1 and struct2 and reports whether the result would not be empty.

The function takes the following parameters:

  • struct2: Structure.

The function returns the following values:

  • ok: TRUE if intersection would not be empty.

func (*Structure) ClockTime

func (structure *Structure) ClockTime(fieldname string) (ClockTime, bool)

ClockTime 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a ClockTime to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a ClockTime, this function returns FALSE.

func (*Structure) Copy

func (structure *Structure) Copy() *Structure

Copy duplicates a Structure and all its fields and values.

Free-function: gst_structure_free.

The function returns the following values:

  • ret: new Structure.

func (*Structure) DateTime

func (structure *Structure) DateTime(fieldname string) (*DateTime, bool)

DateTime 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).

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a DateTime to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a data, this function returns FALSE.

func (*Structure) Double

func (structure *Structure) Double(fieldname string) (float64, bool)

Double 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a gdouble to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a double, this function returns FALSE.

func (*Structure) Enum

func (structure *Structure) Enum(fieldname string, enumtype coreglib.Type) (int, bool)

Enum 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.

The function takes the following parameters:

  • fieldname: name of a field.
  • enumtype: enum type of a field.

The function returns the following values:

  • value: pointer to an int to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain an enum of the given type, this function returns FALSE.

func (*Structure) FieldType

func (structure *Structure) FieldType(fieldname string) coreglib.Type

FieldType 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.

The function takes the following parameters:

  • fieldname: name of the field.

The function returns the following values:

  • gType of the field.

func (*Structure) FilterAndMapInPlace

func (structure *Structure) FilterAndMapInPlace(fn StructureFilterMapFunc)

FilterAndMapInPlace calls the provided function once for each field in the Structure. 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.

The function takes the following parameters:

  • fn: function to call for each field.

func (*Structure) Fixate

func (structure *Structure) Fixate()

Fixate all values in structure using gst_value_fixate(). structure will be modified in-place and should be writable.

func (*Structure) FixateField

func (structure *Structure) FixateField(fieldName string) bool

FixateField fixates a Structure by changing the given field with its fixated value.

The function takes the following parameters:

  • fieldName: field in structure.

The function returns the following values:

  • ok: TRUE if the structure field could be fixated.

func (*Structure) FixateFieldBoolean

func (structure *Structure) FixateFieldBoolean(fieldName string, target bool) bool

FixateFieldBoolean fixates a Structure by changing the given field_name field to the given target boolean if that field is not fixed yet.

The function takes the following parameters:

  • fieldName: field in structure.
  • target value of the fixation.

The function returns the following values:

  • ok: TRUE if the structure could be fixated.

func (*Structure) FixateFieldNearestDouble

func (structure *Structure) FixateFieldNearestDouble(fieldName string, target float64) bool

FixateFieldNearestDouble fixates a Structure by changing the given field to the nearest double to target that is a subset of the existing field.

The function takes the following parameters:

  • fieldName: field in structure.
  • target value of the fixation.

The function returns the following values:

  • ok: TRUE if the structure could be fixated.

func (*Structure) FixateFieldNearestFraction

func (structure *Structure) FixateFieldNearestFraction(fieldName string, targetNumerator int, targetDenominator int) bool

FixateFieldNearestFraction fixates a Structure by changing the given field to the nearest fraction to target_numerator/target_denominator that is a subset of the existing field.

The function takes the following parameters:

  • fieldName: field in structure.
  • targetNumerator: numerator of the target value of the fixation.
  • targetDenominator: denominator of the target value of the fixation.

The function returns the following values:

  • ok: TRUE if the structure could be fixated.

func (*Structure) FixateFieldNearestInt

func (structure *Structure) FixateFieldNearestInt(fieldName string, target int) bool

FixateFieldNearestInt fixates a Structure by changing the given field to the nearest integer to target that is a subset of the existing field.

The function takes the following parameters:

  • fieldName: field in structure.
  • target value of the fixation.

The function returns the following values:

  • ok: TRUE if the structure could be fixated.

func (*Structure) FixateFieldString

func (structure *Structure) FixateFieldString(fieldName string, target string) bool

FixateFieldString fixates a Structure by changing the given field_name field to the given target string if that field is not fixed yet.

The function takes the following parameters:

  • fieldName: field in structure.
  • target value of the fixation.

The function returns the following values:

  • ok: TRUE if the structure could be fixated.

func (*Structure) Flagset

func (structure *Structure) Flagset(fieldname string) (valueFlags uint, valueMask uint, ok bool)

Flagset: read the GstFlagSet flags and mask out of the structure into the provided pointers.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • valueFlags (optional): pointer to a guint for the flags field.
  • valueMask (optional): pointer to a guint for the mask field.
  • ok: TRUE if the values could be set correctly. If there was no field with fieldname or the existing field did not contain a GstFlagSet, this function returns FALSE.

func (*Structure) ForEach

func (structure *Structure) ForEach(fn StructureForEachFunc) bool

ForEach calls the provided function once for each field in the Structure. The function must not modify the fields. Also see gst_structure_map_in_place() and gst_structure_filter_and_map_in_place().

The function takes the following parameters:

  • fn: function to call for each field.

The function returns the following values:

  • ok: TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise.

func (*Structure) Fraction

func (structure *Structure) Fraction(fieldname string) (valueNumerator int, valueDenominator int, ok bool)

Fraction 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • valueNumerator: pointer to an int to set.
  • valueDenominator: pointer to an int to set.
  • ok: TRUE if the values could be set correctly. If there was no field with fieldname or the existing field did not contain a GstFraction, this function returns FALSE.

func (*Structure) HasField

func (structure *Structure) HasField(fieldname string) bool

HasField: check if structure contains a field named fieldname.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • ok: TRUE if the structure contains a field with the given name.

func (*Structure) HasFieldTyped

func (structure *Structure) HasFieldTyped(fieldname string, typ coreglib.Type) bool

HasFieldTyped: check if structure contains a field named fieldname and with GType type.

The function takes the following parameters:

  • fieldname: name of a field.
  • typ: type of a value.

The function returns the following values:

  • ok: TRUE if the structure contains a field with the given name and type.

func (*Structure) HasName

func (structure *Structure) HasName(name string) bool

HasName checks if the structure has the given name.

The function takes the following parameters:

  • name: structure name to check for.

The function returns the following values:

  • ok: TRUE if name matches the name of the structure.

func (*Structure) IDGetValue

func (structure *Structure) IDGetValue(field glib.Quark) *coreglib.Value

IDGetValue: get the value of the field with GQuark field.

The function takes the following parameters:

  • field of the field to get.

The function returns the following values:

  • value (optional) corresponding to the field with the given name identifier.

func (*Structure) IDHasField

func (structure *Structure) IDHasField(field glib.Quark) bool

IDHasField: check if structure contains a field named field.

The function takes the following parameters:

  • field of the field name.

The function returns the following values:

  • ok: TRUE if the structure contains a field with the given name.

func (*Structure) IDHasFieldTyped

func (structure *Structure) IDHasFieldTyped(field glib.Quark, typ coreglib.Type) bool

IDHasFieldTyped: check if structure contains a field named field and with GType type.

The function takes the following parameters:

  • field of the field name.
  • typ: type of a value.

The function returns the following values:

  • ok: TRUE if the structure contains a field with the given name and type.

func (*Structure) IDSetValue

func (structure *Structure) IDSetValue(field glib.Quark, value *coreglib.Value)

IDSetValue 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.

The function takes the following parameters:

  • field representing a field.
  • value: new value of the field.

func (*Structure) IDTakeValue

func (structure *Structure) IDTakeValue(field glib.Quark, value *coreglib.Value)

IDTakeValue 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.

The function takes the following parameters:

  • field representing a field.
  • value: new value of the field.

func (*Structure) Int

func (structure *Structure) Int(fieldname string) (int, bool)

Int 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to an int to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain an int, this function returns FALSE.

func (*Structure) Int64

func (structure *Structure) Int64(fieldname string) (int64, bool)

Int64 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a #gint64 to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a #gint64, this function returns FALSE.

func (*Structure) Intersect

func (struct1 *Structure) Intersect(struct2 *Structure) *Structure

Intersect intersects struct1 and struct2 and returns the intersection.

The function takes the following parameters:

  • struct2: Structure.

The function returns the following values:

  • structure (optional): intersection of struct1 and struct2.

func (*Structure) IsEqual

func (structure1 *Structure) IsEqual(structure2 *Structure) bool

IsEqual tests if the two Structure are equal.

The function takes the following parameters:

  • structure2: Structure.

The function returns the following values:

  • ok: TRUE if the two structures have the same name and field.

func (*Structure) IsSubset

func (subset *Structure) IsSubset(superset *Structure) bool

IsSubset 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.

The function takes the following parameters:

  • superset: potentially greater Structure.

The function returns the following values:

  • ok: TRUE if subset is a subset of superset.

func (*Structure) MapInPlace

func (structure *Structure) MapInPlace(fn StructureMapFunc) bool

MapInPlace calls the provided function once for each field in the Structure. In contrast to gst_structure_foreach(), the function may modify but not delete the fields. The structure must be mutable.

The function takes the following parameters:

  • fn: function to call for each field.

The function returns the following values:

  • ok: TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise.

func (*Structure) NFields

func (structure *Structure) NFields() int

NFields: get the number of fields in the structure.

The function returns the following values:

  • gint: number of fields in the structure.

func (*Structure) Name

func (structure *Structure) Name() string

Name: get the name of structure as a string.

The function returns the following values:

  • utf8: name of the structure.

func (*Structure) NameID

func (structure *Structure) NameID() glib.Quark

NameID: get the name of structure as a GQuark.

The function returns the following values:

  • quark representing the name of the structure.

func (*Structure) NthFieldName

func (structure *Structure) NthFieldName(index uint) string

NthFieldName: get the name of the given field number, counting from 0 onwards.

The function takes the following parameters:

  • index to get the name of.

The function returns the following values:

  • utf8: name of the given field number.

func (*Structure) RemoveAllFields

func (structure *Structure) RemoveAllFields()

RemoveAllFields removes all fields in a GstStructure.

func (*Structure) RemoveField

func (structure *Structure) RemoveField(fieldname string)

RemoveField removes the field with the given name. If the field with the given name does not exist, the structure is unchanged.

The function takes the following parameters:

  • fieldname: name of the field to remove.

func (*Structure) Serialize

func (structure *Structure) Serialize(flags SerializeFlags) string

Serialize 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 T_SERIALIZE_FLAG_BACKWARD_COMPAT is passed as flag.

Free-function: g_free.

The function takes the following parameters:

  • flags to use to serialize structure.

The function returns the following values:

  • utf8: pointer to string allocated by g_malloc(). g_free() after usage.

func (*Structure) SetName

func (structure *Structure) SetName(name string)

SetName 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 "/-_.:".

The function takes the following parameters:

  • name: new name of the structure.

func (*Structure) SetParentRefcount

func (structure *Structure) SetParentRefcount(refcount *int) bool

SetParentRefcount sets the parent_refcount field of Structure. 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 Structure, as described in the MT Refcounting section of the design documents.

The function takes the following parameters:

  • refcount: pointer to the parent's refcount.

The function returns the following values:

  • ok: TRUE if the parent refcount could be set.

func (*Structure) SetValue

func (structure *Structure) SetValue(fieldname string, value *coreglib.Value)

SetValue 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.

The function takes the following parameters:

  • fieldname: name of the field to set.
  • value: new value of the field.

func (*Structure) String

func (structure *Structure) String(fieldname string) string

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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • utf8 (optional): pointer to the string or NULL when the field did not exist or did not contain a string.

func (*Structure) TakeValue

func (structure *Structure) TakeValue(fieldname string, value *coreglib.Value)

TakeValue 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. The function will take ownership of value.

The function takes the following parameters:

  • fieldname: name of the field to set.
  • value: new value of the field.

func (*Structure) ToString

func (structure *Structure) ToString() string

ToString converts structure to a human-readable string representation.

For debugging purposes its easier to do something like this: |[<!-- language="C" --> 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 Caps / Structure deeper than one level, you should user gst_structure_serialize() instead for those cases.

Free-function: g_free.

The function returns the following values:

  • utf8: pointer to string allocated by g_malloc(). g_free() after usage.

func (*Structure) Type

func (s *Structure) Type() coreglib.Type

Type of a structure.

func (*Structure) Uint

func (structure *Structure) Uint(fieldname string) (uint, bool)

Uint 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a uint to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a uint, this function returns FALSE.

func (*Structure) Uint64

func (structure *Structure) Uint64(fieldname string) (uint64, bool)

Uint64 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.

The function takes the following parameters:

  • fieldname: name of a field.

The function returns the following values:

  • value: pointer to a #guint64 to set.
  • ok: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a #guint64, this function returns FALSE.

func (*Structure) Value

func (structure *Structure) Value(fieldname string) *coreglib.Value

Value: get the value of the field with name fieldname.

The function takes the following parameters:

  • fieldname: name of the field to get.

The function returns the following values:

  • value (optional) corresponding to the field with the given name.

type StructureChangeType

type StructureChangeType C.gint

StructureChangeType: type of a GST_MESSAGE_STRUCTURE_CHANGE.

const (
	// StructureChangeTypePadLink: pad linking is starting or done.
	StructureChangeTypePadLink StructureChangeType = iota
	// StructureChangeTypePadUnlink: pad unlinking is starting or done.
	StructureChangeTypePadUnlink
)

func (StructureChangeType) String

func (s StructureChangeType) String() string

String returns the name in string for StructureChangeType.

type StructureFilterMapFunc

type StructureFilterMapFunc func(fieldId glib.Quark, value *coreglib.Value) (ok bool)

StructureFilterMapFunc: 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 StructureForEachFunc

type StructureForEachFunc func(fieldId glib.Quark, value *coreglib.Value) (ok bool)

StructureForEachFunc: function that will be called in gst_structure_foreach(). The function may not modify value.

type StructureMapFunc

type StructureMapFunc func(fieldId glib.Quark, value *coreglib.Value) (ok bool)

StructureMapFunc: function that will be called in gst_structure_map_in_place(). The function may modify value.

type SystemClock

type SystemClock struct {
	Clock
	// contains filtered or unexported fields
}

SystemClock: 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 SystemClockClass

type SystemClockClass struct {
	// contains filtered or unexported fields
}

SystemClockClass: instance of this type is always passed by reference.

func (*SystemClockClass) ParentClass

func (s *SystemClockClass) ParentClass() *ClockClass

type SystemClockOverrides

type SystemClockOverrides struct {
}

SystemClockOverrides contains methods that are overridable.

type TagSetter

type TagSetter struct {
	Element
	// contains filtered or unexported fields
}

TagSetter: 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 TagMergeMode 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 TagSetter 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:

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->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);.

TagSetter wraps an interface. This means the user can get the underlying type by calling Cast().

func (*TagSetter) ResetTags

func (setter *TagSetter) ResetTags()

ResetTags: reset the internal taglist. Elements should call this from within the state-change handler.

type TagSetterInterface

type TagSetterInterface struct {
	// contains filtered or unexported fields
}

TagSetterInterface interface.

An instance of this type is always passed by reference.

type TagSetterOverrider

type TagSetterOverrider interface {
}

TagSetterOverrider contains methods that are overridable.

type TagSetterer

type TagSetterer interface {
	coreglib.Objector

	// ResetTags: reset the internal taglist.
	ResetTags()
}

TagSetterer describes TagSetter's interface methods.

type Task

type Task struct {
	GstObject
	// contains filtered or unexported fields
}

Task is used by Element and Pad to provide the data passing threads in a Pipeline.

A Pad will typically start a Task to push or pull data to/from the peer pads. Most source elements start a Task to push data. In some cases a demuxer element can start a Task 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 Pad to start/pause/stop tasks, it might sometimes be needed to create a Task manually if it is not related to a Pad.

Before the Task can be run, it needs a Mutex 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 Task will repeatedly call the TaskFunction 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 Task, 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 Message to send out-of-band data to the application. The application can receive messages from the Bus 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.

func NewTask

func NewTask(fn TaskFunction) *Task

NewTask: 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 Task 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 Mutex must be configured using the gst_task_set_lock() function. This lock will always be acquired while func is called.

The function takes the following parameters:

  • fn to use.

The function returns the following values:

  • task: new Task.

    MT safe.

func (*Task) Join

func (task *Task) Join() bool

Join 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.

The function returns the following values:

  • ok: TRUE if the task could be joined.

    MT safe.

func (*Task) Pause

func (task *Task) Pause() bool

Pause 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.

The function returns the following values:

  • ok: TRUE if the task could be paused.

    MT safe.

func (*Task) Pool

func (task *Task) Pool() *TaskPool

Pool: get the TaskPool that this task will use for its streaming threads.

MT safe.

The function returns the following values:

  • taskPool used by task. gst_object_unref() after usage.

func (*Task) Resume

func (task *Task) Resume() 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.

The function returns the following values:

  • ok: TRUE if the task could be resumed.

    MT safe.

func (*Task) SetPool

func (task *Task) SetPool(pool *TaskPool)

SetPool: set pool as the new GstTaskPool for task. Any new streaming threads that will be created by task will now use pool.

MT safe.

The function takes the following parameters:

  • pool: TaskPool.

func (*Task) SetState

func (task *Task) SetState(state TaskState) bool

SetState 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.

The function takes the following parameters:

  • state: new task state.

The function returns the following values:

  • ok: TRUE if the state could be changed.

func (*Task) Start

func (task *Task) Start() bool

Start starts task. The task must have a lock associated with it using gst_task_set_lock() or this function will return FALSE.

The function returns the following values:

  • ok: TRUE if the task could be started.

    MT safe.

func (*Task) State

func (task *Task) State() TaskState

State: get the current state of the task.

The function returns the following values:

  • taskState of the task

    MT safe.

func (*Task) Stop

func (task *Task) Stop() bool

Stop 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.

The function returns the following values:

  • ok: TRUE if the task could be stopped.

    MT safe.

type TaskClass

type TaskClass struct {
	// contains filtered or unexported fields
}

TaskClass: instance of this type is always passed by reference.

func (*TaskClass) ParentClass

func (t *TaskClass) ParentClass() *ObjectClass

type TaskFunction

type TaskFunction func()

TaskFunction: function that will repeatedly be called in the thread created by a Task.

type TaskOverrides

type TaskOverrides struct {
}

TaskOverrides contains methods that are overridable.

type TaskPool

type TaskPool struct {
	GstObject
	// contains filtered or unexported fields
}

TaskPool: 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.

func NewTaskPool

func NewTaskPool() *TaskPool

NewTaskPool: create a new default task pool. The default task pool will use a regular GThreadPool for threads.

The function returns the following values:

  • taskPool: new TaskPool. gst_object_unref() after usage.

func (*TaskPool) Cleanup

func (pool *TaskPool) Cleanup()

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 (*TaskPool) DisposeHandle

func (pool *TaskPool) DisposeHandle(id unsafe.Pointer)

DisposeHandle: dispose of the handle returned by gst_task_pool_push(). This does not need to be called with the default implementation as the default TaskPoolClass::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.

The function takes the following parameters:

  • id (optional): id.

func (*TaskPool) Join

func (pool *TaskPool) Join(id unsafe.Pointer)

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 TaskPoolClass::push implementation always returns NULL.

This method should only be called with the same pool instance that provided id.

The function takes the following parameters:

  • id (optional): id.

func (*TaskPool) Prepare

func (pool *TaskPool) Prepare() error

Prepare the taskpool for accepting gst_task_pool_push() operations.

MT safe.

func (*TaskPool) Push

func (pool *TaskPool) Push(fn TaskPoolFunction) (unsafe.Pointer, error)

Push: start the execution of a new thread from pool.

The function takes the following parameters:

  • fn: function to call.

The function returns the following values:

  • gpointer (optional): pointer that should be used for the gst_task_pool_join function. This pointer can be NULL, you must check error to detect errors. If the pointer is not NULL and gst_task_pool_join() is not used, call gst_task_pool_dispose_handle() instead.

type TaskPoolClass

type TaskPoolClass struct {
	// contains filtered or unexported fields
}

TaskPoolClass object.

An instance of this type is always passed by reference.

func (*TaskPoolClass) ParentClass

func (t *TaskPoolClass) ParentClass() *ObjectClass

ParentClass: parent class structure.

type TaskPoolFunction

type TaskPoolFunction func()

TaskPoolFunction: task function, see gst_task_pool_push().

type TaskPoolOverrides

type TaskPoolOverrides struct {
	// 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 func()
	// DisposeHandle: dispose of the handle returned by gst_task_pool_push().
	// This does not need to be called with the default implementation as the
	// default TaskPoolClass::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.
	//
	// The function takes the following parameters:
	//
	//    - id (optional): id.
	//
	DisposeHandle func(id unsafe.Pointer)
	// 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 TaskPoolClass::push implementation always returns NULL.
	//
	// This method should only be called with the same pool instance that
	// provided id.
	//
	// The function takes the following parameters:
	//
	//    - id (optional): id.
	//
	Join func(id unsafe.Pointer)
	// Prepare the taskpool for accepting gst_task_pool_push() operations.
	//
	// MT safe.
	Prepare func() error
}

TaskPoolOverrides contains methods that are overridable.

type TaskState

type TaskState C.gint

TaskState: different states a task can be in.

const (
	// TaskStarted: task is started and running.
	TaskStarted TaskState = iota
	// TaskStopped: task is stopped.
	TaskStopped
	// TaskPaused: task is paused.
	TaskPaused
)

func (TaskState) String

func (t TaskState) String() string

String returns the name in string for TaskState.

type TimedValue

type TimedValue struct {
	// contains filtered or unexported fields
}

TimedValue: structure for storing a timestamp and a value.

An instance of this type is always passed by reference.

func (*TimedValue) SetValue

func (t *TimedValue) SetValue(value float64)

Value: corresponding value.

func (*TimedValue) Timestamp

func (t *TimedValue) Timestamp() ClockTime

Timestamp: timestamp of the value change.

func (*TimedValue) Value

func (t *TimedValue) Value() float64

Value: corresponding value.

type Toc

type Toc struct {
	// contains filtered or unexported fields
}

Toc functions are used to create/free Toc and TocEntry structures. Also they are used to convert Toc into Structure and vice versa.

Toc 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 Toc structure which represents root contents of the source. You can also attach TOC-specific tags to it. Then fill it with TocEntry entries by appending them to the Toc using gst_toc_append_entry(), and appending subentries to a TocEntry 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 Event, and gst_event_parse_toc() to parse received TOC event. Use gst_event_new_toc_select() to create a new TOC select Event, and gst_event_parse_toc_select() to parse received TOC select event. The same rule for the Message: gst_message_new_toc() to create new TOC Message, 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).

An instance of this type is always passed by reference.

func NewToc

func NewToc(scope TocScope) *Toc

NewToc constructs a struct Toc.

func (*Toc) AppendEntry

func (toc *Toc) AppendEntry(entry *TocEntry)

AppendEntry appends the TocEntry entry to toc.

The function takes the following parameters:

  • entry: TocEntry.

func (*Toc) Dump

func (toc *Toc) Dump()

func (*Toc) Entries

func (toc *Toc) Entries() []*TocEntry

Entries gets the list of TocEntry of toc.

The function returns the following values:

  • list of TocEntry for entry.

func (*Toc) FindEntry

func (toc *Toc) FindEntry(uid string) *TocEntry

FindEntry: find TocEntry with given uid in the toc.

The function takes the following parameters:

  • uid: UID to find TocEntry with.

The function returns the following values:

  • tocEntry (optional) with specified uid from the toc, or NULL if not found.

func (*Toc) Scope

func (toc *Toc) Scope() TocScope

The function returns the following values:

  • tocScope: scope of toc.

type TocEntry

type TocEntry struct {
	// contains filtered or unexported fields
}

TocEntry: instance of this type is always passed by reference.

func NewTocEntry

func NewTocEntry(typ TocEntryType, uid string) *TocEntry

NewTocEntry constructs a struct TocEntry.

func (*TocEntry) AppendSubEntry

func (entry *TocEntry) AppendSubEntry(subentry *TocEntry)

AppendSubEntry appends the TocEntry subentry to entry.

The function takes the following parameters:

  • subentry: TocEntry.

func (*TocEntry) EntryType

func (entry *TocEntry) EntryType() TocEntryType

The function returns the following values:

  • tocEntryType entry's entry type.

func (*TocEntry) IsAlternative

func (entry *TocEntry) IsAlternative() bool

The function returns the following values:

  • ok: TRUE if entry's type is an alternative type, otherwise FALSE.

func (*TocEntry) IsSequence

func (entry *TocEntry) IsSequence() bool

The function returns the following values:

  • ok: TRUE if entry's type is a sequence type, otherwise FALSE.

func (*TocEntry) Loop

func (entry *TocEntry) Loop() (TocLoopType, int, bool)

Loop: 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.

The function returns the following values:

  • loopType (optional): storage for the loop_type value, leave NULL if not need.
  • repeatCount (optional): storage for the repeat_count value, leave NULL if not need.
  • ok: TRUE if all non-NULL storage pointers were filled with appropriate values, FALSE otherwise.

func (*TocEntry) Parent

func (entry *TocEntry) Parent() *TocEntry

Parent gets the parent TocEntry of entry.

The function returns the following values:

  • tocEntry (optional): parent TocEntry of entry.

func (*TocEntry) SetLoop

func (entry *TocEntry) SetLoop(loopType TocLoopType, repeatCount int)

SetLoop: set loop_type and repeat_count values for the entry.

The function takes the following parameters:

  • loopType: loop_type value to set.
  • repeatCount: repeat_count value to set.

func (*TocEntry) SetStartStopTimes

func (entry *TocEntry) SetStartStopTimes(start int64, stop int64)

SetStartStopTimes: set start and stop values for the entry.

The function takes the following parameters:

  • start value to set.
  • stop value to set.

func (*TocEntry) StartStopTimes

func (entry *TocEntry) StartStopTimes() (start int64, stop int64, ok bool)

StartStopTimes: get start and stop values from the entry and write them into appropriate storages.

The function returns the following values:

  • start (optional): storage for the start value, leave NULL if not need.
  • stop (optional): storage for the stop value, leave NULL if not need.
  • ok: TRUE if all non-NULL storage pointers were filled with appropriate values, FALSE otherwise.

func (*TocEntry) SubEntries

func (entry *TocEntry) SubEntries() []*TocEntry

SubEntries gets the sub-entries of entry.

The function returns the following values:

  • list of TocEntry of entry.

func (*TocEntry) Toc

func (entry *TocEntry) Toc() *Toc

Toc gets the parent Toc of entry.

The function returns the following values:

  • toc: parent Toc of entry.

func (*TocEntry) Uid

func (entry *TocEntry) Uid() string

Uid gets the UID of entry.

The function returns the following values:

  • utf8: UID of entry.

type TocEntryType

type TocEntryType C.gint

TocEntryType: different types of TOC entries (see TocEntry).

There are two types of TOC entries: alternatives or parts in a sequence.

const (
	// TocEntryTypeAngle: entry is an angle (i.e. an alternative).
	TocEntryTypeAngle TocEntryType = -3
	// TocEntryTypeVersion: entry is a version (i.e. alternative).
	TocEntryTypeVersion TocEntryType = -2
	// TocEntryTypeEdition: entry is an edition (i.e. alternative).
	TocEntryTypeEdition TocEntryType = -1
	// TocEntryTypeInvalid: invalid entry type value.
	TocEntryTypeInvalid TocEntryType = 0
	// TocEntryTypeTitle: entry is a title (i.e. a part of a sequence).
	TocEntryTypeTitle TocEntryType = 1
	// TocEntryTypeTrack: entry is a track (i.e. a part of a sequence).
	TocEntryTypeTrack TocEntryType = 2
	// TocEntryTypeChapter: entry is a chapter (i.e. a part of a sequence).
	TocEntryTypeChapter TocEntryType = 3
)

func (TocEntryType) String

func (t TocEntryType) String() string

String returns the name in string for TocEntryType.

type TocLoopType

type TocLoopType C.gint

TocLoopType: how a TocEntry should be repeated. By default, entries are played a single time.

const (
	// TocLoopNone: single forward playback.
	TocLoopNone TocLoopType = iota
	// TocLoopForward: repeat forward.
	TocLoopForward
	// TocLoopReverse: repeat backward.
	TocLoopReverse
	// TocLoopPingPong: repeat forward and backward.
	TocLoopPingPong
)

func (TocLoopType) String

func (t TocLoopType) String() string

String returns the name in string for TocLoopType.

type TocScope

type TocScope C.gint

TocScope: scope of a TOC.

const (
	// TocScopeGlobal: global TOC representing all selectable options (this is
	// what applications are usually interested in).
	TocScopeGlobal TocScope = 1
	// TocScopeCurrent: 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 (TocScope) String

func (t TocScope) String() string

String returns the name in string for TocScope.

type TocSetter

type TocSetter struct {
	Element
	// contains filtered or unexported fields
}

TocSetter: 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 TocSetter 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.

TocSetter wraps an interface. This means the user can get the underlying type by calling Cast().

func (*TocSetter) Reset

func (setter *TocSetter) Reset()

Reset the internal TOC. Elements should call this from within the state-change handler.

func (*TocSetter) SetToc

func (setter *TocSetter) SetToc(toc *Toc)

SetToc: set the given TOC on the setter. Previously set TOC will be unreffed before setting a new one.

The function takes the following parameters:

  • toc (optional) to set.

func (*TocSetter) Toc

func (setter *TocSetter) Toc() *Toc

Toc: return current TOC the setter uses. The TOC should not be modified without making it writable first.

The function returns the following values:

  • toc (optional): TOC set, or NULL. Unref with gst_toc_unref() when no longer needed.

type TocSetterInterface

type TocSetterInterface struct {
	// contains filtered or unexported fields
}

TocSetterInterface interface.

An instance of this type is always passed by reference.

type TocSetterOverrider

type TocSetterOverrider interface {
}

TocSetterOverrider contains methods that are overridable.

type TocSetterer

type TocSetterer interface {
	coreglib.Objector

	// Toc: return current TOC the setter uses.
	Toc() *Toc
	// Reset the internal TOC.
	Reset()
	// SetToc: set the given TOC on the setter.
	SetToc(toc *Toc)
}

TocSetterer describes TocSetter's interface methods.

type Tracer

type Tracer struct {
	GstObject
	// contains filtered or unexported fields
}

Tracer: tracing modules will subclass Tracer 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.

func BaseTracer

func BaseTracer(obj Tracerer) *Tracer

BaseTracer returns the underlying base object.

type TracerClass

type TracerClass struct {
	// contains filtered or unexported fields
}

TracerClass: instance of this type is always passed by reference.

func (*TracerClass) ParentClass

func (t *TracerClass) ParentClass() *ObjectClass

type TracerFactory

type TracerFactory struct {
	PluginFeature
	// contains filtered or unexported fields
}

TracerFactory: use gst_tracer_factory_get_list() to get a list of tracer factories known to GStreamer.

func TracerFactoryGetList

func TracerFactoryGetList() []*TracerFactory

TracerFactoryGetList gets the list of all registered tracer factories. You must free the list using gst_plugin_feature_list_free().

The returned factories are sorted by factory name.

Free-function: gst_plugin_feature_list_free.

The function returns the following values:

  • list of all registered TracerFactory.

func (*TracerFactory) TracerType

func (factory *TracerFactory) TracerType() coreglib.Type

TracerType: 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().

The function returns the following values:

  • gType for tracers managed by this factory or 0 if the factory is not loaded.

type TracerOverrides

type TracerOverrides struct {
}

TracerOverrides contains methods that are overridable.

type TracerRecord

type TracerRecord struct {
	GstObject
	// contains filtered or unexported fields
}

TracerRecord: tracing modules will create instances of this class to announce the data they will log and create a log formatter.

type TracerValueFlags

type TracerValueFlags C.guint

TracerValueFlags: flag that describe the value. These flags help applications processing the logs to understand the values.

const (
	// TracerValueFlagsNone: no flags.
	TracerValueFlagsNone TracerValueFlags = 0b0
	// TracerValueFlagsOptional: 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 = 0b1
	// TracerValueFlagsAggregated: value is a combined figure, since the start
	// of tracing. Examples are averages or timestamps.
	TracerValueFlagsAggregated TracerValueFlags = 0b10
)

func (TracerValueFlags) Has

func (t TracerValueFlags) Has(other TracerValueFlags) bool

Has returns true if t contains other.

func (TracerValueFlags) String

func (t TracerValueFlags) String() string

String returns the names in string for TracerValueFlags.

type TracerValueScope

type TracerValueScope C.gint

TracerValueScope: 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 Pads.

const (
	// TracerValueScopeProcess: value is related to the process.
	TracerValueScopeProcess TracerValueScope = iota
	// TracerValueScopeThread: value is related to a thread.
	TracerValueScopeThread
	// TracerValueScopeElement: value is related to an Element.
	TracerValueScopeElement
	// TracerValueScopePad: value is related to a Pad.
	TracerValueScopePad
)

func (TracerValueScope) String

func (t TracerValueScope) String() string

String returns the name in string for TracerValueScope.

type Tracerer

type Tracerer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Tracerer describes types inherited from class Tracer.

To get the original type, the caller must assert this to an interface or another type.

func TracingGetActiveTracers

func TracingGetActiveTracers() []Tracerer

TracingGetActiveTracers: get a list of all active tracer objects owned by the tracing framework for the entirety of the run-time of the process or till gst_deinit() is called.

The function returns the following values:

  • list of Tracer objects.

type TypeFind

type TypeFind struct {
	// contains filtered or unexported fields
}

TypeFind: following functions allow you to detect the media type of an unknown stream.

An instance of this type is always passed by reference.

func (*TypeFind) Data

func (t *TypeFind) Data() unsafe.Pointer

Data: data used by the caller of the typefinding function.

func (*TypeFind) Length

func (find *TypeFind) Length() uint64

Length: get the length of the data stream.

The function returns the following values:

  • guint64: length of the data stream, or 0 if it is not available.

func (*TypeFind) Suggest

func (find *TypeFind) Suggest(probability uint, caps *Caps)

Suggest: if a TypeFindFunction calls this function it suggests the caps with the given probability. A TypeFindFunction may supply different suggestions in one call. It is up to the caller of the TypeFindFunction to interpret these values.

The function takes the following parameters:

  • probability in percent that the suggestion is right.
  • caps: fixed Caps to suggest.

func (*TypeFind) SuggestEmptySimple

func (find *TypeFind) SuggestEmptySimple(probability uint, mediaType string)

SuggestEmptySimple: if a TypeFindFunction 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 Caps with no fields.

The function takes the following parameters:

  • probability in percent that the suggestion is right.
  • mediaType: media type of the suggested caps.

type TypeFindFactory

type TypeFindFactory struct {
	PluginFeature
	// contains filtered or unexported fields
}

TypeFindFactory: these functions allow querying information about registered typefind functions. How to create and register these functions is described in the section <link linkend="gstreamer-Writing-typefind-functions"> "Writing typefind functions"</link>.

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.

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 >= 0 && offset + size <= find->size) {
    return find->data + offset;
  }
  return NULL;
}
static void
my_suggest (gpointer data, guint probability, GstCaps *caps)
{
  MyTypeFind *find = (MyTypeFind *) data;
  if (probability > find->probability) {
    find->probability = probability;
    gst_caps_replace (&find->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, &find, };
  walk = type_list = gst_type_find_factory_get_list ();
  while (walk) {
    GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (walk->data);
    walk = g_list_next (walk)
    gst_type_find_factory_call_function (factory, &gst_find);
  }
  g_list_free (type_list);
  return find.caps;
};.

func TypeFindFactoryGetList

func TypeFindFactoryGetList() []*TypeFindFactory

TypeFindFactoryGetList gets the list of all registered typefind factories. You must free the list using gst_plugin_feature_list_free().

The returned factories are sorted by highest rank first, and then by factory name.

Free-function: gst_plugin_feature_list_free.

The function returns the following values:

  • list of all registered TypeFindFactory.

func (*TypeFindFactory) CallFunction

func (factory *TypeFindFactory) CallFunction(find *TypeFind)

CallFunction calls the TypeFindFunction associated with this factory.

The function takes the following parameters:

  • find: properly setup TypeFind entry. The get_data and suggest_type members must be set.

func (*TypeFindFactory) Caps

func (factory *TypeFindFactory) Caps() *Caps

Caps gets the Caps associated with a typefind factory.

The function returns the following values:

  • caps (optional) associated with this factory.

func (*TypeFindFactory) Extensions

func (factory *TypeFindFactory) Extensions() []string

Extensions gets the extensions associated with a TypeFindFactory. 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.

The function returns the following values:

  • utf8s (optional): a NULL-terminated array of extensions associated with this factory.

func (*TypeFindFactory) HasFunction

func (factory *TypeFindFactory) HasFunction() bool

HasFunction: 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.

The function returns the following values:

  • ok: TRUE if the factory has a typefind functions set, otherwise FALSE.

type TypeFindFunction

type TypeFindFunction func(find *TypeFind)

TypeFindFunction: function that will be called by typefinding.

type TypeFindProbability

type TypeFindProbability C.gint

TypeFindProbability: probability of the typefind function. Higher values have more certainty in doing a reliable typefind.

const (
	// TypeFindNone: type undetected.
	TypeFindNone TypeFindProbability = 0
	// TypeFindMinimum: unlikely typefind.
	TypeFindMinimum TypeFindProbability = 1
	// TypeFindPossible: possible type detected.
	TypeFindPossible TypeFindProbability = 50
	// TypeFindLikely: likely a type was detected.
	TypeFindLikely TypeFindProbability = 80
	// TypeFindNearlyCertain: nearly certain that a type was detected.
	TypeFindNearlyCertain TypeFindProbability = 99
	// TypeFindMaximum: very certain a type was detected.
	TypeFindMaximum TypeFindProbability = 100
)

func (TypeFindProbability) String

func (t TypeFindProbability) String() string

String returns the name in string for TypeFindProbability.

type URI

type URI struct {
	// contains filtered or unexported fields
}

URI object can be used to parse and split a URI string into its constituent parts. Two Uri objects can be joined to make a new Uri using the algorithm described in RFC3986.

An instance of this type is always passed by reference.

func NewURI

func NewURI(scheme string, userinfo string, host string, port uint, path string, query string, fragment string) *URI

NewURI constructs a struct URI.

func URIFromString

func URIFromString(uri string) *URI

URIFromString parses a URI string into a new Uri object. Will return NULL if the URI cannot be parsed.

The function takes the following parameters:

  • uri: URI string to parse.

The function returns the following values:

  • ret (optional): new Uri object, or NULL.

func URIFromStringEscaped

func URIFromStringEscaped(uri string) *URI

URIFromStringEscaped parses a URI string into a new Uri object. Will return NULL if the URI cannot be parsed. This is identical to gst_uri_from_string() except that the userinfo and fragment components of the URI will not be unescaped while parsing.

Use this when you need to extract a username and password from the userinfo such as https://user:passwordexample.com since either may contain a URI-escaped ':' character. gst_uri_from_string() will unescape the entire userinfo component, which will make it impossible to know which ':' delineates the username and password.

The same applies to the fragment component of the URI, such as https://example.com/path#fragment which may contain a URI-escaped '#'.

The function takes the following parameters:

  • uri: URI string to parse.

The function returns the following values:

  • ret (optional): new Uri object, or NULL.

func (*URI) AppendPath

func (uri *URI) AppendPath(relativePath string) bool

AppendPath: 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.

The function takes the following parameters:

  • relativePath: relative path to append to the end of the current path.

The function returns the following values:

  • ok: TRUE if the path was appended successfully.

func (*URI) AppendPathSegment

func (uri *URI) AppendPathSegment(pathSegment string) bool

AppendPathSegment: append a single path segment onto the end of the URI path.

The function takes the following parameters:

  • pathSegment: path segment string to append to the URI path.

The function returns the following values:

  • ok: TRUE if the path was appended successfully.

func (*URI) Equal

func (first *URI) Equal(second *URI) bool

Equal compares two Uri objects to see if they represent the same normalized URI.

The function takes the following parameters:

  • second: second Uri to compare.

The function returns the following values:

  • ok: TRUE if the normalized versions of the two URI's would be equal.

func (*URI) Fragment

func (uri *URI) Fragment() string

Fragment: get the fragment name from the URI or NULL if it doesn't exist. If uri is NULL then returns NULL.

The function returns the following values:

  • utf8 (optional): host name from the Uri object or NULL.

func (*URI) FromStringWithBase

func (base *URI) FromStringWithBase(uri string) *URI

FromStringWithBase: like gst_uri_from_string() but also joins with a base URI.

The function takes the following parameters:

  • uri: URI string to parse.

The function returns the following values:

  • ret: new Uri object.

func (*URI) Host

func (uri *URI) Host() string

Host: get the host name from the URI or NULL if it doesn't exist. If uri is NULL then returns NULL.

The function returns the following values:

  • utf8 (optional): host name from the Uri object or NULL.

func (*URI) IsNormalized

func (uri *URI) IsNormalized() bool

IsNormalized tests the uri to see if it is normalized. A NULL uri is considered to be normalized.

The function returns the following values:

  • ok: TRUE if the URI is normalized or is NULL.

func (*URI) IsWritable

func (uri *URI) IsWritable() bool

IsWritable: check if it is safe to write to this Uri.

Check if the refcount of uri is exactly 1, meaning that no other reference exists to the Uri and that the Uri is therefore writable.

Modification of a Uri should only be done after verifying that it is writable.

The function returns the following values:

  • ok: TRUE if it is safe to write to the object.

func (*URI) Join

func (baseUri *URI) Join(refUri *URI) *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.

The function takes the following parameters:

  • refUri (optional): reference URI to join onto the base URI.

The function returns the following values:

  • uri (optional) which represents the base with the reference URI joined on.

func (*URI) MakeWritable

func (uri *URI) MakeWritable() *URI

MakeWritable: make the Uri 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 Uri. If uri is NULL then NULL is returned.

The function returns the following values:

  • ret: writable version of uri.

func (*URI) MediaFragmentTable

func (uri *URI) MediaFragmentTable() map[string]string

MediaFragmentTable: get the media fragment table from the URI, as defined by "Media Fragments URI 1.0". Hash table returned by this API is a list of "key-value" pairs, and the each pair is generated by splitting "URI fragment" per "&" sub-delims, then "key" and "value" are split by "=" sub-delims. The "key" returned by this API may be undefined keyword by standard. A value may be NULL to indicate that the key should appear in the fragment string in the URI, but does not have a value. Free the returned Table with #g_hash_table_unref() when it is no longer required. Modifying this hash table does not affect the fragment in the URI.

See more about Media Fragments URI 1.0 (W3C) at https://www.w3.org/TR/media-frags/.

The function returns the following values:

  • hashTable (optional): the fragment hash table from the URI.

func (*URI) NewWithBase

func (base *URI) NewWithBase(scheme string, userinfo string, host string, port uint, path string, query string, fragment string) *URI

NewWithBase: like gst_uri_new(), but joins the new URI onto a base URI.

The function takes the following parameters:

  • scheme (optional) for the new URI.
  • userinfo (optional): user-info for the new URI.
  • host (optional) name for the new URI.
  • port number for the new URI or GST_URI_NO_PORT.
  • path (optional) for the new URI with '/' separating path elements.
  • query (optional) string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "&percnt;26".
  • fragment (optional) name for the new URI.

The function returns the following values:

  • uri: new URI joined onto base.

func (*URI) Normalize

func (uri *URI) Normalize() bool

Normalize: 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 Uri object must be writable. Check with gst_uri_is_writable() or use gst_uri_make_writable() first.

The function returns the following values:

  • ok: TRUE if the URI was modified.

func (*URI) Path

func (uri *URI) Path() string

Path: extract the path string from the URI object.

The function returns the following values:

  • utf8 (optional): path from the URI. Once finished with the string should be g_free()'d.

func (*URI) PathSegments

func (uri *URI) PathSegments() []string

PathSegments: get a list of path segments from the URI.

The function returns the following values:

  • list of path segment strings or NULL if no path segments are available. Free the list when no longer needed with g_list_free_full(list, g_free).

func (*URI) PathString

func (uri *URI) PathString() string

PathString: extract the path string from the URI object as a percent encoded URI path.

The function returns the following values:

  • utf8 (optional): path from the URI. Once finished with the string should be g_free()'d.

func (*URI) Port

func (uri *URI) Port() uint

Port: 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.

The function returns the following values:

  • guint: port number from the Uri object or GST_URI_NO_PORT.

func (*URI) QueryHasKey

func (uri *URI) QueryHasKey(queryKey string) bool

QueryHasKey: check if there is a query table entry for the query_key key.

The function takes the following parameters:

  • queryKey: key to lookup.

The function returns the following values:

  • ok: TRUE if query_key exists in the URI query table.

func (*URI) QueryKeys

func (uri *URI) QueryKeys() []string

QueryKeys: get a list of the query keys from the URI.

The function returns the following values:

  • list of keys from the URI query. Free the list with g_list_free().

func (*URI) QueryString

func (uri *URI) QueryString() string

QueryString: get a percent encoded URI query string from the uri.

The function returns the following values:

  • utf8 (optional): percent encoded query string. Use g_free() when no longer needed.

func (*URI) QueryTable

func (uri *URI) QueryTable() map[string]string

QueryTable: get the query table from the URI. Keys and values in the table are freed with g_free when they are deleted. A value may be NULL to indicate that the key should appear in the query string in the URI, but does not have a value. Free the returned Table with #g_hash_table_unref() when it is no longer required. Modifying this hash table will modify the query in the URI.

The function returns the following values:

  • hashTable (optional): query hash table from the URI.

func (*URI) QueryValue

func (uri *URI) QueryValue(queryKey string) string

QueryValue: 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.

The function takes the following parameters:

  • queryKey: key to lookup.

The function returns the following values:

  • utf8 (optional): value for the given key, or NULL if not found.

func (*URI) RemoveQueryKey

func (uri *URI) RemoveQueryKey(queryKey string) bool

RemoveQueryKey: remove an entry from the query table by key.

The function takes the following parameters:

  • queryKey: key to remove.

The function returns the following values:

  • ok: TRUE if the key existed in the table and was removed.

func (*URI) Scheme

func (uri *URI) Scheme() string

Scheme: get the scheme name from the URI or NULL if it doesn't exist. If uri is NULL then returns NULL.

The function returns the following values:

  • utf8 (optional): scheme from the Uri object or NULL.

func (*URI) SetFragment

func (uri *URI) SetFragment(fragment string) bool

SetFragment sets the fragment string in the URI. Use a value of NULL in fragment to unset the fragment string.

The function takes the following parameters:

  • fragment (optional) string to set.

The function returns the following values:

  • ok: TRUE if the fragment was set/unset successfully.

func (*URI) SetHost

func (uri *URI) SetHost(host string) bool

SetHost: set or unset the host for the URI.

The function takes the following parameters:

  • host: new host string to set or NULL to unset.

The function returns the following values:

  • ok: TRUE if the host was set/unset successfully.

func (*URI) SetPath

func (uri *URI) SetPath(path string) bool

SetPath sets or unsets the path in the URI.

The function takes the following parameters:

  • path: new path to set with path segments separated by '/', or use NULL to unset the path.

The function returns the following values:

  • ok: TRUE if the path was set successfully.

func (*URI) SetPathSegments

func (uri *URI) SetPathSegments(pathSegments []string) bool

SetPathSegments: replace the path segments list in the URI.

The function takes the following parameters:

  • pathSegments (optional): new path list to set.

The function returns the following values:

  • ok: TRUE if the path segments were set successfully.

func (*URI) SetPathString

func (uri *URI) SetPathString(path string) bool

SetPathString sets or unsets the path in the URI.

The function takes the following parameters:

  • path: new percent encoded path to set with path segments separated by '/', or use NULL to unset the path.

The function returns the following values:

  • ok: TRUE if the path was set successfully.

func (*URI) SetPort

func (uri *URI) SetPort(port uint) bool

SetPort: set or unset the port number for the URI.

The function takes the following parameters:

  • port: new port number to set or GST_URI_NO_PORT to unset.

The function returns the following values:

  • ok: TRUE if the port number was set/unset successfully.

func (*URI) SetQueryString

func (uri *URI) SetQueryString(query string) bool

SetQueryString sets or unsets the query table in the URI.

The function takes the following parameters:

  • query: 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:

  • ok: TRUE if the query table was set successfully.

func (*URI) SetQueryTable

func (uri *URI) SetQueryTable(queryTable map[string]string) bool

SetQueryTable: set the query table to use in the URI. The old table is unreferenced and a reference to the new one is used instead. A value if NULL for query_table will remove the query string from the URI.

The function takes the following parameters:

  • queryTable (optional): new query table to use.

The function returns the following values:

  • ok: TRUE if the new table was successfully used for the query table.

func (*URI) SetQueryValue

func (uri *URI) SetQueryValue(queryKey string, queryValue string) bool

SetQueryValue: 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.

The function takes the following parameters:

  • queryKey: key for the query entry.
  • queryValue (optional): value for the key.

The function returns the following values:

  • ok: TRUE if the query table was successfully updated.

func (*URI) SetScheme

func (uri *URI) SetScheme(scheme string) bool

SetScheme: set or unset the scheme for the URI.

The function takes the following parameters:

  • scheme: new scheme to set or NULL to unset the scheme.

The function returns the following values:

  • ok: TRUE if the scheme was set/unset successfully.

func (*URI) SetUserinfo

func (uri *URI) SetUserinfo(userinfo string) bool

SetUserinfo: set or unset the user information for the URI.

The function takes the following parameters:

  • userinfo: new user-information string to set or NULL to unset.

The function returns the following values:

  • ok: TRUE if the user information was set/unset successfully.

func (*URI) String

func (uri *URI) String() string

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.

The function returns the following values:

  • utf8: string version of the URI.

func (*URI) Userinfo

func (uri *URI) Userinfo() string

Userinfo: 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.

The function returns the following values:

  • utf8 (optional): userinfo from the Uri object or NULL.

type URIError

type URIError C.gint

URIError: different URI-related errors that can occur.

const (
	// URIErrorUnsupportedProtocol: protocol is not supported.
	URIErrorUnsupportedProtocol URIError = iota
	// URIErrorBadURI: there was a problem with the URI.
	URIErrorBadURI
	// URIErrorBadState: could not set or change the URI because the URI handler
	// was in a state where that is not possible or not permitted.
	URIErrorBadState
	// URIErrorBadReference: there was a problem with the entity that the URI
	// references.
	URIErrorBadReference
)

func (URIError) String

func (u URIError) String() string

String returns the name in string for URIError.

type URIHandler

type URIHandler struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

URIHandler is an interface that is implemented by Source and Sink Element 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.

URIHandler wraps an interface. This means the user can get the underlying type by calling Cast().

func (*URIHandler) Protocols

func (handler *URIHandler) Protocols() []string

Protocols gets the list of protocols supported by handler. This list may not be modified.

The function returns the following values:

  • utf8s (optional): the supported protocols. Returns NULL if the handler isn't implemented properly, or the handler doesn't support any protocols.

func (*URIHandler) SetURI

func (handler *URIHandler) SetURI(uri string) error

SetURI tries to set the URI of the given handler.

The function takes the following parameters:

  • uri: URI to set.

func (*URIHandler) URI

func (handler *URIHandler) URI() string

URI gets the currently handled URI.

The function returns the following values:

  • utf8 (optional): URI currently handled by the handler. Returns NULL if there are no URI currently handled. The returned string must be freed with g_free() when no longer needed.

func (*URIHandler) URIType

func (handler *URIHandler) URIType() URIType

URIType gets the type of the given URI handler.

The function returns the following values:

  • uriType of the URI handler. Returns T_URI_UNKNOWN if the handler isn't implemented correctly.

type URIHandlerInterface

type URIHandlerInterface struct {
	// contains filtered or unexported fields
}

URIHandlerInterface: any Element using this interface should implement these methods.

An instance of this type is always passed by reference.

type URIHandlerer

type URIHandlerer interface {
	coreglib.Objector

	// Protocols gets the list of protocols supported by handler.
	Protocols() []string
	// URI gets the currently handled URI.
	URI() string
	// URIType gets the type of the given URI handler.
	URIType() URIType
	// SetURI tries to set the URI of the given handler.
	SetURI(uri string) error
}

URIHandlerer describes URIHandler's interface methods.

type URIType

type URIType C.gint

URIType: different types of URI direction.

const (
	// URIUnknown: URI direction is unknown.
	URIUnknown URIType = iota
	// URISink: URI is a consumer.
	URISink
	// URISrc: URI is a producer.
	URISrc
)

func (URIType) String

func (u URIType) String() string

String returns the name in string for URIType.

type ValueArray

type ValueArray struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

ValueArray: fundamental type that describes an ordered list of #GValue.

type ValueList

type ValueList struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

ValueList: fundamental type that describes an unordered list of #GValue.

type ValueTable

type ValueTable struct {
	// contains filtered or unexported fields
}

ValueTable: VTable for the #GValue type.

An instance of this type is always passed by reference.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL