Refactor GVFG channel and driver access flow

- support only the new vfg100_0821c driver; legacy drivers and IOCTL contracts are intentionally unsupported
- use one SDK handle per physical device with independent CH0/CH1 sessions and selectable event masks
- expose Device Manager friendly names and remove redundant enumerated device indices
- align active capture IOCTLs with the new driver while omitting unsupported OPEN_VIDEO/CLOSE_VIDEO calls
- isolate IOCTL codes, request layouts, and DeviceIoControl calls in the new giga_ioctl DLL
- block reads of pure write-only registers while preserving dual-semantics interrupt status reads
- reduce duplicate signal register queries during open/start
- add zero-copy/copy driver GetFrame timing in microseconds and show it in the preview status
- update public/internal documentation for the revised lifecycle and channel APIs

Validation: static searches and git diff --check only; build intentionally not run.
This commit is contained in:
Mark.lin
2026-08-21 17:52:04 +08:00
parent f783e21476
commit 1574e90b49
21 changed files with 805 additions and 437 deletions
+4 -4
View File
@@ -14,16 +14,16 @@
<mxCell id="copySlot" value="Select writable FrameSlot&#xa;ready=false, in_use=false&#xa;ring pressure may drop oldest unread frame" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#82b366;fontSize=13" vertex="1" parent="1"><mxGeometry x="90" y="370" width="280" height="100" as="geometry"/></mxCell>
<mxCell id="copyGet" value="IOCTL_PCIES2MM_GET_FRAME&#xa;input {channel, 0xFFFFFFFF}&#xa;one copy: driver DMA → slot.data&#xa;GET_VIDEO_DONE_INDEX removed" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#82b366;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="440" y="360" width="280" height="120" as="geometry"/></mxCell>
<mxCell id="copyPublish" value="publish_frame()&#xa;slot.ready=true, in_use=false&#xa;frame_cv_.notify_one()" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#82b366;fontSize=13" vertex="1" parent="1"><mxGeometry x="250" y="520" width="300" height="90" as="geometry"/></mxCell>
<mxCell id="copyRead" value="gvfg_read_frame()&#xa;frame.data = slot.data.data()&#xa;SDK-owned until release" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13" vertex="1" parent="1"><mxGeometry x="90" y="665" width="270" height="95" as="geometry"/></mxCell>
<mxCell id="copyRelease" value="gvfg_release_frame()&#xa;validate token&#xa;slot.in_use=false&#xa;slot reusable" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="450" y="655" width="270" height="105" as="geometry"/></mxCell>
<mxCell id="copyRead" value="gvfg_read_channel_frame()&#xa;frame.data = slot.data.data()&#xa;SDK-owned until release" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13" vertex="1" parent="1"><mxGeometry x="90" y="665" width="270" height="95" as="geometry"/></mxCell>
<mxCell id="copyRelease" value="gvfg_release_channel_frame()&#xa;validate token&#xa;slot.in_use=false&#xa;slot reusable" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="450" y="655" width="270" height="105" as="geometry"/></mxCell>
<mxCell id="zcLane" value="ZERO-COPY MODE — one outstanding driver frame" style="swimlane;html=1;startSize=34;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=17;fontStyle=1" vertex="1" parent="1"><mxGeometry x="830" y="310" width="700" height="500" as="geometry"/></mxCell>
<mxCell id="zcEnable" value="Open device&#xa;ENABLE_FRAME_ZEROCOPY(channel)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#6c8ebf;fontSize=13" vertex="1" parent="1"><mxGeometry x="860" y="365" width="260" height="85" as="geometry"/></mxCell>
<mxCell id="zcHeld" value="frame ready or held?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=13" vertex="1" parent="1"><mxGeometry x="1220" y="355" width="230" height="105" as="geometry"/></mxCell>
<mxCell id="zcAcquire" value="No: ACQUIRE_VIDEO_FRAME_ZEROCOPY&#xa;input {channel, 0xFFFFFFFF}&#xa;output driver-owned pointer&#xa;no SDK payload copy" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#6c8ebf;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="860" y="520" width="300" height="115" as="geometry"/></mxCell>
<mxCell id="zcSkip" value="Yes: skip this acquire event&#xa;keep held driver pointer valid&#xa;no loss statistic or event" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=13" vertex="1" parent="1"><mxGeometry x="1210" y="525" width="270" height="95" as="geometry"/></mxCell>
<mxCell id="zcRead" value="gvfg_read_frame()&#xa;returns driver pointer&#xa;valid until release" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13" vertex="1" parent="1"><mxGeometry x="860" y="675" width="270" height="85" as="geometry"/></mxCell>
<mxCell id="zcRelease" value="gvfg_release_frame()&#xa;validate token&#xa;RELEASE_VIDEO_FRAME(channel)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="1210" y="665" width="290" height="95" as="geometry"/></mxCell>
<mxCell id="zcRead" value="gvfg_read_channel_frame()&#xa;returns driver pointer&#xa;valid until release" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13" vertex="1" parent="1"><mxGeometry x="860" y="675" width="270" height="85" as="geometry"/></mxCell>
<mxCell id="zcRelease" value="gvfg_release_channel_frame()&#xa;validate token&#xa;RELEASE_VIDEO_FRAME(channel)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=13;fontStyle=1" vertex="1" parent="1"><mxGeometry x="1210" y="665" width="290" height="95" as="geometry"/></mxCell>
<mxCell id="consumer" value="Before release: application may preview, convert, record, or copy. Return the frame descriptor unchanged." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=14" vertex="1" parent="1"><mxGeometry x="300" y="855" width="1000" height="60" as="geometry"/></mxCell>
<mxCell id="close" value="Stop / close / exit: release held frame first; zero-copy sends DISABLE_FRAME_ZEROCOPY(channel), then closes device" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1" vertex="1" parent="1"><mxGeometry x="450" y="960" width="700" height="70" as="geometry"/></mxCell>