Results 1 to 3 of 3

Thread: Issue with understanding the getAvailableInputChannels()

  1. #1
    Join Date
    Mar 2017
    Location
    Deutschland
    Posts
    14

    Issue with understanding the getAvailableInputChannels()

    Hi,

    I am using frame grabber for my project. Here is the code snippet of what i have done so far, I want to get a list of available input channels and later set it. I know i must select a device first in order to get input channels. However I really do not understand how to select device and than show available input channels.

    //From library

    DShowLib::InitLibrary();
    atexit(ExitLibrary);
    m_pGrabber = new Grabber();
    Grabber::tVidCapDevListPtr pVidCapDevList = m_pGrabber->getAvailableVideoCaptureDevices();
    if( pVidCapDevList == 0 || pVidCapDevList->empty() )
    {
    qDebug() << "No device available";
    }
    // Fill the qDebug with available capture device module
    for ( Grabber::tVidCapDevList::iterator it =
    pVidCapDevList->begin();
    it != pVidCapDevList->end();
    ++it )
    {
    qDebug() << "Available device name : ";
    qDebug() << it->c_str();

    }
    // Select the currently valid device
    if( m_pGrabber->isDevValid() )
    {
    qDebug() << "Device available";
    m_pGrabber->getDev().c_str();
    qDebug() << "Device set properly";
    }
    qDebug() << "Device not valid";
    Grabber::tInChnListPtr pInpChnList = m_pGrabber->getAvailableInputChannels();
    //Check if input channel exists or not
    if( pInpChnList == 0 || pInpChnList->empty() )
    {
    qDebug() << "No input channel exists";
    qDebug() << m_pGrabber->isFrameRateListAvailable();
    qDebug() << m_pGrabber->isInputChannelAvailableWithCurDev();
    }
    // Fill the qDebug with available channels
    for ( Grabber::tInChnList::iterator it =
    pInpChnList->begin();
    it != pInpChnList->end();
    ++it )
    {
    qDebug() << "Available channels : ";
    qDebug() << it->c_str();
    }


    //End

    I see the following output :

    Available device name :
    DFG/SV1/PCIe
    No input channel exists
    The program has unexpectedly finished.
    Last edited by sulabh; March 30, 2017 at 09:07:11. Reason: Device not valid issue

  2. #2
    Join Date
    Jan 2003
    Location
    Bremen, Germany
    Posts
    4,886

    Re: Issue with understanding the getAvailableInputChannels()

    Hello Sulab

    You did not open the device. The debug output "qDebug() << "Device set properly";" is not executed. You should call

    m_pGrabber->openDev("DFG/SV!/PCIe");
    before
    if( m_pGrabber->isDevValid() )


    https://www.theimagingsource.com/sup...er_openDev.htm
    Best regards
    Stefan
    IC Imaging Control Support

  3. #3
    Join Date
    Mar 2017
    Location
    Deutschland
    Posts
    14

    Re: Issue with understanding the getAvailableInputChannels()

    Quote Originally Posted by Stefan Geissler View Post
    Hello Sulab

    You did not open the device. The debug output "qDebug() << "Device set properly";" is not executed. You should call

    m_pGrabber->openDev("DFG/SV!/PCIe");
    before
    if( m_pGrabber->isDevValid() )


    https://www.theimagingsource.com/sup...er_openDev.htm
    Thanks it works perfectly now

Similar Threads

  1. Issue with DMK22BUC03
    By AsierPz in forum Hardware and Driver
    Replies: 1
    Last Post: March 2, 2017, 17:11:10
  2. Framerate issue
    By SLcroc in forum IC Imaging Control ActiveX
    Replies: 5
    Last Post: December 23, 2015, 17:00:11
  3. Trigger issue
    By phonlab in forum Hardware and Driver
    Replies: 2
    Last Post: January 20, 2011, 13:19:57
  4. Is there any issue with 64 bit vista
    By Jack Johnson in forum IC Imaging Control .NET
    Replies: 3
    Last Post: February 2, 2009, 12:45:33
  5. Replies: 4
    Last Post: December 20, 2004, 21:39:44

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
  •