| Предыдущий | Следующий |
| TPC_E_INITIALIZE_FAIL | VFW_E_NOT_STOPPED |
VFW_E_STATE_CHANGED
Практический смысл
VFW_E_STATE_CHANGED (0X80040223) — результат DirectShow. Исходное описание: AllStat records its meaning as “The state changed while waiting to process the sample”.
. Не объединяйте этот код с соседними VFW_E_*: диагностическая граница задаётся конкретным состоянием ниже.
Конкретные признаки контракта
- Evidence to collect
Capture 1 for this result: state before and after the wait, including transition timestamps.
- Evidence to collect
Capture 2 for this result: streaming thread, control thread and flush events.
- Evidence to collect
Capture 3 for this result: sample identity, timestamp and graph generation.
- Correction and retry boundary
Corrective action 2 for this result: treat state change as cancellation rather than sample corruption.
- Likely causes
Possible cause 3 for this result: application control and streaming callbacks race on filter state.
- Correction and retry boundary
Corrective action 3 for this result: discard or requeue work according to the new state.
- Difference from nearby HRESULTs
VFW_E_WRONG_STATE means an operation begins in an unsuitable state; it means the state changed while work was already waiting. Keep these outcomes separate in logs, exception mappings, user messages, dashboards and automated retry policy.
Что проверить в trace
Сохраните exact method, filter CLSID/friendly name, connected pins, media type, graph state и generation, clock/rate либо sample timestamps, если они участвуют в этой операции. Для persisted data дополнительно фиксируйте offending field или byte range, а для renderer/device path — выбранный hardware capability.
Как отделить этот случай от соседних
Сопоставьте каждый приведённый выше признак с фактическим вызовом. Если условие из исходного контракта не выполняется, не переносите recovery от другого VFW-кода. Если после rebuild или re-enumeration результат исчезает, отдельно проверьте stale object, race и изменение topology.
Исправление и подтверждение
Меняйте только подтверждённую причину: входной параметр, media type, timing, filter connection, renderer/device capability, persisted field или текущее состояние graph. После изменения повторите тот же минимальный сценарий и сравните topology и первый HRESULT до и после исправления.
Технические ссылки
- Microsoft: DirectShow error and success codes.
- Microsoft: IMediaControl.
- Microsoft: DirectShow media samples.
Нужно найти другой код? Найти другой код состояния или ошибки.