Question

New to renderscript and just successfully run the "hellocompute" sample.

And I would like to build a camera preview with renderscript. Understanding that I need to process the yuv data to RGB to display in a callback, I find this in the android source code!

livePreview

but after I import this project my IDE(eclipse) telling me

b.addKernel(mScript.getKernelID_root());

goes wrong and

    The method getKernelID_root() is undefined for the type ScriptC_yuv RsYuv.java  /CameraPreviewActivity/src/com/android/rs/livepreview   line 98 Java Problem

and I find no implementation of this function in scriptC_yuv.java as well.

I have try to change to android.support.v8.renderscript but error remains.

FYI: I have eclipse, android sdk tools 22.6.3, android platform tools 19.0.1 and I set projects API 19 android 4.4.2. And I am able to compile "hellpcompute" which have no renderscript Intrinsic.

Any idea about this? or anywhere to find runnable samples for renderscipt camera preview.

Was it helpful?

Solution

I had the same problem while trying that demo app as well. Turns out, that besides having the project compile with the API 19 target, you must also set the app's manifest min SDK version to level 19, otherwise compiling fails as script groups (which this app uses) are not available on older versions.

So on AndroidManifest.xml , just make sure you have:

<uses-sdk android:minSdkVersion="19" />

Instead of the default "14" that I think it comes with when you first download the source code. I'm not sure if there is a better way of fixing it, but this worked for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top