Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

RecordFBOActivity swapBuffers problem #99

Open
@herbaini

Description

@herbaini

In RecordFBOActivity, when I start recording, which will have "mWindowSurface.swapBuffers" and "mInputWindowSurface.swapBuffers" .
The fast speed is Choreographer time which diffent on diffent Devices!(58-62 maybe)
I want get a stable FPS(for example 60) because I will do opengl compose then display and record.

Now I do by this at fixed fps:

public void run() {
            prepareGl();
            while (mRunning) {
                llNowNs = System.nanoTime();
                if (llNowNs - llBeginNs < llFrameCount * mRefreshTimeNs) {
                    llDelayNs = llFrameCount * mRefreshTimeNs - llNowNs + llBeginNs;
                    try {
                        Thread.sleep(llDelayNs / 1000000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }

                    continue;
                }

                render(llFrameCount * mRefreshTimeNs);
                llFrameCount++;
            }
            releaseGl();
        }

Every render() I swapbuffer to encode surface and swapbuffer to display like in RecordFBOActivity.

Now the problem is swapbuffer to encode surface cost long time. I think is BufferQueue is Fence by something! What it is???

And which is best arch to do this???

I do not want to download Image then push to the encode! Which is ulgy and slowly!!!!

Very thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions