Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2026 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
5
7#include "common/qohosvideosink_p.h"
9#include "mediacapture/qohoscamera_p.h"
10#include "mediacapture/qohosimagecapture_p.h"
11#include "mediacapture/qohosmediacapturesession_p.h"
12#include "mediacapture/qohosmediarecorder_p.h"
13#include "mediacapture/qohosvideodevices_p.h"
14#include "mediaplayer/qohosmediaplayer_p.h"
15
16#include <private/qplatformmediaformatinfo_p.h>
17#include <private/qplatformmediaplugin_p.h>
18
19#include <QtCore/qloggingcategory.h>
20
22
23Q_LOGGING_CATEGORY(qLcOhosMediaPlugin, "qt.multimedia.ohos")
24
25class QOhosMediaPlugin : public QPlatformMediaPlugin
26{
27 Q_OBJECT
28 Q_PLUGIN_METADATA(IID QPlatformMediaPlugin_iid FILE "ohos.json")
29
30public:
31 QOhosMediaPlugin() : QPlatformMediaPlugin() { }
32
33 QPlatformMediaIntegration *create(const QString &name) override
34 {
35 if (name == u"ohos")
36 return new QOhosIntegration;
37 return nullptr;
38 }
39};
40
41QOhosIntegration::QOhosIntegration() : QPlatformMediaIntegration(QLatin1String("ohos"))
42{
43}
44
45QOhosIntegration::~QOhosIntegration() = default;
46
47QPlatformMediaFormatInfo *QOhosIntegration::createFormatInfo()
48{
49 return new QOhosFormatsInfo;
50}
51
52q23::expected<QPlatformMediaPlayer *, QString>
53QOhosIntegration::createPlayer(QMediaPlayer *player)
54{
55 return new QOhosMediaPlayer(player);
56}
57
58q23::expected<QPlatformVideoSink *, QString>
59QOhosIntegration::createVideoSink(QVideoSink *sink)
60{
61 return new QOhosVideoSink(sink);
62}
63
64q23::expected<QPlatformCamera *, QString> QOhosIntegration::createCamera(QCamera *camera)
65{
66 return new QOhosCamera(camera);
67}
68
69q23::expected<QPlatformImageCapture *, QString>
70QOhosIntegration::createImageCapture(QImageCapture *imageCapture)
71{
72 return new QOhosImageCapture(imageCapture);
73}
74
75q23::expected<QPlatformMediaRecorder *, QString>
76QOhosIntegration::createRecorder(QMediaRecorder *recorder)
77{
78 return new QOhosMediaRecorder(recorder);
79}
80
81q23::expected<QPlatformMediaCaptureSession *, QString> QOhosIntegration::createCaptureSession()
82{
83 return new QOhosMediaCaptureSession;
84}
85
86QPlatformVideoDevices *QOhosIntegration::createVideoDevices()
87{
88 return new QOhosVideoDevices(this);
89}
90
91QT_END_NAMESPACE
92
93#include "qohosintegration.moc"
Combined button and popup list for selecting options.