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

Commit bf022055 authored by Patrick Williams's avatar Patrick Williams
Browse files

Add an option to record secure windows

This will only work when running as root

Bug: 324890339
Test: verified the recorded content includes secure windows
Change-Id: Ib148a6100657098e1fadde5bd2096ac26776c57f
parent 65574a32
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ static AString gCodecName = ""; // codec name override
static bool gSizeSpecified = false;     // was size explicitly requested?
static bool gWantInfoScreen = false;    // do we want initial info screen?
static bool gWantFrameTime = false;     // do we want times on each frame?
static bool gSecureDisplay = false;     // should we create a secure virtual display?
static uint32_t gVideoWidth = 0;        // default width+height
static uint32_t gVideoHeight = 0;
static uint32_t gBitRate = 20000000;     // 20Mbps
@@ -362,7 +363,7 @@ static status_t prepareVirtualDisplay(
        const sp<IGraphicBufferProducer>& bufferProducer,
        sp<IBinder>* pDisplayHandle, sp<SurfaceControl>* mirrorRoot) {
    sp<IBinder> dpy = SurfaceComposerClient::createDisplay(
            String8("ScreenRecorder"), false /*secure*/);
            String8("ScreenRecorder"), gSecureDisplay);
    SurfaceComposerClient::Transaction t;
    t.setDisplaySurface(dpy, bufferProducer);
    setDisplayProjection(t, dpy, displayState);
@@ -1253,6 +1254,7 @@ int main(int argc, char* const argv[]) {
        { "persistent-surface", no_argument,        NULL, 'p' },
        { "bframes",            required_argument,  NULL, 'B' },
        { "display-id",         required_argument,  NULL, 'd' },
        { "capture-secure",     no_argument,        NULL, 'S' },
        { NULL,                 0,                  NULL, 0 }
    };

@@ -1372,6 +1374,9 @@ int main(int argc, char* const argv[]) {

            fprintf(stderr, "Invalid physical display ID\n");
            return 2;
        case 'S':
            gSecureDisplay = true;
            break;
        default:
            if (ic != '?') {
                fprintf(stderr, "getopt_long returned unexpected value 0x%x\n", ic);