Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
avfmediaencoder_p.h
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#ifndef AVFMEDIAENCODER_H
5#define AVFMEDIAENCODER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19#include "avfcamerautility_p.h"
20#include "qaudiodevice.h"
21
22#include <private/qplatformmediarecorder_p.h>
23#include <private/qplatformmediacapture_p.h>
24#include <QtMultimedia/qmediametadata.h>
25
26#include <QtCore/qglobal.h>
27#include <QtCore/qurl.h>
28
29#include <AVFoundation/AVFoundation.h>
30
32
34class QString;
35class QUrl;
36
38{
40public:
42 ~AVFMediaEncoder() override;
43
44 bool isLocationWritable(const QUrl &location) const override;
45
46 QMediaRecorder::RecorderState state() const override;
47
48 qint64 duration() const override;
49
51 void pause() override;
52 void resume() override;
53 void stop() override;
54
55 void setMetaData(const QMediaMetaData &) override;
56 QMediaMetaData metaData() const override;
57
58 AVFCameraService *cameraService() const { return m_service; }
59
61
63
64 void toggleRecord(bool enable);
65
66private:
67 void applySettings(QMediaEncoderSettings &settings);
68 void unapplySettings();
69
70 Q_INVOKABLE void assetWriterStarted();
71 Q_INVOKABLE void assetWriterFinished();
72 Q_INVOKABLE void assetWriterError(QString error);
73
74private Q_SLOTS:
75 void onCameraChanged();
76 void cameraActiveChanged(bool);
77
78private:
79 void stopWriter();
80
81 AVFCameraService *m_service = nullptr;
82 AVFScopedPointer<QT_MANGLE_NAMESPACE(AVFMediaAssetWriter)> m_writer;
83
85
86 QMediaMetaData m_metaData;
87
88 qint64 m_duration;
89
90 NSDictionary *m_audioSettings;
91 NSDictionary *m_videoSettings;
92};
93
95
96#endif // AVFMEDIAENCODER_H
QMediaMetaData metaData() const override
void setMetaData(const QMediaMetaData &) override
void updateDuration(qint64 duration)
qint64 duration() const override
void stop() override
void resume() override
void toggleRecord(bool enable)
AVFMediaEncoder(QMediaRecorder *parent)
bool isLocationWritable(const QUrl &location) const override
void record(QMediaEncoderSettings &settings) override
~AVFMediaEncoder() override
AVFCameraService * cameraService() const
QMediaRecorder::RecorderState state() const override
void pause() override
void setCaptureSession(QPlatformMediaCaptureSession *session)
\inmodule QtMultimedia
\inmodule QtMultimedia
RecorderState
\qmlproperty enumeration QtMultimedia::MediaRecorder::recorderState
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QMediaRecorder::Error error() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
GLint location
GLboolean enable
#define QT_MANGLE_NAMESPACE(name)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SLOTS
long long qint64
Definition qtypes.h:60
QSettings settings("MySoft", "Star Runner")
[0]