2

暂停 ExoPlayer 并将我的应用程序置于后台时,我不断收到错误消息。该流包含在服务器端插入的受 Widevine 保护的内容和广告。我怀疑这种受保护和不受保护内容的混合导致了错误,但不知道从哪里开始。将应用程序置于后台并恢复它实际上在未受保护的前贴片广告期间有效一次,但在主要内容中第二次尝试时失败。

SurfaceUtils记录以下消息:native window cannot handle protected buffers: the consumer should either be a hardware composer or support hardware protection

有人知道这实际上意味着什么吗?不幸的是,我对 ExoPlayer 的内部运作不太熟悉。

返回错误的代码在SurfaceUtils.cpp这里可能会有所帮助:

// Make sure to check whether either Stagefright or the video decoder
// requested protected buffers.
if (usage & GRALLOC_USAGE_PROTECTED) {
    // Check if the ANativeWindow sends images directly to SurfaceFlinger.
    int queuesToNativeWindow = 0;
    err = nativeWindow->query(
            nativeWindow, NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER, &queuesToNativeWindow);
    if (err != NO_ERROR) {
        ALOGE("error authenticating native window: %s (%d)", strerror(-err), -err);
        return err;
    }
    // Check if the consumer end of the ANativeWindow can handle protected content.
    int isConsumerProtected = 0;
    err = nativeWindow->query(
            nativeWindow, NATIVE_WINDOW_CONSUMER_IS_PROTECTED, &isConsumerProtected);
    if (err != NO_ERROR) {
        ALOGE("error query native window: %s (%d)", strerror(-err), -err);
        return err;
    }
    // Deny queuing into native window if neither condition is satisfied.
    if (queuesToNativeWindow != 1 && isConsumerProtected != 1) {
        ALOGE("native window cannot handle protected buffers: the consumer should either be a hardware composer or support hardware protection");
        return PERMISSION_DENIED;
    }
}
4

0 回答 0