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 emit rhiChanged();
24}
25
26void QFFmpegVideoSink::onVideoFrameChanged(const QVideoFrame &frame)
27{
28 QMutexLocker guard { &m_rhiMutex };
29 auto *buffer = QVideoFramePrivate::hwBuffer(frame);
30 if (buffer && m_rhi)
31 buffer->initTextureConverter(*m_rhi);
32}
33
34QT_END_NAMESPACE
35
36#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