Coder Social home page Coder Social logo

android-camera-hal's Introduction

Minimal working V4L2-based Android Camera HAL driver.

HAL version: 3.0
Module version: 2.3
Camera API version: 2



LIMITATIONS
-----------

* Supports only one camera

* Tested only on Tegra K1, using one specific camera and a webcam.

* No parameter control, most of the reported specs are hardcoded.

* Resolution detection is limited up to 1920x1080. See availableResolutions()
  in V4l2Device.cpp.



WORKAROUNDS/BUILD TIME CONFIGURATION
------------------------------------

In Android.mk there are some flags which control how the driver works. Some
of them might not always work.


  LOCAL_CFLAGS += -DV4L2DEVICE_FPS_LIMIT=<NNN>

  <NNN> is positive integer. Limits framerate at the driver level. Helps when
  the kernel's V4L2 driver allows to read the buffers faster than it fills them
  with a new frames. Comment out to disable the limit.


  LOCAL_CFLAGS += -DV4L2DEVICE_BUF_COUNT=<NNN>

  <NNN> is a positive integer (4 by default) - V4L2 buffers count.


  LOCAL_CFLAGS += -DV4L2DEVICE_PIXEL_FORMAT=V4L2_PIX_FMT_UYVY
  #LOCAL_CFLAGS += -DV4L2DEVICE_PIXEL_FORMAT=V4L2_PIX_FMT_YUYV

  V4L2 source color format.


  LOCAL_CFLAGS += -DV4L2DEVICE_OPEN_ONCE

  Opens and initializes /dev/video0 during boot time. Comment out to open/close
  the device when a camera app is opened/closed.


  LOCAL_CFLAGS += -DV4L2DEVICE_USE_POLL

  Use poll() before dequeueing a buffer.



BOOT TIME CONFIGURATION
-----------------------

The "ro.camera.v4l2device.resolution" system property allows to force one single
resolution (must be supported by V4L2). The value is in the "WIDTHxHEIGHT" format.



HOW TO BUILD
------------

In your target's makefile (e.g. device/mycompany/mydevice/mydevice.mk) add:

  PRODUCT_PACKAGES += camera.$(TARGET_BOARD_PLATFORM)
  PRODUCT_PACKAGES += media_profiles.xml

and just build Android.

android-camera-hal's People

Contributors

mgielda avatar mglb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-camera-hal's Issues

Not compiling

Hello,

I'm trying to include this HAL on my AOSP to make work my USB Webcam.
I have errors on compilation.
use of undeclared identifier 'kMaxStride'
no member named 'I422ToABGRRow_NEON' in namespace 'libyuv'
no member named 'getOffset' in 'SkDynamicMemoryWStream'
This error are in ImageConverter.cpp
Could you please help me fix this ?

Thanks

Can't connect to the camera

Hello,
i build this library with AOSP android 6 ok, but when i open camera app, it shows "Camera error, Can't connect to the camera". I'm sure /dev/video0 is working before.
How can i test it using Android Camera API?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.