Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qplatformvideosink.cpp
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
5
7
9
11
13{
14 QMutexLocker locker(&m_mutex);
15 return m_nativeSize;
16}
17
19{
20 {
21 QMutexLocker locker(&m_mutex);
22 if (m_nativeSize == s)
23 return;
24 m_nativeSize = s;
25 }
26 emit m_sink->videoSizeChanged();
27}
28
30{
31 bool sizeChanged = false;
32
33 {
34 QMutexLocker locker(&m_mutex);
35 if (frame == m_currentVideoFrame)
36 return;
37 m_currentVideoFrame = frame;
38 m_currentVideoFrame.setSubtitleText(m_subtitleText);
39 sizeChanged = m_nativeSize != frame.size();
40 m_nativeSize = frame.size();
41 }
42
43 if (sizeChanged)
44 emit m_sink->videoSizeChanged();
46}
47
49{
50 QMutexLocker locker(&m_mutex);
51 return m_currentVideoFrame;
52}
53
55{
56 {
57 QMutexLocker locker(&m_mutex);
58 if (m_subtitleText == subtitleText)
59 return;
60 m_subtitleText = subtitleText;
61 }
63}
64
66{
67 QMutexLocker locker(&m_mutex);
68 return m_subtitleText;
69}
70
72
73#include "moc_qplatformvideosink_p.cpp"
\inmodule QtCore
Definition qmutex.h:317
\inmodule QtCore
Definition qobject.h:90
QString subtitleText() const
void setSubtitleText(const QString &subtitleText)
virtual void setVideoFrame(const QVideoFrame &frame)
QVideoFrame currentVideoFrame() const
QPlatformVideoSink(QVideoSink *parent)
~QPlatformVideoSink() override
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:26
void setSubtitleText(const QString &text)
Sets the subtitle text that should be rendered together with this video frame to text.
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
void videoSizeChanged()
void subtitleTextChanged(const QString &subtitleText) QT6_ONLY(const)
void videoFrameChanged(const QVideoFrame &frame) QT6_ONLY(const)
Signals when the video frame changes.
QSize size
the size of the widget excluding any window frame
Definition qwidget.h:113
Combined button and popup list for selecting options.
GLdouble s
[6]
Definition qopenglext.h:235
#define emit
QFrame frame
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent