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
qffmpegvideosink.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 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#include <qffmpegvideosink_p.h>
4#include <qffmpegvideobuffer_p.h>
5#include <private/qvideoframe_p.h>
6
8
10 : QPlatformVideoSink(sink)
11{
12}
13
14void QFFmpegVideoSink::setRhi(QRhi *rhi)
15{
16 {
17 QMutexLocker guard{ &m_rhiMutex };
18 if (m_rhi == rhi)
19 return;
20 m_rhi = rhi;
21 }
22
23 Q_EMIT rhiChanged();
24}
25
26void QFFmpegVideoSink::onVideoFrameChanged(const QVideoFrame &frame)
27{
28 auto *buffer = QVideoFramePrivate::hwBuffer(frame);
29 if (!buffer)
30 return;
31
32 withRhi([&](QRhi *rhi) {
33 if (rhi)
34 buffer->initTextureConverter(*rhi);
35 });
36}
37
38QT_END_NAMESPACE
39
40#include "moc_qffmpegvideosink_p.cpp"
void onVideoFrameChanged(const QVideoFrame &frame) override
void setRhi(QRhi *rhi) override
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
Combined button and popup list for selecting options.