Android camera access

Lee Matthews lma at spaceapplications.com
Mon May 26 02:57:50 PDT 2014


On Mo, 2014-05-26 at 11:10 +0200, Lee Matthews wrote:
> Thanks. 
> 
> Our application is extremely niche, where we will be sending the phone
> to the International Space Station, so I can say with absolute
> certainty, given the costs and time involved in space qualifying a
> smartphone, our target platform won't change. 
> 
> When you say that mediacodec can be easily abstracted to a new
> gstreamer element, how easy would it be for a noob to Java and
> gstreamer ? ie me ! :)

Of course I can't estimate that, but if you call yourself noob I would
guess we're talking about weeks here then ;)

Did you ever create a GStreamer element yourself? Also take a look at
the code in gstamc.c, something very similar to that would be needed for
just the JNI integration.

No, afraid not. I will take a look at gstamc.c. Thanks for the hint.

> I need to try and balance the amount of time it would take to use v4l2
> against writing an abstraction to android.media.MediaCodec. How easy
> would it be to add v4l2 to the binaries ?

So here we're talking about a few minutes, and then rebuilding it all :)

Great, this would be using the cerbero tool ?

Lee


> 
> 
> On Mo, 2014-05-26 at 10:54 +0200, Lee Matthews wrote:
> > Hi,
> > 
> > I wish to be able to access an external usb camera attached to an Android phone using gstreamer. I have already achieved this using the android version of gstreamer that uses the dynamic libraries from the command line, I was using the following pipeline :
> > 
> > gst-launch-1.0 v4l2src device=/dev/video4 ! video/x-raw, framerate=20/1,width=640, height=480 !  jpegenc ! multipartmux boundary=spionisto ! tcpclientsink host=10.1.5.21 port=9999
> > 
> > I have looked at the android static libraries and I cannot find the video4linux2 plugin. Having done a little research it would appear that I need to use JNI to access the android.hardware.Camera API. Why is this ? Why does the video4linux2 plugin exist in its dynamic version and not in its static version for the android platform ? I'm rather lost on this.
> > 
> > Can anyone enlighten me ?
> 
> v4l2 is not a public API on Android, and a device might support it for
> camera access or not. I guess it would make sense to include it
> nonetheless in the binaries :)
> 
> However the real solution will be to use the Java API via JNI, and with
> a similar approach as is used in the androidmedia plugin for
> android.media.MediaCodec usage this can be abstracted quite easily into
> a new GStreamer element.
> 

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list