This file is indexed.

/usr/include/d/gtkd-3/gstreamer/Device.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
/*
 * 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.Device;

private import glib.Str;
private import gobject.ObjectG;
private import gobject.Signals;
private import gstreamer.Caps;
private import gstreamer.Element;
private import gstreamer.ObjectGst;
private import gstreamer.Structure;
private import gstreamer.c.functions;
public  import gstreamer.c.types;
public  import gstreamerc.gstreamertypes;
private import std.algorithm;


/**
 * #GstDevice are objects representing a device, they contain
 * relevant metadata about the device, such as its class and the #GstCaps
 * representing the media types it can produce or handle.
 * 
 * #GstDevice are created by #GstDeviceProvider objects which can be
 * aggregated by #GstDeviceMonitor objects.
 *
 * Since: 1.4
 */
public class Device : ObjectGst
{
	/** the main Gtk struct */
	protected GstDevice* gstDevice;

	/** Get the main Gtk struct */
	public GstDevice* getDeviceStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return gstDevice;
	}

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

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

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


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

	/**
	 * Creates the element with all of the required parameters set to use
	 * this device.
	 *
	 * Params:
	 *     name = name of new element, or %NULL to automatically
	 *         create a unique name.
	 *
	 * Returns: a new #GstElement configured to use this device
	 *
	 * Since: 1.4
	 */
	public Element createElement(string name)
	{
		auto p = gst_device_create_element(gstDevice, Str.toStringz(name));

		if(p is null)
		{
			return null;
		}

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

	/**
	 * Getter for the #GstCaps that this device supports.
	 *
	 * Returns: The #GstCaps supported by this device. Unref with
	 *     gst_caps_unref() when done.
	 *
	 * Since: 1.4
	 */
	public Caps getCaps()
	{
		auto p = gst_device_get_caps(gstDevice);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(Caps)(cast(GstCaps*) p, true);
	}

	/**
	 * Gets the "class" of a device. This is a "/" separated list of
	 * classes that represent this device. They are a subset of the
	 * classes of the #GstDeviceProvider that produced this device.
	 *
	 * Returns: The device class. Free with g_free() after use.
	 *
	 * Since: 1.4
	 */
	public string getDeviceClass()
	{
		auto retStr = gst_device_get_device_class(gstDevice);

		scope(exit) Str.freeString(retStr);
		return Str.toString(retStr);
	}

	/**
	 * Gets the user-friendly name of the device.
	 *
	 * Returns: The device name. Free with g_free() after use.
	 *
	 * Since: 1.4
	 */
	public string getDisplayName()
	{
		auto retStr = gst_device_get_display_name(gstDevice);

		scope(exit) Str.freeString(retStr);
		return Str.toString(retStr);
	}

	/**
	 * Gets the extra properties of a device.
	 *
	 * Returns: The extra properties or %NULL when there are none.
	 *     Free with gst_structure_free() after use.
	 *
	 * Since: 1.6
	 */
	public Structure getProperties()
	{
		auto p = gst_device_get_properties(gstDevice);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p, true);
	}

	/**
	 * Check if @device matches all of the given classes
	 *
	 * Params:
	 *     classes = a "/"-separated list of device classes to match, only match if
	 *         all classes are matched
	 *
	 * Returns: %TRUE if @device matches.
	 *
	 * Since: 1.4
	 */
	public bool hasClasses(string classes)
	{
		return gst_device_has_classes(gstDevice, Str.toStringz(classes)) != 0;
	}

	/**
	 * Check if @factory matches all of the given classes
	 *
	 * Params:
	 *     classes = a %NULL terminated array of classes
	 *         to match, only match if all classes are matched
	 *
	 * Returns: %TRUE if @device matches.
	 *
	 * Since: 1.4
	 */
	public bool hasClassesv(string[] classes)
	{
		return gst_device_has_classesv(gstDevice, Str.toStringzArray(classes)) != 0;
	}

	/**
	 * Tries to reconfigure an existing element to use the device. If this
	 * function fails, then one must destroy the element and create a new one
	 * using gst_device_create_element().
	 *
	 * Note: This should only be implemented for elements can change their
	 * device in the PLAYING state.
	 *
	 * Params:
	 *     element = a #GstElement
	 *
	 * Returns: %TRUE if the element could be reconfigured to use this device,
	 *     %FALSE otherwise.
	 *
	 * Since: 1.4
	 */
	public bool reconfigureElement(Element element)
	{
		return gst_device_reconfigure_element(gstDevice, (element is null) ? null : element.getElementStruct()) != 0;
	}

	protected class OnRemovedDelegateWrapper
	{
		void delegate(Device) dlg;
		gulong handlerId;

		this(void delegate(Device) dlg)
		{
			this.dlg = dlg;
			onRemovedListeners ~= this;
		}

		void remove(OnRemovedDelegateWrapper source)
		{
			foreach(index, wrapper; onRemovedListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onRemovedListeners[index] = null;
					onRemovedListeners = std.algorithm.remove(onRemovedListeners, index);
					break;
				}
			}
		}
	}
	OnRemovedDelegateWrapper[] onRemovedListeners;

	/** */
	gulong addOnRemoved(void delegate(Device) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnRemovedDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"removed",
			cast(GCallback)&callBackRemoved,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackRemovedDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static void callBackRemoved(GstDevice* deviceStruct, OnRemovedDelegateWrapper wrapper)
	{
		wrapper.dlg(wrapper.outer);
	}

	extern(C) static void callBackRemovedDestroy(OnRemovedDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}
}