Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
bin
/build
/dist
/distribution
.classpath
.project
*.DS_Store
/.gradle
local.properties
/.idea
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Processing Video implementation for Android
This library tries to expose the same API endpoints as that of processing-video library for PC. The sketch from processing-video library works for Android.
This library tries to expose the same API endpoints as that of processing-video library for PC.
Any sketches using the processing-video library should work the same when using this library on Android.

**Demo:** https://www.youtube.com/watch?v=kjqcWGLH6Q8

**A primitive example :**
**A simple example :**
```
import in.omerjerk.processing.video.android.*;

Expand All @@ -26,4 +27,11 @@ void draw() {

**Behind the hood :**

The idea is to render camera preview on a `SurfaceTexture` and as soon as the new frame is received, copy the data from this `SurfaceTexture` to a custom texure bound to target `GL_TEXTURE_2D` (Note : We cannot directly render to a texture bound to `GL_TEXTURE_2D` target, because for the preview to happen, the texture must be bound to `GL_TEXTURE_EXTERNAL_OES`). This custom texture is then rendered to a PGraphics object. The backing texture of that PGraphics object is then used as the texture cache for our PImage file which stores the video.
The idea is to render camera preview on a `SurfaceTexture` and as soon as the new frame is received, copy the data from this `SurfaceTexture` to a custom texture bound to target `GL_TEXTURE_2D`
(Note : We cannot directly render to a texture bound to `GL_TEXTURE_2D` target, because for the preview to happen, the texture must be bound to `GL_TEXTURE_EXTERNAL_OES`).
This custom texture is then rendered to a PGraphics object.
The backing texture of that PGraphics object is then used as the texture cache for our PImage file which stores the video.

## Building the Project

`gradle dist` will build the project, copy it to the user's Processing sketchbook folder, and prepare a .zip file ready for distribution.
Loading