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
avfdisplaylink_p.h
Go to the documentation of this file.
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#ifndef AVFDISPLAYLINK_H
5#define AVFDISPLAYLINK_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19
20#include <atomic>
21
22#import <QuartzCore/CADisplayLink.h>
23#if !defined(QT_PLATFORM_UIKIT)
24#include <QuartzCore/CVDisplayLink.h>
25#endif
26
27@class QT_MANGLE_NAMESPACE(DisplayLinkObserver);
28
29QT_BEGIN_NAMESPACE
30
31class AVFDisplayLink final : public QObject
32{
33 Q_OBJECT
34public:
35 explicit AVFDisplayLink(QObject *parent = nullptr);
36 ~AVFDisplayLink() override;
37 bool isValid() const;
38 bool isActive() const;
39
40public Q_SLOTS:
41 void start();
42 void stop();
43
44Q_SIGNALS:
45 void tick();
46
47public:
48 void displayLinkEvent();
49
50protected:
51 bool event(QEvent *) override;
52
53private:
54 QT_MANGLE_NAMESPACE(DisplayLinkObserver) *m_observer = {};
55#if !defined(QT_PLATFORM_UIKIT)
56 CVDisplayLinkRef m_cvDisplayLink{};
57#endif
58 bool m_isActive{};
59 std::atomic<bool> m_framePending{false};
60};
61
62QT_END_NAMESPACE
63
64#endif // AVFDISPLAYLINK_H