Пример #1
0
/* Define the Input used.
   Add the callbacks on input
   p_input is held once here */
void InputManager::setInput( input_thread_t *_p_input )
{
    delInput();
    p_input = _p_input;
    if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )
    {
        msg_Dbg( p_intf, "IM: Setting an input" );
        vlc_object_hold( p_input );
        addCallbacks();
        UpdateStatus();
        UpdateName();
        UpdateArt();
        UpdateTeletext();
        UpdateNavigation();
        UpdateVout();

        p_item = input_GetItem( p_input );
        emit rateChanged( var_GetFloat( p_input, "rate" ) );
    }
    else
    {
        p_input = NULL;
        p_item = NULL;
        assert( !p_input_vbi );
        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    }
}
Пример #2
0
/* Define the Input used.
   Add the callbacks on input
   p_input is held once here */
void InputManager::setInput( input_thread_t *_p_input )
{
    delInput();
    p_input = _p_input;
    if( p_input != NULL )
    {
        msg_Dbg( p_intf, "IM: Setting an input" );
        vlc_object_hold( p_input );
        addCallbacks();

        UpdateStatus();
        UpdateName();
        UpdateArt();
        UpdateTeletext();
        UpdateNavigation();
        UpdateVout();

        p_item = input_GetItem( p_input );
        emit rateChanged( var_GetFloat( p_input, "rate" ) );

        /* Get Saved Time */
        if( p_item->i_type == ITEM_TYPE_FILE )
        {
            char *uri = input_item_GetURI( p_item );

            int i_time = RecentsMRL::getInstance( p_intf )->time( qfu(uri) );
            if( i_time > 0 && qfu( uri ) != lastURI &&
                    !var_GetFloat( p_input, "run-time" ) &&
                    !var_GetFloat( p_input, "start-time" ) &&
                    !var_GetFloat( p_input, "stop-time" ) )
            {
                emit resumePlayback( (int64_t)i_time * 1000 );
            }
            playlist_Lock( THEPL );
            // Add root items only
            playlist_item_t* p_node = playlist_CurrentPlayingItem( THEPL );
            if ( p_node != NULL && p_node->p_parent != NULL && p_node->p_parent->i_id == THEPL->p_playing->i_id )
            {
                // Save the latest URI to avoid asking to restore the
                // position on the same input file.
                lastURI = qfu( uri );
                RecentsMRL::getInstance( p_intf )->addRecent( lastURI );
            }
            playlist_Unlock( THEPL );
            free( uri );
        }
    }
    else
    {
        p_item = NULL;
        lastURI.clear();
        assert( !p_input_vbi );
        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    }
}
void NuiMayaDeviceGrabber::postConstructor()
{
	// Avoid node to be auto deleted when all connection breaks
	setExistWithoutInConnections(true);
	setExistWithoutOutConnections(true);

	addCallbacks();

	SafeDelete(m_pCache);
	m_pCache = new NuiFrameBuffer();

	SafeDelete(m_pDevice);
	m_pDevice = new NuiRGBDDeviceController();
}
Пример #4
0
/* Define the Input used.
   Add the callbacks on input
   p_input is held once here */
void InputManager::setInput( input_thread_t *_p_input )
{
    delInput();
    p_input = _p_input;
    if( p_input != NULL )
    {
        msg_Dbg( p_intf, "IM: Setting an input" );
        vlc_object_hold( p_input );
        addCallbacks();

        UpdateStatus();
        UpdateName();
        UpdateArt();
        UpdateTeletext();
        UpdateNavigation();
        UpdateVout();

        p_item = input_GetItem( p_input );
        emit rateChanged( var_GetFloat( p_input, "rate" ) );

        /* Get Saved Time */
        if( p_item->i_type == ITEM_TYPE_FILE )
        {
            int i_time = RecentsMRL::getInstance( p_intf )->time( p_item->psz_uri );
            if( i_time > 0 &&
                    !var_GetFloat( p_input, "run-time" ) &&
                    !var_GetFloat( p_input, "start-time" ) &&
                    !var_GetFloat( p_input, "stop-time" ) )
            {
                emit resumePlayback( (int64_t)i_time * 1000 );
            }
        }
    }
    else
    {
        p_item = NULL;
        assert( !p_input_vbi );
        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    }
}
Пример #5
0
static void
mainLoop() {
    addCallbacks(retracer);

    long long startTime = 0; 
    frameNo = 0;

    startTime = os::getTime();

    if (singleThread) {
        trace::Call *call;
        while ((call = parser->parse_call())) {
            retraceCall(call);
            delete call;
        }
    } else {
        RelayRace race;
        race.run();
    }
    finishRendering();

    long long endTime = os::getTime();
    float timeInterval = (endTime - startTime) * (1.0 / os::timeFrequency);

    if ((retrace::verbosity >= -1) || (retrace::profiling)) {
        std::cout << 
            "Rendered " << frameNo << " frames"
            " in " <<  timeInterval << " secs,"
            " average of " << (frameNo/timeInterval) << " fps\n";
    }

    if (waitOnFinish) {
        waitForInput();
    } else {
        return;
    }
}
Пример #6
0
 Retracer() {
     addCallbacks(stdc_callbacks);
 }
Пример #7
0
static void
mainLoop() {
    addCallbacks(retracer);

    long long startTime = 0; 
    frameNo = 0;

    startTime = os::getTime();

    if (singleThread) {
        trace::Call *call;
        while ((call = parser.parse_call())) {
            retraceCall(call);
            delete call;
        };
    } else {
        RelayRace race;
        race.run();
    }
    finishRendering();

    long long endTime = os::getTime();
    float timeInterval = (endTime - startTime) * (1.0 / os::timeFrequency);

    if ((retrace::verbosity >= -1) || (retrace::profiling)) {
        std::cout << 
            "Rendered " << frameNo << " frames"
            " in " <<  timeInterval << " secs,"
            " average of " << (frameNo/timeInterval) << " fps\n";

        std::cout << std::endl;
        std::cout <<
            "Total number of calls: " << nCalls.tot() << std::endl;
        std::cout <<
            "Average number of calls: " << nCalls.avg() << std::endl;
        std::cout <<
            "Minimum number of calls: " << nCalls.min() << std::endl;
        std::cout <<
            "Maximum number of calls: " << nCalls.max() << std::endl;

        std::cout << std::endl;
        std::cout <<
            "Total number of render calls: " << nRenderCalls.tot() << std::endl;
        std::cout <<
            "Average number of render calls: " << nRenderCalls.avg() << std::endl;
        std::cout <<
            "Minimum number of render calls: " << nRenderCalls.min() << std::endl;
        std::cout <<
            "Maximum number of render calls: " << nRenderCalls.max() << std::endl;

        std::cout << std::endl;
        std::cout <<
            "Total texel uploads: " << texUploads.tot() << std::endl;
        std::cout <<
            "Average texel uploads: " << texUploads.avg() << std::endl;
        std::cout <<
            "Minimum texel uploads: " << texUploads.min() << std::endl;
        std::cout <<
            "Maximum texel uploads: " << texUploads.max() << std::endl;

        std::cout << std::endl;
        std::cout <<
            "Total number of triangles: " << nTriangles.tot() << std::endl;
        std::cout <<
            "Average number of triangles: " << nTriangles.avg() << std::endl;
        std::cout <<
            "Minimum number of triangles: " << nTriangles.min() << std::endl;
        std::cout <<
            "Maximum number of triangles: " << nTriangles.max() << std::endl;

        std::cout << std::endl;
        std::cout <<
            "Total number of vertices: " << nVertices.tot() << std::endl;
        std::cout <<
            "Average number of vertices: " << nVertices.avg() << std::endl;
        std::cout <<
            "Minimum number of vertices: " << nVertices.min() << std::endl;
        std::cout <<
            "Maximum number of vertices: " << nVertices.max() << std::endl;
    }

    if (waitOnFinish) {
        waitForInput();
    } else {
        return;
    }
}