示例#1
0
int VoutManager::controlWindow( struct vout_window_t *pWnd,
                            int query, va_list args )
{
    intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
    VoutManager *pThis = pIntf->p_sys->p_voutManager;
    vout_thread_t* pVout = pWnd->vout;

    switch( query )
    {
        case VOUT_SET_SIZE:
        {
            unsigned int i_width  = va_arg( args, unsigned int );
            unsigned int i_height = va_arg( args, unsigned int );

            if( i_width && i_height )
            {
                pThis->lockVout();

                vector<SavedVout>::iterator it;
                for( it = pThis->m_SavedVoutVec.begin();
                     it != pThis->m_SavedVoutVec.end(); it++ )
                {
                    if( (*it).pVout == pVout )
                    {
                        // Post a vout resize command
                        CmdResizeVout *pCmd =
                            new CmdResizeVout( pThis->getIntf(),
                                               (*it).pVoutWindow,
                                               (int)i_width, (int)i_height );
                        AsyncQueue *pQueue =
                            AsyncQueue::instance( pThis->getIntf() );
                        pQueue->push( CmdGenericPtr( pCmd ) );
                        break;
                    }
                }

                pThis->unlockVout();
            }
        }

        default:
            msg_Dbg( pWnd, "control query not supported" );
            break;
    }

    return VLC_SUCCESS;
}
示例#2
0
void *VoutManager::getWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
{
    // Theme may have been destroyed
    if( !pIntf->p_sys->p_theme )
        return NULL;

    VoutManager *pThis = pIntf->p_sys->p_voutManager;

    vout_thread_t* pVout = pWnd->vout;
    int width = (int)pWnd->width;
    int height = (int)pWnd->height;

    pThis->lockVout();

    void* handle = pThis->acceptVout( pVout, width, height );

    pThis->unlockVout();

    return handle;
}
示例#3
0
void VoutManager::releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
{
    VoutManager *pThis = pIntf->p_sys->p_voutManager;

    // Theme may have been destroyed
    if( !pIntf->p_sys->p_theme )
        return;

    vout_thread_t* pVout = pWnd->vout;

    pThis->lockVout();

    // remove vout thread from savedVec
    vector<SavedVout>::iterator it;
    for( it = pThis->m_SavedVoutVec.begin(); it != pThis->m_SavedVoutVec.end(); it++ )
    {
        if( (*it).pVout == pVout )
        {
            msg_Dbg( pIntf, "vout released vout=0x%p, VideoCtrl=0x%p",
                             pVout, (*it).pCtrlVideo );

            // if a video control was being used, detach from it
            if( (*it).pCtrlVideo )
            {
                (*it).pCtrlVideo->detachVoutWindow( );
            }

            // remove resources
            delete (*it).pVoutWindow;
            pThis->m_SavedVoutVec.erase( it );
            break;
        }
    }

    pThis->unlockVout();
}