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 <QtMultimedia/private/qplatformvideosink_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<QPlatformCamera *, QString> QOhosIntegration::createCamera(QCamera *camera)
59{
60 return new QOhosCamera(camera);
61}
62
63q23::expected<QPlatformImageCapture *, QString>
64QOhosIntegration::createImageCapture(QImageCapture *imageCapture)
65{
66 return new QOhosImageCapture(imageCapture);
67}
68
69q23::expected<QPlatformMediaRecorder *, QString>
70QOhosIntegration::createRecorder(QMediaRecorder *recorder)
71{
72 return new QOhosMediaRecorder(recorder);
73}
74
75q23::expected<QPlatformMediaCaptureSession *, QString> QOhosIntegration::createCaptureSession()
76{
77 return new QOhosMediaCaptureSession;
78}
79
80QPlatformVideoDevices *QOhosIntegration::createVideoDevices()
81{
82 return new QOhosVideoDevices(this);
83}
84
85QT_END_NAMESPACE
86
87#include "qohosintegration.moc"
Combined button and popup list for selecting options.