cannot reopen camera twice

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cannot reopen camera twice

800 Views
tomingliu
Contributor I

Dear All

I am facing a camera problem when using QT5 GUI libraries, pls see my implementation

int Q_DECL_EXPORT txHalInit()

{

    if(!camera) {

        camera = new QCamera(QCameraInfo::defaultCamera());

        if(!camera) return -1;

        cameraViewfinder = new QCameraViewfinder();

        if(!cameraViewfinder) {

            delete camera; return -1;

        }

int Q_DECL_EXPORT txToggleVideo(void)

{

    if(camera) {

        if(isVideoOn == false)

        {

            if(camera->state() == QCamera::UnloadedState) {

                cameraViewfinder->show();

                camera->setViewfinder(cameraViewfinder);

                camera->start();

            }

            cameraViewfinder->setWindowOpacity(1.0);

            isVideoOn = true; return 1;

        }

        else

        {

            cameraViewfinder->hide();

            //cameraViewfinder->setWindowOpacity(0.0);

            camera->stop();camera->unlock(); camera->unload();

            isVideoOn = false; return 0;

        }

    }

    return -1;

}

}

When I try to toggle camera video on and off twice, i get below error, The camera will stop capture video when getting below error

void CameraBinSession::setState(QCamera::State) QCamera::ActiveState

GstElement* CameraBinSession::buildCameraSource()

bool CameraBinSession::setupCameraBin() Viewfinder changed, reconfigure.

Source caps: video/x-raw, format=(string){ I420, NV12, YUY2, UYVY }, width=(int)720, height=(int)480, framerate=(fraction)30/1, interlace-mode=(string)interleaved

Supported resolutions: video/x-raw, width=(int)720, height=(int)480

(QSize(720, 480))

Supported rates: video/x-raw, framerate=(fraction)30/1

(QPair(30,1))

====== MP3ENC: 4.0.9 build on Mar 25 2016 16:53:25. ======

(halTests:833): GStreamer-CRITICAL **: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed

(halTests:833): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

>>>>> fps=0.752219:

GstElement* CameraBinSession::buildCameraSource()

Source caps: video/x-raw, format=(string){ I420, NV12, YUY2, UYVY }, width=(int)720, height=(int)480, framerate=(fraction)30/1, interlace-mode=(string)interleaved

Supported resolutions: video/x-raw, width=(int)720, height=(int)480

(QSize(720, 480))

Supported rates: video/x-raw, framerate=(fraction)30/1

(QPair(30,1))

====== MP3ENC: 4.0.9 build on Mar 25 2016 16:53:25. ======

true

"state changed: old: GST_STATE_NULL  new: GST_STATE_READY  pending: GST_STATE_VOID_PENDING"

[INFO]  Product Info: i.MX6Q/D/S

====== VPUENC: 4.0.9 build on Mar 25 2016 16:53:17. ======

        wrapper: 1.0.65 (VPUWRAPPER_ARM_LINUX Build on Mar 25 2016 16:51:00)

        vpulib: 5.4.33

        firmware: 3.1.1.46072

[INFO]  Product Info: i.MX6Q/D/S

====== VPUENC: 4.0.9 build on Mar 25 2016 16:53:17. ======

        wrapper: 1.0.65 (VPUWRAPPER_ARM_LINUX Build on Mar 25 2016 16:51:00)

        vpulib: 5.4.33

        firmware: 3.1.1.46072

"state changed: old: GST_STATE_READY  new: GST_STATE_PAUSED  pending: GST_STATE_PLAYING"

CameraBin error: "Internal data flow error."

CameraBin error: "Internal data flow error."

who can kindly give me some advice to solve this issue?? appreciate

Regards

Toming

Labels (4)
0 Kudos
2 Replies

475 Views
tomingliu
Contributor I

Here below is my bsp info

!

BB_VERSION        = "1.28.0"

BUILD_SYS         = "x86_64-linux"

NATIVELSBSTRING   = "Fedora-18"

TARGET_SYS        = "arm-tanxun-linux-gnueabi"

MACHINE           = "imx6qsabresd"

DISTRO            = "fsl-imx-fb"

DISTRO_VERSION    = "4.1.15-1.1.0"

TUNE_FEATURES     = "arm armv7a vfp neon callconvention-hard cortexa9"

TARGET_FPU        = "vfp-neon"

0 Kudos

475 Views
joanxie
NXP TechSupport
NXP TechSupport

what bsp do you use? could you give me your test steps? let me reproduce it on my board, and what board and camera do you use?

0 Kudos