Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 616b4d83e35eb3e6bad52c0db85f6b9f28bf0144
      
https://github.com/WebKit/WebKit/commit/616b4d83e35eb3e6bad52c0db85f6b9f28bf0144
  Author: Enrique Ocaña González <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M Source/WebCore/platform/GStreamer.cmake
    M Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp

  Log Message:
  -----------
  [EME][OpenCDM] Querying robustness level from CDM instead of hardcoding the 
levels
https://bugs.webkit.org/show_bug.cgi?id=322180

Reviewed by Nikolas Zimmermann.

A new OpenCDM API (optional at build time) is now available to query
supported robustness levels directly from the CDM, instead of having
them hardcoded. CDMPrivateThunder::supportedRobustnesses() should be
update to use that new API when it's available, but ensuring backwards
compatibility when not.

This patch checks uses the new API (when available) to get a dynamically
allocated array of strings with the different robustness levels
supported. That array must be freed by the callee. Unfortunately, the
way in which the opencdm_system_supported_robustness() API call is
defined, it forces us to use unsafe pointer arithmetic, because the
compiler can't ensure that buffers actually have a length of count.
We do know the assumption about buffers' length is true, so we use an
unsafe span as the less bad way to keep the unsafeness contained.

For a detailed explanation of how the safety restrictions work, see:
https://clang.llvm.org/docs/SafeBuffers.html

Original author: Krishna Priya Kanagaraj <[email protected]>

* Source/WebCore/platform/GStreamer.cmake: Detect if 
opencdm_system_supported_robustness() exists and set the 
THUNDER_HAS_OCDM_SUPPORTED_ROBUSTNESS preprocessor define to 1 or 0 accordingly.
* Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMPrivateThunder::supportedRobustnesses const): Query the OpenCDM 
robustness API when available, get the answer into a Vector and return it, 
freeing the underlying data structure returned by the API.

Canonical link: https://commits.webkit.org/319531@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to