Closed Bug 1962030 Opened 20 days ago Closed 13 days ago

[wmfme] Prevent CDM shutdown after MFMediaEngineParent is shut down in order to enable CDM reuse

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(3 files)

Our current implementation shutdowns MFCDM after MFMediaEngineParent is destroyed. However, the CDM could be reused again for another MFMediaEngineParent, so we should keep the CDM alive, and only destroy it when the MFCDMParent is shutdown.

MFCDMParent represents a CDM instance, which is not necessarily tied to
a single playback session. A CDM can be reused across multiple
playbacks—for example, after playback A ends, a web author can use the
same CDM instance to create a new key session for playback B.

Therefore, the CDM should only be destroyed when MFCDMParent is shut
down, to support proper reuse.

Depends on D246523

Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/105b0988a161 part1 : delay destruction of CDM and MFCDMProxy until MFCDMParent is shut down to enable CDM reuse. r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/6638bf9e0f9c part2 : add test. r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/ef68762fe949 part3 : correct debug log definition for WMF clearkey. r=media-playback-reviewers,padenot

Backed out for causing build bustages on MFMediaSource.cpp.

[task 2025-04-29T17:58:43.019Z] 17:58:43     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/dom/media/platforms/wmf'
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -fms-compatibility-version=19.39 -std:c++17 --target=aarch64-windows-msvc -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml -FoUnified_cpp_media_platforms_wmf0.obj -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf,nochecks -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DMOZ_SUPPORT_LEAKCHECKING -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/dom/media/platforms/wmf -I/builds/worker/workspace/obj-build/dom/media/platforms/wmf -I/builds/worker/checkouts/gecko/dom/media/ipc -I/builds/worker/checkouts/gecko/gfx/cairo/cairo/src -I/builds/worker/checkouts/gecko/media/libyuv/libyuv/include -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -MD -DMOZILLA_CLIENT -FI /builds/worker/workspace/obj-build/mozilla-config.h -Zc:sizedDealloc- -Gy -Zc:inline -Gw -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -TP -GR- -D_HAS_EXCEPTIONS=0 -fcrash-diagnostics-dir=/builds/worker/artifacts -Z7 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -Werror -W3 -Wbitfield-enum-conversion -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wenum-compare-conditional -Wenum-float-conversion -Wvolatile -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-microsoft-exception-spec -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fno-strict-aliasing -Xclang -ffp-contract=off  -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_media_platforms_wmf0.obj.pp -Xclang -MT -Xclang Unified_cpp_media_platforms_wmf0.obj   Unified_cpp_media_platforms_wmf0.cpp
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -  In file included from Unified_cpp_media_platforms_wmf0.cpp:65:
[task 2025-04-29T17:58:43.024Z] 17:58:43    ERROR -  /builds/worker/checkouts/gecko/dom/media/platforms/wmf/MFMediaSource.cpp(293,3): error: use of undeclared identifier 'mCDMProxy'
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -    293 |   mCDMProxy = nullptr;
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -        |   ^
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -  1 error generated.
[task 2025-04-29T17:58:43.024Z] 17:58:43    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:675: Unified_cpp_media_platforms_wmf0.obj] Error 1
[task 2025-04-29T17:58:43.024Z] 17:58:43     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/dom/media/platforms/wmf'
Flags: needinfo?(alwu)
Flags: needinfo?(alwu)
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e11ddd6edbd2 part1 : delay destruction of CDM and MFCDMProxy until MFCDMParent is shut down to enable CDM reuse. r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/9dca9a485b42 part2 : add test. r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/51942e172e04 part3 : correct debug log definition for WMF clearkey. r=media-playback-reviewers,padenot
Regressions: 1963473
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: