Tim wrote:
> 
> On Nov 3, 8:58 am, Girish <htgir...@gmail.com> wrote:
>> In my application i want to pass the camera data to native layer. what
>> is the best possible approach for doing the same.
>>
>> I know it can be done 2 ways.
>>
>> 1.start the camera in application and pass the preview data to native
>> layer. But i feel this may consume lot of resources.
> 
> This is the only 'supported' way. Apparently there is a bug with the
> camera callback that creates a new massive object for every frame.
> Since java is shite and garbage collected this slows this way down
> even before you copy all the data through JNI.

Well, it's not a "bug", it's just how Java works.
It certainly does suck.

>> 2.Start the camera directly in native layer and use it. So JNI will
>> come less into picture. and not much resource loading also.But dont
>> want to take any risk by using the lower layer code which may change
>> in future.
> 
> Yeah this would be ideal, but not supported yet, if ever.

We tried to get opencore to do this for us, and we failed.

We never even got opencore's extensive debugging to turn on while trying 
to figure out how things work, and after some person-weeks of effort, we 
  understood enough about opencore that we can use it as a library, but 
not via MediaService.

We are now writing our own service that opens the camera hardware 
directly, and runs as a service.  I do not think a lot of things will 
happen to this layer, except that it will not be available anymore.
We tried to chmod the camera devices so that it could be a non-root 
service, but there is more to it than that, so for now, it's a root 
service.


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

Reply via email to