Loading libs/gui/ISurfaceComposer.cpp +23 −2 Original line number Diff line number Diff line Loading @@ -681,6 +681,18 @@ public: result = reply.readUint64Vector(&outStats->component_3_sample); return result; } virtual status_t getProtectedContentSupport(bool* outSupported) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); remote()->transact(BnSurfaceComposer::GET_PROTECTED_CONTENT_SUPPORT, data, &reply); bool result; status_t err = reply.readBool(&result); if (err == NO_ERROR) { *outSupported = result; } return err; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1017,7 +1029,7 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace)); reply->writeInt32(static_cast<int32_t>(wideColorGamutPixelFormat)); } return NO_ERROR; return error; } case GET_COLOR_MANAGEMENT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Loading @@ -1026,7 +1038,7 @@ status_t BnSurfaceComposer::onTransact( if (error == NO_ERROR) { reply->writeBool(result); } return result; return error; } case GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Loading Loading @@ -1110,6 +1122,15 @@ status_t BnSurfaceComposer::onTransact( } return result; } case GET_PROTECTED_CONTENT_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); bool result; status_t error = getProtectedContentSupport(&result); if (error == NO_ERROR) { reply->writeBool(result); } return error; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/include/gui/ISurfaceComposer.h +7 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,12 @@ public: virtual status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames, uint64_t timestamp, DisplayedFrameStats* outStats) const = 0; /* * Gets whether SurfaceFlinger can support protected content in GPU composition. * Requires the ACCESS_SURFACE_FLINGER permission. */ virtual status_t getProtectedContentSupport(bool* outSupported) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -350,6 +356,7 @@ public: GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES, SET_DISPLAY_CONTENT_SAMPLING_ENABLED, GET_DISPLAYED_CONTENT_SAMPLE, GET_PROTECTED_CONTENT_SUPPORT, }; virtual status_t onTransact(uint32_t code, const Parcel& data, Loading libs/gui/tests/Surface_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -655,7 +655,8 @@ public: return NO_ERROR; } virtual status_t getColorManagement(bool* /*outGetColorManagement*/) const { return NO_ERROR; } status_t getColorManagement(bool* /*outGetColorManagement*/) const override { return NO_ERROR; } status_t getProtectedContentSupport(bool* /*outSupported*/) const override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading services/surfaceflinger/SurfaceFlinger.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -1153,6 +1153,14 @@ status_t SurfaceFlinger::getDisplayedContentSample(const sp<IBinder>& displayTok outStats); } status_t SurfaceFlinger::getProtectedContentSupport(bool* outSupported) const { if (!outSupported) { return BAD_VALUE; } *outSupported = getRenderEngine().supportsProtectedContent(); return NO_ERROR; } status_t SurfaceFlinger::enableVSyncInjections(bool enable) { postMessageSync(new LambdaMessage([&] { Mutex::Autolock _l(mStateLock); Loading Loading @@ -5004,7 +5012,8 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) { case SET_TRANSACTION_STATE: case CREATE_CONNECTION: case GET_COLOR_MANAGEMENT: case GET_COMPOSITION_PREFERENCE: { case GET_COMPOSITION_PREFERENCE: case GET_PROTECTED_CONTENT_SUPPORT: { return OK; } case CAPTURE_LAYERS: Loading services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ private: status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames, uint64_t timestamp, DisplayedFrameStats* outStats) const override; status_t getProtectedContentSupport(bool* outSupported) const override; /* ------------------------------------------------------------------------ * DeathRecipient interface Loading Loading
libs/gui/ISurfaceComposer.cpp +23 −2 Original line number Diff line number Diff line Loading @@ -681,6 +681,18 @@ public: result = reply.readUint64Vector(&outStats->component_3_sample); return result; } virtual status_t getProtectedContentSupport(bool* outSupported) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); remote()->transact(BnSurfaceComposer::GET_PROTECTED_CONTENT_SUPPORT, data, &reply); bool result; status_t err = reply.readBool(&result); if (err == NO_ERROR) { *outSupported = result; } return err; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1017,7 +1029,7 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace)); reply->writeInt32(static_cast<int32_t>(wideColorGamutPixelFormat)); } return NO_ERROR; return error; } case GET_COLOR_MANAGEMENT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Loading @@ -1026,7 +1038,7 @@ status_t BnSurfaceComposer::onTransact( if (error == NO_ERROR) { reply->writeBool(result); } return result; return error; } case GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Loading Loading @@ -1110,6 +1122,15 @@ status_t BnSurfaceComposer::onTransact( } return result; } case GET_PROTECTED_CONTENT_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); bool result; status_t error = getProtectedContentSupport(&result); if (error == NO_ERROR) { reply->writeBool(result); } return error; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/include/gui/ISurfaceComposer.h +7 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,12 @@ public: virtual status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames, uint64_t timestamp, DisplayedFrameStats* outStats) const = 0; /* * Gets whether SurfaceFlinger can support protected content in GPU composition. * Requires the ACCESS_SURFACE_FLINGER permission. */ virtual status_t getProtectedContentSupport(bool* outSupported) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -350,6 +356,7 @@ public: GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES, SET_DISPLAY_CONTENT_SAMPLING_ENABLED, GET_DISPLAYED_CONTENT_SAMPLE, GET_PROTECTED_CONTENT_SUPPORT, }; virtual status_t onTransact(uint32_t code, const Parcel& data, Loading
libs/gui/tests/Surface_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -655,7 +655,8 @@ public: return NO_ERROR; } virtual status_t getColorManagement(bool* /*outGetColorManagement*/) const { return NO_ERROR; } status_t getColorManagement(bool* /*outGetColorManagement*/) const override { return NO_ERROR; } status_t getProtectedContentSupport(bool* /*outSupported*/) const override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading
services/surfaceflinger/SurfaceFlinger.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -1153,6 +1153,14 @@ status_t SurfaceFlinger::getDisplayedContentSample(const sp<IBinder>& displayTok outStats); } status_t SurfaceFlinger::getProtectedContentSupport(bool* outSupported) const { if (!outSupported) { return BAD_VALUE; } *outSupported = getRenderEngine().supportsProtectedContent(); return NO_ERROR; } status_t SurfaceFlinger::enableVSyncInjections(bool enable) { postMessageSync(new LambdaMessage([&] { Mutex::Autolock _l(mStateLock); Loading Loading @@ -5004,7 +5012,8 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) { case SET_TRANSACTION_STATE: case CREATE_CONNECTION: case GET_COLOR_MANAGEMENT: case GET_COMPOSITION_PREFERENCE: { case GET_COMPOSITION_PREFERENCE: case GET_PROTECTED_CONTENT_SUPPORT: { return OK; } case CAPTURE_LAYERS: Loading
services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ private: status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames, uint64_t timestamp, DisplayedFrameStats* outStats) const override; status_t getProtectedContentSupport(bool* outSupported) const override; /* ------------------------------------------------------------------------ * DeathRecipient interface Loading