Loading media/libstagefright/SurfaceUtils.cpp +13 −3 Original line number Original line Diff line number Diff line Loading @@ -91,9 +91,19 @@ status_t setNativeWindowSizeFormatAndUsage( return err; return err; } } // Check if the ANativeWindow uses hardware protected buffers. // Check if the consumer end of the ANativeWindow can handle protected content. if (queuesToNativeWindow != 1 && !(consumerUsage & GRALLOC_USAGE_PROTECTED)) { int isConsumerProtected = 0; ALOGE("native window could not be authenticated"); 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; return PERMISSION_DENIED; } } } } Loading Loading
media/libstagefright/SurfaceUtils.cpp +13 −3 Original line number Original line Diff line number Diff line Loading @@ -91,9 +91,19 @@ status_t setNativeWindowSizeFormatAndUsage( return err; return err; } } // Check if the ANativeWindow uses hardware protected buffers. // Check if the consumer end of the ANativeWindow can handle protected content. if (queuesToNativeWindow != 1 && !(consumerUsage & GRALLOC_USAGE_PROTECTED)) { int isConsumerProtected = 0; ALOGE("native window could not be authenticated"); 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; return PERMISSION_DENIED; } } } } Loading