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
qqnxaudiorecorder_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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#ifndef QQNXAUDIORECORDER_H
4#define QQNXAUDIORECORDER_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include "mmrenderertypes.h"
18
19#include <QByteArray>
20#include <QUrl>
21
22#include <QtCore/qobject.h>
23#include <QtCore/qtconfigmacros.h>
24
25#include <QtMultimedia/qmediarecorder.h>
26
27#include <private/qplatformmediarecorder_p.h>
28
29#include <mm/renderer.h>
30#include <mm/renderer/types.h>
31
32#include <memory>
33
35
37
39{
41
42public:
43 explicit QQnxAudioRecorder(QObject *parent = nullptr);
45
46 void setInputDeviceId(const QByteArray &id);
47 void setOutputUrl(const QUrl &url);
49
50 void record();
51 void stop();
52
55 void durationChanged(qint64 durationMs);
57
58private:
59 void openConnection();
60 void closeConnection();
61 void attach();
62 void detach();
63 void configureOutputBitRate();
64 void startMonitoring();
65 void stopMonitoring();
66 void readEvents();
67 void handleMmEventStatus(const mmr_event_t *event);
68 void handleMmEventState(const mmr_event_t *event);
69 void handleMmEventError(const mmr_event_t *event);
70
71 bool isAttached() const;
72
73 struct ContextDeleter
74 {
75 void operator()(mmr_context_t *ctx) { if (ctx) mmr_context_destroy(ctx); }
76 };
77
78 struct ConnectionDeleter
79 {
80 void operator()(mmr_connection_t *conn) { if (conn) mmr_disconnect(conn); }
81 };
82
83 using ContextUniquePtr = std::unique_ptr<mmr_context_t, ContextDeleter>;
84 ContextUniquePtr m_context;
85
86 using ConnectionUniquePtr = std::unique_ptr<mmr_connection_t, ConnectionDeleter>;
87 ConnectionUniquePtr m_connection;
88
89 int m_id = -1;
90 int m_audioId = -1;
91
92 QByteArray m_inputDeviceId;
93
94 QUrl m_outputUrl;
95
96 QMediaEncoderSettings m_encoderSettings;
97
98 std::unique_ptr<QQnxMediaEventThread> m_eventThread;
99};
100
102
103#endif
\inmodule QtCore
Definition qbytearray.h:57
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
void setInputDeviceId(const QByteArray &id)
void durationChanged(qint64 durationMs)
void setOutputUrl(const QUrl &url)
void stateChanged(QMediaRecorder::RecorderState state)
QQnxAudioRecorder(QObject *parent=nullptr)
void setMediaEncoderSettings(const QMediaEncoderSettings &settings)
void actualLocationChanged(const QUrl &location)
\inmodule QtCore
Definition qurl.h:94
EGLContext ctx
else opt state
[0]
Combined button and popup list for selecting options.
GLint location
struct _cl_event * event
typedefQT_BEGIN_NAMESPACE struct mmr_context mmr_context_t
#define Q_OBJECT
#define Q_SIGNALS
long long qint64
Definition qtypes.h:60
QSettings settings("MySoft", "Star Runner")
[0]
QUrl url("example.com")
[constructor-url-reference]