@girs/farstream-0.2 0.2.0-3.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2784 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * Farstream-0.2
10
+ */
11
+
12
+ import type Gst from '@girs/gst-1.0';
13
+ import type GObject from '@girs/gobject-2.0';
14
+ import type GLib from '@girs/glib-2.0';
15
+ import type GModule from '@girs/gmodule-2.0';
16
+
17
+ /**
18
+ * An enum for the type of candidate used/reported
19
+ */
20
+ export enum CandidateType {
21
+ /**
22
+ * A host candidate (local)
23
+ */
24
+ HOST,
25
+ /**
26
+ * A server reflexive candidate.
27
+ */
28
+ SRFLX,
29
+ /**
30
+ * A peer reflexive candidate
31
+ */
32
+ PRFLX,
33
+ /**
34
+ * An relay candidate
35
+ */
36
+ RELAY,
37
+ /**
38
+ * A multicast address
39
+ */
40
+ MULTICAST,
41
+ }
42
+ /**
43
+ * This enum contains the component IDs defined in ICE-19
44
+ */
45
+ export enum ComponentType {
46
+ /**
47
+ * Use this when specifying a component is innapropriate
48
+ */
49
+ NONE,
50
+ /**
51
+ * This component is for RTP data
52
+ */
53
+ RTP,
54
+ /**
55
+ * This component is for RTCP control
56
+ */
57
+ RTCP,
58
+ }
59
+ /**
60
+ * An enum that represents the different DTMF event that can be sent to a
61
+ * #FsSession. The values corresponds those those defined in RFC 4733
62
+ * The rest of the possibles values are in the IANA registry at:
63
+ * http://www.iana.org/assignments/audio-telephone-event-registry
64
+ */
65
+ export enum DTMFEvent {
66
+ TODO_0,
67
+ TODO_1,
68
+ TODO_2,
69
+ TODO_3,
70
+ TODO_4,
71
+ TODO_5,
72
+ TODO_6,
73
+ TODO_7,
74
+ TODO_8,
75
+ TODO_9,
76
+ STAR,
77
+ POUND,
78
+ A,
79
+ B,
80
+ C,
81
+ D,
82
+ }
83
+ /**
84
+ * An enum that represents the different ways a DTMF event can be sent
85
+ */
86
+ export enum DTMFMethod {
87
+ /**
88
+ * Send as a special payload type defined by RFC 4733
89
+ * (which obsoletes RFC 2833)
90
+ */
91
+ RTP_RFC4733,
92
+ /**
93
+ * Send as tones as in-band audio sound
94
+ */
95
+ SOUND,
96
+ }
97
+ /**
98
+ * This is the enum of error numbers that will come either on the "error"
99
+ * signal, from the Gst Bus or for error in the FS_ERROR domain in GErrors
100
+ */
101
+ export enum Error {
102
+ /**
103
+ * Error constructing some of the sub-elements, this
104
+ * probably denotes an error in the installation of the gstreamer elements.
105
+ * It is a fatal error.
106
+ */
107
+ CONSTRUCTION,
108
+ /**
109
+ * An internal error happened in Farstream, it may be in
110
+ * an inconsistent state. The object from which this error comes should be
111
+ * discarded.
112
+ */
113
+ INTERNAL,
114
+ /**
115
+ * Invalid arguments to the function, this
116
+ * is a programming error and should not be reported to the user
117
+ */
118
+ INVALID_ARGUMENTS,
119
+ /**
120
+ * A network related error, this should probably be
121
+ * reported to the user.
122
+ */
123
+ NETWORK,
124
+ /**
125
+ * The optional functionality is not implemented by
126
+ * this plugin.
127
+ */
128
+ NOT_IMPLEMENTED,
129
+ /**
130
+ * The codec negotiation has failed, this means
131
+ * that there are no common codecs between the local and remote codecs.
132
+ */
133
+ NEGOTIATION_FAILED,
134
+ /**
135
+ * Data is received on an unknown codec, this most
136
+ * likely denotes an error on the remote side, the buffers will be ignored.
137
+ * It can safely be ignored in most cases (but may result in a call with no
138
+ * media received).
139
+ */
140
+ UNKNOWN_CODEC,
141
+ /**
142
+ * There are no codecs detected for that media type.
143
+ */
144
+ NO_CODECS,
145
+ /**
146
+ * All of the codecs have been disabled by the
147
+ * codec preferences, one should try less strict codec preferences.
148
+ */
149
+ NO_CODECS_LEFT,
150
+ /**
151
+ * Could not connect to the to remote party.
152
+ */
153
+ CONNECTION_FAILED,
154
+ /**
155
+ * The object has been disposed.
156
+ */
157
+ DISPOSED,
158
+ /**
159
+ * The object already exists
160
+ */
161
+ ALREADY_EXISTS,
162
+ }
163
+ /**
164
+ * Enum used to signify the media type of a codec or stream.
165
+ */
166
+ export enum MediaType {
167
+ /**
168
+ * A media type that encodes audio.
169
+ */
170
+ AUDIO,
171
+ /**
172
+ * A media type that encodes video.
173
+ */
174
+ VIDEO,
175
+ /**
176
+ * A media type for application data.
177
+ */
178
+ APPLICATION,
179
+ /**
180
+ * Largest valid #FsMediaType
181
+ */
182
+ LAST,
183
+ }
184
+ /**
185
+ * An enum for the base IP protocol
186
+ */
187
+ export enum NetworkProtocol {
188
+ /**
189
+ * A UDP based protocol
190
+ */
191
+ UDP,
192
+ /**
193
+ * A TCP based protocol, will listen for
194
+ * incoming connections
195
+ */
196
+ TCP,
197
+ /**
198
+ * A TCP based protocol, will listen for
199
+ * incoming connections
200
+ */
201
+ TCP_PASSIVE,
202
+ /**
203
+ * A TCP based protocol, will attempt to
204
+ * open an outbound connection
205
+ */
206
+ TCP_ACTIVE,
207
+ /**
208
+ * A TCP based protocol, will listen for
209
+ * incoming connections and attempt an outbound connection at the same time
210
+ * as the peer (Simultanuous-Open)
211
+ */
212
+ TCP_SO,
213
+ }
214
+ /**
215
+ * These are the possible states of a stream, a simple multicast stream
216
+ * could only be in "disconnected" or "ready" state.
217
+ * An stream using an ICE transmitter would use all of these.
218
+ */
219
+ export enum StreamState {
220
+ /**
221
+ * connectivity checks have been completed,
222
+ * but connectivity was not established
223
+ */
224
+ FAILED,
225
+ /**
226
+ * no activity scheduled
227
+ */
228
+ DISCONNECTED,
229
+ /**
230
+ * gathering local candidates
231
+ */
232
+ GATHERING,
233
+ /**
234
+ * establishing connectivity
235
+ */
236
+ CONNECTING,
237
+ /**
238
+ * at least one working candidate pair
239
+ */
240
+ CONNECTED,
241
+ /**
242
+ * ICE concluded, candidate pair selection is now final
243
+ */
244
+ READY,
245
+ }
246
+ /**
247
+ * An enum for specifying the direction of a stream
248
+ * @bitfield
249
+ */
250
+ export enum StreamDirection {
251
+ /**
252
+ * No direction specified
253
+ */
254
+ NONE,
255
+ /**
256
+ * Send only
257
+ */
258
+ SEND,
259
+ /**
260
+ * Receive only
261
+ */
262
+ RECV,
263
+ /**
264
+ * Send and receive
265
+ */
266
+ BOTH,
267
+ }
268
+ /**
269
+ * A format that can be used in printf like format strings to format a FsCodec
270
+ */
271
+ export const CODEC_FORMAT: string | null
272
+ /**
273
+ * If the id of a #FsCodec is #FS_CODEC_ID_ANY, then it will be replaced
274
+ * with a dynamic payload type at runtime
275
+ */
276
+ export const CODEC_ID_ANY: number
277
+ /**
278
+ * If the id of a #FsCodec is #FS_CODEC_ID_DISABLE, then this codec will
279
+ * not be used
280
+ */
281
+ export const CODEC_ID_DISABLE: number
282
+ /**
283
+ * A format that can be used in printf like format strings to format a
284
+ * FsRtpHeaderExtension
285
+ */
286
+ export const RTP_HEADER_EXTENSION_FORMAT: string | null
287
+ /**
288
+ * Copies a GList of #FsCandidate and its contents
289
+ * @param candidate_list A GList of #FsCandidate
290
+ * @returns a new GList of #FsCandidate
291
+ */
292
+ export function candidate_list_copy(candidate_list: Codec[]): Codec[]
293
+ /**
294
+ * Verifies if two glist of fscodecs are identical
295
+ * @param list1 a #GList of #FsCodec
296
+ * @param list2 a #GList of #FsCodec
297
+ * @returns %TRUE if they are identical, %FALSE otherwise
298
+ */
299
+ export function codec_list_are_equal(list1: Codec[] | null, list2: Codec[] | null): boolean
300
+ /**
301
+ * Copies a list of #FsCodec structures.
302
+ * @param codec_list a GList of #FsCodec to copy
303
+ * @returns The new list.
304
+ */
305
+ export function codec_list_copy(codec_list: Codec[]): Codec[]
306
+ /**
307
+ * Reads the content of a #GKeyFile of the following format into
308
+ * a #GList of #FsCodec structures.
309
+ *
310
+ *
311
+ * Example:
312
+ *
313
+ * ```
314
+ * [audio/codec1]
315
+ * clock-rate=8000
316
+ *
317
+ * [audio/codec1:1]
318
+ * clock-rate=16000
319
+ *
320
+ * [audio/codec2]
321
+ * one_param=QCIF
322
+ * another_param=WOW
323
+ *
324
+ * [video/codec3]
325
+ * wierd_param=42
326
+ * feedback:nack/pli=1
327
+ * feedback:tfrc=
328
+ * ```
329
+ *
330
+ * @param filename Name of the #GKeyFile to read the codecs parameters from
331
+ * @returns The #GList of #FsCodec or %NULL if the keyfile was empty or an error occured.
332
+ */
333
+ export function codec_list_from_keyfile(filename: string | null): Codec[]
334
+ export function error_quark(): GLib.Quark
335
+ /**
336
+ * Gives a user-printable string representing the media type
337
+ * @param media_type A media type
338
+ * @returns a static string representing the media type
339
+ */
340
+ export function media_type_to_string(media_type: MediaType): string | null
341
+ /**
342
+ * Parses a "farstream-farstream" message and checks if it matches
343
+ * the `object` parameters.
344
+ * @param object a #GObject to match against the message
345
+ * @param message a #GstMessage to parse
346
+ * @returns %TRUE if the message matches the object and is valid.
347
+ */
348
+ export function parse_error(object: GObject.Object, message: Gst.Message): [ /* returnType */ boolean, /* error */ Error, /* error_msg */ string | null ]
349
+ /**
350
+ * Does a deep copy of a #GList of #FsRtpHeaderExtension
351
+ * @param extensions a #GList of #FsRtpHeaderExtension
352
+ * @returns a new #GList of #FsRtpHeaderExtension
353
+ */
354
+ export function rtp_header_extension_list_copy(extensions: RtpHeaderExtension[]): RtpHeaderExtension[]
355
+ /**
356
+ * Reads the content of a #GKeyFile of the following format into a
357
+ * #GList of #FsRtpHeaderExtension structures.
358
+ *
359
+ * The groups have a format "rtp-hdrext:audio:XXX" or
360
+ * "rtp-hdrext:video:XXX" where XXX is a unique string (per media type).
361
+ *
362
+ * The valid keys are:
363
+ * <itemizedlist>
364
+ * <listitem>id: a int between in the 1-255 and 4096-4351 ranges</listitem>
365
+ * <listitem>uri: a URI describing the RTP Header Extension</listitem>
366
+ * <listitem>direction (optional): To only send or receive a RTP Header
367
+ * Extension, possible values are "send", "receive", "none" or "both".
368
+ * Defaults to "both"</listitem>
369
+ * </itemizedlist>
370
+ *
371
+ * Example:
372
+ *
373
+ * ```
374
+ * [rtp-hdrext:audio:a]
375
+ * id=1
376
+ * uri=urn:ietf:params:rtp-hdrext:toffset
377
+ *
378
+ * [rtp-hdrext:audio:abc]
379
+ * id=3
380
+ * uri=urn:ietf:params:rtp-hdrext:ntp-64
381
+ * direction=receive
382
+ * ```
383
+ *
384
+ * @param filename Name of the #GKeyFile to read the RTP Header Extensions from
385
+ * @param media_type The media type for which to get header extensions
386
+ * @returns a #GList of #FsRtpHeaderExtension that must be freed with fs_rtp_header_extension_list_destroy()
387
+ */
388
+ export function rtp_header_extension_list_from_keyfile(filename: string | null, media_type: MediaType): RtpHeaderExtension[]
389
+ /**
390
+ * These default codec preferences should work with the elements that are
391
+ * available in the main GStreamer element repositories.
392
+ * They should be suitable for standards based protocols like SIP or XMPP.
393
+ * @param element Element for which to fetch default codec preferences
394
+ * @returns The default codec preferences for this plugin. This #GList should be freed with fs_codec_list_destroy()
395
+ */
396
+ export function utils_get_default_codec_preferences(element: Gst.Element): Codec[]
397
+ /**
398
+ * These default rtp header extension preferences should work with the elements
399
+ * that are available in the main GStreamer element repositories.
400
+ * They should be suitable for standards based protocols like SIP or XMPP.
401
+ * @param element Element for which to fetch default RTP Header Extension preferences
402
+ * @param media_type The #FsMediaType for which to get default RTP Header Extension preferences
403
+ * @returns The default rtp header extension preferences for this plugin, this #GList should be freed with fs_codec_list_destroy()
404
+ */
405
+ export function utils_get_default_rtp_header_extension_preferences(element: Gst.Element, media_type: MediaType): Codec[]
406
+ /**
407
+ * This allows setting the bitrate on all elements that have a "bitrate"
408
+ * property without having to know the type or of the unit used by that element.
409
+ *
410
+ * This will be obsolete in 0.11 (when all elements use bit/sec for the
411
+ * "bitrate" property.
412
+ * @param element The #GstElement
413
+ * @param bitrate The bitrate in bits/sec
414
+ */
415
+ export function utils_set_bitrate(element: Gst.Element, bitrate: number): void
416
+ /**
417
+ * This is for the bindings benefit. Works around the limitations of GObject
418
+ * introspection.
419
+ * @param value a #GValue of type #FS_TYPE_CANDIDATE_LIST
420
+ * @param candidates A #GList of #FsCandidate
421
+ */
422
+ export function value_set_candidate_list(value: any, candidates: Candidate[] | null): void
423
+ export module Conference {
424
+
425
+ // Constructor properties interface
426
+
427
+ export interface ConstructorProperties extends Gst.ChildProxy.ConstructorProperties, Gst.Bin.ConstructorProperties {
428
+ }
429
+
430
+ }
431
+
432
+ export interface Conference extends Gst.ChildProxy {
433
+
434
+ // Conflicting properties
435
+
436
+ object: any
437
+
438
+ // Own fields of Farstream-0.2.Farstream.Conference
439
+
440
+ parent: Gst.Bin & Gst.Object
441
+
442
+ // Owm methods of Farstream-0.2.Farstream.Conference
443
+
444
+ /**
445
+ * Create a new Farstream Participant for the type of the given conference.
446
+ * @returns the new #FsParticipant that has been created. The #FsParticipant is owned by the user and he must unref it when he is done with it.
447
+ */
448
+ new_participant(): Participant
449
+ /**
450
+ * Create a new Farstream session for the given conference.
451
+ * @param media_type #FsMediaType of the new session
452
+ * @returns the new #FsSession that has been created. The #FsSession must be unref'd by the user when closing the session.
453
+ */
454
+ new_session(media_type: MediaType): Session
455
+
456
+ // Conflicting methods
457
+
458
+ /**
459
+ * Gets a single property using the GstChildProxy mechanism.
460
+ * You are responsible for freeing it by calling g_value_unset()
461
+ * @param name name of the property
462
+ */
463
+ get_property(name: string | null): /* value */ any
464
+
465
+ // Overloads of get_property
466
+
467
+ /**
468
+ * Gets a property of an object.
469
+ *
470
+ * The `value` can be:
471
+ *
472
+ * - an empty #GValue initialized by %G_VALUE_INIT, which will be
473
+ * automatically initialized with the expected type of the property
474
+ * (since GLib 2.60)
475
+ * - a #GValue initialized with the expected type of the property
476
+ * - a #GValue initialized with a type to which the expected type
477
+ * of the property can be transformed
478
+ *
479
+ * In general, a copy is made of the property contents and the caller is
480
+ * responsible for freeing the memory by calling g_value_unset().
481
+ *
482
+ * Note that g_object_get_property() is really intended for language
483
+ * bindings, g_object_get() is much more convenient for C programming.
484
+ * @param property_name the name of the property to get
485
+ * @param value return location for the property value
486
+ */
487
+ get_property(property_name: string | null, value: any): void
488
+ /**
489
+ * Gets a property of an object.
490
+ *
491
+ * The `value` can be:
492
+ *
493
+ * - an empty #GValue initialized by %G_VALUE_INIT, which will be
494
+ * automatically initialized with the expected type of the property
495
+ * (since GLib 2.60)
496
+ * - a #GValue initialized with the expected type of the property
497
+ * - a #GValue initialized with a type to which the expected type
498
+ * of the property can be transformed
499
+ *
500
+ * In general, a copy is made of the property contents and the caller is
501
+ * responsible for freeing the memory by calling g_value_unset().
502
+ *
503
+ * Note that g_object_get_property() is really intended for language
504
+ * bindings, g_object_get() is much more convenient for C programming.
505
+ * @param property_name the name of the property to get
506
+ * @param value return location for the property value
507
+ */
508
+ get_property(property_name: string | null, value: any): void
509
+ /**
510
+ * Increases the reference count of `object`.
511
+ *
512
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
513
+ * of `object` will be propagated to the return type (using the GCC typeof()
514
+ * extension), so any casting the caller needs to do on the return type must be
515
+ * explicit.
516
+ * @returns the same @object
517
+ */
518
+ ref(): GObject.Object
519
+ /**
520
+ * Increments the reference count on `object`. This function
521
+ * does not take the lock on `object` because it relies on
522
+ * atomic refcounting.
523
+ *
524
+ * This object returns the input parameter to ease writing
525
+ * constructs like :
526
+ * result = gst_object_ref (object->parent);
527
+ * @returns A pointer to @object
528
+ */
529
+ ref(): Gst.Object
530
+
531
+ // Overloads of ref
532
+
533
+ /**
534
+ * Increases the reference count of `object`.
535
+ *
536
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
537
+ * of `object` will be propagated to the return type (using the GCC typeof()
538
+ * extension), so any casting the caller needs to do on the return type must be
539
+ * explicit.
540
+ * @returns the same @object
541
+ */
542
+ ref(): GObject.Object
543
+
544
+ // Own virtual methods of Farstream-0.2.Farstream.Conference
545
+
546
+ /**
547
+ * Create a new Farstream Participant for the type of the given conference.
548
+ * @virtual
549
+ * @returns the new #FsParticipant that has been created. The #FsParticipant is owned by the user and he must unref it when he is done with it.
550
+ */
551
+ vfunc_new_participant(): Participant
552
+ /**
553
+ * Create a new Farstream session for the given conference.
554
+ * @virtual
555
+ * @param media_type #FsMediaType of the new session
556
+ * @returns the new #FsSession that has been created. The #FsSession must be unref'd by the user when closing the session.
557
+ */
558
+ vfunc_new_session(media_type: MediaType): Session
559
+
560
+ // Class property signals of Farstream-0.2.Farstream.Conference
561
+
562
+ connect(sigName: "notify::async-handling", callback: (($obj: Conference, pspec: GObject.ParamSpec) => void)): number
563
+ connect_after(sigName: "notify::async-handling", callback: (($obj: Conference, pspec: GObject.ParamSpec) => void)): number
564
+ emit(sigName: "notify::async-handling", ...args: any[]): void
565
+ connect(sigName: "notify::message-forward", callback: (($obj: Conference, pspec: GObject.ParamSpec) => void)): number
566
+ connect_after(sigName: "notify::message-forward", callback: (($obj: Conference, pspec: GObject.ParamSpec) => void)): number
567
+ emit(sigName: "notify::message-forward", ...args: any[]): void
568
+ connect(sigName: string, callback: (...args: any[]) => void): number
569
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
570
+ emit(sigName: string, ...args: any[]): void
571
+ disconnect(id: number): void
572
+ }
573
+
574
+ /**
575
+ * The #FsConference structure, all the members are private
576
+ * @class
577
+ */
578
+ export class Conference extends Gst.Bin {
579
+
580
+ // Own properties of Farstream-0.2.Farstream.Conference
581
+
582
+ static name: string
583
+ static $gtype: GObject.GType<Conference>
584
+
585
+ // Constructors of Farstream-0.2.Farstream.Conference
586
+
587
+ constructor(config?: Conference.ConstructorProperties)
588
+ _init(config?: Conference.ConstructorProperties): void
589
+ }
590
+
591
+ export module ElementAddedNotifier {
592
+
593
+ // Signal callback interfaces
594
+
595
+ /**
596
+ * Signal callback interface for `element-added`
597
+ */
598
+ export interface ElementAddedSignalCallback {
599
+ ($obj: ElementAddedNotifier, bin: Gst.Bin, element: Gst.Element): void
600
+ }
601
+
602
+
603
+ // Constructor properties interface
604
+
605
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
606
+ }
607
+
608
+ }
609
+
610
+ export interface ElementAddedNotifier {
611
+
612
+ // Own fields of Farstream-0.2.Farstream.ElementAddedNotifier
613
+
614
+ parent: GObject.Object
615
+
616
+ // Owm methods of Farstream-0.2.Farstream.ElementAddedNotifier
617
+
618
+ /**
619
+ * Add a #GstBin to on which the #FsElementAddedNotifier::element-added signal
620
+ * will be called on every element and sub-element present and added in the
621
+ * future.
622
+ * @param bin A #GstBin to watch to added elements
623
+ */
624
+ add(bin: Gst.Bin): void
625
+ /**
626
+ * Stop watching the passed bin and its subbins.
627
+ * @param bin A #GstBin to stop watching
628
+ * @returns %TRUE if the #GstBin was being watched, %FALSE otherwise
629
+ */
630
+ remove(bin: Gst.Bin): boolean
631
+ /**
632
+ * Same as first calling fs_utils_get_default_element_properties() and using
633
+ * the result with
634
+ * fs_element_added_notifier_set_properties_from_keyfile() .
635
+ *
636
+ * This is binding friendly (since GKeyFile doesn't have a boxed type).
637
+ * @param element Element for which to set the default codec preferences
638
+ * @returns The id of the signal connection, this can be used to disconnect this property setter using g_signal_handler_disconnect().
639
+ */
640
+ set_default_properties(element: Gst.Element): number
641
+ /**
642
+ * Same as fs_element_added_notifier_set_properties_from_keyfile() but using
643
+ * the name of the file to load instead of the #GKeyFile directly.
644
+ * @param filename The name of the keyfile to use
645
+ * @returns %TRUE if the file was successfully loaded, %FALSE otherwise
646
+ */
647
+ set_properties_from_file(filename: string | null): boolean
648
+ /**
649
+ * Using a #GKeyFile where the groups are the element's type or name
650
+ * and the key=value are the property and its value, this function
651
+ * will set the properties on the elements added to this object after
652
+ * this function has been called. It will take ownership of the
653
+ * GKeyFile structure. It will first try the group as the element type, if that
654
+ * does not match, it will check its name.
655
+ * @param keyfile a #GKeyFile
656
+ * @returns The id of the signal connection, this can be used to disconnect this property setter using g_signal_handler_disconnect().
657
+ */
658
+ set_properties_from_keyfile(keyfile: GLib.KeyFile): number
659
+
660
+ // Own signals of Farstream-0.2.Farstream.ElementAddedNotifier
661
+
662
+ connect(sigName: "element-added", callback: ElementAddedNotifier.ElementAddedSignalCallback): number
663
+ connect_after(sigName: "element-added", callback: ElementAddedNotifier.ElementAddedSignalCallback): number
664
+ emit(sigName: "element-added", bin: Gst.Bin, element: Gst.Element, ...args: any[]): void
665
+
666
+ // Class property signals of Farstream-0.2.Farstream.ElementAddedNotifier
667
+
668
+ connect(sigName: string, callback: (...args: any[]) => void): number
669
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
670
+ emit(sigName: string, ...args: any[]): void
671
+ disconnect(id: number): void
672
+ }
673
+
674
+ /**
675
+ * All members are private
676
+ * @class
677
+ */
678
+ export class ElementAddedNotifier extends GObject.Object {
679
+
680
+ // Own properties of Farstream-0.2.Farstream.ElementAddedNotifier
681
+
682
+ static name: string
683
+ static $gtype: GObject.GType<ElementAddedNotifier>
684
+
685
+ // Constructors of Farstream-0.2.Farstream.ElementAddedNotifier
686
+
687
+ constructor(config?: ElementAddedNotifier.ConstructorProperties)
688
+ /**
689
+ * Creates a new #FsElementAddedNotifier object
690
+ * @constructor
691
+ * @returns the newly-created #FsElementAddedNotifier
692
+ */
693
+ constructor()
694
+ /**
695
+ * Creates a new #FsElementAddedNotifier object
696
+ * @constructor
697
+ * @returns the newly-created #FsElementAddedNotifier
698
+ */
699
+ static new(): ElementAddedNotifier
700
+ _init(config?: ElementAddedNotifier.ConstructorProperties): void
701
+ }
702
+
703
+ export module Participant {
704
+
705
+ // Constructor properties interface
706
+
707
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
708
+ }
709
+
710
+ }
711
+
712
+ export interface Participant {
713
+
714
+ // Own fields of Farstream-0.2.Farstream.Participant
715
+
716
+ parent: GObject.Object
717
+
718
+ // Class property signals of Farstream-0.2.Farstream.Participant
719
+
720
+ connect(sigName: string, callback: (...args: any[]) => void): number
721
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
722
+ emit(sigName: string, ...args: any[]): void
723
+ disconnect(id: number): void
724
+ }
725
+
726
+ /**
727
+ * All members are private (access them using the properties)
728
+ * @class
729
+ */
730
+ export class Participant extends GObject.Object {
731
+
732
+ // Own properties of Farstream-0.2.Farstream.Participant
733
+
734
+ static name: string
735
+ static $gtype: GObject.GType<Participant>
736
+
737
+ // Constructors of Farstream-0.2.Farstream.Participant
738
+
739
+ constructor(config?: Participant.ConstructorProperties)
740
+ _init(config?: Participant.ConstructorProperties): void
741
+ }
742
+
743
+ export module Plugin {
744
+
745
+ // Constructor properties interface
746
+
747
+ export interface ConstructorProperties extends GObject.TypePlugin.ConstructorProperties, GObject.TypeModule.ConstructorProperties {
748
+ }
749
+
750
+ }
751
+
752
+ export interface Plugin extends GObject.TypePlugin {
753
+
754
+ // Own fields of Farstream-0.2.Farstream.Plugin
755
+
756
+ /**
757
+ * the parent object
758
+ * @field
759
+ */
760
+ parent: GObject.TypeModule
761
+
762
+ // Conflicting methods
763
+
764
+ /**
765
+ * Calls the `use_plugin` function from the #GTypePluginClass of
766
+ * `plugin`. There should be no need to use this function outside of
767
+ * the GObject type system itself.
768
+ */
769
+ use(): void
770
+ /**
771
+ * Increases the use count of a #GTypeModule by one. If the
772
+ * use count was zero before, the plugin will be loaded.
773
+ * If loading the plugin fails, the use count is reset to
774
+ * its prior value.
775
+ * @returns %FALSE if the plugin needed to be loaded and loading the plugin failed.
776
+ */
777
+ use(): boolean
778
+
779
+ // Overloads of use
780
+
781
+ /**
782
+ * Calls the `use_plugin` function from the #GTypePluginClass of
783
+ * `plugin`. There should be no need to use this function outside of
784
+ * the GObject type system itself.
785
+ */
786
+ use(): void
787
+
788
+ // Class property signals of Farstream-0.2.Farstream.Plugin
789
+
790
+ connect(sigName: string, callback: (...args: any[]) => void): number
791
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
792
+ emit(sigName: string, ...args: any[]): void
793
+ disconnect(id: number): void
794
+ }
795
+
796
+ /**
797
+ * This structure represents a plugin, it is opaque.
798
+ * @class
799
+ */
800
+ export class Plugin extends GObject.TypeModule {
801
+
802
+ // Own properties of Farstream-0.2.Farstream.Plugin
803
+
804
+ static name: string
805
+ static $gtype: GObject.GType<Plugin>
806
+
807
+ // Constructors of Farstream-0.2.Farstream.Plugin
808
+
809
+ constructor(config?: Plugin.ConstructorProperties)
810
+ _init(config?: Plugin.ConstructorProperties): void
811
+ /**
812
+ * Gets the list of all available plugins of a certain type
813
+ * @param type_suffix Get list of plugins with this type suffix
814
+ * @returns a newly allocated NULL terminated array of strings or %NULL if no strings were found. It should be freed with g_strfreev().
815
+ */
816
+ static list_available(type_suffix: string | null): string[]
817
+ }
818
+
819
+ export module Session {
820
+
821
+ // Signal callback interfaces
822
+
823
+ /**
824
+ * Signal callback interface for `error`
825
+ */
826
+ export interface ErrorSignalCallback {
827
+ ($obj: Session, object: GObject.Object, error_no: Error, error_msg: string | null): void
828
+ }
829
+
830
+
831
+ // Constructor properties interface
832
+
833
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
834
+
835
+ // Own constructor properties of Farstream-0.2.Farstream.Session
836
+
837
+ /**
838
+ * The #FsConference parent of this session. This property is a
839
+ * construct param and is read-only.
840
+ */
841
+ conference?: Conference | null
842
+ /**
843
+ * The ID of the session, the first number of the pads linked to this session
844
+ * will be this id
845
+ */
846
+ id?: number | null
847
+ /**
848
+ * The media-type of the session. This is either Audio, Video or both.
849
+ * This is a constructor parameter that cannot be changed.
850
+ */
851
+ media_type?: MediaType | null
852
+ /**
853
+ * Sets the IP ToS field (and if possible the IPv6 TCLASS field
854
+ */
855
+ tos?: number | null
856
+ }
857
+
858
+ }
859
+
860
+ export interface Session {
861
+
862
+ // Own properties of Farstream-0.2.Farstream.Session
863
+
864
+ /**
865
+ * These are the #GstCaps that can be fed into the session,
866
+ * they are used to filter the codecs to only those that can
867
+ * accepted those caps as input.
868
+ */
869
+ readonly allowed_sink_caps: Gst.Caps
870
+ /**
871
+ * These are the #GstCaps that the session can produce,
872
+ * they are used to filter the codecs to only those that can
873
+ * accepted those caps as output.
874
+ */
875
+ readonly allowed_src_caps: Gst.Caps
876
+ /**
877
+ * This is the current preferences list for the local codecs. It is
878
+ * set by the user to specify the codec options and priorities. The user may
879
+ * change its value with fs_session_set_codec_preferences() at any time
880
+ * during a session. It is a #GList of #FsCodec.
881
+ * The user must free this codec list using fs_codec_list_destroy() when done.
882
+ *
883
+ * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
884
+ * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
885
+ * payload type of the codec will be "reserved" and not be used by any
886
+ * dynamically assigned payload type.
887
+ */
888
+ readonly codec_preferences: Codec[]
889
+ /**
890
+ * This is the list of codecs used for this session. It will include the
891
+ * codecs and payload type used to receive media on this session. It will
892
+ * also include any configuration parameter that must be transmitted reliably
893
+ * for the other end to decode the content.
894
+ *
895
+ * It may change when the codec preferences are set, when codecs are set
896
+ * on a #FsStream in this session, when a #FsStream is destroyed or
897
+ * asynchronously when new config data is discovered.
898
+ *
899
+ * If any configuration parameter needs to be discovered, this property
900
+ * will be %NULL until they have been discovered. One can always get
901
+ * the codecs from #FsSession:codecs-without-config.
902
+ * The "farstream-codecs-changed" message will be emitted whenever the value
903
+ * of this property changes.
904
+ *
905
+ * It is a #GList of #FsCodec. User must free this codec list using
906
+ * fs_codec_list_destroy() when done.
907
+ */
908
+ readonly codecs: Codec[]
909
+ /**
910
+ * This is the same list of codecs as #FsSession:codecs without
911
+ * the configuration information that describes the data sent. It is suitable
912
+ * for configurations where a list of codecs is shared by many senders.
913
+ * If one is using codecs such as Theora, Vorbis or H.264 that require
914
+ * such information to be transmitted, the configuration data should be
915
+ * included in the stream and retransmitted regularly.
916
+ *
917
+ * It may change when the codec preferences are set, when codecs are set
918
+ * on a #FsStream in this session, when a #FsStream is destroyed or
919
+ * asynchronously when new config data is discovered.
920
+ *
921
+ * The "farstream-codecs-changed" message will be emitted whenever the value
922
+ * of this property changes.
923
+ *
924
+ * It is a #GList of #FsCodec. User must free this codec list using
925
+ * fs_codec_list_destroy() when done.
926
+ */
927
+ readonly codecs_without_config: Codec[]
928
+ /**
929
+ * The #FsConference parent of this session. This property is a
930
+ * construct param and is read-only.
931
+ */
932
+ readonly conference: Conference
933
+ /**
934
+ * Indicates the currently active send codec. A user can change the active
935
+ * send codec by calling fs_session_set_send_codec(). The send codec could
936
+ * also be automatically changed by Farstream. This property is an
937
+ * #FsCodec. User must free the codec using fs_codec_destroy() when done.
938
+ * The "farstream-send-codec-changed" message is emitted on the bus when
939
+ * the value of this property changes.
940
+ */
941
+ readonly current_send_codec: Codec
942
+ /**
943
+ * Retrieves previously set encryption parameters
944
+ */
945
+ readonly encryption_parameters: Gst.Structure
946
+ /**
947
+ * The ID of the session, the first number of the pads linked to this session
948
+ * will be this id
949
+ */
950
+ readonly id: number
951
+ /**
952
+ * The media-type of the session. This is either Audio, Video or both.
953
+ * This is a constructor parameter that cannot be changed.
954
+ */
955
+ readonly media_type: MediaType
956
+ /**
957
+ * The Gstreamer sink pad that must be used to send media data on this
958
+ * session. User must unref this GstPad when done with it.
959
+ */
960
+ readonly sink_pad: Gst.Pad
961
+ /**
962
+ * Sets the IP ToS field (and if possible the IPv6 TCLASS field
963
+ */
964
+ tos: number
965
+
966
+ // Own fields of Farstream-0.2.Farstream.Session
967
+
968
+ parent: GObject.Object
969
+
970
+ // Owm methods of Farstream-0.2.Farstream.Session
971
+
972
+ /**
973
+ * Some codec updates need to be reliably transmitted to the other side
974
+ * because they contain important parameters required to decode the media.
975
+ * Other codec updates, caused by user action, don't.
976
+ * @param old_codecs Codecs previously retrieved from the #FsSession:codecs property
977
+ * @param new_codecs Codecs recently retrieved from the #FsSession:codecs property
978
+ * @returns A new #GList of #FsCodec that need to be resent or %NULL if there are none. This list must be freed with fs_codec_list_destroy().
979
+ */
980
+ codecs_need_resend(old_codecs: Codec[] | null, new_codecs: Codec[] | null): Codec[]
981
+ /**
982
+ * This will cause the session to remove all links to other objects and to
983
+ * remove itself from the #FsConference, it will also destroy all #FsStream
984
+ * inside this #FsSession Once a #FsSession has been destroyed, it
985
+ * can not be used anymore.
986
+ *
987
+ * It is strongly recommended to call this function from the main thread because
988
+ * releasing the application's reference to a session.
989
+ */
990
+ destroy(): void
991
+ /**
992
+ * This function emit the "error" signal on a #FsSession, it should only be
993
+ * called by subclasses.
994
+ * @param error_no The number of the error of type #FsError
995
+ * @param error_msg Error message
996
+ */
997
+ emit_error(error_no: number, error_msg: string | null): void
998
+ /**
999
+ * Returns the GType of the stream transmitter, bindings can use it
1000
+ * to validate/convert the parameters passed to fs_session_new_stream().
1001
+ * @param transmitter The name of the transmitter
1002
+ * @returns The #GType of the stream transmitter
1003
+ */
1004
+ get_stream_transmitter_type(transmitter: string | null): GObject.GType
1005
+ /**
1006
+ * Get the list of all available transmitters for this session.
1007
+ * @returns a newly-allocagted %NULL terminated array of named of transmitters or %NULL if no transmitter is needed for this type of session. It should be freed with g_strfreev().
1008
+ */
1009
+ list_transmitters(): string[]
1010
+ /**
1011
+ * This function creates a stream for the given participant into the active session.
1012
+ * @param participant #FsParticipant of a participant for the new stream
1013
+ * @param direction #FsStreamDirection describing the direction of the new stream that will be created for this participant
1014
+ * @returns the new #FsStream that has been created. User must unref the #FsStream when the stream is ended. If an error occured, returns NULL.
1015
+ */
1016
+ new_stream(participant: Participant, direction: StreamDirection): Stream
1017
+ /**
1018
+ * Parses a "farstream-codecs-changed" message and checks if it matches
1019
+ * the `session` parameters.
1020
+ * @param message a #GstMessage to parse
1021
+ * @returns %TRUE if the message matches the session and is valid.
1022
+ */
1023
+ parse_codecs_changed(message: Gst.Message): boolean
1024
+ /**
1025
+ * Parses a "farstream-send-codec-changed" message and checks if it matches
1026
+ * the `session` parameters.
1027
+ * @param message a #GstMessage to parse
1028
+ * @returns %TRUE if the message matches the session and is valid.
1029
+ */
1030
+ parse_send_codec_changed(message: Gst.Message): [ /* returnType */ boolean, /* codec */ Codec, /* secondary_codecs */ Codec[] ]
1031
+ /**
1032
+ * Parses a "farstream-telephony-event-started" message and checks if it matches
1033
+ * the `session` parameters.
1034
+ * @param message a #GstMessage to parse
1035
+ * @returns %TRUE if the message matches the session and is valid.
1036
+ */
1037
+ parse_telephony_event_started(message: Gst.Message): [ /* returnType */ boolean, /* method */ DTMFMethod, /* event */ DTMFEvent, /* volume */ number ]
1038
+ /**
1039
+ * Parses a "farstream-telephony-event-stopped" message and checks if it matches
1040
+ * the `session` parameters.
1041
+ * @param message a #GstMessage to parse
1042
+ * @returns %TRUE if the message matches the session and is valid.
1043
+ */
1044
+ parse_telephony_event_stopped(message: Gst.Message): [ /* returnType */ boolean, /* method */ DTMFMethod ]
1045
+ /**
1046
+ * Sets the allowed caps for the sink and source pads for this #FsSession.
1047
+ * Only codecs that can take the input specified by the `sink_caps` and
1048
+ * can produce output as specified by the `src_caps` will be produced
1049
+ * in the #FsSession:codecs property and so only those will be negotiated.
1050
+ *
1051
+ * If %NULL is passed to either `src_caps` or `sink_caps,` it is not changed.
1052
+ *
1053
+ * The default is "video/x-raw" for a video stream, "audio/x-raw" for an audio
1054
+ * stream and "ANY" for an application stream.
1055
+ *
1056
+ * The values can be retrived using the #FsSession:allowed-src-caps and
1057
+ * #FsSession:allowed-sink-caps properties.
1058
+ * @param sink_caps Caps for the sink pad or %NULL
1059
+ * @param src_caps Caps for the src pad or %NULL
1060
+ * @returns %TRUE if the new filter caps were acceptable.
1061
+ */
1062
+ set_allowed_caps(sink_caps: Gst.Caps | null, src_caps: Gst.Caps | null): boolean
1063
+ /**
1064
+ * Set the list of desired codec preferences. The user may
1065
+ * change this value during an ongoing session. Note that doing this can cause
1066
+ * the codecs to change. Therefore this requires the user to fetch
1067
+ * the new codecs and renegotiate them with the peers. It is a #GList
1068
+ * of #FsCodec. The changes are immediately effective.
1069
+ * The function does not take ownership of the list.
1070
+ *
1071
+ * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
1072
+ * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
1073
+ * payload type of the codec will be "reserved" and not be used by any
1074
+ * dynamically assigned payload type.
1075
+ *
1076
+ * If the list of specifications would invalidate all codecs, an error will
1077
+ * be returned.
1078
+ * @param codec_preferences a #GList of #FsCodec with the desired configuration
1079
+ * @returns %TRUE on success, %FALSE on error.
1080
+ */
1081
+ set_codec_preferences(codec_preferences: Codec[] | null): boolean
1082
+ /**
1083
+ * Sets encryption parameters. The exact parameters depend on the type of
1084
+ * plugin being used.
1085
+ * @param parameters a #GstStructure containing the encryption parameters or %NULL to disable encryption
1086
+ * @returns %TRUE if the encryption parameters could be set, %FALSE otherwise
1087
+ */
1088
+ set_encryption_parameters(parameters: Gst.Structure | null): boolean
1089
+ /**
1090
+ * This function will set the currently being sent codec for all streams in this
1091
+ * session. The given #FsCodec must be taken directly from the #codecs
1092
+ * property of the session. If the given codec is not in the codecs
1093
+ * list, `error` will be set and %FALSE will be returned. The `send_codec` will be
1094
+ * copied so it must be free'd using fs_codec_destroy() when done.
1095
+ * @param send_codec a #FsCodec representing the codec to send
1096
+ * @returns %FALSE if the send codec couldn't be set.
1097
+ */
1098
+ set_send_codec(send_codec: Codec): boolean
1099
+ /**
1100
+ * This function will start sending a telephony event (such as a DTMF
1101
+ * tone) on the #FsSession. You have to call the function
1102
+ * fs_session_stop_telephony_event() to stop it.
1103
+ *
1104
+ * If this function returns %TRUE, a "farstream-telephony-event-started" will
1105
+ * always be emitted when the event is actually played out.
1106
+ * @param event A #FsStreamDTMFEvent or another number defined at http://www.iana.org/assignments/audio-telephone-event-registry
1107
+ * @param volume The volume in dBm0 without the negative sign. Should be between 0 and 36. Higher values mean lower volume
1108
+ * @returns %TRUE if sucessful, it can return %FALSE if the #FsStream does not support this telephony event.
1109
+ */
1110
+ start_telephony_event(event: number, volume: number): boolean
1111
+ /**
1112
+ * This function will stop sending a telephony event started by
1113
+ * fs_session_start_telephony_event(). If the event was being sent
1114
+ * for less than 50ms, it will be sent for 50ms minimum. If the
1115
+ * duration was a positive and the event is not over, it will cut it
1116
+ * short.
1117
+ *
1118
+ * If this function returns %TRUE, a "farstream-telephony-event-stopped" will
1119
+ * always be emitted when the event is actually stopped.
1120
+ * @returns %TRUE if sucessful, it can return %FALSE if the #FsSession does not support telephony events or if no telephony event is being sent
1121
+ */
1122
+ stop_telephony_event(): boolean
1123
+
1124
+ // Own virtual methods of Farstream-0.2.Farstream.Session
1125
+
1126
+ /**
1127
+ * Some codec updates need to be reliably transmitted to the other side
1128
+ * because they contain important parameters required to decode the media.
1129
+ * Other codec updates, caused by user action, don't.
1130
+ * @virtual
1131
+ * @param old_codecs Codecs previously retrieved from the #FsSession:codecs property
1132
+ * @param new_codecs Codecs recently retrieved from the #FsSession:codecs property
1133
+ * @returns A new #GList of #FsCodec that need to be resent or %NULL if there are none. This list must be freed with fs_codec_list_destroy().
1134
+ */
1135
+ vfunc_codecs_need_resend(old_codecs: Codec[] | null, new_codecs: Codec[] | null): Codec[]
1136
+ /**
1137
+ * Returns the GType of the stream transmitter, bindings can use it
1138
+ * to validate/convert the parameters passed to fs_session_new_stream().
1139
+ * @virtual
1140
+ * @param transmitter The name of the transmitter
1141
+ * @returns The #GType of the stream transmitter
1142
+ */
1143
+ vfunc_get_stream_transmitter_type(transmitter: string | null): GObject.GType
1144
+ /**
1145
+ * Get the list of all available transmitters for this session.
1146
+ * @virtual
1147
+ * @returns a newly-allocagted %NULL terminated array of named of transmitters or %NULL if no transmitter is needed for this type of session. It should be freed with g_strfreev().
1148
+ */
1149
+ vfunc_list_transmitters(): string[]
1150
+ /**
1151
+ * This function creates a stream for the given participant into the active session.
1152
+ * @virtual
1153
+ * @param participant #FsParticipant of a participant for the new stream
1154
+ * @param direction #FsStreamDirection describing the direction of the new stream that will be created for this participant
1155
+ * @returns the new #FsStream that has been created. User must unref the #FsStream when the stream is ended. If an error occured, returns NULL.
1156
+ */
1157
+ vfunc_new_stream(participant: Participant, direction: StreamDirection): Stream
1158
+ /**
1159
+ * Sets the allowed caps for the sink and source pads for this #FsSession.
1160
+ * Only codecs that can take the input specified by the `sink_caps` and
1161
+ * can produce output as specified by the `src_caps` will be produced
1162
+ * in the #FsSession:codecs property and so only those will be negotiated.
1163
+ *
1164
+ * If %NULL is passed to either `src_caps` or `sink_caps,` it is not changed.
1165
+ *
1166
+ * The default is "video/x-raw" for a video stream, "audio/x-raw" for an audio
1167
+ * stream and "ANY" for an application stream.
1168
+ *
1169
+ * The values can be retrived using the #FsSession:allowed-src-caps and
1170
+ * #FsSession:allowed-sink-caps properties.
1171
+ * @virtual
1172
+ * @param sink_caps Caps for the sink pad or %NULL
1173
+ * @param src_caps Caps for the src pad or %NULL
1174
+ * @returns %TRUE if the new filter caps were acceptable.
1175
+ */
1176
+ vfunc_set_allowed_caps(sink_caps: Gst.Caps | null, src_caps: Gst.Caps | null): boolean
1177
+ /**
1178
+ * Set the list of desired codec preferences. The user may
1179
+ * change this value during an ongoing session. Note that doing this can cause
1180
+ * the codecs to change. Therefore this requires the user to fetch
1181
+ * the new codecs and renegotiate them with the peers. It is a #GList
1182
+ * of #FsCodec. The changes are immediately effective.
1183
+ * The function does not take ownership of the list.
1184
+ *
1185
+ * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
1186
+ * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
1187
+ * payload type of the codec will be "reserved" and not be used by any
1188
+ * dynamically assigned payload type.
1189
+ *
1190
+ * If the list of specifications would invalidate all codecs, an error will
1191
+ * be returned.
1192
+ * @virtual
1193
+ * @param codec_preferences a #GList of #FsCodec with the desired configuration
1194
+ * @returns %TRUE on success, %FALSE on error.
1195
+ */
1196
+ vfunc_set_codec_preferences(codec_preferences: Codec[] | null): boolean
1197
+ /**
1198
+ * Sets encryption parameters. The exact parameters depend on the type of
1199
+ * plugin being used.
1200
+ * @virtual
1201
+ * @param parameters a #GstStructure containing the encryption parameters or %NULL to disable encryption
1202
+ * @returns %TRUE if the encryption parameters could be set, %FALSE otherwise
1203
+ */
1204
+ vfunc_set_encryption_parameters(parameters: Gst.Structure | null): boolean
1205
+ /**
1206
+ * This function will set the currently being sent codec for all streams in this
1207
+ * session. The given #FsCodec must be taken directly from the #codecs
1208
+ * property of the session. If the given codec is not in the codecs
1209
+ * list, `error` will be set and %FALSE will be returned. The `send_codec` will be
1210
+ * copied so it must be free'd using fs_codec_destroy() when done.
1211
+ * @virtual
1212
+ * @param send_codec a #FsCodec representing the codec to send
1213
+ * @returns %FALSE if the send codec couldn't be set.
1214
+ */
1215
+ vfunc_set_send_codec(send_codec: Codec): boolean
1216
+ /**
1217
+ * This function will start sending a telephony event (such as a DTMF
1218
+ * tone) on the #FsSession. You have to call the function
1219
+ * fs_session_stop_telephony_event() to stop it.
1220
+ *
1221
+ * If this function returns %TRUE, a "farstream-telephony-event-started" will
1222
+ * always be emitted when the event is actually played out.
1223
+ * @virtual
1224
+ * @param event A #FsStreamDTMFEvent or another number defined at http://www.iana.org/assignments/audio-telephone-event-registry
1225
+ * @param volume The volume in dBm0 without the negative sign. Should be between 0 and 36. Higher values mean lower volume
1226
+ * @returns %TRUE if sucessful, it can return %FALSE if the #FsStream does not support this telephony event.
1227
+ */
1228
+ vfunc_start_telephony_event(event: number, volume: number): boolean
1229
+ /**
1230
+ * This function will stop sending a telephony event started by
1231
+ * fs_session_start_telephony_event(). If the event was being sent
1232
+ * for less than 50ms, it will be sent for 50ms minimum. If the
1233
+ * duration was a positive and the event is not over, it will cut it
1234
+ * short.
1235
+ *
1236
+ * If this function returns %TRUE, a "farstream-telephony-event-stopped" will
1237
+ * always be emitted when the event is actually stopped.
1238
+ * @virtual
1239
+ * @returns %TRUE if sucessful, it can return %FALSE if the #FsSession does not support telephony events or if no telephony event is being sent
1240
+ */
1241
+ vfunc_stop_telephony_event(): boolean
1242
+
1243
+ // Own signals of Farstream-0.2.Farstream.Session
1244
+
1245
+ connect(sigName: "error", callback: Session.ErrorSignalCallback): number
1246
+ connect_after(sigName: "error", callback: Session.ErrorSignalCallback): number
1247
+ emit(sigName: "error", object: GObject.Object, error_no: Error, error_msg: string | null, ...args: any[]): void
1248
+
1249
+ // Class property signals of Farstream-0.2.Farstream.Session
1250
+
1251
+ connect(sigName: "notify::allowed-sink-caps", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1252
+ connect_after(sigName: "notify::allowed-sink-caps", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1253
+ emit(sigName: "notify::allowed-sink-caps", ...args: any[]): void
1254
+ connect(sigName: "notify::allowed-src-caps", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1255
+ connect_after(sigName: "notify::allowed-src-caps", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1256
+ emit(sigName: "notify::allowed-src-caps", ...args: any[]): void
1257
+ connect(sigName: "notify::codec-preferences", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1258
+ connect_after(sigName: "notify::codec-preferences", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1259
+ emit(sigName: "notify::codec-preferences", ...args: any[]): void
1260
+ connect(sigName: "notify::codecs", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1261
+ connect_after(sigName: "notify::codecs", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1262
+ emit(sigName: "notify::codecs", ...args: any[]): void
1263
+ connect(sigName: "notify::codecs-without-config", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1264
+ connect_after(sigName: "notify::codecs-without-config", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1265
+ emit(sigName: "notify::codecs-without-config", ...args: any[]): void
1266
+ connect(sigName: "notify::conference", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1267
+ connect_after(sigName: "notify::conference", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1268
+ emit(sigName: "notify::conference", ...args: any[]): void
1269
+ connect(sigName: "notify::current-send-codec", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1270
+ connect_after(sigName: "notify::current-send-codec", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1271
+ emit(sigName: "notify::current-send-codec", ...args: any[]): void
1272
+ connect(sigName: "notify::encryption-parameters", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1273
+ connect_after(sigName: "notify::encryption-parameters", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1274
+ emit(sigName: "notify::encryption-parameters", ...args: any[]): void
1275
+ connect(sigName: "notify::id", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1276
+ connect_after(sigName: "notify::id", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1277
+ emit(sigName: "notify::id", ...args: any[]): void
1278
+ connect(sigName: "notify::media-type", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1279
+ connect_after(sigName: "notify::media-type", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1280
+ emit(sigName: "notify::media-type", ...args: any[]): void
1281
+ connect(sigName: "notify::sink-pad", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1282
+ connect_after(sigName: "notify::sink-pad", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1283
+ emit(sigName: "notify::sink-pad", ...args: any[]): void
1284
+ connect(sigName: "notify::tos", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1285
+ connect_after(sigName: "notify::tos", callback: (($obj: Session, pspec: GObject.ParamSpec) => void)): number
1286
+ emit(sigName: "notify::tos", ...args: any[]): void
1287
+ connect(sigName: string, callback: (...args: any[]) => void): number
1288
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1289
+ emit(sigName: string, ...args: any[]): void
1290
+ disconnect(id: number): void
1291
+ }
1292
+
1293
+ /**
1294
+ * All members are private, access them using methods and properties
1295
+ * @class
1296
+ */
1297
+ export class Session extends GObject.Object {
1298
+
1299
+ // Own properties of Farstream-0.2.Farstream.Session
1300
+
1301
+ static name: string
1302
+ static $gtype: GObject.GType<Session>
1303
+
1304
+ // Constructors of Farstream-0.2.Farstream.Session
1305
+
1306
+ constructor(config?: Session.ConstructorProperties)
1307
+ _init(config?: Session.ConstructorProperties): void
1308
+ }
1309
+
1310
+ export module Stream {
1311
+
1312
+ // Signal callback interfaces
1313
+
1314
+ /**
1315
+ * Signal callback interface for `error`
1316
+ */
1317
+ export interface ErrorSignalCallback {
1318
+ ($obj: Stream, errorno: Error, error_msg: string | null): void
1319
+ }
1320
+
1321
+ /**
1322
+ * Signal callback interface for `src-pad-added`
1323
+ */
1324
+ export interface SrcPadAddedSignalCallback {
1325
+ ($obj: Stream, pad: Gst.Pad, codec: Codec): void
1326
+ }
1327
+
1328
+
1329
+ // Constructor properties interface
1330
+
1331
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1332
+
1333
+ // Own constructor properties of Farstream-0.2.Farstream.Stream
1334
+
1335
+ /**
1336
+ * The direction of the stream. This property is set initially as a parameter
1337
+ * to the fs_session_new_stream() function. It can be changed later if
1338
+ * required by setting this property.
1339
+ */
1340
+ direction?: StreamDirection | null
1341
+ /**
1342
+ * The #FsParticipant for this stream. This property is a construct param and
1343
+ * is read-only construction.
1344
+ */
1345
+ participant?: Participant | null
1346
+ /**
1347
+ * The #FsSession for this stream. This property is a construct param and
1348
+ * is read-only construction.
1349
+ */
1350
+ session?: Session | null
1351
+ }
1352
+
1353
+ }
1354
+
1355
+ export interface Stream {
1356
+
1357
+ // Own properties of Farstream-0.2.Farstream.Stream
1358
+
1359
+ /**
1360
+ * This is the list of codecs that have been received by this stream.
1361
+ * The user must free the list if fs_codec_list_destroy().
1362
+ * The "farstream-recv-codecs-changed" message is send on the #GstBus
1363
+ * when the value of this property changes.
1364
+ * It is normally emitted right after #FsStream::src-pad-added
1365
+ * only if that codec was not previously received in this stream, but it can
1366
+ * also be emitted if the pad already exists, but the source material that
1367
+ * will come to it is different.
1368
+ */
1369
+ readonly current_recv_codecs: Codec[]
1370
+ /**
1371
+ * Retrieves previously set decryption parameters
1372
+ */
1373
+ readonly decryption_parameters: Gst.Structure
1374
+ /**
1375
+ * The direction of the stream. This property is set initially as a parameter
1376
+ * to the fs_session_new_stream() function. It can be changed later if
1377
+ * required by setting this property.
1378
+ */
1379
+ direction: StreamDirection
1380
+ /**
1381
+ * This is the list of negotiatied codecs, it is the same list as the list
1382
+ * of #FsCodec from the parent #FsSession, except that the codec config data
1383
+ * has been replaced with the data from the remote codecs for this stream.
1384
+ * This is the list of #FsCodec used to receive data from this stream.
1385
+ * It is a #GList of #FsCodec.
1386
+ */
1387
+ readonly negotiated_codecs: Codec[]
1388
+ /**
1389
+ * The #FsParticipant for this stream. This property is a construct param and
1390
+ * is read-only construction.
1391
+ */
1392
+ readonly participant: Participant
1393
+ /**
1394
+ * This is the list of remote codecs for this stream. They must be set by the
1395
+ * user as soon as they are known using fs_stream_set_remote_codecs()
1396
+ * (generally through external signaling). It is a #GList of #FsCodec.
1397
+ */
1398
+ readonly remote_codecs: Codec[]
1399
+ /**
1400
+ * The #FsSession for this stream. This property is a construct param and
1401
+ * is read-only construction.
1402
+ */
1403
+ readonly session: Session
1404
+
1405
+ // Own fields of Farstream-0.2.Farstream.Stream
1406
+
1407
+ parent: GObject.Object
1408
+
1409
+ // Owm methods of Farstream-0.2.Farstream.Stream
1410
+
1411
+ /**
1412
+ * This function is used to add data identifiers that allow the
1413
+ * plugin to recognize packets that are meant for id. For example, in RTP,
1414
+ * one would set the SSRCs that are expected.
1415
+ *
1416
+ * Depending on the protocol, one may be able to add more than one ID
1417
+ * to a stream (in RTP you can have multiple SSRCs in a stream).
1418
+ * If a protocol supports only one id, adding a new one will overwrite it.
1419
+ * If an ID was already set on a stream, adding it to another stream will
1420
+ * override the previdous decision.
1421
+ *
1422
+ * For most protocols, calling this function is optional as the incoming data
1423
+ * can be matched with a stream by its source IP address. This is mostly useful
1424
+ * if one is using multicast or is behind a muxer server.
1425
+ * @param id The id to add to the stream
1426
+ */
1427
+ add_id(id: number): void
1428
+ /**
1429
+ * This function adds remote candidates. Any new candidates are
1430
+ * added to the list. The candidates will be used to establish a connection
1431
+ * with the peer. A copy will be made so the user must free the
1432
+ * passed candidate using fs_candidate_destroy() when done.
1433
+ * @param candidates an #GList of #FsCandidate representing the remote candidates
1434
+ * @returns TRUE if the candidate was valid, FALSE otherwise
1435
+ */
1436
+ add_remote_candidates(candidates: Candidate[]): boolean
1437
+ /**
1438
+ * This will cause the stream to remove all links to other objects and to
1439
+ * remove itself from the #FsSession. Once a #FsStream has been destroyed, it
1440
+ * can not be used anymore.
1441
+ *
1442
+ * It is strongly recommended to call this function from the main thread because
1443
+ * releasing the application's reference to a stream.
1444
+ */
1445
+ destroy(): void
1446
+ /**
1447
+ * This function emits the #FsStream::error" signal, it should only be
1448
+ * called by subclasses.
1449
+ * @param error_no The number of the error
1450
+ * @param error_msg Error message to be displayed to user
1451
+ */
1452
+ emit_error(error_no: number, error_msg: string | null): void
1453
+ /**
1454
+ * Emits the #FsStream::src-pad-added" signal, it should only be
1455
+ * called by subclasses.
1456
+ * @param pad the #GstPad that this #FsStream has created
1457
+ * @param codec The #FsCodec for this pad
1458
+ */
1459
+ emit_src_pad_added(pad: Gst.Pad, codec: Codec): void
1460
+ /**
1461
+ * This function forces data to be sent immediately to the selected remote
1462
+ * candidate, by-passing any connectivity checks. There should be at most
1463
+ * one candidate per component.
1464
+ * @param remote_candidates a #GList of #FsCandidate to force
1465
+ * @returns %TRUE if the candidates could be forced, %FALSE otherwise
1466
+ */
1467
+ force_remote_candidates(remote_candidates: Candidate[]): boolean
1468
+ /**
1469
+ * Creates a #GstIterator that can be used to iterate the src pads of this
1470
+ * stream. These are the pads that were announced by #FsStream:src-pad-added
1471
+ * and are still valid.
1472
+ * @returns The #GstIterator
1473
+ */
1474
+ iterate_src_pads(): Gst.Iterator
1475
+ /**
1476
+ * Parses a "farstream-component-state-changed" message and checks if it matches
1477
+ * the `stream` parameters.
1478
+ * @param message a #GstMessage to parse
1479
+ * @returns %TRUE if the message matches the stream and is valid.
1480
+ */
1481
+ parse_component_state_changed(message: Gst.Message): [ /* returnType */ boolean, /* component */ number, /* state */ StreamState ]
1482
+ /**
1483
+ * Parses a "farstream-local-candidates-prepared" message and checks if it matches
1484
+ * the `stream` parameters.
1485
+ * @param message a #GstMessage to parse
1486
+ * @returns %TRUE if the message matches the stream and is valid.
1487
+ */
1488
+ parse_local_candidates_prepared(message: Gst.Message): boolean
1489
+ /**
1490
+ * Parses a "farstream-new-active-candidate-pair" message and checks
1491
+ * if it matches the `stream` parameters.
1492
+ * @param message a #GstMessage to parse
1493
+ * @returns %TRUE if the message matches the stream and is valid.
1494
+ */
1495
+ parse_new_active_candidate_pair(message: Gst.Message): [ /* returnType */ boolean, /* local_candidate */ Candidate, /* remote_candidate */ Candidate ]
1496
+ /**
1497
+ * Parses a "farstream-new-local-candidate" message and checks if it matches
1498
+ * the `stream` parameters.
1499
+ * @param message a #GstMessage to parse
1500
+ * @returns %TRUE if the message matches the stream and is valid.
1501
+ */
1502
+ parse_new_local_candidate(message: Gst.Message): [ /* returnType */ boolean, /* candidate */ Candidate ]
1503
+ /**
1504
+ * Parses a "farstream-recv-codecs-changed" message and checks if it matches
1505
+ * the `stream` parameters.
1506
+ * @param message a #GstMessage to parse
1507
+ * @returns %TRUE if the message matches the stream and is valid.
1508
+ */
1509
+ parse_recv_codecs_changed(message: Gst.Message): [ /* returnType */ boolean, /* codecs */ Codec[] ]
1510
+ /**
1511
+ * Sets decryption parameters. The exact parameters depend on the type of
1512
+ * plugin being used.
1513
+ * @param parameters a #GstStructure containing the decryption parameters
1514
+ * @returns %TRUE if the decryption parameters could be set, %FALSE otherwise
1515
+ */
1516
+ set_decryption_parameters(parameters: Gst.Structure): boolean
1517
+ /**
1518
+ * This function will set the list of remote codecs for this stream. If
1519
+ * the given remote codecs couldn't be negotiated with the list of local
1520
+ * codecs or already negotiated codecs for the corresponding #FsSession, `error`
1521
+ * will be set and %FALSE will be returned. The `remote_codecs` list will be
1522
+ * copied so it must be free'd using fs_codec_list_destroy() when done.
1523
+ * @param remote_codecs a #GList of #FsCodec representing the remote codecs
1524
+ * @returns %FALSE if the remote codecs couldn't be set.
1525
+ */
1526
+ set_remote_codecs(remote_codecs: Codec[]): boolean
1527
+ /**
1528
+ * Set the transmitter to use for this stream. This function will only succeed
1529
+ * once.
1530
+ *
1531
+ * The parameters correspond to the varios GObject properties of the
1532
+ * selected stream transmitter.
1533
+ * @param transmitter Name of the type of transmitter to use for this stream
1534
+ * @param stream_transmitter_parameters an array of n_parameters #GParameter struct that will be passed to the newly-create #FsStreamTransmitter
1535
+ * @returns %TRUE if the transmitter could be set, %FALSE otherwise
1536
+ */
1537
+ set_transmitter(transmitter: string | null, stream_transmitter_parameters: GObject.Parameter[] | null): boolean
1538
+ /**
1539
+ * Set the transmitter to use for this stream. This function will only succeed
1540
+ * once.
1541
+ *
1542
+ * The parameters correspond to the varios GObject properties of the
1543
+ * selected stream transmitter.
1544
+ *
1545
+ * This is the same as fs_stream_set_transmitter() except that the parameters
1546
+ * are passed in a #GHashTable to make it more friendly to GObject introspection
1547
+ * @param transmitter Name of the type of transmitter to use for this stream
1548
+ * @param stream_transmitter_parameters A #GHashTable of string->GValue containing the parameters.
1549
+ * @returns %TRUE if the transmitter could be set, %FALSE otherwise
1550
+ */
1551
+ set_transmitter_ht(transmitter: string | null, stream_transmitter_parameters: GLib.HashTable | null): boolean
1552
+
1553
+ // Own virtual methods of Farstream-0.2.Farstream.Stream
1554
+
1555
+ /**
1556
+ * This function is used to add data identifiers that allow the
1557
+ * plugin to recognize packets that are meant for id. For example, in RTP,
1558
+ * one would set the SSRCs that are expected.
1559
+ *
1560
+ * Depending on the protocol, one may be able to add more than one ID
1561
+ * to a stream (in RTP you can have multiple SSRCs in a stream).
1562
+ * If a protocol supports only one id, adding a new one will overwrite it.
1563
+ * If an ID was already set on a stream, adding it to another stream will
1564
+ * override the previdous decision.
1565
+ *
1566
+ * For most protocols, calling this function is optional as the incoming data
1567
+ * can be matched with a stream by its source IP address. This is mostly useful
1568
+ * if one is using multicast or is behind a muxer server.
1569
+ * @virtual
1570
+ * @param id The id to add to the stream
1571
+ */
1572
+ vfunc_add_id(id: number): void
1573
+ /**
1574
+ * This function adds remote candidates. Any new candidates are
1575
+ * added to the list. The candidates will be used to establish a connection
1576
+ * with the peer. A copy will be made so the user must free the
1577
+ * passed candidate using fs_candidate_destroy() when done.
1578
+ * @virtual
1579
+ * @param candidates an #GList of #FsCandidate representing the remote candidates
1580
+ * @returns TRUE if the candidate was valid, FALSE otherwise
1581
+ */
1582
+ vfunc_add_remote_candidates(candidates: Candidate[]): boolean
1583
+ /**
1584
+ * This function forces data to be sent immediately to the selected remote
1585
+ * candidate, by-passing any connectivity checks. There should be at most
1586
+ * one candidate per component.
1587
+ * @virtual
1588
+ * @param remote_candidates a #GList of #FsCandidate to force
1589
+ * @returns %TRUE if the candidates could be forced, %FALSE otherwise
1590
+ */
1591
+ vfunc_force_remote_candidates(remote_candidates: Candidate[]): boolean
1592
+ /**
1593
+ * Sets decryption parameters. The exact parameters depend on the type of
1594
+ * plugin being used.
1595
+ * @virtual
1596
+ * @param parameters a #GstStructure containing the decryption parameters
1597
+ * @returns %TRUE if the decryption parameters could be set, %FALSE otherwise
1598
+ */
1599
+ vfunc_set_decryption_parameters(parameters: Gst.Structure): boolean
1600
+ /**
1601
+ * This function will set the list of remote codecs for this stream. If
1602
+ * the given remote codecs couldn't be negotiated with the list of local
1603
+ * codecs or already negotiated codecs for the corresponding #FsSession, `error`
1604
+ * will be set and %FALSE will be returned. The `remote_codecs` list will be
1605
+ * copied so it must be free'd using fs_codec_list_destroy() when done.
1606
+ * @virtual
1607
+ * @param remote_codecs a #GList of #FsCodec representing the remote codecs
1608
+ * @returns %FALSE if the remote codecs couldn't be set.
1609
+ */
1610
+ vfunc_set_remote_codecs(remote_codecs: Codec[]): boolean
1611
+ /**
1612
+ * Set the transmitter to use for this stream. This function will only succeed
1613
+ * once.
1614
+ *
1615
+ * The parameters correspond to the varios GObject properties of the
1616
+ * selected stream transmitter.
1617
+ * @virtual
1618
+ * @param transmitter Name of the type of transmitter to use for this stream
1619
+ * @param stream_transmitter_parameters an array of n_parameters #GParameter struct that will be passed to the newly-create #FsStreamTransmitter
1620
+ * @returns %TRUE if the transmitter could be set, %FALSE otherwise
1621
+ */
1622
+ vfunc_set_transmitter(transmitter: string | null, stream_transmitter_parameters: GObject.Parameter[] | null): boolean
1623
+
1624
+ // Own signals of Farstream-0.2.Farstream.Stream
1625
+
1626
+ connect(sigName: "error", callback: Stream.ErrorSignalCallback): number
1627
+ connect_after(sigName: "error", callback: Stream.ErrorSignalCallback): number
1628
+ emit(sigName: "error", errorno: Error, error_msg: string | null, ...args: any[]): void
1629
+ connect(sigName: "src-pad-added", callback: Stream.SrcPadAddedSignalCallback): number
1630
+ connect_after(sigName: "src-pad-added", callback: Stream.SrcPadAddedSignalCallback): number
1631
+ emit(sigName: "src-pad-added", pad: Gst.Pad, codec: Codec, ...args: any[]): void
1632
+
1633
+ // Class property signals of Farstream-0.2.Farstream.Stream
1634
+
1635
+ connect(sigName: "notify::current-recv-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1636
+ connect_after(sigName: "notify::current-recv-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1637
+ emit(sigName: "notify::current-recv-codecs", ...args: any[]): void
1638
+ connect(sigName: "notify::decryption-parameters", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1639
+ connect_after(sigName: "notify::decryption-parameters", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1640
+ emit(sigName: "notify::decryption-parameters", ...args: any[]): void
1641
+ connect(sigName: "notify::direction", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1642
+ connect_after(sigName: "notify::direction", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1643
+ emit(sigName: "notify::direction", ...args: any[]): void
1644
+ connect(sigName: "notify::negotiated-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1645
+ connect_after(sigName: "notify::negotiated-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1646
+ emit(sigName: "notify::negotiated-codecs", ...args: any[]): void
1647
+ connect(sigName: "notify::participant", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1648
+ connect_after(sigName: "notify::participant", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1649
+ emit(sigName: "notify::participant", ...args: any[]): void
1650
+ connect(sigName: "notify::remote-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1651
+ connect_after(sigName: "notify::remote-codecs", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1652
+ emit(sigName: "notify::remote-codecs", ...args: any[]): void
1653
+ connect(sigName: "notify::session", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1654
+ connect_after(sigName: "notify::session", callback: (($obj: Stream, pspec: GObject.ParamSpec) => void)): number
1655
+ emit(sigName: "notify::session", ...args: any[]): void
1656
+ connect(sigName: string, callback: (...args: any[]) => void): number
1657
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1658
+ emit(sigName: string, ...args: any[]): void
1659
+ disconnect(id: number): void
1660
+ }
1661
+
1662
+ /**
1663
+ * All members are private, access them using methods and properties
1664
+ * @class
1665
+ */
1666
+ export class Stream extends GObject.Object {
1667
+
1668
+ // Own properties of Farstream-0.2.Farstream.Stream
1669
+
1670
+ static name: string
1671
+ static $gtype: GObject.GType<Stream>
1672
+
1673
+ // Constructors of Farstream-0.2.Farstream.Stream
1674
+
1675
+ constructor(config?: Stream.ConstructorProperties)
1676
+ _init(config?: Stream.ConstructorProperties): void
1677
+ }
1678
+
1679
+ export module StreamTransmitter {
1680
+
1681
+ // Signal callback interfaces
1682
+
1683
+ /**
1684
+ * Signal callback interface for `error`
1685
+ */
1686
+ export interface ErrorSignalCallback {
1687
+ ($obj: StreamTransmitter, errorno: Error, error_msg: string | null): void
1688
+ }
1689
+
1690
+ /**
1691
+ * Signal callback interface for `known-source-packet-received`
1692
+ */
1693
+ export interface KnownSourcePacketReceivedSignalCallback {
1694
+ ($obj: StreamTransmitter, component: number, buffer: any): void
1695
+ }
1696
+
1697
+ /**
1698
+ * Signal callback interface for `local-candidates-prepared`
1699
+ */
1700
+ export interface LocalCandidatesPreparedSignalCallback {
1701
+ ($obj: StreamTransmitter): void
1702
+ }
1703
+
1704
+ /**
1705
+ * Signal callback interface for `new-active-candidate-pair`
1706
+ */
1707
+ export interface NewActiveCandidatePairSignalCallback {
1708
+ ($obj: StreamTransmitter, local_candidate: Candidate, remote_candidate: Candidate): void
1709
+ }
1710
+
1711
+ /**
1712
+ * Signal callback interface for `new-local-candidate`
1713
+ */
1714
+ export interface NewLocalCandidateSignalCallback {
1715
+ ($obj: StreamTransmitter, local_candidate: Candidate): void
1716
+ }
1717
+
1718
+ /**
1719
+ * Signal callback interface for `state-changed`
1720
+ */
1721
+ export interface StateChangedSignalCallback {
1722
+ ($obj: StreamTransmitter, component: number, state: StreamState): void
1723
+ }
1724
+
1725
+
1726
+ // Constructor properties interface
1727
+
1728
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1729
+
1730
+ // Own constructor properties of Farstream-0.2.Farstream.StreamTransmitter
1731
+
1732
+ /**
1733
+ * This tells the stream transmitter to associate incoming data with this
1734
+ * based on the source without looking at the content if possible.
1735
+ */
1736
+ associate_on_source?: boolean | null
1737
+ preferred_local_candidates?: any | null
1738
+ /**
1739
+ * A network source #GstElement to be used by the #FsSession
1740
+ */
1741
+ sending?: boolean | null
1742
+ }
1743
+
1744
+ }
1745
+
1746
+ export interface StreamTransmitter {
1747
+
1748
+ // Own properties of Farstream-0.2.Farstream.StreamTransmitter
1749
+
1750
+ /**
1751
+ * This tells the stream transmitter to associate incoming data with this
1752
+ * based on the source without looking at the content if possible.
1753
+ */
1754
+ readonly associate_on_source: boolean
1755
+ readonly preferred_local_candidates: any
1756
+ /**
1757
+ * A network source #GstElement to be used by the #FsSession
1758
+ */
1759
+ sending: boolean
1760
+
1761
+ // Own fields of Farstream-0.2.Farstream.StreamTransmitter
1762
+
1763
+ parent: GObject.Object
1764
+
1765
+ // Owm methods of Farstream-0.2.Farstream.StreamTransmitter
1766
+
1767
+ /**
1768
+ * This function is used to add remote candidates to the transmitter
1769
+ * @param candidates a #GList of the remote candidates
1770
+ * @returns TRUE of the candidate could be added, FALSE if it couldnt (and the #GError will be set)
1771
+ */
1772
+ add_remote_candidates(candidates: Candidate[]): boolean
1773
+ /**
1774
+ * This function emit the "error" signal on a #FsStreamTransmitter, it should
1775
+ * only be called by subclasses.
1776
+ * @param error_no The number of the error
1777
+ * @param error_msg Error message (for the programmer)
1778
+ */
1779
+ emit_error(error_no: number, error_msg: string | null): void
1780
+ /**
1781
+ * This function forces data to be sent immediately to the selected remote
1782
+ * candidate, by-passing any connectivity checks. There should be at most
1783
+ * one candidate per component.
1784
+ * @param remote_candidates a #GList of #FsCandidate to force
1785
+ * @returns %TRUE if the candidates could be forced, %FALSE otherwise
1786
+ */
1787
+ force_remote_candidates(remote_candidates: Candidate[]): boolean
1788
+ /**
1789
+ * This function tells the transmitter to start gathering local candidates,
1790
+ * signals for new candidates and newly active candidates can be emitted
1791
+ * during the call to this function.
1792
+ * @returns %TRUE if it succeeds (or is not implemented), %FALSE otherwise
1793
+ */
1794
+ gather_local_candidates(): boolean
1795
+ /**
1796
+ * This functions stops the #FsStreamTransmitter, it must be called before
1797
+ * the last reference is dropped.
1798
+ */
1799
+ stop(): void
1800
+
1801
+ // Own virtual methods of Farstream-0.2.Farstream.StreamTransmitter
1802
+
1803
+ /**
1804
+ * This function is used to add remote candidates to the transmitter
1805
+ * @virtual
1806
+ * @param candidates a #GList of the remote candidates
1807
+ * @returns TRUE of the candidate could be added, FALSE if it couldnt (and the #GError will be set)
1808
+ */
1809
+ vfunc_add_remote_candidates(candidates: Candidate[]): boolean
1810
+ /**
1811
+ * This function forces data to be sent immediately to the selected remote
1812
+ * candidate, by-passing any connectivity checks. There should be at most
1813
+ * one candidate per component.
1814
+ * @virtual
1815
+ * @param remote_candidates a #GList of #FsCandidate to force
1816
+ * @returns %TRUE if the candidates could be forced, %FALSE otherwise
1817
+ */
1818
+ vfunc_force_remote_candidates(remote_candidates: Candidate[]): boolean
1819
+ /**
1820
+ * This function tells the transmitter to start gathering local candidates,
1821
+ * signals for new candidates and newly active candidates can be emitted
1822
+ * during the call to this function.
1823
+ * @virtual
1824
+ * @returns %TRUE if it succeeds (or is not implemented), %FALSE otherwise
1825
+ */
1826
+ vfunc_gather_local_candidates(): boolean
1827
+ /**
1828
+ * This functions stops the #FsStreamTransmitter, it must be called before
1829
+ * the last reference is dropped.
1830
+ * @virtual
1831
+ */
1832
+ vfunc_stop(): void
1833
+
1834
+ // Own signals of Farstream-0.2.Farstream.StreamTransmitter
1835
+
1836
+ connect(sigName: "error", callback: StreamTransmitter.ErrorSignalCallback): number
1837
+ connect_after(sigName: "error", callback: StreamTransmitter.ErrorSignalCallback): number
1838
+ emit(sigName: "error", errorno: Error, error_msg: string | null, ...args: any[]): void
1839
+ connect(sigName: "known-source-packet-received", callback: StreamTransmitter.KnownSourcePacketReceivedSignalCallback): number
1840
+ connect_after(sigName: "known-source-packet-received", callback: StreamTransmitter.KnownSourcePacketReceivedSignalCallback): number
1841
+ emit(sigName: "known-source-packet-received", component: number, buffer: any, ...args: any[]): void
1842
+ connect(sigName: "local-candidates-prepared", callback: StreamTransmitter.LocalCandidatesPreparedSignalCallback): number
1843
+ connect_after(sigName: "local-candidates-prepared", callback: StreamTransmitter.LocalCandidatesPreparedSignalCallback): number
1844
+ emit(sigName: "local-candidates-prepared", ...args: any[]): void
1845
+ connect(sigName: "new-active-candidate-pair", callback: StreamTransmitter.NewActiveCandidatePairSignalCallback): number
1846
+ connect_after(sigName: "new-active-candidate-pair", callback: StreamTransmitter.NewActiveCandidatePairSignalCallback): number
1847
+ emit(sigName: "new-active-candidate-pair", local_candidate: Candidate, remote_candidate: Candidate, ...args: any[]): void
1848
+ connect(sigName: "new-local-candidate", callback: StreamTransmitter.NewLocalCandidateSignalCallback): number
1849
+ connect_after(sigName: "new-local-candidate", callback: StreamTransmitter.NewLocalCandidateSignalCallback): number
1850
+ emit(sigName: "new-local-candidate", local_candidate: Candidate, ...args: any[]): void
1851
+ connect(sigName: "state-changed", callback: StreamTransmitter.StateChangedSignalCallback): number
1852
+ connect_after(sigName: "state-changed", callback: StreamTransmitter.StateChangedSignalCallback): number
1853
+ emit(sigName: "state-changed", component: number, state: StreamState, ...args: any[]): void
1854
+
1855
+ // Class property signals of Farstream-0.2.Farstream.StreamTransmitter
1856
+
1857
+ connect(sigName: "notify::associate-on-source", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1858
+ connect_after(sigName: "notify::associate-on-source", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1859
+ emit(sigName: "notify::associate-on-source", ...args: any[]): void
1860
+ connect(sigName: "notify::preferred-local-candidates", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1861
+ connect_after(sigName: "notify::preferred-local-candidates", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1862
+ emit(sigName: "notify::preferred-local-candidates", ...args: any[]): void
1863
+ connect(sigName: "notify::sending", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1864
+ connect_after(sigName: "notify::sending", callback: (($obj: StreamTransmitter, pspec: GObject.ParamSpec) => void)): number
1865
+ emit(sigName: "notify::sending", ...args: any[]): void
1866
+ connect(sigName: string, callback: (...args: any[]) => void): number
1867
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1868
+ emit(sigName: string, ...args: any[]): void
1869
+ disconnect(id: number): void
1870
+ }
1871
+
1872
+ /**
1873
+ * All members are private, access them using methods and properties
1874
+ * @class
1875
+ */
1876
+ export class StreamTransmitter extends GObject.Object {
1877
+
1878
+ // Own properties of Farstream-0.2.Farstream.StreamTransmitter
1879
+
1880
+ static name: string
1881
+ static $gtype: GObject.GType<StreamTransmitter>
1882
+
1883
+ // Constructors of Farstream-0.2.Farstream.StreamTransmitter
1884
+
1885
+ constructor(config?: StreamTransmitter.ConstructorProperties)
1886
+ _init(config?: StreamTransmitter.ConstructorProperties): void
1887
+ }
1888
+
1889
+ export module Transmitter {
1890
+
1891
+ // Signal callback interfaces
1892
+
1893
+ /**
1894
+ * Signal callback interface for `error`
1895
+ */
1896
+ export interface ErrorSignalCallback {
1897
+ ($obj: Transmitter, errorno: Error, error_msg: string | null): void
1898
+ }
1899
+
1900
+
1901
+ // Constructor properties interface
1902
+
1903
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1904
+
1905
+ // Own constructor properties of Farstream-0.2.Farstream.Transmitter
1906
+
1907
+ /**
1908
+ * The number of components to create
1909
+ */
1910
+ components?: number | null
1911
+ /**
1912
+ * Apply current stream time to buffers or provide buffers without
1913
+ * timestamps. Must be set before creating a stream transmitter.
1914
+ */
1915
+ do_timestamp?: boolean | null
1916
+ /**
1917
+ * Sets the IP ToS field (and if possible the IPv6 TCLASS field
1918
+ */
1919
+ tos?: number | null
1920
+ }
1921
+
1922
+ }
1923
+
1924
+ export interface Transmitter {
1925
+
1926
+ // Own properties of Farstream-0.2.Farstream.Transmitter
1927
+
1928
+ /**
1929
+ * The number of components to create
1930
+ */
1931
+ readonly components: number
1932
+ /**
1933
+ * Apply current stream time to buffers or provide buffers without
1934
+ * timestamps. Must be set before creating a stream transmitter.
1935
+ */
1936
+ do_timestamp: boolean
1937
+ /**
1938
+ * A network source #GstElement to be used by the #FsSession
1939
+ * These element's sink must have async=FALSE
1940
+ * This element MUST provide a pad named "sink_\%u" per component.
1941
+ * These pads number must start at 1 (the \%u corresponds to the component
1942
+ * number).
1943
+ * These pads MUST be static pads.
1944
+ */
1945
+ readonly gst_sink: Gst.Element
1946
+ /**
1947
+ * A network source #GstElement to be used by the #FsSession
1948
+ * This element MUST provide a source pad named "src_%u" per component.
1949
+ * These pads number must start at 1 (the %u corresponds to the component
1950
+ * number).
1951
+ * These pads MUST be static pads.
1952
+ */
1953
+ readonly gst_src: Gst.Element
1954
+ /**
1955
+ * Sets the IP ToS field (and if possible the IPv6 TCLASS field
1956
+ */
1957
+ tos: number
1958
+
1959
+ // Own fields of Farstream-0.2.Farstream.Transmitter
1960
+
1961
+ parent: GObject.Object
1962
+
1963
+ // Owm methods of Farstream-0.2.Farstream.Transmitter
1964
+
1965
+ /**
1966
+ * This function emit the "error" signal on a #FsTransmitter, it should
1967
+ * only be called by subclasses.
1968
+ * @param error_no The number of the error
1969
+ * @param error_msg Error message to be displayed to user
1970
+ */
1971
+ emit_error(error_no: number, error_msg: string | null): void
1972
+ /**
1973
+ * This function returns the GObject type for the stream transmitter.
1974
+ * This is meant for bindings that need to introspect the type of arguments
1975
+ * that can be passed to the _new_stream_transmitter.
1976
+ * @returns the #GType
1977
+ */
1978
+ get_stream_transmitter_type(): GObject.GType
1979
+ /**
1980
+ * This function will create a new #FsStreamTransmitter element for a
1981
+ * specific participant for this #FsTransmitter
1982
+ * @param participant the #FsParticipant for which the #FsStream using this new #FsStreamTransmitter is created
1983
+ * @param n_parameters The number of parameters to pass to the newly created #FsStreamTransmitter
1984
+ * @param parameters an array of #GParameter
1985
+ * @returns a new #FsStreamTransmitter, or NULL if there is an error
1986
+ */
1987
+ new_stream_transmitter(participant: Participant, n_parameters: number, parameters: GObject.Parameter): StreamTransmitter
1988
+
1989
+ // Own virtual methods of Farstream-0.2.Farstream.Transmitter
1990
+
1991
+ /**
1992
+ * This function returns the GObject type for the stream transmitter.
1993
+ * This is meant for bindings that need to introspect the type of arguments
1994
+ * that can be passed to the _new_stream_transmitter.
1995
+ * @virtual
1996
+ * @returns the #GType
1997
+ */
1998
+ vfunc_get_stream_transmitter_type(): GObject.GType
1999
+ /**
2000
+ * This function will create a new #FsStreamTransmitter element for a
2001
+ * specific participant for this #FsTransmitter
2002
+ * @virtual
2003
+ * @param participant the #FsParticipant for which the #FsStream using this new #FsStreamTransmitter is created
2004
+ * @param n_parameters The number of parameters to pass to the newly created #FsStreamTransmitter
2005
+ * @param parameters an array of #GParameter
2006
+ * @returns a new #FsStreamTransmitter, or NULL if there is an error
2007
+ */
2008
+ vfunc_new_stream_transmitter(participant: Participant, n_parameters: number, parameters: GObject.Parameter): StreamTransmitter
2009
+
2010
+ // Own signals of Farstream-0.2.Farstream.Transmitter
2011
+
2012
+ connect(sigName: "error", callback: Transmitter.ErrorSignalCallback): number
2013
+ connect_after(sigName: "error", callback: Transmitter.ErrorSignalCallback): number
2014
+ emit(sigName: "error", errorno: Error, error_msg: string | null, ...args: any[]): void
2015
+
2016
+ // Class property signals of Farstream-0.2.Farstream.Transmitter
2017
+
2018
+ connect(sigName: "notify::components", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2019
+ connect_after(sigName: "notify::components", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2020
+ emit(sigName: "notify::components", ...args: any[]): void
2021
+ connect(sigName: "notify::do-timestamp", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2022
+ connect_after(sigName: "notify::do-timestamp", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2023
+ emit(sigName: "notify::do-timestamp", ...args: any[]): void
2024
+ connect(sigName: "notify::gst-sink", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2025
+ connect_after(sigName: "notify::gst-sink", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2026
+ emit(sigName: "notify::gst-sink", ...args: any[]): void
2027
+ connect(sigName: "notify::gst-src", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2028
+ connect_after(sigName: "notify::gst-src", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2029
+ emit(sigName: "notify::gst-src", ...args: any[]): void
2030
+ connect(sigName: "notify::tos", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2031
+ connect_after(sigName: "notify::tos", callback: (($obj: Transmitter, pspec: GObject.ParamSpec) => void)): number
2032
+ emit(sigName: "notify::tos", ...args: any[]): void
2033
+ connect(sigName: string, callback: (...args: any[]) => void): number
2034
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2035
+ emit(sigName: string, ...args: any[]): void
2036
+ disconnect(id: number): void
2037
+ }
2038
+
2039
+ /**
2040
+ * All members are private, access them using methods and properties
2041
+ * @class
2042
+ */
2043
+ export class Transmitter extends GObject.Object {
2044
+
2045
+ // Own properties of Farstream-0.2.Farstream.Transmitter
2046
+
2047
+ static name: string
2048
+ static $gtype: GObject.GType<Transmitter>
2049
+
2050
+ // Constructors of Farstream-0.2.Farstream.Transmitter
2051
+
2052
+ constructor(config?: Transmitter.ConstructorProperties)
2053
+ /**
2054
+ * This function creates a new transmitter of the requested type.
2055
+ * It will load the appropriate plugin as required.
2056
+ * @constructor
2057
+ * @param type The type of transmitter to create
2058
+ * @param components The number of components to create
2059
+ * @param tos The Type of Service of the socket, max is 255
2060
+ * @returns a newly-created #FsTransmitter of the requested type (or NULL if there is an error)
2061
+ */
2062
+ constructor(type: string | null, components: number, tos: number)
2063
+ /**
2064
+ * This function creates a new transmitter of the requested type.
2065
+ * It will load the appropriate plugin as required.
2066
+ * @constructor
2067
+ * @param type The type of transmitter to create
2068
+ * @param components The number of components to create
2069
+ * @param tos The Type of Service of the socket, max is 255
2070
+ * @returns a newly-created #FsTransmitter of the requested type (or NULL if there is an error)
2071
+ */
2072
+ static new(type: string | null, components: number, tos: number): Transmitter
2073
+ _init(config?: Transmitter.ConstructorProperties): void
2074
+ /**
2075
+ * Get the list of all available transmitters
2076
+ * @returns a newly allocated array of strings containing the list of all available transmitters or %NULL if there are none. It should be freed with g_strfreev().
2077
+ */
2078
+ static list_available(): string[]
2079
+ }
2080
+
2081
+ export interface Candidate {
2082
+
2083
+ // Own fields of Farstream-0.2.Farstream.Candidate
2084
+
2085
+ /**
2086
+ * a string representing the foundation of this candidate (maximum 32 chars)
2087
+ * @field
2088
+ */
2089
+ foundation: string | null
2090
+ /**
2091
+ * value between 1 and 256 indicating which component this candidate represents (1 is RTP, 2 is RTCP, #FsComponentType can be used here)
2092
+ * @field
2093
+ */
2094
+ component_id: number
2095
+ /**
2096
+ * IP in dotted format
2097
+ * @field
2098
+ */
2099
+ ip: string | null
2100
+ /**
2101
+ * Port to use
2102
+ * @field
2103
+ */
2104
+ port: number
2105
+ /**
2106
+ * IP of base in dotted format as defined in ICE-19.
2107
+ * @field
2108
+ */
2109
+ base_ip: string | null
2110
+ /**
2111
+ * Port of base as defined in ICE-19.
2112
+ * @field
2113
+ */
2114
+ base_port: number
2115
+ /**
2116
+ * #FsNetworkProtocol for ip protocol to use as candidate
2117
+ * @field
2118
+ */
2119
+ proto: NetworkProtocol
2120
+ /**
2121
+ * Value between 0 and (2^31 - 1) representing the priority
2122
+ * @field
2123
+ */
2124
+ priority: number
2125
+ /**
2126
+ * The #FsCandidateType of the candidate
2127
+ * @field
2128
+ */
2129
+ type: CandidateType
2130
+ /**
2131
+ * Username to use to connect to client if necessary,
2132
+ * NULL otherwise
2133
+ * @field
2134
+ */
2135
+ username: string | null
2136
+ /**
2137
+ * Username to use to connect to client if necessary,
2138
+ * NULL otherwise
2139
+ * @field
2140
+ */
2141
+ password: string | null
2142
+ /**
2143
+ * The TTL used when sending Multicast packet (0 = auto)
2144
+ * @field
2145
+ */
2146
+ ttl: number
2147
+
2148
+ // Owm methods of Farstream-0.2.Farstream.Candidate
2149
+
2150
+ /**
2151
+ * Copies a #FsCandidate and its contents.
2152
+ * @returns a new #FsCandidate
2153
+ */
2154
+ copy(): Candidate
2155
+ }
2156
+
2157
+ /**
2158
+ * Struct to hold information about ICE-19 compliant candidates
2159
+ * @record
2160
+ */
2161
+ export class Candidate {
2162
+
2163
+ // Own properties of Farstream-0.2.Farstream.Candidate
2164
+
2165
+ static name: string
2166
+
2167
+ // Constructors of Farstream-0.2.Farstream.Candidate
2168
+
2169
+ /**
2170
+ * Allocates a new #FsCandidate, the rest of the fields can be optionally
2171
+ * filled manually. See also fs_candidate_new_full()
2172
+ * @constructor
2173
+ * @param foundation The foundation of the candidate
2174
+ * @param component_id The component this candidate is for
2175
+ * @param type The type of candidate
2176
+ * @param proto The protocol this component is for
2177
+ * @param ip The IP address of this component (can be NULL for local candidate to mean any address)
2178
+ * @param port the UDP/TCP port
2179
+ * @returns a newly-allocated #FsCandidate
2180
+ */
2181
+ constructor(foundation: string | null, component_id: number, type: CandidateType, proto: NetworkProtocol, ip: string | null, port: number)
2182
+ /**
2183
+ * Allocates a new #FsCandidate, the rest of the fields can be optionally
2184
+ * filled manually. See also fs_candidate_new_full()
2185
+ * @constructor
2186
+ * @param foundation The foundation of the candidate
2187
+ * @param component_id The component this candidate is for
2188
+ * @param type The type of candidate
2189
+ * @param proto The protocol this component is for
2190
+ * @param ip The IP address of this component (can be NULL for local candidate to mean any address)
2191
+ * @param port the UDP/TCP port
2192
+ * @returns a newly-allocated #FsCandidate
2193
+ */
2194
+ static new(foundation: string | null, component_id: number, type: CandidateType, proto: NetworkProtocol, ip: string | null, port: number): Candidate
2195
+ /**
2196
+ * Allocates a new #FsCandidate, filling all the fields. See also
2197
+ * fs_candidate_new()
2198
+ * @constructor
2199
+ * @param foundation The foundation of the candidate
2200
+ * @param component_id The component this candidate is for
2201
+ * @param ip The IP address of this component (can be NULL for local candidate to mean any address)
2202
+ * @param port the UDP/TCP port
2203
+ * @param base_ip IP of base in dotted format as defined in ICE-19.
2204
+ * @param base_port Port of base as defined in ICE-19.
2205
+ * @param proto The protocol this component is for
2206
+ * @param priority Value between 0 and (2^31 - 1) representing the priority
2207
+ * @param type The type of candidate
2208
+ * @param username Username to use to connect to client if necessary, NULL otherwise
2209
+ * @param password Username to use to connect to client if necessary, NULL otherwise
2210
+ * @param ttl The TTL used when sending Multicast packet (0 = auto)
2211
+ * @returns a newly-allocated #FsCandidate
2212
+ */
2213
+ static new_full(foundation: string | null, component_id: number, ip: string | null, port: number, base_ip: string | null, base_port: number, proto: NetworkProtocol, priority: number, type: CandidateType, username: string | null, password: string | null, ttl: number): Candidate
2214
+ }
2215
+
2216
+ export interface Codec {
2217
+
2218
+ // Own fields of Farstream-0.2.Farstream.Codec
2219
+
2220
+ /**
2221
+ * numeric identifier for encoding, eg. PT for SDP
2222
+ * @field
2223
+ */
2224
+ id: number
2225
+ /**
2226
+ * the name of the codec
2227
+ * @field
2228
+ */
2229
+ encoding_name: string | null
2230
+ /**
2231
+ * type of media this codec is for
2232
+ * @field
2233
+ */
2234
+ media_type: MediaType
2235
+ /**
2236
+ * clock rate of this stream
2237
+ * @field
2238
+ */
2239
+ clock_rate: number
2240
+ /**
2241
+ * Number of channels codec should decode
2242
+ * @field
2243
+ */
2244
+ channels: number
2245
+ /**
2246
+ * The minimum interval between two RTCP reports,
2247
+ * If it is not specified (G_MAXUINT), it is up to the protocol to decide
2248
+ * (it is 5 seconds for RTP).
2249
+ * @field
2250
+ */
2251
+ minimum_reporting_interval: number
2252
+ /**
2253
+ * key pairs of param name to param data
2254
+ * @field
2255
+ */
2256
+ optional_params: CodecParameter[]
2257
+ /**
2258
+ * key triplets of
2259
+ * feedbck param type, subtype and extra string that is supported for this codec
2260
+ * @field
2261
+ */
2262
+ feedback_params: FeedbackParameter[]
2263
+
2264
+ // Owm methods of Farstream-0.2.Farstream.Codec
2265
+
2266
+ /**
2267
+ * This function adds an new feedback parameter to a #FsCodec
2268
+ * @param type The type of the feedback parameter
2269
+ * @param subtype The subtype of the feedback parameter
2270
+ * @param extra_params The extra_params of the feeback parameter
2271
+ */
2272
+ add_feedback_parameter(type: string | null, subtype: string | null, extra_params: string | null): void
2273
+ /**
2274
+ * This function adds an new optional parameter to a #FsCodec
2275
+ * @param name The name of the optional parameter
2276
+ * @param value The extra_params of the optional parameter
2277
+ */
2278
+ add_optional_parameter(name: string | null, value: string | null): void
2279
+ /**
2280
+ * Compare two codecs, it will declare two codecs to be identical even
2281
+ * if their optional parameters are in a different order. %NULL encoding names
2282
+ * are ignored.
2283
+ * @param codec2 Second codec
2284
+ * @returns %TRUE of the codecs are identical, %FALSE otherwise
2285
+ */
2286
+ are_equal(codec2: Codec): boolean
2287
+ /**
2288
+ * Copies a #FsCodec structure.
2289
+ * @returns a copy of the codec
2290
+ */
2291
+ copy(): Codec
2292
+ /**
2293
+ * Finds the #FsFeedbackParameter in the #FsCodec that has the requested
2294
+ * subtype, type and extra_params. One of which must be non-NULL;
2295
+ * @param type The subtype of the parameter to search for or %NULL for any type
2296
+ * @param subtype The subtype of the parameter to search for or %NULL for any subtype
2297
+ * @param extra_params The extra_params of the parameter to search for or %NULL for any extra_params
2298
+ * @returns the #FsFeedbackParameter from the #FsCodec or %NULL
2299
+ */
2300
+ get_feedback_parameter(type: string | null, subtype: string | null, extra_params: string | null): FeedbackParameter
2301
+ /**
2302
+ * Finds the #FsCodecParameter in the #FsCodec that has the requested name
2303
+ * and, if not %NULL, the requested value
2304
+ * @param name The name of the parameter to search for
2305
+ * @param value The value of the parameter to search for or %NULL for any value
2306
+ * @returns the #FsCodecParameter from the #FsCodec or %NULL
2307
+ */
2308
+ get_optional_parameter(name: string | null, value: string | null): CodecParameter
2309
+ /**
2310
+ * Removes an optional parameter from a codec.
2311
+ *
2312
+ * NULL param will do nothing.
2313
+ * @param item a pointer to the #GList element to remove that contains a #FsFeedbackParameter
2314
+ */
2315
+ remove_feedback_parameter(item: FeedbackParameter[]): void
2316
+ /**
2317
+ * Removes an optional parameter from a codec.
2318
+ *
2319
+ * NULL param will do nothing.
2320
+ * @param param a pointer to the #FsCodecParameter to remove
2321
+ */
2322
+ remove_optional_parameter(param: CodecParameter): void
2323
+ /**
2324
+ * Returns a newly-allocated string representing the codec
2325
+ * @returns the newly-allocated string
2326
+ */
2327
+ to_string(): string | null
2328
+ }
2329
+
2330
+ /**
2331
+ * This structure reprensents one codec that can be offered or received
2332
+ * @record
2333
+ */
2334
+ export class Codec {
2335
+
2336
+ // Own properties of Farstream-0.2.Farstream.Codec
2337
+
2338
+ static name: string
2339
+
2340
+ // Constructors of Farstream-0.2.Farstream.Codec
2341
+
2342
+ /**
2343
+ * Allocates and initializes a #FsCodec structure
2344
+ * @constructor
2345
+ * @param id codec identifier, if RTP this should be based on IETF RTP payload types
2346
+ * @param encoding_name Name of media type this encodes
2347
+ * @param media_type #FsMediaType for type of codec
2348
+ * @param clock_rate The clock rate this codec encodes at, if applicable
2349
+ * @returns A newly allocated #FsCodec
2350
+ */
2351
+ constructor(id: number, encoding_name: string | null, media_type: MediaType, clock_rate: number)
2352
+ /**
2353
+ * Allocates and initializes a #FsCodec structure
2354
+ * @constructor
2355
+ * @param id codec identifier, if RTP this should be based on IETF RTP payload types
2356
+ * @param encoding_name Name of media type this encodes
2357
+ * @param media_type #FsMediaType for type of codec
2358
+ * @param clock_rate The clock rate this codec encodes at, if applicable
2359
+ * @returns A newly allocated #FsCodec
2360
+ */
2361
+ static new(id: number, encoding_name: string | null, media_type: MediaType, clock_rate: number): Codec
2362
+ }
2363
+
2364
+ export interface CodecParameter {
2365
+
2366
+ // Own fields of Farstream-0.2.Farstream.CodecParameter
2367
+
2368
+ /**
2369
+ * paramter name.
2370
+ * @field
2371
+ */
2372
+ name: string | null
2373
+ /**
2374
+ * parameter value.
2375
+ * @field
2376
+ */
2377
+ value: string | null
2378
+
2379
+ // Owm methods of Farstream-0.2.Farstream.CodecParameter
2380
+
2381
+ /**
2382
+ * Makes a copy of a #FsCodecParameter
2383
+ * @returns a newly allocated #FsCodecParameter
2384
+ */
2385
+ copy(): CodecParameter
2386
+ /**
2387
+ * Frees a #FsCodecParameter
2388
+ */
2389
+ free(): void
2390
+ }
2391
+
2392
+ /**
2393
+ * Used to store arbitary parameters for a codec
2394
+ * @record
2395
+ */
2396
+ export class CodecParameter {
2397
+
2398
+ // Own properties of Farstream-0.2.Farstream.CodecParameter
2399
+
2400
+ static name: string
2401
+ }
2402
+
2403
+ export interface ConferenceClass {
2404
+
2405
+ // Own fields of Farstream-0.2.Farstream.ConferenceClass
2406
+
2407
+ /**
2408
+ * parent GstBin class
2409
+ * @field
2410
+ */
2411
+ parent: Gst.BinClass
2412
+ new_session: (conference: Conference, media_type: MediaType) => Session
2413
+ new_participant: (conference: Conference) => Participant
2414
+ }
2415
+
2416
+ /**
2417
+ * #FsConferenceClass class structure.
2418
+ * @record
2419
+ */
2420
+ export abstract class ConferenceClass {
2421
+
2422
+ // Own properties of Farstream-0.2.Farstream.ConferenceClass
2423
+
2424
+ static name: string
2425
+ }
2426
+
2427
+ export interface ElementAddedNotifierClass {
2428
+
2429
+ // Own fields of Farstream-0.2.Farstream.ElementAddedNotifierClass
2430
+
2431
+ /**
2432
+ * the #GObjectClass parent
2433
+ * @field
2434
+ */
2435
+ parent_class: GObject.ObjectClass
2436
+ }
2437
+
2438
+ /**
2439
+ * All members are private
2440
+ * @record
2441
+ */
2442
+ export abstract class ElementAddedNotifierClass {
2443
+
2444
+ // Own properties of Farstream-0.2.Farstream.ElementAddedNotifierClass
2445
+
2446
+ static name: string
2447
+ }
2448
+
2449
+ export interface ElementAddedNotifierPrivate {
2450
+ }
2451
+
2452
+ export class ElementAddedNotifierPrivate {
2453
+
2454
+ // Own properties of Farstream-0.2.Farstream.ElementAddedNotifierPrivate
2455
+
2456
+ static name: string
2457
+ }
2458
+
2459
+ export interface FeedbackParameter {
2460
+
2461
+ // Own fields of Farstream-0.2.Farstream.FeedbackParameter
2462
+
2463
+ /**
2464
+ * the type of feedback, like "ack", "name", "ccm"
2465
+ * @field
2466
+ */
2467
+ type: string | null
2468
+ /**
2469
+ * the subtype of feedback (can be an empty string)
2470
+ * @field
2471
+ */
2472
+ subtype: string | null
2473
+ /**
2474
+ * a string containing extra parameters (can be empty)
2475
+ * @field
2476
+ */
2477
+ extra_params: string | null
2478
+
2479
+ // Owm methods of Farstream-0.2.Farstream.FeedbackParameter
2480
+
2481
+ /**
2482
+ * Makes a copy of a #FsFeedbackParameter
2483
+ * @returns a newly allocated #FsFeedbackParameter
2484
+ */
2485
+ copy(): FeedbackParameter
2486
+ /**
2487
+ * Frees a #FsFeedbackParameter
2488
+ */
2489
+ free(): void
2490
+ }
2491
+
2492
+ /**
2493
+ * Use to store feedback parameters
2494
+ * @record
2495
+ */
2496
+ export class FeedbackParameter {
2497
+
2498
+ // Own properties of Farstream-0.2.Farstream.FeedbackParameter
2499
+
2500
+ static name: string
2501
+ }
2502
+
2503
+ export interface ParticipantClass {
2504
+
2505
+ // Own fields of Farstream-0.2.Farstream.ParticipantClass
2506
+
2507
+ /**
2508
+ * Our parent
2509
+ * @field
2510
+ */
2511
+ parent_class: GObject.ObjectClass
2512
+ }
2513
+
2514
+ /**
2515
+ * The FsParticipant class has no virtual methods to implement,
2516
+ * but you may want to override the properties or attach more date to it
2517
+ * @record
2518
+ */
2519
+ export abstract class ParticipantClass {
2520
+
2521
+ // Own properties of Farstream-0.2.Farstream.ParticipantClass
2522
+
2523
+ static name: string
2524
+ }
2525
+
2526
+ export interface ParticipantPrivate {
2527
+ }
2528
+
2529
+ export class ParticipantPrivate {
2530
+
2531
+ // Own properties of Farstream-0.2.Farstream.ParticipantPrivate
2532
+
2533
+ static name: string
2534
+ }
2535
+
2536
+ export interface PluginClass {
2537
+
2538
+ // Own fields of Farstream-0.2.Farstream.PluginClass
2539
+
2540
+ parent_class: GObject.TypeModuleClass
2541
+ }
2542
+
2543
+ export abstract class PluginClass {
2544
+
2545
+ // Own properties of Farstream-0.2.Farstream.PluginClass
2546
+
2547
+ static name: string
2548
+ }
2549
+
2550
+ export interface PluginPrivate {
2551
+ }
2552
+
2553
+ export class PluginPrivate {
2554
+
2555
+ // Own properties of Farstream-0.2.Farstream.PluginPrivate
2556
+
2557
+ static name: string
2558
+ }
2559
+
2560
+ export interface RtpHeaderExtension {
2561
+
2562
+ // Own fields of Farstream-0.2.Farstream.RtpHeaderExtension
2563
+
2564
+ /**
2565
+ * The identifier of the RTP header extension
2566
+ * @field
2567
+ */
2568
+ id: number
2569
+ /**
2570
+ * the direction in which this extension can be used
2571
+ * @field
2572
+ */
2573
+ direction: StreamDirection
2574
+ /**
2575
+ * The URI that defines this extension
2576
+ * @field
2577
+ */
2578
+ uri: string | null
2579
+
2580
+ // Owm methods of Farstream-0.2.Farstream.RtpHeaderExtension
2581
+
2582
+ /**
2583
+ * Compares two #FsRtpHeaderExtension structures
2584
+ * @param extension2 The second #FsRtpHeaderExtension
2585
+ * @returns %TRUE if they are identical, %FALSE otherwise
2586
+ */
2587
+ are_equal(extension2: RtpHeaderExtension): boolean
2588
+ }
2589
+
2590
+ /**
2591
+ * Defines a RTP header extension with its negotiated identifier, direction
2592
+ * and URI. They should only be created with fs_rtp_header_extension_new().
2593
+ * @record
2594
+ */
2595
+ export class RtpHeaderExtension {
2596
+
2597
+ // Own properties of Farstream-0.2.Farstream.RtpHeaderExtension
2598
+
2599
+ static name: string
2600
+
2601
+ // Constructors of Farstream-0.2.Farstream.RtpHeaderExtension
2602
+
2603
+ /**
2604
+ * Creates a new #FsRtpHeaderExtension
2605
+ * @constructor
2606
+ * @param id The identifier of the RTP header extension
2607
+ * @param direction the direction in which this extension can be used
2608
+ * @param uri The URI that defines this extension
2609
+ * @returns a new #FsRtpHeaderExtension
2610
+ */
2611
+ constructor(id: number, direction: StreamDirection, uri: string | null)
2612
+ /**
2613
+ * Creates a new #FsRtpHeaderExtension
2614
+ * @constructor
2615
+ * @param id The identifier of the RTP header extension
2616
+ * @param direction the direction in which this extension can be used
2617
+ * @param uri The URI that defines this extension
2618
+ * @returns a new #FsRtpHeaderExtension
2619
+ */
2620
+ static new(id: number, direction: StreamDirection, uri: string | null): RtpHeaderExtension
2621
+ }
2622
+
2623
+ export interface SessionClass {
2624
+
2625
+ // Own fields of Farstream-0.2.Farstream.SessionClass
2626
+
2627
+ /**
2628
+ * Our parent
2629
+ * @field
2630
+ */
2631
+ parent_class: GObject.ObjectClass
2632
+ new_stream: (session: Session, participant: Participant, direction: StreamDirection) => Stream
2633
+ start_telephony_event: (session: Session, event: number, volume: number) => boolean
2634
+ stop_telephony_event: (session: Session) => boolean
2635
+ set_send_codec: (session: Session, send_codec: Codec) => boolean
2636
+ set_codec_preferences: (session: Session, codec_preferences: Codec[] | null) => boolean
2637
+ list_transmitters: (session: Session) => string[]
2638
+ get_stream_transmitter_type: (session: Session, transmitter: string | null) => GObject.GType
2639
+ codecs_need_resend: (session: Session, old_codecs: Codec[] | null, new_codecs: Codec[] | null) => Codec[]
2640
+ set_allowed_caps: (session: Session, sink_caps: Gst.Caps | null, src_caps: Gst.Caps | null) => boolean
2641
+ set_encryption_parameters: (session: Session, parameters: Gst.Structure | null) => boolean
2642
+ }
2643
+
2644
+ /**
2645
+ * You must override at least new_stream in a subclass.
2646
+ * @record
2647
+ */
2648
+ export abstract class SessionClass {
2649
+
2650
+ // Own properties of Farstream-0.2.Farstream.SessionClass
2651
+
2652
+ static name: string
2653
+ }
2654
+
2655
+ export interface SessionPrivate {
2656
+ }
2657
+
2658
+ export class SessionPrivate {
2659
+
2660
+ // Own properties of Farstream-0.2.Farstream.SessionPrivate
2661
+
2662
+ static name: string
2663
+ }
2664
+
2665
+ export interface StreamClass {
2666
+
2667
+ // Own fields of Farstream-0.2.Farstream.StreamClass
2668
+
2669
+ /**
2670
+ * Our parent
2671
+ * @field
2672
+ */
2673
+ parent_class: GObject.ObjectClass
2674
+ add_remote_candidates: (stream: Stream, candidates: Candidate[]) => boolean
2675
+ force_remote_candidates: (stream: Stream, remote_candidates: Candidate[]) => boolean
2676
+ set_remote_codecs: (stream: Stream, remote_codecs: Codec[]) => boolean
2677
+ add_id: (stream: Stream, id: number) => void
2678
+ set_transmitter: (stream: Stream, transmitter: string | null, stream_transmitter_parameters: GObject.Parameter[] | null) => boolean
2679
+ set_decryption_parameters: (stream: Stream, parameters: Gst.Structure) => boolean
2680
+ }
2681
+
2682
+ /**
2683
+ * You must override add_remote_candidate in a subclass.
2684
+ * If you have to negotiate codecs, then you must override set_remote_codecs too
2685
+ * @record
2686
+ */
2687
+ export abstract class StreamClass {
2688
+
2689
+ // Own properties of Farstream-0.2.Farstream.StreamClass
2690
+
2691
+ static name: string
2692
+ }
2693
+
2694
+ export interface StreamPrivate {
2695
+ }
2696
+
2697
+ export class StreamPrivate {
2698
+
2699
+ // Own properties of Farstream-0.2.Farstream.StreamPrivate
2700
+
2701
+ static name: string
2702
+ }
2703
+
2704
+ export interface StreamTransmitterClass {
2705
+
2706
+ // Own fields of Farstream-0.2.Farstream.StreamTransmitterClass
2707
+
2708
+ /**
2709
+ * Our parent
2710
+ * @field
2711
+ */
2712
+ parent_class: GObject.ObjectClass
2713
+ add_remote_candidates: (streamtransmitter: StreamTransmitter, candidates: Candidate[]) => boolean
2714
+ force_remote_candidates: (streamtransmitter: StreamTransmitter, remote_candidates: Candidate[]) => boolean
2715
+ gather_local_candidates: (streamtransmitter: StreamTransmitter) => boolean
2716
+ stop: (streamtransmitter: StreamTransmitter) => void
2717
+ }
2718
+
2719
+ /**
2720
+ * You must override the add_remote_candidate in a subclass
2721
+ * @record
2722
+ */
2723
+ export abstract class StreamTransmitterClass {
2724
+
2725
+ // Own properties of Farstream-0.2.Farstream.StreamTransmitterClass
2726
+
2727
+ static name: string
2728
+ }
2729
+
2730
+ export interface StreamTransmitterPrivate {
2731
+ }
2732
+
2733
+ export class StreamTransmitterPrivate {
2734
+
2735
+ // Own properties of Farstream-0.2.Farstream.StreamTransmitterPrivate
2736
+
2737
+ static name: string
2738
+ }
2739
+
2740
+ export interface TransmitterClass {
2741
+
2742
+ // Own fields of Farstream-0.2.Farstream.TransmitterClass
2743
+
2744
+ /**
2745
+ * Our parent
2746
+ * @field
2747
+ */
2748
+ parent_class: GObject.ObjectClass
2749
+ new_stream_transmitter: (transmitter: Transmitter, participant: Participant, n_parameters: number, parameters: GObject.Parameter) => StreamTransmitter
2750
+ get_stream_transmitter_type: (transmitter: Transmitter) => GObject.GType
2751
+ }
2752
+
2753
+ /**
2754
+ * You must override both methods in a subclass.
2755
+ * @record
2756
+ */
2757
+ export abstract class TransmitterClass {
2758
+
2759
+ // Own properties of Farstream-0.2.Farstream.TransmitterClass
2760
+
2761
+ static name: string
2762
+ }
2763
+
2764
+ export interface TransmitterPrivate {
2765
+ }
2766
+
2767
+ export class TransmitterPrivate {
2768
+
2769
+ // Own properties of Farstream-0.2.Farstream.TransmitterPrivate
2770
+
2771
+ static name: string
2772
+ }
2773
+
2774
+ /**
2775
+ * Name of the imported GIR library
2776
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
2777
+ */
2778
+ export const __name__: string
2779
+ /**
2780
+ * Version of the imported GIR library
2781
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
2782
+ */
2783
+ export const __version__: string
2784
+ // END