audioRecorder->record();
//! [Audio recorder]
- //! [Audio recorder endpoints]
+ //! [Audio recorder inputs]
QStringList inputs = audioRecorder->audioInputs();
QString selectedInput = audioRecorder->defaultAudioInput();
}
audioRecorder->setAudioInput(selectedInput);
- //! [Audio recorder endpoints]
+ //! [Audio recorder inputs]
}
void MediaExample::RadioTuna()
qgstvideobuffer_p.h \
qvideosurfacegstsink_p.h \
qgstreamervideorendererinterface_p.h \
- qgstreameraudioinputendpointselector_p.h \
+ qgstreameraudioinputselector_p.h \
qgstreamervideorenderer_p.h \
qgstreamervideoinputdevicecontrol_p.h \
gstvideoconnector_p.h \
qgstvideobuffer.cpp \
qvideosurfacegstsink.cpp \
qgstreamervideorendererinterface.cpp \
- qgstreameraudioinputendpointselector.cpp \
+ qgstreameraudioinputselector.cpp \
qgstreamervideorenderer.cpp \
qgstreamervideoinputdevicecontrol.cpp \
qgstcodecsinfo.cpp \
**
****************************************************************************/
-#include "qgstreameraudioinputendpointselector_p.h"
+#include "qgstreameraudioinputselector_p.h"
#include <QtCore/QDir>
#include <QtCore/QDebug>
#include <alsa/asoundlib.h>
#endif
-QGstreamerAudioInputEndpointSelector::QGstreamerAudioInputEndpointSelector(QObject *parent)
- :QAudioEndpointSelectorControl(parent)
+QGstreamerAudioInputSelector::QGstreamerAudioInputSelector(QObject *parent)
+ :QAudioInputSelectorControl(parent)
{
update();
}
-QGstreamerAudioInputEndpointSelector::~QGstreamerAudioInputEndpointSelector()
+QGstreamerAudioInputSelector::~QGstreamerAudioInputSelector()
{
}
-QList<QString> QGstreamerAudioInputEndpointSelector::availableEndpoints() const
+QList<QString> QGstreamerAudioInputSelector::availableInputs() const
{
return m_names;
}
-QString QGstreamerAudioInputEndpointSelector::endpointDescription(const QString& name) const
+QString QGstreamerAudioInputSelector::inputDescription(const QString& name) const
{
QString desc;
return desc;
}
-QString QGstreamerAudioInputEndpointSelector::defaultEndpoint() const
+QString QGstreamerAudioInputSelector::defaultInput() const
{
if (m_names.size() > 0)
return m_names.at(0);
return QString();
}
-QString QGstreamerAudioInputEndpointSelector::activeEndpoint() const
+QString QGstreamerAudioInputSelector::activeInput() const
{
return m_audioInput;
}
-void QGstreamerAudioInputEndpointSelector::setActiveEndpoint(const QString& name)
+void QGstreamerAudioInputSelector::setActiveInput(const QString& name)
{
if (m_audioInput.compare(name) != 0) {
m_audioInput = name;
- emit activeEndpointChanged(name);
+ emit activeInputChanged(name);
}
}
-void QGstreamerAudioInputEndpointSelector::update()
+void QGstreamerAudioInputSelector::update()
{
m_names.clear();
m_descriptions.clear();
m_audioInput = m_names.at(0);
}
-void QGstreamerAudioInputEndpointSelector::updateAlsaDevices()
+void QGstreamerAudioInputSelector::updateAlsaDevices()
{
#ifdef HAVE_ALSA
void **hints, **n;
#endif
}
-void QGstreamerAudioInputEndpointSelector::updateOssDevices()
+void QGstreamerAudioInputSelector::updateOssDevices()
{
QDir devDir("/dev");
devDir.setFilter(QDir::System);
}
}
-void QGstreamerAudioInputEndpointSelector::updatePulseDevices()
+void QGstreamerAudioInputSelector::updatePulseDevices()
{
GstElementFactory *factory = gst_element_factory_find("pulsesrc");
if (factory) {
PUBLIC_HEADERS += \
controls/qaudiodecodercontrol.h \
controls/qaudioencodersettingscontrol.h \
- controls/qaudioendpointselectorcontrol.h \
+ controls/qaudioinputselectorcontrol.h \
+ controls/qaudiooutputselectorcontrol.h \
controls/qcameracapturebufferformatcontrol.h \
controls/qcameracapturedestinationcontrol.h \
controls/qcameracontrol.h \
controls/qaudiodecodercontrol.cpp \
controls/qvideoencodersettingscontrol.cpp \
controls/qaudioencodersettingscontrol.cpp \
- controls/qaudioendpointselectorcontrol.cpp \
+ controls/qaudioinputselectorcontrol.cpp \
+ controls/qaudiooutputselectorcontrol.cpp \
controls/qvideodeviceselectorcontrol.cpp
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qaudioendpointselectorcontrol.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QAudioEndpointSelectorControl
-
- \brief The QAudioEndpointSelectorControl class provides an audio endpoint selector media control.
- \inmodule QtMultimedia
- \ingroup multimedia_control
-
- The QAudioEndpointSelectorControl class provides descriptions of the audio
- endpoints available on a system and allows one to be selected as the audio
- of a media service.
-
- The interface name of QAudioEndpointSelectorControl is \c org.qt-project.qt.audioendpointselectorcontrol/5.0 as
- defined in QAudioEndpointSelectorControl_iid.
-
- \sa QMediaService::requestControl()
-*/
-
-/*!
- \macro QAudioEndpointSelectorControl_iid
-
- \c org.qt-project.qt.audioendpointselectorcontrol/5.0
-
- Defines the interface name of the QAudioEndpointSelectorControl class.
-
- \relates QAudioEndpointSelectorControl
-*/
-
-/*!
- Constructs a new audio endpoint selector control with the given \a parent.
-*/
-QAudioEndpointSelectorControl::QAudioEndpointSelectorControl(QObject *parent)
- :QMediaControl(parent)
-{
-}
-
-/*!
- Destroys an audio endpoint selector control.
-*/
-QAudioEndpointSelectorControl::~QAudioEndpointSelectorControl()
-{
-}
-
-/*!
- \fn QList<QString> QAudioEndpointSelectorControl::availableEndpoints() const
-
- Returns a list of the names of the available audio endpoints.
-*/
-
-/*!
- \fn QString QAudioEndpointSelectorControl::endpointDescription(const QString& name) const
-
- Returns the description of the endpoint \a name.
-*/
-
-/*!
- \fn QString QAudioEndpointSelectorControl::defaultEndpoint() const
-
- Returns the name of the default audio endpoint.
-*/
-
-/*!
- \fn QString QAudioEndpointSelectorControl::activeEndpoint() const
-
- Returns the name of the currently selected audio endpoint.
-*/
-
-/*!
- \fn QAudioEndpointSelectorControl::setActiveEndpoint(const QString& name)
-
- Set the active audio endpoint to \a name.
-*/
-
-/*!
- \fn QAudioEndpointSelectorControl::activeEndpointChanged(const QString& name)
-
- Signals that the audio endpoint has changed to \a name.
-*/
-
-/*!
- \fn QAudioEndpointSelectorControl::availableEndpointsChanged()
-
- Signals that list of available endpoints has changed.
-*/
-
-#include "moc_qaudioendpointselectorcontrol.cpp"
-QT_END_NAMESPACE
-
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qaudioinputselectorcontrol.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QAudioInputSelectorControl
+
+ \brief The QAudioInputSelectorControl class provides an audio input selector media control.
+ \inmodule QtMultimedia
+ \ingroup multimedia_control
+
+ The QAudioInputSelectorControl class provides descriptions of the audio
+ inputs available on a system and allows one to be selected as the audio
+ input of a media service.
+
+ The interface name of QAudioInputSelectorControl is \c org.qt-project.qt.audioinputselectorcontrol/5.0 as
+ defined in QAudioInputSelectorControl_iid.
+
+ \sa QMediaService::requestControl()
+*/
+
+/*!
+ \macro QAudioInputSelectorControl_iid
+
+ \c org.qt-project.qt.audioinputselectorcontrol/5.0
+
+ Defines the interface name of the QAudioInputSelectorControl class.
+
+ \relates QAudioInputSelectorControl
+*/
+
+/*!
+ Constructs a new audio input selector control with the given \a parent.
+*/
+QAudioInputSelectorControl::QAudioInputSelectorControl(QObject *parent)
+ :QMediaControl(parent)
+{
+}
+
+/*!
+ Destroys an audio input selector control.
+*/
+QAudioInputSelectorControl::~QAudioInputSelectorControl()
+{
+}
+
+/*!
+ \fn QList<QString> QAudioInputSelectorControl::availableInputs() const
+
+ Returns a list of the names of the available audio inputs.
+*/
+
+/*!
+ \fn QString QAudioInputSelectorControl::inputDescription(const QString& name) const
+
+ Returns the description of the input \a name.
+*/
+
+/*!
+ \fn QString QAudioInputSelectorControl::defaultInput() const
+
+ Returns the name of the default audio input.
+*/
+
+/*!
+ \fn QString QAudioInputSelectorControl::activeInput() const
+
+ Returns the name of the currently selected audio input.
+*/
+
+/*!
+ \fn QAudioInputSelectorControl::setActiveInput(const QString& name)
+
+ Set the active audio input to \a name.
+*/
+
+/*!
+ \fn QAudioInputSelectorControl::activeInputChanged(const QString& name)
+
+ Signals that the audio input has changed to \a name.
+*/
+
+/*!
+ \fn QAudioInputSelectorControl::availableInputsChanged()
+
+ Signals that list of available inputs has changed.
+*/
+
+#include "moc_qaudioinputselectorcontrol.cpp"
+QT_END_NAMESPACE
+
**
****************************************************************************/
-#ifndef QAUDIOENDPOINTSELECTORCONTROL_H
-#define QAUDIOENDPOINTSELECTORCONTROL_H
+#ifndef QAUDIOINPUTSELECTORCONTROL_H
+#define QAUDIOINPUTSELECTORCONTROL_H
#include <qaudio.h>
#include <qmediacontrol.h>
// Class forward declaration required for QDoc bug
class QString;
-class Q_MULTIMEDIA_EXPORT QAudioEndpointSelectorControl : public QMediaControl
+class Q_MULTIMEDIA_EXPORT QAudioInputSelectorControl : public QMediaControl
{
Q_OBJECT
public:
- virtual ~QAudioEndpointSelectorControl();
+ virtual ~QAudioInputSelectorControl();
- virtual QList<QString> availableEndpoints() const = 0;
- virtual QString endpointDescription(const QString& name) const = 0;
- virtual QString defaultEndpoint() const = 0;
- virtual QString activeEndpoint() const = 0;
+ virtual QList<QString> availableInputs() const = 0;
+ virtual QString inputDescription(const QString& name) const = 0;
+ virtual QString defaultInput() const = 0;
+ virtual QString activeInput() const = 0;
public Q_SLOTS:
- virtual void setActiveEndpoint(const QString& name) = 0;
+ virtual void setActiveInput(const QString& name) = 0;
Q_SIGNALS:
- void activeEndpointChanged(const QString& name);
- void availableEndpointsChanged();
+ void activeInputChanged(const QString& name);
+ void availableInputsChanged();
protected:
- QAudioEndpointSelectorControl(QObject *parent = 0);
+ QAudioInputSelectorControl(QObject *parent = 0);
};
-#define QAudioEndpointSelectorControl_iid "org.qt-project.qt.audioendpointselectorcontrol/5.0"
-Q_MEDIA_DECLARE_CONTROL(QAudioEndpointSelectorControl, QAudioEndpointSelectorControl_iid)
+#define QAudioInputSelectorControl_iid "org.qt-project.qt.audioinputselectorcontrol/5.0"
+Q_MEDIA_DECLARE_CONTROL(QAudioInputSelectorControl, QAudioInputSelectorControl_iid)
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QAUDIOENDPOINTSELECTORCONTROL_H
+#endif // QAUDIOINPUTSELECTORCONTROL_H
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qaudiooutputselectorcontrol.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QAudioOutputSelectorControl
+
+ \brief The QAudioOutputSelectorControl class provides an audio output selector media control.
+ \inmodule QtMultimedia
+ \ingroup multimedia_control
+
+ The QAudioOutputSelectorControl class provides descriptions of the audio
+ outputs available on a system and allows one to be selected as the audio
+ output of a media service.
+
+ The interface name of QAudioOutputSelectorControl is \c org.qt-project.qt.audiooutputselectorcontrol/5.0 as
+ defined in QAudioOutputSelectorControl_iid.
+
+ \sa QMediaService::requestControl()
+*/
+
+/*!
+ \macro QAudioOutputSelectorControl_iid
+
+ \c org.qt-project.qt.audiooutputselectorcontrol/5.0
+
+ Defines the interface name of the QAudioOutputSelectorControl class.
+
+ \relates QAudioOutputSelectorControl
+*/
+
+/*!
+ Constructs a new audio output selector control with the given \a parent.
+*/
+QAudioOutputSelectorControl::QAudioOutputSelectorControl(QObject *parent)
+ :QMediaControl(parent)
+{
+}
+
+/*!
+ Destroys an audio output selector control.
+*/
+QAudioOutputSelectorControl::~QAudioOutputSelectorControl()
+{
+}
+
+/*!
+ \fn QList<QString> QAudioOutputSelectorControl::availableOutputs() const
+
+ Returns a list of the names of the available audio outputs.
+*/
+
+/*!
+ \fn QString QAudioOutputSelectorControl::outputDescription(const QString& name) const
+
+ Returns the description of the output \a name.
+*/
+
+/*!
+ \fn QString QAudioOutputSelectorControl::defaultOutput() const
+
+ Returns the name of the default audio output.
+*/
+
+/*!
+ \fn QString QAudioOutputSelectorControl::activeOutput() const
+
+ Returns the name of the currently selected audio output.
+*/
+
+/*!
+ \fn QAudioOutputSelectorControl::setActiveOutput(const QString& name)
+
+ Set the active audio output to \a name.
+*/
+
+/*!
+ \fn QAudioOutputSelectorControl::activeOutputChanged(const QString& name)
+
+ Signals that the audio output has changed to \a name.
+*/
+
+/*!
+ \fn QAudioOutputSelectorControl::availableOutputsChanged()
+
+ Signals that list of available outputs has changed.
+*/
+
+#include "moc_qaudiooutputselectorcontrol.cpp"
+QT_END_NAMESPACE
+
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QAUDIOOUTPUTSELECTORCONTROL_H
+#define QAUDIOOUTPUTSELECTORCONTROL_H
+
+#include <qaudio.h>
+#include <qmediacontrol.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Multimedia)
+
+
+// Class forward declaration required for QDoc bug
+class QString;
+class Q_MULTIMEDIA_EXPORT QAudioOutputSelectorControl : public QMediaControl
+{
+ Q_OBJECT
+
+public:
+ virtual ~QAudioOutputSelectorControl();
+
+ virtual QList<QString> availableOutputs() const = 0;
+ virtual QString outputDescription(const QString& name) const = 0;
+ virtual QString defaultOutput() const = 0;
+ virtual QString activeOutput() const = 0;
+
+public Q_SLOTS:
+ virtual void setActiveOutput(const QString& name) = 0;
+
+Q_SIGNALS:
+ void activeOutputChanged(const QString& name);
+ void availableOutputsChanged();
+
+protected:
+ QAudioOutputSelectorControl(QObject *parent = 0);
+};
+
+#define QAudioOutputSelectorControl_iid "org.qt-project.qt.audiooutputselectorcontrol/5.0"
+Q_MEDIA_DECLARE_CONTROL(QAudioOutputSelectorControl, QAudioOutputSelectorControl_iid)
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+
+#endif // QAUDIOOUTPUTSELECTORCONTROL_H
**
****************************************************************************/
-#ifndef QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
-#define QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
+#ifndef QGSTREAMERAUDIOINPUTSELECTOR_H
+#define QGSTREAMERAUDIOINPUTSELECTOR_H
-#include <qaudioendpointselectorcontrol.h>
+#include <qaudioinputselectorcontrol.h>
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
-class QGstreamerAudioInputEndpointSelector : public QAudioEndpointSelectorControl
+class QGstreamerAudioInputSelector : public QAudioInputSelectorControl
{
Q_OBJECT
public:
- QGstreamerAudioInputEndpointSelector(QObject *parent);
- ~QGstreamerAudioInputEndpointSelector();
+ QGstreamerAudioInputSelector(QObject *parent);
+ ~QGstreamerAudioInputSelector();
- QList<QString> availableEndpoints() const;
- QString endpointDescription(const QString& name) const;
- QString defaultEndpoint() const;
- QString activeEndpoint() const;
+ QList<QString> availableInputs() const;
+ QString inputDescription(const QString& name) const;
+ QString defaultInput() const;
+ QString activeInput() const;
public Q_SLOTS:
- void setActiveEndpoint(const QString& name);
+ void setActiveInput(const QString& name);
private:
void update();
QT_END_NAMESPACE
-#endif // QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
+#endif // QGSTREAMERAUDIOINPUTSELECTOR_H
****************************************************************************/
#include "qaudiorecorder.h"
-#include "qaudioendpointselectorcontrol.h"
+#include "qaudioinputselectorcontrol.h"
#include "qmediaobject_p.h"
#include "qmediarecorder_p.h"
#include <qmediaservice.h>
\snippet doc/src/snippets/multimedia-snippets/media.cpp Audio recorder
- In addition QAudioRecorder provides functionality for selecting the audio
- input from available audio endpoints.
+ In addition QAudioRecorder provides functionality for selecting the audio input.
- \snippet doc/src/snippets/multimedia-snippets/media.cpp Audio recorder endpoints
+ \snippet doc/src/snippets/multimedia-snippets/media.cpp Audio recorder inputs
The \l {audiorecorder}{Audio Recorder} example shows how to use this class
in more detail.
- \sa QMediaRecorder, QAudioEndpointSelectorControl
+ \sa QMediaRecorder, QAudioInputSelectorControl
*/
class QAudioRecorderObject : public QMediaObject
void initControls()
{
Q_Q(QAudioRecorder);
- audioEndpointSelector = 0;
+ audioInputSelector = 0;
QMediaService *service = mediaObject ? mediaObject->service() : 0;
if (service != 0)
- audioEndpointSelector = qobject_cast<QAudioEndpointSelectorControl*>(service->requestControl(QAudioEndpointSelectorControl_iid));
+ audioInputSelector = qobject_cast<QAudioInputSelectorControl*>(service->requestControl(QAudioInputSelectorControl_iid));
- if (audioEndpointSelector) {
- q->connect(audioEndpointSelector, SIGNAL(activeEndpointChanged(QString)),
+ if (audioInputSelector) {
+ q->connect(audioInputSelector, SIGNAL(activeInputChanged(QString)),
SIGNAL(audioInputChanged(QString)));
- q->connect(audioEndpointSelector, SIGNAL(availableEndpointsChanged()),
+ q->connect(audioInputSelector, SIGNAL(availableInputsChanged()),
SIGNAL(availableAudioInputsChanged()));
}
}
QAudioRecorderPrivate():
QMediaRecorderPrivate(),
provider(0),
- audioEndpointSelector(0) {}
+ audioInputSelector(0) {}
QMediaServiceProvider *provider;
- QAudioEndpointSelectorControl *audioEndpointSelector;
+ QAudioInputSelectorControl *audioInputSelector;
};
QMediaObject *mediaObject = d->mediaObject;
setMediaObject(0);
- if (service && d->audioEndpointSelector)
- service->releaseControl(d->audioEndpointSelector);
+ if (service && d->audioInputSelector)
+ service->releaseControl(d->audioInputSelector);
if (d->provider && service)
d->provider->releaseService(service);
QStringList QAudioRecorder::audioInputs() const
{
Q_D(const QAudioRecorder);
- if (d->audioEndpointSelector)
- return d->audioEndpointSelector->availableEndpoints();
+ if (d->audioInputSelector)
+ return d->audioInputSelector->availableInputs();
else
return QStringList();
}
{
Q_D(const QAudioRecorder);
- if (d->audioEndpointSelector)
- return d->audioEndpointSelector->endpointDescription(name);
+ if (d->audioInputSelector)
+ return d->audioInputSelector->inputDescription(name);
else
return QString();
}
{
Q_D(const QAudioRecorder);
- if (d->audioEndpointSelector)
- return d->audioEndpointSelector->defaultEndpoint();
+ if (d->audioInputSelector)
+ return d->audioInputSelector->defaultInput();
else
return QString();
}
{
Q_D(const QAudioRecorder);
- if (d->audioEndpointSelector)
- return d->audioEndpointSelector->activeEndpoint();
+ if (d->audioInputSelector)
+ return d->audioInputSelector->activeInput();
else
return QString();
}
{
Q_D(const QAudioRecorder);
- if (d->audioEndpointSelector)
- return d->audioEndpointSelector->setActiveEndpoint(name);
+ if (d->audioInputSelector)
+ return d->audioInputSelector->setActiveInput(name);
}
/*!
HEADERS += audioencodercontrol.h \
audiocontainercontrol.h \
audiomediarecordercontrol.h \
- audioendpointselector.h \
+ audioinputselector.h \
audiocaptureservice.h \
audiocaptureserviceplugin.h \
audiocapturesession.h
SOURCES += audioencodercontrol.cpp \
audiocontainercontrol.cpp \
audiomediarecordercontrol.cpp \
- audioendpointselector.cpp \
+ audioinputselector.cpp \
audiocaptureservice.cpp \
audiocaptureserviceplugin.cpp \
audiocapturesession.cpp
#include "audiocaptureservice.h"
#include "audiocapturesession.h"
-#include "audioendpointselector.h"
+#include "audioinputselector.h"
#include "audioencodercontrol.h"
#include "audiocontainercontrol.h"
#include "audiomediarecordercontrol.h"
m_encoderControl = new AudioEncoderControl(m_session);
m_containerControl = new AudioContainerControl(m_session);
m_mediaControl = new AudioMediaRecorderControl(m_session);
- m_endpointSelector = new AudioEndpointSelector(m_session);
+ m_inputSelector = new AudioInputSelector(m_session);
}
AudioCaptureService::~AudioCaptureService()
{
delete m_encoderControl;
delete m_containerControl;
- delete m_endpointSelector;
+ delete m_inputSelector;
delete m_mediaControl;
delete m_session;
}
if (qstrcmp(name,QAudioEncoderSettingsControl_iid) == 0)
return m_encoderControl;
- if (qstrcmp(name,QAudioEndpointSelectorControl_iid) == 0)
- return m_endpointSelector;
+ if (qstrcmp(name,QAudioInputSelectorControl_iid) == 0)
+ return m_inputSelector;
if (qstrcmp(name,QMediaContainerControl_iid) == 0)
return m_containerControl;
class AudioEncoderControl;
class AudioContainerControl;
class AudioMediaRecorderControl;
-class AudioEndpointSelector;
+class AudioInputSelector;
QT_USE_NAMESPACE
AudioCaptureSession *m_session;
AudioEncoderControl *m_encoderControl;
AudioContainerControl *m_containerControl;
- AudioEndpointSelector *m_endpointSelector;
+ AudioInputSelector *m_inputSelector;
AudioMediaRecorderControl *m_mediaControl;
};
#include <QDir>
#include "audioencodercontrol.h"
-#include "audioendpointselector.h"
+#include "audioinputselector.h"
#include "audiomediarecordercontrol.h"
#include <qaudioformat.h>
****************************************************************************/
#include "audiocapturesession.h"
-#include "audioendpointselector.h"
+#include "audioinputselector.h"
#include <qaudiodeviceinfo.h>
-AudioEndpointSelector::AudioEndpointSelector(QObject *parent)
- :QAudioEndpointSelectorControl(parent)
+AudioInputSelector::AudioInputSelector(QObject *parent)
+ :QAudioInputSelectorControl(parent)
{
m_session = qobject_cast<AudioCaptureSession*>(parent);
update();
- m_audioInput = defaultEndpoint();
+ m_audioInput = defaultInput();
}
-AudioEndpointSelector::~AudioEndpointSelector()
+AudioInputSelector::~AudioInputSelector()
{
}
-QList<QString> AudioEndpointSelector::availableEndpoints() const
+QList<QString> AudioInputSelector::availableInputs() const
{
return m_names;
}
-QString AudioEndpointSelector::endpointDescription(const QString& name) const
+QString AudioInputSelector::inputDescription(const QString& name) const
{
QString desc;
return desc;
}
-QString AudioEndpointSelector::defaultEndpoint() const
+QString AudioInputSelector::defaultInput() const
{
return QAudioDeviceInfo(QAudioDeviceInfo::defaultInputDevice()).deviceName();
}
-QString AudioEndpointSelector::activeEndpoint() const
+QString AudioInputSelector::activeInput() const
{
return m_audioInput;
}
-void AudioEndpointSelector::setActiveEndpoint(const QString& name)
+void AudioInputSelector::setActiveInput(const QString& name)
{
if (m_audioInput.compare(name) != 0) {
m_audioInput = name;
m_session->setCaptureDevice(name);
- emit activeEndpointChanged(name);
+ emit activeInputChanged(name);
}
}
-void AudioEndpointSelector::update()
+void AudioInputSelector::update()
{
m_names.clear();
m_descriptions.clear();
**
****************************************************************************/
-#ifndef AUDIOENDPOINTSELECTOR_H
-#define AUDIOENDPOINTSELECTOR_H
+#ifndef AUDIOINPUTSELECTOR_H
+#define AUDIOINPUTSELECTOR_H
#include <QStringList>
-#include "qaudioendpointselectorcontrol.h"
+#include "qaudioinputselectorcontrol.h"
class AudioCaptureSession;
QT_USE_NAMESPACE
-class AudioEndpointSelector : public QAudioEndpointSelectorControl
+class AudioInputSelector : public QAudioInputSelectorControl
{
Q_OBJECT
public:
- AudioEndpointSelector(QObject *parent);
- virtual ~AudioEndpointSelector();
+ AudioInputSelector(QObject *parent);
+ virtual ~AudioInputSelector();
- QList<QString> availableEndpoints() const;
- QString endpointDescription(const QString& name) const;
- QString defaultEndpoint() const;
- QString activeEndpoint() const;
+ QList<QString> availableInputs() const;
+ QString inputDescription(const QString& name) const;
+ QString defaultInput() const;
+ QString activeInput() const;
public Q_SLOTS:
- void setActiveEndpoint(const QString& name);
+ void setActiveInput(const QString& name);
private:
void update();
AudioCaptureSession* m_session;
};
-#endif // AUDIOENDPOINTSELECTOR_H
+#endif // AUDIOINPUTSELECTOR_H
DirectShowAudioEndpointControl::DirectShowAudioEndpointControl(
DirectShowPlayerService *service, QObject *parent)
- : QAudioEndpointSelectorControl(parent)
+ : QAudioOutputSelectorControl(parent)
, m_service(service)
, m_bindContext(0)
, m_deviceEnumerator(0)
updateEndpoints();
- setActiveEndpoint(m_defaultEndpoint);
+ setActiveOutput(m_defaultEndpoint);
}
}
m_deviceEnumerator->Release();
}
-QList<QString> DirectShowAudioEndpointControl::availableEndpoints() const
+QList<QString> DirectShowAudioEndpointControl::availableOutputs() const
{
return m_devices.keys();
}
-QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) const
+QString DirectShowAudioEndpointControl::outputDescription(const QString &name) const
{
#ifdef __IPropertyBag_INTERFACE_DEFINED__
QString description;
#endif
}
-QString DirectShowAudioEndpointControl::defaultEndpoint() const
+QString DirectShowAudioEndpointControl::defaultOutput() const
{
return m_defaultEndpoint;
}
-QString DirectShowAudioEndpointControl::activeEndpoint() const
+QString DirectShowAudioEndpointControl::activeOutput() const
{
return m_activeEndpoint;
}
-void DirectShowAudioEndpointControl::setActiveEndpoint(const QString &name)
+void DirectShowAudioEndpointControl::setActiveOutput(const QString &name)
{
if (m_activeEndpoint == name)
return;
#ifndef DIRECTSHOWAUDIOENDPOINTCONTROL_H
#define DIRECTSHOWAUDIOENDPOINTCONTROL_H
-#include "qaudioendpointselectorcontrol.h"
+#include "qaudiooutputselectorcontrol.h"
#include <dshow.h>
QT_USE_NAMESPACE
-class DirectShowAudioEndpointControl : public QAudioEndpointSelectorControl
+class DirectShowAudioEndpointControl : public QAudioOutputSelectorControl
{
Q_OBJECT
public:
DirectShowAudioEndpointControl(DirectShowPlayerService *service, QObject *parent = 0);
~DirectShowAudioEndpointControl();
- QList<QString> availableEndpoints() const;
+ QList<QString> availableOutputs() const;
- QString endpointDescription(const QString &name) const;
+ QString outputDescription(const QString &name) const;
- QString defaultEndpoint() const;
- QString activeEndpoint() const;
+ QString defaultOutput() const;
+ QString activeOutput() const;
- void setActiveEndpoint(const QString& name);
+ void setActiveOutput(const QString& name);
private:
void updateEndpoints();
{
if (qstrcmp(name, QMediaPlayerControl_iid) == 0) {
return m_playerControl;
- } else if (qstrcmp(name, QAudioEndpointSelectorControl_iid) == 0) {
+ } else if (qstrcmp(name, QAudioOutputSelectorControl_iid) == 0) {
return m_audioEndpointControl;
} else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
return m_metaDataControl;
#include "camerabincapturedestination.h"
#include <private/qgstreamerbushelper_p.h>
-#include <private/qgstreameraudioinputendpointselector_p.h>
+#include <private/qgstreameraudioinputselector_p.h>
#include <private/qgstreamervideoinputdevicecontrol_p.h>
#if defined(HAVE_WIDGETS)
m_cameraControl = 0;
m_metaDataControl = 0;
- m_audioInputEndpointSelector = 0;
+ m_audioInputSelector = 0;
m_videoInputDevice = 0;
m_videoOutput = 0;
return;
}
- m_audioInputEndpointSelector = new QGstreamerAudioInputEndpointSelector(this);
- connect(m_audioInputEndpointSelector, SIGNAL(activeEndpointChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
+ m_audioInputSelector = new QGstreamerAudioInputSelector(this);
+ connect(m_audioInputSelector, SIGNAL(activeInputChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
- if (m_captureSession && m_audioInputEndpointSelector->availableEndpoints().size() > 0)
- m_captureSession->setCaptureDevice(m_audioInputEndpointSelector->defaultEndpoint());
+ if (m_captureSession && m_audioInputSelector->availableInputs().size() > 0)
+ m_captureSession->setCaptureDevice(m_audioInputSelector->defaultInput());
m_metaDataControl = new CameraBinMetaData(this);
connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)),
}
}
- if (qstrcmp(name,QAudioEndpointSelectorControl_iid) == 0)
- return m_audioInputEndpointSelector;
+ if (qstrcmp(name,QAudioInputSelectorControl_iid) == 0)
+ return m_audioInputSelector;
if (qstrcmp(name,QVideoDeviceSelectorControl_iid) == 0)
return m_videoInputDevice;
#include <gst/gst.h>
QT_BEGIN_NAMESPACE
-class QAudioEndpointSelectorControl;
+class QAudioInputSelectorControl;
class QVideoDeviceSelectorControl;
CameraBinControl *m_cameraControl;
CameraBinMetaData *m_metaDataControl;
- QAudioEndpointSelectorControl *m_audioInputEndpointSelector;
+ QAudioInputSelectorControl *m_audioInputSelector;
QVideoDeviceSelectorControl *m_videoInputDevice;
QMediaControl *m_videoOutput;
#include "qgstreamercapturemetadatacontrol.h"
#include "qgstreamerimagecapturecontrol.h"
-#include <private/qgstreameraudioinputendpointselector_p.h>
+#include <private/qgstreameraudioinputselector_p.h>
#include <private/qgstreamervideoinputdevicecontrol_p.h>
#include <private/qgstreameraudioprobecontrol_p.h>
m_metaDataControl = 0;
m_videoInput = 0;
- m_audioInputEndpointSelector = 0;
+ m_audioInputSelector = 0;
m_videoInputDevice = 0;
m_videoOutput = 0;
m_imageCaptureControl = new QGstreamerImageCaptureControl(m_captureSession);
}
- m_audioInputEndpointSelector = new QGstreamerAudioInputEndpointSelector(this);
- connect(m_audioInputEndpointSelector, SIGNAL(activeEndpointChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
+ m_audioInputSelector = new QGstreamerAudioInputSelector(this);
+ connect(m_audioInputSelector, SIGNAL(activeInputChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
- if (m_captureSession && m_audioInputEndpointSelector->availableEndpoints().size() > 0)
- m_captureSession->setCaptureDevice(m_audioInputEndpointSelector->defaultEndpoint());
+ if (m_captureSession && m_audioInputSelector->availableInputs().size() > 0)
+ m_captureSession->setCaptureDevice(m_audioInputSelector->defaultInput());
m_metaDataControl = new QGstreamerCaptureMetaDataControl(this);
connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)),
if (!m_captureSession)
return 0;
- if (qstrcmp(name,QAudioEndpointSelectorControl_iid) == 0)
- return m_audioInputEndpointSelector;
+ if (qstrcmp(name,QAudioInputSelectorControl_iid) == 0)
+ return m_audioInputSelector;
if (qstrcmp(name,QVideoDeviceSelectorControl_iid) == 0)
return m_videoInputDevice;
#include <gst/gst.h>
QT_BEGIN_NAMESPACE
-class QAudioEndpointSelectorControl;
+class QAudioInputSelectorControl;
class QVideoDeviceSelectorControl;
class QGstreamerCaptureSession;
QGstreamerV4L2Input *m_videoInput;
QGstreamerCaptureMetaDataControl *m_metaDataControl;
- QAudioEndpointSelectorControl *m_audioInputEndpointSelector;
+ QAudioInputSelectorControl *m_audioInputSelector;
QVideoDeviceSelectorControl *m_videoInputDevice;
QMediaControl *m_videoOutput;
#include "mfaudioendpointcontrol.h"
MFAudioEndpointControl::MFAudioEndpointControl(QObject *parent)
- : QAudioEndpointSelectorControl(parent)
+ : QAudioOutputSelectorControl(parent)
, m_currentActivate(0)
{
updateEndpoints();
- setActiveEndpoint(m_defaultEndpoint);
+ setActiveOutput(m_defaultEndpoint);
}
MFAudioEndpointControl::~MFAudioEndpointControl()
m_currentActivate->Release();
}
-QList<QString> MFAudioEndpointControl::availableEndpoints() const
+QList<QString> MFAudioEndpointControl::availableOutputs() const
{
return m_devices.keys();
}
-QString MFAudioEndpointControl::endpointDescription(const QString &name) const
+QString MFAudioEndpointControl::outputDescription(const QString &name) const
{
return name.section(QLatin1Char('\\'), -1);
}
-QString MFAudioEndpointControl::defaultEndpoint() const
+QString MFAudioEndpointControl::defaultOutput() const
{
return m_defaultEndpoint;
}
-QString MFAudioEndpointControl::activeEndpoint() const
+QString MFAudioEndpointControl::activeOutput() const
{
return m_activeEndpoint;
}
-void MFAudioEndpointControl::setActiveEndpoint(const QString &name)
+void MFAudioEndpointControl::setActiveOutput(const QString &name)
{
if (m_activeEndpoint == name)
return;
#include <mfidl.h>
#include <mmdeviceapi.h>
-#include "qaudioendpointselectorcontrol.h"
+#include "qaudiooutputselectorcontrol.h"
class MFPlayerService;
QT_USE_NAMESPACE
-class MFAudioEndpointControl : public QAudioEndpointSelectorControl
+class MFAudioEndpointControl : public QAudioOutputSelectorControl
{
Q_OBJECT
public:
MFAudioEndpointControl(QObject *parent = 0);
~MFAudioEndpointControl();
- QList<QString> availableEndpoints() const;
+ QList<QString> availableOutputs() const;
- QString endpointDescription(const QString &name) const;
+ QString outputDescription(const QString &name) const;
- QString defaultEndpoint() const;
- QString activeEndpoint() const;
+ QString defaultOutput() const;
+ QString activeOutput() const;
- void setActiveEndpoint(const QString& name);
+ void setActiveOutput(const QString& name);
IMFActivate* currentActivate() const;
{
if (qstrcmp(name, QMediaPlayerControl_iid) == 0) {
return m_player;
- } else if (qstrcmp(name, QAudioEndpointSelectorControl_iid) == 0) {
+ } else if (qstrcmp(name, QAudioOutputSelectorControl_iid) == 0) {
return m_audioEndpointControl;
} else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
return m_metaDataControl;
#include <qaudiorecorder.h>
#include <qaudioencodersettingscontrol.h>
#include <qmediarecordercontrol.h>
-#include <qaudioendpointselectorcontrol.h>
+#include <qaudioinputselectorcontrol.h>
#include <qaudiodeviceinfo.h>
#include <qaudioinput.h>
#include <qmediaobject.h>
// The availabilityChangedSignal is implemented in QAudioRecorder. SO using it to test the signal.
audiosource = new QAudioRecorder;
- /* Spy the signal availableEndpointChanged and audioInputchanged */
- QSignalSpy changed(mockMediaRecorderService->mockAudioEndpointSelector, SIGNAL(availableEndpointsChanged()));
+ /* Spy the signal availableInputsChanged and audioInputchanged */
+ QSignalSpy changed(mockMediaRecorderService->mockAudioInputSelector, SIGNAL(availableInputsChanged()));
QSignalSpy audioInputchange(audiosource, SIGNAL(availableAudioInputsChanged()));
/* Add the end points and verify if the available end point changed signal is emitted. */
- QMetaObject::invokeMethod(mockMediaRecorderService->mockAudioEndpointSelector, "addEndpoints");
+ QMetaObject::invokeMethod(mockMediaRecorderService->mockAudioInputSelector, "addInputs");
QVERIFY(changed.count() == 1);
QVERIFY(audioInputchange.count() == 1);
/* Now try removes */
changed.clear();
audioInputchange.clear();
- QMetaObject::invokeMethod(mockMediaRecorderService->mockAudioEndpointSelector, "removeEndpoints");
+ QMetaObject::invokeMethod(mockMediaRecorderService->mockAudioInputSelector, "removeInputs");
QVERIFY(changed.count() == 1);
QVERIFY(audioInputchange.count() == 1);
}
#include <qmediarecordercontrol.h>
#include <qmediarecorder.h>
#include <qmetadatawritercontrol.h>
-#include <qaudioendpointselectorcontrol.h>
+#include <qaudioinputselectorcontrol.h>
#include <qaudioencodersettingscontrol.h>
#include <qmediacontainercontrol.h>
#include <qvideoencodersettingscontrol.h>
#include <qmediaobject.h>
#include <qmediaservice.h>
#include <qmetadatareadercontrol.h>
-#include <qaudioendpointselectorcontrol.h>
+#include <qaudioinputselectorcontrol.h>
#include "mockmediarecorderservice.h"
#include "mockmediaserviceprovider.h"
#include <qmediarecordercontrol.h>
#include <qmediarecorder.h>
#include <qmetadatawritercontrol.h>
-#include <qaudioendpointselectorcontrol.h>
+#include <qaudioinputselectorcontrol.h>
#include <qaudioencodersettingscontrol.h>
#include <qmediacontainercontrol.h>
#include <qvideoencodersettingscontrol.h>
private:
QAudioEncoderSettingsControl* encode;
- QAudioEndpointSelectorControl* audio;
+ QAudioInputSelectorControl* audio;
MockMediaObject *object;
MockMediaRecorderService*service;
MockMediaRecorderControl *mock;
object = new MockMediaObject(this, service);
capture = new QMediaRecorder(object);
- audio = qobject_cast<QAudioEndpointSelectorControl*>(service->requestControl(QAudioEndpointSelectorControl_iid));
+ audio = qobject_cast<QAudioInputSelectorControl*>(service->requestControl(QAudioInputSelectorControl_iid));
encode = qobject_cast<QAudioEncoderSettingsControl*>(service->requestControl(QAudioEncoderSettingsControl_iid));
videoEncode = qobject_cast<QVideoEncoderSettingsControl*>(service->requestControl(QVideoEncoderSettingsControl_iid));
}
void tst_QMediaRecorder::testAudioDeviceControl()
{
- QSignalSpy readSignal(audio,SIGNAL(activeEndpointChanged(QString)));
- QVERIFY(audio->availableEndpoints().size() == 3);
- QVERIFY(audio->defaultEndpoint().compare("device1") == 0);
- audio->setActiveEndpoint("device2");
+ QSignalSpy readSignal(audio,SIGNAL(activeInputChanged(QString)));
+ QVERIFY(audio->availableInputs().size() == 3);
+ QVERIFY(audio->defaultInput().compare("device1") == 0);
+ audio->setActiveInput("device2");
QTestEventLoop::instance().enterLoop(1);
- QVERIFY(audio->activeEndpoint().compare("device2") == 0);
+ QVERIFY(audio->activeInput().compare("device2") == 0);
QVERIFY(readSignal.count() == 1);
- QVERIFY(audio->endpointDescription("device2").compare("dev2 comment") == 0);
+ QVERIFY(audio->inputDescription("device2").compare("dev2 comment") == 0);
}
void tst_QMediaRecorder::testAudioEncodeControl()
**
****************************************************************************/
-#ifndef MOCKAUDIOENDPOINTSELECTOR_H
-#define MOCKAUDIOENDPOINTSELECTOR_H
+#ifndef MOCKAUDIOINPUTSELECTOR_H
+#define MOCKAUDIOINPUTSELECTOR_H
-#include "qaudioendpointselectorcontrol.h"
+#include "qaudioinputselectorcontrol.h"
-class MockAudioEndpointSelector : public QAudioEndpointSelectorControl
+class MockAudioInputSelector : public QAudioInputSelectorControl
{
Q_OBJECT
public:
- MockAudioEndpointSelector(QObject *parent):
- QAudioEndpointSelectorControl(parent)
+ MockAudioInputSelector(QObject *parent):
+ QAudioInputSelectorControl(parent)
{
m_names << "device1" << "device2" << "device3";
m_descriptions << "dev1 comment" << "dev2 comment" << "dev3 comment";
m_audioInput = "device1";
- emit availableEndpointsChanged();
+ emit availableInputsChanged();
}
- ~MockAudioEndpointSelector() {}
+ ~MockAudioInputSelector() {}
- QList<QString> availableEndpoints() const
+ QList<QString> availableInputs() const
{
return m_names;
}
- QString endpointDescription(const QString& name) const
+ QString inputDescription(const QString& name) const
{
QString desc;
return desc;
}
- QString defaultEndpoint() const
+ QString defaultInput() const
{
return m_names.at(0);
}
- QString activeEndpoint() const
+ QString activeInput() const
{
return m_audioInput;
}
public Q_SLOTS:
- void setActiveEndpoint(const QString& name)
+ void setActiveInput(const QString& name)
{
m_audioInput = name;
- emit activeEndpointChanged(name);
+ emit activeInputChanged(name);
}
- void addEndpoints()
+ void addInputs()
{
m_names << "device4";
- emit availableEndpointsChanged();
+ emit availableInputsChanged();
}
- void removeEndpoints()
+ void removeInputs()
{
m_names.clear();
- emit availableEndpointsChanged();
+ emit availableInputsChanged();
}
private:
-#endif // MOCKAUDIOENDPOINTSELECTOR_H
+#endif // MOCKAUDIOINPUTSELECTOR_H
#include "mockaudioencodercontrol.h"
#include "mockmediarecordercontrol.h"
#include "mockvideoencodercontrol.h"
-#include "mockaudioendpointselector.h"
+#include "mockaudioinputselector.h"
#include "mockmediacontainercontrol.h"
#include "mockmetadatawritercontrol.h"
#include "mockavailabilitycontrol.h"
mockAvailabilityControl(availability),
hasControls(true)
{
- mockAudioEndpointSelector = new MockAudioEndpointSelector(this);
+ mockAudioInputSelector = new MockAudioInputSelector(this);
mockAudioEncoderControl = new MockAudioEncoderControl(this);
mockFormatControl = new MockMediaContainerControl(this);
mockVideoEncoderControl = new MockVideoEncoderControl(this);
{
if (hasControls && qstrcmp(name,QAudioEncoderSettingsControl_iid) == 0)
return mockAudioEncoderControl;
- if (hasControls && qstrcmp(name,QAudioEndpointSelectorControl_iid) == 0)
- return mockAudioEndpointSelector;
+ if (hasControls && qstrcmp(name,QAudioInputSelectorControl_iid) == 0)
+ return mockAudioInputSelector;
if (hasControls && qstrcmp(name,QMediaRecorderControl_iid) == 0)
return mockControl;
if (hasControls && qstrcmp(name,QMediaContainerControl_iid) == 0)
}
QMediaControl *mockControl;
- QAudioEndpointSelectorControl *mockAudioEndpointSelector;
+ QAudioInputSelectorControl *mockAudioInputSelector;
QAudioEncoderSettingsControl *mockAudioEncoderControl;
QMediaContainerControl *mockFormatControl;
QVideoEncoderSettingsControl *mockVideoEncoderControl;
../qmultimedia_common/mockmediarecordercontrol.h \
../qmultimedia_common/mockvideoencodercontrol.h \
../qmultimedia_common/mockaudioencodercontrol.h \
- ../qmultimedia_common/mockaudioendpointselector.h \
+ ../qmultimedia_common/mockaudioinputselector.h \
../qmultimedia_common/mockaudioprobecontrol.h \
# We also need all the container/metadata bits