6#include "private/qcameradevice_p.h"
18 GstDevice *
device =
nullptr;
20 switch (GST_MESSAGE_TYPE (
message)) {
21 case GST_MESSAGE_DEVICE_ADDED:
25 case GST_MESSAGE_DEVICE_REMOVED:
35 return G_SOURCE_CONTINUE;
41 GstDeviceMonitor *monitor;
44 monitor = gst_device_monitor_new();
46 gst_device_monitor_add_filter (monitor,
nullptr,
nullptr);
48 bus = gst_device_monitor_get_bus(monitor);
50 gst_object_unref(bus);
52 gst_device_monitor_start(monitor);
54 auto devices = gst_device_monitor_get_devices(monitor);
68 for (
auto device : m_videoSources) {
70 auto *
desc = gst_device_get_display_name(
device.gstDevice);
77 info->isDefault = def && *def;
92 for (
int i = 0;
i <
size; ++
i) {
93 auto cap = caps.at(
i);
99 auto pixelFormat =
cap.pixelFormat();
110 photoResolutions.
insert(resolution);
114 info->photoResolutions = photoResolutions.
values();
122 if (gst_device_has_classes(
device,
"Video/Source")) {
132 auto it = std::find_if(m_videoSources.begin(), m_videoSources.end(),
133 [=](
const QGstDevice &
a) { return a.gstDevice == device; });
135 if (
it != m_videoSources.end()) {
136 m_videoSources.erase(
it);
145 auto it = std::find_if(m_videoSources.begin(), m_videoSources.end(),
146 [=](
const QGstDevice &
a) { return a.id == id; });
147 return it != m_videoSources.end() ?
it->gstDevice :
nullptr;
IOBluetoothDevice * device
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void removeDevice(GstDevice *)
GstDevice * videoDevice(const QByteArray &id) const
QList< QCameraDevice > videoDevices() const override
void addDevice(GstDevice *)
QGstreamerVideoDevices(QPlatformMediaIntegration *integration)
QList< T > values() const
iterator insert(const T &value)
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
static QT_BEGIN_NAMESPACE gboolean deviceMonitor(GstBus *, GstMessage *message, gpointer m)
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
QFileInfo info(fileName)
[8]
QNetworkAccessManager manager