/
GstPbutils-1.0.d.ts
7455 lines (7452 loc) · 324 KB
/
GstPbutils-1.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* 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 itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* GstPbutils-1.0
*/
import type * as Gjs from './Gjs';
import type GstVideo from './GstVideo-1.0';
import type GstBase from './GstBase-1.0';
import type Gst from './Gst-1.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type GModule from './GModule-2.0';
import type GstAudio from './GstAudio-1.0';
export namespace GstPbutils {
/**
* Different types of supported background shading functions.
*/
enum AudioVisualizerShader {
/**
* no shading
*/
NONE,
/**
* plain fading
*/
FADE,
/**
* fade and move up
*/
FADE_AND_MOVE_UP,
/**
* fade and move down
*/
FADE_AND_MOVE_DOWN,
/**
* fade and move left
*/
FADE_AND_MOVE_LEFT,
/**
* fade and move right
*/
FADE_AND_MOVE_RIGHT,
/**
* fade and move horizontally out
*/
FADE_AND_MOVE_HORIZ_OUT,
/**
* fade and move horizontally in
*/
FADE_AND_MOVE_HORIZ_IN,
/**
* fade and move vertically out
*/
FADE_AND_MOVE_VERT_OUT,
/**
* fade and move vertically in
*/
FADE_AND_MOVE_VERT_IN,
}
/**
* Result values for the discovery process.
*/
enum DiscovererResult {
/**
* The discovery was successful
*/
OK,
/**
* the URI is invalid
*/
URI_INVALID,
/**
* an error happened and the GError is set
*/
ERROR,
/**
* the discovery timed-out
*/
TIMEOUT,
/**
* the discoverer was already discovering a file
*/
BUSY,
/**
* Some plugins are missing for full discovery
*/
MISSING_PLUGINS,
}
/**
* Result codes returned by gst_install_plugins_async() and
* gst_install_plugins_sync(), and also the result code passed to the
* #GstInstallPluginsResultFunc specified with gst_install_plugins_async().
*
* These codes indicate success or failure of starting an external installer
* program and to what extent the requested plugins could be installed.
*/
enum InstallPluginsReturn {
/**
* all of the requested plugins could be
* installed
*/
SUCCESS,
/**
* no appropriate installation candidate for
* any of the requested plugins could be found. Only return this if nothing
* has been installed. Return #GST_INSTALL_PLUGINS_PARTIAL_SUCCESS if
* some (but not all) of the requested plugins could be installed.
*/
NOT_FOUND,
/**
* an error occurred during the installation. If
* this happens, the user has already seen an error message and another
* one should not be displayed
*/
ERROR,
/**
* some of the requested plugins could
* be installed, but not all
*/
PARTIAL_SUCCESS,
/**
* the user has aborted the installation
*/
USER_ABORT,
/**
* the installer had an unclean exit code
* (ie. death by signal)
*/
CRASHED,
/**
* the helper returned an invalid status code
*/
INVALID,
/**
* returned by gst_install_plugins_async() to
* indicate that everything went fine so far and the provided callback
* will be called with the result of the installation later
*/
STARTED_OK,
/**
* some internal failure has
* occurred when trying to start the installer
*/
INTERNAL_FAILURE,
/**
* the helper script to call the
* actual installer is not installed
*/
HELPER_MISSING,
/**
* a previously-started plugin
* installation is still in progress, try again later
*/
INSTALL_IN_PROGRESS,
}
/**
* You can use these flags to control what is serialized by
* gst_discoverer_info_to_variant()
*/
enum DiscovererSerializeFlags {
/**
* Serialize only basic information, excluding
* caps, tags and miscellaneous information
*/
BASIC,
/**
* Serialize the caps for each stream
*/
CAPS,
/**
* Serialize the tags for each stream
*/
TAGS,
/**
* Serialize miscellaneous information for each stream
*/
MISC,
/**
* Serialize all the available info, including
* caps, tags and miscellaneous information
*/
ALL,
}
/**
* Flags that are returned by gst_pb_utils_get_caps_description_flags() and
* describe the format of the caps.
*/
enum PbUtilsCapsDescriptionFlags {
/**
* Caps describe a container format.
*/
CONTAINER,
/**
* Caps describe an audio format, or a
* container format that can store audio.
*/
AUDIO,
/**
* Caps describe an video format, or a
* container format that can store video.
*/
VIDEO,
/**
* Caps describe an image format, or a
* container format that can store image.
*/
IMAGE,
/**
* Caps describe an subtitle format, or a
* container format that can store subtitles.
*/
SUBTITLE,
/**
* Container format is a tags container.
*/
TAG,
/**
* Container format can store any kind of
* stream type.
*/
GENERIC,
}
/**
* #GstEncodingTarget category for recording and capture.
* Targets within this category are optimized for low latency encoding.
*/
const ENCODING_CATEGORY_CAPTURE: string
/**
* #GstEncodingTarget category for device-specific targets.
* The name of the target will usually be the constructor and model of the device,
* and that target will contain #GstEncodingProfiles suitable for that device.
*/
const ENCODING_CATEGORY_DEVICE: string
/**
* #GstEncodingTarget category for file extensions.
* The name of the target will be the name of the file extensions possible
* for a particular target. Those targets are defining like 'default' formats
* usually used for a particular file extension.
*/
const ENCODING_CATEGORY_FILE_EXTENSION: string
/**
* #GstEncodingTarget category for online-services.
* The name of the target will usually be the name of the online service
* and that target will contain #GstEncodingProfiles suitable for that online
* service.
*/
const ENCODING_CATEGORY_ONLINE_SERVICE: string
/**
* #GstEncodingTarget category for storage, archiving and editing targets.
* Those targets can be lossless and/or provide very fast random access content.
* The name of the target will usually be the container type or editing target,
* and that target will contain #GstEncodingProfiles suitable for editing or
* storage.
*/
const ENCODING_CATEGORY_STORAGE_EDITING: string
/**
* The major version of GStreamer's gst-plugins-base libraries at compile time.
*/
const PLUGINS_BASE_VERSION_MAJOR: number
/**
* The micro version of GStreamer's gst-plugins-base libraries at compile time.
*/
const PLUGINS_BASE_VERSION_MICRO: number
/**
* The minor version of GStreamer's gst-plugins-base libraries at compile time.
*/
const PLUGINS_BASE_VERSION_MINOR: number
/**
* The nano version of GStreamer's gst-plugins-base libraries at compile time.
* Actual releases have 0, GIT versions have 1, prerelease versions have 2-...
*/
const PLUGINS_BASE_VERSION_NANO: number
function codec_utils_aac_caps_set_level_and_profile(caps: Gst.Caps, audio_config: Uint8Array): boolean
function codec_utils_aac_get_channels(audio_config: Uint8Array): number
function codec_utils_aac_get_index_from_sample_rate(rate: number): number
function codec_utils_aac_get_level(audio_config: Uint8Array): string | null
function codec_utils_aac_get_profile(audio_config: Uint8Array): string | null
function codec_utils_aac_get_sample_rate(audio_config: Uint8Array): number
function codec_utils_aac_get_sample_rate_from_index(sr_idx: number): number
function codec_utils_caps_from_mime_codec(codecs_field: string): Gst.Caps | null
function codec_utils_caps_get_mime_codec(caps: Gst.Caps): string | null
function codec_utils_h264_caps_set_level_and_profile(caps: Gst.Caps, sps: Uint8Array): boolean
function codec_utils_h264_get_level(sps: Uint8Array): string | null
function codec_utils_h264_get_level_idc(level: string): number
function codec_utils_h264_get_profile(sps: Uint8Array): string | null
function codec_utils_h264_get_profile_flags_level(codec_data: Uint8Array): [ /* returnType */ boolean, /* profile */ number | null, /* flags */ number | null, /* level */ number | null ]
function codec_utils_h265_caps_set_level_tier_and_profile(caps: Gst.Caps, profile_tier_level: Uint8Array): boolean
function codec_utils_h265_get_level(profile_tier_level: Uint8Array): string | null
function codec_utils_h265_get_level_idc(level: string): number
function codec_utils_h265_get_profile(profile_tier_level: Uint8Array): string | null
function codec_utils_h265_get_tier(profile_tier_level: Uint8Array): string | null
function codec_utils_mpeg4video_caps_set_level_and_profile(caps: Gst.Caps, vis_obj_seq: Uint8Array): boolean
function codec_utils_mpeg4video_get_level(vis_obj_seq: Uint8Array): string | null
function codec_utils_mpeg4video_get_profile(vis_obj_seq: Uint8Array): string | null
function codec_utils_opus_create_caps(rate: number, channels: number, channel_mapping_family: number, stream_count: number, coupled_count: number, channel_mapping?: Uint8Array | null): Gst.Caps
function codec_utils_opus_create_caps_from_header(header: Gst.Buffer, comments?: Gst.Buffer | null): Gst.Caps
function codec_utils_opus_create_header(rate: number, channels: number, channel_mapping_family: number, stream_count: number, coupled_count: number, channel_mapping: Uint8Array | null, pre_skip: number, output_gain: number): Gst.Buffer
function codec_utils_opus_parse_caps(caps: Gst.Caps): [ /* returnType */ boolean, /* rate */ number | null, /* channels */ number | null, /* channel_mapping_family */ number | null, /* stream_count */ number | null, /* coupled_count */ number | null, /* channel_mapping */ Uint8Array | null ]
function codec_utils_opus_parse_header(header: Gst.Buffer): [ /* returnType */ boolean, /* rate */ number | null, /* channels */ number | null, /* channel_mapping_family */ number | null, /* stream_count */ number | null, /* coupled_count */ number | null, /* channel_mapping */ Uint8Array | null, /* pre_skip */ number | null, /* output_gain */ number | null ]
function encoding_list_all_targets(categoryname?: string | null): EncodingTarget[]
function encoding_list_available_categories(): string[]
function install_plugins_async(details: string[], ctx: InstallPluginsContext | null, func: InstallPluginsResultFunc): InstallPluginsReturn
function install_plugins_installation_in_progress(): boolean
function install_plugins_return_get_name(ret: InstallPluginsReturn): string
function install_plugins_supported(): boolean
function install_plugins_sync(details: string[], ctx?: InstallPluginsContext | null): InstallPluginsReturn
function is_missing_plugin_message(msg: Gst.Message): boolean
function missing_decoder_installer_detail_new(decode_caps: Gst.Caps): string
function missing_decoder_message_new(element: Gst.Element, decode_caps: Gst.Caps): Gst.Message
function missing_element_installer_detail_new(factory_name: string): string
function missing_element_message_new(element: Gst.Element, factory_name: string): Gst.Message
function missing_encoder_installer_detail_new(encode_caps: Gst.Caps): string
function missing_encoder_message_new(element: Gst.Element, encode_caps: Gst.Caps): Gst.Message
function missing_plugin_message_get_description(msg: Gst.Message): string
function missing_plugin_message_get_installer_detail(msg: Gst.Message): string
function missing_uri_sink_installer_detail_new(protocol: string): string
function missing_uri_sink_message_new(element: Gst.Element, protocol: string): Gst.Message
function missing_uri_source_installer_detail_new(protocol: string): string
function missing_uri_source_message_new(element: Gst.Element, protocol: string): Gst.Message
function pb_utils_add_codec_description_to_tag_list(taglist: Gst.TagList, codec_tag: string | null, caps: Gst.Caps): boolean
function pb_utils_get_caps_description_flags(caps: Gst.Caps): PbUtilsCapsDescriptionFlags
function pb_utils_get_codec_description(caps: Gst.Caps): string
function pb_utils_get_decoder_description(caps: Gst.Caps): string
function pb_utils_get_element_description(factory_name: string): string
function pb_utils_get_encoder_description(caps: Gst.Caps): string
function pb_utils_get_file_extension_from_caps(caps: Gst.Caps): string | null
function pb_utils_get_sink_description(protocol: string): string
function pb_utils_get_source_description(protocol: string): string
function pb_utils_init(): void
function plugins_base_version(): [ /* major */ number, /* minor */ number, /* micro */ number, /* nano */ number ]
function plugins_base_version_string(): string
interface AudioVisualizerShaderFunc {
(scope: AudioVisualizer, s: GstVideo.VideoFrame, d: GstVideo.VideoFrame): void
}
/**
* The prototype of the callback function that will be called once the
* external plugin installer program has returned. You only need to provide
* a callback function if you are using the asynchronous interface.
*/
interface InstallPluginsResultFunc {
(result: InstallPluginsReturn): void
}
interface AudioVisualizer_ConstructProps extends Gst.Element_ConstructProps {
/* Constructor properties of GstPbutils-1.0.GstPbutils.AudioVisualizer */
shade_amount?: number
shader?: AudioVisualizerShader
}
class AudioVisualizer {
/* Properties of GstPbutils-1.0.GstPbutils.AudioVisualizer */
shade_amount: number
shader: AudioVisualizerShader
/* Fields of Gst-1.0.Gst.Element */
object: Gst.Object
/**
* Used to serialize execution of gst_element_set_state()
*/
state_lock: GLib.RecMutex
/**
* Used to signal completion of a state change
*/
state_cond: GLib.Cond
/**
* Used to detect concurrent execution of
* gst_element_set_state() and gst_element_get_state()
*/
state_cookie: number
/**
* the target state of an element as set by the application
*/
target_state: Gst.State
/**
* the current state of an element
*/
current_state: Gst.State
/**
* the next state of an element, can be #GST_STATE_VOID_PENDING if
* the element is in the correct state.
*/
next_state: Gst.State
/**
* the final state the element should go to, can be
* #GST_STATE_VOID_PENDING if the element is in the correct state
*/
pending_state: Gst.State
/**
* the last return value of an element state change
*/
last_return: Gst.StateChangeReturn
/**
* the bus of the element. This bus is provided to the element by the
* parent element or the application. A #GstPipeline has a bus of its own.
*/
bus: Gst.Bus
/**
* the clock of the element. This clock is usually provided to the
* element by the toplevel #GstPipeline.
*/
clock: Gst.Clock
/**
* the time of the clock right before the element is set to
* PLAYING. Subtracting `base_time` from the current clock time in the PLAYING
* state will yield the running_time against the clock.
*/
base_time: Gst.ClockTimeDiff
/**
* the running_time of the last PAUSED state
*/
start_time: Gst.ClockTime
/**
* number of pads of the element, includes both source and sink pads.
*/
numpads: number
/**
* list of pads
*/
pads: Gst.Pad[]
/**
* number of source pads of the element.
*/
numsrcpads: number
/**
* list of source pads
*/
srcpads: Gst.Pad[]
/**
* number of sink pads of the element.
*/
numsinkpads: number
/**
* list of sink pads
*/
sinkpads: Gst.Pad[]
/**
* updated whenever the a pad is added or removed
*/
pads_cookie: number
/**
* list of contexts
*/
contexts: Gst.Context[]
/* Fields of Gst-1.0.Gst.Object */
/**
* object LOCK
*/
lock: GLib.Mutex
/**
* The name of the object
*/
name: string
/**
* this object's parent, weak ref
*/
parent: Gst.Object
/**
* flags for this object
*/
flags: number
/* Fields of GObject-2.0.GObject.InitiallyUnowned */
g_type_instance: GObject.TypeInstance
/* Methods of Gst-1.0.Gst.Element */
/**
* 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.
*/
add_pad(pad: Gst.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: Gst.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
*/
change_state(transition: Gst.StateChange): Gst.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
*/
continue_state(ret: Gst.StateChangeReturn): Gst.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
/**
* 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
*/
foreach_pad(func: Gst.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
*/
foreach_sink_pad(func: Gst.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
*/
foreach_src_pad(func: Gst.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.
*/
get_base_time(): Gst.ClockTime
/**
* Returns the bus of the element. Note that only a #GstPipeline will provide a
* bus for the application.
*/
get_bus(): Gst.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.
*/
get_clock(): Gst.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.
*/
get_compatible_pad(pad: Gst.Pad, caps?: Gst.Caps | null): Gst.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
*/
get_compatible_pad_template(compattempl: Gst.PadTemplate): Gst.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
*/
get_context(context_type: string): Gst.Context | null
/**
* Gets the context with `context_type` set on the element or NULL.
* @param context_type a name of a context to retrieve
*/
get_context_unlocked(context_type: string): Gst.Context | null
/**
* Gets the contexts set on the element.
*
* MT safe.
*/
get_contexts(): Gst.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.
*/
get_current_clock_time(): Gst.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.
*/
get_current_running_time(): Gst.ClockTime
/**
* Retrieves the factory that was used to create this element.
*/
get_factory(): Gst.ElementFactory | null
/**
* Get metadata with `key` in `klass`.
* @param key the key to get
*/
get_metadata(key: string): string
/**
* Retrieves a padtemplate from `element` with the given name.
* @param name the name of the #GstPadTemplate to get.
*/
get_pad_template(name: string): Gst.PadTemplate | null
/**
* Retrieves a list of the pad templates associated with `element`. The
* list must not be modified by the calling code.
*/
get_pad_template_list(): Gst.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.
*/
get_request_pad(name: string): Gst.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.
*/
get_start_time(): Gst.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.
*/
get_state(timeout: Gst.ClockTime): [ /* returnType */ Gst.StateChangeReturn, /* state */ Gst.State | null, /* pending */ Gst.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.
*/
get_static_pad(name: string): Gst.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.
*/
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.
*/
iterate_pads(): Gst.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.
*/
iterate_sink_pads(): Gst.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.
*/
iterate_src_pads(): Gst.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.
*/
link(dest: Gst.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.
*/
link_filtered(dest: Gst.Element, filter?: Gst.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.
*/
link_pads(srcpadname: string | null, dest: Gst.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.
*/
link_pads_filtered(srcpadname: string | null, dest: Gst.Element, destpadname?: string | null, filter?: Gst.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.
*/
link_pads_full(srcpadname: string | null, dest: Gst.Element, destpadname: string | null, flags: Gst.PadLinkCheck): 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: Gst.MessageType, 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: Gst.MessageType, domain: GLib.Quark, code: number, text: string | null, debug: string | null, file: string, function_: string, line: number, structure: Gst.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
*/
post_message(message: Gst.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.
*/
provide_clock(): Gst.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.
*/
query(query: Gst.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.
*/
query_convert(src_format: Gst.Format, src_val: number, dest_format: Gst.Format): [ /* returnType */ boolean, /* dest_val */ 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
*/
query_duration(format: Gst.Format): [ /* returnType */ boolean, /* duration */ number | null ]
/**
* 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
*/
query_position(format: Gst.Format): [ /* returnType */ boolean, /* cur */ number | null ]
/**
* 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: Gst.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.
*/
remove_pad(pad: Gst.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.
*/
request_pad(templ: Gst.PadTemplate, name?: string | null, caps?: Gst.Caps | null): Gst.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.
*/
request_pad_simple(name: string): Gst.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
*/
seek(rate: number, format: Gst.Format, flags: Gst.SeekFlags, start_type: Gst.SeekType, start: number, stop_type: Gst.SeekType, 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