-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgstapp-1.0.d.ts
More file actions
2217 lines (2167 loc) · 111 KB
/
gstapp-1.0.d.ts
File metadata and controls
2217 lines (2167 loc) · 111 KB
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
/// <reference path="./gstbase-1.0.d.ts" />
/// <reference path="./gst-1.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* 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://GstApp?version=1.0' {
// Module dependencies
import type GstBase from 'gi://GstBase?version=1.0';
import type Gst from 'gi://Gst?version=1.0';
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 GstApp {
/**
* GstApp-1.0
*/
export namespace AppLeakyType {
export const $gtype: GObject.GType<AppLeakyType>;
}
/**
* Buffer dropping scheme to avoid the element's internal queue to block when
* full.
*/
enum AppLeakyType {
/**
* Not Leaky
*/
NONE,
/**
* Leaky on upstream (new buffers)
*/
UPSTREAM,
/**
* Leaky on downstream (old buffers)
*/
DOWNSTREAM,
}
export namespace AppStreamType {
export const $gtype: GObject.GType<AppStreamType>;
}
/**
* The stream type.
*/
enum AppStreamType {
/**
* No seeking is supported in the stream, such as a
* live stream.
*/
STREAM,
/**
* The stream is seekable but seeking might not
* be very fast, such as data from a webserver.
*/
SEEKABLE,
/**
* The stream is seekable and seeking is fast,
* such as in a local file.
*/
RANDOM_ACCESS,
}
namespace AppSink {
// Signal signatures
interface SignalSignatures extends GstBase.BaseSink.SignalSignatures {
eos: () => void;
'new-preroll': () => Gst.FlowReturn;
'new-sample': () => Gst.FlowReturn;
'new-serialized-event': () => boolean | void;
'propose-allocation': (arg0: Gst.Query) => boolean | void;
'pull-preroll': () => Gst.Sample | null;
'pull-sample': () => Gst.Sample | null;
'try-pull-object': (arg0: number) => Gst.MiniObject | null;
'try-pull-preroll': (arg0: number) => Gst.Sample | null;
'try-pull-sample': (arg0: number) => Gst.Sample | null;
'notify::buffer-list': (pspec: GObject.ParamSpec) => void;
'notify::caps': (pspec: GObject.ParamSpec) => void;
'notify::drop': (pspec: GObject.ParamSpec) => void;
'notify::emit-signals': (pspec: GObject.ParamSpec) => void;
'notify::eos': (pspec: GObject.ParamSpec) => void;
'notify::max-buffers': (pspec: GObject.ParamSpec) => void;
'notify::max-bytes': (pspec: GObject.ParamSpec) => void;
'notify::max-time': (pspec: GObject.ParamSpec) => void;
'notify::wait-on-eos': (pspec: GObject.ParamSpec) => void;
'notify::async': (pspec: GObject.ParamSpec) => void;
'notify::blocksize': (pspec: GObject.ParamSpec) => void;
'notify::enable-last-sample': (pspec: GObject.ParamSpec) => void;
'notify::last-sample': (pspec: GObject.ParamSpec) => void;
'notify::max-bitrate': (pspec: GObject.ParamSpec) => void;
'notify::max-lateness': (pspec: GObject.ParamSpec) => void;
'notify::processing-deadline': (pspec: GObject.ParamSpec) => void;
'notify::qos': (pspec: GObject.ParamSpec) => void;
'notify::render-delay': (pspec: GObject.ParamSpec) => void;
'notify::stats': (pspec: GObject.ParamSpec) => void;
'notify::sync': (pspec: GObject.ParamSpec) => void;
'notify::throttle-time': (pspec: GObject.ParamSpec) => void;
'notify::ts-offset': (pspec: GObject.ParamSpec) => void;
'notify::name': (pspec: GObject.ParamSpec) => void;
'notify::parent': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GstBase.BaseSink.ConstructorProps, Gst.URIHandler.ConstructorProps {
buffer_list: boolean;
bufferList: boolean;
caps: Gst.Caps;
drop: boolean;
emit_signals: boolean;
emitSignals: boolean;
eos: boolean | any;
max_buffers: number;
maxBuffers: number;
max_bytes: number;
maxBytes: number;
max_time: number;
maxTime: number;
wait_on_eos: boolean;
waitOnEos: boolean;
}
}
/**
* Appsink is a sink plugin that supports many different methods for making
* the application get a handle on the GStreamer data in a pipeline. Unlike
* most GStreamer elements, Appsink provides external API functions.
*
* appsink can be used by linking to the gstappsink.h header file to access the
* methods or by using the appsink action signals and properties.
*
* The normal way of retrieving samples from appsink is by using the
* gst_app_sink_pull_sample() and gst_app_sink_pull_preroll() methods.
* These methods block until a sample becomes available in the sink or when the
* sink is shut down or reaches EOS. There are also timed variants of these
* methods, gst_app_sink_try_pull_sample() and gst_app_sink_try_pull_preroll(),
* which accept a timeout parameter to limit the amount of time to wait.
*
* Appsink will internally use a queue to collect buffers from the streaming
* thread. If the application is not pulling samples fast enough, this queue
* will consume a lot of memory over time. The "max-buffers", "max-time" and "max-bytes"
* properties can be used to limit the queue size. The "drop" property controls whether the
* streaming thread blocks or if older buffers are dropped when the maximum
* queue size is reached. Note that blocking the streaming thread can negatively
* affect real-time performance and should be avoided.
*
* If a blocking behaviour is not desirable, setting the "emit-signals" property
* to %TRUE will make appsink emit the "new-sample" and "new-preroll" signals
* when a sample can be pulled without blocking.
*
* The "caps" property on appsink can be used to control the formats that
* appsink can receive. This property can contain non-fixed caps, the format of
* the pulled samples can be obtained by getting the sample caps.
*
* If one of the pull-preroll or pull-sample methods return %NULL, the appsink
* is stopped or in the EOS state. You can check for the EOS state with the
* "eos" property or with the gst_app_sink_is_eos() method.
*
* The eos signal can also be used to be informed when the EOS state is reached
* to avoid polling.
*/
class AppSink extends GstBase.BaseSink implements Gst.URIHandler {
static $gtype: GObject.GType<AppSink>;
// Properties
get buffer_list(): boolean;
set buffer_list(val: boolean);
get bufferList(): boolean;
set bufferList(val: boolean);
get caps(): Gst.Caps;
set caps(val: Gst.Caps);
get drop(): boolean;
set drop(val: boolean);
get emit_signals(): boolean;
set emit_signals(val: boolean);
get emitSignals(): boolean;
set emitSignals(val: boolean);
// This accessor conflicts with a property or field in a parent class or interface.
eos: boolean | any;
/**
* Maximum amount of buffers in the queue (0 = unlimited).
*/
get max_buffers(): number;
set max_buffers(val: number);
/**
* Maximum amount of buffers in the queue (0 = unlimited).
*/
get maxBuffers(): number;
set maxBuffers(val: number);
/**
* Maximum amount of bytes in the queue (0 = unlimited)
*/
get max_bytes(): number;
set max_bytes(val: number);
/**
* Maximum amount of bytes in the queue (0 = unlimited)
*/
get maxBytes(): number;
set maxBytes(val: number);
/**
* Maximum total duration of data in the queue (0 = unlimited)
*/
get max_time(): number;
set max_time(val: number);
/**
* Maximum total duration of data in the queue (0 = unlimited)
*/
get maxTime(): number;
set maxTime(val: number);
/**
* Wait for all buffers to be processed after receiving an EOS.
*
* In cases where it is uncertain if an `appsink` will have a consumer for its buffers
* when it receives an EOS, set to %FALSE to ensure that the `appsink` will not hang.
*/
get wait_on_eos(): boolean;
set wait_on_eos(val: boolean);
/**
* Wait for all buffers to be processed after receiving an EOS.
*
* In cases where it is uncertain if an `appsink` will have a consumer for its buffers
* when it receives an EOS, set to %FALSE to ensure that the `appsink` will not hang.
*/
get waitOnEos(): boolean;
set waitOnEos(val: boolean);
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: AppSink.SignalSignatures;
// Fields
basesink: GstBase.BaseSink;
// Constructors
constructor(properties?: Partial<AppSink.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect<K extends keyof AppSink.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, AppSink.SignalSignatures[K]>,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after<K extends keyof AppSink.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, AppSink.SignalSignatures[K]>,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit<K extends keyof AppSink.SignalSignatures>(
signal: K,
...args: GObject.GjsParameters<AppSink.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Virtual methods
vfunc_eos(): void;
vfunc_new_preroll(): Gst.FlowReturn;
vfunc_new_sample(): Gst.FlowReturn;
/**
* Get the last preroll sample in `appsink`. This was the sample that caused the
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
* If an EOS event was received before any buffers, this function returns
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
*
* This function blocks until a preroll sample or EOS is received or the appsink
* element is set to the READY/NULL state.
*/
vfunc_pull_preroll(): Gst.Sample | null;
/**
* This function blocks until a sample or EOS becomes available or the appsink
* element is set to the READY/NULL state.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers will be put in a queue so that the application
* can pull samples at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
*
* If an EOS event was received before any buffers, this function returns
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
*/
vfunc_pull_sample(): Gst.Sample | null;
/**
* This function blocks until a sample or an event or EOS becomes available or the appsink
* element is set to the READY/NULL state or the timeout expires.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers and events will be put in a queue so that the application
* can pull them at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
* Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state.
*
* This function will only pull serialized events, excluding
* the EOS event for which this functions returns
* %NULL. Use gst_app_sink_is_eos() to check for the EOS condition.
*
* This method is a variant of gst_app_sink_try_pull_sample() that can be used
* to handle incoming events events as well as samples.
*
* Note that future releases may extend this API to return other object types
* so make sure that your code is checking for the actual type it is handling.
* @param timeout the maximum amount of time to wait for a sample
*/
vfunc_try_pull_object(timeout: Gst.ClockTime): Gst.MiniObject | null;
/**
* Get the last preroll sample in `appsink`. This was the sample that caused the
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
* If an EOS event was received before any buffers or the timeout expires,
* this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS
* condition.
*
* This function blocks until a preroll sample or EOS is received, the appsink
* element is set to the READY/NULL state, or the timeout expires.
* @param timeout the maximum amount of time to wait for the preroll sample
*/
vfunc_try_pull_preroll(timeout: Gst.ClockTime): Gst.Sample | null;
/**
* This function blocks until a sample or EOS becomes available or the appsink
* element is set to the READY/NULL state or the timeout expires.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers will be put in a queue so that the application
* can pull samples at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
*
* If an EOS event was received before any buffers or the timeout expires,
* this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS
* condition.
* @param timeout the maximum amount of time to wait for a sample
*/
vfunc_try_pull_sample(timeout: Gst.ClockTime): Gst.Sample | null;
// Methods
/**
* Check if `appsink` supports buffer lists.
* @returns %TRUE if @appsink supports buffer lists.
*/
get_buffer_list_support(): boolean;
/**
* Get the configured caps on `appsink`.
* @returns the #GstCaps accepted by the sink. gst_caps_unref() after usage.
*/
get_caps(): Gst.Caps | null;
/**
* Check if `appsink` will drop old buffers when the maximum amount of queued
* data is reached (meaning max buffers, time or bytes limit, whichever is hit first).
* @returns %TRUE if @appsink is dropping old buffers when the queue is filled.
*/
get_drop(): boolean;
/**
* Check if appsink will emit the "new-preroll" and "new-sample" signals.
* @returns %TRUE if @appsink is emitting the "new-preroll" and "new-sample" signals.
*/
get_emit_signals(): boolean;
/**
* Get the maximum amount of buffers that can be queued in `appsink`.
* @returns The maximum amount of buffers that can be queued.
*/
get_max_buffers(): number;
/**
* Get the maximum total size, in bytes, that can be queued in `appsink`.
* @returns The maximum amount of bytes that can be queued
*/
get_max_bytes(): number;
/**
* Get the maximum total duration that can be queued in `appsink`.
* @returns The maximum total duration that can be queued.
*/
get_max_time(): Gst.ClockTime;
/**
* Check if `appsink` will wait for all buffers to be consumed when an EOS is
* received.
* @returns %TRUE if @appsink will wait for all buffers to be consumed when an EOS is received.
*/
get_wait_on_eos(): boolean;
/**
* Check if `appsink` is EOS, which is when no more samples can be pulled because
* an EOS event was received.
*
* This function also returns %TRUE when the appsink is not in the PAUSED or
* PLAYING state.
* @returns %TRUE if no more samples can be pulled and the appsink is EOS.
*/
is_eos(): boolean;
/**
* This function blocks until a sample or an event becomes available or the appsink
* element is set to the READY/NULL state.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers and events will be put in a queue so that the application
* can pull them at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
* Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state.
*
* This function will only pull serialized events, excluding
* the EOS event for which this functions returns
* %NULL. Use gst_app_sink_is_eos() to check for the EOS condition.
*
* This method is a variant of gst_app_sink_pull_sample() that can be used
* to handle incoming events events as well as samples.
*
* Note that future releases may extend this API to return other object types
* so make sure that your code is checking for the actual type it is handling.
* @returns a #GstSample, or a #GstEvent or NULL when the appsink is stopped or EOS. Call gst_mini_object_unref() after usage.
*/
pull_object(): Gst.MiniObject | null;
/**
* Get the last preroll sample in `appsink`. This was the sample that caused the
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
* If an EOS event was received before any buffers, this function returns
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
*
* This function blocks until a preroll sample or EOS is received or the appsink
* element is set to the READY/NULL state.
* @returns a #GstSample or NULL when the appsink is stopped or EOS. Call gst_sample_unref() after usage.
*/
pull_preroll(): Gst.Sample | null;
/**
* This function blocks until a sample or EOS becomes available or the appsink
* element is set to the READY/NULL state.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers will be put in a queue so that the application
* can pull samples at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
*
* If an EOS event was received before any buffers, this function returns
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
* @returns a #GstSample or NULL when the appsink is stopped or EOS. Call gst_sample_unref() after usage.
*/
pull_sample(): Gst.Sample | null;
/**
* Instruct `appsink` to enable or disable buffer list support.
*
* For backwards-compatibility reasons applications need to opt in
* to indicate that they will be able to handle buffer lists.
* @param enable_lists enable or disable buffer list support
*/
set_buffer_list_support(enable_lists: boolean): void;
/**
* Set the capabilities on the appsink element. This function takes
* a copy of the caps structure. After calling this method, the sink will only
* accept caps that match `caps`. If `caps` is non-fixed, or incomplete,
* you must check the caps on the samples to get the actual used caps.
* @param caps caps to set
*/
set_caps(caps?: Gst.Caps | null): void;
/**
* Instruct `appsink` to drop old buffers when the maximum amount of queued
* data is reached, that is, when any configured limit is hit (max-buffers, max-time or max-bytes).
* @param drop the new state
*/
set_drop(drop: boolean): void;
/**
* Make appsink emit the "new-preroll" and "new-sample" signals. This option is
* by default disabled because signal emission is expensive and unneeded when
* the application prefers to operate in pull mode.
* @param emit the new state
*/
set_emit_signals(emit: boolean): void;
/**
* Set the maximum amount of buffers that can be queued in `appsink`. After this
* amount of buffers are queued in appsink, any more buffers will block upstream
* elements until a sample is pulled from `appsink,` unless 'drop' is set, in which
* case new buffers will be discarded.
* @param max the maximum number of buffers to queue
*/
set_max_buffers(max: number): void;
/**
* Set the maximum total size that can be queued in `appsink`. After this
* amount of buffers are queued in appsink, any more buffers will block upstream
* elements until a sample is pulled from `appsink,` unless 'drop' is set, in which
* case new buffers will be discarded.
* @param max the maximum total size of buffers to queue, in bytes
*/
set_max_bytes(max: number): void;
/**
* Set the maximum total duration that can be queued in `appsink`. After this
* amount of buffers are queued in appsink, any more buffers will block upstream
* elements until a sample is pulled from `appsink,` unless 'drop' is set, in which
* case new buffers will be discarded.
* @param max the maximum total duration to queue
*/
set_max_time(max: Gst.ClockTime): void;
/**
* Instruct `appsink` to wait for all buffers to be consumed when an EOS is received.
* @param wait the new state
*/
set_wait_on_eos(wait: boolean): void;
/**
* This function blocks until a sample or an event or EOS becomes available or the appsink
* element is set to the READY/NULL state or the timeout expires.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers and events will be put in a queue so that the application
* can pull them at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
* Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state.
*
* This function will only pull serialized events, excluding
* the EOS event for which this functions returns
* %NULL. Use gst_app_sink_is_eos() to check for the EOS condition.
*
* This method is a variant of gst_app_sink_try_pull_sample() that can be used
* to handle incoming events events as well as samples.
*
* Note that future releases may extend this API to return other object types
* so make sure that your code is checking for the actual type it is handling.
* @param timeout the maximum amount of time to wait for a sample
* @returns a #GstSample, or #GstEvent or NULL when the appsink is stopped or EOS or the timeout expires. Call gst_mini_object_unref() after usage.
*/
try_pull_object(timeout: Gst.ClockTime): Gst.MiniObject | null;
/**
* Get the last preroll sample in `appsink`. This was the sample that caused the
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
* If an EOS event was received before any buffers or the timeout expires,
* this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS
* condition.
*
* This function blocks until a preroll sample or EOS is received, the appsink
* element is set to the READY/NULL state, or the timeout expires.
* @param timeout the maximum amount of time to wait for the preroll sample
* @returns a #GstSample or NULL when the appsink is stopped or EOS or the timeout expires. Call gst_sample_unref() after usage.
*/
try_pull_preroll(timeout: Gst.ClockTime): Gst.Sample | null;
/**
* This function blocks until a sample or EOS becomes available or the appsink
* element is set to the READY/NULL state or the timeout expires.
*
* This function will only return samples when the appsink is in the PLAYING
* state. All rendered buffers will be put in a queue so that the application
* can pull samples at its own rate. Note that when the application does not
* pull samples fast enough, the queued buffers could consume a lot of memory,
* especially when dealing with raw video frames.
*
* If an EOS event was received before any buffers or the timeout expires,
* this function returns %NULL. Use gst_app_sink_is_eos () to check for the EOS
* condition.
* @param timeout the maximum amount of time to wait for a sample
* @returns a #GstSample or NULL when the appsink is stopped or EOS or the timeout expires. Call gst_sample_unref() after usage.
*/
try_pull_sample(timeout: Gst.ClockTime): Gst.Sample | null;
// Inherited methods
/**
* Gets the list of protocols supported by `handler`. This list may not be
* modified.
* @returns the supported protocols. Returns %NULL if the @handler isn't implemented properly, or the @handler doesn't support any protocols.
*/
get_protocols(): string[] | null;
/**
* Gets the currently handled URI.
* @returns the URI currently handled by the @handler. Returns %NULL if there are no URI currently handled. The returned string must be freed with g_free() when no longer needed.
*/
get_uri(): string | null;
/**
* Gets the type of the given URI handler
* @returns the #GstURIType of the URI handler. Returns #GST_URI_UNKNOWN if the @handler isn't implemented correctly.
*/
get_uri_type(): Gst.URIType;
/**
* Tries to set the URI of the given handler.
* @param uri URI to set
* @returns %TRUE if the URI was set successfully, else %FALSE.
*/
set_uri(uri: string): boolean;
/**
* Gets the currently handled URI.
*/
vfunc_get_uri(): string | null;
/**
* Tries to set the URI of the given handler.
* @param uri URI to set
*/
vfunc_set_uri(uri: string): boolean;
/**
* 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-refs.html) 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;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* 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-refs.html) 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-refs.html) 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;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): 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;