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

Commit 88320846 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Tracking changes to renaming DisplayConfig to DisplayMode" into sc-dev

parents 57079259 be7e5471
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AMessage.h>
#include <mediadrm/ICrypto.h>
#include <mediadrm/ICrypto.h>
#include <ui/DisplayConfig.h>
#include <ui/DisplayMode.h>
#include <ui/DisplayState.h>
#include <ui/DisplayState.h>


#include "screenrecord.h"
#include "screenrecord.h"
@@ -68,7 +68,7 @@ using android::ABuffer;
using android::ALooper;
using android::ALooper;
using android::AMessage;
using android::AMessage;
using android::AString;
using android::AString;
using android::DisplayConfig;
using android::ui::DisplayMode;
using android::FrameOutput;
using android::FrameOutput;
using android::IBinder;
using android::IBinder;
using android::IGraphicBufferProducer;
using android::IGraphicBufferProducer;
@@ -689,8 +689,8 @@ static status_t recordScreen(const char* fileName) {
        return err;
        return err;
    }
    }


    DisplayConfig displayConfig;
    DisplayMode displayMode;
    err = SurfaceComposerClient::getActiveDisplayConfig(display, &displayConfig);
    err = SurfaceComposerClient::getActiveDisplayMode(display, &displayMode);
    if (err != NO_ERROR) {
    if (err != NO_ERROR) {
        fprintf(stderr, "ERROR: unable to get display config\n");
        fprintf(stderr, "ERROR: unable to get display config\n");
        return err;
        return err;
@@ -700,7 +700,7 @@ static status_t recordScreen(const char* fileName) {
    if (gVerbose) {
    if (gVerbose) {
        printf("Display is %dx%d @%.2ffps (orientation=%s), layerStack=%u\n",
        printf("Display is %dx%d @%.2ffps (orientation=%s), layerStack=%u\n",
                layerStackSpaceRect.getWidth(), layerStackSpaceRect.getHeight(),
                layerStackSpaceRect.getWidth(), layerStackSpaceRect.getHeight(),
                displayConfig.refreshRate, toCString(displayState.orientation),
                displayMode.refreshRate, toCString(displayState.orientation),
                displayState.layerStack);
                displayState.layerStack);
        fflush(stdout);
        fflush(stdout);
    }
    }
@@ -718,7 +718,7 @@ static status_t recordScreen(const char* fileName) {
    sp<FrameOutput> frameOutput;
    sp<FrameOutput> frameOutput;
    sp<IGraphicBufferProducer> encoderInputSurface;
    sp<IGraphicBufferProducer> encoderInputSurface;
    if (gOutputFormat != FORMAT_FRAMES && gOutputFormat != FORMAT_RAW_FRAMES) {
    if (gOutputFormat != FORMAT_FRAMES && gOutputFormat != FORMAT_RAW_FRAMES) {
        err = prepareEncoder(displayConfig.refreshRate, &encoder, &encoderInputSurface);
        err = prepareEncoder(displayMode.refreshRate, &encoder, &encoderInputSurface);


        if (err != NO_ERROR && !gSizeSpecified) {
        if (err != NO_ERROR && !gSizeSpecified) {
            // fallback is defined for landscape; swap if we're in portrait
            // fallback is defined for landscape; swap if we're in portrait
@@ -731,7 +731,7 @@ static status_t recordScreen(const char* fileName) {
                        gVideoWidth, gVideoHeight, newWidth, newHeight);
                        gVideoWidth, gVideoHeight, newWidth, newHeight);
                gVideoWidth = newWidth;
                gVideoWidth = newWidth;
                gVideoHeight = newHeight;
                gVideoHeight = newHeight;
                err = prepareEncoder(displayConfig.refreshRate, &encoder, &encoderInputSurface);
                err = prepareEncoder(displayMode.refreshRate, &encoder, &encoderInputSurface);
            }
            }
        }
        }
        if (err != NO_ERROR) return err;
        if (err != NO_ERROR) return err;
+4 −4
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@
#include <gui/ISurfaceComposer.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/Surface.h>
#include <gui/Surface.h>
#include <ui/DisplayConfig.h>
#include <ui/DisplayMode.h>


static void usage(const char *me) {
static void usage(const char *me) {
    fprintf(stderr, "usage: %s [-a] use audio\n"
    fprintf(stderr, "usage: %s [-a] use audio\n"
@@ -414,10 +414,10 @@ int main(int argc, char **argv) {
        const sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
        const sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
        CHECK(display != nullptr);
        CHECK(display != nullptr);


        DisplayConfig config;
        ui::DisplayMode mode;
        CHECK_EQ(SurfaceComposerClient::getActiveDisplayConfig(display, &config), NO_ERROR);
        CHECK_EQ(SurfaceComposerClient::getActiveDisplayMode(display, &mode), NO_ERROR);


        const ui::Size& resolution = config.resolution;
        const ui::Size& resolution = mode.resolution;
        const ssize_t displayWidth = resolution.getWidth();
        const ssize_t displayWidth = resolution.getWidth();
        const ssize_t displayHeight = resolution.getHeight();
        const ssize_t displayHeight = resolution.getHeight();


+4 −4
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@
#include <media/stagefright/NuMediaExtractor.h>
#include <media/stagefright/NuMediaExtractor.h>
#include <media/stagefright/RenderScriptWrapper.h>
#include <media/stagefright/RenderScriptWrapper.h>
#include <OMX_IVCommon.h>
#include <OMX_IVCommon.h>
#include <ui/DisplayConfig.h>
#include <ui/DisplayMode.h>


#include "RenderScript.h"
#include "RenderScript.h"
#include "ScriptC_argbtorgba.h"
#include "ScriptC_argbtorgba.h"
@@ -752,10 +752,10 @@ int main(int argc, char **argv) {
        const android::sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
        const android::sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
        CHECK(display != nullptr);
        CHECK(display != nullptr);


        DisplayConfig config;
        ui::DisplayMode mode;
        CHECK_EQ(SurfaceComposerClient::getActiveDisplayConfig(display, &config), NO_ERROR);
        CHECK_EQ(SurfaceComposerClient::getActiveDisplayMode(display, &mode), NO_ERROR);


        const ui::Size& resolution = config.resolution;
        const ui::Size& resolution = mode.resolution;
        const ssize_t displayWidth = resolution.getWidth();
        const ssize_t displayWidth = resolution.getWidth();
        const ssize_t displayHeight = resolution.getHeight();
        const ssize_t displayHeight = resolution.getHeight();


+4 −4
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@
#include <gui/Surface.h>
#include <gui/Surface.h>


#include <fcntl.h>
#include <fcntl.h>
#include <ui/DisplayConfig.h>
#include <ui/DisplayMode.h>


using namespace android;
using namespace android;


@@ -321,10 +321,10 @@ int main(int argc, char **argv) {
    const sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
    const sp<IBinder> display = SurfaceComposerClient::getInternalDisplayToken();
    CHECK(display != nullptr);
    CHECK(display != nullptr);


    DisplayConfig config;
    ui::DisplayMode mode;
    CHECK_EQ(SurfaceComposerClient::getActiveDisplayConfig(display, &config), NO_ERROR);
    CHECK_EQ(SurfaceComposerClient::getActiveDisplayMode(display, &mode), NO_ERROR);


    const ui::Size& resolution = config.resolution;
    const ui::Size& resolution = mode.resolution;
    const ssize_t displayWidth = resolution.getWidth();
    const ssize_t displayWidth = resolution.getWidth();
    const ssize_t displayHeight = resolution.getHeight();
    const ssize_t displayHeight = resolution.getHeight();