QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GStreamerFrameMap.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtMultimedia/QVideoFrame>
4#include <QtMultimedia/QVideoFrameFormat>
5#include <gst/gst.h>
6#include <gst/video/video-info.h>
7#include <gst/video/video.h>
8
10
12
13QVideoFrameFormat::ColorSpace toQtColorSpace(GstVideoColorMatrix matrix);
14QVideoFrameFormat::ColorTransfer toQtColorTransfer(GstVideoTransferFunction transfer);
15QVideoFrameFormat::PixelFormat toQtPixelFormat(GstVideoFormat fmt);
16QVideoFrameFormat::ColorRange toQtColorRange(GstVideoColorRange range);
17
19void applyOrientationToFrame(QVideoFrame& frame, GstVideoOrientationMethod method);
20
23void applyOrientationAndTiming(QVideoFrame& frame, GstBuffer* buffer, int streamOrientation);
24
27void applyColorimetry(QVideoFrameFormat& format, const GstVideoInfo& info, GstCaps* caps);
28
30QVideoFrameFormat applyCropMeta(QVideoFrameFormat format, GstBuffer* buffer);
31
35{
36 QVideoFrame frame;
37 enum class Source
38 {
39 Cpu,
40 Gpu
42#if defined(QGC_HAS_ANY_GPU_PATH)
44 bool demoted = false;
45#endif
46};
47
48MappedFrame mapSampleToFrame(GstBuffer* buffer, GstCaps* caps, const GstVideoInfo& info,
49 const QVideoFrameFormat& format, const HwVideoBufferContext& hwContext,
50 HwResolvedPathCache* pathCache = nullptr) noexcept;
MappedFrame mapSampleToFrame(GstBuffer *buffer, GstCaps *caps, const GstVideoInfo &info, const QVideoFrameFormat &format, const HwVideoBufferContext &hwContext, HwResolvedPathCache *pathCache=nullptr) noexcept
QVideoFrameFormat::PixelFormat toQtPixelFormat(GstVideoFormat fmt)
QVideoFrameFormat::ColorTransfer toQtColorTransfer(GstVideoTransferFunction transfer)
QVideoFrameFormat applyCropMeta(QVideoFrameFormat format, GstBuffer *buffer)
Apply video crop meta to format's viewport. Pass-through when no crop meta present.
void applyColorimetry(QVideoFrameFormat &format, const GstVideoInfo &info, GstCaps *caps)
QVideoFrameFormat::ColorSpace toQtColorSpace(GstVideoColorMatrix matrix)
Sample-to-frame helpers for qgcqvideosink's show_frame; pure functions, streaming-thread safe.
void applyOrientationAndTiming(QVideoFrame &frame, GstBuffer *buffer, int streamOrientation)
void applyOrientationToFrame(QVideoFrame &frame, GstVideoOrientationMethod method)
Apply rotation + mirror flags derived from GstVideoOrientationMethod.
QVideoFrameFormat::ColorRange toQtColorRange(GstVideoColorRange range)
HwVideoBufferPath
Identifies which GPU path was chosen; used by the adapter to increment the right counter.
Platform context for the factory; encapsulates EGL handles so callers don't need path-specific ifdefs...
QVideoFrame frame
enum MappedFrame::Source source