diff options
author | Andy McFadden <fadden@android.com> | 2014-02-25 18:29:06 -0800 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2014-02-26 17:49:44 -0800 |
commit | 587c6fefcd3c1d05c608ff511cf3534bc765256e (patch) | |
tree | 6ce9ad218290768a600294b334e39c4e751fb40a /cmds/screenrecord/Program.cpp | |
parent | dc6ac201032d0f6ad0c8149ae2f009ec38693025 (diff) | |
download | frameworks_av-587c6fefcd3c1d05c608ff511cf3534bc765256e.zip frameworks_av-587c6fefcd3c1d05c608ff511cf3534bc765256e.tar.gz frameworks_av-587c6fefcd3c1d05c608ff511cf3534bc765256e.tar.bz2 |
Add frame dump output
This adds the ability to dump frames as RGB data with a minimal
frame header. Only recommended for devices with small displays.
Enable with "--output-format=frames".
The "--raw" option is now selected with "--output-format=h264".
Bug 13140019
Change-Id: I61bee55cea97db3134a91e7ea06106783e5bf340
Diffstat (limited to 'cmds/screenrecord/Program.cpp')
-rw-r--r-- | cmds/screenrecord/Program.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmds/screenrecord/Program.cpp b/cmds/screenrecord/Program.cpp index a198204..73cae6e 100644 --- a/cmds/screenrecord/Program.cpp +++ b/cmds/screenrecord/Program.cpp @@ -201,7 +201,7 @@ status_t Program::linkShaderProgram(GLuint vs, GLuint fs, GLuint* outPgm) { status_t Program::blit(GLuint texName, const float* texMatrix, - int32_t x, int32_t y, int32_t w, int32_t h) const { + int32_t x, int32_t y, int32_t w, int32_t h, bool invert) const { ALOGV("Program::blit %d xy=%d,%d wh=%d,%d", texName, x, y, w, h); const float pos[] = { @@ -218,7 +218,7 @@ status_t Program::blit(GLuint texName, const float* texMatrix, }; status_t err; - err = beforeDraw(texName, texMatrix, pos, uv); + err = beforeDraw(texName, texMatrix, pos, uv, invert); if (err == NO_ERROR) { glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); err = afterDraw(); @@ -232,7 +232,7 @@ status_t Program::drawTriangles(GLuint texName, const float* texMatrix, status_t err; - err = beforeDraw(texName, texMatrix, vertices, texes); + err = beforeDraw(texName, texMatrix, vertices, texes, false); if (err == NO_ERROR) { glDrawArrays(GL_TRIANGLES, 0, count); err = afterDraw(); @@ -241,7 +241,7 @@ status_t Program::drawTriangles(GLuint texName, const float* texMatrix, } status_t Program::beforeDraw(GLuint texName, const float* texMatrix, - const float* vertices, const float* texes) const { + const float* vertices, const float* texes, bool invert) const { // Create an orthographic projection matrix based on viewport size. GLint vp[4]; glGetIntegerv(GL_VIEWPORT, vp); @@ -251,6 +251,10 @@ status_t Program::beforeDraw(GLuint texName, const float* texMatrix, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, }; + if (invert) { + screenToNdc[5] = -screenToNdc[5]; + screenToNdc[13] = -screenToNdc[13]; + } glUseProgram(mProgram); |