Camera

jayel

Active Member
Licensed User
Longtime User
Hello,

When I try the example code "camera example" I can see a preview of my rear camera.
No when I implement the same code in my android app. (not the main activity bu t a second activity called "afbeelding". I don't see the preview window.
But when I click to take a picture, it does make a picture.

Can somebody help me please?

Greets,

John
 

jayel

Active Member
Licensed User
Longtime User
B4X:
MQ.put(0,0xafd103f0,0x36550,0x365b8,0x1d)
MessageQueue::put EXIT
MQ.get(0,0xafd103f0,0x36550,0x365b8,0x1d)
Receive Command: PREVIEW_START, mPreviewRunning =0 
536: cameraSetSize() ENTER
overlay_setPosition (x=10 y=75 w=650 h=410) 
overlay_setParameter  --- Set Transform(0)!
overlay_commit : Set Position - Parameters Error.
--->need recover again
cameraSetSize: VIDIOC_S_FMT PreviewFormat w=640 h=480
551: cameraSetSize() EXIT
649: cameraStart() ENTER
**CaptureQBuffers: preview size=640x480
OK,mOverlay not NULL
mPreviewFrameSize = 0x96000 = 614400
number of buffers = 4
730: cameraStart() EXIT
PREVIEW_START err: 0, ACK
MQ.put(9,0xafd103f0,0x36550,0x365b8,0x1d)
MQ.get(9,0xafd103f0,0x36550,0x365b8,0x1d)
927: startPreview() EXIT
MessageQueue::put EXIT
--------->standy in
--------->standy in drain out
GC_EXPLICIT freed 89 objects / 8088 bytes in 64ms
 streamType 1,sampleRate 44100,format 1,channels 4,frameCount 32768,flags 0
afSampleRate 44100 afFrameCount8192 afLatency186
 -------------mbut_bac onClick() 
>>> Enter set_buttons_light
No keyboard for id 0
Using default keymap: /system/usr/keychars/qwerty.kcm.bin
** Activity (afbeelding) Pause, UserClosed = true **
933: stopPreview() ENTER
MQ.put(1,0x1a438,0xafd10510,0x1a428,0x325a)
MessageQueue::put EXIT
--->need open again module 0xc168 open 0x812014f5
open called for devices 00000002 in mode 0...
external/alsa-lib/src/pcm/pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker_normal
external/alsa-lib/src/pcm/pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker
external/alsa-lib/src/pcm/pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM AndroidPlayback
MQ.get(1,0x1a438,0xafd10510,0x1a428,0x325a)
Receive Command: PREVIEW_STOP

I see a line in the log : overlay_commit : Set Position - Parameters Error.

Isn't that the problem ?

and no i am using the cameraexample.
Because the other won't work with older versions of android.

Greets John
 
Upvote 0
Top