Enable zero-copy through the public API before opening the device and configure a driver-owned zero-copy ring slot. Return every delivered frame through IOCTL_GIGA_RELEASE_VIDEO_FRAME and validate the complete frame token before release. Preserve ownership when the release IOCTL fails so stop, close, or the next start can retry instead of discarding the driver pointer. Stop DMA and join the backend acquire/event thread before draining frames, preventing acquire from racing stop or disable. Drain caller-held, ready, unread, and pending zero-copy frames before stop, restart, disable, device close, or process destruction. Block restart and zero-copy disable when outstanding frames cannot be released successfully. Release unread frames on signal unplug and before format or resolution changes rebuild the frame ring. Propagate stop and release errors through the public API and report release failures in the standalone preview. Document zero-copy ownership, lifecycle requirements, diagnostics, and data flow. Verified with Standalone Debug and Release builds.
173 lines
4.4 KiB
XML
173 lines
4.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>MainWindow</class>
|
|
<widget class="QWidget" name="MainWindow">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>960</width>
|
|
<height>640</height>
|
|
</rect>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>GVFG Qt Preview Sample</string>
|
|
</property>
|
|
<layout class="QGridLayout" name="gridLayout">
|
|
<item row="0" column="0">
|
|
<layout class="QHBoxLayout" name="topLayout">
|
|
<item>
|
|
<widget class="QLabel" name="deviceLabel">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>86</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>86</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="text">
|
|
<string>Device:</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QComboBox" name="deviceCombo"/>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="refreshButton">
|
|
<property name="text">
|
|
<string>Refresh</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="openButton">
|
|
<property name="text">
|
|
<string>Open Device</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="startButton">
|
|
<property name="text">
|
|
<string>Start</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="stopButton">
|
|
<property name="text">
|
|
<string>Stop</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="showPreviewButton">
|
|
<property name="toolTip">
|
|
<string>Available after capture receives its first video frame</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Open view window</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="fullscreenPreviewButton">
|
|
<property name="toolTip">
|
|
<string>Available after capture receives its first video frame</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Fullscreen window</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item row="1" column="0">
|
|
<layout class="QHBoxLayout" name="formatLayout">
|
|
<item>
|
|
<widget class="QLabel" name="outputFormatLabel">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>86</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>86</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="text">
|
|
<string>Output format:</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QComboBox" name="outputFormatCombo">
|
|
<property name="toolTip">
|
|
<string>Requested capture output format</string>
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
<string>YUY2 (8-bit 4:2:2)</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Y210 (10-bit 4:2:2)</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QCheckBox" name="zeroCopyCheckBox">
|
|
<property name="toolTip">
|
|
<string>Must be selected before opening the device</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Zero-copy</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<spacer name="formatSpacer">
|
|
<property name="orientation">
|
|
<enum>Qt::Orientation::Horizontal</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>40</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="statusLabel">
|
|
<property name="text">
|
|
<string>Idle</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="0">
|
|
<widget class="QPlainTextEdit" name="logEdit">
|
|
<property name="readOnly">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<resources/>
|
|
<connections/>
|
|
</ui>
|