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
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
"common/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
34
QT_BEGIN_NAMESPACE
35
36
class
QQnxMediaEventThread;
37
38
class
QQnxAudioRecorder
:
public
QObject
39
{
40
Q_OBJECT
41
42
public
:
43
explicit
QQnxAudioRecorder
(
QObject
*
parent
=
nullptr
);
44
~
QQnxAudioRecorder
();
45
46
void
setInputDeviceId
(
const
QByteArray &id);
47
void
setOutputUrl
(
const
QUrl &url);
48
void
setMediaEncoderSettings
(
const
QMediaEncoderSettings &settings);
49
50
void
record
();
51
void
stop
();
52
53
Q_SIGNALS
:
54
void
stateChanged
(
QMediaRecorder
::
RecorderState
state
);
55
void
durationChanged
(qint64 durationMs);
56
void
actualLocationChanged
(
const
QUrl &location);
57
58
private
:
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
101
QT_END_NAMESPACE
102
103
#
endif
QQnxAudioRecorder
Definition
qqnxaudiorecorder_p.h:39
QQnxAudioRecorder::setInputDeviceId
void setInputDeviceId(const QByteArray &id)
Definition
qqnxaudiorecorder.cpp:140
QQnxAudioRecorder::record
void record()
Definition
qqnxaudiorecorder.cpp:155
QQnxAudioRecorder::~QQnxAudioRecorder
~QQnxAudioRecorder()
Definition
qqnxaudiorecorder.cpp:36
QQnxAudioRecorder::durationChanged
void durationChanged(qint64 durationMs)
QQnxAudioRecorder::setOutputUrl
void setOutputUrl(const QUrl &url)
Definition
qqnxaudiorecorder.cpp:145
QQnxAudioRecorder::stop
void stop()
Definition
qqnxaudiorecorder.cpp:168
QQnxAudioRecorder::setMediaEncoderSettings
void setMediaEncoderSettings(const QMediaEncoderSettings &settings)
Definition
qqnxaudiorecorder.cpp:150
QQnxAudioRecorder::actualLocationChanged
void actualLocationChanged(const QUrl &location)
MMR_STATE_DESTROYED
@ MMR_STATE_DESTROYED
Definition
mmrenderertypes.h:23
MMR_STATE_PLAYING
@ MMR_STATE_PLAYING
Definition
mmrenderertypes.h:26
MMR_STATE_STOPPED
@ MMR_STATE_STOPPED
Definition
mmrenderertypes.h:25
MMR_STATE_IDLE
@ MMR_STATE_IDLE
Definition
mmrenderertypes.h:24
MMR_EVENT_STATE
@ MMR_EVENT_STATE
Definition
mmrenderertypes.h:32
MMR_EVENT_OVERFLOW
@ MMR_EVENT_OVERFLOW
Definition
mmrenderertypes.h:33
MMR_EVENT_INPUT
@ MMR_EVENT_INPUT
Definition
mmrenderertypes.h:38
MMR_EVENT_ERROR
@ MMR_EVENT_ERROR
Definition
mmrenderertypes.h:31
MMR_EVENT_STATUS
@ MMR_EVENT_STATUS
Definition
mmrenderertypes.h:35
MMR_EVENT_TRKPAR
@ MMR_EVENT_TRKPAR
Definition
mmrenderertypes.h:41
MMR_EVENT_PLAYLIST
@ MMR_EVENT_PLAYLIST
Definition
mmrenderertypes.h:37
MMR_EVENT_CTXTPAR
@ MMR_EVENT_CTXTPAR
Definition
mmrenderertypes.h:40
MMR_EVENT_NONE
@ MMR_EVENT_NONE
Definition
mmrenderertypes.h:30
MMR_EVENT_OTHER
@ MMR_EVENT_OTHER
Definition
mmrenderertypes.h:42
MMR_EVENT_OUTPUT
@ MMR_EVENT_OUTPUT
Definition
mmrenderertypes.h:39
MMR_EVENT_METADATA
@ MMR_EVENT_METADATA
Definition
mmrenderertypes.h:36
MMR_EVENT_WARNING
@ MMR_EVENT_WARNING
Definition
mmrenderertypes.h:34
buildDevicePath
static QByteArray buildDevicePath(const QByteArray &deviceId, const QMediaEncoderSettings &settings)
Definition
qqnxaudiorecorder.cpp:15
mmr_event::state
mmr_state_t state
Definition
mmrenderertypes.h:47
mmr_event::type
mmr_event_type_t type
Definition
mmrenderertypes.h:46
mmr_event::pos_str
const char * pos_str
Definition
mmrenderertypes.h:85
qtmultimedia
src
plugins
multimedia
qnx
capture
qqnxaudiorecorder_p.h
Generated on
for Qt by
1.18.0