Giter Club home page Giter Club logo

native-camera2's Introduction

This repo is unmaintained and archived

Hello Camera2

Hello Camera2 is an Android Camera2 sample that plays preview.

It controls camera devices by NDK camera2 APIs which becomes one of public libraries in Android N.

Pre-requisites

  • Android Studio 2.1+ with NDK (>=r12) bundle.

Screenshots

A small extra view is toggled when a screen is touched.

screenshot

Known Bugs

  • When extra surface view is changed, App is crashed. (e.g when switching portrait to landscape mode, vice versa)

native-camera2's People

Contributors

justinjoy 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  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

native-camera2's Issues

Cannot open the camera due to permission denial issue

The logcat logs shows permission denial. Any setting should I try?
Thanks for your sharing and help!

04-25 22:47:22.036 25142-25142/? I/native-camera2-jni: Trying to open Camera2 (id: 0, num of camera : 2)
04-25 22:47:22.037 2399-2399/? I/CameraService: CameraService::connect call (PID -1 "", camera ID 0) for HAL version default and Camera API version 2
04-25 22:47:22.037 2399-2399/? W/ServiceManager: Permission failure: android.permission.CAMERA from uid=10049 pid=25142
04-25 22:47:22.037 2399-2399/? E/CameraService: Permission Denial: can't use the camera pid=25142, uid=10049
04-25 22:47:22.037 25142-25142/? E/ACameraManager: openCamera: connect camera device failed: Status(-8): '1: validateConnectLocked:975: Caller "" (PID 10049, UID 25142) cannot open camera "0" without camera permission'
04-25 22:47:22.038 25142-25142/? E/native-camera2-jni: Failed to open camera device (id: 0)
04-25 22:47:22.038 25142-25142/? E/NdkCameraDevice: ACameraDevice_createCaptureRequest: invalid argument! device 0x0 request 0x7fac1e7028
04-25 22:47:22.038 25142-25142/? E/native-camera2-jni: Failed to create preview capture request (id: 0)
04-25 22:47:22.086 25142-25159/? I/Adreno: QUALCOMM build : d57aba2, Ic27b94dfce
Build Date : 10/26/16
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch :
Remote Branch :
Reconstruct Branch :
04-25 22:47:22.091 25142-25159/? I/OpenGLRenderer: Initialized EGL, version 1.4
04-25 22:47:22.091 25142-25159/? D/OpenGLRenderer: Swap behavior 1
04-25 22:47:22.095 25142-25142/? V/NativeCamera2: surface created.
04-25 22:47:22.095 25142-25142/? I/native-camera2-jni: Surface is prepared in 0x7fc1cf4f38.
04-25 22:47:22.095 25142-25142/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 25142 (p.nativecamera2)

                                     [ 04-25 22:47:22.096   448:  448 W/         ]
                                     debuggerd: handling request: pid=25142 uid=10049 gid=10049 tid=25142

04-25 22:47:22.161 25160-25160/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-25 22:47:22.161 25160-25160/? A/DEBUG: Build fingerprint: 'asus/WW_Phone/ASUS_Z012D:7.0/NRD90M/14.2015.1701.13-20170310:user/release-keys'
04-25 22:47:22.161 25160-25160/? A/DEBUG: Revision: '0'
04-25 22:47:22.161 25160-25160/? A/DEBUG: ABI: 'arm64'
04-25 22:47:22.161 25160-25160/? A/DEBUG: pid: 25142, tid: 25142, name: p.nativecamera2 >>> org.freedesktop.nativecamera2 <<<
04-25 22:47:22.161 25160-25160/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
04-25 22:47:22.161 25160-25160/? A/DEBUG: x0 0000000000000000 x1 0000007fa2f8afd8 x2 0000000000000004 x3 0000000000000003
04-25 22:47:22.161 25160-25160/? A/DEBUG: x4 0000000000000000 x5 0000000000000000 x6 0000007fb14c5000 x7 0000000000000000
04-25 22:47:22.161 25160-25160/? A/DEBUG: x8 0000000000000008 x9 000000001654c5a8 x10 0000007fad60c5f8 x11 0000000000000001
04-25 22:47:22.161 25160-25160/? A/DEBUG: x12 0000007fad60c608 x13 0000000000000000 x14 0000000000000000 x15 0005b025932a128a
04-25 22:47:22.161 25160-25160/? A/DEBUG: x16 0000007fac1e6f30 x17 0000007fb10a2174 x18 0000000000000001 x19 0000007fa2f8afd8
04-25 22:47:22.161 25160-25160/? A/DEBUG: x20 0000000000000000 x21 0e054b79d2cf0fea x22 0000007fae7a3344 x23 0000007fae7a3030
04-25 22:47:22.161 25160-25160/? A/DEBUG: x24 0000000000000004 x25 0e054b79d2cf0fea x26 0000007fad696a98 x27 0e054b79d2cf0fea
04-25 22:47:22.161 25160-25160/? A/DEBUG: x28 0000000000000001 x29 0000007fc1cf4ec0 x30 0000007fac1d656c
04-25 22:47:22.161 25160-25160/? A/DEBUG: sp 0000007fc1cf4e80 pc 0000007fb10a2218 pstate 0000000020000000
04-25 22:47:22.162 25160-25160/? A/DEBUG: backtrace:
04-25 22:47:22.162 25160-25160/? A/DEBUG: #00 pc 000000000000c218 /system/lib64/libcamera2ndk.so (ACaptureRequest_addTarget+164)
04-25 22:47:22.162 25160-25160/? A/DEBUG: #1 pc 0000000000001568 /data/app/org.freedesktop.nativecamera2-1/lib/arm64/libnative-camera2-jni.so (Java_org_freedesktop_nativecamera2_NativeCamera2_setSurface+188)
04-25 22:47:22.162 25160-25160/? A/DEBUG: #2 pc 00000000000032c8 /data/app/org.freedesktop.nativecamera2-1/oat/arm64/base.odex (offset 0x3000)
04-25 22:47:22.476 2689-25162/? W/ActivityManager: Force finishing activity org.freedesktop.nativecamera2/.NativeCamera2

                                               [ 04-25 22:47:22.479   448:  448 W/         ]
                                               debuggerd: resuming target 25142

04-25 22:47:22.483 2689-25162/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger org.freedesktop.nativecamera2
04-25 22:47:22.483 2689-25162/? W/ActivityManager: Force finishing activity org.freedesktop.nativecamera2/.NativeCamera2

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.