Commit b2596f9e authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Merge branch 'Applications/16.04'

parents 88df2ed7 f250175f
......@@ -27,37 +27,23 @@ K_PLUGIN_FACTORY_WITH_JSON( BackendFactory,
QtMultimediaBackend::QtMultimediaBackend(QObject *parent, const QList< QVariant >&)
: BackendInterface("qtmultimedia", parent)
, m_captureBackend(nullptr)
, m_outputBackend(nullptr)
, m_captureBackend(new QtMultimediaCaptureBackend(this))
, m_outputBackend(new QtMultimediaOutputBackend(this))
{
}
QtMultimediaBackend::~QtMultimediaBackend()
{
if (m_captureBackend) {
m_captureBackend->deleteLater();
m_captureBackend = nullptr;
}
if (m_outputBackend) {
m_outputBackend->deleteLater();
m_outputBackend = nullptr;
}
}
CaptureBackendInterface * QtMultimediaBackend::captureBackend() const
{
if (!m_captureBackend) {
m_captureBackend = new QtMultimediaCaptureBackend();
}
return m_captureBackend;
}
OutputBackendInterface * QtMultimediaBackend::outputBackend() const
{
if (!m_outputBackend) {
m_outputBackend = new QtMultimediaOutputBackend();
}
return m_outputBackend;
}
......
......@@ -38,8 +38,8 @@ public:
OutputBackendInterface * outputBackend() const;
private:
mutable QtMultimediaCaptureBackend *m_captureBackend;
mutable QtMultimediaOutputBackend *m_outputBackend;
QtMultimediaCaptureBackend *m_captureBackend;
QtMultimediaOutputBackend *m_outputBackend;
};
#endif
......
......@@ -24,8 +24,9 @@
#include <KLocalizedString>
QtMultimediaCaptureBackend::QtMultimediaCaptureBackend()
: m_recorder(new QAudioRecorder)
QtMultimediaCaptureBackend::QtMultimediaCaptureBackend(QObject *parent)
: CaptureBackendInterface(parent)
, m_recorder(new QAudioRecorder)
{
QString selectedInput = m_recorder->defaultAudioInput();
QAudioEncoderSettings audioSettings;
......
......@@ -33,7 +33,7 @@ class QtMultimediaCaptureBackend : public CaptureBackendInterface
Q_OBJECT
public:
QtMultimediaCaptureBackend();
explicit QtMultimediaCaptureBackend(QObject *parent);
virtual ~QtMultimediaCaptureBackend();
void startCapture(const QString &filePath);
......
......@@ -20,8 +20,9 @@
#include <QUrl>
#include <QMediaPlayer>
QtMultimediaOutputBackend::QtMultimediaOutputBackend()
: m_player(new QMediaPlayer)
QtMultimediaOutputBackend::QtMultimediaOutputBackend(QObject *parent)
: OutputBackendInterface(parent)
, m_player(new QMediaPlayer)
{
connect(m_player, &QMediaPlayer::stateChanged,
this, &QtMultimediaOutputBackend::stateChanged);
......
......@@ -28,7 +28,7 @@ class QtMultimediaOutputBackend : public OutputBackendInterface
Q_OBJECT
public:
QtMultimediaOutputBackend();
explicit QtMultimediaOutputBackend(QObject *parent = nullptr);
virtual ~QtMultimediaOutputBackend();
void setUri(const QString & uri);
......
......@@ -30,7 +30,7 @@
Recorder::Recorder(QObject *parent)
: QObject(parent)
, m_state(StoppedState)
, m_recordingBufferFile(QLatin1String("XXXXXX.ogg"))
, m_recordingBufferFile(QDir::tempPath() + QLatin1String("/XXXXXX.ogg"))
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment