This file is indexed.

/usr/include/d/gtkd-3/gstreamer/ElementFactory.d is in libgstreamerd-3-dev 3.7.5-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module gstreamer.ElementFactory;

private import glib.ListG;
private import glib.Str;
private import gobject.ObjectG;
private import gstreamer.Caps;
private import gstreamer.Element;
private import gstreamer.PluginFeature;
private import gstreamer.c.functions;
public  import gstreamer.c.types;
public  import gstreamerc.gstreamertypes;


/**
 * #GstElementFactory is used to create instances of elements. A
 * GstElementFactory can be added to a #GstPlugin as it is also a
 * #GstPluginFeature.
 * 
 * Use the gst_element_factory_find() and gst_element_factory_create()
 * functions to create element instances or use gst_element_factory_make() as a
 * convenient shortcut.
 * 
 * The following code example shows you how to create a GstFileSrc element.
 * 
 * ## Using an element factory
 * |[<!-- language="C" -->
 * #include &lt;gst/gst.h&gt;
 * 
 * GstElement *src;
 * GstElementFactory *srcfactory;
 * 
 * gst_init (&amp;argc, &amp;argv);
 * 
 * srcfactory = gst_element_factory_find ("filesrc");
 * g_return_if_fail (srcfactory != NULL);
 * src = gst_element_factory_create (srcfactory, "src");
 * g_return_if_fail (src != NULL);
 * ...
 * ]|
 */
public class ElementFactory : PluginFeature
{
	/** the main Gtk struct */
	protected GstElementFactory* gstElementFactory;

	/** Get the main Gtk struct */
	public GstElementFactory* getElementFactoryStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return gstElementFactory;
	}

	/** the main Gtk struct as a void* */
	protected override void* getStruct()
	{
		return cast(void*)gstElementFactory;
	}

	protected override void setStruct(GObject* obj)
	{
		gstElementFactory = cast(GstElementFactory*)obj;
		super.setStruct(obj);
	}

	/**
	 * Sets our main struct and passes it to the parent class.
	 */
	public this (GstElementFactory* gstElementFactory, bool ownedRef = false)
	{
		this.gstElementFactory = gstElementFactory;
		super(cast(GstPluginFeature*)gstElementFactory, ownedRef);
	}

	/**
	 * Create a new element of the type defined by the given element factory.
	 * The element will receive a guaranteed unique name,
	 * consisting of the element factory name and a number.
	 * Params:
	 *  factoryname = a named factory to instantiate
	 * Returns:
	 *  new GstElement or NULL if unable to create element
	 */
	public static Element make( string factoryname )
	{
		// GstElement* gst_element_factory_make (const gchar *factoryname,  const gchar *name);
		auto p = gst_element_factory_make(Str.toStringz(factoryname), null );

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(Element)(cast(GstElement*) p);
	}

	/**
	 */

	/** */
	public static GType getType()
	{
		return gst_element_factory_get_type();
	}

	/**
	 * Search for an element factory of the given name. Refs the returned
	 * element factory; caller is responsible for unreffing.
	 *
	 * Params:
	 *     name = name of factory to find
	 *
	 * Returns: #GstElementFactory if found,
	 *     %NULL otherwise
	 */
	public static ElementFactory find(string name)
	{
		auto p = gst_element_factory_find(Str.toStringz(name));

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(ElementFactory)(cast(GstElementFactory*) p, true);
	}

	/**
	 * Filter out all the elementfactories in @list that can handle @caps in
	 * the given direction.
	 *
	 * If @subsetonly is %TRUE, then only the elements whose pads templates
	 * are a complete superset of @caps will be returned. Else any element
	 * whose pad templates caps can intersect with @caps will be returned.
	 *
	 * Params:
	 *     list = a #GList of
	 *         #GstElementFactory to filter
	 *     caps = a #GstCaps
	 *     direction = a #GstPadDirection to filter on
	 *     subsetonly = whether to filter on caps subsets or not.
	 *
	 * Returns: a #GList of
	 *     #GstElementFactory elements that match the given requisites.
	 *     Use #gst_plugin_feature_list_free after usage.
	 */
	public static ListG listFilter(ListG list, Caps caps, GstPadDirection direction, bool subsetonly)
	{
		auto p = gst_element_factory_list_filter((list is null) ? null : list.getListGStruct(), (caps is null) ? null : caps.getCapsStruct(), direction, subsetonly);

		if(p is null)
		{
			return null;
		}

		return new ListG(cast(GList*) p, true);
	}

	/**
	 * Get a list of factories that match the given @type. Only elements
	 * with a rank greater or equal to @minrank will be returned.
	 * The list of factories is returned by decreasing rank.
	 *
	 * Params:
	 *     type = a #GstElementFactoryListType
	 *     minrank = Minimum rank
	 *
	 * Returns: a #GList of
	 *     #GstElementFactory elements. Use gst_plugin_feature_list_free() after
	 *     usage.
	 */
	public static ListG listGetElements(GstElementFactoryListType type, GstRank minrank)
	{
		auto p = gst_element_factory_list_get_elements(type, minrank);

		if(p is null)
		{
			return null;
		}

		return new ListG(cast(GList*) p, true);
	}

	/**
	 * Create a new element of the type defined by the given element factory.
	 * If name is %NULL, then the element will receive a guaranteed unique name,
	 * consisting of the element factory name and a number.
	 * If name is given, it will be given the name supplied.
	 *
	 * Params:
	 *     factoryname = a named factory to instantiate
	 *     name = name of new element, or %NULL to automatically create
	 *         a unique name
	 *
	 * Returns: new #GstElement or %NULL
	 *     if unable to create element
	 */
	public static Element make(string factoryname, string name)
	{
		auto p = gst_element_factory_make(Str.toStringz(factoryname), Str.toStringz(name));

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(Element)(cast(GstElement*) p);
	}

	/**
	 * Checks if the factory can sink all possible capabilities.
	 *
	 * Params:
	 *     caps = the caps to check
	 *
	 * Returns: %TRUE if the caps are fully compatible.
	 */
	public bool canSinkAllCaps(Caps caps)
	{
		return gst_element_factory_can_sink_all_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct()) != 0;
	}

	/**
	 * Checks if the factory can sink any possible capability.
	 *
	 * Params:
	 *     caps = the caps to check
	 *
	 * Returns: %TRUE if the caps have a common subset.
	 */
	public bool canSinkAnyCaps(Caps caps)
	{
		return gst_element_factory_can_sink_any_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct()) != 0;
	}

	/**
	 * Checks if the factory can src all possible capabilities.
	 *
	 * Params:
	 *     caps = the caps to check
	 *
	 * Returns: %TRUE if the caps are fully compatible.
	 */
	public bool canSrcAllCaps(Caps caps)
	{
		return gst_element_factory_can_src_all_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct()) != 0;
	}

	/**
	 * Checks if the factory can src any possible capability.
	 *
	 * Params:
	 *     caps = the caps to check
	 *
	 * Returns: %TRUE if the caps have a common subset.
	 */
	public bool canSrcAnyCaps(Caps caps)
	{
		return gst_element_factory_can_src_any_caps(gstElementFactory, (caps is null) ? null : caps.getCapsStruct()) != 0;
	}

	/**
	 * Create a new element of the type defined by the given elementfactory.
	 * It will be given the name supplied, since all elements require a name as
	 * their first argument.
	 *
	 * Params:
	 *     name = name of new element, or %NULL to automatically create
	 *         a unique name
	 *
	 * Returns: new #GstElement or %NULL
	 *     if the element couldn't be created
	 */
	public Element create(string name)
	{
		auto p = gst_element_factory_create(gstElementFactory, Str.toStringz(name));

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(Element)(cast(GstElement*) p);
	}

	/**
	 * Get the #GType for elements managed by this factory. The type can
	 * only be retrieved if the element factory is loaded, which can be
	 * assured with gst_plugin_feature_load().
	 *
	 * Returns: the #GType for elements managed by this factory or 0 if
	 *     the factory is not loaded.
	 */
	public GType getElementType()
	{
		return gst_element_factory_get_element_type(gstElementFactory);
	}

	/**
	 * Get the metadata on @factory with @key.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: the metadata with @key on @factory or %NULL
	 *     when there was no metadata with the given @key.
	 */
	public string getMetadata(string key)
	{
		return Str.toString(gst_element_factory_get_metadata(gstElementFactory, Str.toStringz(key)));
	}

	/**
	 * Get the available keys for the metadata on @factory.
	 *
	 * Returns: a %NULL-terminated array of key strings, or %NULL when there is no
	 *     metadata. Free with g_strfreev() when no longer needed.
	 */
	public string[] getMetadataKeys()
	{
		auto retStr = gst_element_factory_get_metadata_keys(gstElementFactory);

		scope(exit) Str.freeStringArray(retStr);
		return Str.toStringArray(retStr);
	}

	/**
	 * Gets the number of pad_templates in this factory.
	 *
	 * Returns: the number of pad_templates
	 */
	public uint getNumPadTemplates()
	{
		return gst_element_factory_get_num_pad_templates(gstElementFactory);
	}

	/**
	 * Gets the #GList of #GstStaticPadTemplate for this factory.
	 *
	 * Returns: the
	 *     static pad templates
	 */
	public ListG getStaticPadTemplates()
	{
		auto p = gst_element_factory_get_static_pad_templates(gstElementFactory);

		if(p is null)
		{
			return null;
		}

		return new ListG(cast(GList*) p);
	}

	/**
	 * Gets a %NULL-terminated array of protocols this element supports or %NULL if
	 * no protocols are supported. You may not change the contents of the returned
	 * array, as it is still owned by the element factory. Use g_strdupv() to
	 * make a copy of the protocol string array if you need to.
	 *
	 * Returns: the supported protocols
	 *     or %NULL
	 */
	public string[] getUriProtocols()
	{
		return Str.toStringArray(gst_element_factory_get_uri_protocols(gstElementFactory));
	}

	/**
	 * Gets the type of URIs the element supports or #GST_URI_UNKNOWN if none.
	 *
	 * Returns: type of URIs this element supports
	 */
	public GstURIType getUriType()
	{
		return gst_element_factory_get_uri_type(gstElementFactory);
	}

	/**
	 * Check if @factory implements the interface with name @interfacename.
	 *
	 * Params:
	 *     interfacename = an interface name
	 *
	 * Returns: %TRUE when @factory implement the interface.
	 */
	public bool hasInterface(string interfacename)
	{
		return gst_element_factory_has_interface(gstElementFactory, Str.toStringz(interfacename)) != 0;
	}

	/**
	 * Check if @factory is of the given types.
	 *
	 * Params:
	 *     type = a #GstElementFactoryListType
	 *
	 * Returns: %TRUE if @factory is of @type.
	 */
	public bool listIsType(GstElementFactoryListType type)
	{
		return gst_element_factory_list_is_type(gstElementFactory, type) != 0;
	}
}