return TRUE;
} else {
int bytesPerLine = 0;
- QVideoSurfaceFormat format = formatForCaps(caps, &bytesPerLine);
+ QGstBufferPoolInterface *pool = sink->delegate->pool();
+ QAbstractVideoBuffer::HandleType handleType =
+ pool ? pool->handleType() : QAbstractVideoBuffer::NoHandle;
+
+ QVideoSurfaceFormat format = formatForCaps(caps, &bytesPerLine, handleType);
if (sink->delegate->isActive()) {
QVideoSurfaceFormat surfaceFormst = sink->delegate->surfaceFormat();
return FALSE;
}
-QVideoSurfaceFormat QVideoSurfaceGstSink::formatForCaps(GstCaps *caps, int *bytesPerLine)
+QVideoSurfaceFormat QVideoSurfaceGstSink::formatForCaps(GstCaps *caps, int *bytesPerLine, QAbstractVideoBuffer::HandleType handleType)
{
const GstStructure *structure = gst_caps_get_structure(caps, 0);
}
if (pixelFormat != QVideoFrame::Format_Invalid) {
- QVideoSurfaceFormat format(size, pixelFormat);
+ QVideoSurfaceFormat format(size, pixelFormat, handleType);
QPair<int, int> rate;
gst_structure_get_fraction(structure, "framerate", &rate.first, &rate.second);
if (!sink->delegate->isActive()) {
int bytesPerLine = 0;
- QVideoSurfaceFormat format = formatForCaps(intersection, &bytesPerLine);
+ QGstBufferPoolInterface *pool = sink->delegate->pool();
+ QAbstractVideoBuffer::HandleType handleType =
+ pool ? pool->handleType() : QAbstractVideoBuffer::NoHandle;
+
+ QVideoSurfaceFormat format = formatForCaps(intersection, &bytesPerLine, handleType);
if (!sink->delegate->start(format, bytesPerLine)) {
qWarning() << "failed to start video surface";
GstVideoSink parent;
static QVideoSurfaceGstSink *createSink(QAbstractVideoSurface *surface);
- static QVideoSurfaceFormat formatForCaps(GstCaps *caps, int *bytesPerLine = 0);
+ static QVideoSurfaceFormat formatForCaps(GstCaps *caps,
+ int *bytesPerLine = 0,
+ QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle);
static void setFrameTimeStamps(QVideoFrame *frame, GstBuffer *buffer);
static void handleShowPrerollChange(GObject *o, GParamSpec *p, gpointer d);