cine-io / cineio-broadcast-android

The cine.io Android Broadcast SDK
https://www.cine.io/products/broadcast
MIT License
52 stars 32 forks source link

Making use of EglSurfaceBase's saveFrame method #10

Open lgorse opened 9 years ago

lgorse commented 9 years ago

I'm trying to implement frame capture on the CineIO API, so users can creat thumbnails on the fly. EglSurfaceBase's saveFrame method works really well BUT I'm not sure how to access it properly.

The method works great when I set it up from within TextureMovieEncoder's handleFrameAvailable method (it generates multiple frames very quickly if I just dump the code there).

But of course I want the code to fire upon the user clicking on a button and for now every implementation I attempt returns the error:

"Expected EGL context/surface is not current"

I was wondering if you guys had a recommended route for using the saveFrame method from EglSurfaceBase, and if you had any advice on how I can approach this problem.

Thanks!

trshafer commented 9 years ago

Hey @lgorse that's a great idea. I don't have any immediate advice for approaching the problem. If you are able to make it work, we'll gladly accept a PR.

lgorse commented 9 years ago

OK I'm going to start on this tonight. Thanks!