1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qplatformmediarecorder_p.h"
5#include <QObject>
6
7QT_BEGIN_NAMESPACE
8
9QPlatformMediaRecorder::QPlatformMediaRecorder(QMediaRecorder *parent)
10 : q(parent)
11{
12}
13
14void QPlatformMediaRecorder::pause()
15{
16 error(error: QMediaRecorder::FormatError, errorString: QMediaRecorder::tr(s: "Pause not supported"));
17}
18
19void QPlatformMediaRecorder::resume()
20{
21 error(error: QMediaRecorder::FormatError, errorString: QMediaRecorder::tr(s: "Resume not supported"));
22}
23
24void QPlatformMediaRecorder::stateChanged(QMediaRecorder::RecorderState state)
25{
26 if (m_state == state)
27 return;
28 m_state = state;
29 emit q->recorderStateChanged(state);
30}
31
32void QPlatformMediaRecorder::durationChanged(qint64 duration)
33{
34 if (m_duration == duration)
35 return;
36 m_duration = duration;
37 emit q->durationChanged(duration);
38}
39
40void QPlatformMediaRecorder::actualLocationChanged(const QUrl &location)
41{
42 if (m_actualLocation == location)
43 return;
44 m_actualLocation = location;
45 emit q->actualLocationChanged(location);
46}
47
48void QPlatformMediaRecorder::error(QMediaRecorder::Error error, const QString &errorString)
49{
50 if (error == m_error && errorString == m_errorString)
51 return;
52 m_error = error;
53 m_errorString = errorString;
54 if (error != QMediaRecorder::NoError)
55 emit q->errorOccurred(error, errorString);
56 emit q->errorChanged();
57}
58
59void QPlatformMediaRecorder::metaDataChanged()
60{
61 emit q->metaDataChanged();
62}
63
64QT_END_NAMESPACE
65

source code of qtmultimedia/src/multimedia/platform/qplatformmediarecorder.cpp