Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecordFBOActivity swapBuffers problem #99

Open
herbaini opened this issue Aug 9, 2018 · 0 comments
Open

RecordFBOActivity swapBuffers problem #99

herbaini opened this issue Aug 9, 2018 · 0 comments

Comments

@herbaini
Copy link

herbaini commented Aug 9, 2018

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!

@herbaini herbaini changed the title RecordFBOActivity swapBuffers program RecordFBOActivity swapBuffers problem Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant