#include <gst/gst.h>#include <gst/video/video-info.h>#include <gst/video/video.h>#include <QtCore/QRect>#include <QtCore/QSize>#include <QtMultimedia/QVideoFrame>#include <QtMultimedia/QVideoFrameFormat>#include "HwBuffers/HwBuffers.h"#include "HwBuffers/common/CpuVideoFramePool.h"Go to the source code of this file.
Classes | |
| struct | FrameGeometry |
| struct | MappedFrame |
Functions | |
| QVideoFrameFormat::ColorSpace | toQtColorSpace (GstVideoColorMatrix matrix) |
| Sample-to-frame helpers for qgcqvideosink's show_frame; pure functions, streaming-thread safe. | |
| QVideoFrameFormat::ColorTransfer | toQtColorTransfer (GstVideoTransferFunction transfer) |
| QVideoFrameFormat::PixelFormat | toQtPixelFormat (GstVideoFormat fmt) |
| QVideoFrameFormat::ColorRange | toQtColorRange (GstVideoColorRange range) |
| void | applyOrientationToFrame (QVideoFrame &frame, GstVideoOrientationMethod method) |
| Apply rotation + mirror flags derived from GstVideoOrientationMethod. | |
| void | applyOrientationAndTiming (QVideoFrame &frame, GstBuffer *buffer, int streamOrientation) |
The stream's orientation + PTS/duration timing; streamOrientation is GstVideoOrientationMethod cast to int. | |
| void | applyColorimetry (QVideoFrameFormat &format, const GstVideoInfo &info, GstCaps *caps) |
| FrameGeometry | frameGeometry (GstBuffer *buffer, const GstVideoInfo &capsInfo) |
| void | applyFlips (QVideoFrame &frame, const FrameGeometry &geometry) |
Flips frame's picture as geometry tells, ahead of the rotation and mirroring the frame already has. | |
| QVideoFrameFormat | withFrameGeometry (QVideoFrameFormat format, const FrameGeometry &geometry) |
format for frames of geometry: its frame size, with the picture as the viewport. | |
| MappedFrame | mapSampleToFrame (GstBuffer *buffer, GstCaps *caps, const GstVideoInfo &info, const QVideoFrameFormat &format, const HwVideoBufferContext &hwContext, const CpuVideoFramePool::PinnedFrameCounter &pinnedCpuFrames, HwResolvedPathCache *pathCache=nullptr) |
| void applyColorimetry | ( | QVideoFrameFormat & | format, |
| const GstVideoInfo & | info, | ||
| GstCaps * | caps ) |
Set color-space/transfer/range from gst-video colorimetry + HDR (MaxCLL preferred); infers BT.601/709 from height when caps omit it.
Definition at line 147 of file GstQgcFrameMap.cc.
References toQtColorRange(), toQtColorSpace(), and toQtColorTransfer().
Referenced by gst_qgc_q_video_sink_set_caps().
| void applyFlips | ( | QVideoFrame & | frame, |
| const FrameGeometry & | geometry ) |
Flips frame's picture as geometry tells, ahead of the rotation and mirroring the frame already has.
Definition at line 259 of file GstQgcFrameMap.cc.
References FrameGeometry::flipHorizontally, and FrameGeometry::flipVertically.
Referenced by gst_qgc_q_video_sink_show_frame().
| void applyOrientationAndTiming | ( | QVideoFrame & | frame, |
| GstBuffer * | buffer, | ||
| int | streamOrientation ) |
The stream's orientation + PTS/duration timing; streamOrientation is GstVideoOrientationMethod cast to int.
Definition at line 133 of file GstQgcFrameMap.cc.
References applyOrientationToFrame().
Referenced by gst_qgc_q_video_sink_show_frame().
| void applyOrientationToFrame | ( | QVideoFrame & | frame, |
| GstVideoOrientationMethod | method ) |
Apply rotation + mirror flags derived from GstVideoOrientationMethod.
Definition at line 102 of file GstQgcFrameMap.cc.
Referenced by applyOrientationAndTiming().
| FrameGeometry frameGeometry | ( | GstBuffer * | buffer, |
| const GstVideoInfo & | capsInfo ) |
buffer's geometry under caps of capsInfo; the caps' own without any of those metas. An affine meta that also turns, shears or projects is left out.
Definition at line 233 of file GstQgcFrameMap.cc.
References FrameGeometry::frameSize, FrameGeometry::picture, and FrameGeometry::pictureSize.
Referenced by gst_qgc_q_video_sink_show_frame().
| MappedFrame mapSampleToFrame | ( | GstBuffer * | buffer, |
| GstCaps * | caps, | ||
| const GstVideoInfo & | info, | ||
| const QVideoFrameFormat & | format, | ||
| const HwVideoBufferContext & | hwContext, | ||
| const CpuVideoFramePool::PinnedFrameCounter & | pinnedCpuFrames, | ||
| HwResolvedPathCache * | pathCache = nullptr ) |
Definition at line 288 of file GstQgcFrameMap.cc.
References CpuVideoFramePool::copyFromBuffer(), MappedFrame::demoted, MappedFrame::frame, MappedFrame::gpuPath, GstHw::hasCpuLayout(), makeHwVideoBuffer(), MappedFrame::noCpuLayout, None, and CpuVideoFramePool::wrapZeroCopy().
Referenced by gst_qgc_q_video_sink_show_frame().
| QVideoFrameFormat::ColorRange toQtColorRange | ( | GstVideoColorRange | range | ) |
Definition at line 90 of file GstQgcFrameMap.cc.
Referenced by applyColorimetry().
| QVideoFrameFormat::ColorSpace toQtColorSpace | ( | GstVideoColorMatrix | matrix | ) |
Sample-to-frame helpers for qgcqvideosink's show_frame; pure functions, streaming-thread safe.
Definition at line 27 of file GstQgcFrameMap.cc.
References toQtColorSpace().
Referenced by applyColorimetry(), and toQtColorSpace().
| QVideoFrameFormat::ColorTransfer toQtColorTransfer | ( | GstVideoTransferFunction | transfer | ) |
Definition at line 46 of file GstQgcFrameMap.cc.
Referenced by applyColorimetry().
| QVideoFrameFormat::PixelFormat toQtPixelFormat | ( | GstVideoFormat | fmt | ) |
Definition at line 80 of file GstQgcFrameMap.cc.
References GstQgc::kVideoFormatTable.
Referenced by gst_qgc_q_video_sink_set_caps().
| QVideoFrameFormat withFrameGeometry | ( | QVideoFrameFormat | format, |
| const FrameGeometry & | geometry ) |
format for frames of geometry: its frame size, with the picture as the viewport.
Definition at line 280 of file GstQgcFrameMap.cc.
References FrameGeometry::frameSize, and FrameGeometry::picture.
Referenced by gst_qgc_q_video_sink_show_frame().