commit | 9f036cc34a1f213adb3862f939bb9269f2078a42 | [log] [tgz] |
---|---|---|
author | Xiaohan Wang <xhwang@chromium.org> | Wed May 16 19:40:54 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed May 16 19:40:54 2018 |
tree | 838d4aaeae623d02d750ab55c0314021283b4bc5 | |
parent | 09303a143182fecda7b43faa1eb355be325e202d [diff] |
media: Only allow CDM setting in initial init in MediaCodecVideoDecoder Even though a new |cdm_context| is passed in re-initialization, the current MediaCodecVideoDecoder (MCVD) code assumes SetCdm() only happens in the first initialization. Instead of trying to fix MCVD to support setting CDM on a later config change, we'll only allow CDM setting in the initial initialization. More precisely: - SetCdm() is only triggered in initial initialization, if |cdm_context| is non-null, even if the initial config is clear. - In a re-initialization, if the config is encrypted, and we don't have a MediaCrypto already, we'll simply fail, even if a non-null |cdm_context| is passed in. For the reference, "Support of switching [between clear and encrypted] when MediaKeys is set after the playback starts, [or ...], is a quality of implementation issue" [1]. We may apply this to our media pipeline and all decoders to simplify our code. The cost for a JS player to setMediaKeys() before playback starts is really minimal (no need to even start license exchange). There are some other changes in this CL: - Fix AVDA so that if MediaCrytoContext is not available but the stream, is clear, we'll not try to initialize CDM. - Misc logging fixes based on media logging guidance [2]. [1] https://github.com/w3c/encrypted-media/pull/374/files [2] https://chromium.googlesource.com/chromium/src/+/master/media/README.md#logging Bug: 840586 Test: Manually tested switching from clear to encrypted H264. Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I584a21dc992ae8bf13794b9310cb2a549e73bade Reviewed-on: https://chromium-review.googlesource.com/1056490 Reviewed-by: Frank Liberato <liberato@chromium.org> Commit-Queue: Xiaohan Wang <xhwang@chromium.org> Cr-Commit-Position: refs/heads/master@{#559234}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .