Defold native extension which provides access to the camera on macOS, iOS and Android.
Manual, API and setup instructions is available on the official Defold site.
Example of interacting with the camera through native extensions
License: MIT License
Defold native extension which provides access to the camera on macOS, iOS and Android.
Manual, API and setup instructions is available on the official Defold site.
There's experimental Android support in the Android branch, but that branch uses the Java APIs. We should look into using code from the NDK example: https://github.com/googlesamples/android-ndk/blob/master/camera/texture-view/src/main/cpp/camera_manager.cpp
Even though the project doesn't support a platform it would be nice if it could still make them bundle/build successfully.
Sometimes a released version of the app can crash with the camera. I haven't found it crashing on a debug build so far.
02-26 15:17:58.573 28781 28781 I defold : INFO:Camera: Camera_QueueMessage 0
02-26 15:17:58.664 28781 28812 W defold : WARNING:Camera: The constructor is deprecated: dmScript::LuaHBuffer wrapper = { HBuffer, bool };
02-26 15:17:58.763 28781 28812 I defold : INFO:CRASH: Successfully wrote Crashdump to file: /data/user/0/com.jerakin.pokedex/files/_crash
02-26 15:17:58.763 28781 28812 E defold : ERROR:CRASH: CALL STACK:
02-26 15:17:58.763 28781 28812 E defold :
02-26 15:17:58.763 28781 28812 E defold : # 0 pc 0x1da654 ...IPEw==/lib/arm64/libPokedex5E.so _ZN7dmCrashL7HandlerEiP7siginfoPv+60
02-26 15:17:58.763 28781 28812 E defold : # 1 pc 0x638 [vdso] <unknown>+0
02-26 15:17:58.763 28781 28812 E defold : # 2 pc 0x143c0 ...oid.runtime/lib64/bionic/libc.so abort+176
02-26 15:17:58.763 28781 28812 E defold :
02-26 15:17:58.763 28781 28812 E defold :
02-26 15:36:57.853 3083 3119 I defold : INFO:CRASH: Successfully wrote Crashdump to file: /data/user/0/com.jerakin.pokedex/files/_crash
02-26 15:36:57.853 3083 3119 E defold : ERROR:CRASH: CALL STACK:
02-26 15:36:57.853 3083 3119 E defold :
02-26 15:36:57.853 3083 3119 E defold : # 0 pc 0x1c5c58 ...jaHQ==/lib/arm64/libPokedex5E.so <unknown>+0
02-26 15:36:57.853 3083 3119 E defold : # 1 pc 0x638 [vdso] <unknown>+0
02-26 15:36:57.853 3083 3119 E defold : # 2 pc 0x143c0 ...oid.runtime/lib64/bionic/libc.so abort+176
02-26 15:36:57.853 3083 3119 E defold : own>+0
02-26 15:36:57.853 3083 3119 E defold : Lua Callstack:
02-26 15:36:57.853 3083 3119 E defold : main/main.script:30: in function send_crash_on_start
02-26 15:36:57.853 3083 3119 E defold : main/main.script:92: in function <main/main.script:82>
02-26 15:36:57.853 3083 3119 E defold :
02-26 15:36:57.853 3083 3119 E defold :
Trying to use extension-camera to read a QR code or OSX but it instantly crashes the running instance and only leaves this in the _crash
.
# 0 pc 0x2d52e5fd ServiceManagement _sigtramp+29
iteDumpEP9lua_State+9
# 1 pc 0x41f445 dmengine lj_BC_FUNCC+68
# 2 pc 0x436342 dmengine lua_pcall+146
# 3 pc 0x400011 dmengine _ZN8dmScriptL13PCallInternalEP9lua_Stateiii+81
# 4 pc 0x36b4f2 dmengine _ZN12dmGameObject9RunScriptEP9lua_StatePNS_6ScriptENS_14ScriptFunctionEPNS_14ScriptInstanceERKNS_15RunScriptParamsE+386
# 5 pc 0x36b6ea dmengine _ZN12dmGameObject14CompScriptInitERKNS_19ComponentInitParamsE+58
# 6 pc 0x379583 dmengine _ZN12dmGameObjectL12InitInstanceEPNS_10CollectionEPNS_8InstanceE+1395
# 7 pc 0x37261c dmengine _ZN12dmGameObject4InitEPNS_16CollectionHandleE+188
# 8 pc 0x338546 dmengine _ZN8dmEngine4InitEPNS_6EngineEiPPc+7990
# 9 pc 0x339e75 dmengine _ZN8dmEngine6LaunchEiPPcPFvPNS_6EngineEPvES6_S4_+133
#10 pc 0x33a44f dmengine _Z11engine_mainiPPc+143
Samsung Galaxy S9+ , One UI-version 2.5, Android-version 10.
Forum post: https://forum.defold.com/t/access-camera-photos/3638/118?u=britzl
11-19 11:17:43.361 23141 23141 D AndroidRuntime: Shutting down VM
--------- beginning of crash
11-19 11:17:43.366 23141 23141 E AndroidRuntime: FATAL EXCEPTION: main
11-19 11:17:43.366 23141 23141 E AndroidRuntime: Process: com.defold.camera, PID: 23141
11-19 11:17:43.366 23141 23141 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:android:fragment:0, request=100, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.defold.camera/com.dynamo.android.DefoldActivity}: java.lang.RuntimeException: setParameters failed
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:5360)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:5401)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.os.Looper.loop(Looper.java:237)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8167)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: Caused by: java.lang.RuntimeException: setParameters failed
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.hardware.Camera.native_setParameters(Native Method)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.hardware.Camera.setParameters(Camera.java:2117)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at com.defold.android.camera.AndroidCamera.startPreviewAuthorized(AndroidCamera.java:155)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at com.defold.android.camera.AndroidCamera.onRequestPermissionsResult(AndroidCamera.java:83)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.Activity.dispatchRequestPermissionsResultToFragment(Activity.java:8492)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:8308)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:5353)
11-19 11:17:43.366 23141 23141 E AndroidRuntime: ... 11 more
11-19 11:17:43.377 2842 32661 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
11-19 11:17:43.382 2842 5579 D Debug : !@DumpState : SHIP
11-19 11:17:43.382 2842 5579 D Debug : !@DumpState : debug level:0x4f4c
11-19 11:17:43.382 2842 5579 D Debug : !@Dumpstate : Finally, system will skip dumpstate
11-19 11:17:43.385 2842 5579 W ActivityManager: crash : com.defold.camera,0
11-19 11:17:43.392 2842 5579 W ActivityTaskManager: Force finishing activity com.defold.camera/com.dynamo.android.DefoldActivity
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.