Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qplatformmediarecorder.cpp
Go to the documentation of this file.
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
6
#
include
<
QtMultimedia
/
private
/
qmediastoragelocation_p
.
h
>
7
#
include
<
QtCore
/
qobject
.
h
>
8
#
include
<
QtCore
/
qstandardpaths
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
QPlatformMediaRecorder::QPlatformMediaRecorder(QMediaRecorder *parent)
13
: q(parent)
14
{
15
}
16
17
void
QPlatformMediaRecorder::pause()
18
{
19
updateError(QMediaRecorder::FormatError, QMediaRecorder::tr(
"Pause not supported"
));
20
}
21
22
void
QPlatformMediaRecorder::resume()
23
{
24
updateError(QMediaRecorder::FormatError, QMediaRecorder::tr(
"Resume not supported"
));
25
}
26
27
void
QPlatformMediaRecorder::stateChanged(QMediaRecorder::RecorderState state)
28
{
29
if
(m_state == state)
30
return
;
31
m_state = state;
32
Q_EMIT q->recorderStateChanged(state);
33
}
34
35
void
QPlatformMediaRecorder::durationChanged(qint64 duration)
36
{
37
if
(m_duration == duration)
38
return
;
39
m_duration = duration;
40
Q_EMIT q->durationChanged(duration);
41
}
42
43
void
QPlatformMediaRecorder::actualLocationChanged(
const
QUrl &location)
44
{
45
if
(m_actualLocation == location)
46
return
;
47
m_actualLocation = location;
48
Q_EMIT q->actualLocationChanged(location);
49
}
50
51
void
QPlatformMediaRecorder::updateError(QMediaRecorder::Error error,
const
QString &errorString)
52
{
53
m_error.setAndNotify(error, errorString, *q);
54
}
55
56
void
QPlatformMediaRecorder::metaDataChanged()
57
{
58
Q_EMIT q->metaDataChanged();
59
}
60
61
QString QPlatformMediaRecorder::findActualLocation(
const
QMediaEncoderSettings &settings)
const
62
{
63
const
auto
audioOnly = settings.videoCodec() == QMediaFormat::VideoCodec::Unspecified;
64
65
const
auto
primaryLocation =
66
audioOnly ? QStandardPaths::MusicLocation : QStandardPaths::MoviesLocation;
67
QString location = QMediaStorageLocation::generateFileName(
68
outputLocation().toString(QUrl::PreferLocalFile), primaryLocation, settings.preferredSuffix());
69
70
Q_ASSERT(!location.isEmpty());
71
72
return
location;
73
}
74
75
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtmultimedia
src
multimedia
platform
qplatformmediarecorder.cpp
Generated on
for Qt by
1.18.0