UNPKG

@girs/gst-1.0

Version:

GJS TypeScript type definitions for Gst-1.0, generated from library version 1.28.1

1,885 lines (1,699 loc) 1.04 MB
/** * 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, ... */ import '@girs/gjs'; // Module dependencies import type GObject from '@girs/gobject-2.0'; import type GLib from '@girs/glib-2.0'; import type GModule from '@girs/gmodule-2.0'; export namespace Gst { /** * Gst-1.0 */ /** * @gir-type Enum */ export namespace BufferingMode { export const $gtype: GObject.GType<BufferingMode>; } /** * The different types of buffering methods. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace BusSyncReply { export const $gtype: GObject.GType<BusSyncReply>; } /** * The result values for a GstBusSyncHandler. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace CapsIntersectMode { export const $gtype: GObject.GType<CapsIntersectMode>; } /** * Modes of caps intersection * * {@link Gst.CapsIntersectMode.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. * * {@link Gst.CapsIntersectMode.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. * @gir-type Enum */ enum CapsIntersectMode { /** * Zig-zags over both caps. */ ZIG_ZAG, /** * Keeps the first caps order. */ FIRST, } /** * @gir-type Enum */ export namespace ClockEntryType { export const $gtype: GObject.GType<ClockEntryType>; } /** * The type of the clock entry * @gir-type Enum */ enum ClockEntryType { /** * a single shot timeout */ SINGLE, /** * a periodic timeout request */ PERIODIC, } /** * @gir-type Enum */ export namespace ClockReturn { export const $gtype: GObject.GType<ClockReturn>; } /** * The return value of a clock operation. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace ClockType { export const $gtype: GObject.GType<ClockType>; } /** * The different kind of clocks. * @gir-type Enum */ 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. * @gir-type Struct */ class CoreError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace DebugColorMode { export const $gtype: GObject.GType<DebugColorMode>; } /** * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace DebugLevel { export const $gtype: GObject.GType<DebugLevel>; } /** * 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. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace EventType { export const $gtype: GObject.GType<EventType>; } /** * {@link Gst.EventType} lists the standard event types that can be sent in a pipeline. * * The custom event types can be used for private messages between elements * that can't be expressed using normal * GStreamer buffer passing semantics. Custom events carry an arbitrary * {@link Gst.Structure}. * Specific custom events are distinguished by the name of the structure. * @gir-type Enum */ 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, /** * {@link Gst.Caps} 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 {@link Gst.StreamCollection} 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, } /** * @gir-type Enum */ export namespace FlowReturn { export const $gtype: GObject.GType<FlowReturn>; } /** * The result of passing data to a pad. * * Note that the custom return values should not be exposed outside of the * element scope. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace Format { export const $gtype: GObject.GType<Format>; } /** * Standard predefined formats * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace IteratorItem { export const $gtype: GObject.GType<IteratorItem>; } /** * The result of a {@link Gst.IteratorItemFunction}. * @gir-type Enum */ enum IteratorItem { /** * Skip this item */ SKIP, /** * Return item */ PASS, /** * Stop after this item. */ END, } /** * @gir-type Enum */ export namespace IteratorResult { export const $gtype: GObject.GType<IteratorResult>; } /** * The result of `gst_iterator_next()`. * @gir-type Enum */ 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, ...) * @gir-type Struct */ class LibraryError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace PadDirection { export const $gtype: GObject.GType<PadDirection>; } /** * The direction of a pad. * @gir-type Enum */ enum PadDirection { /** * direction is unknown. */ UNKNOWN, /** * the pad is a source pad. */ SRC, /** * the pad is a sink pad. */ SINK, } /** * @gir-type Enum */ export namespace PadLinkReturn { export const $gtype: GObject.GType<PadLinkReturn>; } /** * Result values from gst_pad_link and friends. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace PadMode { export const $gtype: GObject.GType<PadMode>; } /** * 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. * @gir-type Enum */ enum PadMode { /** * Pad will not handle dataflow */ NONE, /** * Pad handles dataflow in downstream push mode */ PUSH, /** * Pad handles dataflow in upstream pull mode */ PULL, } /** * @gir-type Enum */ export namespace PadPresence { export const $gtype: GObject.GType<PadPresence>; } /** * Indicates when this pad will become available. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace PadProbeReturn { export const $gtype: GObject.GType<PadProbeReturn>; } /** * Different return values for the {@link Gst.PadProbeCallback}. * @gir-type Enum */ 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 {@link Gst.FlowReturn.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 * {@link Gst.PadProbeReturn.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 {@link Gst.FlowReturn} 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. * @gir-type Struct */ class ParseError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods /** * Get the error quark used by the parsing subsystem. */ static quark(): GLib.Quark; } /** * The plugin loading errors * @gir-type Struct */ class PluginError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods /** * Get the error quark. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace ProgressType { export const $gtype: GObject.GType<ProgressType>; } /** * The type of a {@link Gst.MessageType.PROGRESS}. The progress messages inform the * application of the status of asynchronous tasks. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace PromiseResult { export const $gtype: GObject.GType<PromiseResult>; } /** * The result of a {@link Gst.Promise} * @gir-type Enum * @since 1.14 */ 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, } /** * @gir-type Enum */ export namespace QOSType { export const $gtype: GObject.GType<QOSType>; } /** * The different types of QoS events that can be given to the * `gst_event_new_qos()` method. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace QueryType { export const $gtype: GObject.GType<QueryType>; } /** * Standard predefined Query types * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace Rank { export const $gtype: GObject.GType<Rank>; } /** * Element priority ranks. Defines the order in which the autoplugger (or * similar rank-picking mechanisms, such as e.g. `gst_element_make_from_uri()`) * will choose this element over an alternative one with the same function. * * These constants serve as a rough guidance for defining the rank of a * {@link Gst.PluginFeature}. Any value is valid, including values bigger than * `GST_RANK_PRIMARY`. * @gir-type Enum */ 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. * @gir-type Struct */ class ResourceError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace SearchMode { export const $gtype: GObject.GType<SearchMode>; } /** * The different search modes. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace SeekType { export const $gtype: GObject.GType<SeekType>; } /** * The different types of seek events. When constructing a seek event with * `gst_event_new_seek()` or when doing gst_segment_do_seek (). * @gir-type Enum */ enum SeekType { /** * no change in position is required */ NONE, /** * absolute position is requested */ SET, /** * relative position to duration is requested */ END, } /** * @gir-type Enum */ export namespace State { export const $gtype: GObject.GType<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()`. * @gir-type Enum */ 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 {@link Gst.Clock} is running and * the data is flowing. */ PLAYING, } /** * @gir-type Enum */ export namespace StateChange { export const $gtype: GObject.GType<StateChange>; } /** * These are the different state changes an element goes through. * {@link Gst.State.NULL} &rArr; {@link Gst.State.PLAYING} is called an upwards state change * and {@link Gst.State.PLAYING} &rArr; {@link Gst.State.NULL} a downwards state change. * @gir-type Enum */ 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 {@link Gst.StateChangeReturn.ASYNC} and complete * the state change when they have enough information. It is a requirement * for sinks to return {@link Gst.StateChangeReturn.ASYNC} and complete the state change * when they receive the first buffer or {@link Gst.EventType.EOS} (preroll). * Sinks also block the dataflow when in PAUSED. * * A pipeline resets the running_time to 0. * * Live sources return {@link Gst.StateChangeReturn.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 {@link Gst.Clock} and distributes this to all the children * before setting them to PLAYING. This means that it is only allowed to * synchronize on the {@link Gst.Clock} in the PLAYING state. * * The pipeline uses the {@link Gst.Clock} and the running_time to calculate the * base_time. The base_time is distributed to all children when performing * the state change. * * Sink elements stop blocking on the preroll buffer or event and start * rendering the data. * * Sinks can post {@link Gst.MessageType.EOS} in the PLAYING state. It is not allowed * to post {@link Gst.MessageType.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 {@link Gst.StateChangeReturn.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 * {@link Gst.Clock} and the base_time. It stores this information to continue * playback when going back to the PLAYING state. * * Sinks unblock any {@link Gst.Clock} 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 {@link Gst.EventType.EOS}. * * Any queued {@link Gst.MessageType.EOS} items are removed since they will be reposted * when going back to the PLAYING state. The EOS messages are queued in * {@link Gst.Bin} containers. * * Live sources stop generating data and return {@link Gst.StateChangeReturn.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 {@link Gst.FlowReturn.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, } /** * @gir-type Enum */ export namespace StateChangeReturn { export const $gtype: GObject.GType<StateChangeReturn>; } /** * The possible return values from a state change function such as * `gst_element_set_state()`. Only `GST_STATE_CHANGE_FAILURE` is a real failure. * @gir-type Enum */ 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 {@link 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, ... * @gir-type Struct */ class StreamError extends GLib.Error { static $gtype: GObject.GType<GLib.Error>; // 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 }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace StreamStatusType { export const $gtype: GObject.GType<StreamStatusType>; } /** * The type of a {@link Gst.MessageType.STREAM_STATUS}. The stream status messages inform the * application of new streaming threads and their status. * @gir-type Enum */ 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, } /** * @gir-type Enum */ export namespace StructureChangeType { export const $gtype: GObject.GType<StructureChangeType>; } /** * The type of a {@link Gst.MessageType.STRUCTURE_CHANGE}. * @gir-type Enum */ enum StructureChangeType { /** * Pad linking is starting or done. */ LINK, /** * Pad unlinking is starting or done. */ UNLINK, } /** * @gir-type Enum */ export namespace TagFlag { export const $gtype: GObject.GType<TagFlag>; } /** * Extra tag flags used when registering tags. * @gir-type Enum */ enum TagFlag { /** * undefined flag */ UNDEFINED, /** * tag is meta data