I'm developing a painting app, with canvas and SurfaceView, and I want to 
record user operations, and generate video.

In this moment I'm trying: 

    public static Bitmap captureView(View v) {
        Log.v(CAPTURE_TAG, "init");
        v.setDrawingCacheEnabled(true);
        v.buildDrawingCache(true);
        Bitmap b = Bitmap.createBitmap(v.getDrawingCache());
        //v.destroyDrawingCache();
        v.setDrawingCacheEnabled(false); // clear drawing cache
        Log.v(CAPTURE_TAG, "Fin:");
        return b;
    }
and I call this every 50ms, using timer, and AsynTask, on AsynkTask, on 
onPostExecute method I save the bitmap in external storage:

    public class takeCaptureTask extends AsyncTask<View, Void, Bitmap> {
    
        @Override
        protected void onPostExecute(Bitmap result) {
            Log.v("taskCapt", "Fin - InitSave");
            new saveCaptureTask().execute(result);
    }
    
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            Log.v("taskCapt", "init");
        }
    
        @Override
        protected Bitmap doInBackground(View... params) {
            return Utils.captureView(params[0]);
        }
    }

And finally generate video using NDK and ffmpeg.

My problem is the performance, using this, every screenshot take 200ms 
(5FPS), and I need at least 15 FPS.

My questions are:<br />
1- I'm in the correct way to do the screen recording without root? <br />
2- can I take screenshot of canvas using other methods?<br />
        -> I found two methods, this, and save copy of canvas bitmap, but 
two solutions have very poor performance
3- It's posible take screenshots from NDK without root? in this case, 
how?<br />
4- It's faster save data to External Storage using NDK?<br />
5- How buffer a lot of images to process it later? 

My appologies for my bad English.

Thanks a lot for your help!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to