Esempio n. 1
0
/**
 * Videoreader dispatching method: it tries to find the first
 * API that can access a given filename.
 */
CV_IMPL CvCapture * cvCreateFileCapture (const char * filename)
{
    CvCapture * result = 0;

    if (! result)
        result = cvCreateFileCapture_FFMPEG_proxy (filename);

    #ifdef HAVE_XINE
    if (! result)
        result = cvCreateFileCapture_XINE (filename);
    #endif

    #ifdef HAVE_GSTREAMER
    if (! result)
        result = cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename);
    #endif

    #ifdef HAVE_QUICKTIME
    if (! result)
        result = cvCreateFileCapture_QT (filename);
    #endif
    
    if (! result)
        result = cvCreateFileCapture_Images (filename);

    return result;
}
Esempio n. 2
0
/**
 * Videoreader dispatching method: it tries to find the first
 * API that can access a given filename.
 */
CV_IMPL CvCapture * cvCreateFileCapture (const char * filename)
{
    CvCapture * result = 0;

#ifdef HAVE_FFMPEG
    if (! result)
        result = cvCreateFileCapture_FFMPEG_proxy (filename);
#endif

#ifdef HAVE_VFW
    if (! result)
        result = cvCreateFileCapture_VFW (filename);
#endif

#ifdef HAVE_MSMF
    if (! result)
        result = cvCreateFileCapture_MSMF (filename);
#endif

#ifdef HAVE_XINE
    if (! result)
        result = cvCreateFileCapture_XINE (filename);
#endif

#ifdef HAVE_GSTREAMER
    if (! result)
        result = cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename);
#endif

#if defined(HAVE_QUICKTIME) || defined(HAVE_QTKIT)
    if (! result)
        result = cvCreateFileCapture_QT (filename);
#endif

#ifdef HAVE_AVFOUNDATION
    if (! result)
        result = cvCreateFileCapture_AVFoundation (filename);
#endif

#ifdef HAVE_OPENNI
    if (! result)
        result = cvCreateFileCapture_OpenNI (filename);
#endif

    if (! result)
        result = cvCreateFileCapture_Images (filename);

    return result;
}
Esempio n. 3
0
/**
 * Videoreader dispatching method: it tries to find the first
 * API that can access a given filename.
 */
CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, int apiPreference)
{
    CvCapture * result = 0;

    switch(apiPreference) {
    default:
        // user specified an API we do not know
        // bail out to let the user know that it is not available
        if (apiPreference) break;

#ifdef HAVE_FFMPEG
    case CV_CAP_FFMPEG:
        if (! result)
            result = cvCreateFileCapture_FFMPEG_proxy (filename);
        if (apiPreference) break;
#endif

#ifdef HAVE_VFW
    case CV_CAP_VFW:
        if (! result)
            result = cvCreateFileCapture_VFW (filename);
        if (apiPreference) break;
#endif
#if defined HAVE_LIBV4L || defined HAVE_CAMV4L || defined HAVE_CAMV4L2 || defined HAVE_VIDEOIO
        if (!result)
            result = cvCreateCameraCapture_V4L(filename);
        if (apiPreference) break;
#endif

    case CV_CAP_MSMF:
#ifdef HAVE_MSMF
        if (! result)
            result = cvCreateFileCapture_MSMF (filename);
#endif

#ifdef HAVE_XINE
        if (! result)
            result = cvCreateFileCapture_XINE (filename);
#endif
        if (apiPreference) break;

#ifdef HAVE_GSTREAMER
    case CV_CAP_GSTREAMER:
        if (! result)
            result = cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename);
        if (apiPreference) break;
#endif

#if defined(HAVE_QUICKTIME) || defined(HAVE_QTKIT)
    case CV_CAP_QT:
        if (! result)
            result = cvCreateFileCapture_QT (filename);
        if (apiPreference) break;
#endif

#ifdef HAVE_AVFOUNDATION
    case CV_CAP_AVFOUNDATION:
        if (! result)
            result = cvCreateFileCapture_AVFoundation (filename);
        if (apiPreference) break;
#endif

#ifdef HAVE_OPENNI
    case CV_CAP_OPENNI:
        if (! result)
            result = cvCreateFileCapture_OpenNI (filename);
        if (apiPreference) break;
#endif

    case CV_CAP_IMAGES:
        if (! result)
            result = cvCreateFileCapture_Images (filename);
    }

    return result;
}