4#include <QtFFmpegMediaPluginImpl/private/qcgwindowcapture_p.h>
6#include <QtCore/qmutex.h>
7#include <QtCore/qwaitcondition.h>
9#include <QtFFmpegMediaPluginImpl/private/qffmpegsurfacecapturegrabber_p.h>
11#include <QtGui/qscreen.h>
12#include <QtGui/qguiapplication.h>
14#include <QtMultimedia/qabstractvideobuffer.h>
15#include <QtMultimedia/private/qcapturablewindow_p.h>
16#include <QtMultimedia/private/qvideoframe_p.h>
18#include <QtCore/private/qcore_mac_p.h>
20#include <ApplicationServices/ApplicationServices.h>
21#include <IOKit/graphics/IOGraphicsLib.h>
23#import <AppKit/NSScreen.h>
24#import <AppKit/NSApplication.h>
25#import <AppKit/NSWindow.h>
29std::optional<qreal> frameRateForWindow(CGWindowID )
53 auto provider = CGImageGetDataProvider(image);
54 m_data = CGDataProviderCopyData(provider);
55 m_bytesPerLine = CGImageGetBytesPerRow(image);
62 mapData.planeCount = 1;
63 mapData.bytesPerLine[0] =
static_cast<
int>(m_bytesPerLine);
64 mapData.data[0] = (uchar *)CFDataGetBytePtr(m_data);
65 mapData.dataSize[0] =
static_cast<
int>(CFDataGetLength(m_data));
73 QCFType<CFDataRef> m_data;
74 size_t m_bytesPerLine = 0;
119 qWarning() <<
"Unexpected image format. PixelFormatInfo:"
201 return std::make_unique<QCGWindowCapture>();
208#include "moc_qcgwindowcapture_p.cpp"
MapData map(QVideoFrame::MapMode) override
Maps the planes of a video buffer to memory.
QVideoFrameFormat format() const override
Gets \l QVideoFrameFormat of the underlying video buffer.
QCGImageVideoBuffer(CGImageRef image)
std::unique_ptr< QPlatformSurfaceCapture > makeQCgWindowCapture()
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType