Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
danielleCoder
Posts: 178
Registered: ‎04-16-2011
My Device: torch 9800

Re: Updating Focus Indicator causing camera viewfinder to flicker

Hi Sean, did you find time to have a look at this?

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Updating Focus Indicator causing camera viewfinder to flicker

I have loaded it up.. can you explain exactly how to reproduce, and what I should be looking for?

I'm on STL100-1, and I am not seeing any issues so far.

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Updating Focus Indicator causing camera viewfinder to flicker

managed to reproduce the problem using your app on STL100-3.  never saw it on STL100-1.

manifests as a single-frame flash down the side of the screen.

I will pass this the the appropriate team.. interesting..

 

no workarounds to suggest for you at this point.

Please use plain text.
Developer
danielleCoder
Posts: 178
Registered: ‎04-16-2011
My Device: torch 9800

Re: Updating Focus Indicator causing camera viewfinder to flicker

glad you can reproduce the problem - I was just trying to upload a video previewing the error but the uplaod failed!

 

I'm wondering if it's to do with the navigationpane back button shown on the camera page but from what I've learnt from docs everything seems ok with the code.

 

Thanks for looking into it.

 

 

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Updating Focus Indicator causing camera viewfinder to flicker

it's purely a graphics problem.

If I monitor the frame-to-frame brightness computed over the buffers by attaching the following viewfinder callback to camera_start_photo_viewfinder()...

 

void Focus::vfCallback(camera_handle_t handle, camera_buffer_t *buf, void *arg)
{
    static unsigned long brightness = 0;
#define SUBSAMPLE 4
#define THRESHOLD 20
    unsigned long cur = 0;
    if (buf->frametype == CAMERA_FRAMETYPE_NV12) {
        for (unsigned int y=0; y<buf->framedesc.nv12.height; y+=SUBSAMPLE) {
            for (unsigned x=0; x<buf->framedesc.nv12.width; x+=SUBSAMPLE) {
                cur += buf->framebuf[y*buf->framedesc.nv12.stride+x];
            }
        }
        cur = cur / (buf->framedesc.nv12.height*buf->framedesc.nv12.width/SUBSAMPLE/SUBSAMPLE);
        if (brightness != 0) {
            if (cur > brightness+THRESHOLD) {
                qDebug() << "PREV:" << brightness << " CUR:" << cur;
            }
        }
        qDebug() << cur;
        brightness = cur;
    }
}

 

I never see any deviation from my baseline brightness value.  This means that the artifact is not camera-related, but appears to be a problem with the graphics compositing on that particular device.

 

Cheers,

Sean

 

Please use plain text.