///
///
///
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Gst?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace Gst {
/**
* Gst-1.0
*/
/**
* The different types of buffering methods.
*/
/**
* The different types of buffering methods.
*/
export namespace BufferingMode {
export const $gtype: GObject.GType;
}
enum BufferingMode {
/**
* a small amount of data is buffered
*/
STREAM,
/**
* the stream is being downloaded
*/
DOWNLOAD,
/**
* the stream is being downloaded in a ringbuffer
*/
TIMESHIFT,
/**
* the stream is a live stream
*/
LIVE,
}
/**
* The result values for a GstBusSyncHandler.
*/
/**
* The result values for a GstBusSyncHandler.
*/
export namespace BusSyncReply {
export const $gtype: GObject.GType;
}
enum BusSyncReply {
/**
* drop the message
*/
DROP,
/**
* pass the message to the async queue
*/
PASS,
/**
* pass message to async queue, continue if message is handled
*/
ASYNC,
}
/**
* 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.
*/
/**
* 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.
*/
export namespace CapsIntersectMode {
export const $gtype: GObject.GType;
}
enum CapsIntersectMode {
/**
* Zig-zags over both caps.
*/
ZIG_ZAG,
/**
* Keeps the first caps order.
*/
FIRST,
}
/**
* The type of the clock entry
*/
/**
* The type of the clock entry
*/
export namespace ClockEntryType {
export const $gtype: GObject.GType;
}
enum ClockEntryType {
/**
* a single shot timeout
*/
SINGLE,
/**
* a periodic timeout request
*/
PERIODIC,
}
/**
* The return value of a clock operation.
*/
/**
* The return value of a clock operation.
*/
export namespace ClockReturn {
export const $gtype: GObject.GType;
}
enum ClockReturn {
/**
* The operation succeeded.
*/
OK,
/**
* The operation was scheduled too late.
*/
EARLY,
/**
* The clockID was unscheduled
*/
UNSCHEDULED,
/**
* The ClockID is busy
*/
BUSY,
/**
* A bad time was provided to a function.
*/
BADTIME,
/**
* An error occurred
*/
ERROR,
/**
* Operation is not supported
*/
UNSUPPORTED,
/**
* The ClockID is done waiting
*/
DONE,
}
/**
* The different kind of clocks.
*/
/**
* The different kind of clocks.
*/
export namespace ClockType {
export const $gtype: GObject.GType;
}
enum ClockType {
/**
* time since Epoch
*/
REALTIME,
/**
* monotonic time since some unspecified starting
* point
*/
MONOTONIC,
/**
* some other time source is used (Since: 1.0.5)
*/
OTHER,
/**
* time since Epoch, but using International Atomic Time
* as reference (Since: 1.18)
*/
TAI,
}
/**
* Core errors are errors inside the core GStreamer library.
*/
class CoreError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* a general error which doesn't fit in any other
* category. Make sure you add a custom message to the error call.
*/
static FAILED: number;
/**
* do not use this except as a placeholder for
* deciding where to go while developing code.
*/
static TOO_LAZY: number;
/**
* use this when you do not want to implement
* this functionality yet.
*/
static NOT_IMPLEMENTED: number;
/**
* used for state change errors.
*/
static STATE_CHANGE: number;
/**
* used for pad-related errors.
*/
static PAD: number;
/**
* used for thread-related errors.
*/
static THREAD: number;
/**
* used for negotiation-related errors.
*/
static NEGOTIATION: number;
/**
* used for event-related errors.
*/
static EVENT: number;
/**
* used for seek-related errors.
*/
static SEEK: number;
/**
* used for caps-related errors.
*/
static CAPS: number;
/**
* used for negotiation-related errors.
*/
static TAG: number;
/**
* used if a plugin is missing.
*/
static MISSING_PLUGIN: number;
/**
* used for clock related errors.
*/
static CLOCK: number;
/**
* used if functionality has been disabled at
* compile time.
*/
static DISABLED: number;
/**
* the number of core error types.
*/
static NUM_ERRORS: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
export namespace DebugColorMode {
export const $gtype: GObject.GType;
}
enum DebugColorMode {
/**
* Do not use colors in logs.
*/
OFF,
/**
* Paint logs in a platform-specific way.
*/
ON,
/**
* Paint logs with UNIX terminal color codes
* no matter what platform GStreamer is running on.
*/
UNIX,
}
/**
* The level defines the importance of a debugging message. The more important a
* message is, the greater the probability that the debugging system outputs it.
*/
/**
* The level defines the importance of a debugging message. The more important a
* message is, the greater the probability that the debugging system outputs it.
*/
export namespace DebugLevel {
export const $gtype: GObject.GType;
}
enum DebugLevel {
/**
* No debugging level specified or desired. Used to deactivate
* debugging output.
*/
NONE,
/**
* 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.
*/
ERROR,
/**
* 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.")
*/
WARNING,
/**
* 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.
*/
FIXME,
/**
* 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.")
*/
INFO,
/**
* 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.
*/
DEBUG,
/**
* 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.
*/
LOG,
/**
* Tracing-related messages.
* Examples for this are referencing/dereferencing of objects.
*/
TRACE,
/**
* 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.
*/
MEMDUMP,
/**
* The number of defined debugging levels.
*/
COUNT,
}
/**
* #GstEventType lists the standard event types that can be sent in a pipeline.
*
* The custom event types can be used for private messages between elements
* that can't be expressed using normal
* GStreamer buffer passing semantics. Custom events carry an arbitrary
* #GstStructure.
* Specific custom events are distinguished by the name of the structure.
*/
/**
* #GstEventType lists the standard event types that can be sent in a pipeline.
*
* The custom event types can be used for private messages between elements
* that can't be expressed using normal
* GStreamer buffer passing semantics. Custom events carry an arbitrary
* #GstStructure.
* Specific custom events are distinguished by the name of the structure.
*/
export namespace EventType {
export const $gtype: GObject.GType;
}
enum EventType {
/**
* unknown event.
*/
UNKNOWN,
/**
* Start a flush operation. This event clears all data
* from the pipeline and unblock all streaming threads.
*/
FLUSH_START,
/**
* Stop a flush operation. This event resets the
* running-time of the pipeline.
*/
FLUSH_STOP,
/**
* 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.
*/
STREAM_START,
/**
* #GstCaps event. Notify the pad of a new media type.
*/
CAPS,
/**
* A new media segment follows in the dataflow. The
* segment events contains information for clipping buffers and
* converting buffer timestamps to running-time and
* stream-time.
*/
SEGMENT,
/**
* A new #GstStreamCollection is available (Since: 1.10)
*/
STREAM_COLLECTION,
/**
* A new set of metadata tags has been found in the stream.
*/
TAG,
/**
* Notification of buffering requirements. Currently not
* used yet.
*/
BUFFERSIZE,
/**
* An event that sinks turn into a message. Used to
* send messages that should be emitted in sync with
* rendering.
*/
SINK_MESSAGE,
/**
* 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)
*/
STREAM_GROUP_DONE,
/**
* 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.
*/
EOS,
/**
* An event which indicates that a new table of contents (TOC)
* was found or updated.
*/
TOC,
/**
* An event which indicates that new or updated
* encryption information has been found in the stream.
*/
PROTECTION,
/**
* Marks the end of a segment playback.
*/
SEGMENT_DONE,
/**
* Marks a gap in the datastream.
*/
GAP,
/**
* Notify downstream that a playback rate override
* should be applied as soon as possible. (Since: 1.18)
*/
INSTANT_RATE_CHANGE,
/**
* A quality message. Used to indicate to upstream elements
* that the downstream elements should adjust their processing
* rate.
*/
QOS,
/**
* A request for a new playback position and rate.
*/
SEEK,
/**
* Navigation events are usually used for communicating
* user requests, such as mouse or keyboard movements,
* to upstream elements.
*/
NAVIGATION,
/**
* Notification of new latency adjustment. Sinks will use
* the latency information to adjust their synchronisation.
*/
LATENCY,
/**
* A request for stepping through the media. Sinks will usually
* execute the step operation.
*/
STEP,
/**
* A request for upstream renegotiating caps and reconfiguring.
*/
RECONFIGURE,
/**
* A request for a new playback position based on TOC
* entry's UID.
*/
TOC_SELECT,
/**
* A request to select one or more streams (Since: 1.10)
*/
SELECT_STREAMS,
/**
* 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)
*/
INSTANT_RATE_SYNC_TIME,
/**
* Upstream custom event
*/
CUSTOM_UPSTREAM,
/**
* Downstream custom event that travels in the
* data flow.
*/
CUSTOM_DOWNSTREAM,
/**
* Custom out-of-band downstream event.
*/
CUSTOM_DOWNSTREAM_OOB,
/**
* Custom sticky downstream event.
*/
CUSTOM_DOWNSTREAM_STICKY,
/**
* Custom upstream or downstream event.
* In-band when travelling downstream.
*/
CUSTOM_BOTH,
/**
* Custom upstream or downstream out-of-band event.
*/
CUSTOM_BOTH_OOB,
}
/**
* The result of passing data to a pad.
*
* Note that the custom return values should not be exposed outside of the
* element scope.
*/
/**
* The result of passing data to a pad.
*
* Note that the custom return values should not be exposed outside of the
* element scope.
*/
export namespace FlowReturn {
export const $gtype: GObject.GType;
}
enum FlowReturn {
/**
* Pre-defined custom success code.
*/
CUSTOM_SUCCESS_2,
/**
* Pre-defined custom success code (define your
* custom success code to this to avoid compiler
* warnings).
*/
CUSTOM_SUCCESS_1,
/**
* Elements can use values starting from
* this (and higher) to define custom success
* codes.
*/
CUSTOM_SUCCESS,
/**
* Data passing was ok.
*/
OK,
/**
* Pad is not linked.
*/
NOT_LINKED,
/**
* Pad is flushing.
*/
FLUSHING,
/**
* Pad is EOS.
*/
EOS,
/**
* Pad is not negotiated.
*/
NOT_NEGOTIATED,
/**
* Some (fatal) error occurred. Element generating
* this error should post an error message using
* GST_ELEMENT_ERROR() with more details.
*/
ERROR,
/**
* This operation is not supported.
*/
NOT_SUPPORTED,
/**
* Elements can use values starting from
* this (and lower) to define custom error codes.
*/
CUSTOM_ERROR,
/**
* Pre-defined custom error code (define your
* custom error code to this to avoid compiler
* warnings).
*/
CUSTOM_ERROR_1,
/**
* Pre-defined custom error code.
*/
CUSTOM_ERROR_2,
}
/**
* Standard predefined formats
*/
/**
* Standard predefined formats
*/
export namespace Format {
export const $gtype: GObject.GType;
}
enum Format {
/**
* undefined format
*/
UNDEFINED,
/**
* the default format of the pad/element. This can be
* samples for raw audio, frames/fields for raw video (some, but not all,
* elements support this; use `GST_FORMAT_TIME` if you don't have a good
* reason to query for samples/frames)
*/
DEFAULT,
/**
* bytes
*/
BYTES,
/**
* time in nanoseconds
*/
TIME,
/**
* buffers (few, if any, elements implement this as of
* May 2009)
*/
BUFFERS,
/**
* percentage of stream (few, if any, elements implement
* this as of May 2009)
*/
PERCENT,
}
/**
* The result of a #GstIteratorItemFunction.
*/
/**
* The result of a #GstIteratorItemFunction.
*/
export namespace IteratorItem {
export const $gtype: GObject.GType;
}
enum IteratorItem {
/**
* Skip this item
*/
SKIP,
/**
* Return item
*/
PASS,
/**
* Stop after this item.
*/
END,
}
/**
* The result of gst_iterator_next().
*/
/**
* The result of gst_iterator_next().
*/
export namespace IteratorResult {
export const $gtype: GObject.GType;
}
enum IteratorResult {
/**
* No more items in the iterator
*/
DONE,
/**
* An item was retrieved
*/
OK,
/**
* Datastructure changed while iterating
*/
RESYNC,
/**
* An error happened
*/
ERROR,
}
/**
* Library errors are for errors from the library being used by elements
* (initializing, finalizing, settings, ...)
*/
class LibraryError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* a general error which doesn't fit in any other
* category. Make sure you add a custom message to the error call.
*/
static FAILED: number;
/**
* do not use this except as a placeholder for
* deciding where to go while developing code.
*/
static TOO_LAZY: number;
/**
* used when the library could not be opened.
*/
static INIT: number;
/**
* used when the library could not be closed.
*/
static SHUTDOWN: number;
/**
* used when the library doesn't accept settings.
*/
static SETTINGS: number;
/**
* used when the library generated an encoding error.
*/
static ENCODE: number;
/**
* the number of library error types.
*/
static NUM_ERRORS: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* The direction of a pad.
*/
/**
* The direction of a pad.
*/
export namespace PadDirection {
export const $gtype: GObject.GType;
}
enum PadDirection {
/**
* direction is unknown.
*/
UNKNOWN,
/**
* the pad is a source pad.
*/
SRC,
/**
* the pad is a sink pad.
*/
SINK,
}
/**
* Result values from gst_pad_link and friends.
*/
/**
* Result values from gst_pad_link and friends.
*/
export namespace PadLinkReturn {
export const $gtype: GObject.GType;
}
enum PadLinkReturn {
/**
* link succeeded
*/
OK,
/**
* pads have no common grandparent
*/
WRONG_HIERARCHY,
/**
* pad was already linked
*/
WAS_LINKED,
/**
* pads have wrong direction
*/
WRONG_DIRECTION,
/**
* pads do not have common format
*/
NOFORMAT,
/**
* pads cannot cooperate in scheduling
*/
NOSCHED,
/**
* refused for some reason
*/
REFUSED,
}
/**
* The status of a GstPad. After activating a pad, which usually happens when the
* parent element goes from READY to PAUSED, the GstPadMode defines if the
* pad operates in push or pull mode.
*/
/**
* The status of a GstPad. After activating a pad, which usually happens when the
* parent element goes from READY to PAUSED, the GstPadMode defines if the
* pad operates in push or pull mode.
*/
export namespace PadMode {
export const $gtype: GObject.GType;
}
enum PadMode {
/**
* Pad will not handle dataflow
*/
NONE,
/**
* Pad handles dataflow in downstream push mode
*/
PUSH,
/**
* Pad handles dataflow in upstream pull mode
*/
PULL,
}
/**
* Indicates when this pad will become available.
*/
/**
* Indicates when this pad will become available.
*/
export namespace PadPresence {
export const $gtype: GObject.GType;
}
enum PadPresence {
/**
* the pad is always available
*/
ALWAYS,
/**
* the pad will become available depending on the media stream
*/
SOMETIMES,
/**
* the pad is only available on request with
* gst_element_request_pad().
*/
REQUEST,
}
/**
* Different return values for the #GstPadProbeCallback.
*/
/**
* Different return values for the #GstPadProbeCallback.
*/
export namespace PadProbeReturn {
export const $gtype: GObject.GType;
}
enum PadProbeReturn {
/**
* 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.
*/
DROP,
/**
* 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).
*/
OK,
/**
* remove this probe, passing the data. For blocking probes
* this will cause data flow to unblock, unless there are also other
* blocking probes installed.
*/
REMOVE,
/**
* 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.
*/
PASS,
/**
* Data has been handled in the probe and will not be
* forwarded further. For events and buffers this is the same behaviour as
* %GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer
* or event yourself). For queries it will also return %TRUE to the caller.
* The probe can also modify the #GstFlowReturn value by using the
* #GST_PAD_PROBE_INFO_FLOW_RETURN() accessor.
* Note that the resulting query must contain valid entries.
* Since: 1.6
*/
HANDLED,
}
/**
* The different parsing errors that can occur.
*/
class ParseError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* A syntax error occurred.
*/
static SYNTAX: number;
/**
* The description contained an unknown element
*/
static NO_SUCH_ELEMENT: number;
/**
* An element did not have a specified property
*/
static NO_SUCH_PROPERTY: number;
/**
* There was an error linking two pads.
*/
static LINK: number;
/**
* There was an error setting a property
*/
static COULD_NOT_SET_PROPERTY: number;
/**
* An empty bin was specified.
*/
static EMPTY_BIN: number;
/**
* An empty description was specified
*/
static EMPTY: number;
/**
* A delayed link did not get resolved.
*/
static DELAYED_LINK: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Get the error quark used by the parsing subsystem.
*/
static quark(): GLib.Quark;
}
/**
* The plugin loading errors
*/
class PluginError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The plugin could not be loaded
*/
static MODULE: number;
/**
* The plugin has unresolved dependencies
*/
static DEPENDENCIES: number;
/**
* The plugin has already be loaded from a different file
*/
static NAME_MISMATCH: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Get the error quark.
*/
static quark(): GLib.Quark;
}
/**
* The type of a %GST_MESSAGE_PROGRESS. The progress messages inform the
* application of the status of asynchronous tasks.
*/
/**
* The type of a %GST_MESSAGE_PROGRESS. The progress messages inform the
* application of the status of asynchronous tasks.
*/
export namespace ProgressType {
export const $gtype: GObject.GType;
}
enum ProgressType {
/**
* A new task started.
*/
START,
/**
* A task completed and a new one continues.
*/
CONTINUE,
/**
* A task completed.
*/
COMPLETE,
/**
* A task was canceled.
*/
CANCELED,
/**
* A task caused an error. An error message is also
* posted on the bus.
*/
ERROR,
}
/**
* The result of a #GstPromise
*/
/**
* The result of a #GstPromise
*/
export namespace PromiseResult {
export const $gtype: GObject.GType;
}
enum PromiseResult {
/**
* Initial state. Waiting for transition to any
* other state.
*/
PENDING,
/**
* Interrupted by the consumer as it doesn't
* want the value anymore.
*/
INTERRUPTED,
/**
* A producer marked a reply
*/
REPLIED,
/**
* The promise expired (the carrying object
* lost all refs) and the promise will never be fulfilled.
*/
EXPIRED,
}
/**
* The different types of QoS events that can be given to the
* gst_event_new_qos() method.
*/
/**
* The different types of QoS events that can be given to the
* gst_event_new_qos() method.
*/
export namespace QOSType {
export const $gtype: GObject.GType;
}
enum QOSType {
/**
* The QoS event type that is produced when upstream
* elements are producing data too quickly and the element can't keep up
* processing the data. Upstream should reduce their production rate. This
* type is also used when buffers arrive early or in time.
*/
OVERFLOW,
/**
* The QoS event type that is produced when upstream
* elements are producing data too slowly and need to speed up their
* production rate.
*/
UNDERFLOW,
/**
* The QoS event type that is produced when the
* application enabled throttling to limit the data rate.
*/
THROTTLE,
}
/**
* Standard predefined Query types
*/
/**
* Standard predefined Query types
*/
export namespace QueryType {
export const $gtype: GObject.GType;
}
enum QueryType {
/**
* unknown query type
*/
UNKNOWN,
/**
* current position in stream
*/
POSITION,
/**
* total duration of the stream
*/
DURATION,
/**
* latency of stream
*/
LATENCY,
/**
* current jitter of stream
*/
JITTER,
/**
* current rate of the stream
*/
RATE,
/**
* seeking capabilities
*/
SEEKING,
/**
* segment start/stop positions
*/
SEGMENT,
/**
* convert values between formats
*/
CONVERT,
/**
* query supported formats for convert
*/
FORMATS,
/**
* query available media for efficient seeking.
*/
BUFFERING,
/**
* a custom application or element defined query.
*/
CUSTOM,
/**
* query the URI of the source or sink.
*/
URI,
/**
* the buffer allocation properties
*/
ALLOCATION,
/**
* the scheduling properties
*/
SCHEDULING,
/**
* the accept caps query
*/
ACCEPT_CAPS,
/**
* the caps query
*/
CAPS,
/**
* wait till all serialized data is consumed downstream
*/
DRAIN,
/**
* query the pipeline-local context from
* downstream or upstream (since 1.2)
*/
CONTEXT,
/**
* the bitrate query (since 1.16)
*/
BITRATE,
/**
* Query stream selection capability.
*/
SELECTABLE,
}
/**
* Element priority ranks. Defines the order in which the autoplugger (or
* similar rank-picking mechanisms, such as e.g. gst_element_make_from_uri())
* will choose this element over an alternative one with the same function.
*
* These constants serve as a rough guidance for defining the rank of a
* #GstPluginFeature. Any value is valid, including values bigger than
* `GST_RANK_PRIMARY`.
*/
/**
* Element priority ranks. Defines the order in which the autoplugger (or
* similar rank-picking mechanisms, such as e.g. gst_element_make_from_uri())
* will choose this element over an alternative one with the same function.
*
* These constants serve as a rough guidance for defining the rank of a
* #GstPluginFeature. Any value is valid, including values bigger than
* `GST_RANK_PRIMARY`.
*/
export namespace Rank {
export const $gtype: GObject.GType;
}
enum Rank {
/**
* will be chosen last or not at all
*/
NONE,
/**
* unlikely to be chosen
*/
MARGINAL,
/**
* likely to be chosen
*/
SECONDARY,
/**
* will be chosen first
*/
PRIMARY,
}
/**
* 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.
*/
class ResourceError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* a general error which doesn't fit in any other
* category. Make sure you add a custom message to the error call.
*/
static FAILED: number;
/**
* do not use this except as a placeholder for
* deciding where to go while developing code.
*/
static TOO_LAZY: number;
/**
* used when the resource could not be found.
*/
static NOT_FOUND: number;
/**
* used when resource is busy.
*/
static BUSY: number;
/**
* used when resource fails to open for reading.
*/
static OPEN_READ: number;
/**
* used when resource fails to open for writing.
*/
static OPEN_WRITE: number;
/**
* used when resource cannot be opened for
* both reading and writing, or either (but unspecified which).
*/
static OPEN_READ_WRITE: number;
/**
* used when the resource can't be closed.
*/
static CLOSE: number;
/**
* used when the resource can't be read from.
*/
static READ: number;
/**
* used when the resource can't be written to.
*/
static WRITE: number;
/**
* used when a seek on the resource fails.
*/
static SEEK: number;
/**
* used when a synchronize on the resource fails.
*/
static SYNC: number;
/**
* used when settings can't be manipulated on.
*/
static SETTINGS: number;
/**
* used when the resource has no space left.
*/
static NO_SPACE_LEFT: number;
/**
* used when the resource can't be opened
* due to missing authorization.
* (Since: 1.2.4)
*/
static NOT_AUTHORIZED: number;
/**
* the number of resource error types.
*/
static NUM_ERRORS: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* The different search modes.
*/
/**
* The different search modes.
*/
export namespace SearchMode {
export const $gtype: GObject.GType;
}
enum SearchMode {
/**
* Only search for exact matches.
*/
EXACT,
/**
* Search for an exact match or the element just before.
*/
BEFORE,
/**
* Search for an exact match or the element just after.
*/
AFTER,
}
/**
* The different types of seek events. When constructing a seek event with
* gst_event_new_seek() or when doing gst_segment_do_seek ().
*/
/**
* The different types of seek events. When constructing a seek event with
* gst_event_new_seek() or when doing gst_segment_do_seek ().
*/
export namespace SeekType {
export const $gtype: GObject.GType;
}
enum SeekType {
/**
* no change in position is required
*/
NONE,
/**
* absolute position is requested
*/
SET,
/**
* relative position to duration is requested
*/
END,
}
/**
* The possible states an element can be in. States can be changed using
* gst_element_set_state() and checked using gst_element_get_state().
*/
/**
* The possible states an element can be in. States can be changed using
* gst_element_set_state() and checked using gst_element_get_state().
*/
export namespace State {
export const $gtype: GObject.GType;
}
enum State {
/**
* no pending state.
*/
VOID_PENDING,
/**
* the NULL state or initial state of an element.
*/
NULL,
/**
* the element is ready to go to PAUSED.
*/
READY,
/**
* the element is PAUSED, it is ready to accept and
* process data. Sink elements however only accept one
* buffer and then block.
*/
PAUSED,
/**
* the element is PLAYING, the #GstClock is running and
* the data is flowing.
*/
PLAYING,
}
/**
* These are the different state changes an element goes through.
* %GST_STATE_NULL ⇒ %GST_STATE_PLAYING is called an upwards state change
* and %GST_STATE_PLAYING ⇒ %GST_STATE_NULL a downwards state change.
*/
/**
* These are the different state changes an element goes through.
* %GST_STATE_NULL ⇒ %GST_STATE_PLAYING is called an upwards state change
* and %GST_STATE_PLAYING ⇒ %GST_STATE_NULL a downwards state change.
*/
export namespace StateChange {
export const $gtype: GObject.GType;
}
enum StateChange {
/**
* 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).
*/
NULL_TO_READY,
/**
* 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.
*/
READY_TO_PAUSED,
/**
* state change from PAUSED to PLAYING.
* * Most elements ignore this state change.
* * The pipeline selects a #GstClock and distributes this to all the children
* before setting them to PLAYING. This means that it is only allowed to
* synchronize on the #GstClock in the PLAYING state.
* * The pipeline uses the #GstClock and the running_time to calculate the
* base_time. The base_time is distributed to all children when performing
* the state change.
* * Sink elements stop blocking on the preroll buffer or event and start
* rendering the data.
* * Sinks can post %GST_MESSAGE_EOS in the PLAYING state. It is not allowed
* to post %GST_MESSAGE_EOS when not in the PLAYING state.
* * While streaming in PAUSED or PLAYING elements can create and remove
* sometimes pads.
* * Live sources start generating data and return %GST_STATE_CHANGE_SUCCESS.
*/
PAUSED_TO_PLAYING,
/**
* state change from PLAYING to PAUSED.
* * Most elements ignore this state change.
* * The pipeline calculates the running_time based on the last selected
* #GstClock and the base_time. It stores this information to continue
* playback when going back to the PLAYING state.
* * Sinks unblock any #GstClock wait calls.
* * When a sink does not have a pending buffer to play, it returns
* #GST_STATE_CHANGE_ASYNC from this state change and completes the state
* change when it receives a new buffer or an %GST_EVENT_EOS.
* * Any queued %GST_MESSAGE_EOS items are removed since they will be reposted
* when going back to the PLAYING state. The EOS messages are queued in
* #GstBin containers.
* * Live sources stop generating data and return %GST_STATE_CHANGE_NO_PREROLL.
*/
PLAYING_TO_PAUSED,
/**
* 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
*/
PAUSED_TO_READY,
/**
* state change from READY to NULL.
* * Elements close devices
* * Elements reset any internal state.
*/
READY_TO_NULL,
/**
* state change from NULL to NULL. (Since: 1.14)
*/
NULL_TO_NULL,
/**
* 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)
*/
READY_TO_READY,
/**
* 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)
*/
PAUSED_TO_PAUSED,
/**
* state change from PLAYING to PLAYING. (Since: 1.14)
*/
PLAYING_TO_PLAYING,
}
/**
* The possible return values from a state change function such as
* gst_element_set_state(). Only `GST_STATE_CHANGE_FAILURE` is a real failure.
*/
/**
* The possible return values from a state change function such as
* gst_element_set_state(). Only `GST_STATE_CHANGE_FAILURE` is a real failure.
*/
export namespace StateChangeReturn {
export const $gtype: GObject.GType;
}
enum StateChangeReturn {
/**
* the state change failed
*/
FAILURE,
/**
* the state change succeeded
*/
SUCCESS,
/**
* the state change will happen asynchronously
*/
ASYNC,
/**
* the state change succeeded but the element
* cannot produce data in %GST_STATE_PAUSED.
* This typically happens with live sources.
*/
NO_PREROLL,
}
/**
* Stream errors are for anything related to the stream being processed:
* format errors, media type errors, ...
* They're typically used by decoders, demuxers, converters, ...
*/
class StreamError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* a general error which doesn't fit in any other
* category. Make sure you add a custom message to the error call.
*/
static FAILED: number;
/**
* do not use this except as a placeholder for
* deciding where to go while developing code.
*/
static TOO_LAZY: number;
/**
* use this when you do not want to implement
* this functionality yet.
*/
static NOT_IMPLEMENTED: number;
/**
* used when the element doesn't know the
* stream's type.
*/
static TYPE_NOT_FOUND: number;
/**
* used when the element doesn't handle this type
* of stream.
*/
static WRONG_TYPE: number;
/**
* used when there's no codec to handle the
* stream's type.
*/
static CODEC_NOT_FOUND: number;
/**
* used when decoding fails.
*/
static DECODE: number;
/**
* used when encoding fails.
*/
static ENCODE: number;
/**
* used when demuxing fails.
*/
static DEMUX: number;
/**
* used when muxing fails.
*/
static MUX: number;
/**
* used when the stream is of the wrong format
* (for example, wrong caps).
*/
static FORMAT: number;
/**
* used when the stream is encrypted and can't be
* decrypted because this is not supported by the element.
*/
static DECRYPT: number;
/**
* used when the stream is encrypted and
* can't be decrypted because no suitable key is available.
*/
static DECRYPT_NOKEY: number;
/**
* the number of stream error types.
*/
static NUM_ERRORS: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* The type of a %GST_MESSAGE_STREAM_STATUS. The stream status messages inform the
* application of new streaming threads and their status.
*/
/**
* The type of a %GST_MESSAGE_STREAM_STATUS. The stream status messages inform the
* application of new streaming threads and their status.
*/
export namespace StreamStatusType {
export const $gtype: GObject.GType;
}
enum StreamStatusType {
/**
* A new thread need to be created.
*/
CREATE,
/**
* a thread entered its loop function
*/
ENTER,
/**
* a thread left its loop function
*/
LEAVE,
/**
* a thread is destroyed
*/
DESTROY,
/**
* a thread is started
*/
START,
/**
* a thread is paused
*/
PAUSE,
/**
* a thread is stopped
*/
STOP,
}
/**
* The type of a %GST_MESSAGE_STRUCTURE_CHANGE.
*/
/**
* The type of a %GST_MESSAGE_STRUCTURE_CHANGE.
*/
export namespace StructureChangeType {
export const $gtype: GObject.GType;
}
enum StructureChangeType {
/**
* Pad linking is starting or done.
*/
LINK,
/**
* Pad unlinking is starting or done.
*/
UNLINK,
}
/**
* Extra tag flags used when registering tags.
*/
/**
* Extra tag flags used when registering tags.
*/
export namespace TagFlag {
export const $gtype: GObject.GType;
}
enum TagFlag {
/**
* undefined flag
*/
UNDEFINED,
/**
* tag is meta data
*/
META,
/**
* tag is encoded
*/
ENCODED,
/**
* tag is decoded
*/
DECODED,
/**
* number of tag flags
*/
COUNT,
}
/**
* The different tag merging modes are basically replace, overwrite and append,
* but they can be seen from two directions. Given two taglists: (A) the tags
* already in the element and (B) the ones that are supplied to the element (
* e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a
* %GST_EVENT_TAG), how are these tags merged?
* In the table below this is shown for the cases that a tag exists in the list
* (A) or does not exists (!A) and combinations thereof.
*
* | merge mode | A + B | A + !B | !A + B | !A + !B |
* | ----------- | ----- | ------ | ------ | ------- |
* | REPLACE_ALL | B | ø | B | ø |
* | REPLACE | B | A | B | ø |
* | APPEND | A, B | A | B | ø |
* | PREPEND | B, A | A | B | ø |
* | KEEP | A | A | B | ø |
* | KEEP_ALL | A | A | ø | ø |
*/
/**
* The different tag merging modes are basically replace, overwrite and append,
* but they can be seen from two directions. Given two taglists: (A) the tags
* already in the element and (B) the ones that are supplied to the element (
* e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a
* %GST_EVENT_TAG), how are these tags merged?
* In the table below this is shown for the cases that a tag exists in the list
* (A) or does not exists (!A) and combinations thereof.
*
* | merge mode | A + B | A + !B | !A + B | !A + !B |
* | ----------- | ----- | ------ | ------ | ------- |
* | REPLACE_ALL | B | ø | B | ø |
* | REPLACE | B | A | B | ø |
* | APPEND | A, B | A | B | ø |
* | PREPEND | B, A | A | B | ø |
* | KEEP | A | A | B | ø |
* | KEEP_ALL | A | A | ø | ø |
*/
export namespace TagMergeMode {
export const $gtype: GObject.GType;
}
enum TagMergeMode {
/**
* undefined merge mode
*/
UNDEFINED,
/**
* replace all tags (clear list and append)
*/
REPLACE_ALL,
/**
* replace tags
*/
REPLACE,
/**
* append tags
*/
APPEND,
/**
* prepend tags
*/
PREPEND,
/**
* keep existing tags
*/
KEEP,
/**
* keep all existing tags
*/
KEEP_ALL,
/**
* the number of merge modes
*/
COUNT,
}
/**
* GstTagScope specifies if a taglist applies to the complete
* medium or only to one single stream.
*/
/**
* GstTagScope specifies if a taglist applies to the complete
* medium or only to one single stream.
*/
export namespace TagScope {
export const $gtype: GObject.GType;
}
enum TagScope {
/**
* tags specific to this single stream
*/
STREAM,
/**
* global tags for the complete medium
*/
GLOBAL,
}
/**
* The different states a task can be in
*/
/**
* The different states a task can be in
*/
export namespace TaskState {
export const $gtype: GObject.GType;
}
enum TaskState {
/**
* the task is started and running
*/
STARTED,
/**
* the task is stopped
*/
STOPPED,
/**
* the task is paused
*/
PAUSED,
}
/**
* The different types of TOC entries (see #GstTocEntry).
*
* There are two types of TOC entries: alternatives or parts in a sequence.
*/
/**
* The different types of TOC entries (see #GstTocEntry).
*
* There are two types of TOC entries: alternatives or parts in a sequence.
*/
export namespace TocEntryType {
export const $gtype: GObject.GType;
}
enum TocEntryType {
/**
* entry is an angle (i.e. an alternative)
*/
ANGLE,
/**
* entry is a version (i.e. alternative)
*/
VERSION,
/**
* entry is an edition (i.e. alternative)
*/
EDITION,
/**
* invalid entry type value
*/
INVALID,
/**
* entry is a title (i.e. a part of a sequence)
*/
TITLE,
/**
* entry is a track (i.e. a part of a sequence)
*/
TRACK,
/**
* entry is a chapter (i.e. a part of a sequence)
*/
CHAPTER,
}
/**
* How a #GstTocEntry should be repeated. By default, entries are played a
* single time.
*/
/**
* How a #GstTocEntry should be repeated. By default, entries are played a
* single time.
*/
export namespace TocLoopType {
export const $gtype: GObject.GType;
}
enum TocLoopType {
/**
* single forward playback
*/
NONE,
/**
* repeat forward
*/
FORWARD,
/**
* repeat backward
*/
REVERSE,
/**
* repeat forward and backward
*/
PING_PONG,
}
/**
* The scope of a TOC.
*/
/**
* The scope of a TOC.
*/
export namespace TocScope {
export const $gtype: GObject.GType;
}
enum TocScope {
/**
* global TOC representing all selectable options
* (this is what applications are usually interested in)
*/
GLOBAL,
/**
* 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)
*/
CURRENT,
}
/**
* Tracing record will contain fields that contain a measured value or extra
* meta-data. One such meta data are values that tell where a measurement was
* taken. This enumerating declares to which scope such a meta data field
* relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
* events may contain values for different #GstPads.
*/
/**
* Tracing record will contain fields that contain a measured value or extra
* meta-data. One such meta data are values that tell where a measurement was
* taken. This enumerating declares to which scope such a meta data field
* relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
* events may contain values for different #GstPads.
*/
export namespace TracerValueScope {
export const $gtype: GObject.GType;
}
enum TracerValueScope {
/**
* the value is related to the process
*/
PROCESS,
/**
* the value is related to a thread
*/
THREAD,
/**
* the value is related to an #GstElement
*/
ELEMENT,
/**
* the value is related to a #GstPad
*/
PAD,
}
/**
* The probability of the typefind function. Higher values have more certainty
* in doing a reliable typefind.
*/
/**
* The probability of the typefind function. Higher values have more certainty
* in doing a reliable typefind.
*/
export namespace TypeFindProbability {
export const $gtype: GObject.GType;
}
enum TypeFindProbability {
/**
* type undetected.
*/
NONE,
/**
* unlikely typefind.
*/
MINIMUM,
/**
* possible type detected.
*/
POSSIBLE,
/**
* likely a type was detected.
*/
LIKELY,
/**
* nearly certain that a type was detected.
*/
NEARLY_CERTAIN,
/**
* very certain a type was detected.
*/
MAXIMUM,
}
/**
* Different URI-related errors that can occur.
*/
class URIError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The protocol is not supported
*/
static UNSUPPORTED_PROTOCOL: number;
/**
* There was a problem with the URI
*/
static BAD_URI: number;
/**
* Could not set or change the URI because the
* URI handler was in a state where that is not possible or not permitted
*/
static BAD_STATE: number;
/**
* There was a problem with the entity that
* the URI references
*/
static BAD_REFERENCE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* The different types of URI direction.
*/
/**
* The different types of URI direction.
*/
export namespace URIType {
export const $gtype: GObject.GType;
}
enum URIType {
/**
* The URI direction is unknown
*/
UNKNOWN,
/**
* The URI is a consumer.
*/
SINK,
/**
* The URI is a producer.
*/
SRC,
}
/**
* The allocator name for the default system memory allocator
*/
const ALLOCATOR_SYSMEM: string;
/**
* Combination of all possible fields that can be copied with
* gst_buffer_copy_into().
*/
const BUFFER_COPY_ALL: BufferCopyFlags;
/**
* Combination of all possible metadata fields that can be copied with
* gst_buffer_copy_into().
*/
const BUFFER_COPY_METADATA: BufferCopyFlags;
/**
* Constant for no-offset return results.
*/
const BUFFER_OFFSET_NONE: number;
const CAN_INLINE: number;
const CAPS_FEATURE_MEMORY_SYSTEM_MEMORY: string;
/**
* Constant to define an undefined clock time.
*/
const CLOCK_TIME_NONE: ClockTime;
const DEBUG_BG_MASK: number;
const DEBUG_FG_MASK: number;
const DEBUG_FORMAT_MASK: number;
const ELEMENT_FACTORY_KLASS_DECODER: string;
const ELEMENT_FACTORY_KLASS_DECRYPTOR: string;
const ELEMENT_FACTORY_KLASS_DEMUXER: string;
const ELEMENT_FACTORY_KLASS_DEPAYLOADER: string;
const ELEMENT_FACTORY_KLASS_ENCODER: string;
const ELEMENT_FACTORY_KLASS_ENCRYPTOR: string;
const ELEMENT_FACTORY_KLASS_FORMATTER: string;
/**
* 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.
*/
const ELEMENT_FACTORY_KLASS_HARDWARE: string;
const ELEMENT_FACTORY_KLASS_MEDIA_AUDIO: string;
const ELEMENT_FACTORY_KLASS_MEDIA_IMAGE: string;
const ELEMENT_FACTORY_KLASS_MEDIA_METADATA: string;
const ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE: string;
const ELEMENT_FACTORY_KLASS_MEDIA_VIDEO: string;
const ELEMENT_FACTORY_KLASS_MUXER: string;
const ELEMENT_FACTORY_KLASS_PARSER: string;
const ELEMENT_FACTORY_KLASS_PAYLOADER: string;
const ELEMENT_FACTORY_KLASS_SINK: string;
const ELEMENT_FACTORY_KLASS_SRC: string;
/**
* Elements of any of the defined GST_ELEMENT_FACTORY_LIST types
*/
const ELEMENT_FACTORY_TYPE_ANY: ElementFactoryListType;
/**
* All sinks handling audio, video or image media types
*/
const ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: ElementFactoryListType;
/**
* All encoders handling audio media types
*/
const ELEMENT_FACTORY_TYPE_AUDIO_ENCODER: ElementFactoryListType;
/**
* All elements used to 'decode' streams (decoders, demuxers, parsers, depayloaders)
*/
const ELEMENT_FACTORY_TYPE_DECODABLE: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_DECODER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_DECRYPTOR: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_DEMUXER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_DEPAYLOADER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_ENCODER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_ENCRYPTOR: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_FORMATTER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_HARDWARE: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MAX_ELEMENTS: ElementFactoryListType;
/**
* Elements matching any of the defined GST_ELEMENT_FACTORY_TYPE_MEDIA types
*
* Note: Do not use this if you wish to not filter against any of the defined
* media types. If you wish to do this, simply don't specify any
* GST_ELEMENT_FACTORY_TYPE_MEDIA flag.
*/
const ELEMENT_FACTORY_TYPE_MEDIA_ANY: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MEDIA_AUDIO: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MEDIA_IMAGE: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MEDIA_METADATA: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MEDIA_VIDEO: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_MUXER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_PARSER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_PAYLOADER: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_SINK: ElementFactoryListType;
const ELEMENT_FACTORY_TYPE_SRC: ElementFactoryListType;
/**
* Timestamp correcting elements
*/
const ELEMENT_FACTORY_TYPE_TIMESTAMPER: ElementFactoryListType;
/**
* All encoders handling video or image media types
*/
const ELEMENT_FACTORY_TYPE_VIDEO_ENCODER: ElementFactoryListType;
/**
* Name and contact details of the author(s). Use \n to separate
* multiple author details.
* E.g: "Joe Bloggs <joe.blogs at foo.com>"
*/
const ELEMENT_METADATA_AUTHOR: string;
/**
* Sentence describing the purpose of the element.
* E.g: "Write stream to a file"
*/
const ELEMENT_METADATA_DESCRIPTION: string;
/**
* Set uri pointing to user documentation. Applications can use this to show
* help for e.g. effects to users.
*/
const ELEMENT_METADATA_DOC_URI: string;
/**
* 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.
*/
const ELEMENT_METADATA_ICON_NAME: string;
/**
* String describing the type of element, as an unordered list
* separated with slashes ('/'). See draft-klass.txt of the design docs
* for more details and common types. E.g: "Sink/File"
*/
const ELEMENT_METADATA_KLASS: string;
/**
* The long English name of the element. E.g. "File Sink"
*/
const ELEMENT_METADATA_LONGNAME: string;
const EVENT_NUM_SHIFT: number;
/**
* The same thing as #GST_EVENT_TYPE_UPSTREAM | #GST_EVENT_TYPE_DOWNSTREAM.
*/
const EVENT_TYPE_BOTH: EventTypeFlags;
/**
* A mask value with all bits set, for use as a
* GstFlagSet mask where all flag bits must match
* exactly
*/
const FLAG_SET_MASK_EXACT: number;
/**
* The PERCENT format is between 0 and this value
*/
const FORMAT_PERCENT_MAX: number;
/**
* The value used to scale down the reported PERCENT format value to
* its real value.
*/
const FORMAT_PERCENT_SCALE: number;
/**
* A value which is guaranteed to never be returned by
* gst_util_group_id_next().
*
* Can be used as a default value in variables used to store group_id.
*/
const GROUP_ID_INVALID: number;
/**
* To be used in GST_PLUGIN_DEFINE if unsure about the licence.
*/
const LICENSE_UNKNOWN: string;
/**
* GstLockFlags value alias for GST_LOCK_FLAG_READ | GST_LOCK_FLAG_WRITE
*/
const LOCK_FLAG_READWRITE: LockFlags;
/**
* GstMapFlags value alias for GST_MAP_READ | GST_MAP_WRITE
*/
const MAP_READWRITE: MapFlags;
/**
* This metadata stays relevant until a deep copy is made.
*/
const META_TAG_MEMORY_REFERENCE_STR: string;
/**
* This metadata stays relevant as long as memory layout is unchanged.
* In hindsight, this tag should have been called "memory-layout".
*/
const META_TAG_MEMORY_STR: string;
/**
* Constant that defines one GStreamer millisecond.
*/
const MSECOND: ClockTimeDiff;
/**
* Constant that defines one GStreamer nanosecond
*/
const NSECOND: ClockTimeDiff;
/**
* Use this flag on GObject properties of GstObject to indicate that
* they might not be available depending on environment such as OS, device, etc,
* so such properties will be installed conditionally only if the GstObject is
* able to support it.
*/
const PARAM_CONDITIONALLY_AVAILABLE: number;
/**
* Use this flag on GObject properties to signal they can make sense to be.
* controlled over time. This hint is used by the GstController.
*/
const PARAM_CONTROLLABLE: number;
/**
* Use this flag on GObject properties of GstObject to indicate that
* during `gst-inspect` and friends, the default value should be used
* as default instead of the current value.
*/
const PARAM_DOC_SHOW_DEFAULT: number;
/**
* Use this flag on GObject properties of GstElements to indicate that
* they can be changed when the element is in the PAUSED or lower state.
* This flag implies GST_PARAM_MUTABLE_READY.
*/
const PARAM_MUTABLE_PAUSED: number;
/**
* Use this flag on GObject properties of GstElements to indicate that
* they can be changed when the element is in the PLAYING or lower state.
* This flag implies GST_PARAM_MUTABLE_PAUSED.
*/
const PARAM_MUTABLE_PLAYING: number;
/**
* Use this flag on GObject properties of GstElements to indicate that
* they can be changed when the element is in the READY or lower state.
*/
const PARAM_MUTABLE_READY: number;
/**
* Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.
*/
const PARAM_USER_SHIFT: number;
/**
* The field name in a GstCaps that is used to signal the UUID of the protection
* system.
*/
const PROTECTION_SYSTEM_ID_CAPS_FIELD: string;
/**
* The 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.
*/
const PROTECTION_UNSPECIFIED_SYSTEM_ID: string;
const QUERY_NUM_SHIFT: number;
/**
* The same thing as #GST_QUERY_TYPE_UPSTREAM | #GST_QUERY_TYPE_DOWNSTREAM.
*/
const QUERY_TYPE_BOTH: QueryTypeFlags;
/**
* Constant that defines one GStreamer second.
*/
const SECOND: ClockTimeDiff;
const SEGMENT_INSTANT_FLAGS: number;
/**
* A value which is guaranteed to never be returned by
* gst_util_seqnum_next().
*
* Can be used as a default value in variables used to store seqnum.
*/
const SEQNUM_INVALID: number;
/**
* album containing this data (string)
*
* The album name as it should be displayed, e.g. 'The Jazz Guitar'
*/
const TAG_ALBUM: string;
/**
* The artist of the entire album, as it should be displayed.
*/
const TAG_ALBUM_ARTIST: string;
/**
* The artist of the entire album, as it should be sorted.
*/
const TAG_ALBUM_ARTIST_SORTNAME: string;
/**
* album gain in db (double)
*/
const TAG_ALBUM_GAIN: string;
/**
* peak of the album (double)
*/
const TAG_ALBUM_PEAK: string;
/**
* album containing this data, as used for sorting (string)
*
* The album name as it should be sorted, e.g. 'Jazz Guitar, The'
*/
const TAG_ALBUM_SORTNAME: string;
/**
* count of discs inside collection this disc belongs to (unsigned integer)
*/
const TAG_ALBUM_VOLUME_COUNT: string;
/**
* disc number inside a collection (unsigned integer)
*/
const TAG_ALBUM_VOLUME_NUMBER: string;
/**
* Arbitrary application data (sample)
*
* Some formats allow applications to add their own arbitrary data
* into files. This data is application dependent.
*/
const TAG_APPLICATION_DATA: string;
/**
* Name of the application used to create the media (string)
*/
const TAG_APPLICATION_NAME: string;
/**
* person(s) responsible for the recording (string)
*
* The artist name as it should be displayed, e.g. 'Jimi Hendrix' or
* 'The Guitar Heroes'
*/
const TAG_ARTIST: string;
/**
* 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'
*/
const TAG_ARTIST_SORTNAME: string;
/**
* generic file attachment (sample) (sample taglist should specify the content
* type and if possible set "filename" to the file name of the
* attachment)
*/
const TAG_ATTACHMENT: string;
/**
* codec the audio data is stored in (string)
*/
const TAG_AUDIO_CODEC: string;
/**
* number of beats per minute in audio (double)
*/
const TAG_BEATS_PER_MINUTE: string;
/**
* exact or average bitrate in bits/s (unsigned integer)
*/
const TAG_BITRATE: string;
/**
* codec the data is stored in (string)
*/
const TAG_CODEC: string;
/**
* free text commenting the data (string)
*/
const TAG_COMMENT: string;
/**
* person(s) who composed the recording (string)
*/
const TAG_COMPOSER: string;
/**
* The composer's name, used for sorting (string)
*/
const TAG_COMPOSER_SORTNAME: string;
/**
* conductor/performer refinement (string)
*/
const TAG_CONDUCTOR: string;
/**
* contact information (string)
*/
const TAG_CONTACT: string;
/**
* container format the data is stored in (string)
*/
const TAG_CONTAINER_FORMAT: string;
/**
* Unique identifier for the audio, video or text track this tag is associated
* with. The mappings for several container formats are defined in the [Sourcing
* In-band Media Resource Tracks from Media Containers into HTML
* specification](https://dev.w3.org/html5/html-sourcing-inband-tracks/).
*/
const TAG_CONTAINER_SPECIFIC_TRACK_ID: string;
/**
* copyright notice of the data (string)
*/
const TAG_COPYRIGHT: string;
/**
* URI to location where copyright details can be found (string)
*/
const TAG_COPYRIGHT_URI: string;
/**
* date the data was created (#GDate structure)
*/
const TAG_DATE: string;
/**
* date and time the data was created (#GstDateTime structure)
*/
const TAG_DATE_TIME: string;
/**
* short text describing the content of the data (string)
*/
const TAG_DESCRIPTION: string;
/**
* Manufacturer of the device used to create the media (string)
*/
const TAG_DEVICE_MANUFACTURER: string;
/**
* Model of the device used to create the media (string)
*/
const TAG_DEVICE_MODEL: string;
/**
* length in GStreamer time units (nanoseconds) (unsigned 64-bit integer)
*/
const TAG_DURATION: string;
/**
* 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
* #GST_TAG_APPLICATION_NAME or #GST_TAG_COMMENT for that.
*/
const TAG_ENCODED_BY: string;
/**
* encoder used to encode this stream (string)
*/
const TAG_ENCODER: string;
/**
* version of the encoder used to encode this stream (unsigned integer)
*/
const TAG_ENCODER_VERSION: string;
/**
* 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.
*/
const TAG_EXTENDED_COMMENT: string;
/**
* genre this data belongs to (string)
*/
const TAG_GENRE: string;
/**
* 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 #GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION
*/
const TAG_GEO_LOCATION_CAPTURE_DIRECTION: string;
/**
* The city (english name) where the media has been produced (string).
*/
const TAG_GEO_LOCATION_CITY: string;
/**
* The country (english name) where the media has been produced (string).
*/
const TAG_GEO_LOCATION_COUNTRY: string;
/**
* geo elevation of where the media has been recorded or produced in meters
* according to WGS84 (zero is average sea level) (double).
*/
const TAG_GEO_LOCATION_ELEVATION: string;
/**
* Represents the expected error on the horizontal positioning in
* meters (double).
*/
const TAG_GEO_LOCATION_HORIZONTAL_ERROR: string;
/**
* 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).
*/
const TAG_GEO_LOCATION_LATITUDE: string;
/**
* 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).
*/
const TAG_GEO_LOCATION_LONGITUDE: string;
/**
* 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 #GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION
*/
const TAG_GEO_LOCATION_MOVEMENT_DIRECTION: string;
/**
* Speed of the capturing device when performing the capture.
* Represented in m/s. (double)
*
* See also #GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION
*/
const TAG_GEO_LOCATION_MOVEMENT_SPEED: string;
/**
* human readable descriptive location of where the media has been recorded or
* produced. (string).
*/
const TAG_GEO_LOCATION_NAME: string;
/**
* A 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.
*/
const TAG_GEO_LOCATION_SUBLOCATION: string;
/**
* Groups together media that are related and spans multiple tracks. An
* example are multiple pieces of a concerto. (string)
*/
const TAG_GROUPING: string;
/**
* Homepage for this media (i.e. artist or movie homepage) (string)
*/
const TAG_HOMEPAGE: string;
/**
* image (sample) (sample taglist should specify the content type and preferably
* also set "image-type" field as `GstTagImageType`)
*/
const TAG_IMAGE: string;
/**
* 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.
*/
const TAG_IMAGE_ORIENTATION: string;
/**
* Information about the people behind a remix and similar
* interpretations of another existing piece (string)
*/
const TAG_INTERPRETED_BY: string;
/**
* International Standard Recording Code - see http://www.ifpi.org/isrc/ (string)
*/
const TAG_ISRC: string;
/**
* comma separated keywords describing the content (string).
*/
const TAG_KEYWORDS: string;
/**
* 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()`
*/
const TAG_LANGUAGE_CODE: string;
/**
* 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.
*/
const TAG_LANGUAGE_NAME: string;
/**
* license of data (string)
*/
const TAG_LICENSE: string;
/**
* URI to location where license details can be found (string)
*/
const TAG_LICENSE_URI: string;
/**
* Origin of media as a URI (location, where the original of the file or stream
* is hosted) (string)
*/
const TAG_LOCATION: string;
/**
* The lyrics of the media (string)
*/
const TAG_LYRICS: string;
/**
* maximum bitrate in bits/s (unsigned integer)
*/
const TAG_MAXIMUM_BITRATE: string;
/**
* [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.
*/
const TAG_MIDI_BASE_NOTE: string;
/**
* minimum bitrate in bits/s (unsigned integer)
*/
const TAG_MINIMUM_BITRATE: string;
/**
* nominal bitrate in bits/s (unsigned integer). The actual bitrate might be
* different from this target bitrate.
*/
const TAG_NOMINAL_BITRATE: string;
/**
* organization (string)
*/
const TAG_ORGANIZATION: string;
/**
* person(s) performing (string)
*/
const TAG_PERFORMER: string;
/**
* image that is meant for preview purposes, e.g. small icon-sized version
* (sample) (sample taglist should specify the content type)
*/
const TAG_PREVIEW_IMAGE: string;
/**
* Any private data that may be contained in tags (sample).
*
* It is represented by #GstSample in which #GstBuffer contains the
* binary data and the sample's info #GstStructure 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.
*/
const TAG_PRIVATE_DATA: string;
/**
* Name of the label or publisher (string)
*/
const TAG_PUBLISHER: string;
/**
* reference level of track and album gain values (double)
*/
const TAG_REFERENCE_LEVEL: string;
/**
* serial number of track (unsigned integer)
*/
const TAG_SERIAL: string;
/**
* Number of the episode within a season/show (unsigned integer)
*/
const TAG_SHOW_EPISODE_NUMBER: string;
/**
* Name of the show, used for displaying (string)
*/
const TAG_SHOW_NAME: string;
/**
* Number of the season of a show/series (unsigned integer)
*/
const TAG_SHOW_SEASON_NUMBER: string;
/**
* Name of the show, used for sorting (string)
*/
const TAG_SHOW_SORTNAME: string;
/**
* codec/format the subtitle data is stored in (string)
*/
const TAG_SUBTITLE_CODEC: string;
/**
* commonly used title (string)
*
* The title as it should be displayed, e.g. 'The Doll House'
*/
const TAG_TITLE: string;
/**
* commonly used title, as used for sorting (string)
*
* The title as it should be sorted, e.g. 'Doll House, The'
*/
const TAG_TITLE_SORTNAME: string;
/**
* count of tracks inside collection this track belongs to (unsigned integer)
*/
const TAG_TRACK_COUNT: string;
/**
* track gain in db (double)
*/
const TAG_TRACK_GAIN: string;
/**
* track number inside a collection (unsigned integer)
*/
const TAG_TRACK_NUMBER: string;
/**
* peak of the track (double)
*/
const TAG_TRACK_PEAK: string;
/**
* 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)
*/
const TAG_USER_RATING: string;
/**
* version of this data (string)
*/
const TAG_VERSION: string;
/**
* codec the video data is stored in (string)
*/
const TAG_VIDEO_CODEC: string;
/**
* Special value for the repeat_count set in gst_toc_entry_set_loop() or
* returned by gst_toc_entry_set_loop() to indicate infinite looping.
*/
const TOC_REPEAT_COUNT_INFINITE: number;
/**
* Value for #GstUri.port to indicate no port number.
*/
const URI_NO_PORT: number;
/**
* Constant that defines one GStreamer microsecond.
*/
const USECOND: ClockTimeDiff;
/**
* Indicates that the first value provided to a comparison function
* (gst_value_compare()) is equal to the second one.
*/
const VALUE_EQUAL: number;
/**
* Indicates that the first value provided to a comparison function
* (gst_value_compare()) is greater than the second one.
*/
const VALUE_GREATER_THAN: number;
/**
* Indicates that the first value provided to a comparison function
* (gst_value_compare()) is lesser than the second one.
*/
const VALUE_LESS_THAN: number;
/**
* Indicates that the comparison function (gst_value_compare()) can not
* determine a order for the two provided values.
*/
const VALUE_UNORDERED: number;
/**
* The major version of GStreamer at compile time:
*/
const VERSION_MAJOR: number;
/**
* The micro version of GStreamer at compile time:
*/
const VERSION_MICRO: number;
/**
* The minor version of GStreamer at compile time:
*/
const VERSION_MINOR: number;
/**
* The nano version of GStreamer at compile time:
* Actual releases have 0, GIT versions have 1, prerelease versions have 2-...
*/
const VERSION_NANO: number;
/**
* 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.
* @returns the maximum amount of memory blocks that a buffer can hold.
*/
function buffer_get_max_memory(): number;
/**
* Modifies a pointer to a #GstBufferList to point to a different
* #GstBufferList. The modification is done atomically (so this is useful for
* ensuring thread safety in some cases), and the reference counts are updated
* appropriately (the old buffer list is unreffed, the new is reffed).
*
* Either `new_list` or the #GstBufferList pointed to by `old_list` may be %NULL.
* @param old_list pointer to a pointer to a #GstBufferList to be replaced.
* @param new_list pointer to a #GstBufferList that will replace the buffer list pointed to by @old_list.
* @returns %TRUE if @new_list was different from @old_list
*/
function buffer_list_replace(
old_list?: BufferList | null,
new_list?: BufferList | null,
): [boolean, BufferList | null];
/**
* Modifies a pointer to a #GstBufferList to point to a different
* #GstBufferList. This function is similar to gst_buffer_list_replace() except
* that it takes ownership of `new_list`.
* @param old_list pointer to a pointer to a #GstBufferList to be replaced.
* @param new_list pointer to a #GstBufferList that will replace the bufferlist pointed to by @old_list.
* @returns %TRUE if @new_list was different from @old_list
*/
function buffer_list_take(old_list: BufferList, new_list?: BufferList | null): [boolean, BufferList];
/**
* Creates a #GstCapsFeatures from a string representation.
* @param features a string representation of a #GstCapsFeatures.
* @returns a new #GstCapsFeatures or %NULL when the string could not be parsed.
*/
function caps_features_from_string(features: string): CapsFeatures | null;
/**
* Converts `caps` from a string representation.
*
* The implementation of serialization up to 1.20 would lead to unexpected results
* when there were nested #GstCaps / #GstStructure deeper than one level.
* @param string a string to convert to #GstCaps
* @returns a newly allocated #GstCaps
*/
function caps_from_string(string: string): Caps | null;
/**
* Modifies a pointer to a #GstContext to point to a different #GstContext. The
* modification is done atomically (so this is useful for ensuring thread safety
* in some cases), and the reference counts are updated appropriately (the old
* context is unreffed, the new one is reffed).
*
* Either `new_context` or the #GstContext pointed to by `old_context` may be %NULL.
* @param old_context pointer to a pointer to a #GstContext to be replaced.
* @param new_context pointer to a #GstContext that will replace the context pointed to by @old_context.
* @returns %TRUE if @new_context was different from @old_context
*/
function context_replace(old_context: Context, new_context?: Context | null): [boolean, Context];
function core_error_quark(): GLib.Quark;
/**
* Adds the logging function to the list of logging functions.
* Be sure to use #G_GNUC_NO_INSTRUMENT on that function, it is needed.
* @param func the function to use
*/
function debug_add_log_function(func: LogFunction): void;
/**
* 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.
* @param max_size_per_thread Maximum size of log per thread in bytes
* @param thread_timeout Timeout for threads in seconds
*/
function debug_add_ring_buffer_logger(max_size_per_thread: number, thread_timeout: number): void;
/**
* 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.
* @param bin the top-level pipeline that should be analyzed
* @param details type of #GstDebugGraphDetails to use
* @returns a string containing the pipeline in graphviz dot format.
*/
function debug_bin_to_dot_data(bin: Bin, details: DebugGraphDetails | null): string;
/**
* 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
* ```
* @param bin the top-level pipeline that should be analyzed
* @param details type of #GstDebugGraphDetails to use
* @param file_name output base filename (e.g. "myplayer")
*/
function debug_bin_to_dot_file(bin: Bin, details: DebugGraphDetails | null, file_name: string): void;
/**
* 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.
* @param bin the top-level pipeline that should be analyzed
* @param details type of #GstDebugGraphDetails to use
* @param file_name output base filename (e.g. "myplayer")
*/
function debug_bin_to_dot_file_with_ts(bin: Bin, details: DebugGraphDetails | null, file_name: string): void;
/**
* Constructs a string that can be used for getting the desired color in color
* terminals.
* You need to free the string after use.
* @param colorinfo the color info
* @returns a string containing the color definition
*/
function debug_construct_term_color(colorinfo: number): string;
/**
* 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.
* @param colorinfo the color info
* @returns an integer containing the color definition
*/
function debug_construct_win_color(colorinfo: number): number;
/**
* 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.
* @returns the list of debug categories
*/
function debug_get_all_categories(): DebugCategory[];
/**
* Changes the coloring mode for debug output.
* @returns see @GstDebugColorMode for possible values.
*/
function debug_get_color_mode(): DebugColorMode;
/**
* Returns the default threshold that is used for new categories.
* @returns the default threshold level
*/
function debug_get_default_threshold(): DebugLevel;
function debug_get_stack_trace(flags: StackTraceFlags | null): string | null;
/**
* Checks if debugging output is activated.
* @returns %TRUE, if debugging is activated
*/
function debug_is_active(): boolean;
/**
* Checks if the debugging output should be colored.
* @returns %TRUE, if the debug output should be colored.
*/
function debug_is_colored(): boolean;
/**
* Get the string representation of a debugging level
* @param level the level to get the name for
* @returns the name
*/
function debug_level_get_name(level: DebugLevel | null): string;
/**
* The default logging handler used by GStreamer. Logging functions get called
* whenever a macro like GST_DEBUG or similar is used. By default this function
* is setup to output the message and additional info to stderr (or the log file
* specified via the GST_DEBUG_FILE environment variable) as received via
* `user_data`.
*
* You can add other handlers by using gst_debug_add_log_function().
* And you can remove this handler by calling
* gst_debug_remove_log_function(gst_debug_log_default);
* @param category category to log
* @param level level of the message
* @param file the file that emitted the message, usually the __FILE__ identifier
* @param _function the function that emitted the message
* @param line the line from that the message was emitted, usually __LINE__
* @param object the object this message relates to, or %NULL if none
* @param message the actual message
* @param user_data the FILE* to log to
*/
function debug_log_default(
category: DebugCategory,
level: DebugLevel | null,
file: string,
_function: string,
line: number,
object: GObject.Object | null,
message: DebugMessage,
user_data?: any | null,
): void;
/**
* Returns the string representation for the specified debug log message
* formatted in the same way as gst_debug_log_default() (the default handler),
* without color. The purpose is to make it easy for custom log output
* handlers to get a log output that is identical to what the default handler
* would write out.
* @param category category to log
* @param level level of the message
* @param file the file that emitted the message, usually the __FILE__ identifier
* @param _function the function that emitted the message
* @param line the line from that the message was emitted, usually __LINE__
* @param object the object this message relates to, or %NULL if none
* @param message the actual message
*/
function debug_log_get_line(
category: DebugCategory,
level: DebugLevel | null,
file: string,
_function: string,
line: number,
object: GObject.Object | null,
message: DebugMessage,
): string;
/**
* Logs the given message using the currently registered debugging handlers.
* @param category category to log
* @param level level of the message is in
* @param file the file that emitted the message, usually the __FILE__ identifier
* @param _function the function that emitted the message
* @param line the line from that the message was emitted, usually __LINE__
* @param id the identifier of the object this message relates to or %NULL if none
* @param message_string a message string
*/
function debug_log_id_literal(
category: DebugCategory,
level: DebugLevel | null,
file: string,
_function: string,
line: number,
id: string | null,
message_string: string,
): void;
/**
* Logs the given message using the currently registered debugging handlers.
* @param category category to log
* @param level level of the message is in
* @param file the file that emitted the message, usually the __FILE__ identifier
* @param _function the function that emitted the message
* @param line the line from that the message was emitted, usually __LINE__
* @param object the object this message relates to, or %NULL if none
* @param message_string a message string
*/
function debug_log_literal(
category: DebugCategory,
level: DebugLevel | null,
file: string,
_function: string,
line: number,
object: GObject.Object | null,
message_string: string,
): void;
/**
* Returns a string that represents `ptr`. This is safe to call with
* %GstStructure, %GstCapsFeatures, %GstMiniObject s (e.g. %GstCaps,
* %GstBuffer or %GstMessage), and %GObjects (e.g. %GstElement or %GstPad).
*
* The string representation is meant to be used for debugging purposes and
* might change between GStreamer versions.
*
* Passing other kind of pointers might or might not work and is generally
* unsafe to do.
* @param ptr the object
* @returns a string containing a string representation of the object
*/
function debug_print_object(ptr?: any | null): string;
/**
* Returns a string that represents `segments`.
*
* The string representation is meant to be used for debugging purposes and
* might change between GStreamer versions.
* @param segment the %GstSegment
* @returns a string containing a string representation of the segment
*/
function debug_print_segment(segment?: Segment | null): string;
/**
* If libunwind, glibc backtrace or DbgHelp are present
* a stack trace is printed.
*/
function debug_print_stack_trace(): void;
/**
* Removes all registered instances of the given logging functions.
* @param func the log function to remove, or %NULL to remove the default log function
* @returns How many instances of the function were removed
*/
function debug_remove_log_function(func?: LogFunction | null): number;
/**
* Removes all registered instances of log functions with the given user data.
* @param data user data of the log function to remove
* @returns How many instances of the function were removed
*/
function debug_remove_log_function_by_data(data?: any | null): number;
/**
* Removes any previously added ring buffer logger with
* gst_debug_add_ring_buffer_logger().
*/
function debug_remove_ring_buffer_logger(): void;
/**
* Fetches the current logs per thread from the ring buffer logger. See
* gst_debug_add_ring_buffer_logger() for details.
* @returns NULL-terminated array of strings with the debug output per thread
*/
function debug_ring_buffer_logger_get_logs(): string[];
/**
* 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.
* @param active Whether to use debugging output or not
*/
function debug_set_active(active: boolean): void;
/**
* Changes the coloring mode for debug output.
*
* This function may be called before gst_init().
* @param mode The coloring mode for debug output. See @GstDebugColorMode.
*/
function debug_set_color_mode(mode: DebugColorMode | null): void;
/**
* Changes the coloring mode for debug output.
*
* This function may be called before gst_init().
* @param mode The coloring mode for debug output. One of the following: "on", "auto", "off", "disable", "unix".
*/
function debug_set_color_mode_from_string(mode: string): void;
/**
* 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().
* @param colored Whether to use colored output or not
*/
function debug_set_colored(colored: boolean): void;
/**
* Sets the default threshold to the given level and updates all categories to
* use this threshold.
*
* This function may be called before gst_init().
* @param level level to set
*/
function debug_set_default_threshold(level: DebugLevel | null): void;
/**
* Sets all categories which match the given glob style pattern to the given
* level.
* @param name name of the categories to set
* @param level level to set them to
*/
function debug_set_threshold_for_name(name: string, level: DebugLevel | null): void;
/**
* 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.
* @param list comma-separated list of "category:level" pairs to be used as debug logging levels
* @param 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.
*/
function debug_set_threshold_from_string(list: string, reset: boolean): void;
/**
* Resets all categories with the given name back to the default level.
* @param name name of the categories to set
*/
function debug_unset_threshold_for_name(name: string): void;
/**
* 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.
*/
function deinit(): void;
/**
* Registers a new #GstDynamicTypeFactory in the registry
* @param plugin The #GstPlugin to register @dyn_type for
* @param type The #GType to register dynamically
*/
function dynamic_type_register(plugin: Plugin, type: GObject.GType): boolean;
/**
* Get a string describing the error message in the current locale.
* @param domain the GStreamer error domain this error belongs to.
* @param code the error code belonging to the domain.
* @returns a newly allocated string describing the error message (in UTF-8 encoding)
*/
function error_get_message(domain: GLib.Quark, code: number): string;
/**
* Gets the #GstEventTypeFlags associated with `type`.
* @param type a #GstEventType
* @returns a #GstEventTypeFlags.
*/
function event_type_get_flags(type: EventType | null): EventTypeFlags;
/**
* Get a printable name for the given event type. Do not modify or free.
* @param type the event type
* @returns a reference to the static name of the event.
*/
function event_type_get_name(type: EventType | null): string;
/**
* Get the unique quark for the given event type.
* @param type the event type
* @returns the quark associated with the event type
*/
function event_type_to_quark(type: EventType | null): GLib.Quark;
/**
* Converts the #GstEventType to an unsigned integer that
* represents the ordering of sticky events when re-sending them.
* A lower value represents a higher-priority event.
* @param type a #GstEventType
* @returns an unsigned integer
*/
function event_type_to_sticky_ordering(type: EventType | null): number;
/**
* 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.
* @param filename absolute or relative file name path
* @returns newly-allocated URI string, or NULL on error. The caller must free the URI string with g_free() when no longer needed.
*/
function filename_to_uri(filename: string): string | null;
/**
* Gets a string representing the given flow return.
* @param ret a #GstFlowReturn to get the name of.
* @returns a static string with the name of the flow return.
*/
function flow_get_name(ret: FlowReturn | null): string;
/**
* Get the unique quark for the given GstFlowReturn.
* @param ret a #GstFlowReturn to get the quark of.
* @returns the quark associated with the flow return or 0 if an invalid return was specified.
*/
function flow_to_quark(ret: FlowReturn | null): GLib.Quark;
/**
* Return the format registered with the given nick.
* @param nick The nick of the format
* @returns The format with @nick or GST_FORMAT_UNDEFINED if the format was not registered.
*/
function format_get_by_nick(nick: string): Format;
/**
* Get details about the given format.
* @param format The format to get details of
* @returns The #GstFormatDefinition for @format or %NULL on failure. MT safe.
*/
function format_get_details(format: Format | null): FormatDefinition | null;
/**
* Get a printable name for the given format. Do not modify or free.
* @param format a #GstFormat
* @returns a reference to the static name of the format or %NULL if the format is unknown.
*/
function format_get_name(format: Format | null): string | null;
/**
* Iterate all the registered formats. The format definition is read
* only.
* @returns a GstIterator of #GstFormatDefinition.
*/
function format_iterate_definitions(): Iterator;
/**
* Create a new GstFormat based on the nick or return an
* already registered format with that nick.
* @param nick The nick of the new format
* @param description The description of the new format
* @returns A new GstFormat or an already registered format with the same nick. MT safe.
*/
function format_register(nick: string, description: string): Format;
/**
* Get the unique quark for the given format.
* @param format a #GstFormat
* @returns the quark associated with the format or 0 if the format is unknown.
*/
function format_to_quark(format: Format | null): GLib.Quark;
/**
* See if the given format is inside the format array.
* @param formats The format array to search
* @param format the format to find
* @returns %TRUE if the format is found inside the array
*/
function formats_contains(formats: Format[] | null, format: Format | null): boolean;
/**
* 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.
* @returns The path of the executable that initialized GStreamer, or %NULL if it could not be determined.
*/
function get_main_executable_path(): string | null;
/**
* Initializes the GStreamer library, setting up internal path lists,
* registering built-in elements, and loading standard plugins.
*
* Unless the plugin registry is disabled at compile time, the registry will be
* loaded. By default this will also check if the registry cache needs to be
* updated and rescan all plugins if needed. See gst_update_registry() for
* details and section
* Running GStreamer Applications
* for how to disable automatic registry updates.
*
* WARNING: This function will terminate your program if it was unable to
* initialize GStreamer for some reason. If you want your program to fall back,
* use gst_init_check() instead.
* @param argv pointer to application's argv
*/
function init(argv?: string[] | null): string[] | null;
/**
* Initializes the GStreamer library, setting up internal path lists,
* registering built-in elements, and loading standard plugins.
*
* This function will return %FALSE if GStreamer could not be initialized
* for some reason. If you want your program to fail fatally,
* use gst_init() instead.
* @param argv pointer to application's argv
* @returns %TRUE if GStreamer could be initialized.
*/
function init_check(argv?: string[] | null): [boolean, string[] | null];
/**
* Checks if `obj` is a #GstCapsFeatures
* @param obj
* @returns %TRUE if @obj is a #GstCapsFeatures %FALSE otherwise
*/
function is_caps_features(obj?: any | null): boolean;
/**
* Use this function to check if GStreamer has been initialized with gst_init()
* or gst_init_check().
* @returns %TRUE if initialization has been done, %FALSE otherwise.
*/
function is_initialized(): boolean;
function library_error_quark(): GLib.Quark;
/**
* Modifies a pointer to a #GstMessage to point to a different #GstMessage. This
* function is similar to gst_message_replace() except that it takes ownership
* of `new_message`.
* @param old_message pointer to a pointer to a #GstMessage to be replaced.
* @param new_message pointer to a #GstMessage that will replace the message pointed to by @old_message.
* @returns %TRUE if @new_message was different from @old_message
*/
function message_take(old_message: Message, new_message?: Message | null): [boolean, Message];
/**
* Get a printable name for the given message type. Do not modify or free.
* @param type the message type
* @returns a reference to the static name of the message.
*/
function message_type_get_name(type: MessageType | null): string;
/**
* Get the unique quark for the given message type.
* @param type the message type
* @returns the quark associated with the message type
*/
function message_type_to_quark(type: MessageType | null): GLib.Quark;
/**
* When a element like `tee` decides the allocation, each downstream element may
* fill different parameters and pass them to gst_query_add_allocation_meta().
* In order to keep these parameters, a merge operation is needed. This
* aggregate function can combine the parameters from `params0` and `param1`, and
* write the result back into `aggregated_params`.
* @param api the GType of the API for which the parameters are being aggregated.
* @param aggregated_params This structure will be updated with the combined parameters from both @params0 and @params1.
* @param params0 a #GstStructure containing the new parameters to be aggregated.
* @param params1 a #GstStructure containing the new parameters to be aggregated.
* @returns %TRUE if the parameters were successfully aggregated, %FALSE otherwise.
*/
function meta_api_type_aggregate_params(
api: GObject.GType,
aggregated_params: Structure,
params0: Structure,
params1: Structure,
): boolean;
function meta_api_type_get_tags(api: GObject.GType): string[];
/**
* Check if `api` was registered with `tag`.
* @param api an API
* @param tag the tag to check
* @returns %TRUE if @api was registered with @tag.
*/
function meta_api_type_has_tag(api: GObject.GType, tag: GLib.Quark): boolean;
/**
* Register and return a GType for the `api` and associate it with
* `tags`.
* @param api an API to register
* @param tags tags for @api
* @returns a unique GType for @api.
*/
function meta_api_type_register(api: string, tags: string[]): GObject.GType;
/**
* This function sets the aggregator function for a specific API type.
* @param api the #GType of the API for which the aggregator function is being set.
* @param aggregator the aggregator function to be associated with the given API type.
*/
function meta_api_type_set_params_aggregator(
api: GObject.GType,
aggregator: AllocationMetaParamsAggregator,
): void;
/**
* Recreate a #GstMeta from serialized data returned by
* gst_meta_serialize() and add it to `buffer`.
*
* Note that the meta must have been previously registered by calling one of
* `gst_*_meta_get_info ()` functions.
*
* `consumed` is set to the number of bytes that can be skipped from `data` to
* find the next meta serialization, if any. In case of parsing error that does
* not allow to determine that size, `consumed` is set to 0.
* @param buffer a #GstBuffer
* @param data serialization data obtained from gst_meta_serialize()
* @param size size of @data
* @returns the metadata owned by @buffer, or %NULL.
*/
function meta_deserialize(buffer: Buffer, data: number, size: number): [Meta | null, number];
/**
* Lookup a previously registered meta info structure by its implementation name
* `impl`.
* @param impl the name
* @returns a #GstMetaInfo with @impl, or %NULL when no such metainfo exists.
*/
function meta_get_info(impl: string): MetaInfo | null;
/**
* Register a new custom #GstMeta implementation, backed by an opaque
* structure holding a #GstStructure.
*
* The registered info can be retrieved later with gst_meta_get_info() by using
* `name` as the key.
*
* The backing #GstStructure 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 #GstStructure
* will always be copied when the transform operation is copy, other operations
* are discarded, copy regions are ignored.
* @param name the name of the #GstMeta implementation
* @param tags tags for @api
* @param transform_func a #GstMetaTransformFunction
* @returns a #GstMetaInfo that can be used to access metadata.
*/
function meta_register_custom(
name: string,
tags: string[],
transform_func?: CustomMetaTransformFunction | null,
): MetaInfo;
/**
* Simplified version of gst_meta_register_custom(), with no tags and no
* transform function.
* @param name the name of the #GstMeta implementation
* @returns a #GstMetaInfo that can be used to access metadata.
*/
function meta_register_custom_simple(name: string): MetaInfo;
/**
* Atomically modifies a pointer to point to a new mini-object.
* The reference count of `olddata` is decreased and the reference count of
* `newdata` is increased.
*
* Either `newdata` and the value pointed to by `olddata` may be %NULL.
* @param olddata pointer to a pointer to a mini-object to be replaced
* @param newdata pointer to new mini-object
* @returns %TRUE if @newdata was different from @olddata
*/
function mini_object_replace(
olddata?: MiniObject | null,
newdata?: MiniObject | null,
): [boolean, MiniObject | null];
/**
* Modifies a pointer to point to a new mini-object. The modification
* is done atomically. This version is similar to gst_mini_object_replace()
* except that it does not increase the refcount of `newdata` and thus
* takes ownership of `newdata`.
*
* Either `newdata` and the value pointed to by `olddata` may be %NULL.
* @param olddata pointer to a pointer to a mini-object to be replaced
* @param newdata pointer to new mini-object
* @returns %TRUE if @newdata was different from @olddata
*/
function mini_object_take(olddata: MiniObject, newdata: MiniObject): [boolean, MiniObject];
/**
* Return the name of a pad mode, for use in debug messages mostly.
* @param mode the pad mode
* @returns short mnemonic for pad mode @mode
*/
function pad_mode_get_name(mode: PadMode | null): string;
/**
* This function creates a GstArray GParamSpec for use by objects/elements
* that want to expose properties of GstArray type. This function is
* typically * used in connection with g_object_class_install_property() in a
* GObjects's instance_init function.
* @param name canonical name of the property specified
* @param nick nick name for the property specified
* @param blurb description of the property specified
* @param element_spec GParamSpec of the array
* @param flags flags for the property specified
* @returns a newly created parameter specification
*/
function param_spec_array(
name: string,
nick: string,
blurb: string,
element_spec: GObject.ParamSpec,
flags: GObject.ParamFlags | null,
): GObject.ParamSpec;
/**
* This function creates a fraction GParamSpec for use by objects/elements
* that want to expose properties of fraction type. This function is typically
* used in connection with g_object_class_install_property() in a GObjects's
* instance_init function.
* @param name canonical name of the property specified
* @param nick nick name for the property specified
* @param blurb description of the property specified
* @param min_num minimum value (fraction numerator)
* @param min_denom minimum value (fraction denominator)
* @param max_num maximum value (fraction numerator)
* @param max_denom maximum value (fraction denominator)
* @param default_num default value (fraction numerator)
* @param default_denom default value (fraction denominator)
* @param flags flags for the property specified
* @returns a newly created parameter specification
*/
function param_spec_fraction(
name: string,
nick: string,
blurb: string,
min_num: number,
min_denom: number,
max_num: number,
max_denom: number,
default_num: number,
default_denom: number,
flags: GObject.ParamFlags | null,
): GObject.ParamSpec | null;
function parent_buffer_meta_api_get_type(): GObject.GType;
/**
* Gets the global #GstMetaInfo describing the #GstParentBufferMeta meta.
* @returns The #GstMetaInfo
*/
function parent_buffer_meta_get_info(): MetaInfo;
/**
* This is a convenience wrapper around gst_parse_launch() to create a
* #GstBin from a gst-launch-style pipeline description. See
* gst_parse_launch() and the gst-launch man page for details about the
* syntax. Ghost pads on the bin for unlinked source or sink pads
* within the bin can automatically be created (but only a maximum of
* one ghost pad for each direction will be created; if you expect
* multiple unlinked source pads or multiple unlinked sink pads
* and want them all ghosted, you will have to create the ghost pads
* yourself).
* @param bin_description command line describing the bin
* @param ghost_unlinked_pads whether to automatically create ghost pads for unlinked source or sink pads within the bin
* @returns a newly-created bin, or %NULL if an error occurred.
*/
function parse_bin_from_description(bin_description: string, ghost_unlinked_pads: boolean): Bin;
/**
* This is a convenience wrapper around gst_parse_launch() to create a
* #GstBin from a gst-launch-style pipeline description. See
* gst_parse_launch() and the gst-launch man page for details about the
* syntax. Ghost pads on the bin for unlinked source or sink pads
* within the bin can automatically be created (but only a maximum of
* one ghost pad for each direction will be created; if you expect
* multiple unlinked source pads or multiple unlinked sink pads
* and want them all ghosted, you will have to create the ghost pads
* yourself).
* @param bin_description command line describing the bin
* @param ghost_unlinked_pads whether to automatically create ghost pads for unlinked source or sink pads within the bin
* @param context a parse context allocated with gst_parse_context_new(), or %NULL
* @param flags parsing options, or #GST_PARSE_FLAG_NONE
* @returns a newly-created element, which is guaranteed to be a bin unless #GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS was passed, or %NULL if an error occurred.
*/
function parse_bin_from_description_full(
bin_description: string,
ghost_unlinked_pads: boolean,
context: ParseContext | null,
flags: ParseFlags | null,
): Element;
/**
* Get the error quark used by the parsing subsystem.
* @returns the quark of the parse errors.
*/
function parse_error_quark(): GLib.Quark;
/**
* 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().
* @param pipeline_description the command line describing the pipeline
* @returns a 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 #GstPipeline, which than is returned.
*/
function parse_launch(pipeline_description: string): Element;
/**
* 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().
* @param pipeline_description the command line describing the pipeline
* @param context a parse context allocated with gst_parse_context_new(), or %NULL
* @param flags parsing options, or #GST_PARSE_FLAG_NONE
* @returns a 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 #GstPipeline, which then is returned (unless the GST_PARSE_FLAG_PLACE_IN_BIN flag is set, in which case they are put in a #GstBin instead).
*/
function parse_launch_full(
pipeline_description: string,
context: ParseContext | null,
flags: ParseFlags | null,
): Element;
/**
* 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.
* @param argv null-terminated array of arguments
* @returns a new element on success and %NULL on failure.
*/
function parse_launchv(argv: string[]): Element;
/**
* 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.
* @param argv null-terminated array of arguments
* @param context a parse context allocated with gst_parse_context_new(), or %NULL
* @param flags parsing options, or #GST_PARSE_FLAG_NONE
* @returns a 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 #GST_PARSE_FLAG_FATAL_ERRORS in @flags, then %NULL will always be returned on failure)
*/
function parse_launchv_full(argv: string[], context: ParseContext | null, flags: ParseFlags | null): Element;
/**
* Get the error quark.
* @returns The error quark used in GError messages
*/
function plugin_error_quark(): GLib.Quark;
/**
* Gets the directory for application specific presets if set by the
* application.
* @returns the directory or %NULL, don't free or modify the string
*/
function preset_get_app_dir(): string | null;
/**
* 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.
* @param app_dir the application specific preset dir
* @returns %TRUE for success, %FALSE if the dir already has been set
*/
function preset_set_app_dir(app_dir: string): boolean;
/**
* Iterates the supplied list of UUIDs and checks the GstRegistry for
* all the decryptors supporting one of the supplied UUIDs.
* @param system_identifiers A null terminated array of strings that contains the UUID values of each protection system that is to be checked.
* @returns A null terminated array containing all the @system_identifiers supported by the set of available decryptors, or %NULL if no matches were found.
*/
function protection_filter_systems_by_available_decryptors(system_identifiers: string[]): string[] | null;
function protection_meta_api_get_type(): GObject.GType;
function protection_meta_get_info(): MetaInfo;
/**
* 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.
* @param system_identifiers A null terminated array of strings that contains the UUID values of each protection system that is to be checked.
* @returns 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.
*/
function protection_select_system(system_identifiers: string[]): string | null;
/**
* Modifies a pointer to a #GstQuery to point to a different #GstQuery. This
* function is similar to gst_query_replace() except that it takes ownership of
* `new_query`.
*
* Either `new_query` or the #GstQuery pointed to by `old_query` may be %NULL.
* @param old_query pointer to a pointer to a #GstQuery to be stolen.
* @param new_query pointer to a #GstQuery that will replace the query pointed to by @old_query.
* @returns %TRUE if @new_query was different from @old_query
*/
function query_take(old_query?: Query | null, new_query?: Query | null): [boolean, Query | null];
/**
* Gets the #GstQueryTypeFlags associated with `type`.
* @param type a #GstQueryType
* @returns a #GstQueryTypeFlags.
*/
function query_type_get_flags(type: QueryType | null): QueryTypeFlags;
/**
* Get a printable name for the given query type. Do not modify or free.
* @param type the query type
* @returns a reference to the static name of the query.
*/
function query_type_get_name(type: QueryType | null): string;
/**
* Get the unique quark for the given query type.
* @param type the query type
* @returns the quark associated with the query type
*/
function query_type_to_quark(type: QueryType | null): GLib.Quark;
function reference_timestamp_meta_api_get_type(): GObject.GType;
/**
* Gets the global #GstMetaInfo describing the #GstReferenceTimestampMeta meta.
* @returns The #GstMetaInfo
*/
function reference_timestamp_meta_get_info(): MetaInfo;
function resource_error_quark(): GLib.Quark;
/**
* 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.
* @returns %TRUE if GStreamer is allowed to install a custom SIGSEGV handler.
*/
function segtrap_is_enabled(): boolean;
/**
* Applications might want to disable/enable the SIGSEGV handling of
* the GStreamer core. See gst_segtrap_is_enabled() for more information.
* @param enabled whether a custom SIGSEGV handler should be installed.
*/
function segtrap_set_enabled(enabled: boolean): void;
/**
* Gets a string representing the given state transition.
* @param transition a #GstStateChange to get the name of.
* @returns a string with the name of the state result.
*/
function state_change_get_name(transition: StateChange | null): string;
function stream_error_quark(): GLib.Quark;
/**
* Get a descriptive string for a given #GstStreamType
* @param stype a #GstStreamType
* @returns A string describing the stream type
*/
function stream_type_get_name(stype: StreamType | null): string;
/**
* Atomically modifies a pointer to point to a new structure.
* The #GstStructure `oldstr_ptr` is pointing to is freed and
* `newstr` is taken ownership over.
*
* Either `newstr` and the value pointed to by `oldstr_ptr` may be %NULL.
*
* It is a programming error if both `newstr` and the value pointed to by
* `oldstr_ptr` refer to the same, non-%NULL structure.
* @param oldstr_ptr pointer to a place of a #GstStructure to take
* @param newstr a new #GstStructure
* @returns %TRUE if @newstr was different from @oldstr_ptr
*/
function structure_take(oldstr_ptr?: Structure | null, newstr?: Structure | null): [boolean, Structure | null];
/**
* Checks if the given type is already registered.
* @param tag name of the tag
* @returns %TRUE if the type is already registered
*/
function tag_exists(tag: string): boolean;
/**
* Returns the human-readable description of this tag, You must not change or
* free this string.
* @param tag the tag
* @returns the human-readable description of this tag
*/
function tag_get_description(tag: string): string;
/**
* Gets the flag of `tag`.
* @param tag the tag
* @returns the flag of this tag.
*/
function tag_get_flag(tag: string): TagFlag;
/**
* Returns the human-readable name of this tag, You must not change or free
* this string.
* @param tag the tag
* @returns the human-readable name of this tag
*/
function tag_get_nick(tag: string): string;
/**
* Gets the #GType used for this tag.
* @param tag the tag
* @returns the #GType of this tag
*/
function tag_get_type(tag: string): GObject.GType;
/**
* Checks if the given tag is fixed. A fixed tag can only contain one value.
* Unfixed tags can contain lists of values.
* @param tag tag to check
* @returns %TRUE, if the given tag is fixed.
*/
function tag_is_fixed(tag: string): boolean;
/**
* Copies the contents for the given tag into the value,
* merging multiple values into one if multiple values are associated
* with the tag.
* You must g_value_unset() the value after use.
* @param list list to get the tag from
* @param tag tag to read out
* @returns %TRUE, if a value was copied, %FALSE if the tag didn't exist in the given list.
*/
function tag_list_copy_value(list: TagList, tag: string): [boolean, unknown];
/**
* Modifies a pointer to a #GstTagList to point to a different #GstTagList. The
* modification is done atomically (so this is useful for ensuring thread
* safety in some cases), and the reference counts are updated appropriately
* (the old tag list is unreffed, the new is reffed).
*
* Either `new_taglist` or the #GstTagList pointed to by `old_taglist` may be
* %NULL.
* @param old_taglist pointer to a pointer to a #GstTagList to be replaced.
* @param new_taglist pointer to a #GstTagList that will replace the tag list pointed to by @old_taglist.
* @returns %TRUE if @new_taglist was different from @old_taglist
*/
function tag_list_replace(
old_taglist?: TagList | null,
new_taglist?: TagList | null,
): [boolean, TagList | null];
/**
* Modifies a pointer to a #GstTagList to point to a different #GstTagList.
* This function is similar to gst_tag_list_replace() except that it takes
* ownership of `new_taglist`.
* @param old_taglist pointer to a pointer to a #GstTagList to be replaced.
* @param new_taglist pointer to a #GstTagList that will replace the taglist pointed to by @old_taglist.
* @returns %TRUE if @new_taglist was different from @old_taglist
*/
function tag_list_take(old_taglist: TagList, new_taglist?: TagList | null): [boolean, TagList];
/**
* This is a convenience function for the func argument of gst_tag_register().
* It concatenates all given strings using a comma. The tag must be registered
* as a G_TYPE_STRING or this function will fail.
* @param src GValue to copy from
*/
function tag_merge_strings_with_comma(src: GObject.Value | any): unknown;
/**
* This is a convenience function for the func argument of gst_tag_register().
* It creates a copy of the first value from the list.
* @param src GValue to copy from
*/
function tag_merge_use_first(src: GObject.Value | any): unknown;
/**
* Converts `type` to a string representation.
* @param type a #GstTocEntryType.
* @returns Returns a human-readable string for @type. This string is only for debugging purpose and should not be displayed in a user interface.
*/
function toc_entry_type_get_nick(type: TocEntryType | null): string;
/**
* 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.
* @returns A #GList of #GstTracer objects
*/
function tracing_get_active_tracers(): Tracer[];
/**
* Register `func` to be called when the trace hook `detail` is getting invoked.
* Use %NULL for `detail` to register to all hooks.
* @param tracer the tracer
* @param detail the detailed hook
* @param func the callback
*/
function tracing_register_hook(tracer: Tracer, detail: string, func: GObject.Callback): void;
/**
* 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.
* @param plugin A #GstPlugin, or %NULL for a static typefind function
* @param name The name for registering
* @param rank The rank (or importance) of this typefind function
* @param func The #GstTypeFindFunction to use
* @param extensions Optional comma-separated list of extensions that could belong to this type
* @param possible_caps Optionally the caps that could be returned when typefinding succeeds
* @returns %TRUE on success, %FALSE otherwise
*/
function type_find_register(
plugin: Plugin | null,
name: string,
rank: number,
func: TypeFindFunction,
extensions?: string | null,
possible_caps?: Caps | null,
): boolean;
/**
* Checks if `type` is plugin API. See gst_type_mark_as_plugin_api() for
* details.
* @param type a GType
* @returns %TRUE if @type is plugin API or %FALSE otherwise.
*/
function type_is_plugin_api(type: GObject.GType): [boolean, PluginAPIFlags | null];
/**
* 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.
* @param type a GType
* @param flags a set of #GstPluginAPIFlags to further inform cache generation.
*/
function type_mark_as_plugin_api(type: GObject.GType, flags: PluginAPIFlags | null): void;
/**
* 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.
* @returns %TRUE if the registry has been updated successfully (does not imply that there were changes), otherwise %FALSE.
*/
function update_registry(): boolean;
/**
* Constructs a URI for a given valid protocol and location.
*
* Free-function: g_free
* @param protocol Protocol for URI
* @param location Location for URI
* @returns a new string for this URI.
*/
function uri_construct(protocol: string, location: string): string;
function uri_error_quark(): GLib.Quark;
/**
* Parses a URI string into a new #GstUri object. Will return NULL if the URI
* cannot be parsed.
* @param uri The URI string to parse.
* @returns A new #GstUri object, or NULL.
*/
function uri_from_string(uri: string): Uri | null;
/**
* Parses a URI string into a new #GstUri 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:password`example`.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 '#'.
* @param uri The URI string to parse.
* @returns A new #GstUri object, or NULL.
*/
function uri_from_string_escaped(uri: string): Uri | null;
/**
* 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
* @param uri A URI string
* @returns the 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.
*/
function uri_get_location(uri: string): string | null;
/**
* Extracts the protocol out of a given valid URI. The returned string must be
* freed using g_free().
* @param uri A URI string
* @returns The protocol for this URI.
*/
function uri_get_protocol(uri: string): string | null;
/**
* Checks if the protocol of a given valid URI matches `protocol`.
* @param uri a URI string
* @param protocol a protocol string (e.g. "http")
* @returns %TRUE if the protocol matches.
*/
function uri_has_protocol(uri: string, protocol: string): boolean;
/**
* 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.
* @param uri A URI string
* @returns %TRUE if the string is a valid URI
*/
function uri_is_valid(uri: string): boolean;
/**
* This is a convenience function to join two URI strings and return the result.
* The returned string should be g_free()'d after use.
* @param base_uri The percent-encoded base URI.
* @param ref_uri The percent-encoded reference URI to join to the @base_uri.
* @returns A string representing the percent-encoded join of the two URIs.
*/
function uri_join_strings(base_uri: string, ref_uri: string): string | null;
/**
* 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.
* @param type Whether to check for a source or a sink
* @param protocol Protocol that should be checked for (e.g. "http" or "smb")
* @returns %TRUE
*/
function uri_protocol_is_supported(type: URIType | null, protocol: string): boolean;
/**
* 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.
* @param protocol A string
* @returns %TRUE if the string is a valid protocol identifier, %FALSE otherwise.
*/
function uri_protocol_is_valid(protocol: string): boolean;
/**
* 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)).
* @param array the sorted input array
* @param num_elements number of elements in the array
* @param element_size size of every element in bytes
* @param search_func function to compare two elements, @search_data will always be passed as second argument
* @param mode search mode that should be used
* @param search_data element that should be found
* @returns The address of the found element or %NULL if nothing was found
*/
function util_array_binary_search(
array: any | null,
num_elements: number,
element_size: number,
search_func: GLib.CompareDataFunc,
mode: SearchMode | null,
search_data?: any | null,
): any | null;
/**
* Returns smallest integral value not less than log2(v).
* @param v a #guint32 value.
* @returns a computed #guint val.
*/
function util_ceil_log2(v: number): number;
/**
* Transforms a #gdouble to a fraction and simplifies
* the result.
* @param src #gdouble to transform
*/
function util_double_to_fraction(src: number): [number, number];
/**
* Dumps the buffer memory into a hex representation. Useful for debugging.
* @param buf a #GstBuffer whose memory to dump
*/
function util_dump_buffer(buf: Buffer): void;
/**
* Dumps the memory block into a hex representation. Useful for debugging.
* @param mem a pointer to the memory to dump
*/
function util_dump_mem(mem: Uint8Array | string): void;
/**
* Compares the given filenames using natural ordering.
* @param a a filename to compare with @b
* @param b a filename to compare with @a
*/
function util_filename_compare(a: string, b: string): number;
/**
* Returns smallest integral value not bigger than log2(v).
* @param v a #guint32 value.
* @returns a computed #guint val.
*/
function util_floor_log2(v: number): number;
/**
* Adds the fractions `a_n/``a_d` and `b_n/``b_d` and stores
* the result in `res_n` and `res_d`.
* @param a_n Numerator of first value
* @param a_d Denominator of first value
* @param b_n Numerator of second value
* @param b_d Denominator of second value
* @returns %FALSE on overflow, %TRUE otherwise.
*/
function util_fraction_add(a_n: number, a_d: number, b_n: number, b_d: number): [boolean, number, number];
/**
* 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.
* @param a_n Numerator of first value
* @param a_d Denominator of first value
* @param b_n Numerator of second value
* @param b_d Denominator of second value
* @returns -1 if a < b; 0 if a = b; 1 if a > b.
*/
function util_fraction_compare(a_n: number, a_d: number, b_n: number, b_d: number): number;
/**
* Multiplies the fractions `a_n/``a_d` and `b_n/``b_d` and stores
* the result in `res_n` and `res_d`.
* @param a_n Numerator of first value
* @param a_d Denominator of first value
* @param b_n Numerator of second value
* @param b_d Denominator of second value
* @returns %FALSE on overflow, %TRUE otherwise.
*/
function util_fraction_multiply(a_n: number, a_d: number, b_n: number, b_d: number): [boolean, number, number];
/**
* Multiplies the fractions `a_n/``a_d` and `b_n/``b_d` and stores
* the result in `res_n` and `res_d`.
* @param a_n Numerator of first value
* @param a_d Denominator of first value
* @param b_n Numerator of second value
* @param b_d Denominator of second value
* @returns %FALSE on overflow, %TRUE otherwise.
*/
function util_fraction_multiply_int64(
a_n: number,
a_d: number,
b_n: number,
b_d: number,
): [boolean, number, number];
/**
* Transforms a fraction to a #gdouble.
* @param src_n Fraction numerator as #gint
* @param src_d Fraction denominator #gint
*/
function util_fraction_to_double(src_n: number, src_d: number): number;
function util_gdouble_to_guint64(value: number): number;
/**
* Get a property of type %GST_TYPE_ARRAY and transform it into a
* #GValueArray. This allow language bindings to get GST_TYPE_ARRAY
* properties which are otherwise not an accessible type.
* @param object the object to set the array to
* @param name the name of the property to set
*/
function util_get_object_array(object: GObject.Object, name: string): [boolean, GObject.ValueArray];
/**
* Get a timestamp as GstClockTime to be used for interval measurements.
* The timestamp should not be interpreted in any other way.
* @returns the timestamp
*/
function util_get_timestamp(): ClockTime;
/**
* Calculates the greatest common divisor of `a`
* and `b`.
* @param a First value as #gint
* @param b Second value as #gint
* @returns Greatest common divisor of @a and @b
*/
function util_greatest_common_divisor(a: number, b: number): number;
/**
* Calculates the greatest common divisor of `a`
* and `b`.
* @param a First value as #gint64
* @param b Second value as #gint64
* @returns Greatest common divisor of @a and @b
*/
function util_greatest_common_divisor_int64(a: number, b: number): number;
/**
* 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)
* @returns A constantly incrementing unsigned integer, which might overflow back to 0 at some point.
*/
function util_group_id_next(): number;
function util_guint64_to_gdouble(value: number): number;
/**
* Compare two sequence numbers, handling wraparound.
*
* The current implementation just returns (gint32)(`s1` - `s2`).
* @param s1 A sequence number.
* @param s2 Another sequence number.
* @returns A negative number if @s1 is before @s2, 0 if they are equal, or a positive number if @s1 is after @s2.
*/
function util_seqnum_compare(s1: number, s2: number): number;
/**
* 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).
* @returns A constantly incrementing 32-bit unsigned integer, which might overflow at some point. Use gst_util_seqnum_compare() to make sure you handle wraparound correctly.
*/
function util_seqnum_next(): number;
/**
* 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.
* @param object the object to set the argument of
* @param name the name of the argument to set
* @param value the string value to set
*/
function util_set_object_arg(object: GObject.Object, name: string, value: string): void;
/**
* Transfer a #GValueArray to %GST_TYPE_ARRAY and set this value on the
* specified property name. This allow language bindings to set GST_TYPE_ARRAY
* properties which are otherwise not an accessible type.
* @param object the object to set the array to
* @param name the name of the property to set
* @param array a #GValueArray containing the values
*/
function util_set_object_array(object: GObject.Object, name: string, array: GObject.ValueArray): boolean;
/**
* 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.
* @param value_str the string to get the value from
*/
function util_set_value_from_string(value_str: string): unknown;
/**
* Calculates the simpler representation of `numerator` and `denominator` and
* update both values with the resulting simplified fraction.
*
* Simplify a fraction using a simple continued fraction decomposition.
* The idea here is to convert fractions such as 333333/10000000 to 1/30
* using 32 bit arithmetic only. The algorithm is not perfect and relies
* upon two arbitrary parameters to remove non-significative terms from
* the simple continued fraction decomposition. Using 8 and 333 for
* `n_terms` and `threshold` respectively seems to give nice results.
* @param numerator First value as #gint
* @param denominator Second value as #gint
* @param n_terms non-significative terms (typical value: 8)
* @param threshold threshold (typical value: 333)
*/
function util_simplify_fraction(
numerator: number,
denominator: number,
n_terms: number,
threshold: number,
): void;
/**
* 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.
* @param val the number to scale
* @param num the numerator of the scale ratio
* @param denom the denominator of the scale ratio
* @returns @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().
*/
function util_uint64_scale(val: number, num: number, denom: number): number;
/**
* 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.
* @param val the number to scale
* @param num the numerator of the scale ratio
* @param denom the denominator of the scale ratio
* @returns @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().
*/
function util_uint64_scale_ceil(val: number, num: number, denom: number): number;
/**
* 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.
* @param val guint64 (such as a #GstClockTime) to scale.
* @param num numerator of the scale factor.
* @param denom denominator of the scale factor.
* @returns @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().
*/
function util_uint64_scale_int(val: number, num: number, denom: number): number;
/**
* 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.
* @param val guint64 (such as a #GstClockTime) to scale.
* @param num numerator of the scale factor.
* @param denom denominator of the scale factor.
* @returns @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().
*/
function util_uint64_scale_int_ceil(val: number, num: number, denom: number): number;
/**
* 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.
* @param val guint64 (such as a #GstClockTime) to scale.
* @param num numerator of the scale factor.
* @param denom denominator of the scale factor.
* @returns @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().
*/
function util_uint64_scale_int_round(val: number, num: number, denom: number): number;
/**
* 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.
* @param val the number to scale
* @param num the numerator of the scale ratio
* @param denom the denominator of the scale ratio
* @returns @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().
*/
function util_uint64_scale_round(val: number, num: number, denom: number): number;
/**
* Determines if `value1` and `value2` can be compared.
* @param value1 a value to compare
* @param value2 another value to compare
* @returns %TRUE if the values can be compared
*/
function value_can_compare(value1: GObject.Value | any, value2: GObject.Value | any): boolean;
/**
* Determines if intersecting two values will produce a valid result.
* Two values will produce a valid intersection if they have the same
* type.
* @param value1 a value to intersect
* @param value2 another value to intersect
* @returns %TRUE if the values can intersect
*/
function value_can_intersect(value1: GObject.Value | any, value2: GObject.Value | any): boolean;
/**
* Checks if it's possible to subtract `subtrahend` from `minuend`.
* @param minuend the value to subtract from
* @param subtrahend the value to subtract
* @returns %TRUE if a subtraction is possible
*/
function value_can_subtract(minuend: GObject.Value | any, subtrahend: GObject.Value | any): boolean;
/**
* 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.
* @param value1 a value to union
* @param value2 another value to union
* @returns %TRUE if there is a function allowing the two values to be unioned.
*/
function value_can_union(value1: GObject.Value | any, value2: GObject.Value | any): boolean;
/**
* 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.
* @param value1 a value to compare
* @param value2 another value to compare
* @returns comparison result
*/
function value_compare(value1: GObject.Value | any, value2: GObject.Value | any): number;
/**
* Tries to deserialize a string into the type specified by the given GValue.
* If the operation succeeds, %TRUE is returned, %FALSE otherwise.
* @param src string to deserialize
* @returns %TRUE on success
*/
function value_deserialize(src: string): [boolean, unknown];
/**
* Tries to deserialize a string into the type specified by the given GValue.
* `pspec` may be used to guide the deserializing of nested members.
* If the operation succeeds, %TRUE is returned, %FALSE otherwise.
* @param src string to deserialize
* @param pspec the #GParamSpec describing the expected value
* @returns %TRUE on success
*/
function value_deserialize_with_pspec(src: string, pspec?: GObject.ParamSpec | null): [boolean, unknown];
/**
* 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.
* @param dest the #GValue destination
* @param src the #GValue to fixate
* @returns %TRUE if @dest contains a fixated version of @src.
*/
function value_fixate(dest: GObject.Value | any, src: GObject.Value | any): boolean;
/**
* Multiplies the two #GValue items containing a #GST_TYPE_FRACTION and sets
* `product` to the product of the two fractions.
* @param product a GValue initialized to #GST_TYPE_FRACTION
* @param factor1 a GValue initialized to #GST_TYPE_FRACTION
* @param factor2 a GValue initialized to #GST_TYPE_FRACTION
* @returns %FALSE in case of an error (like integer overflow), %TRUE otherwise.
*/
function value_fraction_multiply(
product: GObject.Value | any,
factor1: GObject.Value | any,
factor2: GObject.Value | any,
): boolean;
/**
* Subtracts the `subtrahend` from the `minuend` and sets `dest` to the result.
* @param dest a GValue initialized to #GST_TYPE_FRACTION
* @param minuend a GValue initialized to #GST_TYPE_FRACTION
* @param subtrahend a GValue initialized to #GST_TYPE_FRACTION
* @returns %FALSE in case of an error (like integer overflow), %TRUE otherwise.
*/
function value_fraction_subtract(
dest: GObject.Value | any,
minuend: GObject.Value | any,
subtrahend: GObject.Value | any,
): boolean;
/**
* Gets the bitmask specified by `value`.
* @param value a GValue initialized to #GST_TYPE_BITMASK
* @returns the bitmask.
*/
function value_get_bitmask(value: GObject.Value | any): number;
/**
* Gets the contents of `value`. The reference count of the returned
* #GstCaps will not be modified, therefore the caller must take one
* before getting rid of the `value`.
* @param value a GValue initialized to GST_TYPE_CAPS
* @returns the contents of @value
*/
function value_get_caps(value: GObject.Value | any): Caps;
/**
* Gets the contents of `value`.
* @param value a GValue initialized to GST_TYPE_CAPS_FEATURES
* @returns the contents of @value
*/
function value_get_caps_features(value: GObject.Value | any): CapsFeatures;
/**
* Gets the maximum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_DOUBLE_RANGE
* @returns the maximum of the range
*/
function value_get_double_range_max(value: GObject.Value | any): number;
/**
* Gets the minimum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_DOUBLE_RANGE
* @returns the minimum of the range
*/
function value_get_double_range_min(value: GObject.Value | any): number;
/**
* Retrieve the flags field of a GstFlagSet `value`.
* @param value a GValue initialized to #GST_TYPE_FLAG_SET
* @returns the flags field of the flagset instance.
*/
function value_get_flagset_flags(value: GObject.Value | any): number;
/**
* Retrieve the mask field of a GstFlagSet `value`.
* @param value a GValue initialized to #GST_TYPE_FLAG_SET
* @returns the mask field of the flagset instance.
*/
function value_get_flagset_mask(value: GObject.Value | any): number;
/**
* Gets the denominator of the fraction specified by `value`.
* @param value a GValue initialized to #GST_TYPE_FRACTION
* @returns the denominator of the fraction.
*/
function value_get_fraction_denominator(value: GObject.Value | any): number;
/**
* Gets the numerator of the fraction specified by `value`.
* @param value a GValue initialized to #GST_TYPE_FRACTION
* @returns the numerator of the fraction.
*/
function value_get_fraction_numerator(value: GObject.Value | any): number;
/**
* Gets the maximum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_FRACTION_RANGE
* @returns the maximum of the range
*/
function value_get_fraction_range_max(value: GObject.Value | any): GObject.Value | null;
/**
* Gets the minimum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_FRACTION_RANGE
* @returns the minimum of the range
*/
function value_get_fraction_range_min(value: GObject.Value | any): GObject.Value | null;
/**
* Gets the maximum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT64_RANGE
* @returns the maximum of the range
*/
function value_get_int64_range_max(value: GObject.Value | any): number;
/**
* Gets the minimum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT64_RANGE
* @returns the minimum of the range
*/
function value_get_int64_range_min(value: GObject.Value | any): number;
/**
* Gets the step of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT64_RANGE
* @returns the step of the range
*/
function value_get_int64_range_step(value: GObject.Value | any): number;
/**
* Gets the maximum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT_RANGE
* @returns the maximum of the range
*/
function value_get_int_range_max(value: GObject.Value | any): number;
/**
* Gets the minimum of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT_RANGE
* @returns the minimum of the range
*/
function value_get_int_range_min(value: GObject.Value | any): number;
/**
* Gets the step of the range specified by `value`.
* @param value a GValue initialized to GST_TYPE_INT_RANGE
* @returns the step of the range
*/
function value_get_int_range_step(value: GObject.Value | any): number;
/**
* Gets the contents of `value`.
* @param value a GValue initialized to GST_TYPE_STRUCTURE
* @returns the contents of @value
*/
function value_get_structure(value: GObject.Value | any): Structure;
/**
* Initialises the target value to be of the same type as source and then copies
* the contents from source to target.
* @param src the source value
*/
function value_init_and_copy(src: GObject.Value | any): unknown;
/**
* 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.
* @param value1 a value to intersect
* @param value2 another value to intersect
* @returns %TRUE if the intersection is non-empty
*/
function value_intersect(
value1: GObject.Value | any,
value2: GObject.Value | any,
): [boolean, GObject.Value | null];
/**
* 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.
* @param value the #GValue to check
* @returns true if the value is "fixed".
*/
function value_is_fixed(value: GObject.Value | any): boolean;
/**
* Check that `value1` is a subset of `value2`.
* @param value1 a #GValue
* @param value2 a #GValue
* @returns %TRUE is @value1 is a subset of @value2
*/
function value_is_subset(value1: GObject.Value | any, value2: GObject.Value | any): boolean;
/**
* Registers functions to perform calculations on #GValue items of a given
* type. Each type can only be added once.
* @param table structure containing functions to register
*/
function value_register(table: ValueTable): void;
/**
* 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
* @param value a #GValue to serialize
* @returns the serialization for @value or %NULL if none exists
*/
function value_serialize(value: GObject.Value | any): string | null;
/**
* Sets `value` to the bitmask specified by `bitmask`.
* @param value a GValue initialized to #GST_TYPE_BITMASK
* @param bitmask the bitmask
*/
function value_set_bitmask(value: GObject.Value | any, bitmask: number): void;
/**
* Sets the contents of `value` to `caps`. A reference to the
* provided `caps` will be taken by the `value`.
* @param value a GValue initialized to GST_TYPE_CAPS
* @param caps the caps to set the value to
*/
function value_set_caps(value: GObject.Value | any, caps: Caps): void;
/**
* Sets the contents of `value` to `features`.
* @param value a GValue initialized to GST_TYPE_CAPS_FEATURES
* @param features the features to set the value to
*/
function value_set_caps_features(value: GObject.Value | any, features: CapsFeatures): void;
/**
* Sets `value` to the range specified by `start` and `end`.
* @param value a GValue initialized to GST_TYPE_DOUBLE_RANGE
* @param start the start of the range
* @param end the end of the range
*/
function value_set_double_range(value: GObject.Value | any, start: number, end: number): void;
/**
* 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"
* @param value a GValue initialized to %GST_TYPE_FLAG_SET
* @param flags The value of the flags set or unset
* @param mask The mask indicate which flags bits must match for comparisons
*/
function value_set_flagset(value: GObject.Value | any, flags: number, mask: number): void;
/**
* 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.
* @param value a GValue initialized to #GST_TYPE_FRACTION
* @param numerator the numerator of the fraction
* @param denominator the denominator of the fraction
*/
function value_set_fraction(value: GObject.Value | any, numerator: number, denominator: number): void;
/**
* Sets `value` to the range specified by `start` and `end`.
* @param value a GValue initialized to GST_TYPE_FRACTION_RANGE
* @param start the start of the range (a GST_TYPE_FRACTION GValue)
* @param end the end of the range (a GST_TYPE_FRACTION GValue)
*/
function value_set_fraction_range(
value: GObject.Value | any,
start: GObject.Value | any,
end: GObject.Value | any,
): void;
/**
* Sets `value` to the range specified by `numerator_start/``denominator_start`
* and `numerator_end/``denominator_end`.
* @param value a GValue initialized to GST_TYPE_FRACTION_RANGE
* @param numerator_start the numerator start of the range
* @param denominator_start the denominator start of the range
* @param numerator_end the numerator end of the range
* @param denominator_end the denominator end of the range
*/
function value_set_fraction_range_full(
value: GObject.Value | any,
numerator_start: number,
denominator_start: number,
numerator_end: number,
denominator_end: number,
): void;
/**
* Sets `value` to the range specified by `start` and `end`.
* @param value a GValue initialized to GST_TYPE_INT64_RANGE
* @param start the start of the range
* @param end the end of the range
*/
function value_set_int64_range(value: GObject.Value | any, start: number, end: number): void;
/**
* Sets `value` to the range specified by `start,` `end` and `step`.
* @param value a GValue initialized to GST_TYPE_INT64_RANGE
* @param start the start of the range
* @param end the end of the range
* @param step the step of the range
*/
function value_set_int64_range_step(value: GObject.Value | any, start: number, end: number, step: number): void;
/**
* Sets `value` to the range specified by `start` and `end`.
* @param value a GValue initialized to GST_TYPE_INT_RANGE
* @param start the start of the range
* @param end the end of the range
*/
function value_set_int_range(value: GObject.Value | any, start: number, end: number): void;
/**
* Sets `value` to the range specified by `start,` `end` and `step`.
* @param value a GValue initialized to GST_TYPE_INT_RANGE
* @param start the start of the range
* @param end the end of the range
* @param step the step of the range
*/
function value_set_int_range_step(value: GObject.Value | any, start: number, end: number, step: number): void;
/**
* Sets the contents of `value` to `structure`.
* @param value a GValue initialized to GST_TYPE_STRUCTURE
* @param structure the structure to set the value to
*/
function value_set_structure(value: GObject.Value | any, structure: Structure): void;
/**
* Subtracts `subtrahend` from `minuend` and stores the result in `dest`.
* Note that this means subtraction as in sets, not as in mathematics.
* @param minuend the value to subtract from
* @param subtrahend the value to subtract
* @returns %TRUE if the subtraction is not empty
*/
function value_subtract(
minuend: GObject.Value | any,
subtrahend: GObject.Value | any,
): [boolean, GObject.Value | null];
/**
* Creates a GValue corresponding to the union of `value1` and `value2`.
* @param value1 a value to union
* @param value2 another value to union
* @returns %TRUE if the union succeeded.
*/
function value_union(value1: GObject.Value | any, value2: GObject.Value | any): [boolean, unknown];
/**
* Gets the version number of the GStreamer library.
*/
function version(): [number, number, number, number];
/**
* This function returns a string that is useful for describing this version
* of GStreamer to the outside world: user agent strings, logging, ...
* @returns a newly allocated string describing this version of GStreamer.
*/
function version_string(): string;
interface AllocationMetaParamsAggregator {
(aggregated_params: Structure, params0: Structure, params1: Structure): boolean;
}
interface BufferForeachMetaFunc {
(buffer: Buffer): boolean;
}
interface BufferListFunc {
(idx: number): boolean;
}
interface BusFunc {
(bus: Bus, message: Message): boolean;
}
interface BusSyncHandler {
(bus: Bus, message: Message): BusSyncReply;
}
interface CapsFilterMapFunc {
(features: CapsFeatures, structure: Structure): boolean;
}
interface CapsForeachFunc {
(features: CapsFeatures, structure: Structure): boolean;
}
interface CapsMapFunc {
(features: CapsFeatures, structure: Structure): boolean;
}
interface ClockCallback {
(clock: Clock, time: ClockTime, id: ClockID): boolean;
}
interface ControlBindingConvert {
(binding: ControlBinding, src_value: number, dest_value: GObject.Value | any): void;
}
interface ControlSourceGetValue {
(self: ControlSource, timestamp: ClockTime, value: number): boolean;
}
interface ControlSourceGetValueArray {
(self: ControlSource, timestamp: ClockTime, interval: ClockTime, n_values: number, values: number): boolean;
}
interface CustomMetaTransformFunction {
(transbuf: Buffer, meta: CustomMeta, buffer: Buffer, type: GLib.Quark, data?: any | null): boolean;
}
interface DebugFuncPtr {
(): void;
}
interface ElementCallAsyncFunc {
(element: Element): void;
}
interface ElementForeachPadFunc {
(element: Element, pad: Pad): boolean;
}
interface IteratorCopyFunction {
(it: Iterator, copy: Iterator): void;
}
interface IteratorFoldFunction {
(item: GObject.Value | any, ret: GObject.Value | any): boolean;
}
interface IteratorForeachFunction {
(item: GObject.Value | any): void;
}
interface IteratorFreeFunction {
(it: Iterator): void;
}
interface IteratorItemFunction {
(it: Iterator, item: GObject.Value | any): IteratorItem;
}
interface IteratorNextFunction {
(it: Iterator, result: GObject.Value | any): IteratorResult;
}
interface IteratorResyncFunction {
(it: Iterator): void;
}
interface LogFunction {
(
category: DebugCategory,
level: DebugLevel,
file: string,
_function: string,
line: number,
object: A,
message: DebugMessage,
): void;
}
interface MemoryCopyFunction {
(mem: Memory, offset: number, size: number): Memory;
}
interface MemoryIsSpanFunction {
(mem1: Memory, mem2: Memory, offset: number): boolean;
}
interface MemoryMapFullFunction {
(mem: Memory, info: MapInfo, maxsize: number): any | null;
}
interface MemoryMapFunction {
(mem: Memory, maxsize: number, flags: MapFlags): any | null;
}
interface MemoryShareFunction {
(mem: Memory, offset: number, size: number): Memory;
}
interface MemoryUnmapFullFunction {
(mem: Memory, info: MapInfo): void;
}
interface MemoryUnmapFunction {
(mem: Memory): void;
}
interface MetaClearFunction {
(buffer: Buffer, meta: Meta): void;
}
interface MetaDeserializeFunction {
(info: MetaInfo, buffer: Buffer, data: number, size: number, version: number): Meta | null;
}
interface MetaFreeFunction {
(meta: Meta, buffer: Buffer): void;
}
interface MetaInitFunction {
(meta: Meta, params: any | null, buffer: Buffer): boolean;
}
interface MetaSerializeFunction {
(meta: Meta, data: ByteArrayInterface): boolean;
}
interface MetaTransformFunction {
(transbuf: Buffer, meta: Meta, buffer: Buffer, type: GLib.Quark, data?: any | null): boolean;
}
interface MiniObjectCopyFunction {
(obj: MiniObject): MiniObject;
}
interface MiniObjectDisposeFunction {
(obj: MiniObject): boolean;
}
interface MiniObjectFreeFunction {
(obj: MiniObject): void;
}
interface MiniObjectNotify {
(obj: MiniObject): void;
}
interface PadActivateFunction {
(pad: Pad, parent: Object): boolean;
}
interface PadActivateModeFunction {
(pad: Pad, parent: Object, mode: PadMode, active: boolean): boolean;
}
interface PadChainFunction {
(pad: Pad, parent: Object | null, buffer: Buffer): FlowReturn;
}
interface PadChainListFunction {
(pad: Pad, parent: Object | null, list: BufferList): FlowReturn;
}
interface PadEventFullFunction {
(pad: Pad, parent: Object | null, event: Event): FlowReturn;
}
interface PadEventFunction {
(pad: Pad, parent: Object | null, event: Event): boolean;
}
interface PadForwardFunction {
(pad: Pad): boolean;
}
interface PadGetRangeFunction {
(pad: Pad, parent: Object | null, offset: number, length: number, buffer: Buffer): FlowReturn;
}
interface PadIterIntLinkFunction {
(pad: Pad, parent?: Object | null): Iterator;
}
interface PadLinkFunction {
(pad: Pad, parent: Object | null, peer: Pad): PadLinkReturn;
}
interface PadProbeCallback {
(pad: Pad, info: PadProbeInfo): PadProbeReturn;
}
interface PadQueryFunction {
(pad: Pad, parent: Object | null, query: Query): boolean;
}
interface PadStickyEventsForeachFunction {
(pad: Pad, event?: Event | null): boolean;
}
interface PadUnlinkFunction {
(pad: Pad, parent?: Object | null): void;
}
interface PluginFeatureFilter {
(feature: PluginFeature): boolean;
}
interface PluginFilter {
(plugin: Plugin): boolean;
}
interface PluginInitFullFunc {
(plugin: Plugin): boolean;
}
interface PluginInitFunc {
(plugin: Plugin): boolean;
}
interface PromiseChangeFunc {
(promise: Promise): void;
}
interface StructureFilterMapFunc {
(field_id: GLib.Quark, value: GObject.Value | any): boolean;
}
interface StructureFilterMapIdStrFunc {
(fieldname: IdStr, value: GObject.Value | any): boolean;
}
interface StructureForeachFunc {
(field_id: GLib.Quark, value: GObject.Value | any): boolean;
}
interface StructureForeachIdStrFunc {
(fieldname: IdStr, value: GObject.Value | any): boolean;
}
interface StructureMapFunc {
(field_id: GLib.Quark, value: GObject.Value | any): boolean;
}
interface StructureMapIdStrFunc {
(fieldname: IdStr, value: GObject.Value | any): boolean;
}
interface TagForeachFunc {
(list: TagList, tag: string): void;
}
interface TagMergeFunc {
(dest: GObject.Value | any, src: GObject.Value | any): void;
}
interface TaskFunction {
(): void;
}
interface TaskPoolFunction {
(): void;
}
interface TaskThreadFunc {
(task: Task, thread: GLib.Thread): void;
}
interface TypeFindFunction {
(find: TypeFind): void;
}
interface ValueCompareFunc {
(value1: GObject.Value | any, value2: GObject.Value | any): number;
}
interface ValueDeserializeFunc {
(dest: GObject.Value | any, s: string): boolean;
}
interface ValueDeserializeWithPSpecFunc {
(dest: GObject.Value | any, s: string, pspec: GObject.ParamSpec): boolean;
}
interface ValueSerializeFunc {
(value1: GObject.Value | any): string;
}
/**
* Flags for allocators.
*/
/**
* Flags for allocators.
*/
export namespace AllocatorFlags {
export const $gtype: GObject.GType;
}
enum AllocatorFlags {
/**
* The allocator has a custom alloc function.
* Only elements designed to work with this allocator should be using it,
* other elements should ignore it from allocation propositions.
* This implies %GST_ALLOCATOR_FLAG_NO_COPY.
*/
CUSTOM_ALLOC,
/**
* When copying a #GstMemory allocated with this allocator, the copy will
* instead be allocated using the default allocator. Use this when allocating a
* new memory is an heavy opperation that should only be done with a
* #GstBufferPool for example.
*/
NO_COPY,
/**
* first flag that can be used for custom purposes
*/
LAST,
}
/**
* GstBinFlags are a set of flags specific to bins. Most are set/used
* internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
* and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
*/
/**
* GstBinFlags are a set of flags specific to bins. Most are set/used
* internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
* and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
*/
export namespace BinFlags {
export const $gtype: GObject.GType;
}
enum BinFlags {
/**
* Don't resync a state change when elements are added or linked in the bin
*/
NO_RESYNC,
/**
* 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.
*/
STREAMS_AWARE,
/**
* The last enum in the series of flags for bins. Derived classes can use this
* as first value in a list of flags.
*/
LAST,
}
/**
* A set of flags that can be provided to the gst_buffer_copy_into()
* function to specify which items should be copied.
*/
/**
* A set of flags that can be provided to the gst_buffer_copy_into()
* function to specify which items should be copied.
*/
export namespace BufferCopyFlags {
export const $gtype: GObject.GType;
}
enum BufferCopyFlags {
/**
* copy nothing
*/
NONE,
/**
* flag indicating that buffer flags should be copied
*/
FLAGS,
/**
* flag indicating that buffer pts, dts,
* duration, offset and offset_end should be copied
*/
TIMESTAMPS,
/**
* flag indicating that buffer meta should be
* copied
*/
META,
/**
* 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.
*/
MEMORY,
/**
* flag indicating that buffer memory should be
* merged
*/
MERGE,
/**
* flag indicating that memory should always be copied instead of reffed
*/
DEEP,
}
/**
* A set of buffer flags used to describe properties of a #GstBuffer.
*/
/**
* A set of buffer flags used to describe properties of a #GstBuffer.
*/
export namespace BufferFlags {
export const $gtype: GObject.GType;
}
enum BufferFlags {
/**
* the buffer is live data and should be discarded in
* the PAUSED state.
*/
LIVE,
/**
* the buffer contains data that should be dropped
* because it will be clipped against the segment
* boundaries or because it does not contain data
* that should be shown to the user.
*/
DECODE_ONLY,
/**
* the buffer marks a data discontinuity in the stream.
* This typically occurs after a seek or a dropped buffer
* from a live or network source.
*/
DISCONT,
/**
* the buffer timestamps might have a discontinuity
* and this buffer is a good point to resynchronize.
*/
RESYNC,
/**
* the buffer data is corrupted.
*/
CORRUPTED,
/**
* the buffer contains a media specific marker. for
* video this is the end of a frame boundary, for audio
* this is the start of a talkspurt. for RTP
* packets this matches the marker flag in the
* RTP packet header.
*/
MARKER,
/**
* the buffer contains header information that is
* needed to decode the following data.
*/
HEADER,
/**
* the buffer has been created to fill a gap in the
* stream and contains media neutral data (elements can
* switch to optimized code path that ignores the buffer
* content).
*/
GAP,
/**
* the buffer can be dropped without breaking the
* stream, for example to reduce bandwidth.
*/
DROPPABLE,
/**
* this unit cannot be decoded independently.
*/
DELTA_UNIT,
/**
* this flag is set when memory of the buffer
* is added/removed
*/
TAG_MEMORY,
/**
* Elements which write to disk or permanent storage should ensure the data
* is synced after writing the contents of this buffer.
*/
SYNC_AFTER,
/**
* 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.
*/
NON_DROPPABLE,
/**
* additional media specific flags can be added starting from
* this flag.
*/
LAST,
}
/**
* Additional flags to control the allocation of a buffer
*/
/**
* Additional flags to control the allocation of a buffer
*/
export namespace BufferPoolAcquireFlags {
export const $gtype: GObject.GType;
}
enum BufferPoolAcquireFlags {
/**
* no flags
*/
NONE,
/**
* buffer is keyframe
*/
KEY_UNIT,
/**
* when the bufferpool is empty, acquire_buffer
* will by default block until a buffer is released into the pool again. Setting
* this flag makes acquire_buffer return #GST_FLOW_EOS instead of blocking.
*/
DONTWAIT,
/**
* buffer is discont
*/
DISCONT,
/**
* last flag, subclasses can use private flags
* starting from this value.
*/
LAST,
}
/**
* The standard flags that a bus may have.
*/
/**
* The standard flags that a bus may have.
*/
export namespace BusFlags {
export const $gtype: GObject.GType;
}
enum BusFlags {
/**
* The bus is currently dropping all messages
*/
FLUSHING,
/**
* offset to define more flags
*/
FLAG_LAST,
}
/**
* Extra flags for a caps.
*/
/**
* Extra flags for a caps.
*/
export namespace CapsFlags {
export const $gtype: GObject.GType;
}
enum CapsFlags {
/**
* Caps has no specific content, but can contain
* anything.
*/
ANY,
}
/**
* The capabilities of this clock
*/
/**
* The capabilities of this clock
*/
export namespace ClockFlags {
export const $gtype: GObject.GType;
}
enum ClockFlags {
/**
* clock can do a single sync timeout request
*/
CAN_DO_SINGLE_SYNC,
/**
* clock can do a single async timeout request
*/
CAN_DO_SINGLE_ASYNC,
/**
* clock can do sync periodic timeout requests
*/
CAN_DO_PERIODIC_SYNC,
/**
* clock can do async periodic timeout callbacks
*/
CAN_DO_PERIODIC_ASYNC,
/**
* clock's resolution can be changed
*/
CAN_SET_RESOLUTION,
/**
* clock can be slaved to a master clock
*/
CAN_SET_MASTER,
/**
* clock needs to be synced before it can be used
*/
NEEDS_STARTUP_SYNC,
/**
* subclasses can add additional flags starting from this flag
*/
LAST,
}
/**
* These are some terminal style flags you can use when creating your
* debugging categories to make them stand out in debugging output.
*/
/**
* These are some terminal style flags you can use when creating your
* debugging categories to make them stand out in debugging output.
*/
export namespace DebugColorFlags {
export const $gtype: GObject.GType;
}
enum DebugColorFlags {
/**
* Use black as foreground color.
*/
FG_BLACK,
/**
* Use red as foreground color.
*/
FG_RED,
/**
* Use green as foreground color.
*/
FG_GREEN,
/**
* Use yellow as foreground color.
*/
FG_YELLOW,
/**
* Use blue as foreground color.
*/
FG_BLUE,
/**
* Use magenta as foreground color.
*/
FG_MAGENTA,
/**
* Use cyan as foreground color.
*/
FG_CYAN,
/**
* Use white as foreground color.
*/
FG_WHITE,
/**
* Use black as background color.
*/
BG_BLACK,
/**
* Use red as background color.
*/
BG_RED,
/**
* Use green as background color.
*/
BG_GREEN,
/**
* Use yellow as background color.
*/
BG_YELLOW,
/**
* Use blue as background color.
*/
BG_BLUE,
/**
* Use magenta as background color.
*/
BG_MAGENTA,
/**
* Use cyan as background color.
*/
BG_CYAN,
/**
* Use white as background color.
*/
BG_WHITE,
/**
* Make the output bold.
*/
BOLD,
/**
* Underline the output.
*/
UNDERLINE,
}
/**
* Available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE()
* and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().
*/
/**
* Available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE()
* and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().
*/
export namespace DebugGraphDetails {
export const $gtype: GObject.GType;
}
enum DebugGraphDetails {
/**
* show caps-name on edges
*/
MEDIA_TYPE,
/**
* show caps-details on edges
*/
CAPS_DETAILS,
/**
* show modified parameters on
* elements
*/
NON_DEFAULT_PARAMS,
/**
* show element states
*/
STATES,
/**
* show full element parameter values even
* if they are very long
*/
FULL_PARAMS,
/**
* show all the typical details that one might want
*/
ALL,
/**
* show all details regardless of how large or
* verbose they make the resulting output
*/
VERBOSE,
}
/**
* The standard flags that an element may have.
*/
/**
* The standard flags that an element may have.
*/
export namespace ElementFlags {
export const $gtype: GObject.GType;
}
enum ElementFlags {
/**
* ignore state changes from parent
*/
LOCKED_STATE,
/**
* the element is a sink
*/
SINK,
/**
* the element is a source.
*/
SOURCE,
/**
* the element can provide a clock
*/
PROVIDE_CLOCK,
/**
* the element requires a clock
*/
REQUIRE_CLOCK,
/**
* the element can use an index
*/
INDEXABLE,
/**
* offset to define more flags
*/
LAST,
}
/**
* #GstEventTypeFlags indicate the aspects of the different #GstEventType
* values. You can get the type flags of a #GstEventType with the
* gst_event_type_get_flags() function.
*/
/**
* #GstEventTypeFlags indicate the aspects of the different #GstEventType
* values. You can get the type flags of a #GstEventType with the
* gst_event_type_get_flags() function.
*/
export namespace EventTypeFlags {
export const $gtype: GObject.GType;
}
enum EventTypeFlags {
/**
* Set if the event can travel upstream.
*/
UPSTREAM,
/**
* Set if the event can travel downstream.
*/
DOWNSTREAM,
/**
* Set if the event should be serialized with data
* flow.
*/
SERIALIZED,
/**
* Set if the event is sticky on the pads.
*/
STICKY,
/**
* Multiple sticky events can be on a pad, each
* identified by the event name.
*/
STICKY_MULTI,
}
/**
* The different flags that can be set on #GST_EVENT_GAP events. See
* gst_event_set_gap_flags() for details.
*/
/**
* The different flags that can be set on #GST_EVENT_GAP events. See
* gst_event_set_gap_flags() for details.
*/
export namespace GapFlags {
export const $gtype: GObject.GType;
}
enum GapFlags {
/**
* The #GST_EVENT_GAP signals missing data,
* for example because of packet loss.
*/
DATA,
}
/**
* Flags used when locking miniobjects
*/
/**
* Flags used when locking miniobjects
*/
export namespace LockFlags {
export const $gtype: GObject.GType;
}
enum LockFlags {
/**
* lock for read access
*/
READ,
/**
* lock for write access
*/
WRITE,
/**
* lock for exclusive access
*/
EXCLUSIVE,
/**
* first flag that can be used for custom purposes
*/
LAST,
}
/**
* Flags used when mapping memory
*/
/**
* Flags used when mapping memory
*/
export namespace MapFlags {
export const $gtype: GObject.GType;
}
enum MapFlags {
/**
* map for read access
*/
READ,
/**
* map for write access
*/
WRITE,
/**
* first flag that can be used for custom purposes
*/
FLAG_LAST,
}
/**
* Flags for wrapped memory.
*/
/**
* Flags for wrapped memory.
*/
export namespace MemoryFlags {
export const $gtype: GObject.GType;
}
enum MemoryFlags {
/**
* memory is readonly. It is not allowed to map the
* memory with #GST_MAP_WRITE.
*/
READONLY,
/**
* 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.)
*/
NO_SHARE,
/**
* the memory prefix is filled with 0 bytes
*/
ZERO_PREFIXED,
/**
* the memory padding is filled with 0 bytes
*/
ZERO_PADDED,
/**
* the memory is physically
* contiguous. (Since: 1.2)
*/
PHYSICALLY_CONTIGUOUS,
/**
* the memory can't be mapped via
* gst_memory_map() without any preconditions. (Since: 1.2)
*/
NOT_MAPPABLE,
/**
* first flag that can be used for custom purposes
*/
LAST,
}
/**
* The different message types that are available.
*/
/**
* The different message types that are available.
*/
export namespace MessageType {
export const $gtype: GObject.GType;
}
enum MessageType {
/**
* an undefined message
*/
UNKNOWN,
/**
* 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.
*/
EOS,
/**
* an error occurred. When the application receives an error
* message it should stop playback of the pipeline and not assume that more
* data will be played. It is possible to specify a redirection url to the error
* messages by setting a `redirect-location` field into the error message, application
* or high level bins might use the information as required.
*/
ERROR,
/**
* a warning occurred.
*/
WARNING,
/**
* an info message occurred
*/
INFO,
/**
* a tag was found.
*/
TAG,
/**
* the pipeline is buffering. When the application
* receives a buffering message in the PLAYING state for a non-live pipeline it
* must PAUSE the pipeline until the buffering completes, when the percentage
* field in the message is 100%. For live pipelines, no action must be
* performed and the buffering percentage can be used to inform the user about
* the progress.
*/
BUFFERING,
/**
* a state change happened
*/
STATE_CHANGED,
/**
* an element changed state in a streaming thread.
* This message is deprecated.
*/
STATE_DIRTY,
/**
* a stepping operation finished.
*/
STEP_DONE,
/**
* an element notifies its capability of providing
* a clock. This message is used internally and
* never forwarded to the application.
*/
CLOCK_PROVIDE,
/**
* The current clock as selected by the pipeline became
* unusable. The pipeline will select a new clock on
* the next PLAYING state change. The application
* should set the pipeline to PAUSED and back to
* PLAYING when this message is received.
*/
CLOCK_LOST,
/**
* a new clock was selected in the pipeline.
*/
NEW_CLOCK,
/**
* the structure of the pipeline changed. This
* message is used internally and never forwarded to the application.
*/
STRUCTURE_CHANGE,
/**
* status about a stream, emitted when it starts,
* stops, errors, etc..
*/
STREAM_STATUS,
/**
* message posted by the application, possibly
* via an application-specific element.
*/
APPLICATION,
/**
* element-specific message, see the specific element's
* documentation
*/
ELEMENT,
/**
* pipeline started playback of a segment. This
* message is used internally and never forwarded to the application.
*/
SEGMENT_START,
/**
* 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.
*/
SEGMENT_DONE,
/**
* The duration of a pipeline changed. The
* application can get the new duration with a duration query.
*/
DURATION_CHANGED,
/**
* Posted by elements when their latency changes. The
* application should recalculate and distribute a new latency.
*/
LATENCY,
/**
* Posted by elements when they start an ASYNC
* #GstStateChange. This message is not forwarded to the application but is used
* internally.
*/
ASYNC_START,
/**
* Posted by elements when they complete an ASYNC
* #GstStateChange. The application will only receive this message from the toplevel
* pipeline.
*/
ASYNC_DONE,
/**
* 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.
*/
REQUEST_STATE,
/**
* A stepping operation was started.
*/
STEP_START,
/**
* A buffer was dropped or an element changed its processing
* strategy for Quality of Service reasons.
*/
QOS,
/**
* A progress message.
*/
PROGRESS,
/**
* A new table of contents (TOC) was found or previously found TOC
* was updated.
*/
TOC,
/**
* Message to request resetting the pipeline's
* running time from the pipeline. This is an internal message which
* applications will likely never receive.
*/
RESET_TIME,
/**
* 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).
*/
STREAM_START,
/**
* Message indicating that an element wants a specific context (Since: 1.2)
*/
NEED_CONTEXT,
/**
* Message indicating that an element created a context (Since: 1.2)
*/
HAVE_CONTEXT,
/**
* 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)
*/
EXTENDED,
/**
* Message indicating a #GstDevice was added to
* a #GstDeviceProvider (Since: 1.4)
*/
DEVICE_ADDED,
/**
* Message indicating a #GstDevice was removed
* from a #GstDeviceProvider (Since: 1.4)
*/
DEVICE_REMOVED,
/**
* Message indicating a #GObject property has
* changed (Since: 1.10)
*/
PROPERTY_NOTIFY,
/**
* Message indicating a new #GstStreamCollection
* is available (Since: 1.10)
*/
STREAM_COLLECTION,
/**
* Message indicating the active selection of
* #GstStreams has changed (Since: 1.10)
*/
STREAMS_SELECTED,
/**
* 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)
*/
REDIRECT,
/**
* Message indicating a #GstDevice was changed
* a #GstDeviceProvider (Since: 1.16)
*/
DEVICE_CHANGED,
/**
* 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)
*/
INSTANT_RATE_REQUEST,
/**
* mask for all of the above messages.
*/
ANY,
}
/**
* Extra metadata flags.
*/
/**
* Extra metadata flags.
*/
export namespace MetaFlags {
export const $gtype: GObject.GType;
}
enum MetaFlags {
/**
* no flags
*/
NONE,
/**
* metadata should not be modified
*/
READONLY,
/**
* metadata is managed by a bufferpool
*/
POOLED,
/**
* metadata should not be removed
*/
LOCKED,
/**
* additional flags can be added starting from this flag.
*/
LAST,
}
/**
* Flags for the mini object
*/
/**
* Flags for the mini object
*/
export namespace MiniObjectFlags {
export const $gtype: GObject.GType;
}
enum MiniObjectFlags {
/**
* the object can be locked and unlocked with
* gst_mini_object_lock() and gst_mini_object_unlock().
*/
LOCKABLE,
/**
* the object is permanently locked in
* READONLY mode. Only read locks can be performed on the object.
*/
LOCK_READONLY,
/**
* the object is expected to stay alive
* even after gst_deinit() has been called and so should be ignored by leak
* detection tools. (Since: 1.10)
*/
MAY_BE_LEAKED,
/**
* first flag that can be used by subclasses.
*/
LAST,
}
/**
* The standard flags that an gstobject may have.
*/
/**
* The standard flags that an gstobject may have.
*/
export namespace ObjectFlags {
export const $gtype: GObject.GType;
}
enum ObjectFlags {
/**
* the object is expected to stay alive even
* after gst_deinit() has been called and so should be ignored by leak
* detection tools. (Since: 1.10)
*/
MAY_BE_LEAKED,
/**
* Flag that's set when the object has been constructed. This can be used by
* API such as base class setters to differentiate between the case where
* they're called from a subclass's instance init function (and where the
* object isn't fully constructed yet, and so one shouldn't do anything but
* set values in the instance structure), and the case where the object is
* constructed.
*/
CONSTRUCTED,
/**
* subclasses can add additional flags starting from this flag
*/
LAST,
}
/**
* Pad state flags
*/
/**
* Pad state flags
*/
export namespace PadFlags {
export const $gtype: GObject.GType;
}
enum PadFlags {
/**
* is dataflow on a pad blocked
*/
BLOCKED,
/**
* is pad flushing
*/
FLUSHING,
/**
* is pad in EOS state
*/
EOS,
/**
* is pad currently blocking on a buffer or event
*/
BLOCKING,
/**
* ensure that there is a parent object before calling
* into the pad callbacks.
*/
NEED_PARENT,
/**
* the pad should be reconfigured/renegotiated.
* The flag has to be unset manually after
* reconfiguration happened.
*/
NEED_RECONFIGURE,
/**
* the pad has pending events
*/
PENDING_EVENTS,
/**
* the pad is using fixed caps. This means that
* once the caps are set on the pad, the default caps query function
* will only return those caps.
*/
FIXED_CAPS,
/**
* the default event and query handler will forward
* all events and queries to the internally linked pads
* instead of discarding them.
*/
PROXY_CAPS,
/**
* the default query handler will forward
* allocation queries to the internally linked pads
* instead of discarding them.
*/
PROXY_ALLOCATION,
/**
* the default query handler will forward
* scheduling queries to the internally linked pads
* instead of discarding them.
*/
PROXY_SCHEDULING,
/**
* the default accept-caps handler will check
* it the caps intersect the query-caps result instead
* of checking for a subset. This is interesting for
* parsers that can accept incompletely specified caps.
*/
ACCEPT_INTERSECT,
/**
* the default accept-caps handler will use
* the template pad caps instead of query caps to
* compare with the accept caps. Use this in combination
* with %GST_PAD_FLAG_ACCEPT_INTERSECT. (Since: 1.6)
*/
ACCEPT_TEMPLATE,
/**
* offset to define more flags
*/
LAST,
}
/**
* The amount of checking to be done when linking pads. `GST_PAD_LINK_CHECK_CAPS`
* and `GST_PAD_LINK_CHECK_TEMPLATE_CAPS` are mutually exclusive. If both are
* specified, expensive but safe `GST_PAD_LINK_CHECK_CAPS` are performed.
*
* > 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.
*/
/**
* The amount of checking to be done when linking pads. `GST_PAD_LINK_CHECK_CAPS`
* and `GST_PAD_LINK_CHECK_TEMPLATE_CAPS` are mutually exclusive. If both are
* specified, expensive but safe `GST_PAD_LINK_CHECK_CAPS` are performed.
*
* > 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.
*/
export namespace PadLinkCheck {
export const $gtype: GObject.GType;
}
enum PadLinkCheck {
/**
* Don't check hierarchy or caps compatibility.
*/
NOTHING,
/**
* 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.
*/
HIERARCHY,
/**
* 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.
*/
TEMPLATE_CAPS,
/**
* Check if the pads are compatible by comparing the
* caps returned by gst_pad_query_caps().
*/
CAPS,
/**
* Disables pushing a reconfigure event when pads are
* linked.
*/
NO_RECONFIGURE,
/**
* The default checks done when linking
* pads (i.e. the ones used by gst_pad_link()).
*/
DEFAULT,
}
/**
* The different probing types that can occur. When either one of
* `GST_PAD_PROBE_TYPE_IDLE` or `GST_PAD_PROBE_TYPE_BLOCK` is used, the probe will be a
* blocking probe.
*/
/**
* The different probing types that can occur. When either one of
* `GST_PAD_PROBE_TYPE_IDLE` or `GST_PAD_PROBE_TYPE_BLOCK` is used, the probe will be a
* blocking probe.
*/
export namespace PadProbeType {
export const $gtype: GObject.GType;
}
enum PadProbeType {
/**
* invalid probe type
*/
INVALID,
/**
* probe idle pads and block while the callback is called
*/
IDLE,
/**
* probe and block pads
*/
BLOCK,
/**
* probe buffers
*/
BUFFER,
/**
* probe buffer lists
*/
BUFFER_LIST,
/**
* probe downstream events
*/
EVENT_DOWNSTREAM,
/**
* probe upstream events
*/
EVENT_UPSTREAM,
/**
* 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.
*/
EVENT_FLUSH,
/**
* probe downstream queries
*/
QUERY_DOWNSTREAM,
/**
* probe upstream queries
*/
QUERY_UPSTREAM,
/**
* probe push
*/
PUSH,
/**
* probe pull
*/
PULL,
/**
* probe and block at the next opportunity, at data flow or when idle
*/
BLOCKING,
/**
* probe downstream data (buffers, buffer lists, and events)
*/
DATA_DOWNSTREAM,
/**
* probe upstream data (events)
*/
DATA_UPSTREAM,
/**
* probe upstream and downstream data (buffers, buffer lists, and events)
*/
DATA_BOTH,
/**
* probe and block downstream data (buffers, buffer lists, and events)
*/
BLOCK_DOWNSTREAM,
/**
* probe and block upstream data (events)
*/
BLOCK_UPSTREAM,
/**
* probe upstream and downstream events
*/
EVENT_BOTH,
/**
* probe upstream and downstream queries
*/
QUERY_BOTH,
/**
* probe upstream events and queries and downstream buffers, buffer lists, events and queries
*/
ALL_BOTH,
/**
* probe push and pull
*/
SCHEDULING,
}
/**
* Flags for the padtemplate
*/
/**
* Flags for the padtemplate
*/
export namespace PadTemplateFlags {
export const $gtype: GObject.GType;
}
enum PadTemplateFlags {
/**
* first flag that can be used by subclasses.
*/
LAST,
}
/**
* Parsing options.
*/
/**
* Parsing options.
*/
export namespace ParseFlags {
export const $gtype: GObject.GType;
}
enum ParseFlags {
/**
* Do not use any special parsing options.
*/
NONE,
/**
* Always return %NULL when an error occurs
* (default behaviour is to return partially constructed bins or elements
* in some cases)
*/
FATAL_ERRORS,
/**
* If a bin only has a single element,
* just return the element.
*/
NO_SINGLE_ELEMENT_BINS,
/**
* If more than one toplevel element is described
* by the pipeline description string, put them in a #GstBin instead of a
* #GstPipeline. (Since: 1.10)
*/
PLACE_IN_BIN,
}
/**
* Pipeline flags
*/
/**
* Pipeline flags
*/
export namespace PipelineFlags {
export const $gtype: GObject.GType;
}
enum PipelineFlags {
/**
* this pipeline works with a fixed clock
*/
FIXED_CLOCK,
/**
* offset to define more flags
*/
LAST,
}
export namespace PluginAPIFlags {
export const $gtype: GObject.GType;
}
enum PluginAPIFlags {
/**
* 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.
*/
MEMBERS,
}
/**
* Flags used in connection with gst_plugin_add_dependency().
*/
/**
* Flags used in connection with gst_plugin_add_dependency().
*/
export namespace PluginDependencyFlags {
export const $gtype: GObject.GType;
}
enum PluginDependencyFlags {
/**
* no special flags
*/
NONE,
/**
* recurse into subdirectories
*/
RECURSE,
/**
* use paths
* argument only if none of the environment variables is set
*/
PATHS_ARE_DEFAULT_ONLY,
/**
* interpret
* filename argument as filter suffix and check all matching files in
* the directory
*/
FILE_NAME_IS_SUFFIX,
/**
* interpret
* filename argument as filter prefix and check all matching files in
* the directory. Since: 1.8.
*/
FILE_NAME_IS_PREFIX,
/**
* interpret
* non-absolute paths as relative to the main executable directory. Since
* 1.14.
*/
PATHS_ARE_RELATIVE_TO_EXE,
}
/**
* The plugin loading state
*/
/**
* The plugin loading state
*/
export namespace PluginFlags {
export const $gtype: GObject.GType;
}
enum PluginFlags {
/**
* Temporarily loaded plugins
*/
CACHED,
/**
* The plugin won't be scanned (again)
*/
BLACKLISTED,
}
/**
* #GstQueryTypeFlags indicate the aspects of the different #GstQueryType
* values. You can get the type flags of a #GstQueryType with the
* gst_query_type_get_flags() function.
*/
/**
* #GstQueryTypeFlags indicate the aspects of the different #GstQueryType
* values. You can get the type flags of a #GstQueryType with the
* gst_query_type_get_flags() function.
*/
export namespace QueryTypeFlags {
export const $gtype: GObject.GType;
}
enum QueryTypeFlags {
/**
* Set if the query can travel upstream.
*/
UPSTREAM,
/**
* Set if the query can travel downstream.
*/
DOWNSTREAM,
/**
* Set if the query should be serialized with data
* flow.
*/
SERIALIZED,
}
/**
* The different scheduling flags.
*/
/**
* The different scheduling flags.
*/
export namespace SchedulingFlags {
export const $gtype: GObject.GType;
}
enum SchedulingFlags {
/**
* if seeking is possible
*/
SEEKABLE,
/**
* if sequential access is recommended
*/
SEQUENTIAL,
/**
* if bandwidth is limited and buffering possible (since 1.2)
*/
BANDWIDTH_LIMITED,
}
/**
* 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.
*/
/**
* 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.
*/
export namespace SeekFlags {
export const $gtype: GObject.GType;
}
enum SeekFlags {
/**
* no flag
*/
NONE,
/**
* flush pipeline
*/
FLUSH,
/**
* accurate position is requested, this might
* be considerably slower for some formats.
*/
ACCURATE,
/**
* seek to the nearest keyframe. This might be
* faster but less accurate.
*/
KEY_UNIT,
/**
* perform a segment seek.
*/
SEGMENT,
/**
* when doing fast forward or fast reverse playback, allow
* elements to skip frames instead of generating all
* frames. (Since: 1.6)
*/
TRICKMODE,
/**
* Deprecated backward compatibility flag, replaced
* by %GST_SEEK_FLAG_TRICKMODE
*/
SKIP,
/**
* 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.
*/
SNAP_BEFORE,
/**
* go to a location after the requested position,
* if %GST_SEEK_FLAG_KEY_UNIT this means the keyframe at of after the
* requested position.
*/
SNAP_AFTER,
/**
* 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.
*/
SNAP_NEAREST,
/**
* 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)
*/
TRICKMODE_KEY_UNITS,
/**
* 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)
*/
TRICKMODE_NO_AUDIO,
/**
* 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)
*/
TRICKMODE_FORWARD_PREDICTED,
/**
* 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)
*/
INSTANT_RATE_CHANGE,
}
/**
* Flags for the GstSegment structure. Currently mapped to the corresponding
* values of the seek flags.
*/
/**
* Flags for the GstSegment structure. Currently mapped to the corresponding
* values of the seek flags.
*/
export namespace SegmentFlags {
export const $gtype: GObject.GType;
}
enum SegmentFlags {
/**
* no flags
*/
NONE,
/**
* reset the pipeline running_time to the segment
* running_time
*/
RESET,
/**
* perform skip playback (Since: 1.6)
*/
TRICKMODE,
/**
* Deprecated backward compatibility flag, replaced
* by `GST_SEGMENT_FLAG_TRICKMODE`
*/
SKIP,
/**
* send SEGMENT_DONE instead of EOS
*/
SEGMENT,
/**
* Decode only keyframes, where
* possible (Since: 1.6)
*/
TRICKMODE_KEY_UNITS,
/**
* Decode only keyframes or forward
* predicted frames, where possible (Since: 1.18)
*/
TRICKMODE_FORWARD_PREDICTED,
/**
* Do not decode any audio, where
* possible (Since: 1.6)
*/
TRICKMODE_NO_AUDIO,
}
export namespace SerializeFlags {
export const $gtype: GObject.GType;
}
enum SerializeFlags {
/**
* No special flags specified.
*/
NONE,
/**
* Serialize using the old format for
* nested structures.
*/
BACKWARD_COMPAT,
/**
* Serialization fails if a value cannot be serialized instead of using
* placeholder "NULL" value (e.g. pointers, objects).
*/
STRICT,
}
export namespace StackTraceFlags {
export const $gtype: GObject.GType;
}
enum StackTraceFlags {
/**
* Try to retrieve the minimum information
* available, which may be none on some platforms
* (Since: 1.18)
*/
NONE,
/**
* Try to retrieve as much information as possible,
* including source information when getting the
* stack trace
*/
FULL,
}
export namespace StreamFlags {
export const $gtype: GObject.GType;
}
enum StreamFlags {
/**
* This stream has no special attributes
*/
NONE,
/**
* This stream is a sparse stream (e.g. a subtitle
* stream), data may flow only in irregular intervals with large gaps in
* between.
*/
SPARSE,
/**
* 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.
*/
SELECT,
/**
* 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).
*/
UNSELECT,
}
/**
* #GstStreamType describes a high level classification set for
* flows of data in #GstStream objects.
*
* Note that this is a flag, and therefore users should not assume it
* will be a single value. Do not use the equality operator for checking
* whether a stream is of a certain type.
*/
/**
* #GstStreamType describes a high level classification set for
* flows of data in #GstStream objects.
*
* Note that this is a flag, and therefore users should not assume it
* will be a single value. Do not use the equality operator for checking
* whether a stream is of a certain type.
*/
export namespace StreamType {
export const $gtype: GObject.GType;
}
enum StreamType {
/**
* The stream is of unknown (unclassified) type.
*/
UNKNOWN,
/**
* The stream is of audio data
*/
AUDIO,
/**
* The stream carries video data
*/
VIDEO,
/**
* The stream is a muxed container type
*/
CONTAINER,
/**
* The stream contains subtitle / subpicture data.
*/
TEXT,
}
/**
* Flag that describe the value. These flags help applications processing the
* logs to understand the values.
*/
/**
* Flag that describe the value. These flags help applications processing the
* logs to understand the values.
*/
export namespace TracerValueFlags {
export const $gtype: GObject.GType;
}
enum TracerValueFlags {
/**
* no flags
*/
NONE,
/**
* the value is optional. When using this flag
* one need to have an additional boolean arg before this value in the
* var-args list passed to gst_tracer_record_log().
*/
OPTIONAL,
/**
* the value is a combined figure, since the
* start of tracing. Examples are averages or timestamps.
*/
AGGREGATED,
}
namespace Allocator {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
/**
* 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.
*/
abstract class Allocator extends Object {
static $gtype: GObject.GType;
// Fields
object: Object;
mem_type: string;
mem_map: MemoryMapFunction;
mem_unmap: MemoryUnmapFunction;
mem_copy: MemoryCopyFunction;
mem_share: MemoryShareFunction;
mem_is_span: MemoryIsSpanFunction;
mem_map_full: MemoryMapFullFunction;
mem_unmap_full: MemoryUnmapFullFunction;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Find a previously registered allocator with `name`. When `name` is %NULL, the
* default allocator will be returned.
* @param name the name of the allocator
*/
static find(name?: string | null): Allocator | null;
/**
* Registers the memory `allocator` with `name`.
* @param name the name of the allocator
* @param allocator #GstAllocator
*/
static register(name: string, allocator: Allocator): void;
// Virtual methods
/**
* Use `allocator` to allocate a new memory block with memory that is at least
* `size` big.
*
* The optional `params` can specify the prefix and padding for the memory. If
* %NULL is passed, no flags, no extra prefix/padding and a default alignment is
* used.
*
* The prefix/padding will be filled with 0 if flags contains
* #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
*
* When `allocator` is %NULL, the default allocator will be used.
*
* The alignment in `params` is given as a bitmask so that `align` + 1 equals
* the amount of bytes to align to. For example, to align to 8 bytes,
* use an alignment of 7.
* @param size size of the visible memory area
* @param params optional parameters
*/
vfunc_alloc(size: number, params?: AllocationParams | null): Memory | null;
/**
* Free `memory` that was previously allocated with gst_allocator_alloc().
* @param memory the memory to free
*/
vfunc_free(memory: Memory): void;
// Methods
/**
* Use `allocator` to allocate a new memory block with memory that is at least
* `size` big.
*
* The optional `params` can specify the prefix and padding for the memory. If
* %NULL is passed, no flags, no extra prefix/padding and a default alignment is
* used.
*
* The prefix/padding will be filled with 0 if flags contains
* #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
*
* When `allocator` is %NULL, the default allocator will be used.
*
* The alignment in `params` is given as a bitmask so that `align` + 1 equals
* the amount of bytes to align to. For example, to align to 8 bytes,
* use an alignment of 7.
* @param size size of the visible memory area
* @param params optional parameters
* @returns a new #GstMemory.
*/
alloc(size: number, params?: AllocationParams | null): Memory | null;
/**
* Free `memory` that was previously allocated with gst_allocator_alloc().
* @param memory the memory to free
*/
free(memory: Memory): void;
/**
* Set the default allocator.
*/
set_default(): void;
}
namespace Bin {
// Signal callback interfaces
interface DeepElementAdded {
(sub_bin: Bin, element: Element): void;
}
interface DeepElementRemoved {
(sub_bin: Bin, element: Element): void;
}
interface DoLatency {
(): boolean;
}
interface ElementAdded {
(element: Element): void;
}
interface ElementRemoved {
(element: Element): void;
}
// Constructor properties interface
interface ConstructorProps extends Element.ConstructorProps, ChildProxy.ConstructorProps {
async_handling: boolean;
asyncHandling: boolean;
message_forward: boolean;
messageForward: boolean;
}
}
/**
* #GstBin is an element that can contain other #GstElement, allowing them to be
* managed as a group.
* Pads from the child elements can be ghosted to the bin, see #GstGhostPad.
* This makes the bin look like any other elements and enables creation of
* higher-level abstraction elements.
*
* A new #GstBin is created with gst_bin_new(). Use a #GstPipeline instead if you
* want to create a toplevel bin because a normal bin doesn't have a bus or
* handle clock distribution of its own.
*
* After the bin has been created you will typically add elements to it with
* gst_bin_add(). You can remove elements with gst_bin_remove().
*
* An element can be retrieved from a bin with gst_bin_get_by_name(), using the
* elements name. gst_bin_get_by_name_recurse_up() is mainly used for internal
* purposes and will query the parent bins when the element is not found in the
* current bin.
*
* An iterator of elements in a bin can be retrieved with
* gst_bin_iterate_elements(). Various other iterators exist to retrieve the
* elements in a bin.
*
* gst_object_unref() is used to drop your reference to the bin.
*
* The #GstBin::element-added signal is fired whenever a new element is added to
* the bin. Likewise the #GstBin::element-removed signal is fired whenever an
* element is removed from the bin.
*
* A #GstBin internally intercepts every #GstMessage posted by its children and
* implements the following default behaviour for each of them:
*
* * %GST_MESSAGE_EOS: This message is only posted by sinks in the PLAYING
* state. If all sinks posted the EOS message, this bin will post and EOS
* message upwards.
*
* * %GST_MESSAGE_SEGMENT_START: Just collected and never forwarded upwards.
* The messages are used to decide when all elements have completed playback
* of their segment.
*
* * %GST_MESSAGE_SEGMENT_DONE: Is posted by #GstBin when all elements that posted
* a SEGMENT_START have posted a SEGMENT_DONE.
*
* * %GST_MESSAGE_DURATION_CHANGED: Is posted by an element that detected a change
* in the stream duration. The duration change is posted to the
* application so that it can refetch the new duration with a duration
* query.
*
* Note that these messages can be posted before the bin is prerolled, in which
* case the duration query might fail.
*
* Note also that there might be a discrepancy (due to internal buffering/queueing)
* between the stream being currently displayed and the returned duration query.
*
* Applications might want to also query for duration (and changes) by
* listening to the %GST_MESSAGE_STREAM_START message, signaling the active start
* of a (new) stream.
*
* * %GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it
* can no longer provide a clock.
*
* The default bin behaviour is to check if the lost clock was the one provided
* by the bin. If so and the bin is currently in the PLAYING state, the message
* is forwarded to the bin parent.
*
* This message is also generated when a clock provider is removed from
* the bin. If this message is received by the application, it should
* PAUSE the pipeline and set it back to PLAYING to force a new clock
* distribution.
*
* * %GST_MESSAGE_CLOCK_PROVIDE: This message is generated when an element
* can provide a clock. This mostly happens when a new clock
* provider is added to the bin.
*
* The default behaviour of the bin is to mark the currently selected clock as
* dirty, which will perform a clock recalculation the next time the bin is
* asked to provide a clock.
*
* This message is never sent to the application but is forwarded to
* the parent of the bin.
*
* * OTHERS: posted upwards.
*
* A #GstBin implements the following default behaviour for answering to a
* #GstQuery:
*
* * %GST_QUERY_DURATION: The bin will forward the query to all sink
* elements contained within and will return the maximum value.
* If no sinks are available in the bin, the query fails.
*
* * %GST_QUERY_POSITION: The query is sent to all sink elements in the bin and the
* MAXIMUM of all values is returned. If no sinks are available in the bin,
* the query fails.
*
* * OTHERS: the query is forwarded to all sink elements, the result
* of the first sink that answers the query successfully is returned. If no
* sink is in the bin, the query fails.
*
* A #GstBin will by default forward any event sent to it to all sink
* ( %GST_EVENT_TYPE_UPSTREAM ) or source ( %GST_EVENT_TYPE_DOWNSTREAM ) elements
* depending on the event type.
*
* If all the elements return %TRUE, the bin will also return %TRUE, else %FALSE
* is returned. If no elements of the required type are in the bin, the event
* handler will return %TRUE.
*/
class Bin extends Element implements ChildProxy {
static $gtype: GObject.GType;
// Properties
/**
* If set to %TRUE, the bin will handle asynchronous state changes.
* This should be used only if the bin subclass is modifying the state
* of its children on its own.
*/
get async_handling(): boolean;
set async_handling(val: boolean);
/**
* If set to %TRUE, the bin will handle asynchronous state changes.
* This should be used only if the bin subclass is modifying the state
* of its children on its own.
*/
get asyncHandling(): boolean;
set asyncHandling(val: boolean);
/**
* Forward all children messages, even those that would normally be filtered by
* the bin. This can be interesting when one wants to be notified of the EOS
* state of individual elements, for example.
*
* The messages are converted to an ELEMENT message with the bin as the
* source. The structure of the message is named `GstBinForwarded` and contains
* a field named `message` that contains the original forwarded #GstMessage.
*/
get message_forward(): boolean;
set message_forward(val: boolean);
/**
* Forward all children messages, even those that would normally be filtered by
* the bin. This can be interesting when one wants to be notified of the EOS
* state of individual elements, for example.
*
* The messages are converted to an ELEMENT message with the bin as the
* source. The structure of the message is named `GstBinForwarded` and contains
* a field named `message` that contains the original forwarded #GstMessage.
*/
get messageForward(): boolean;
set messageForward(val: boolean);
// Fields
element: Element;
numchildren: number;
children: Element[];
children_cookie: number;
child_bus: Bus;
polling: boolean;
state_dirty: boolean;
clock_dirty: boolean;
provided_clock: Clock;
clock_provider: Element;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name?: string | null): Bin;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'deep-element-added',
callback: (_source: this, sub_bin: Bin, element: Element) => void,
): number;
connect_after(
signal: 'deep-element-added',
callback: (_source: this, sub_bin: Bin, element: Element) => void,
): number;
emit(signal: 'deep-element-added', sub_bin: Bin, element: Element): void;
connect(
signal: 'deep-element-removed',
callback: (_source: this, sub_bin: Bin, element: Element) => void,
): number;
connect_after(
signal: 'deep-element-removed',
callback: (_source: this, sub_bin: Bin, element: Element) => void,
): number;
emit(signal: 'deep-element-removed', sub_bin: Bin, element: Element): void;
connect(signal: 'do-latency', callback: (_source: this) => boolean): number;
connect_after(signal: 'do-latency', callback: (_source: this) => boolean): number;
emit(signal: 'do-latency'): void;
connect(signal: 'element-added', callback: (_source: this, element: Element) => void): number;
connect_after(signal: 'element-added', callback: (_source: this, element: Element) => void): number;
emit(signal: 'element-added', element: Element): void;
connect(signal: 'element-removed', callback: (_source: this, element: Element) => void): number;
connect_after(signal: 'element-removed', callback: (_source: this, element: Element) => void): number;
emit(signal: 'element-removed', element: Element): void;
// Virtual methods
/**
* Method to add an element to the bin.
* @param element the element to be added
*/
vfunc_add_element(element: Element): boolean;
/**
* Method called when an element was added somewhere in the bin hierarchy.
* @param sub_bin the #GstBin to which the element was added
* @param child the element that was added
*/
vfunc_deep_element_added(sub_bin: Bin, child: Element): void;
/**
* Method called when an element was removed somewhere in the bin hierarchy.
* @param sub_bin the #GstBin from which the element was removed
* @param child the element that was removed
*/
vfunc_deep_element_removed(sub_bin: Bin, child: Element): void;
vfunc_do_latency(): boolean;
/**
* Method called when an element was added to the bin.
* @param child the element that was added
*/
vfunc_element_added(child: Element): void;
/**
* Method called when an element was removed from the bin.
* @param child the element that was removed
*/
vfunc_element_removed(child: Element): void;
/**
* Method to handle a message from the children.
* @param message the message to be handled
*/
vfunc_handle_message(message: Message): void;
/**
* Method to remove an element from the bin.
* @param element the element to be removed
*/
vfunc_remove_element(element: Element): boolean;
// Methods
/**
* 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.
* @param element the #GstElement to add
* @returns %TRUE if the element could be added, %FALSE if the bin does not want to accept the element.
*/
add(element: Element): boolean;
/**
* 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.
* @param direction whether to look for an unlinked source or sink pad
* @returns unlinked pad of the given direction.
*/
find_unlinked_pad(direction: PadDirection | null): Pad | null;
/**
* 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.
* @param iface the #GType of an interface
* @returns A #GstElement inside the bin implementing the interface
*/
get_by_interface(iface: GObject.GType): Element | null;
/**
* Gets the element with the given name from a bin. This
* function recurses into child bins.
* @param name the element name to search for
* @returns the #GstElement with the given name
*/
get_by_name(name: string): Element | null;
/**
* Gets the element with the given name from this bin. If the
* element is not found, a recursion is performed on the parent bin.
* @param name the element name to search for
* @returns the #GstElement with the given name
*/
get_by_name_recurse_up(name: string): Element | null;
get_suppressed_flags(): ElementFlags;
/**
* Looks for all elements inside the bin with the given element factory name.
* The function recurses inside child bins. The iterator will yield a series of
* #GstElement.
* @param factory_name the name of the #GstElementFactory
* @returns a #GstIterator of #GstElement for all elements in the bin with the given element factory name
*/
iterate_all_by_element_factory_name(factory_name: string): Iterator | null;
/**
* Looks for all elements inside the bin that implements the given
* interface. You can safely cast all returned elements to the given interface.
* The function recurses inside child bins. The iterator will yield a series
* of #GstElement.
* @param iface the #GType of an interface
* @returns a #GstIterator of #GstElement for all elements in the bin implementing the given interface
*/
iterate_all_by_interface(iface: GObject.GType): Iterator | null;
/**
* Gets an iterator for the elements in this bin.
* @returns a #GstIterator of #GstElement
*/
iterate_elements(): Iterator | null;
/**
* Gets an iterator for the elements in this bin.
* This iterator recurses into GstBin children.
* @returns a #GstIterator of #GstElement
*/
iterate_recurse(): Iterator | null;
/**
* Gets an iterator for all elements in the bin that have the
* #GST_ELEMENT_FLAG_SINK flag set.
* @returns a #GstIterator of #GstElement
*/
iterate_sinks(): Iterator | null;
/**
* 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.
* @returns a #GstIterator of #GstElement
*/
iterate_sorted(): Iterator | null;
/**
* Gets an iterator for all elements in the bin that have the
* #GST_ELEMENT_FLAG_SOURCE flag set.
* @returns a #GstIterator of #GstElement
*/
iterate_sources(): Iterator | null;
/**
* Queries `bin` for the current latency and reconfigures this latency on all the
* elements using a LATENCY event.
*
* This method is typically called on the pipeline when a #GST_MESSAGE_LATENCY
* is posted on the bus.
*
* This function simply emits the #GstBin::do-latency signal so any custom latency
* calculations will be performed.
* @returns %TRUE if the latency could be queried and reconfigured.
*/
recalculate_latency(): boolean;
/**
* 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.
* @param element the #GstElement to remove
* @returns %TRUE if the element could be removed, %FALSE if the bin does not want to remove the element.
*/
remove(element: Element): boolean;
/**
* Suppresses the given flags on the bin. #GstElementFlags of a
* child element are propagated when it is added to the bin.
* When suppressed flags are set, those specified flags will
* not be propagated to the bin.
* @param flags the #GstElementFlags to suppress
*/
set_suppressed_flags(flags: ElementFlags | null): void;
/**
* Synchronizes the state of every child of `bin` with the state
* of `bin`. See also gst_element_sync_state_with_parent().
* @returns %TRUE if syncing the state was successful for all children, otherwise %FALSE.
*/
sync_children_states(): boolean;
// Inherited methods
/**
* Emits the #GstChildProxy::child-added signal.
* @param child the newly added child
* @param name the name of the new child
*/
child_added(child: GObject.Object, name: string): void;
/**
* Emits the #GstChildProxy::child-removed signal.
* @param child the removed child
* @param name the name of the old child
*/
child_removed(child: GObject.Object, name: string): void;
/**
* Fetches a child by its number.
* @param index the child's position in the child list
* @returns the child object or %NULL if not found (index too high).
*/
get_child_by_index(index: number): T;
/**
* Looks up a child element by the given name.
*
* This virtual method has a default implementation that uses #GstObject
* together with gst_object_get_name(). If the interface is to be used with
* #GObjects, this methods needs to be overridden.
* @param name the child's name
* @returns the child object or %NULL if not found.
*/
get_child_by_name(name: string): T;
/**
* Looks up a child element by the given full-path name.
*
* Similar to gst_child_proxy_get_child_by_name(), this method
* searches and returns a child given a name. The difference is that
* this method allows a hierarchical path in the form of
* child1::child2::child3. In the later example this method would
* return a reference to child3, if found. The name should be made of
* element names only and should not contain any property names.
* @param name the full-path child's name
* @returns the child object or %NULL if not found.
*/
get_child_by_name_recurse(name: string): T;
/**
* Gets the number of child objects this parent contains.
* @returns the number of child objects
*/
get_children_count(): number;
/**
* Gets a single property using the GstChildProxy mechanism.
* You are responsible for freeing it by calling g_value_unset()
* @param name name of the property
*/
get_property(name: string): unknown;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Looks up which object and #GParamSpec would be effected by the given `name`.
* @param name name of the property to look up
* @returns %TRUE if @target and @pspec could be found. %FALSE otherwise. In that case the values for @pspec and @target are not modified. Unref @target after usage. For plain #GObject @target is the same as @object.
*/
lookup(name: string): [boolean, GObject.Object | null, GObject.ParamSpec | null];
/**
* Sets a single property using the GstChildProxy mechanism.
* @param name name of the property to set
* @param value new #GValue for the property
*/
set_property(name: string, value: GObject.Value | any): void;
/**
* Emits the #GstChildProxy::child-added signal.
* @param child the newly added child
* @param name the name of the new child
*/
vfunc_child_added(child: GObject.Object, name: string): void;
/**
* Emits the #GstChildProxy::child-removed signal.
* @param child the removed child
* @param name the name of the old child
*/
vfunc_child_removed(child: GObject.Object, name: string): void;
/**
* Fetches a child by its number.
* @param index the child's position in the child list
*/
vfunc_get_child_by_index(index: number): T;
/**
* Looks up a child element by the given name.
*
* This virtual method has a default implementation that uses #GstObject
* together with gst_object_get_name(). If the interface is to be used with
* #GObjects, this methods needs to be overridden.
* @param name the child's name
*/
vfunc_get_child_by_name(name: string): T;
/**
* Gets the number of child objects this parent contains.
*/
vfunc_get_children_count(): number;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
// Conflicted with Gst.Object.ref
ref(...args: never[]): any;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
/**
* A fundamental type that describes a 64-bit bitmask
*/
class Bitmask {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
namespace BufferPool {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
/**
* A #GstBufferPool is an object that can be used to pre-allocate and recycle
* buffers of the same size and with the same properties.
*
* A #GstBufferPool is created with gst_buffer_pool_new().
*
* Once a pool is created, it needs to be configured. A call to
* gst_buffer_pool_get_config() returns the current configuration structure from
* the pool. With gst_buffer_pool_config_set_params() and
* gst_buffer_pool_config_set_allocator() the bufferpool parameters and
* allocator can be configured. Other properties can be configured in the pool
* depending on the pool implementation.
*
* A bufferpool can have extra options that can be enabled with
* gst_buffer_pool_config_add_option(). The available options can be retrieved
* with gst_buffer_pool_get_options(). Some options allow for additional
* configuration properties to be set.
*
* After the configuration structure has been configured,
* gst_buffer_pool_set_config() updates the configuration in the pool. This can
* fail when the configuration structure is not accepted.
*
* After the pool has been configured, it can be activated with
* gst_buffer_pool_set_active(). This will preallocate the configured resources
* in the pool.
*
* When the pool is active, gst_buffer_pool_acquire_buffer() can be used to
* retrieve a buffer from the pool.
*
* Buffers allocated from a bufferpool will automatically be returned to the
* pool with gst_buffer_pool_release_buffer() when their refcount drops to 0.
*
* The bufferpool can be deactivated again with gst_buffer_pool_set_active().
* All further gst_buffer_pool_acquire_buffer() calls will return an error. When
* all buffers are returned to the pool they will be freed.
*/
class BufferPool extends Object {
static $gtype: GObject.GType;
// Fields
object: Object;
flushing: number;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): BufferPool;
// Static methods
/**
* 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().
* @param config a #GstBufferPool configuration
* @param option an option to add
*/
static config_add_option(config: Structure, option: string): void;
/**
* Gets the `allocator` and `params` from `config`.
* @param config a #GstBufferPool configuration
*/
static config_get_allocator(config: Structure): [boolean, Allocator | null, AllocationParams | null];
/**
* Parses an available `config` and gets the option at `index` of the options API
* array.
* @param config a #GstBufferPool configuration
* @param index position in the option array to read
*/
static config_get_option(config: Structure, index: number): string | null;
/**
* Gets the configuration values from `config`.
* @param config a #GstBufferPool configuration
*/
static config_get_params(config: Structure): [boolean, Caps | null, number, number, number];
/**
* Checks if `config` contains `option`.
* @param config a #GstBufferPool configuration
* @param option an option
*/
static config_has_option(config: Structure, option: string): boolean;
/**
* Retrieves the number of values currently stored in the options array of the
* `config` structure.
* @param config a #GstBufferPool configuration
*/
static config_n_options(config: Structure): number;
/**
* Sets the `allocator` and `params` on `config`.
*
* One of `allocator` and `params` can be %NULL, but not both. When `allocator`
* is %NULL, the default allocator of the pool will use the values in `param`
* to perform its allocation. When `param` is %NULL, the pool will use the
* provided `allocator` with its default #GstAllocationParams.
*
* A call to gst_buffer_pool_set_config() can update the allocator and params
* with the values that it is able to do. Some pools are, for example, not able
* to operate with different allocators or cannot allocate with the values
* specified in `params`. Use gst_buffer_pool_get_config() to get the currently
* used values.
* @param config a #GstBufferPool configuration
* @param allocator a #GstAllocator
* @param params #GstAllocationParams
*/
static config_set_allocator(
config: Structure,
allocator?: Allocator | null,
params?: AllocationParams | null,
): void;
/**
* Configures `config` with the given parameters.
* @param config a #GstBufferPool configuration
* @param caps caps for the buffers
* @param size the size of each buffer, not including prefix and padding
* @param min_buffers the minimum amount of buffers to allocate.
* @param max_buffers the maximum amount of buffers to allocate or 0 for unlimited.
*/
static config_set_params(
config: Structure,
caps: Caps | null,
size: number,
min_buffers: number,
max_buffers: number,
): void;
/**
* 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.
* @param config a #GstBufferPool configuration
* @param caps the excepted caps of buffers
* @param size the expected size of each buffer, not including prefix and padding
* @param min_buffers the expected minimum amount of buffers to allocate.
* @param max_buffers the expect maximum amount of buffers to allocate or 0 for unlimited.
*/
static config_validate_params(
config: Structure,
caps: Caps | null,
size: number,
min_buffers: number,
max_buffers: number,
): boolean;
// Virtual methods
/**
* Acquires a buffer from `pool`. `buffer` should point to a memory location that
* can hold a pointer to the new buffer. When the pool is empty, this function
* will by default block until a buffer is released into the pool again or when
* the pool is set to flushing or deactivated.
*
* `params` can contain optional parameters to influence the allocation.
* @param params parameters.
*/
vfunc_acquire_buffer(params?: BufferPoolAcquireParams | null): [FlowReturn, Buffer | null];
/**
* 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 #GST_META_FLAG_POOLED and #GST_META_FLAG_LOCKED and will
* not be removed from the buffer in #GstBufferPoolClass::reset_buffer.
* The buffer should have the #GST_BUFFER_FLAG_TAG_MEMORY cleared.
* @param params parameters.
*/
vfunc_alloc_buffer(params?: BufferPoolAcquireParams | null): [FlowReturn, Buffer | null];
/**
* Enter the flushing state.
*/
vfunc_flush_start(): void;
/**
* Leave the flushing state.
*/
vfunc_flush_stop(): void;
/**
* Free a buffer. The default implementation unrefs the buffer.
* @param buffer the #GstBuffer to free
*/
vfunc_free_buffer(buffer: Buffer): void;
/**
* 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().
*/
vfunc_get_options(): string[];
/**
* 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.
* @param buffer a #GstBuffer
*/
vfunc_release_buffer(buffer: Buffer): void;
/**
* 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 #GST_META_FLAG_POOLED flag (even
* the metadata with #GST_META_FLAG_LOCKED). If the
* #GST_BUFFER_FLAG_TAG_MEMORY was set, this function can also try to
* restore the memory and clear the #GST_BUFFER_FLAG_TAG_MEMORY again.
* @param buffer the #GstBuffer to reset
*/
vfunc_reset_buffer(buffer: Buffer): void;
/**
* Sets the configuration of the pool. If the pool is already configured, and
* the configuration hasn't changed, this function will return %TRUE. If the
* pool is active, this method will return %FALSE and active configuration
* will remain. Buffers allocated from this pool must be returned or else this
* function will do nothing and return %FALSE.
*
* `config` is a #GstStructure that contains the configuration parameters for
* the pool. A default and mandatory set of parameters can be configured with
* gst_buffer_pool_config_set_params(), gst_buffer_pool_config_set_allocator()
* and gst_buffer_pool_config_add_option().
*
* If the parameters in `config` can not be set exactly, this function returns
* %FALSE and will try to update as much state as possible. The new state can
* then be retrieved and refined with gst_buffer_pool_get_config().
*
* This function takes ownership of `config`.
* @param config a #GstStructure
*/
vfunc_set_config(config: Structure): boolean;
/**
* Start the bufferpool. The default implementation will preallocate
* min-buffers buffers and put them in the queue.
*
* Subclasses do not need to chain up to the parent's default implementation
* if they don't want min-buffers based preallocation.
*/
vfunc_start(): boolean;
/**
* Stop the bufferpool. the default implementation will free the
* preallocated buffers. This function is called when all the buffers are
* returned to the pool.
*/
vfunc_stop(): boolean;
// Methods
/**
* Acquires a buffer from `pool`. `buffer` should point to a memory location that
* can hold a pointer to the new buffer. When the pool is empty, this function
* will by default block until a buffer is released into the pool again or when
* the pool is set to flushing or deactivated.
*
* `params` can contain optional parameters to influence the allocation.
* @param params parameters.
* @returns a #GstFlowReturn such as %GST_FLOW_FLUSHING when the pool is inactive.
*/
acquire_buffer(params?: BufferPoolAcquireParams | null): [FlowReturn, Buffer | null];
/**
* 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.
* @returns a copy of the current configuration of @pool.
*/
get_config(): Structure;
/**
* 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().
* @returns a %NULL terminated array of strings.
*/
get_options(): string[];
/**
* Checks if the bufferpool supports `option`.
* @param option an option
* @returns %TRUE if the buffer pool contains @option.
*/
has_option(option: string): boolean;
/**
* Checks if `pool` is active. A pool can be activated with the
* gst_buffer_pool_set_active() call.
* @returns %TRUE when the pool is active.
*/
is_active(): boolean;
/**
* 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.
* @param buffer a #GstBuffer
*/
release_buffer(buffer: Buffer): void;
/**
* 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.
* @param active the new active state
* @returns %FALSE when the pool was not configured or when preallocation of the buffers failed.
*/
set_active(active: boolean): boolean;
/**
* Sets the configuration of the pool. If the pool is already configured, and
* the configuration hasn't changed, this function will return %TRUE. If the
* pool is active, this method will return %FALSE and active configuration
* will remain. Buffers allocated from this pool must be returned or else this
* function will do nothing and return %FALSE.
*
* `config` is a #GstStructure that contains the configuration parameters for
* the pool. A default and mandatory set of parameters can be configured with
* gst_buffer_pool_config_set_params(), gst_buffer_pool_config_set_allocator()
* and gst_buffer_pool_config_add_option().
*
* If the parameters in `config` can not be set exactly, this function returns
* %FALSE and will try to update as much state as possible. The new state can
* then be retrieved and refined with gst_buffer_pool_get_config().
*
* This function takes ownership of `config`.
* @param config a #GstStructure
* @returns %TRUE when the configuration could be set.
*/
set_config(config: Structure): boolean;
/**
* Enables or disables the flushing state of a `pool` without freeing or
* allocating buffers.
* @param flushing whether to start or stop flushing
*/
set_flushing(flushing: boolean): void;
}
namespace Bus {
// Signal callback interfaces
interface Message {
(message: Message): void;
}
interface SyncMessage {
(message: Message): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
enable_async: boolean;
enableAsync: boolean;
}
}
/**
* The #GstBus is an object responsible for delivering #GstMessage packets in
* a first-in first-out way from the streaming threads (see #GstTask) to the
* application.
*
* Since the application typically only wants to deal with delivery of these
* messages from one thread, the GstBus will marshall the messages between
* different threads. This is important since the actual streaming of media
* is done in another thread than the application.
*
* The GstBus provides support for #GSource based notifications. This makes it
* possible to handle the delivery in the glib #GMainLoop.
*
* The #GSource callback function gst_bus_async_signal_func() can be used to
* convert all bus messages into signal emissions.
*
* A message is posted on the bus with the gst_bus_post() method. With the
* gst_bus_peek() and gst_bus_pop() methods one can look at or retrieve a
* previously posted message.
*
* The bus can be polled with the gst_bus_poll() method. This methods blocks
* up to the specified timeout value until one of the specified messages types
* is posted on the bus. The application can then gst_bus_pop() the messages
* from the bus to handle them.
* Alternatively the application can register an asynchronous bus function
* using gst_bus_add_watch_full() or gst_bus_add_watch(). This function will
* install a #GSource in the default glib main loop and will deliver messages
* a short while after they have been posted. Note that the main loop should
* be running for the asynchronous callbacks.
*
* It is also possible to get messages from the bus without any thread
* marshalling with the gst_bus_set_sync_handler() method. This makes it
* possible to react to a message in the same thread that posted the
* message on the bus. This should only be used if the application is able
* to deal with messages from different threads.
*
* Every #GstPipeline has one bus.
*
* Note that a #GstPipeline will set its bus into flushing state when changing
* from READY to NULL state.
*/
class Bus extends Object {
static $gtype: GObject.GType;
// Properties
/**
* Enables async message delivery support for bus watches,
* gst_bus_pop() and similar API. Without this only the
* synchronous message handlers are called.
*
* This property is used to create the child element buses
* in #GstBin.
*/
set enable_async(val: boolean);
/**
* Enables async message delivery support for bus watches,
* gst_bus_pop() and similar API. Without this only the
* synchronous message handlers are called.
*
* This property is used to create the child element buses
* in #GstBin.
*/
set enableAsync(val: boolean);
// Fields
object: Object;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Bus;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'message', callback: (_source: this, message: Message) => void): number;
connect_after(signal: 'message', callback: (_source: this, message: Message) => void): number;
emit(signal: 'message', message: Message): void;
connect(signal: 'sync-message', callback: (_source: this, message: Message) => void): number;
connect_after(signal: 'sync-message', callback: (_source: this, message: Message) => void): number;
emit(signal: 'sync-message', message: Message): void;
// Virtual methods
/**
* A message has been posted on the bus.
* @param message the message that has been posted asynchronously
*/
vfunc_message(message: Message): void;
/**
* A message has been posted on the bus.
* @param message the message that has been posted synchronously
*/
vfunc_sync_message(message: Message): void;
// Methods
/**
* 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.
*/
add_signal_watch(): void;
/**
* Adds a bus signal watch to the default main context with the given `priority`
* (e.g. %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
* context set up using g_main_context_push_thread_default()
* (before one had to create a bus watch source and attach it to the desired
* main context 'manually').
*
* After calling this statement, the bus will emit the "message" signal for each
* message posted on the bus when the #GMainLoop is running.
*
* This function may be called multiple times. To clean up, the caller is
* responsible for calling gst_bus_remove_signal_watch() as many times as this
* function is called.
*
* There can only be a single bus watch per bus, you must remove any signal
* watch before you can set another type of watch.
* @param priority The priority of the watch.
*/
add_signal_watch_full(priority: number): void;
/**
* Adds a bus watch to the default main context with the given `priority` (e.g.
* %G_PRIORITY_DEFAULT). It is also possible to use a non-default main
* context set up using g_main_context_push_thread_default() (before
* one had to create a bus watch source and attach it to the desired main
* context 'manually').
*
* This function is used to receive asynchronous messages in the main loop.
* There can only be a single bus watch per bus, you must remove it before you
* can set a new one.
*
* The bus watch will only work if a #GMainLoop is being run.
*
* When `func` is called, the message belongs to the caller; if you want to
* keep a copy of it, call gst_message_ref() before leaving `func`.
*
* The watch can be removed using gst_bus_remove_watch() or by returning %FALSE
* from `func`. If the watch was added to the default main context it is also
* possible to remove the watch using g_source_remove().
*
* The bus watch will take its own reference to the `bus,` so it is safe to unref
* `bus` using gst_object_unref() after setting the bus watch.
* @param priority The priority of the watch.
* @param func A function to call when a message is received.
* @returns The event source id or 0 if @bus already got an event source.
*/
add_watch(priority: number, func: BusFunc): number;
/**
* A helper #GstBusFunc that can be used to convert all asynchronous messages
* into signals.
* @param message the #GstMessage received
* @param data user data
* @returns %TRUE
*/
async_signal_func(message: Message, data?: any | null): boolean;
/**
* 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.
* @returns a #GSource that can be added to a #GMainLoop.
*/
create_watch(): GLib.Source | null;
/**
* 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.
*/
disable_sync_message_emission(): void;
/**
* Instructs GStreamer to emit the "sync-message" signal after running the bus's
* sync handler. This function is here so that code can ensure that they can
* synchronously receive messages without having to affect what the bin's sync
* handler is.
*
* This function may be called multiple times. To clean up, the caller is
* responsible for calling gst_bus_disable_sync_message_emission() as many times
* as this function is called.
*
* While this function looks similar to gst_bus_add_signal_watch(), it is not
* exactly the same -- this function enables *synchronous* emission of
* signals when messages arrive; gst_bus_add_signal_watch() adds an idle callback
* to pop messages off the bus *asynchronously*. The sync-message signal
* comes from the thread of whatever object posted the message; the "message"
* signal is marshalled to the main thread via the #GMainLoop.
*/
enable_sync_message_emission(): void;
/**
* Gets the file descriptor from the bus which can be used to get notified about
* messages being available with functions like g_poll(), and allows integration
* into other event loops based on file descriptors.
* Whenever a message is available, the POLLIN / %G_IO_IN event is set.
*
* Warning: NEVER read or write anything to the returned fd but only use it
* for getting notifications via g_poll() or similar and then use the normal
* GstBus API, e.g. gst_bus_pop().
*/
get_pollfd(): GLib.PollFD;
/**
* Checks if there are pending messages on the bus that
* should be handled.
* @returns %TRUE if there are messages on the bus to be handled, %FALSE otherwise.
*/
have_pending(): boolean;
/**
* Peeks the message on the top of the bus' queue. The message will remain
* on the bus' message queue.
* @returns the #GstMessage that is on the bus, or %NULL if the bus is empty.
*/
peek(): Message | null;
/**
* Polls the bus for messages. Will block while waiting for messages to come.
* You can specify a maximum time to poll with the `timeout` parameter. If
* `timeout` is negative, this function will block indefinitely.
*
* All messages not in `events` will be popped off the bus and will be ignored.
* It is not possible to use message enums beyond #GST_MESSAGE_EXTENDED in the
* `events` mask
*
* Because poll is implemented using the "message" signal enabled by
* gst_bus_add_signal_watch(), calling gst_bus_poll() will cause the "message"
* signal to be emitted for every message that poll sees. Thus a "message"
* signal handler will see the same messages that this function sees -- neither
* will steal messages from the other.
*
* This function will run a #GMainLoop from the default main context when
* polling.
*
* You should never use this function, since it is pure evil. This is
* especially true for GUI applications based on Gtk+ or Qt, but also for any
* other non-trivial application that uses the GLib main loop. As this function
* runs a GLib main loop, any callback attached to the default GLib main
* context may be invoked. This could be timeouts, GUI events, I/O events etc.;
* even if gst_bus_poll() is called with a 0 timeout. Any of these callbacks
* may do things you do not expect, e.g. destroy the main application window or
* some other resource; change other application state; display a dialog and
* run another main loop until the user clicks it away. In short, using this
* function may add a lot of complexity to your code through unexpected
* re-entrancy and unexpected changes to your application's state.
*
* For 0 timeouts use gst_bus_pop_filtered() instead of this function; for
* other short timeouts use gst_bus_timed_pop_filtered(); everything else is
* better handled by setting up an asynchronous bus watch and doing things
* from there.
* @param events a mask of #GstMessageType, representing the set of message types to poll for (note special handling of extended message types below)
* @param timeout the poll timeout, as a #GstClockTime, or #GST_CLOCK_TIME_NONE to poll indefinitely.
* @returns the message that was received, or %NULL if the poll timed out.
*/
poll(events: MessageType | null, timeout: ClockTime): Message | null;
/**
* Gets a message from the bus.
* @returns the #GstMessage that is on the bus, or %NULL if the bus is empty.
*/
pop(): Message | null;
/**
* Gets a message matching `type` from the bus. Will discard all messages on
* the bus that do not match `type` and that have been posted before the first
* message that does match `type`. If there is no message matching `type` on
* the bus, all messages will be discarded. It is not possible to use message
* enums beyond #GST_MESSAGE_EXTENDED in the `events` mask.
* @param types message types to take into account
* @returns the next #GstMessage matching @type that is on the bus, or %NULL if the bus is empty or there is no message matching @type.
*/
pop_filtered(types: MessageType | null): Message | null;
/**
* Posts a message on the given bus. Ownership of the message
* is taken by the bus.
* @param message the #GstMessage to post
* @returns %TRUE if the message could be posted, %FALSE if the bus is flushing.
*/
post(message: Message): boolean;
/**
* Removes a signal watch previously added with gst_bus_add_signal_watch().
*/
remove_signal_watch(): void;
/**
* Removes an installed bus watch from `bus`.
* @returns %TRUE on success or %FALSE if @bus has no event source.
*/
remove_watch(): boolean;
/**
* 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.
* @param flushing whether or not to flush the bus
*/
set_flushing(flushing: boolean): void;
/**
* 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.
* @param func The handler function to install
*/
set_sync_handler(func?: BusSyncHandler | null): void;
/**
* A helper #GstBusSyncHandler that can be used to convert all synchronous
* messages into signals.
* @param message the #GstMessage received
* @param data user data
* @returns %GST_BUS_PASS
*/
sync_signal_handler(message: Message, data?: any | null): BusSyncReply;
/**
* Gets a message from the bus, waiting up to the specified timeout.
*
* If `timeout` is 0, this function behaves like gst_bus_pop(). If `timeout` is
* #GST_CLOCK_TIME_NONE, this function will block forever until a message was
* posted on the bus.
* @param timeout a timeout
* @returns the #GstMessage that is on the bus after the specified timeout or %NULL if the bus is empty after the timeout expired.
*/
timed_pop(timeout: ClockTime): Message | null;
/**
* Gets a message from the bus whose type matches the message type mask `types,`
* waiting up to the specified timeout (and discarding any messages that do not
* match the mask provided).
*
* If `timeout` is 0, this function behaves like gst_bus_pop_filtered(). If
* `timeout` is #GST_CLOCK_TIME_NONE, this function will block forever until a
* matching message was posted on the bus.
* @param timeout a timeout in nanoseconds, or %GST_CLOCK_TIME_NONE to wait forever
* @param types message types to take into account, %GST_MESSAGE_ANY for any type
* @returns a #GstMessage matching the filter in @types, or %NULL if no matching message was found on the bus until the timeout expired.
*/
timed_pop_filtered(timeout: ClockTime, types: MessageType | null): Message | null;
}
namespace Clock {
// Signal callback interfaces
interface Synced {
(synced: boolean): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
timeout: number;
window_size: number;
windowSize: number;
window_threshold: number;
windowThreshold: number;
}
}
/**
* GStreamer uses a global clock to synchronize the plugins in a pipeline.
* Different clock implementations are possible by implementing this abstract
* base class or, more conveniently, by subclassing #GstSystemClock.
*
* The #GstClock returns a monotonically increasing time with the method
* gst_clock_get_time(). Its accuracy and base time depend on the specific
* clock implementation but time is always expressed in nanoseconds. Since the
* baseline of the clock is undefined, the clock time returned is not
* meaningful in itself, what matters are the deltas between two clock times.
* The time returned by a clock is called the absolute time.
*
* The pipeline uses the clock to calculate the running time. Usually all
* renderers synchronize to the global clock using the buffer timestamps, the
* #GST_EVENT_SEGMENT events and the element's base time, see #GstPipeline.
*
* A clock implementation can support periodic and single shot clock
* notifications both synchronous and asynchronous.
*
* One first needs to create a #GstClockID for the periodic or single shot
* notification using gst_clock_new_single_shot_id() or
* gst_clock_new_periodic_id().
*
* To perform a blocking wait for the specific time of the #GstClockID use
* gst_clock_id_wait(). To receive a callback when the specific time is reached
* in the clock use gst_clock_id_wait_async(). Both these calls can be
* interrupted with the gst_clock_id_unschedule() call. If the blocking wait is
* unscheduled a return value of #GST_CLOCK_UNSCHEDULED is returned.
*
* Periodic callbacks scheduled async will be repeatedly called automatically
* until they are unscheduled. To schedule a sync periodic callback,
* gst_clock_id_wait() should be called repeatedly.
*
* The async callbacks can happen from any thread, either provided by the core
* or from a streaming thread. The application should be prepared for this.
*
* A #GstClockID that has been unscheduled cannot be used again for any wait
* operation, a new #GstClockID should be created and the old unscheduled one
* should be destroyed with gst_clock_id_unref().
*
* It is possible to perform a blocking wait on the same #GstClockID from
* multiple threads. However, registering the same #GstClockID for multiple
* async notifications is not possible, the callback will only be called for
* the thread registering the entry last.
*
* None of the wait operations unref the #GstClockID, the owner is responsible
* for unreffing the ids itself. This holds for both periodic and single shot
* notifications. The reason being that the owner of the #GstClockID has to
* keep a handle to the #GstClockID to unblock the wait on FLUSHING events or
* state changes and if the entry would be unreffed automatically, the handle
* might become invalid without any notification.
*
* These clock operations do not operate on the running time, so the callbacks
* will also occur when not in PLAYING state as if the clock just keeps on
* running. Some clocks however do not progress when the element that provided
* the clock is not PLAYING.
*
* When a clock has the #GST_CLOCK_FLAG_CAN_SET_MASTER flag set, it can be
* slaved to another #GstClock with gst_clock_set_master(). The clock will
* then automatically be synchronized to this master clock by repeatedly
* sampling the master clock and the slave clock and recalibrating the slave
* clock with gst_clock_set_calibration(). This feature is mostly useful for
* plugins that have an internal clock but must operate with another clock
* selected by the #GstPipeline. They can track the offset and rate difference
* of their internal clock relative to the master clock by using the
* gst_clock_get_calibration() function.
*
* The master/slave synchronisation can be tuned with the #GstClock:timeout,
* #GstClock:window-size and #GstClock:window-threshold properties.
* The #GstClock:timeout property defines the interval to sample the master
* clock and run the calibration functions. #GstClock:window-size defines the
* number of samples to use when calibrating and #GstClock:window-threshold
* defines the minimum number of samples before the calibration is performed.
*/
abstract class Clock extends Object {
static $gtype: GObject.GType;
// Properties
get timeout(): number;
set timeout(val: number);
get window_size(): number;
set window_size(val: number);
get windowSize(): number;
set windowSize(val: number);
get window_threshold(): number;
set window_threshold(val: number);
get windowThreshold(): number;
set windowThreshold(val: number);
// Fields
object: Object;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'synced', callback: (_source: this, synced: boolean) => void): number;
connect_after(signal: 'synced', callback: (_source: this, synced: boolean) => void): number;
emit(signal: 'synced', synced: boolean): void;
// Static methods
/**
* Compares the two #GstClockID instances. This function can be used
* as a GCompareFunc when sorting ids.
* @param id1 A #GstClockID
* @param id2 A #GstClockID to compare with
*/
static id_compare_func(id1?: any | null, id2?: any | null): number;
/**
* This function returns the underlying clock.
* @param id a #GstClockID
*/
static id_get_clock(id: ClockID): Clock | null;
/**
* Gets the time of the clock ID
* @param id The #GstClockID to query
*/
static id_get_time(id: ClockID): ClockTime;
/**
* Increases the refcount of given `id`.
* @param id The #GstClockID to ref
*/
static id_ref(id: ClockID): ClockID;
/**
* Unrefs given `id`. When the refcount reaches 0 the
* #GstClockID will be freed.
* @param id The #GstClockID to unref
*/
static id_unref(id: ClockID): void;
/**
* Cancels an outstanding request with `id`. This can either
* be an outstanding async notification or a pending sync notification.
* After this call, `id` cannot be used anymore to receive sync or
* async notifications, you need to create a new #GstClockID.
* @param id The id to unschedule
*/
static id_unschedule(id: ClockID): void;
/**
* 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.
* @param id a #GstClockID to check
* @param clock a #GstClock to compare against
*/
static id_uses_clock(id: ClockID, clock: Clock): boolean;
/**
* Performs a blocking wait on `id`.
* `id` should have been created with gst_clock_new_single_shot_id()
* or gst_clock_new_periodic_id() and should not have been unscheduled
* with a call to gst_clock_id_unschedule().
*
* If the `jitter` argument is not %NULL and this function returns #GST_CLOCK_OK
* or #GST_CLOCK_EARLY, it will contain the difference
* against the clock and the time of `id` when this method was
* called.
* Positive values indicate how late `id` was relative to the clock
* (in which case this function will return #GST_CLOCK_EARLY).
* Negative values indicate how much time was spent waiting on the clock
* before this function returned.
* @param id The #GstClockID to wait on
*/
static id_wait(id: ClockID): [ClockReturn, ClockTimeDiff | null];
/**
* Registers a callback on the given #GstClockID `id` with the given
* function and user_data. When passing a #GstClockID with an invalid
* time to this function, the callback will be called immediately
* with a time set to %GST_CLOCK_TIME_NONE. The callback will
* be called when the time of `id` has been reached.
*
* The callback `func` can be invoked from any thread, either provided by the
* core or from a streaming thread. The application should be prepared for this.
* @param id a #GstClockID to wait on
* @param func The callback function
*/
static id_wait_async(id: ClockID, func: ClockCallback): ClockReturn;
// Virtual methods
/**
* Change the resolution of the clock. Not all values might
* be acceptable.
* @param old_resolution the previous resolution
* @param new_resolution the new resolution
*/
vfunc_change_resolution(old_resolution: ClockTime, new_resolution: ClockTime): ClockTime;
/**
* Gets the current internal time of the given clock. The time is returned
* unadjusted for the offset and the rate.
*/
vfunc_get_internal_time(): ClockTime;
/**
* Gets the accuracy of the clock. The accuracy of the clock is the granularity
* of the values returned by gst_clock_get_time().
*/
vfunc_get_resolution(): ClockTime;
/**
* Unblock a blocking or async wait operation.
* @param entry the entry to unschedule
*/
vfunc_unschedule(entry: ClockEntry): void;
/**
* Perform a blocking wait on the given #GstClockEntry and return
* the jitter.
* @param entry the entry to wait on
*/
vfunc_wait(entry: ClockEntry): [ClockReturn, ClockTimeDiff | null];
/**
* Perform an asynchronous wait on the given #GstClockEntry.
* @param entry the entry to wait on
*/
vfunc_wait_async(entry: ClockEntry): ClockReturn;
// Methods
/**
* The time `observation_external` of the external or master clock and the time
* `observation_internal` of the internal or 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.
* @param observation_internal a time on the internal clock
* @param observation_external a time on the external clock
* @returns %TRUE if enough observations were added to run the regression algorithm.
*/
add_observation(observation_internal: ClockTime, observation_external: ClockTime): [boolean, number];
/**
* Add a clock observation to the internal slaving algorithm the same as
* gst_clock_add_observation(), and return the result of the external or 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.
* @param observation_internal a time on the internal clock
* @param observation_external a time on the external clock
* @returns %TRUE if enough observations were added to run the regression algorithm.
*/
add_observation_unapplied(
observation_internal: ClockTime,
observation_external: ClockTime,
): [boolean, number, ClockTime | null, ClockTime | null, ClockTime | null, ClockTime | null];
/**
* 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().
* @param internal a clock time
* @returns the converted time of the clock.
*/
adjust_unlocked(internal: ClockTime): ClockTime;
/**
* Converts the given `internal_target` clock time to the external time,
* using the passed calibration parameters. This function performs the
* same calculation as gst_clock_adjust_unlocked() when called using the
* current calibration parameters, but doesn't ensure a monotonically
* increasing result as gst_clock_adjust_unlocked() does.
*
* Note: The `clock` parameter is unused and can be NULL
* @param internal_target a clock time
* @param cinternal a reference internal time
* @param cexternal a reference external time
* @param cnum the numerator of the rate of the clock relative to its internal time
* @param cdenom the denominator of the rate of the clock
* @returns the converted time of the clock.
*/
adjust_with_calibration(
internal_target: ClockTime,
cinternal: ClockTime,
cexternal: ClockTime,
cnum: ClockTime,
cdenom: ClockTime,
): ClockTime;
/**
* 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.
*/
get_calibration(): [ClockTime | null, ClockTime | null, ClockTime | null, ClockTime | null];
/**
* Gets the current internal time of the given clock. The time is returned
* unadjusted for the offset and the rate.
* @returns the internal time of the clock. Or %GST_CLOCK_TIME_NONE when given invalid input.
*/
get_internal_time(): ClockTime;
/**
* Gets the master clock that `clock` is slaved to or %NULL when the clock is
* not slaved to any master clock.
* @returns a master #GstClock or %NULL when this clock is not slaved to a master clock.
*/
get_master(): Clock | null;
/**
* Gets the accuracy of the clock. The accuracy of the clock is the granularity
* of the values returned by gst_clock_get_time().
* @returns the resolution of the clock in units of #GstClockTime.
*/
get_resolution(): ClockTime;
/**
* Gets the current time of the given clock. The time is always
* monotonically increasing and adjusted according to the current
* offset and rate.
* @returns the time of the clock. Or %GST_CLOCK_TIME_NONE when given invalid input.
*/
get_time(): ClockTime;
/**
* Gets the amount of time that master and slave clocks are sampled.
* @returns the interval between samples.
*/
get_timeout(): ClockTime;
/**
* Checks if the clock is currently synced, by looking at whether
* %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is set.
* @returns %TRUE if the clock is currently synced
*/
is_synced(): boolean;
/**
* 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`.
* @param start_time the requested start time
* @param interval the requested interval
* @returns a #GstClockID that can be used to request the time notification.
*/
new_periodic_id(start_time: ClockTime, interval: ClockTime): ClockID;
/**
* Gets a #GstClockID from `clock` to trigger a single shot
* notification at the requested time.
* @param time the requested time
* @returns a #GstClockID that can be used to request the time notification.
*/
new_single_shot_id(time: ClockTime): ClockID;
/**
* Reinitializes the provided periodic `id` to the provided start time and
* interval. Does not modify the reference count.
* @param id a #GstClockID
* @param start_time the requested start time
* @param interval the requested interval
* @returns %TRUE if the GstClockID could be reinitialized to the provided @time, else %FALSE.
*/
periodic_id_reinit(id: ClockID, start_time: ClockTime, interval: ClockTime): boolean;
/**
* 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.
* @param internal a reference internal time
* @param external a reference external time
* @param rate_num the numerator of the rate of the clock relative to its internal time
* @param rate_denom the denominator of the rate of the clock
*/
set_calibration(internal: ClockTime, external: ClockTime, rate_num: ClockTime, rate_denom: ClockTime): void;
/**
* 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.
* @param master a master #GstClock
* @returns %TRUE if the clock is capable of being slaved to a master clock. Trying to set a master on a clock without the #GST_CLOCK_FLAG_CAN_SET_MASTER flag will make this function return %FALSE.
*/
set_master(master?: Clock | null): boolean;
/**
* Sets the accuracy of the clock. Some clocks have the possibility to operate
* with different accuracy at the expense of more resource usage. There is
* normally no need to change the default resolution of a clock. The resolution
* of a clock can only be changed if the clock has the
* #GST_CLOCK_FLAG_CAN_SET_RESOLUTION flag set.
* @param resolution The resolution to set
* @returns the new resolution of the clock.
*/
set_resolution(resolution: ClockTime): ClockTime;
/**
* Sets `clock` to synced and emits the #GstClock::synced signal, and wakes up any
* thread waiting in gst_clock_wait_for_sync().
*
* This function must only be called if %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC
* is set on the clock, and is intended to be called by subclasses only.
* @param synced if the clock is synced
*/
set_synced(synced: boolean): void;
/**
* Sets the amount of time, in nanoseconds, to sample master and slave
* clocks
* @param timeout a timeout
*/
set_timeout(timeout: ClockTime): void;
/**
* Reinitializes the provided single shot `id` to the provided time. Does not
* modify the reference count.
* @param id a #GstClockID
* @param time The requested time.
* @returns %TRUE if the GstClockID could be reinitialized to the provided @time, else %FALSE.
*/
single_shot_id_reinit(id: ClockID, time: ClockTime): boolean;
/**
* 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().
* @param external an external clock time
* @returns the internal time of the clock corresponding to @external.
*/
unadjust_unlocked(external: ClockTime): ClockTime;
/**
* Converts the given `external_target` clock time to the internal time,
* using the passed calibration parameters. This function performs the
* same calculation as gst_clock_unadjust_unlocked() when called using the
* current calibration parameters.
*
* Note: The `clock` parameter is unused and can be NULL
* @param external_target a clock time
* @param cinternal a reference internal time
* @param cexternal a reference external time
* @param cnum the numerator of the rate of the clock relative to its internal time
* @param cdenom the denominator of the rate of the clock
* @returns the converted time of the clock.
*/
unadjust_with_calibration(
external_target: ClockTime,
cinternal: ClockTime,
cexternal: ClockTime,
cnum: ClockTime,
cdenom: ClockTime,
): ClockTime;
/**
* Waits until `clock` is synced for reporting the current time. If `timeout`
* is %GST_CLOCK_TIME_NONE it will wait forever, otherwise it will time out
* after `timeout` nanoseconds.
*
* For asynchronous waiting, the #GstClock::synced signal can be used.
*
* This returns immediately with %TRUE if %GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC
* is not set on the clock, or if the clock is already synced.
* @param timeout timeout for waiting or %GST_CLOCK_TIME_NONE
* @returns %TRUE if waiting was successful, or %FALSE on timeout
*/
wait_for_sync(timeout: ClockTime): boolean;
}
namespace ControlBinding {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
name: string;
object: Object | any;
}
}
/**
* A base class for value mapping objects that attaches control sources to #GObject
* properties. Such an object is taking one or more #GstControlSource instances,
* combines them and maps the resulting value to the type and value range of the
* bound property.
*/
abstract class ControlBinding extends Object {
static $gtype: GObject.GType;
// Properties
get name(): string;
// This accessor conflicts with a property or field in a parent class or interface.
object: Object | any;
// Fields
pspec: GObject.ParamSpec;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
/**
* 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.
* @param timestamp the time that should be processed
* @param interval the time spacing between subsequent values
* @param values array to put control-values in
*/
vfunc_get_g_value_array(
timestamp: ClockTime,
interval: ClockTime,
values: (GObject.Value | any)[],
): boolean;
/**
* Gets the value for the given controlled property at the requested time.
* @param timestamp the time the control-change should be read from
*/
vfunc_get_value(timestamp: ClockTime): GObject.Value | null;
/**
* Sets the property of the `object,` according to the #GstControlSources that
* handles it and for the given timestamp.
*
* If this function fails, it is most likely the application developers fault.
* Most probably the control sources are not setup correctly.
* @param object the object that has controlled properties
* @param timestamp the time that should be processed
* @param last_sync the last time this was called
*/
vfunc_sync_values(object: Object, timestamp: ClockTime, last_sync: ClockTime): boolean;
// Methods
/**
* 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.
* @param timestamp the time that should be processed
* @param interval the time spacing between subsequent values
* @param values array to put control-values in
* @returns %TRUE if the given array could be filled, %FALSE otherwise
*/
get_g_value_array(timestamp: ClockTime, interval: ClockTime, values: (GObject.Value | any)[]): boolean;
// Conflicted with Gst.Object.get_g_value_array
get_g_value_array(...args: never[]): any;
/**
* Gets the value for the given controlled property at the requested time.
* @param timestamp the time the control-change should be read from
* @returns the GValue of the property at the given time, or %NULL if the property isn't controlled.
*/
get_value(timestamp: ClockTime): GObject.Value | null;
// Conflicted with Gst.Object.get_value
get_value(...args: never[]): any;
/**
* Checks if the control binding is disabled.
* @returns %TRUE if the binding is inactive
*/
is_disabled(): boolean;
/**
* This function is used to disable a control binding for some time, i.e.
* gst_object_sync_values() will do nothing.
* @param disabled boolean that specifies whether to disable the controller or not.
*/
set_disabled(disabled: boolean): void;
/**
* Sets the property of the `object,` according to the #GstControlSources that
* handles it and for the given timestamp.
*
* If this function fails, it is most likely the application developers fault.
* Most probably the control sources are not setup correctly.
* @param object the object that has controlled properties
* @param timestamp the time that should be processed
* @param last_sync the last time this was called
* @returns %TRUE if the controller value could be applied to the object property, %FALSE otherwise
*/
sync_values(object: Object, timestamp: ClockTime, last_sync: ClockTime): boolean;
// Conflicted with Gst.Object.sync_values
sync_values(...args: never[]): any;
}
namespace ControlSource {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
/**
* The #GstControlSource is a base class for control value sources that could
* be used to get timestamp-value pairs. A control source essentially is a
* function over time.
*
* A #GstControlSource is used by first getting an instance of a specific
* control-source, creating a binding for the control-source to the target property
* of the element and then adding the binding to the element. The binding will
* convert the data types and value range to fit to the bound property.
*
* For implementing a new #GstControlSource one has to implement
* #GstControlSourceGetValue and #GstControlSourceGetValueArray functions.
* These are then used by gst_control_source_get_value() and
* gst_control_source_get_value_array() to get values for specific timestamps.
*/
abstract class ControlSource extends Object {
static $gtype: GObject.GType;
// Fields
// This field conflicts with a function in a parent class or interface.
get_value: ControlSourceGetValue | any;
get_value_array: ControlSourceGetValueArray;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the value for this #GstControlSource at a given timestamp.
* @param timestamp the time for which the value should be returned
* @returns %FALSE if the value couldn't be returned, %TRUE otherwise.
*/
control_source_get_value(timestamp: ClockTime): [boolean, number];
/**
* Gets an array of values for for this #GstControlSource. Values that are
* undefined contain NANs.
* @param timestamp the first timestamp
* @param interval the time steps
* @param values array to put control-values in
* @returns %TRUE if the given array could be filled, %FALSE otherwise
*/
control_source_get_value_array(timestamp: ClockTime, interval: ClockTime, values: number[]): boolean;
}
namespace Device {
// Signal callback interfaces
interface Removed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
caps: Caps;
device_class: string;
deviceClass: string;
display_name: string;
displayName: string;
properties: Structure;
}
}
/**
* #GstDevice are objects representing a device, they contain
* relevant metadata about the device, such as its class and the #GstCaps
* representing the media types it can produce or handle.
*
* #GstDevice are created by #GstDeviceProvider objects which can be
* aggregated by #GstDeviceMonitor objects.
*/
abstract class Device extends Object {
static $gtype: GObject.GType;
// Properties
get caps(): Caps;
get device_class(): string;
get deviceClass(): string;
get display_name(): string;
get displayName(): string;
get properties(): Structure;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
// Virtual methods
/**
* Creates the element with all of the required parameters set to use
* this device.
* @param name name of new element, or %NULL to automatically create a unique name.
*/
vfunc_create_element(name?: string | null): Element | null;
/**
* 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.
* @param element a #GstElement
*/
vfunc_reconfigure_element(element: Element): boolean;
// Methods
/**
* Creates the element with all of the required parameters set to use
* this device.
* @param name name of new element, or %NULL to automatically create a unique name.
* @returns a new #GstElement configured to use this device
*/
create_element(name?: string | null): Element | null;
/**
* Getter for the #GstCaps that this device supports.
* @returns The #GstCaps supported by this device. Unref with gst_caps_unref() when done.
*/
get_caps(): Caps | null;
/**
* Gets the "class" of a device. This is a "/" separated list of
* classes that represent this device. They are a subset of the
* classes of the #GstDeviceProvider that produced this device.
* @returns The device class. Free with g_free() after use.
*/
get_device_class(): string;
/**
* Gets the user-friendly name of the device.
* @returns The device name. Free with g_free() after use.
*/
get_display_name(): string;
/**
* Gets the extra properties of a device.
* @returns The extra properties or %NULL when there are none. Free with gst_structure_free() after use.
*/
get_properties(): Structure | null;
/**
* Check if `device` matches all of the given classes
* @param classes a "/"-separated list of device classes to match, only match if all classes are matched
* @returns %TRUE if @device matches.
*/
has_classes(classes: string): boolean;
/**
* Check if `factory` matches all of the given classes
* @param classes a %NULL terminated array of classes to match, only match if all classes are matched
* @returns %TRUE if @device matches.
*/
has_classesv(classes: string[]): boolean;
/**
* 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.
* @param element a #GstElement
* @returns %TRUE if the element could be reconfigured to use this device, %FALSE otherwise.
*/
reconfigure_element(element: Element): boolean;
}
namespace DeviceMonitor {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
show_all: boolean;
showAll: boolean;
}
}
/**
* Applications should create a #GstDeviceMonitor when they want
* to probe, list and monitor devices of a specific type. The
* #GstDeviceMonitor will create the appropriate
* #GstDeviceProvider objects and manage them. It will then post
* messages on its #GstBus for devices that have been added and
* removed.
*
* The device monitor will monitor all devices matching the filters that
* the application has set.
*
* The basic use pattern of a device monitor is as follows:
*
* ```
* static gboolean
* my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data)
* {
* GstDevice *device;
* gchar *name;
*
* switch (GST_MESSAGE_TYPE (message)) {
* case GST_MESSAGE_DEVICE_ADDED:
* gst_message_parse_device_added (message, &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;
* }
* ```
*
*/
class DeviceMonitor extends Object {
static $gtype: GObject.GType;
// Properties
get show_all(): boolean;
set show_all(val: boolean);
get showAll(): boolean;
set showAll(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): DeviceMonitor;
// Methods
/**
* Adds a filter for which #GstDevice will be monitored, any device that matches
* all these classes and the #GstCaps will be returned.
*
* If this function is called multiple times to add more filters, each will be
* matched independently. That is, adding more filters will not further restrict
* what devices are matched.
*
* The #GstCaps supported by the device as returned by gst_device_get_caps() are
* not intersected with caps filters added using this function.
*
* Filters must be added before the #GstDeviceMonitor is started.
* @param classes device classes to use as filter or %NULL for any class
* @param caps the #GstCaps to filter or %NULL for ANY
* @returns The id of the new filter or 0 if no provider matched the filter's classes.
*/
add_filter(classes?: string | null, caps?: Caps | null): number;
/**
* Gets the #GstBus of this #GstDeviceMonitor
* @returns a #GstBus
*/
get_bus(): Bus;
/**
* Gets a list of devices from all of the relevant monitors. This may actually
* probe the hardware if the monitor is not currently started.
* @returns a #GList of #GstDevice
*/
get_devices(): Device[] | null;
/**
* Get a list of the currently selected device provider factories.
*
* This
* @returns A list of device provider factory names that are currently being monitored by @monitor or %NULL when nothing is being monitored.
*/
get_providers(): string[];
/**
* Get if `monitor` is currently showing all devices, even those from hidden
* providers.
* @returns %TRUE when all devices will be shown.
*/
get_show_all_devices(): boolean;
/**
* Removes a filter from the #GstDeviceMonitor using the id that was returned
* by gst_device_monitor_add_filter().
* @param filter_id the id of the filter
* @returns %TRUE of the filter id was valid, %FALSE otherwise
*/
remove_filter(filter_id: number): boolean;
/**
* Set if all devices should be visible, even those devices from hidden
* providers. Setting `show_all` to true might show some devices multiple times.
* @param show_all show all devices
*/
set_show_all_devices(show_all: boolean): void;
/**
* 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.
* @returns %TRUE if the device monitoring could be started, i.e. at least a single device provider was started successfully.
*/
start(): boolean;
/**
* Stops monitoring the devices.
*/
stop(): void;
}
namespace DeviceProvider {
// Signal callback interfaces
interface ProviderHidden {
(object: string): void;
}
interface ProviderUnhidden {
(object: string): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
/**
* A #GstDeviceProvider subclass is provided by a plugin that handles devices
* if there is a way to programmatically list connected devices. It can also
* optionally provide updates to the list of connected devices.
*
* Each #GstDeviceProvider subclass is a singleton, a plugin should
* normally provide a single subclass for all devices.
*
* Applications would normally use a #GstDeviceMonitor to monitor devices
* from all relevant providers.
*/
abstract class DeviceProvider extends Object {
static $gtype: GObject.GType;
// Fields
devices: any[];
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'provider-hidden', callback: (_source: this, object: string) => void): number;
connect_after(signal: 'provider-hidden', callback: (_source: this, object: string) => void): number;
emit(signal: 'provider-hidden', object: string): void;
connect(signal: 'provider-unhidden', callback: (_source: this, object: string) => void): number;
connect_after(signal: 'provider-unhidden', callback: (_source: this, object: string) => void): number;
emit(signal: 'provider-unhidden', object: string): void;
// Static methods
/**
* Create a new device providerfactory capable of instantiating objects of the
* `type` and add the factory to `plugin`.
* @param plugin #GstPlugin to register the device provider with, or %NULL for a static device provider.
* @param name name of device providers of this type
* @param rank rank of device provider (higher rank means more importance when autoplugging)
* @param type GType of device provider to register
*/
static register(plugin: Plugin | null, name: string, rank: number, type: GObject.GType): boolean;
static add_metadata(key: string, value: string): void;
static add_static_metadata(key: string, value: string): void;
static get_metadata(key: string): string | null;
static set_metadata(longname: string, classification: string, description: string, author: string): void;
static set_static_metadata(
longname: string,
classification: string,
description: string,
author: string,
): void;
// Virtual methods
/**
* Starts providering the devices. This will cause #GST_MESSAGE_DEVICE_ADDED
* and #GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus
* when devices are added or removed from the system.
*
* Since the #GstDeviceProvider is a singleton,
* gst_device_provider_start() may already have been called by another
* user of the object, gst_device_provider_stop() needs to be called the same
* number of times.
*
* After this function has been called, gst_device_provider_get_devices() will
* return the same objects that have been received from the
* #GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.
*/
vfunc_start(): boolean;
/**
* Decreases the use-count by one. If the use count reaches zero, this
* #GstDeviceProvider will stop providering the devices. This needs to be
* called the same number of times that gst_device_provider_start() was called.
*/
vfunc_stop(): void;
// Methods
can_monitor(): boolean;
/**
* Posts a message on the provider's #GstBus to inform applications that
* a new device has been added.
*
* This is for use by subclasses.
*
* `device'`s reference count will be incremented, and any floating reference
* will be removed (see gst_object_ref_sink()).
* @param device a #GstDevice that has been added
*/
device_add(device: Device): void;
/**
* This function is used when `changed_device` was modified into its new form
* `device`. This will post a `DEVICE_CHANGED` message on the bus to let
* the application know that the device was modified. #GstDevice is immutable
* for MT. safety purposes so this is an "atomic" way of letting the application
* know when a device was modified.
* @param device the new version of @changed_device
* @param changed_device the old version of the device that has been updated
*/
device_changed(device: Device, changed_device: Device): void;
/**
* Posts a message on the provider's #GstBus to inform applications that
* a device has been removed.
*
* This is for use by subclasses.
* @param device a #GstDevice that has been removed
*/
device_remove(device: Device): void;
/**
* Gets the #GstBus of this #GstDeviceProvider
* @returns a #GstBus
*/
get_bus(): Bus;
/**
* 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 #GstDevice
* objedcts that have been returned by the #GST_MESSAGE_DEVICE_ADDED messages.
* @returns a #GList of #GstDevice
*/
get_devices(): Device[];
/**
* Retrieves the factory that was used to create this device provider.
* @returns the #GstDeviceProviderFactory used for creating this device provider. no refcounting is needed.
*/
get_factory(): DeviceProviderFactory | null;
/**
* Get the provider factory names of the #GstDeviceProvider instances that
* are hidden by `provider`.
* @returns a list of hidden providers factory names or %NULL when nothing is hidden by @provider. Free with g_strfreev.
*/
get_hidden_providers(): string[];
/**
* Get metadata with `key` in `provider`.
* @param key the key to get
* @returns the metadata for @key.
*/
get_metadata(key: string): string;
/**
* 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.
* @param name a provider factory name
*/
hide_provider(name: string): void;
/**
* This function can be used to know if the `provider` was successfully started.
*/
is_started(): boolean;
/**
* Starts providering the devices. This will cause #GST_MESSAGE_DEVICE_ADDED
* and #GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus
* when devices are added or removed from the system.
*
* Since the #GstDeviceProvider is a singleton,
* gst_device_provider_start() may already have been called by another
* user of the object, gst_device_provider_stop() needs to be called the same
* number of times.
*
* After this function has been called, gst_device_provider_get_devices() will
* return the same objects that have been received from the
* #GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.
* @returns %TRUE if the device providering could be started
*/
start(): boolean;
/**
* Decreases the use-count by one. If the use count reaches zero, this
* #GstDeviceProvider will stop providering the devices. This needs to be
* called the same number of times that gst_device_provider_start() was called.
*/
stop(): void;
/**
* 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.
* @param name a provider factory name
*/
unhide_provider(name: string): void;
}
namespace DeviceProviderFactory {
// Constructor properties interface
interface ConstructorProps extends PluginFeature.ConstructorProps {}
}
/**
* #GstDeviceProviderFactory is used to create instances of device providers. A
* GstDeviceProviderfactory can be added to a #GstPlugin as it is also a
* #GstPluginFeature.
*
* Use the gst_device_provider_factory_find() and
* gst_device_provider_factory_get() functions to create device
* provider instances or use gst_device_provider_factory_get_by_name() as a
* convenient shortcut.
*/
class DeviceProviderFactory extends PluginFeature {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Search for an device provider factory of the given name. Refs the returned
* device provider factory; caller is responsible for unreffing.
* @param name name of factory to find
*/
static find(name: string): DeviceProviderFactory | null;
/**
* Returns the device provider of the type defined by the given device
* provider factory.
* @param factoryname a named factory to instantiate
*/
static get_by_name(factoryname: string): DeviceProvider | null;
/**
* Get a list of factories with a rank greater or equal to `minrank`.
* The list of factories is returned by decreasing rank.
* @param minrank Minimum rank
*/
static list_get_device_providers(minrank: Rank): DeviceProviderFactory[];
// Methods
/**
* Returns the device provider of the type defined by the given device
* providerfactory.
* @returns the #GstDeviceProvider or %NULL if the device provider couldn't be created
*/
get(): DeviceProvider | null;
/**
* 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().
* @returns the #GType for device providers managed by this factory.
*/
get_device_provider_type(): GObject.GType;
/**
* Get the metadata on `factory` with `key`.
* @param key a key
* @returns the metadata with @key on @factory or %NULL when there was no metadata with the given @key.
*/
get_metadata(key: string): string | null;
/**
* Get the available keys for the metadata on `factory`.
* @returns a %NULL-terminated array of key strings, or %NULL when there is no metadata. Free with g_strfreev() when no longer needed.
*/
get_metadata_keys(): string[] | null;
/**
* Check if `factory` matches all of the given `classes`
* @param classes a "/" separate list of classes to match, only match if all classes are matched
* @returns %TRUE if @factory matches or if @classes is %NULL.
*/
has_classes(classes?: string | null): boolean;
/**
* Check if `factory` matches all of the given classes
* @param classes a %NULL terminated array of classes to match, only match if all classes are matched
* @returns %TRUE if @factory matches.
*/
has_classesv(classes?: string[] | null): boolean;
}
/**
* A fundamental type that describes a #gdouble range
*/
class DoubleRange {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
namespace DynamicTypeFactory {
// Constructor properties interface
interface ConstructorProps extends PluginFeature.ConstructorProps {}
}
/**
* #GstDynamicTypeFactory is used to represent a type that can be
* automatically loaded the first time it is used. For example,
* a non-standard type for use in caps fields.
*
* In general, applications and plugins don't need to use the factory
* beyond registering the type in a plugin init function. Once that is
* done, the type is stored in the registry, and ready as soon as the
* registry is loaded.
*
* ## Registering a type for dynamic loading
*
*
* ```c
*
* static gboolean
* plugin_init (GstPlugin * plugin)
* {
* return gst_dynamic_type_register (plugin, GST_TYPE_CUSTOM_CAPS_FIELD);
* }
* ```
*
*/
class DynamicTypeFactory extends PluginFeature {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
static load(factoryname: string): GObject.GType;
}
namespace Element {
// Signal callback interfaces
interface NoMorePads {
(): void;
}
interface PadAdded {
(new_pad: Pad): void;
}
interface PadRemoved {
(old_pad: Pad): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
/**
* GstElement is the abstract base class needed to construct an element that
* can be used in a GStreamer pipeline. Please refer to the plugin writers
* guide for more information on creating #GstElement subclasses.
*
* The name of a #GstElement can be get with gst_element_get_name() and set with
* gst_element_set_name(). For speed, GST_ELEMENT_NAME() can be used in the
* core when using the appropriate locking. Do not use this in plug-ins or
* applications in order to retain ABI compatibility.
*
* Elements can have pads (of the type #GstPad). These pads link to pads on
* other elements. #GstBuffer flow between these linked pads.
* A #GstElement has a #GList of #GstPad structures for all their input (or sink)
* and output (or source) pads.
* Core and plug-in writers can add and remove pads with gst_element_add_pad()
* and gst_element_remove_pad().
*
* An existing pad of an element can be retrieved by name with
* gst_element_get_static_pad(). A new dynamic pad can be created using
* gst_element_request_pad() with a #GstPadTemplate.
* An iterator of all pads can be retrieved with gst_element_iterate_pads().
*
* Elements can be linked through their pads.
* If the link is straightforward, use the gst_element_link()
* convenience function to link two elements, or gst_element_link_many()
* for more elements in a row.
* Use gst_element_link_filtered() to link two elements constrained by
* a specified set of #GstCaps.
* For finer control, use gst_element_link_pads() and
* gst_element_link_pads_filtered() to specify the pads to link on
* each element by name.
*
* Each element has a state (see #GstState). You can get and set the state
* of an element with gst_element_get_state() and gst_element_set_state().
* Setting a state triggers a #GstStateChange. To get a string representation
* of a #GstState, use gst_element_state_get_name().
*
* You can get and set a #GstClock on an element using gst_element_get_clock()
* and gst_element_set_clock().
* Some elements can provide a clock for the pipeline if
* the #GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the
* gst_element_provide_clock() method one can retrieve the clock provided by
* such an element.
* Not all elements require a clock to operate correctly. If the
* #GST_ELEMENT_FLAG_REQUIRE_CLOCK() flag is set, a clock should be set on the
* element with gst_element_set_clock().
*
* Note that clock selection and distribution is normally handled by the
* toplevel #GstPipeline so the clock functions are only to be used in very
* specific situations.
*/
abstract class Element extends Object {
static $gtype: GObject.GType;
// Fields
object: Object;
state_cookie: number;
target_state: State;
current_state: State;
next_state: State;
pending_state: State;
last_return: StateChangeReturn;
bus: Bus;
clock: Clock;
base_time: ClockTimeDiff;
start_time: ClockTime;
numpads: number;
pads: Pad[];
numsrcpads: number;
srcpads: Pad[];
numsinkpads: number;
sinkpads: Pad[];
pads_cookie: number;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'no-more-pads', callback: (_source: this) => void): number;
connect_after(signal: 'no-more-pads', callback: (_source: this) => void): number;
emit(signal: 'no-more-pads'): void;
connect(signal: 'pad-added', callback: (_source: this, new_pad: Pad) => void): number;
connect_after(signal: 'pad-added', callback: (_source: this, new_pad: Pad) => void): number;
emit(signal: 'pad-added', new_pad: Pad): void;
connect(signal: 'pad-removed', callback: (_source: this, old_pad: Pad) => void): number;
connect_after(signal: 'pad-removed', callback: (_source: this, old_pad: Pad) => void): number;
emit(signal: 'pad-removed', old_pad: Pad): void;
// Static methods
/**
* Creates an element for handling the given URI.
* @param type Whether to create a source or a sink
* @param uri URI to create an element for
* @param elementname Name of created element, can be %NULL.
*/
static make_from_uri(type: URIType, uri: string, elementname?: string | null): Element;
/**
* Create a new elementfactory capable of instantiating objects of the
* `type` and add the factory to `plugin`.
* @param plugin #GstPlugin to register the element with, or %NULL for a static element.
* @param name name of elements of this type
* @param rank rank of element (higher rank means more importance when autoplugging)
* @param type GType of element to register
*/
static register(plugin: Plugin | null, name: string, rank: number, type: GObject.GType): boolean;
/**
* Gets a string representing the given state change result.
* @param state_ret a #GstStateChangeReturn to get the name of.
*/
static state_change_return_get_name(state_ret: StateChangeReturn): string;
/**
* Gets a string representing the given state.
* @param state a #GstState to get the name of.
*/
static state_get_name(state: State): string;
/**
* Marks `type` as "documentation should be skipped".
* Can be useful for dynamically registered element to be excluded from
* plugin documentation system.
*
* Example:
* ```c
* GType my_type;
* GTypeInfo my_type_info;
*
* // Fill "my_type_info"
* ...
*
* my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
* &my_type_info, 0);
* gst_element_type_set_skip_documentation (my_type);
* gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);
* ```
* @param type a #GType of element
*/
static type_set_skip_documentation(type: GObject.GType): void;
static add_metadata(key: string, value: string): void;
static add_pad_template(templ: PadTemplate): void;
static add_static_metadata(key: string, value: string): void;
static add_static_pad_template(static_templ: StaticPadTemplate): void;
static add_static_pad_template_with_gtype(static_templ: StaticPadTemplate, pad_type: GObject.GType): void;
static get_metadata(key: string): string;
static get_pad_template(name: string): PadTemplate | null;
static get_pad_template_list(): PadTemplate[];
static set_metadata(longname: string, classification: string, description: string, author: string): void;
static set_static_metadata(
longname: string,
classification: string,
description: string,
author: string,
): void;
// Virtual methods
/**
* Perform `transition` on `element`.
*
* This function must be called with STATE_LOCK held and is mainly used
* internally.
* @param transition the requested transition
*/
vfunc_change_state(transition: StateChange): StateChangeReturn;
/**
* Gets the state of the element.
*
* For elements that performed an ASYNC state change, as reported by
* gst_element_set_state(), this function will block up to the
* specified timeout value for the state change to complete.
* If the element completes the state change or goes into
* an error, this function returns immediately with a return value of
* %GST_STATE_CHANGE_SUCCESS or %GST_STATE_CHANGE_FAILURE respectively.
*
* For elements that did not return %GST_STATE_CHANGE_ASYNC, this function
* returns the current and pending state immediately.
*
* This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
* successfully changed its state but is not able to provide data yet.
* This mostly happens for live sources that only produce data in
* %GST_STATE_PLAYING. While the state change return is equivalent to
* %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
* some sink elements might not be able to complete their state change because
* an element is not producing data to complete the preroll. When setting the
* element to playing, the preroll will complete and playback will start.
* @param timeout a #GstClockTime to specify the timeout for an async state change or %GST_CLOCK_TIME_NONE for infinite timeout.
*/
vfunc_get_state(timeout: ClockTime): [StateChangeReturn, State | null, State | null];
/**
* Use this function to signal that the element does not expect any more pads
* to show up in the current pipeline. This function should be called whenever
* pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
* pad templates use this in combination with autopluggers to figure out that
* the element is done initializing its pads.
*
* This function emits the #GstElement::no-more-pads signal.
*
* MT safe.
*/
vfunc_no_more_pads(): void;
vfunc_pad_added(pad: Pad): void;
vfunc_pad_removed(pad: Pad): void;
/**
* Post a message on the element's #GstBus. This function takes ownership of the
* message; if you want to access the message after this call, you should add an
* additional reference before calling.
* @param message a #GstMessage to post
*/
vfunc_post_message(message: Message): boolean;
/**
* 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.
*/
vfunc_provide_clock(): Clock | null;
/**
* 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.
* @param query the #GstQuery.
*/
vfunc_query(query: Query): boolean;
/**
* called when a request pad is to be released
* @param pad
*/
vfunc_release_pad(pad: Pad): void;
/**
* 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().
* @param templ a #GstPadTemplate of which we want a pad of.
* @param name the name of the request #GstPad to retrieve. Can be %NULL.
* @param caps the caps of the pad we want to request. Can be %NULL.
*/
vfunc_request_new_pad(templ: PadTemplate, name?: string | null, caps?: Caps | null): Pad | null;
/**
* 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.
* @param event the #GstEvent to send to the element.
*/
vfunc_send_event(event: Event): boolean;
/**
* Sets the bus of the element. Increases the refcount on the bus.
* For internal use only, unless you're testing elements.
*
* MT safe.
* @param bus the #GstBus to set.
*/
vfunc_set_bus(bus?: Bus | null): void;
/**
* Sets the clock for the element. This function increases the
* refcount on the clock. Any previously set clock on the object
* is unreffed.
* @param clock the #GstClock to set for the element.
*/
vfunc_set_clock(clock?: Clock | null): boolean;
/**
* Sets the context of the element. Increases the refcount of the context.
*
* MT safe.
* @param context the #GstContext to set.
*/
vfunc_set_context(context: Context): void;
/**
* Sets the state of the element. This function will try to set the
* requested state by going through all the intermediary states and calling
* the class's state change function for each.
*
* This function can return #GST_STATE_CHANGE_ASYNC, in which case the
* element will perform the remainder of the state change asynchronously in
* another thread.
* An application can use gst_element_get_state() to wait for the completion
* of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
* %GST_MESSAGE_STATE_CHANGED on the bus.
*
* State changes to %GST_STATE_READY or %GST_STATE_NULL never return
* #GST_STATE_CHANGE_ASYNC.
* @param state the element's new #GstState.
*/
vfunc_set_state(state: State): StateChangeReturn;
/**
* called immediately after a new state was set.
* @param oldstate
* @param newstate
* @param pending
*/
vfunc_state_changed(oldstate: State, newstate: State, pending: State): void;
// Methods
/**
* 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.
*/
abort_state(): void;
/**
* Adds a pad (link point) to `element`. `pad'`s parent will be set to `element;`
* see gst_object_set_parent() for refcounting information.
*
* Pads are automatically activated when added in the PAUSED or PLAYING
* state.
*
* The pad and the element should be unlocked when calling this function.
*
* This function will emit the #GstElement::pad-added signal on the element.
* @param pad the #GstPad to add to the element.
* @returns %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.
*/
add_pad(pad: Pad): boolean;
add_property_deep_notify_watch(property_name: string | null, include_value: boolean): number;
add_property_notify_watch(property_name: string | null, include_value: boolean): number;
/**
* 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.
* @param func Function to call asynchronously from another thread
*/
call_async(func: ElementCallAsyncFunc): void;
/**
* Perform `transition` on `element`.
*
* This function must be called with STATE_LOCK held and is mainly used
* internally.
* @param transition the requested transition
* @returns the #GstStateChangeReturn of the state transition.
*/
change_state(transition: StateChange | null): StateChangeReturn;
/**
* Commit the state change of the element and proceed to the next
* pending state if any. This function is used
* by elements that do asynchronous state changes.
* The core will normally call this method automatically when an
* element returned %GST_STATE_CHANGE_SUCCESS from the state change function.
*
* If after calling this method the element still has not reached
* the pending state, the next state change is performed.
*
* This method is used internally and should normally not be called by plugins
* or applications.
*
* This function must be called with STATE_LOCK held.
* @param ret The previous state return value
* @returns The result of the commit state change. MT safe.
*/
continue_state(ret: StateChangeReturn | null): StateChangeReturn;
/**
* Creates a pad for each pad template that is always available.
* This function is only useful during object initialization of
* subclasses of #GstElement.
*/
create_all_pads(): void;
/**
* Creates a stream-id for `element` by combining the upstream information with
* the `stream_id`.
*
* This function generates an unique stream-id by getting the upstream
* stream-start event stream ID and appending `stream_id` to it. If the element
* has no sinkpad it will generate an upstream stream-id by doing an URI query
* on the element and in the worst case just uses a random number. Source
* elements that don't implement the URI handler interface should ideally
* generate a unique, deterministic stream-id manually instead.
*
* Since stream IDs are sorted alphabetically, any numbers in the stream ID
* should be printed with a fixed number of characters, preceded by 0's, such as
* by using the format \%03u instead of \%u.
* @param stream_id The stream-id
* @returns A stream-id for @element.
*/
decorate_stream_id(stream_id: string): string;
/**
* 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.
* @param func function to call for each pad
* @returns %FALSE if @element had no pads or if one of the calls to @func returned %FALSE.
*/
foreach_pad(func: ElementForeachPadFunc): boolean;
/**
* 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.
* @param func function to call for each sink pad
* @returns %FALSE if @element had no sink pads or if one of the calls to @func returned %FALSE.
*/
foreach_sink_pad(func: ElementForeachPadFunc): boolean;
/**
* 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.
* @param func function to call for each source pad
* @returns %FALSE if @element had no source pads or if one of the calls to @func returned %FALSE.
*/
foreach_src_pad(func: ElementForeachPadFunc): boolean;
/**
* 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.
* @returns the base time of the element. MT safe.
*/
get_base_time(): ClockTime;
/**
* Returns the bus of the element. Note that only a #GstPipeline will provide a
* bus for the application.
* @returns the element's #GstBus. unref after usage. MT safe.
*/
get_bus(): Bus | null;
/**
* 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.
* @returns the #GstClock of the element. unref after usage. MT safe.
*/
get_clock(): Clock | null;
/**
* 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`.
* @param pad the #GstPad to find a compatible one for.
* @param caps the #GstCaps to use as a filter.
* @returns the #GstPad to which a link can be made, or %NULL if one cannot be found. gst_object_unref() after usage.
*/
get_compatible_pad(pad: Pad, caps?: Caps | null): Pad | null;
/**
* Retrieves a pad template from `element` that is compatible with `compattempl`.
* Pads from compatible templates can be linked together.
* @param compattempl the #GstPadTemplate to find a compatible template for
* @returns a compatible #GstPadTemplate, or %NULL if none was found. No unreferencing is necessary.
*/
get_compatible_pad_template(compattempl: PadTemplate): PadTemplate | null;
/**
* Gets the context with `context_type` set on the element or NULL.
*
* MT safe.
* @param context_type a name of a context to retrieve
* @returns A #GstContext or NULL
*/
get_context(context_type: string): Context | null;
/**
* Gets the context with `context_type` set on the element or NULL.
* @param context_type a name of a context to retrieve
* @returns A #GstContext or NULL
*/
get_context_unlocked(context_type: string): Context | null;
/**
* Gets the contexts set on the element.
*
* MT safe.
* @returns List of #GstContext
*/
get_contexts(): Context[];
/**
* 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.
* @returns the clock time of the element, or GST_CLOCK_TIME_NONE if there is no clock.
*/
get_current_clock_time(): ClockTime;
/**
* Returns the running time of the element. The running time is the
* element's clock time minus its base time. Will return GST_CLOCK_TIME_NONE
* if the element has no clock, or if its base time has not been set.
* @returns the running time of the element, or GST_CLOCK_TIME_NONE if the element has no clock or its base time has not been set.
*/
get_current_running_time(): ClockTime;
/**
* Retrieves the factory that was used to create this element.
* @returns the #GstElementFactory used for creating this element or %NULL if element has not been registered (static element). no refcounting is needed.
*/
get_factory(): ElementFactory | null;
/**
* Get metadata with `key` in `klass`.
* @param key the key to get
* @returns the metadata for @key.
*/
get_metadata(key: string): string;
/**
* Retrieves a padtemplate from `element` with the given name.
* @param name the name of the #GstPadTemplate to get.
* @returns the #GstPadTemplate with the given name, or %NULL if none was found. No unreferencing is necessary.
*/
get_pad_template(name: string): PadTemplate | null;
/**
* Retrieves a list of the pad templates associated with `element`. The
* list must not be modified by the calling code.
* @returns the #GList of pad templates.
*/
get_pad_template_list(): PadTemplate[];
/**
* The name of this function is confusing to people learning GStreamer.
* gst_element_request_pad_simple() aims at making it more explicit it is
* a simplified gst_element_request_pad().
* @param name the name of the request #GstPad to retrieve.
* @returns requested #GstPad if found, otherwise %NULL. Release after usage.
*/
get_request_pad(name: string): Pad | null;
/**
* Returns the start time of the element. The start time is the
* running time of the clock when this element was last put to PAUSED.
*
* Usually the start_time is managed by a toplevel element such as
* #GstPipeline.
*
* MT safe.
* @returns the start time of the element.
*/
get_start_time(): ClockTime;
/**
* 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.
* @param timeout a #GstClockTime to specify the timeout for an async state change or %GST_CLOCK_TIME_NONE for infinite timeout.
* @returns %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.
*/
get_state(timeout: ClockTime): [StateChangeReturn, State | null, State | null];
/**
* Retrieves a pad from `element` by name. This version only retrieves
* already-existing (i.e. 'static') pads.
* @param name the name of the static #GstPad to retrieve.
* @returns the requested #GstPad if found, otherwise %NULL. unref after usage. MT safe.
*/
get_static_pad(name: string): Pad | null;
/**
* Checks if the state of an element is locked.
* If the state of an element is locked, state changes of the parent don't
* affect the element.
* This way you can leave currently unused elements inside bins. Just lock their
* state before changing the state from #GST_STATE_NULL.
*
* MT safe.
* @returns %TRUE, if the element's state is locked.
*/
is_locked_state(): boolean;
/**
* 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.
* @returns the #GstIterator of #GstPad. MT safe.
*/
iterate_pads(): Iterator;
/**
* Retrieves an iterator of `element'`s sink pads.
*
* The order of pads returned by the iterator will be the order in which
* the pads were added to the element.
* @returns the #GstIterator of #GstPad. MT safe.
*/
iterate_sink_pads(): Iterator;
/**
* Retrieves an iterator of `element'`s source pads.
*
* The order of pads returned by the iterator will be the order in which
* the pads were added to the element.
* @returns the #GstIterator of #GstPad. MT safe.
*/
iterate_src_pads(): Iterator;
/**
* 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.
* @param dest the #GstElement containing the destination pad.
* @returns %TRUE if the elements could be linked, %FALSE otherwise.
*/
link(dest: Element): boolean;
/**
* 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.
* @param dest the #GstElement containing the destination pad.
* @param filter the #GstCaps to filter the link, or %NULL for no filter.
* @returns %TRUE if the pads could be linked, %FALSE otherwise.
*/
link_filtered(dest: Element, filter?: Caps | null): boolean;
/**
* 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.
* @param srcpadname the name of the #GstPad in source element or %NULL for any pad.
* @param dest the #GstElement containing the destination pad.
* @param destpadname the name of the #GstPad in destination element, or %NULL for any pad.
* @returns %TRUE if the pads could be linked, %FALSE otherwise.
*/
link_pads(srcpadname: string | null, dest: Element, destpadname?: string | null): boolean;
/**
* 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`.
* @param srcpadname the name of the #GstPad in source element or %NULL for any pad.
* @param dest the #GstElement containing the destination pad.
* @param destpadname the name of the #GstPad in destination element or %NULL for any pad.
* @param filter the #GstCaps to filter the link, or %NULL for no filter.
* @returns %TRUE if the pads could be linked, %FALSE otherwise.
*/
link_pads_filtered(
srcpadname: string | null,
dest: Element,
destpadname?: string | null,
filter?: Caps | null,
): boolean;
/**
* 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().
* @param srcpadname the name of the #GstPad in source element or %NULL for any pad.
* @param dest the #GstElement containing the destination pad.
* @param destpadname the name of the #GstPad in destination element, or %NULL for any pad.
* @param flags the #GstPadLinkCheck to be performed when linking pads.
* @returns %TRUE if the pads could be linked, %FALSE otherwise.
*/
link_pads_full(
srcpadname: string | null,
dest: Element,
destpadname: string | null,
flags: PadLinkCheck | null,
): boolean;
/**
* 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.
*/
lost_state(): void;
/**
* Post an error, warning or info message on the bus from inside an element.
*
* `type` must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
* #GST_MESSAGE_INFO.
*
* MT safe.
* @param type the #GstMessageType
* @param domain the GStreamer GError domain this message belongs to
* @param code the GError code belonging to the domain
* @param text an allocated text string to be used as a replacement for the default message connected to code, or %NULL
* @param debug an allocated debug message to be used as a replacement for the default debugging information, or %NULL
* @param file the source code file where the error was generated
* @param _function the source code function where the error was generated
* @param line the source code line where the error was generated
*/
message_full(
type: MessageType | null,
domain: GLib.Quark,
code: number,
text: string | null,
debug: string | null,
file: string,
_function: string,
line: number,
): void;
/**
* Post an error, warning or info message on the bus from inside an element.
*
* `type` must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
* #GST_MESSAGE_INFO.
* @param type the #GstMessageType
* @param domain the GStreamer GError domain this message belongs to
* @param code the GError code belonging to the domain
* @param text an allocated text string to be used as a replacement for the default message connected to code, or %NULL
* @param debug an allocated debug message to be used as a replacement for the default debugging information, or %NULL
* @param file the source code file where the error was generated
* @param _function the source code function where the error was generated
* @param line the source code line where the error was generated
* @param structure optional details structure
*/
message_full_with_details(
type: MessageType | null,
domain: GLib.Quark,
code: number,
text: string | null,
debug: string | null,
file: string,
_function: string,
line: number,
structure: Structure,
): void;
/**
* Use this function to signal that the element does not expect any more pads
* to show up in the current pipeline. This function should be called whenever
* pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
* pad templates use this in combination with autopluggers to figure out that
* the element is done initializing its pads.
*
* This function emits the #GstElement::no-more-pads signal.
*
* MT safe.
*/
no_more_pads(): void;
/**
* Post a message on the element's #GstBus. This function takes ownership of the
* message; if you want to access the message after this call, you should add an
* additional reference before calling.
* @param message a #GstMessage to post
* @returns %TRUE if the message was successfully posted. The function returns %FALSE if the element did not have a bus. MT safe.
*/
post_message(message: Message): boolean;
/**
* 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.
* @returns the GstClock provided by the element or %NULL if no clock could be provided. Unref after usage. MT safe.
*/
provide_clock(): Clock | null;
/**
* 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.
* @param query the #GstQuery.
* @returns %TRUE if the query could be performed. MT safe.
*/
query(query: Query): boolean;
/**
* Queries an element to convert `src_val` in `src_format` to `dest_format`.
* @param src_format a #GstFormat to convert from.
* @param src_val a value to convert.
* @param dest_format the #GstFormat to convert to.
* @returns %TRUE if the query could be performed.
*/
query_convert(src_format: Format | null, src_val: number, dest_format: Format | null): [boolean, number];
/**
* 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.
* @param format the #GstFormat requested
* @returns %TRUE if the query could be performed.
*/
query_duration(format: Format | null): [boolean, number];
/**
* 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().
* @param format the #GstFormat requested
* @returns %TRUE if the query could be performed.
*/
query_position(format: Format | null): [boolean, number];
/**
* 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.
* @param pad the #GstPad to release.
*/
release_request_pad(pad: Pad): void;
/**
* Removes `pad` from `element`. `pad` will be destroyed if it has not been
* referenced elsewhere using gst_object_unparent().
*
* This function is used by plugin developers and should not be used
* by applications. Pads that were dynamically requested from elements
* with gst_element_request_pad() should be released with the
* gst_element_release_request_pad() function instead.
*
* Pads are not automatically deactivated so elements should perform the needed
* steps to deactivate the pad in case this pad is removed in the PAUSED or
* PLAYING state. See gst_pad_set_active() for more information about
* deactivating pads.
*
* The pad and the element should be unlocked when calling this function.
*
* This function will emit the #GstElement::pad-removed signal on the element.
* @param pad the #GstPad to remove from the element.
* @returns %TRUE if the pad could be removed. Can return %FALSE if the pad does not belong to the provided element. MT safe.
*/
remove_pad(pad: Pad): boolean;
remove_property_notify_watch(watch_id: number): void;
/**
* 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().
* @param templ a #GstPadTemplate of which we want a pad of.
* @param name the name of the request #GstPad to retrieve. Can be %NULL.
* @param caps the caps of the pad we want to request. Can be %NULL.
* @returns requested #GstPad if found, otherwise %NULL. Release after usage.
*/
request_pad(templ: PadTemplate, name?: string | null, caps?: Caps | null): Pad | null;
/**
* 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.
* @param name the name of the request #GstPad to retrieve.
* @returns requested #GstPad if found, otherwise %NULL. Release after usage.
*/
request_pad_simple(name: string): Pad | null;
/**
* 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.
* @param rate The new playback rate
* @param format The format of the seek values
* @param flags The optional seek flags.
* @param start_type The type and flags for the new start position
* @param start The value of the new start position
* @param stop_type The type and flags for the new stop position
* @param stop The value of the new stop position
* @returns %TRUE if the event was handled. Flushing seeks will trigger a preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
*/
seek(
rate: number,
format: Format | null,
flags: SeekFlags | null,
start_type: SeekType | null,
start: number,
stop_type: SeekType | null,
stop: number,
): boolean;
/**
* 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.
* @param format a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
* @param seek_flags seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
* @param seek_pos position to seek to (relative to the start); if you are doing a seek in #GST_FORMAT_TIME this value is in nanoseconds - multiply with #GST_SECOND to convert seconds to nanoseconds or with #GST_MSECOND to convert milliseconds to nanoseconds.
* @returns %TRUE if the seek operation succeeded. Flushing seeks will trigger a preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
*/
seek_simple(format: Format | null, seek_flags: SeekFlags | null, seek_pos: number): boolean;
/**
* 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.
* @param event the #GstEvent to send to the element.
* @returns %TRUE if the event was handled. Events that trigger a preroll (such as flushing seeks and steps) will emit %GST_MESSAGE_ASYNC_DONE.
*/
send_event(event: Event): boolean;
/**
* Set the base time of an element. See gst_element_get_base_time().
*
* MT safe.
* @param time the base time to set.
*/
set_base_time(time: ClockTime): void;
/**
* Sets the bus of the element. Increases the refcount on the bus.
* For internal use only, unless you're testing elements.
*
* MT safe.
* @param bus the #GstBus to set.
*/
set_bus(bus?: Bus | null): void;
/**
* Sets the clock for the element. This function increases the
* refcount on the clock. Any previously set clock on the object
* is unreffed.
* @param clock the #GstClock to set for the element.
* @returns %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.
*/
set_clock(clock?: Clock | null): boolean;
/**
* Sets the context of the element. Increases the refcount of the context.
*
* MT safe.
* @param context the #GstContext to set.
*/
set_context(context: Context): void;
/**
* 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.
* @param locked_state %TRUE to lock the element's state
* @returns %TRUE if the state was changed, %FALSE if bad parameters were given or the elements state-locking needed no change.
*/
set_locked_state(locked_state: boolean): boolean;
/**
* Set the start time of an element. The start time of the element is the
* running time of the element when it last went to the PAUSED state. In READY
* or after a flushing seek, it is set to 0.
*
* Toplevel elements like #GstPipeline will manage the start_time and
* base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE
* on such a toplevel element will disable the distribution of the base_time to
* the children and can be useful if the application manages the base_time
* itself, for example if you want to synchronize capture from multiple
* pipelines, and you can also ensure that the pipelines have the same clock.
*
* MT safe.
* @param time the base time to set.
*/
set_start_time(time: ClockTime): void;
/**
* Sets the state of the element. This function will try to set the
* requested state by going through all the intermediary states and calling
* the class's state change function for each.
*
* This function can return #GST_STATE_CHANGE_ASYNC, in which case the
* element will perform the remainder of the state change asynchronously in
* another thread.
* An application can use gst_element_get_state() to wait for the completion
* of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
* %GST_MESSAGE_STATE_CHANGED on the bus.
*
* State changes to %GST_STATE_READY or %GST_STATE_NULL never return
* #GST_STATE_CHANGE_ASYNC.
* @param state the element's new #GstState.
* @returns Result of the state change using #GstStateChangeReturn. MT safe.
*/
set_state(state: State | null): StateChangeReturn;
/**
* 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.
* @returns %TRUE, if the element's state could be synced to the parent's state. MT safe.
*/
sync_state_with_parent(): boolean;
/**
* 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().
* @param dest the sink #GstElement to unlink.
*/
unlink(dest: Element): void;
/**
* Unlinks the two named pads of the source and destination elements.
*
* This is a convenience function for gst_pad_unlink().
* @param srcpadname the name of the #GstPad in source element.
* @param dest a #GstElement containing the destination pad.
* @param destpadname the name of the #GstPad in destination element.
*/
unlink_pads(srcpadname: string, dest: Element, destpadname: string): void;
}
namespace ElementFactory {
// Constructor properties interface
interface ConstructorProps extends PluginFeature.ConstructorProps {}
}
/**
* #GstElementFactory is used to create instances of elements. A
* GstElementFactory can be added to a #GstPlugin as it is also a
* #GstPluginFeature.
*
* Use the gst_element_factory_find() and gst_element_factory_create()
* functions to create element instances or use gst_element_factory_make() as a
* convenient shortcut.
*
* The following code example shows you how to create a GstFileSrc element.
*
* ## Using an element factory
*
* ```c
* #include
*
* 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);
* ...
* ```
*
*/
class ElementFactory extends PluginFeature {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Search for an element factory of the given name. Refs the returned
* element factory; caller is responsible for unreffing.
* @param name name of factory to find
*/
static find(name: string): ElementFactory | null;
/**
* 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.
* @param list a #GList of #GstElementFactory to filter
* @param caps a #GstCaps
* @param direction a #GstPadDirection to filter on
* @param subsetonly whether to filter on caps subsets or not.
*/
static list_filter(
list: ElementFactory[],
caps: Caps,
direction: PadDirection,
subsetonly: boolean,
): ElementFactory[];
/**
* 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.
* @param type a #GstElementFactoryListType
* @param minrank Minimum rank
*/
static list_get_elements(type: ElementFactoryListType, minrank: Rank): ElementFactory[];
/**
* 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.
* @param factoryname a named factory to instantiate
* @param name name of new element, or %NULL to automatically create a unique name
*/
static make(factoryname: string, name?: string | null): Element | null;
/**
* Create a new element of the type defined by the given elementfactory.
* The supplied list of properties, will be passed at object construction.
* @param factoryname a named factory to instantiate
* @param names array of properties names
* @param values array of associated properties values
*/
static make_with_properties(
factoryname: string,
names?: string[] | null,
values?: GObject.Value[] | null,
): Element | null;
// Methods
/**
* Checks if the factory can sink all possible capabilities.
* @param caps the caps to check
* @returns %TRUE if the caps are fully compatible.
*/
can_sink_all_caps(caps: Caps): boolean;
/**
* Checks if the factory can sink any possible capability.
* @param caps the caps to check
* @returns %TRUE if the caps have a common subset.
*/
can_sink_any_caps(caps: Caps): boolean;
/**
* Checks if the factory can src all possible capabilities.
* @param caps the caps to check
* @returns %TRUE if the caps are fully compatible.
*/
can_src_all_caps(caps: Caps): boolean;
/**
* Checks if the factory can src any possible capability.
* @param caps the caps to check
* @returns %TRUE if the caps have a common subset.
*/
can_src_any_caps(caps: Caps): boolean;
/**
* 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.
* @param name name of new element, or %NULL to automatically create a unique name
* @returns new #GstElement or %NULL if the element couldn't be created
*/
create(name?: string | null): Element | null;
/**
* Create a new element of the type defined by the given elementfactory.
* The supplied list of properties, will be passed at object construction.
* @param names array of properties names
* @param values array of associated properties values
* @returns new #GstElement or %NULL if the element couldn't be created
*/
create_with_properties(names?: string[] | null, values?: GObject.Value[] | null): Element | null;
/**
* 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().
* @returns the #GType for elements managed by this factory or 0 if the factory is not loaded.
*/
get_element_type(): GObject.GType;
/**
* Get the metadata on `factory` with `key`.
* @param key a key
* @returns the metadata with @key on @factory or %NULL when there was no metadata with the given @key.
*/
get_metadata(key: string): string | null;
/**
* Get the available keys for the metadata on `factory`.
* @returns a %NULL-terminated array of key strings, or %NULL when there is no metadata. Free with g_strfreev() when no longer needed.
*/
get_metadata_keys(): string[] | null;
/**
* Gets the number of pad_templates in this factory.
* @returns the number of pad_templates
*/
get_num_pad_templates(): number;
/**
* Queries whether registered element managed by `factory` needs to
* be excluded from documentation system or not.
* @returns %TRUE if documentation should be skipped
*/
get_skip_documentation(): boolean;
/**
* Gets the #GList of #GstStaticPadTemplate for this factory.
* @returns the static pad templates
*/
get_static_pad_templates(): StaticPadTemplate[];
/**
* 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.
* @returns the supported protocols or %NULL
*/
get_uri_protocols(): string[];
/**
* Gets the type of URIs the element supports or #GST_URI_UNKNOWN if none.
* @returns type of URIs this element supports
*/
get_uri_type(): URIType;
/**
* Check if `factory` implements the interface with name `interfacename`.
* @param interfacename an interface name
* @returns %TRUE when @factory implement the interface.
*/
has_interface(interfacename: string): boolean;
/**
* Check if `factory` is of the given types.
* @param type a #GstElementFactoryListType
* @returns %TRUE if @factory is of @type.
*/
list_is_type(type: ElementFactoryListType): boolean;
}
/**
* A fundamental type that describes a 32-bit flag bitfield, with 32-bit
* mask indicating which of the bits in the field are explicitly set.
*/
class FlagSet {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
// Static methods
/**
* Create a new sub-class of #GST_TYPE_FLAG_SET
* which will pretty-print the human-readable flags
* when serializing, for easier debugging.
* @param flags_type a #GType of a #G_TYPE_FLAGS type.
*/
static register(flags_type: GObject.GType): GObject.GType;
}
/**
* A fundamental type that describes a fraction of an integer numerator
* over an integer denominator
*/
class Fraction {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
/**
* A fundamental type that describes a #GstFractionRange range
*/
class FractionRange {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
namespace GhostPad {
// Constructor properties interface
interface ConstructorProps extends ProxyPad.ConstructorProps {}
}
/**
* GhostPads are useful when organizing pipelines with #GstBin like elements.
* The idea here is to create hierarchical element graphs. The bin element
* contains a sub-graph. Now one would like to treat the bin-element like any
* other #GstElement. This is where GhostPads come into play. A GhostPad acts as
* a proxy for another pad. Thus the bin can have sink and source ghost-pads
* that are associated with sink and source pads of the child elements.
*
* If the target pad is known at creation time, gst_ghost_pad_new() is the
* function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target()
* to create the ghost-pad and use gst_ghost_pad_set_target() to establish the
* association later on.
*
* Note that GhostPads add overhead to the data processing of a pipeline.
*/
class GhostPad extends ProxyPad {
static $gtype: GObject.GType;
// Fields
pad: ProxyPad;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string | null, target: Pad): GhostPad;
// Conflicted with Gst.Pad.new
static ['new'](...args: never[]): any;
static new_from_template(name: string | null, target: Pad, templ: PadTemplate): GhostPad;
// Conflicted with Gst.Pad.new_from_template
static new_from_template(...args: never[]): any;
static new_no_target(name: string | null, dir: PadDirection): GhostPad;
static new_no_target_from_template(name: string | null, templ: PadTemplate): GhostPad;
// Static methods
/**
* Invoke the default activate mode function of a ghost pad.
* @param pad the #GstPad to activate or deactivate.
* @param parent the parent of @pad or %NULL
* @param mode the requested activation mode
* @param active whether the pad should be active or not.
*/
static activate_mode_default(pad: Pad, parent: Object | null, mode: PadMode, active: boolean): boolean;
/**
* Invoke the default activate mode function of a proxy pad that is
* owned by a ghost pad.
* @param pad the #GstPad to activate or deactivate.
* @param parent the parent of @pad or %NULL
* @param mode the requested activation mode
* @param active whether the pad should be active or not.
*/
static internal_activate_mode_default(
pad: Pad,
parent: Object | null,
mode: PadMode,
active: boolean,
): boolean;
// Methods
/**
* Finish initialization of a newly allocated ghost pad.
*
* This function is most useful in language bindings and when subclassing
* #GstGhostPad; plugin and application developers normally will not call this
* function. Call this function directly after a call to g_object_new
* (GST_TYPE_GHOST_PAD, "direction", `dir,` ..., NULL).
* @returns %TRUE if the construction succeeds, %FALSE otherwise.
*/
construct(): boolean;
/**
* Get the target pad of `gpad`. Unref target pad after usage.
* @returns the target #GstPad, can be %NULL if the ghostpad has no target set. Unref target pad after usage.
*/
get_target(): Pad | null;
/**
* 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.
* @param newtarget the new pad target
* @returns %TRUE if the new target could be set. This function can return %FALSE when the internal pads could not be linked.
*/
set_target(newtarget?: Pad | null): boolean;
}
/**
* A fundamental type that describes a #gint64 range
*/
class Int64Range {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
/**
* A fundamental type that describes a #gint range
*/
class IntRange {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
namespace Object {
// Signal callback interfaces
interface DeepNotify {
(prop_object: Object, prop: GObject.ParamSpec): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {
name: string;
parent: Object;
}
}
/**
* #GstObject provides a root for the object hierarchy tree filed in by the
* GStreamer library. It is currently a thin wrapper on top of
* #GInitiallyUnowned. It is an abstract class that is not very usable on its own.
*
* #GstObject gives us basic refcounting, parenting functionality and locking.
* Most of the functions are just extended for special GStreamer needs and can be
* found under the same name in the base class of #GstObject which is #GObject
* (e.g. g_object_ref() becomes gst_object_ref()).
*
* Since #GstObject derives from #GInitiallyUnowned, it also inherits the
* floating reference. Be aware that functions such as gst_bin_add() and
* gst_element_add_pad() take ownership of the floating reference.
*
* In contrast to #GObject instances, #GstObject adds a name property. The functions
* gst_object_set_name() and gst_object_get_name() are used to set/get the name
* of the object.
*
* ## controlled properties
*
* Controlled properties offers a lightweight way to adjust gobject properties
* over stream-time. It works by using time-stamped value pairs that are queued
* for element-properties. At run-time the elements continuously pull value
* changes for the current stream-time.
*
* What needs to be changed in a #GstElement?
* Very little - it is just two steps to make a plugin controllable!
*
* * mark gobject-properties paramspecs that make sense to be controlled,
* by GST_PARAM_CONTROLLABLE.
*
* * when processing data (get, chain, loop function) at the beginning call
* gst_object_sync_values(element,timestamp).
* This will make the controller update all GObject properties that are
* under its control with the current values based on the timestamp.
*
* What needs to be done in applications? Again it's not a lot to change.
*
* * create a #GstControlSource.
* csource = gst_interpolation_control_source_new ();
* g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
*
* * Attach the #GstControlSource on the controller to a property.
* gst_object_add_control_binding (object, gst_direct_control_binding_new (object, "prop1", csource));
*
* * Set the control values
* gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,0 * GST_SECOND, value1);
* gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,1 * GST_SECOND, value2);
*
* * start your pipeline
*/
abstract class Object extends GObject.InitiallyUnowned {
static $gtype: GObject.GType