Loading include/gui/BufferQueue.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,8 @@ public: virtual void onFrameReplaced(const BufferItem& item) override; virtual void onFrameReplaced(const BufferItem& item) override; virtual void onBuffersReleased() override; virtual void onBuffersReleased() override; virtual void onSidebandStreamChanged() override; virtual void onSidebandStreamChanged() override; virtual bool getFrameTimestamps(uint64_t frameNumber, FrameTimestamps* outTimestamps) const override; private: private: // mConsumerListener is a weak reference to the IConsumerListener. This is // mConsumerListener is a weak reference to the IConsumerListener. This is // the raison d'etre of ProxyConsumerListener. // the raison d'etre of ProxyConsumerListener. Loading include/gui/BufferQueueProducer.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -186,6 +186,10 @@ public: virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) override; sp<Fence>* outFence, float outTransformMatrix[16]) override; // See IGraphicBufferProducer::getFrameTimestamps virtual bool getFrameTimestamps(uint64_t frameNumber, FrameTimestamps* outTimestamps) const override; private: private: // This is required by the IBinder::DeathRecipient interface // This is required by the IBinder::DeathRecipient interface virtual void binderDied(const wp<IBinder>& who); virtual void binderDied(const wp<IBinder>& who); Loading include/gui/FrameTimestamps.h 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line /* * Copyright 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_GUI_FRAMETIMESTAMPS_H #define ANDROID_GUI_FRAMETIMESTAMPS_H #include <utils/Timers.h> #include <utils/Flattenable.h> namespace android { struct FrameTimestamps : public LightFlattenablePod<FrameTimestamps> { FrameTimestamps() : frameNumber(0), postedTime(0), acquireTime(0), refreshStartTime(0), glCompositionDoneTime(0), displayRetireTime(0), releaseTime(0) {} uint64_t frameNumber; nsecs_t postedTime; nsecs_t acquireTime; nsecs_t refreshStartTime; nsecs_t glCompositionDoneTime; nsecs_t displayRetireTime; nsecs_t releaseTime; }; } // namespace android #endif include/gui/IConsumerListener.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <binder/IInterface.h> #include <binder/IInterface.h> #include <gui/FrameTimestamps.h> namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -78,6 +80,11 @@ public: // stream is first attached and when it is either detached or replaced by a // stream is first attached and when it is either detached or replaced by a // different stream. // different stream. virtual void onSidebandStreamChanged() = 0; /* Asynchronous */ virtual void onSidebandStreamChanged() = 0; /* Asynchronous */ // See IGraphicBufferProducer::getFrameTimestamps // This queries the consumer for the timestamps virtual bool getFrameTimestamps(uint64_t /*frameNumber*/, FrameTimestamps* /*outTimestamps*/) const { return false; } }; }; Loading include/gui/IGraphicBufferProducer.h +10 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,8 @@ #include <ui/Rect.h> #include <ui/Rect.h> #include <ui/Region.h> #include <ui/Region.h> #include <gui/FrameTimestamps.h> namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -568,6 +570,14 @@ public: // Returns NO_ERROR or the status of the Binder transaction // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) = 0; sp<Fence>* outFence, float outTransformMatrix[16]) = 0; // Attempts to retrieve timestamp information for the given frame number. // If information for the given frame number is not found, returns false. // Returns true otherwise. // // If a fence has not yet signaled the timestamp returned will be 0; virtual bool getFrameTimestamps(uint64_t /*frameNumber*/, FrameTimestamps* /*outTimestamps*/) const { return false; } }; }; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading
include/gui/BufferQueue.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,8 @@ public: virtual void onFrameReplaced(const BufferItem& item) override; virtual void onFrameReplaced(const BufferItem& item) override; virtual void onBuffersReleased() override; virtual void onBuffersReleased() override; virtual void onSidebandStreamChanged() override; virtual void onSidebandStreamChanged() override; virtual bool getFrameTimestamps(uint64_t frameNumber, FrameTimestamps* outTimestamps) const override; private: private: // mConsumerListener is a weak reference to the IConsumerListener. This is // mConsumerListener is a weak reference to the IConsumerListener. This is // the raison d'etre of ProxyConsumerListener. // the raison d'etre of ProxyConsumerListener. Loading
include/gui/BufferQueueProducer.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -186,6 +186,10 @@ public: virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) override; sp<Fence>* outFence, float outTransformMatrix[16]) override; // See IGraphicBufferProducer::getFrameTimestamps virtual bool getFrameTimestamps(uint64_t frameNumber, FrameTimestamps* outTimestamps) const override; private: private: // This is required by the IBinder::DeathRecipient interface // This is required by the IBinder::DeathRecipient interface virtual void binderDied(const wp<IBinder>& who); virtual void binderDied(const wp<IBinder>& who); Loading
include/gui/FrameTimestamps.h 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line /* * Copyright 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_GUI_FRAMETIMESTAMPS_H #define ANDROID_GUI_FRAMETIMESTAMPS_H #include <utils/Timers.h> #include <utils/Flattenable.h> namespace android { struct FrameTimestamps : public LightFlattenablePod<FrameTimestamps> { FrameTimestamps() : frameNumber(0), postedTime(0), acquireTime(0), refreshStartTime(0), glCompositionDoneTime(0), displayRetireTime(0), releaseTime(0) {} uint64_t frameNumber; nsecs_t postedTime; nsecs_t acquireTime; nsecs_t refreshStartTime; nsecs_t glCompositionDoneTime; nsecs_t displayRetireTime; nsecs_t releaseTime; }; } // namespace android #endif
include/gui/IConsumerListener.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <binder/IInterface.h> #include <binder/IInterface.h> #include <gui/FrameTimestamps.h> namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -78,6 +80,11 @@ public: // stream is first attached and when it is either detached or replaced by a // stream is first attached and when it is either detached or replaced by a // different stream. // different stream. virtual void onSidebandStreamChanged() = 0; /* Asynchronous */ virtual void onSidebandStreamChanged() = 0; /* Asynchronous */ // See IGraphicBufferProducer::getFrameTimestamps // This queries the consumer for the timestamps virtual bool getFrameTimestamps(uint64_t /*frameNumber*/, FrameTimestamps* /*outTimestamps*/) const { return false; } }; }; Loading
include/gui/IGraphicBufferProducer.h +10 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,8 @@ #include <ui/Rect.h> #include <ui/Rect.h> #include <ui/Region.h> #include <ui/Region.h> #include <gui/FrameTimestamps.h> namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -568,6 +570,14 @@ public: // Returns NO_ERROR or the status of the Binder transaction // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) = 0; sp<Fence>* outFence, float outTransformMatrix[16]) = 0; // Attempts to retrieve timestamp information for the given frame number. // If information for the given frame number is not found, returns false. // Returns true otherwise. // // If a fence has not yet signaled the timestamp returned will be 0; virtual bool getFrameTimestamps(uint64_t /*frameNumber*/, FrameTimestamps* /*outTimestamps*/) const { return false; } }; }; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading