Preserve video format notifications before capture starts
Confirm the requested format before clearing stale audio and video frame notifications. Validation: SDK Release built with the current worktree; staged whitespace check passed.
This commit is contained in:
@@ -452,14 +452,13 @@ namespace gvfg::internal
|
||||
const gvfg_status_t openStatus = ensure_vendor_channel_open();
|
||||
if (openStatus != GVFG_OK)
|
||||
return openStatus;
|
||||
#ifndef NDEBUG
|
||||
if (events_.hVideoFormatChangedEvent &&
|
||||
WaitForSingleObject(events_.hVideoFormatChangedEvent, 0) == WAIT_OBJECT_0)
|
||||
OutputDebugStringA("[GVFG] Received VIDEO_FORMAT_CHANGED (before start reset)\n");
|
||||
#endif
|
||||
const gvfg_status_t resetStatus = from_vendor(GvfgResetEvents(&events_), "GvfgResetEvents");
|
||||
if (resetStatus != GVFG_OK)
|
||||
return resetStatus;
|
||||
// Clear stale frame notifications without consuming format or input events.
|
||||
for (HANDLE frameEvent : {events_.hVideoFrameInEvent, events_.hVideoExtraFrame,
|
||||
events_.hAudioFrameInEvent, events_.hAudioExtraFrame})
|
||||
{
|
||||
if (frameEvent && !ResetEvent(frameEvent))
|
||||
return reject(GVFG_EIO, "Capture frame event reset failed");
|
||||
}
|
||||
configured_ = true;
|
||||
return GVFG_OK;
|
||||
}
|
||||
|
||||
@@ -354,9 +354,6 @@ struct gvfg_channel_session_t
|
||||
if (!session)
|
||||
return reject(GVFG_ESTATE, "configure stream rejected: channel is not open");
|
||||
|
||||
const gvfg_status_t st = session->configure_stream();
|
||||
if (st != GVFG_OK)
|
||||
return st;
|
||||
const gvfg_status_t signalStatus = querySignal();
|
||||
if (signalStatus != GVFG_OK)
|
||||
return signalStatus;
|
||||
@@ -366,7 +363,7 @@ struct gvfg_channel_session_t
|
||||
return reject(GVFG_ETIMEOUT,
|
||||
"gvfg_start_channel rejected: no input signal");
|
||||
}
|
||||
return GVFG_OK;
|
||||
return session->configure_stream();
|
||||
}
|
||||
|
||||
gvfg_status_t readFrame(gvfg_frame_t &out, uint32_t timeoutMs,
|
||||
|
||||
Reference in New Issue
Block a user