bool XineEngine::init() { DEBUG_BLOCK debug() << "'Bringing joy to small mexican gerbils, a few weeks at a time.'\n"; m_xine = xine_new(); if( !m_xine ) { KMessageBox::error( 0, i18n("Pana could not initialize xine.") ); return false; } #ifdef XINE_SAFE_MODE xine_engine_set_param( m_xine, XINE_ENGINE_PARAM_VERBOSITY, 99 ); #endif xine_config_load( m_xine, configPath() ); debug() << "w00t" << configPath() << endl; xine_init( m_xine ); makeNewStream(); #ifndef XINE_SAFE_MODE startTimer( 200 ); //prunes the scope #endif return true; }
eXine() { /* this should be done once. */ if(!xine_check_version(1, 1, 0)) { int major, minor, sub; xine_get_version (&major, &minor, &sub); eWarning("Require xine library version 1.1.0, found %d.%d.%d.\n", major, minor,sub); return; } else { int major, minor, sub; eDebug("Built with xine library %d.%d.%d (%s)\n", XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION, XINE_VERSION); xine_get_version (&major, &minor, &sub); eDebug("Found xine library version: %d.%d.%d (%s).\n", major, minor, sub, xine_get_version_string()); } xine = xine_new(); xine_engine_set_param(xine, XINE_ENGINE_PARAM_VERBOSITY, 1); xine_init(xine); }
PyObject * Xine_PyObject_set_engine_param(Xine_PyObject *self, PyObject *args, PyObject *kwargs) { int param, value; if (!PyArg_ParseTuple(args, "ii", ¶m, &value)) return NULL; xine_engine_set_param(self->xine, param, value); return Py_INCREF(Py_None), Py_None; }
static int icvOpenAVI_XINE( CvCaptureAVI_XINE* capture, const char* filename ) { #ifndef NDEBUG fprintf( stderr, "(DEBUG) icvOpenAVI_XINE ... start\n" ); #endif char configfile[ 2048 ]; capture->xine = xine_new(); sprintf( configfile, "%s%s", xine_get_homedir(), "/.xine/config" ); xine_config_load( capture->xine, configfile ); xine_init( capture->xine ); xine_engine_set_param( capture->xine, 0, 0 ); capture->vo_port = xine_new_framegrab_video_port( capture->xine ); if ( capture->vo_port == NULL ) { printf( "(ERROR)icvOpenAVI_XINE(): Unable to initialize video driver.\n" ); return 0; } capture->stream = xine_stream_new( capture->xine, NULL, capture->vo_port ); if ( !xine_open( capture->stream, filename ) ) { printf( "(ERROR)icvOpenAVI_XINE(): Unable to open source '%s'\n", filename ); return 0; } // reset stream... xine_play( capture->stream, 0, 0 ); // initialize some internals... capture->frame_number = 0; if ( !xine_get_next_video_frame( capture->vo_port, &capture->xine_frame ) ) { #ifndef NDEBUG fprintf( stderr, "(DEBUG) icvOpenAVI_XINE ... failed!\n" ); #endif return 0; } capture->size = cvSize( capture->xine_frame.width, capture->xine_frame.height ); capture->yuv_frame = cvCreateImage( capture->size, IPL_DEPTH_8U, 3 ); capture->bgr_frame = cvCreateImage( capture->size, IPL_DEPTH_8U, 3 ); xine_free_video_frame( capture->vo_port, &capture->xine_frame ); capture->xine_frame.data[ 0 ] = 0; icvCheckSeekAVI_XINE( capture ); capture->frame_duration = xine_get_stream_info( capture->stream, XINE_STREAM_INFO_FRAME_DURATION ) / 90.; capture->frame_rate = 1000 / capture->frame_duration; #ifndef NDEBUG fprintf( stderr, "(DEBUG) frame_duration = %f, framerate = %f\n", capture->frame_duration, capture->frame_rate ); #endif OPENCV_ASSERT ( capture->yuv_frame, "icvOpenAVI_XINE( CvCaptureAVI_XINE *, const char *)", "couldn't create yuv frame"); OPENCV_ASSERT ( capture->bgr_frame, "icvOpenAVI_XINE( CvCaptureAVI_XINE *, const char *)", "couldn't create bgr frame"); #ifndef NDEBUG fprintf( stderr, "(DEBUG) icvOpenAVI_XINE ... end\n" ); #endif return 1; }