[Streak 5 Android Development] _n0p_:
ITT: hunderteins doing wonders working on kernel.

No troll.

Chance appeared.

OK.

What do we have to start with:

Current (kibuuka's) camera implementation is in using camera wrapper / HAL that provides HAL functions, bridging them to libcamera.so

Unfortunately, libcamera uses three overlay functions, used to be in libui in Gingerbread.

Now they are in liboverlay.so (and two haven't exact analogs).

My thoughts:

Does liboverlay actually work?

Can we simply add/replace needed functions -

overlay:: Overlay::setFd(int) _ZN7overlay7Overlay5setFdEi - new impl uses second channel parameter.

overlay:: Overlay::setCrop(unsigned int, unsigned int, unsigned int, unsigned int) _ZN7overlay7Overlay7setCropEjjjj - present as is.

overlay:: Overlay::queueBuffer(void *) _ZN7overlay7Overlay11queueBufferEPv - dunno.

So far: i've made a simple hacks to liboverlay and libcamera - wrappers loads fine.

But on Camera init if fails (seems like on wrapper init):

I/CameraService( 117): Opening camera 0
D/CameraHAL( 117): qcamera_device_open: name:0 device:0x153e4 cameraId:0
F/libc ( 117): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/Process ( 184): Sending signal. PID: 653 SIG: 3
I/dalvikvm( 653): threadid=3: reacting to signal 3
I/dalvikvm( 653): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 250): GC_CONCURRENT freed 285K, 27% free 10229K/13959K, paused 7ms+14ms
D/dalvikvm( 653): GC_CONCURRENT freed 206K, 4% free 9376K/9671K, paused 4ms+11ms
D/dalvikvm( 653): GC_FOR_ALLOC freed 21K, 3% free 9768K/10055K, paused 20ms
I/DEBUG ( 111): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 111): Build fingerprint: 'dell/dell_streak/streak:4.0.4/IMM76L/eng.den.20120711.230916:eng/test-keys'
I/DEBUG ( 111): pid: 117, tid: 117 >>> /system/bin/mediaserver <<<
I/DEBUG ( 111): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 111): r0 00000000 r1 40f463b0 r2 ffffff54 r3 ffffff58
I/DEBUG ( 111): r4 40f4622c r5 405aa4b1 r6 beb2c9dc r7 00000000
I/DEBUG ( 111): r8 0000028d r9 beb2caa4 10 beb2c9f0 fp 40f462e8
I/DEBUG ( 111): ip ffffff50 sp beb2c970 lr ffffff48 pc 40f44322 cpsr 40000030
I/DEBUG ( 111): d0 496172656d616320 d1 0076007200650035
I/DEBUG ( 111): d2 0065007200610033 d3 0061004300490065
I/DEBUG ( 111): d4 0069007300730069 d5 006f0043006e006f
I/DEBUG ( 111): d6 006f00720074006e d7 00720065006c006c
I/DEBUG ( 111): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 111): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 111): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 111): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 111): d16 0000000000000000 d17 3fefae147ae147ae
I/DEBUG ( 111): d18 4000000000000000 d19 3fcce748f8ed8687
I/DEBUG ( 111): d20 3f11504c209ef562 d21 bebbb370fb6f0b05
I/DEBUG ( 111): d22 3ff0000000000000 d23 3ff43d16aee00482
I/DEBUG ( 111): d24 3e66376972bea4d0 d25 0000000000000000
I/DEBUG ( 111): d26 0000000000000000 d27 0000000000000000
I/DEBUG ( 111): d28 0000000000000000 d29 0000000000000000
I/DEBUG ( 111): d30 0000000000000000 d31 0000000000000000
I/DEBUG ( 111): scr 20000010
I/DEBUG ( 111):
D/dalvikvm( 653): GC_CONCURRENT freed 15K, 2% free 10233K/10439K, paused 2ms+15ms
I/DEBUG ( 111): #00 pc 00002322 /system/lib/hw/camera.streak.so (_Z21qcamera_set_callbacksP13camera_devicePFviiiPvEPFviPK13camera_memoryjP21camera_frame_metadataS1_EPFvxiS6_jS1_EPFPS4_ijjS1_ES1_)
I/DEBUG ( 111): #01 pc 0000a84a /system/lib/libcameraservice.so (_ZN7android13CameraService6ClientC1ERKNS_2spIS0_EERKNS2_INS_13ICameraClientEEERKNS2_INS_23CameraHardwareInterfaceEEEiii)
I/DEBUG ( 111): #02 pc 0000aba6 /system/lib/libcameraservice.so (_ZN7android13CameraService7connectERKNS_2spINS_13ICameraClientEEEi)
I/DEBUG ( 111): #03 pc 000174b6 /system/lib/libcamera_client.so (_ZN7android15BnCameraService10onTransactEjRKNS_6ParcelEPS1_j)
I/DEBUG ( 111): #04 pc 00008d62 /system/lib/libcameraservice.so (_ZN7android13CameraService10onTransactEjRKNS_6ParcelEPS1_j)
I/DEBUG ( 111): #05 pc 00017ec0 /system/lib/libbinder.so (_ZN7android7BBinder8transactEjRKNS_6ParcelEPS1_j)
I/DEBUG ( 111): #06 pc 0001b1ea /system/lib/libbinder.so (_ZN7android14IPCThreadState14executeCommandEi)
I/DEBUG ( 111): #07 pc 0001b3c6 /system/lib/libbinder.so (_ZN7android14IPCThreadState14joinThreadPoolEb)
I/DEBUG ( 111): #08 pc 00008a96 /system/bin/mediaserver
I/DEBUG ( 111): #09 pc 00016524 /system/lib/libc.so (__libc_init)
I/DEBUG ( 111):
I/DEBUG ( 111): code around pc:
I/DEBUG ( 111): 40f44300 58216029 9d064811 f854600a 5821200c )`!X.H...`T.. !X
I/DEBUG ( 111): 40f44310 c03cf8df f8546013 6808300e 601d4a0d ..<..`T..0.h.J.`
I/DEBUG ( 111): 40f44320 68054b0d 58e358a1 200cf854 94009c07 .K.h.X.XT.. ....
I/DEBUG ( 111): 40f44330 47a0692c bf00bd3e 00001f38 ffffff3c ,i.G>...8...<...
I/DEBUG ( 111): 40f44340 ffffff40 ffffff44 ffffff48 ffffff4c @...D...H...L...
I/DEBUG ( 111):
I/DEBUG ( 111): code around lr:
I/DEBUG ( 111): ffffff28 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 111): ffffff38 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 111): ffffff48 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 111): ffffff58 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 111): ffffff68 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 111):
I/DEBUG ( 111): stack:
I/DEBUG ( 111): beb2c930 000224e0 [heap]
I/DEBUG ( 111): beb2c934 4008b498
I/DEBUG ( 111): beb2c938 405abe48 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c93c 40057a1d /system/lib/libc.so
I/DEBUG ( 111): beb2c940 000224e0 [heap]
I/DEBUG ( 111): beb2c944 4008b4a8
I/DEBUG ( 111): beb2c948 00013758 [heap]
I/DEBUG ( 111): beb2c94c 000137a4 [heap]
I/DEBUG ( 111): beb2c950 405ae194 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c954 beb2c9dc [stack]
I/DEBUG ( 111): beb2c958 00014ad0 [heap]
I/DEBUG ( 111): beb2c95c 000153e0 [heap]
I/DEBUG ( 111): beb2c960 00014ad0 [heap]
I/DEBUG ( 111): beb2c964 000153e0 [heap]
I/DEBUG ( 111): beb2c968 df0027ad
I/DEBUG ( 111): beb2c96c 00000000
I/DEBUG ( 111): #00 beb2c970 00014710 [heap]
I/DEBUG ( 111): beb2c974 405a8571 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c978 405a9031 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c97c 00013758 [heap]
I/DEBUG ( 111): beb2c980 40f442e9 /system/lib/hw/camera.streak.so
I/DEBUG ( 111): beb2c984 405ab84d /system/lib/libcameraservice.so
I/DEBUG ( 111): #01 beb2c988 405aa4b1 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c98c 000153e0 [heap]
I/DEBUG ( 111): beb2c990 00013758 [heap]
I/DEBUG ( 111): beb2c994 00000000
I/DEBUG ( 111): beb2c998 0000fd88 [heap]
I/DEBUG ( 111): beb2c99c beb2ca90 [stack]
I/DEBUG ( 111): beb2c9a0 0000028d
I/DEBUG ( 111): beb2c9a4 405ae194 /system/lib/libcameraservice.so
I/DEBUG ( 111): beb2c9a8 beb2c9dc [stack]
I/DEBUG ( 111): beb2c9ac 405abbab /system/lib/libcameraservice.so

In attach:

libcamera.so (libui reference changed to libov.so, android:: Overlay changed to overlay:: Overlay) and libov.so (quickly built liboverlay variant)

Useful only if you want to debug the issue further.