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 <QtQml/qqmlextensionplugin.h>
5#include <QtQml/qqml.h>
6#include <QtQml/qqmlengine.h>
7#include <QtQml/qqmlcomponent.h>
8#include "qsoundeffect.h"
9#include "qmediaplayer.h"
10#include "qmediametadata.h"
11#include "qcamera.h"
12#include "qmediacapturesession.h"
13#include "qmediarecorder.h"
14
15#include <private/qquickimagepreviewprovider_p.h>
16
17QT_BEGIN_NAMESPACE
18
19class QMultimediaQuickModule : public QQmlEngineExtensionPlugin
20{
21 Q_OBJECT
22 Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid)
23
24public:
25 QMultimediaQuickModule(QObject *parent = nullptr)
26 : QQmlEngineExtensionPlugin(parent)
27 {
28 volatile auto registration = qml_register_types_QtMultimedia;
29 Q_UNUSED(registration);
30 }
31
32 void initializeEngine(QQmlEngine *engine, const char *uri) override
33 {
34 Q_UNUSED(uri);
35 engine->addImageProvider(id: "camera", new QQuickImagePreviewProvider);
36 }
37};
38
39QT_END_NAMESPACE
40
41#include "multimedia_plugin.moc"
42
43

source code of qtmultimedia/src/multimediaquick/multimedia_plugin.cpp