4#ifndef QGSTVIDEOBUFFER_P_H
5#define QGSTVIDEOBUFFER_P_H
18#include <private/qhwvideobuffer_p.h>
19#include <QtCore/qvariant.h>
21#include <common/qgst_p.h>
22#include <gst/video/video.h>
25class QVideoFrameFormat;
28class QGstVideoBuffer
final :
public QHwVideoBuffer
32 const QVideoFrameFormat &frameFormat);
35 MapData map(QVideoFrame::MapMode mode)
override;
45 const QVideoFrameFormat m_frameFormat;
47 mutable GstVideoFrame m_frame{};
48 const QGstBufferHandle m_buffer;
49 QVideoFrame::MapMode m_mode = QVideoFrame::NotMapped;
50#if QT_CONFIG(gstreamer_gl_egl)
51 Qt::HANDLE m_eglDisplay =
nullptr;
52 QFunctionPointer m_eglImageTargetTexture2D =
nullptr;
QGObjectHandlerConnection(QGstObject object, gulong handler)
~QGObjectHandlerScopedConnection()
QGObjectHandlerScopedConnection(QGObjectHandlerConnection connection)
std::optional< int > toInt64() const
std::optional< QGRange< int > > toIntRange() const
std::optional< int > toInt() const
QGstStructureView toStructure() const
std::optional< QGRange< float > > getFractionRange() const
const char * toString() const
std::optional< float > getFraction() const
QGValue at(int index) const
std::optional< bool > toBool() const
QGstSampleHandle pullSample()
void setCallbacks(GstAppSinkCallbacks &callbacks, gpointer user_data, GDestroyNotify notify)
GstAppSink * appSink() const
void setCaps(const QGstCaps &caps)
static QGstAppSink create(const char *name)
QGstAppSink(GstAppSink *, RefMode)
static QGstAppSrc create(const char *name)
GstFlowReturn pushBuffer(GstBuffer *)
void setCallbacks(GstAppSrcCallbacks &callbacks, gpointer user_data, GDestroyNotify notify)
QGstAppSrc(GstAppSrc *, RefMode)
GstAppSrc * appSrc() const
QGstBaseSink(GstBaseSink *, RefMode)
GstBaseSink * baseSink() const
QGstBaseSrc(GstBaseSrc *, RefMode)
GstBaseSrc * baseSrc() const
void addUnlinkedGhostPads(GstPadDirection)
void dumpGraph(const char *fileNamePrefix, bool includeTimestamp=true) const
QGstElement findByName(const char *)
void recalculateLatency()
static QGstBin create(const char *name)
void addGhostPad(const QGstElement &child, const char *name)
static QGstBin createFromPipelineDescription(const char *pipelineDescription, const char *name=nullptr, bool ghostUnlinkedPads=false)
static QGstBin createFromFactory(const char *factory, const char *name)
void addGhostPad(const char *name, const QGstPad &pad)
QGstBin(GstBin *bin, RefMode mode=NeedsRef)
MemoryFormat memoryFormat() const
std::optional< QGstVideoInfo > videoInfo() const
static QGstCaps fromCameraFormat(const QCameraFormat &format)
void setResolution(QSize)
void addPixelFormats(const QList< QVideoFrameFormat::PixelFormat > &formats, const char *capsFeatures=nullptr)
QGstStructureView at(int index) const
QGstClock(GstClock *clock, RefMode mode)
GstClockTime time() const
QGstClock(const QGstObject &o)
void setBaseTime(GstClockTime time) const
GstStateChangeReturn setState(GstState state)
std::optional< std::chrono::nanoseconds > position() const
GstElement * element() const
QGstElement(GstElement *element, RefMode mode)
void lockState(bool locked)
QGstBin getRootBin() const
QGstPad getRequestPad(const char *name) const
std::optional< bool > canSeek() const
std::optional< std::chrono::nanoseconds > duration() const
bool isStateLocked() const
void sendEvent(GstEvent *event) const
void dumpPipelineGraph(const char *filename) const
GstClockTime baseTime() const
QByteArrayView factoryName() const
void releaseRequestPad(const QGstPad &pad) const
bool syncStateWithParent()
QGstPad staticPad(const char *name) const
QGstBin getParentBin() const
std::optional< std::chrono::milliseconds > positionInMs() const
static QGstElement createFromFactory(const char *factory, const char *name=nullptr)
QGstElement getParent() const
QGstPipeline getPipeline() const
static QGstElement createFromPipelineDescription(const char *)
std::optional< std::chrono::milliseconds > durationInMs() const
void set(const char *property, double d)
QGObjectHandlerConnection connect(const char *name, GCallback callback, gpointer userData)
void * getObject(const char *property) const
double getDouble(const char *property) const
int getInt(const char *property) const
void set(const char *property, int32_t i)
QLatin1StringView name() const
void set(const char *property, const QGstObject &o)
QGString getString(const char *property) const
void disconnect(gulong handlerId)
QGstObject getGstObject(const char *property) const
QLatin1StringView typeName() const
void set(const char *property, const char *str)
bool getBool(const char *property) const
QGstObject & operator=(QGstObject &&) noexcept=default
void set(const char *property, void *object, GDestroyNotify destroyFunction)
void set(const char *property, bool b)
quint64 getUInt64(const char *property) const
QGstStructureView getStructure(const char *property) const
qint64 getInt64(const char *property) const
void set(const char *property, const QGstCaps &c)
float getFloat(const char *property) const
uint getUInt(const char *property) const
GstObject * object() const
bool link(const QGstPad &sink) const
GstEvent * stickyEvent(GstEventType type)
QGstTagListHandle tags() const
QGstPad(const QGstObject &o)
QGstCaps queryCaps() const
QGstPad(GstPad *pad, RefMode mode)
void sendFlushStartStop(bool resetTime)
QGString streamId() const
std::optional< QPlatformMediaPlayer::TrackType > inferTrackTypeFromName() const
bool sendEvent(GstEvent *event)
QGstCaps currentCaps() const
QGstElement parent() const
bool unlink(const QGstPad &sink) const
QGstStructureView(const QUniqueGstStructureHandle &)
QGRange< float > frameRateRange() const
QGValue operator[](const char *fieldname) const
QUniqueGstStructureHandle clone() const
QList< QVideoFrameFormat::PixelFormat > pixelFormats() const
std::optional< QGRange< QSize > > resolutionRange() const
QGstreamerMessage getMessage()
std::optional< Fraction > pixelAspectRatio() const
QGstTagListHandle tags() const
QByteArrayView name() const
QGstStructureView(const GstStructure *)
QGstVideoBuffer(QGstBufferHandle buffer, const QGstVideoInfo &videoInfo, const QVideoFrameFormat &frameFormat)
~QGstVideoBuffer() override
bool isDmaBuf() const override
QVideoFrameTexturesUPtr mapTextures(QRhi &, QVideoFrameTexturesUPtr &) override
GstBuffer * gstBuffer() const
void unmap() override
Releases the memory mapped by the map() function.
MapData map(QVideoFrame::MapMode mode) override
Maps the planes of a video buffer to memory.
QSize qCalculateFrameSizeGStreamer(QSize resolution, Fraction par)
Combined button and popup list for selecting options.
constexpr std::array< VideoFormat, 19 > qt_videoFormatLookup
QGstCaps::MemoryFormat qMemoryFormatFromGstBuffer(GstBuffer *buffer)
QVideoFrameFormat qVideoFrameFormatFromGstVideoInfo(const QGstVideoInfo &vidInfo)
#define QT_GSTREAMER_SUPPORTS_GST_VIDEO_FORMAT_DMA_DRM
GstVideoFormat qGstVideoFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format)
QString qGstErrorMessageCannotFindElement(std::string_view element)
QVideoFrame qCreateFrameFromGstBuffer(QGstBufferHandle buffer, const QGstVideoInfo &videoInfo)
QVideoFrameFormat::PixelFormat qPixelFormatFromGstVideoFormat(GstVideoFormat format)