miqt/qt/multimedia/gen_qvideosurfaceformat.cpp

169 lines
5.3 KiB
C++
Raw Normal View History

2024-11-04 23:15:32 +13:00
#include <QByteArray>
#include <QList>
#include <QRect>
#include <QSize>
#include <QVariant>
#include <QVideoSurfaceFormat>
#include <qvideosurfaceformat.h>
#include "gen_qvideosurfaceformat.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
2024-11-04 23:15:32 +13:00
2024-12-07 17:15:57 +13:00
QVideoSurfaceFormat* QVideoSurfaceFormat_new() {
return new QVideoSurfaceFormat();
2024-11-04 23:15:32 +13:00
}
2024-12-07 17:15:57 +13:00
QVideoSurfaceFormat* QVideoSurfaceFormat_new2(QSize* size, int pixelFormat) {
return new QVideoSurfaceFormat(*size, static_cast<QVideoFrame::PixelFormat>(pixelFormat));
2024-11-04 23:15:32 +13:00
}
2024-12-07 17:15:57 +13:00
QVideoSurfaceFormat* QVideoSurfaceFormat_new3(QVideoSurfaceFormat* format) {
return new QVideoSurfaceFormat(*format);
2024-11-04 23:15:32 +13:00
}
2024-12-07 17:15:57 +13:00
QVideoSurfaceFormat* QVideoSurfaceFormat_new4(QSize* size, int pixelFormat, int handleType) {
return new QVideoSurfaceFormat(*size, static_cast<QVideoFrame::PixelFormat>(pixelFormat), static_cast<QAbstractVideoBuffer::HandleType>(handleType));
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_operatorAssign(QVideoSurfaceFormat* self, QVideoSurfaceFormat* format) {
2024-11-04 23:15:32 +13:00
self->operator=(*format);
}
2025-02-01 13:45:16 +13:00
bool QVideoSurfaceFormat_operatorEqual(const QVideoSurfaceFormat* self, QVideoSurfaceFormat* format) {
return (*self == *format);
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
bool QVideoSurfaceFormat_operatorNotEqual(const QVideoSurfaceFormat* self, QVideoSurfaceFormat* format) {
return (*self != *format);
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
bool QVideoSurfaceFormat_isValid(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return self->isValid();
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_pixelFormat(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
QVideoFrame::PixelFormat _ret = self->pixelFormat();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_handleType(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
QAbstractVideoBuffer::HandleType _ret = self->handleType();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
QSize* QVideoSurfaceFormat_frameSize(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return new QSize(self->frameSize());
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setFrameSize(QVideoSurfaceFormat* self, QSize* size) {
2024-11-04 23:15:32 +13:00
self->setFrameSize(*size);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setFrameSize2(QVideoSurfaceFormat* self, int width, int height) {
2024-11-04 23:15:32 +13:00
self->setFrameSize(static_cast<int>(width), static_cast<int>(height));
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_frameWidth(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return self->frameWidth();
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_frameHeight(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return self->frameHeight();
}
2025-02-01 13:45:16 +13:00
QRect* QVideoSurfaceFormat_viewport(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return new QRect(self->viewport());
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setViewport(QVideoSurfaceFormat* self, QRect* viewport) {
2024-11-04 23:15:32 +13:00
self->setViewport(*viewport);
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_scanLineDirection(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
QVideoSurfaceFormat::Direction _ret = self->scanLineDirection();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setScanLineDirection(QVideoSurfaceFormat* self, int direction) {
2024-11-04 23:15:32 +13:00
self->setScanLineDirection(static_cast<QVideoSurfaceFormat::Direction>(direction));
}
2025-02-01 13:45:16 +13:00
double QVideoSurfaceFormat_frameRate(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
qreal _ret = self->frameRate();
return static_cast<double>(_ret);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setFrameRate(QVideoSurfaceFormat* self, double rate) {
2024-11-04 23:15:32 +13:00
self->setFrameRate(static_cast<qreal>(rate));
}
2025-02-01 13:45:16 +13:00
QSize* QVideoSurfaceFormat_pixelAspectRatio(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return new QSize(self->pixelAspectRatio());
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setPixelAspectRatio(QVideoSurfaceFormat* self, QSize* ratio) {
2024-11-04 23:15:32 +13:00
self->setPixelAspectRatio(*ratio);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setPixelAspectRatio2(QVideoSurfaceFormat* self, int width, int height) {
2024-11-04 23:15:32 +13:00
self->setPixelAspectRatio(static_cast<int>(width), static_cast<int>(height));
}
2025-02-01 13:45:16 +13:00
int QVideoSurfaceFormat_yCbCrColorSpace(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
QVideoSurfaceFormat::YCbCrColorSpace _ret = self->yCbCrColorSpace();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setYCbCrColorSpace(QVideoSurfaceFormat* self, int colorSpace) {
2024-11-04 23:15:32 +13:00
self->setYCbCrColorSpace(static_cast<QVideoSurfaceFormat::YCbCrColorSpace>(colorSpace));
}
2025-02-01 13:45:16 +13:00
bool QVideoSurfaceFormat_isMirrored(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return self->isMirrored();
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setMirrored(QVideoSurfaceFormat* self, bool mirrored) {
2024-11-04 23:15:32 +13:00
self->setMirrored(mirrored);
}
2025-02-01 13:45:16 +13:00
QSize* QVideoSurfaceFormat_sizeHint(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
return new QSize(self->sizeHint());
}
2025-02-01 13:45:16 +13:00
struct miqt_array /* of struct miqt_string */ QVideoSurfaceFormat_propertyNames(const QVideoSurfaceFormat* self) {
2024-11-04 23:15:32 +13:00
QList<QByteArray> _ret = self->propertyNames();
// Convert QList<> from C++ memory to manually-managed C memory
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
QByteArray _lv_qb = _ret[i];
struct miqt_string _lv_ms;
_lv_ms.len = _lv_qb.length();
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
memcpy(_lv_ms.data, _lv_qb.data(), _lv_ms.len);
_arr[i] = _lv_ms;
}
struct miqt_array _out;
_out.len = _ret.length();
_out.data = static_cast<void*>(_arr);
return _out;
}
2025-02-01 13:45:16 +13:00
QVariant* QVideoSurfaceFormat_property(const QVideoSurfaceFormat* self, const char* name) {
2024-11-04 23:15:32 +13:00
return new QVariant(self->property(name));
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_setProperty(QVideoSurfaceFormat* self, const char* name, QVariant* value) {
2024-11-04 23:15:32 +13:00
self->setProperty(name, *value);
}
2025-02-01 13:45:16 +13:00
void QVideoSurfaceFormat_delete(QVideoSurfaceFormat* self) {
delete self;
2024-11-04 23:15:32 +13:00
}