• Bug#1108891: kodi-inputstream-adaptive: Trixie version of inputstream-a

    From Mark@21:1/5 to All on Mon Jul 7 01:50:01 2025
    Package: kodi-inputstream-adaptive
    Version: 21.5.9+ds-1
    Severity: wishlist
    X-Debbugs-Cc: [email protected]

    Dear Maintainer,

    Trixie currently includes kodi-inputstream-adaptive 21.5.9+ds-1, which crashes with Widevine CDM 4.10.2891.0. The fix was pushed in inputstream-adaptive 21.5.13-Omega, https://github.com/xbmc/inputstream.adaptive/releases/tag/21.5.13-Omega
    but since Kodi on Debian seems to use its own packaged inputstream-adaptive rather than one downloaded as a Kodi addon, it is currently impossible to playback most DRM-protected video in Trixie.

    I suspect this is part of the headache of fitting a fast-moving program like Kodi into the Debian release system, but is there any way of this patch to kodi-inputstream-adaptive making it into Trixie?

    Thanks,
    Mark




    -- System Information:
    Debian Release: 13.0
    APT prefers testing-security
    APT policy: (500, 'testing-security'), (500, 'testing')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.12.33+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
    Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8), LANGUAGE=en_NZ:en
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages kodi-inputstream-adaptive depends on:
    ii kodi [kodi-api-inputstream] 2:21.2+dfsg-4
    ii libatomic1 14.2.0-19
    ii libc6 2.41-9
    ii libgcc-s1 14.2.0-19
    ii libpugixml1v5 1.14-2
    ii libstdc++6 14.2.0-19
    ii libwebm1 1.0.0.31-1+b2

    kodi-inputstream-adaptive recommends no packages.

    kodi-inputstream-adaptive suggests no packages.

    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian Ramacher@21:1/5 to Vasyl Gello on Fri Aug 1 20:30:01 2025
    XPost: linux.debian.devel.release

    On 2025-07-15 21:07:56 +0300, Vasyl Gello wrote:
    Package: kodi-inputstream-adaptive
    Version: 21.5.9+ds-1
    Followup-For: Bug #1108891
    X-Debbugs-Cc: [email protected]

    Hi Mark,

    Thanks for pointing this out! My analysis shows that the CDM fix
    was more or less sorted out in 21.5.15+ds-1 that I have prepared
    for upload.

    The test DEB for you is: http://temp.sh/XXsbF/kodi-inputstream-adaptive_21.5.15ds-1_amd64.deb

    Please confirm that everything works (or does not work) for you now.

    CC'ing #debian-release team with a broader question: since all Kodi
    and addon point releases for 21.x are bugfix-only, is it possible to
    get chromium-style approval for src:kodi and src:kodi-* in Debian 13?

    That would solve ton of user woes and, basically, that was my ideal
    when I started the maintainership back in 2020.

    For the record, I attach the debdiff between current version in trixie (21.5.9+ds-1) and the fixed (21.5.15+ds-1). It is quite big (250 KB)
    because of clang-format run during the backport. However it is all
    backport of a bugfix, therefore I barely see the reason to add the
    actual patch sequence to debian/patches compared to new version upload.

    Dear colleagues from release team, what do you think?

    It's too late now, but for the future: best way to get input from us is
    via unblock (pre-approval) requests. Mails to the mailing list have a
    high chance to be missed.

    Cheers


    Sincerely,
    Vasyl

    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/azure-pipelines.yml kodi-inputstream-adaptive-21.5.15+ds/azure-pipelines.yml
    --- kodi-inputstream-adaptive-21.5.9+ds/azure-pipelines.yml 2025-01-19 09:11:59.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/azure-pipelines.yml 2025-07-06 07:54:23.000000000 +0000
    @@ -39,11 +39,11 @@
    ARCHITECTURE: x64
    CONFIGURATION: Release
    WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0"
    - ARM32-UWP:
    - GENERATOR: "Visual Studio 17 2022"
    - ARCHITECTURE: ARM
    - CONFIGURATION: Release
    - WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0"
    + #ARM32-UWP:
    + # GENERATOR: "Visual Studio 17 2022"
    + # ARCHITECTURE: ARM
    + # CONFIGURATION: Release
    + # WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0"
    #ARM64-UWP:
    # GENERATOR: "Visual Studio 17 2022"
    # ARCHITECTURE: ARM64
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/debian/changelog kodi-inputstream-adaptive-21.5.15+ds/debian/changelog
    --- kodi-inputstream-adaptive-21.5.9+ds/debian/changelog 2025-01-27 08:45:13.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/debian/changelog 2025-07-15 16:51:54.000000000 +0000
    @@ -1,3 +1,9 @@
    +kodi-inputstream-adaptive (21.5.15+ds-1) unstable; urgency=high
    +
    + * New upstream version 21.5.15+ds (Closes: #1108891)
    +
    + -- Vasyl Gello <[email protected]> Tue, 15 Jul 2025 16:51:54 +0000
    +
    kodi-inputstream-adaptive (21.5.9+ds-1) unstable; urgency=high

    * New upstream version 21.5.9+ds
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/depends/common/pugixml/flags.txt kodi-inputstream-adaptive-21.5.15+ds/depends/common/pugixml/flags.txt
    --- kodi-inputstream-adaptive-21.5.9+ds/depends/common/pugixml/flags.txt 1970-01-01 00:00:00.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/depends/common/pugixml/flags.txt 2025-07-06 07:54:23.000000000 +0000
    @@ -0,0 +1 @@
    +-DCMAKE_POLICY_VERSION_MINIMUM=3.5
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/depends/common/rapidjson/flags.txt kodi-inputstream-adaptive-21.5.15+ds/depends/common/rapidjson/flags.txt
    --- kodi-inputstream-adaptive-21.5.9+ds/depends/common/rapidjson/flags.txt 2025-01-19 09:11:59.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/depends/common/rapidjson/flags.txt 2025-07-06 07:54:23.000000000 +0000
    @@ -1 +1 @@
    --DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_CXX17=ON -DRAPIDJSON_HAS_STDSTRING=ON
    +-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_CXX17=ON -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/inputstream.adaptive/addon.xml.in kodi-inputstream-adaptive-21.5.15+ds/inputstream.adaptive/addon.xml.in
    --- kodi-inputstream-adaptive-21.5.9+ds/inputstream.adaptive/addon.xml.in 2025-01-19 09:11:59.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/inputstream.adaptive/addon.xml.in 2025-07-06 07:54:23.000000000 +0000
    @@ -1,7 +1,7 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <addon
    id="inputstream.adaptive"
    - version="21.5.9"
    + version="21.5.15"
    name="InputStream Adaptive"
    provider-name="peak3d, Team Kodi">
    <requires>@ADDON_DEPENDS@</requires>
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/inputstream.adaptive/changelog.txt kodi-inputstream-adaptive-21.5.15+ds/inputstream.adaptive/changelog.txt
    --- kodi-inputstream-adaptive-21.5.9+ds/inputstream.adaptive/changelog.txt 2025-01-19 09:11:59.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/inputstream.adaptive/changelog.txt 2025-07-06 07:54:23.000000000 +0000
    @@ -1,3 +1,26 @@
    +v21.5.15 (2025-07-06)
    +- Fix playback with IP with port number
    +
    +v21.5.14 (2025-05-15)
    +- Fix playback problem due to URLs containing dots on paths
    +
    +v21.5.13 (2025-05-04)
    +- Fix crash with Widevine CDM 4.10.2891.0
    +- [Widevine] Updated CDM interface
    +
    +v21.5.12 (2025-04-27)
    +- [Dash] Fix SegmentTemplate TSB to prevent use extra live delay workarounds +
    +v21.5.11 (2025-04-15)
    +- Fix live delay that was causing broken playback in some cases
    +
    +v21.5.10 (2025-04-06)
    +- INFO: Widevine CDM 4.10.2891.0 cannot be used to play videos, if you installed it reinstall an old version
    +- [ClearKey] Fix playback with streams that have mixed unencrypted/encrypted segments
    +- [HLS] Fix timeshift on single period video stream
    +- [HLS] Fix possible repeated frames on live stream with discontinuities
    +- Fix playback with SMIL URL manifests
    +
    v21.5.9 (2025-01-19)
    - Fix packaging errors

    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/debug.cpp kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/debug.cpp
    --- kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/debug.cpp 1970-01-01 00:00:00.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/debug.cpp 2025-07-06 07:54:23.000000000 +0000
    @@ -0,0 +1,57 @@
    +/*
    + * Copyright (C) 2025 Team Kodi
    + * This file is part of Kodi - https://kodi.tv
    + *
    + * SPDX-License-Identifier: GPL-2.0-or-later
    + * See LICENSES/README.md for more information.
    + */
    +
    +#include "debug.h"
    +
    +#include <cstdarg>
    +#include <cstdio>
    +
    +#ifdef _MSC_VER
    +#define snprintf _snprintf
    +#endif
    +
    +struct dbgContext
    +{
    + const char* name;
    + void (*msgCallback)(const CDM_DBG::LogLevel level, const char* msg);
    +};
    +
    +dbgContext debugContext = {"WV-CDM-Library", nullptr};
    +
    +void CDM_DBG::Log(const CDM_DBG::LogLevel level, const char* format, ...)
    +{
    + if (!debugContext.msgCallback)
    + return;
    +
    + char msg[2048];
    + const int len = snprintf(msg, sizeof(msg), "[%s] ", debugContext.name);
    + if (len < 0 || len >= sizeof(msg))
    + {
    + debugContext.msgCallback(CDM_DBG::LogLevel::ERROR,
    + "Cannot print log string: Context name too long");
    + return;
    + }
    +
    + va_list ap;
    + va_start(ap, format);
    + const int formattedLen = vsnprintf(msg + len, sizeof(msg) - len, format, ap);
    + va_end(ap);
    + if (formattedLen < 0 || formattedLen >= (sizeof(msg) - len))
    + {
    + debugContext.msgCallback(CDM_DBG::LogLevel::ERROR,
    + "Cannot print log string: Text content too long");
    + return;
    + }
    +
    + debugContext.msgCallback(level, msg);
    +}
    +
    +void CDM_DBG::SetDBGMsgCallback(void (*msgcb)(const CDM_DBG::LogLevel level, const char* msg))
    +{
    + debugContext.msgCallback = msgcb;
    +}
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/debug.h kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/debug.h
    --- kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/debug.h 1970-01-01 00:00:00.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/debug.h 2025-07-06 07:54:23.000000000 +0000
    @@ -0,0 +1,27 @@
    +/*
    + * Copyright (C) 2025 Team Kodi
    + * This file is part of Kodi - https://kodi.tv
    + *
    + * SPDX-License-Identifier: GPL-2.0-or-later
    + * See LICENSES/README.md for more information.
    + */
    +
    +#pragma once
    +
    +namespace CDM_DBG
    +{
    +enum class LogLevel
    +{
    + DEBUG,
    + INFO,
    + WARNING,
    + ERROR,
    + FATAL
    +};
    +
    +void Log(const LogLevel level, const char* format, ...);
    +#define LogF(level, format, ...) Log((level), ("%s: " format), __FUNCTION__, ##__VA_ARGS__)
    +
    +void SetDBGMsgCallback(void (*msgcb)(const LogLevel level, const char* msg));
    +
    +} // namespace cdm
    diff -Nru kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/media/cdm/api/content_decryption_module.h kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/media/cdm/api/content_decryption_module.h
    --- kodi-inputstream-adaptive-21.5.9+ds/lib/cdm/cdm/media/cdm/api/content_decryption_module.h 2025-01-19 09:11:59.000000000 +0000
    +++ kodi-inputstream-adaptive-21.5.15+ds/lib/cdm/cdm/media/cdm/api/content_decryption_module.h 2025-07-06 07:54:23.000000000 +0000
    @@ -12,7 +12,6 @@
    #include <type_traits>

    #include "content_decryption_module_export.h"
    -#include "content_decryption_module_proxy.h"

    #if defined(_MSC_VER)
    typedef unsigned char uint8_t;
    @@ -51,1731 +50,1728 @@

    extern "C" {

    - CDM_API void INITIALIZE_CDM_MODULE();
    +CDM_API void INITIALIZE_CDM_MODULE();

    - CDM_API void DeinitializeCdmModule();
    +CDM_API void DeinitializeCdmModule();

    - // Returns a pointer to the requested CDM Host interface upon success.
    - // Returns NULL if the requested CDM Host interface is not supported.
    - // The caller should cast the returned pointer to the type matching
    - // |host_interface_version|.
    - typedef void* (*GetCdmHostFunc)(int host_interface_version, void* user_data);
    -
    - // Returns a pointer to the requested CDM upon success.
    - // Returns NULL if an error occurs or the requested |cdm_interface_version| or
    - // |key_system| is not supported or another error occurs.
    - // The caller should cast the returned pointer to the type matching
    - // |cdm_interface_version|.
    - // Caller retains ownership of arguments and must call Destroy() on the returned
    - // object.
    - CDM_API void* CreateCdmInstance(int cdm_interface_version,
    - const char* key_system,
    - uint32_t key_system_size,
    - GetCdmHostFunc get_cdm_host_func,
    - void* user_data);
    +// Returns a pointer to the requested CDM Host interface upon success.
    +// Returns NULL if the requested CDM Host interface is not supported.
    +// The caller should cast the returned pointer to the type matching
    +// |host_interface_version|.
    +typedef void* (*GetCdmHostFunc)(int host_interface_version, void* user_data);
    +
    +// Returns a pointer to the requested CDM upon success.
    +// Returns NULL if an error occurs or the requested |cdm_interface_version| or
    +// |key_system| is not supported or another error occurs.
    +// The caller should cast the returned pointer to the type matching
    +// |cdm_interface_version|.
    +// Caller retains ownership of arguments and must call Destroy() on the returned
    +// object.
    +CDM_API void* CreateCdmInstance(int cdm_interface_version,
    + const char* key_system,
    + uint32_t key_system_size,
    + GetCdmHostFunc get_cdm_host_func,
    + void* user_data);

    - CDM_API const char* GetCdmVersion();
    +CDM_API const char* GetCdmVersion();

    } // extern "C"

    namespace cdm {

    - enum Status : uint32_t {
    - kSuccess = 0,
    - kNeedMoreData, // Decoder needs more data to produce a decoded frame/sample.
    - kNoKey, // The required decryption key is not available.
    - kInitializationError, // Initialization error.
    - kDecryptError, // Decryption failed.
    - kDecodeError, // Error decoding audio or video.
    - kDeferredInitialization // Decoder is not ready for initialization.
    - };
    - CHECK_TYPE(Status, 4, 4);
    -
    - // Exceptions used by the CDM to reject promises.
    - // https://w3c.github.io/encrypted-media/#exceptions
    - enum Exception : uint32_t {
    - kExceptionTypeError,
    - kExceptionNotSupportedError,
    - kExceptionInvalidStateError,
    - kExceptionQuotaExceededError
    - };
    - CHECK_TYPE(Exception, 4, 4);
    -
    - // The encryption scheme. The definitions are from ISO/IEC 23001-7:2016.
    - enum class EncryptionScheme : uint32_t {
    - kUnencrypted = 0,
    - kCenc, // 'cenc' subsample encryption using AES-CTR mode.
    - kCbcs // 'cbcs' pattern encryption using AES-CBC mode.
    - };
    - CHECK_TYPE(EncryptionScheme, 4, 4);
    -
    - // The pattern used for pattern encryption. Note that ISO/IEC 23001-7:2016 - // defines each block to be 16-bytes.
    - struct Pattern {
    - uint32_t crypt_byte_block; // Count of the encrypted blocks.
    - uint32_t skip_byte_block; // Count of the unencrypted blocks.
    - };
    - CHECK_TYPE(Pattern, 8, 8);
    -
    - enum class ColorRange : uint8_t {
    - kInvalid,
    - kLimited, // 709 color range with RGB values ranging from 16 to 235.
    - kFull, // Full RGB color range with RGB values from 0 to 255.
    - kDerived // Range is defined by |transfer_id| and |matrix_id|.
    - };
    - CHECK_TYPE(ColorRange, 1, 1);
    -
    - // Described in ISO 23001-8:2016, section 7. All the IDs are in the range - // [0, 255] so 8-bit integer is sufficient. An unspecified ColorSpace should be
    - // {2, 2, 2, ColorRange::kInvalid}, where value 2 means "Unspecified" for all
    - // the IDs, as defined by the spec.
    - struct ColorSpace {
    - uint8_t primary_id; // 7.1 colour primaries, table 2
    - uint8_t transfer_id; // 7.2 transfer characteristics, table 3
    - uint8_t matrix_id; // 7.3 matrix coefficients, table 4
    - ColorRange range;
    - };
    - CHECK_TYPE(ColorSpace, 4, 4);
    -
    - // Time is defined as the number of seconds since the Epoch
    - // (00:00:00 UTC, January 1, 1970), not including any added leap second.
    - // Also see Time definition in spec: https://w3c.github.io/encrypted-media/#time
    - // Note that Time is defined in millisecond accuracy in the spec but in second
    - // accuracy here.
    - typedef double Time;
    -
    - // An input buffer can be split into several continuous subsamples.
    - // A SubsampleEntry specifies the number of clear and cipher bytes in each - // subsample. For example, the following buffer has three subsamples:
    - //
    - // |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
    - // | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 |
    - //
    - // For decryption, all of the cipher bytes in a buffer should be concatenated
    - // (in the subsample order) into a single logical stream. The clear bytes should
    - // not be considered as part of decryption.
    - //
    - // Stream to decrypt: | cipher1 | cipher2 | cipher3 |
    - // Decrypted stream: | decrypted1| decrypted2 | decrypted3 |
    - //
    - // After decryption, the decrypted bytes should be copied over the position
    - // of the corresponding cipher bytes in the original buffer to form the output
    - // buffer. Following the above example, the decrypted buffer should be: +enum Status : uint32_t {
    + kSuccess = 0,
    + kNeedMoreData, // Decoder needs more data to produce a decoded frame/sample.
    + kNoKey, // The required decryption key is not available.
    + kInitializationError, // Initialization error.
    + kDecryptError, // Decryption failed.
    + kDecodeError, // Error decoding audio or video.
    + kDeferredInitialization // Decoder is not ready for initialization.
    +};
    +CHECK_TYPE(Status, 4, 4);
    +
    +// Exceptions used by the CDM to reject promises.
    +// https://w3c.github.io/encrypted-media/#exceptions
    +enum Exception : uint32_t {
    + kExceptionTypeError,
    + kExceptionNotSupportedError,
    + kExceptionInvalidStateError,
    + kExceptionQuotaExceededError
    +};
    +CHECK_TYPE(Exception, 4, 4);
    +
    +// The encryption scheme. The definitions are from ISO/IEC 23001-7:2016. +enum class EncryptionScheme : uint32_t {
    + kUnencrypted = 0,
    + kCenc, // 'cenc' subsample encryption using AES-CTR mode.
    + kCbcs // 'cbcs' pattern encryption using AES-CBC mode.
    +};
    +CHECK_TYPE(EncryptionScheme, 4, 4);
    +
    +// The pattern used for pattern encryption. Note that ISO/IEC 23001-7:2016 +// defines each block to be 16-bytes.
    +struct Pattern {
    + uint32_t crypt_byte_block; // Count of the encrypted blocks.
    + uint32_t skip_byte_block; // Count of the unencrypted blocks.
    +};
    +CHECK_TYPE(Pattern, 8, 8);
    +
    +enum class ColorRange : uint8_t {
    + kInvalid,
    + kLimited, // 709 color range with RGB values ranging from 16 to 235.
    + kFull, // Full RGB color range with RGB values from 0 to 255.
    + kDerived // Range is defined by |transfer_id| and |matrix_id|.
    +};
    +CHECK_TYPE(ColorRange, 1, 1);
    +
    +// Described in ISO 23001-8:2016, section 7. All the IDs are in the range +// [0, 255] so 8-bit integer is sufficient. An unspecified ColorSpace should be
    +// {2, 2, 2, ColorRange::kInvalid}, where value 2 means "Unspecified" for all
    +// the IDs, as defined by the spec.
    +struct ColorSpace {
    + uint8_t primary_id; // 7.1 colour primaries, table 2
    + uint8_t transfer_id; // 7.2 transfer characteristics, table 3
    + uint8_t matrix_id; // 7.3 matrix coefficients, table 4
    + ColorRange range;
    +};
    +CHECK_TYPE(ColorSpace, 4, 4);
    +
    +// Time is defined as the number of seconds since the Epoch
    +// (00:00:00 UTC, January 1, 1970), not including any added leap second.
    +// Also see Time definition in spec: https://w3c.github.io/encrypted-media/#time
    +// Note that Time is defined in millisecond accuracy in the spec but in second
    +// accuracy here.
    +typedef double Time;
    +
    +// An input buffer can be split into several continuous subsamples.
    +// A SubsampleEntry specifies the number of clear and cipher bytes in each +// subsample. For example, the following buffer has three subsamples:
    +//
    +// |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
    +// | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 |
    +//
    +// For decryption, all of the cipher bytes in a buffer should be concatenated
    +// (in the subsample order) into a single logical stream. The clear bytes should
    +// not be considered as part of decryption.
    +//
    +// Stream to decrypt: | cipher1 | cipher2 | cipher3 |
    +// Decrypted stream: | decrypted1| decrypted2 | decrypted3 |
    +//
    +// After decryption, the decrypted bytes should be copied over the position +// of the corresponding cipher bytes in the original buffer to form the output
    +// buffer. Following the above example, the decrypted buffer should be:
    +//
    +// |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
    +// | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 |
    +//
    +struct SubsampleEntry {
    + uint32_t clear_bytes;
    + uint32_t cipher_bytes;
    +};
    +CHECK_TYPE(SubsampleEntry, 8, 8);
    +
    +// Represents an input buffer to be decrypted (and possibly decoded). It does
    +// not own any pointers in this struct. If |encryption_scheme| = kUnencrypted,
    +// the data is unencrypted.
    +// Note that this struct is organized so that sizeof(InputBuffer_2)
    +// equals the sum of sizeof() all members in both 32-bit and 64-bit compiles.
    +// Padding has been added to keep the fields aligned.
    +struct InputBuffer_2 {
    + const uint8_t* data; // Pointer to the beginning of the input data.
    + uint32_t data_size; // Size (in bytes) of |data|.
    +
    + EncryptionScheme encryption_scheme;
    +
    + const uint8_t* key_id; // Key ID to identify the decryption key.
    + uint32_t key_id_size; // Size (in bytes) of |key_id|.
    + uint32_t : 32; // Padding.
    +
    + const uint8_t* iv; // Initialization vector.
    + uint32_t iv_size; // Size (in bytes) of |iv|.
    + uint32_t : 32; // Padding.
    +
    + const struct SubsampleEntry* subsamples;
    + uint32_t num_subsamples; // Number of subsamples in |subsamples|.
    + uint32_t : 32; // Padding.
    +
    + // |pattern| is required if |encryption_scheme| specifies pattern encryption.
    + Pattern pattern;
    +
    + int64_t timestamp; // Presentation timestamp in microseconds.
    +};
    +CHECK_TYPE(InputBuffer_2, 64, 80);
    +
    +enum AudioCodec : uint32_t { kUnknownAudioCodec = 0, kCodecVorbis, kCodecAac };
    +CHECK_TYPE(AudioCodec, 4, 4);
    +
    +struct AudioDecoderConfig_2 {
    + AudioCodec codec;
    + int32_t channel_count;
    + int32_t bits_per_channel;
    + int32_t samples_per_second;
    +
    + // Optional byte data required to initialize audio decoders, such as the
    + // vorbis setup header.
    + uint8_t* extra_data;
    + uint32_t extra_data_size;
    +
    + // Encryption scheme.
    + EncryptionScheme encryption_scheme;
    +};
    +CHECK_TYPE(AudioDecoderConfig_2, 28, 32);
    +
    +// Supported sample formats for AudioFrames.
    +enum AudioFormat : uint32_t {
    + kUnknownAudioFormat = 0, // Unknown format value. Used for error reporting.
    + kAudioFormatU8, // Interleaved unsigned 8-bit w/ bias of 128.
    + kAudioFormatS16, // Interleaved signed 16-bit.
    + kAudioFormatS32, // Interleaved signed 32-bit.
    + kAudioFormatF32, // Interleaved float 32-bit.
    + kAudioFormatPlanarS16, // Signed 16-bit planar.
    + kAudioFormatPlanarF32, // Float 32-bit planar.
    +};
    +CHECK_TYPE(AudioFormat, 4, 4);
    +
    +// Surface formats based on FOURCC labels, see: http://www.fourcc.org/yuv.php
    +// Values are chosen to be consistent with Chromium's VideoPixelFormat values.
    +enum VideoFormat : uint32_t {
    + kUnknownVideoFormat = 0, // Unknown format value. Used for error reporting.
    + kYv12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples.
    + kI420 = 2, // 12bpp YUV planar 1x1 Y, 2x2 UV samples.
    +
    + // In the following formats, each sample uses 16-bit in storage, while the + // sample value is stored in the least significant N bits where N is
    + // specified by the number after "P". For example, for YUV420P9, each Y, U,
    + // and V sample is stored in the least significant 9 bits in a 2-byte block.
    + kYUV420P9 = 16,
    + kYUV420P10 = 17,
    + kYUV422P9 = 18,
    + kYUV422P10 = 19,
    + kYUV444P9 = 20,
    + kYUV444P10 = 21,
    + kYUV420P12 = 22,
    + kYUV422P12 = 23,
    + kYUV444P12 = 24,
    +};
    +CHECK_TYPE(VideoFormat, 4, 4);
    +
    +struct Size {
    + int32_t width;
    + int32_t height;
    +};
    +CHECK_TYPE(Size, 8, 8);
    +
    +enum VideoCodec : uint32_t {
    + kUnknownVideoCodec = 0,
    + kCodecVp8,
    + kCodecH264,
    + kCodecVp9,
    + kCodecAv1
    +};
    +CHECK_TYPE(VideoCodec, 4, 4);
    +
    +enum VideoCodecProfile : uint32_t {
    + kUnknownVideoCodecProfile = 0,
    + kProfileNotNeeded,
    + kH264ProfileBaseline,
    + kH264ProfileMain,
    + kH264ProfileExtended,
    + kH264ProfileHigh,
    + kH264ProfileHigh10,
    + kH264ProfileHigh422,
    + kH264ProfileHigh444Predictive,
    + kVP9Profile0,
    + kVP9Profile1,
    + kVP9Profile2,
    + kVP9Profile3,
    + kAv1ProfileMain,
    + kAv1ProfileHigh,
    + kAv1ProfilePro
    +};
    +CHECK_TYPE(VideoCodecProfile, 4, 4);
    +
    +// Deprecated: New CDM implementations should use VideoDecoderConfig_3.
    +// Note that this struct is organized so that sizeof(VideoDecoderConfig_2) +// equals the sum of sizeof() all members in both 32-bit and 64-bit compiles.
    +// Padding has been added to keep the fields aligned.
    +struct VideoDecoderConfig_2 {
    + VideoCodec codec;
    + VideoCodecProfile profile;
    + VideoFormat format;
    + uint32_t : 32; // Padding.
    +
    + // Width and height of video frame immediately post-decode. Not all pixels + // in this region are valid.
    + Size coded_size;
    +
    + // Optional byte data required to initialize video decoders, such as H.264 + // AAVC data.
    + uint8_t* extra_data;
    + uint32_t extra_data_size;
    +
    + // Encryption scheme.
    + EncryptionScheme encryption_scheme;
    +};
    +CHECK_TYPE(VideoDecoderConfig_2, 36, 40);
    +
    +struct VideoDecoderConfig_3 {
    + VideoCodec codec;
    + VideoCodecProfile profile;
    + VideoFormat format;
    + ColorSpace color_space;
    +
    + // Width and height of video frame immediately post-decode. Not all pixels + // in this region are valid.
    + Size coded_size;
    +
    + // Optional byte data required to initialize video decoders, such as H.264 + // AAVC data.
    + uint8_t* extra_data;
    + uint32_t extra_data_size;
    +
    + EncryptionScheme encryption_scheme;
    +};
    +CHECK_TYPE(VideoDecoderConfig_3, 36, 40);
    +
    +enum StreamType : uint32_t { kStreamTypeAudio = 0, kStreamTypeVideo = 1 }; +CHECK_TYPE(StreamType, 4, 4);
    +
    +// Structure provided to ContentDecryptionModule::OnPlatformChallengeResponse()
    +// after a platform challenge was initiated via Host::SendPlatformChallenge().
    +// All values will be NULL / zero in the event of a challenge failure. +struct PlatformChallengeResponse {
    + // |challenge| provided during Host::SendPlatformChallenge() combined with + // nonce data and signed with the platform's private key.
    + const uint8_t* signed_data;
    + uint32_t signed_data_length;
    +
    + // RSASSA-PKCS1-v1_5-SHA256 signature of the |signed_data| block.
    + const uint8_t* signed_data_signature;
    + uint32_t signed_data_signature_length;
    +
    + // X.509 device specific certificate for the |service_id| requested.
    + const uint8_t* platform_key_certificate;
    + uint32_t platform_key_certificate_length;
    +};
    +CHECK_TYPE(PlatformChallengeResponse, 24, 48);
    +
    +// The current status of the associated key. The valid types are defined in the
    +// spec: https://w3c.github.io/encrypted-media/#dom-mediakeystatus
    +enum KeyStatus : uint32_t {
    + kUsable = 0,
    + kInternalError = 1,
    + kExpired = 2,
    + kOutputRestricted = 3,
    + kOutputDownscaled = 4,
    + kStatusPending = 5,
    + kReleased = 6
    +};
    +CHECK_TYPE(KeyStatus, 4, 4);
    +
    +// The current status of the associated key. The valid types are defined in the
    +// spec: https://w3c.github.io/encrypted-media/#dom-mediakeystatus
    +// Note: For forward compatibility, Host implementations must gracefully handle
    +// unexpected (new) enum values, e.g. no-op. This is used by the CDM Interfaces
    +// starting from CDM_12.
    +enum class KeyStatus_2 : uint32_t {
    + kUsable = 0,
    + kInternalError = 1,
    + kExpired = 2,
    + kOutputRestricted = 3,
    + kOutputDownscaled = 4,
    + kStatusPending = 5,
    + kReleased = 6,
    + kUsableInFuture = 7
    +};
    +CHECK_TYPE(KeyStatus_2, 4, 4);
    +
    +// Used when passing arrays of key information. Does not own the referenced +// data. |system_code| is an additional error code for unusable keys and
    +// should be 0 when |status| == kUsable.
    +struct KeyInformation {
    + const uint8_t* key_id;
    + uint32_t key_id_size;
    + KeyStatus status;
    + uint32_t system_code;
    +};
    +CHECK_TYPE(KeyInformation, 16, 24);
    +
    +// Used when passing arrays of key information. Does not own the referenced +// data. |system_code| is an additional error code for unusable keys and
    +// should be 0 when |status| == kUsable. Used by CDM12 and beyond.
    +struct KeyInformation_2 {
    + const uint8_t* key_id;
    + uint32_t key_id_size;
    + KeyStatus_2 status;
    + uint32_t system_code;
    +};
    +CHECK_TYPE(KeyInformation_2, 16, 24);
    +
    +// Supported output protection methods for use with EnableOutputProtection() and
    +// returned by OnQueryOutputProtectionStatus().
    +enum OutputProtectionMethods : uint32_t {
    + kProtectionNone = 0,
    + kProtectionHDCP = 1 << 0
    +};
    +CHECK_TYPE(OutputProtectionMethods, 4, 4);
    +
    +// Connected output link types returned by OnQueryOutputProtectionStatus(). +enum OutputLinkTypes : uint32_t {
    + kLinkTypeNone = 0,
    + kLinkTypeUnknown = 1 << 0,
    + kLinkTypeInternal = 1 << 1,
    + kLinkTypeVGA = 1 << 2,
    + kLinkTypeHDMI = 1 << 3,
    + kLinkTypeDVI = 1 << 4,
    + kLinkTypeDisplayPort = 1 << 5,
    + kLinkTypeNetwork = 1 << 6
    +};
    +CHECK_TYPE(OutputLinkTypes, 4, 4);
    +
    +// Result of the QueryOutputProtectionStatus() call.
    +enum QueryResult : uint32_t { kQuerySucceeded = 0, kQueryFailed }; +CHECK_TYPE(QueryResult, 4, 4);
    +
    +// The Initialization Data Type. The valid types are defined in the spec: +// https://w3c.github.io/encrypted-media/format-registry/initdata/index.html#registry
    +enum InitDataType : uint32_t { kCenc = 0, kKeyIds = 1, kWebM = 2 }; +CHECK_TYPE(InitDataType, 4, 4);
    +
    +// The type of session to create. The valid types are defined in the spec: +// https://w3c.github.io/encrypted-media/#dom-mediakeysessiontype
    +enum SessionType : uint32_t {
    + kTemporary = 0,
    + kPersistentLicense = 1
    +};
    +CHECK_TYPE(SessionType, 4, 4);
    +
    +// The type of the message event. The valid types are defined in the spec: +// https://w3c.github.io/encrypted-media/#dom-mediakeymessagetype
    +enum MessageType : uint32_t {
    + kLicenseRequest = 0,
    + kLicenseRenewal = 1,
    + kLicenseRelease = 2,
    + kIndividualizationRequest = 3
    +};
    +CHECK_TYPE(MessageType, 4, 4);
    +
    +enum HdcpVersion : uint32_t {
    + kHdcpVersionNone,
    + kHdcpVersion1_0,
    + kHdcpVersion1_1,
    + kHdcpVersion1_2,
    + kHdcpVersion1_3,
    + kHdcpVersion1_4,
    + kHdcpVersion2_0,
    + kHdcpVersion2_1,
    + kHdcpVersion2_2,
    + kHdcpVersion2_3
    +};
    +CHECK_TYPE(HdcpVersion, 4, 4);
    +
    +struct Policy {
    + HdcpVersion min_hdcp_version;
    +};
    +CHECK_TYPE(Policy, 4, 4);
    +
    +// Represents a buffer created by Allocator implementations.
    +class CDM_CLASS_API Buffer {
    + public:
    + // Destroys the buffer in the same context as it was created.
    + virtual void Destroy() = 0;
    +
    + virtual uint32_t Capacity() const = 0;
    + virtual uint8_t* Data() = 0;
    + virtual void SetSize(uint32_t size) = 0;
    + virtual uint32_t Size() const = 0;
    +
    + protected:
    + Buffer() {}
    + virtual ~Buffer() {}
    +
    + private:
    + Buffer(const Buffer&);
    + void operator=(const Buffer&);
    +};
    +
    +// Represents a decrypted block that has not been decoded.
    +class CDM_CLASS_API DecryptedBlock {
    + public:
    + virtual void SetDecryptedBuffer(Buffer* buffer) = 0;
    + virtual Buffer* DecryptedBuffer() = 0;
    +
    + // TODO(tomfinegan): Figure out if timestamp is really needed. If it is not,
    + // we can just pass Buffer pointers around.
    + virtual void SetTimestamp(int64_t timestamp) = 0;
    + virtual int64_t Timestamp() const = 0;
    +
    + protected:
    + DecryptedBlock() {}
    + virtual ~DecryptedBlock() {}
    +};
    +
    +// This intentionally avoids using an enum, since it will be used to do math +// with other enums, which is deprecated in C++20.
    +using VideoPlane = uint32_t;
    +constexpr VideoPlane kYPlane = 0;
    +constexpr VideoPlane kUPlane = 1;
    +constexpr VideoPlane kVPlane = 2;
    +constexpr VideoPlane kMaxPlanes = 3;
    +CHECK_TYPE(VideoPlane, 4, 4);
    +
    +class CDM_CLASS_API VideoFrame {
    + public:

    [continued in next message]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)