summaryrefslogtreecommitdiffstats
path: root/src/multimedia/recording/qvideoframeinput.h
blob: 6617b051fe320784b054313892c6a8c19df082db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QVIDEOFRAMEINPUT_H
#define QVIDEOFRAMEINPUT_H

#include <QtMultimedia/qtmultimediaexports.h>
#include <QtMultimedia/qvideoframe.h>
#include <QtCore/qobject.h>

QT_BEGIN_NAMESPACE

class QPlatformVideoFrameInput;
class QVideoFrameInputPrivate;
class QMediaCaptureSession;

class Q_MULTIMEDIA_EXPORT QVideoFrameInput : public QObject
{
    Q_OBJECT
public:
    explicit QVideoFrameInput(QObject *parent = nullptr);

    ~QVideoFrameInput() override;

    bool sendVideoFrame(const QVideoFrame &frame);

    QMediaCaptureSession *captureSession() const;

Q_SIGNALS:
    void readyToSendVideoFrame();

private:
    void setCaptureSession(QMediaCaptureSession *captureSession);

    QPlatformVideoFrameInput *platformVideoFrameInput() const;

    friend class QMediaCaptureSession;
    Q_DISABLE_COPY(QVideoFrameInput)
    Q_DECLARE_PRIVATE(QVideoFrameInput)
};

QT_END_NAMESPACE

#endif // QVIDEOFRAMEINPUT_H