fix(media): recover sharing from initialization failures
## Problem and outcome / ????? Windows Auto could reject startup because it benchmarked the only remaining VP8 path after hardware encoding failed. Start that ordinary fallback directly; keep comparison only when it can choose between usable encoders. Browser peer construction failures now reach their existing preparation/recovery owners, while constructors release tracks they acquired before throwing. Native event timeout text no longer assumes which encoder event was missing. ## Release notes ### ?? ?????????????????? - ?? Windows ????????????????????????????????????? - ????????????????????????????????????? - ?????????????????????????????? ???????????????????????????????????? ### English This patch improves sharing startup and connection recovery. - Fixes Windows automatic codec selection failing to start when an unnecessary software benchmark fails after hardware encoding is unavailable. - Fixes some browser media-connection initialization failures not reaching the existing failure or recovery flow. - Releases video tracks left behind by failed initialization and clarifies native encoder timeout diagnostics. These fixes passed local validation. Device- or network-specific sharing failures still require evidence from the affected environment. ## Verification / ?? - npm run check: 76 test files / 1,115 tests, TypeScript and production Web build passed. - Windows capture build and deterministic native checks passed, including proved-H264 retention and software-only fallback under a failed/expired optional comparison. The old implementation fails the new fallback check. - Fault-injected hardware-unavailable and exhausted-probe-budget paths both captured a synthetic window and produced decoded 1920?1080 VP8 frames, followed by clean process/port/profile retirement. - Browser regressions cover construction failures, exact connection identity, existing recovery budgets, prepared-candidate replacement and owned-track cleanup. Ordinary Host rebuild keeps the existing Viewer recovery owner. - Documentation and repository hygiene checks passed. npm run check:go-core passed; Darwin cgo remains assigned to the native macOS packaging runner. CI also verifies race checks and all platform packages. ## Impact / ?? Compatible patch release v1.6.5; no wire, storage, room authority, retry-policy or quality-adaptation change. Source diagnostics stay ignored and private. The complete v1.6.3 reporter exports narrow failure stages but do not establish the affected machine's root cause. No interaction or room-voice feature is included. A matching Server restart interrupts process-owned media; routine atomic deployment keeps the pre-cutover binary through bounded postflight.
This commit is contained in:
1 parent
383f3656c7
commit
04cbb2c9f4
14 files changed
+269
-90
No files matched your search
@@ -1268,13 +1268,13 @@ struct VideoEncoderSelection final {
|
||||
template <typename Measure>
|
||||
VideoEncoderSelection CompareSoftwareEncoder(std::unique_ptr<VideoEncoder> hardware,
|
||||
std::optional<double> hardware_work, EncoderClock::time_point deadline, Measure measure) {
|
||||
// No comparison is needed when only the ordinary VP8 path remains.
|
||||
if (!hardware_work) return {};
|
||||
try {
|
||||
RequireEncoderTime(deadline);
|
||||
const double software_work = measure();
|
||||
if (!hardware_work || software_work <= *hardware_work) return {};
|
||||
} catch (const std::exception&) {
|
||||
if (!hardware_work) throw;
|
||||
}
|
||||
if (software_work <= *hardware_work) return {};
|
||||
} catch (const std::exception&) {}
|
||||
// The deadline bounds new probing, not reuse of an already-proved encoder.
|
||||
return {OutputKind::h264, std::move(hardware)};
|
||||
}
|
||||
@@ -1368,7 +1368,6 @@ VideoEncoderSelection SelectVideoEncoder(
|
||||
device = DeviceContext{};
|
||||
}
|
||||
if (!device.device) {
|
||||
RequireEncoderTime(deadline);
|
||||
device = CreateDevice(SelectAdapter(adapters, arguments.adapter_index));
|
||||
}
|
||||
return CompareSoftwareEncoder(std::move(hardware), hardware_work, deadline, [&] {
|
||||
|
||||
Reference in new issue
Block a user