Results 1 to 2 of 2

Thread: How can i identify which cameras image is in frameReady thread

  1. #1
    Join Date
    Oct 2007
    Location
    India
    Posts
    21

    How can i identify which cameras image is in frameReady thread

    Hello,
    I am using two cameras in single interface card simultaneously.

    For that i am using a array grabber object like

    m_pGrabber[1]->openDev("DFx 31AF03");
    m_pGrabber[1]->setVideoFormat("UYVY (1024x768)");
    m_pGrabber[1]->setFPS(15.00002);

    m_pGrabber[2]->openDev("DFx 31F03");
    m_pGrabber[2]->setVideoFormat("UYVY (640x480)");
    m_pGrabber[2]->setFPS(15.00002);

    m_pGrabber[1]->startLive();
    m_pGrabber[2]->startLive();

    To Starting a Frameready i use......
    m_pSink->setSinkMode( GrabberSinkType::eRUN);

    then....

    class CListener: public GrabberListener
    {
    public:
    virtual void frameReady( Grabber& caller, smart_ptr<DShowLib::MemBuffer> pBuffer, DWORD FrameNumber );
    };

    void CListener::frameReady( Grabber& caller, smart_ptr<MemBuffer> pBuffer, DWORD currFrame)
    {
    BYTE *p = pBuffer->getPtr();
    k=0;
    for(i=Height-1; i>=0; i--)
    {
    for(j=0; j<Width; j++)
    {
    b = p[k];
    k++;
    g = p[k];
    k++;
    r = p[k];
    k++;
    k++;

    *(*(imagearr1+i) + j) = RGB(b,g,r);
    *(*(imagearr2+i) + j) = RGB(b,g,r);
    }

    }
    }


    Here now in array imagearr1 & imagearr2 which cameras image is stored?

    How to get or identify two cameras images seperately?

    thanks in advance.....

  2. #2
    Join Date
    Oct 2006
    Posts
    93

    Re: How can i identify which cameras image is in frameReady thread

    Hallo sethupathy,

    For example, you can identify the device in the frameReady method as follows:

    Code:
    std::string name = param.getDev().getName();
    Also, there is a sample program attached, which uses two Listener instances.
    The Listener class was extended with an Image Array as Byte*. This Image Array was set by "SetImageArr(BYTE* arr)" to an accordant array...
    Best regards
    Sascha
    IC Imaging Control Support

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •