Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c438389 authored by Huihong Luo's avatar Huihong Luo Committed by Android (Google) Code Review
Browse files

Merge "Sync with ISurfaceComposer changes"

parents 1099c563 8da9cacc
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@
#include <utils/String16.h>

#include <binder/IServiceManager.h>
#include <gui/ISurfaceComposer.h>
#include <ui/DisplayStatInfo.h>
#include <android/gui/ISurfaceComposer.h>
#include <android/gui/DisplayStatInfo.h>

#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AUtils.h>
@@ -39,21 +39,22 @@ void VideoFrameScheduler::updateVsync() {
    mVsyncTime = 0;
    mVsyncPeriod = 0;

    // TODO(b/220021255): wrap this into SurfaceComposerClient
    if (mComposer == NULL) {
        String16 name("SurfaceFlinger");
        String16 name("SurfaceFlingerAIDL");
        sp<IServiceManager> sm = defaultServiceManager();
        mComposer = interface_cast<ISurfaceComposer>(sm->checkService(name));
        mComposer = interface_cast<gui::ISurfaceComposer>(sm->checkService(name));
    }
    if (mComposer != NULL) {
        DisplayStatInfo stats;
        status_t res = mComposer->getDisplayStats(NULL /* display */, &stats);
        if (res == OK) {
        gui::DisplayStatInfo stats;
        binder::Status status = mComposer->getDisplayStats(nullptr/* display */, &stats);
        if (status.isOk()) {
            ALOGV("vsync time:%lld period:%lld",
                    (long long)stats.vsyncTime, (long long)stats.vsyncPeriod);
            mVsyncTime = stats.vsyncTime;
            mVsyncPeriod = stats.vsyncPeriod;
        } else {
            ALOGW("getDisplayStats returned %d", res);
            ALOGW("getDisplayStats returned %d", status.transactionError());
        }
    } else {
        ALOGW("could not get surface mComposer service");
+4 −2
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@

namespace android {

namespace gui {
    class ISurfaceComposer;
}

struct VideoFrameScheduler : public VideoFrameSchedulerBase {
    VideoFrameScheduler();
@@ -32,7 +34,7 @@ protected:

private:
    void updateVsync() override;
    sp<ISurfaceComposer> mComposer;
    sp<gui::ISurfaceComposer> mComposer;
};

}  // namespace android