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

Commit d359b575 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Properly connect to surface flinger in our shell tools"

parents 48719dc6 c5a9766d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -569,12 +569,16 @@ int main(int argc, char **argv) {
        CHECK(control->isValid());

        SurfaceComposerClient::openGlobalTransaction();
        CHECK_EQ(control->setLayer(30000), (status_t)OK);
        CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
        CHECK_EQ(control->show(), (status_t)OK);
        SurfaceComposerClient::closeGlobalTransaction();

        surface = control->getSurface();
        CHECK(surface != NULL);

        CHECK_EQ((status_t)OK,
                 native_window_api_connect(
                     surface.get(), NATIVE_WINDOW_API_MEDIA));
    }

    sp<Controller> controller =
@@ -589,6 +593,10 @@ int main(int argc, char **argv) {
    looper->unregisterHandler(controller->id());

    if (!decodeAudio && useSurface) {
        CHECK_EQ((status_t)OK,
                 native_window_api_disconnect(
                     surface.get(), NATIVE_WINDOW_API_MEDIA));

        composerClient->dispose();
    }

+9 −1
Original line number Diff line number Diff line
@@ -917,7 +917,7 @@ int main(int argc, char **argv) {
            CHECK(control->isValid());

            SurfaceComposerClient::openGlobalTransaction();
            CHECK_EQ(control->setLayer(30000), (status_t)OK);
            CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
            CHECK_EQ(control->show(), (status_t)OK);
            SurfaceComposerClient::closeGlobalTransaction();

@@ -929,6 +929,10 @@ int main(int argc, char **argv) {
            sp<SurfaceTexture> texture = new SurfaceTexture(0 /* tex */);
            gSurface = new SurfaceTextureClient(texture);
        }

        CHECK_EQ((status_t)OK,
                 native_window_api_connect(
                     gSurface.get(), NATIVE_WINDOW_API_MEDIA));
    }

    DataSource::RegisterDefaultSniffers();
@@ -1122,6 +1126,10 @@ int main(int argc, char **argv) {
    }

    if ((useSurfaceAlloc || useSurfaceTexAlloc) && !audioOnly) {
        CHECK_EQ((status_t)OK,
                 native_window_api_disconnect(
                     gSurface.get(), NATIVE_WINDOW_API_MEDIA));

        gSurface.clear();

        if (useSurfaceAlloc) {
+1 −1
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
    CHECK(control->isValid());

    SurfaceComposerClient::openGlobalTransaction();
    CHECK_EQ(control->setLayer(30000), (status_t)OK);
    CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
    CHECK_EQ(control->show(), (status_t)OK);
    SurfaceComposerClient::closeGlobalTransaction();