示例#1
0
/**
 ****************************************************************************
 * Destroy a vlc object (Internal)
 *
 * This function destroys an object that has been previously allocated with
 * vlc_object_create. The object's refcount must be zero and it must not be
 * attached to other objects in any way.
 *
 * This function must be called with cancellation disabled (currently).
 *****************************************************************************/
static void vlc_object_destroy( vlc_object_t *p_this )
{
    vlc_object_internals_t *p_priv = vlc_internals( p_this );

    /* Send a kill to the object's thread if applicable */
    vlc_object_kill( p_this );

    /* Call the custom "subclass" destructor */
    if( p_priv->pf_destructor )
        p_priv->pf_destructor( p_this );

    /* Any thread must have been cleaned up at this point. */
    assert( !p_priv->b_thread );

    /* Destroy the associated variables. */
    var_DestroyAll( p_this );

    vlc_cond_destroy( &p_priv->var_wait );
    vlc_mutex_destroy( &p_priv->var_lock );

    free( p_this->psz_header );

    free( p_priv->psz_name );

    vlc_spin_destroy( &p_priv->ref_spin );
    if( p_priv->pipes[1] != -1 && p_priv->pipes[1] != p_priv->pipes[0] )
        close( p_priv->pipes[1] );
    if( p_priv->pipes[0] != -1 )
        close( p_priv->pipes[0] );
    if( VLC_OBJECT(p_this->p_libvlc) == p_this )
        vlc_mutex_destroy (&(libvlc_priv ((libvlc_int_t *)p_this)->structure_lock));

    free( p_priv );
}
示例#2
0
文件: rotate.c 项目: paa/vlc
/*****************************************************************************
 * Destroy: destroy Distort filter
 *****************************************************************************/
static void Destroy( vlc_object_t *p_this )
{
    filter_t *p_filter = (filter_t *)p_this;

    var_DelCallback( p_filter, FILTER_PREFIX "angle", RotateCallback, p_filter->p_sys );
    var_DelCallback( p_filter, FILTER_PREFIX "deciangle",
                     PreciseRotateCallback, p_filter->p_sys );
    vlc_spin_destroy( &p_filter->p_sys->lock );
    free( p_filter->p_sys );
}
示例#3
0
/*****************************************************************************
 * Destroy
 *****************************************************************************/
static void Destroy( vlc_object_t *p_this )
{
    filter_t *p_filter = (filter_t *)p_this;

    var_DelCallback( p_filter, FILTER_PREFIX "factor",
                     MotionBlurCallback, p_filter->p_sys );
    vlc_spin_destroy( &p_filter->p_sys->lock );

    picture_Release( p_filter->p_sys->p_tmp );
    free( p_filter->p_sys );
}
示例#4
0
文件: maemo.c 项目: CSRedRat/vlc
static void Close( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;

    var_Destroy (p_this->p_libvlc, "hildon-iface");

    gtk_main_quit();
    vlc_join (p_intf->p_sys->thread, NULL);
    vlc_spin_destroy( &p_intf->p_sys->event_lock );
    free( p_intf->p_sys );
}
示例#5
0
void libvlc_log_close( libvlc_log_t *p_log )
{
    if( !p_log )
        return;

    assert( p_log->p_messages );
    msg_Unsubscribe(p_log->p_messages);
    libvlc_release( p_log->p_instance );
    libvlc_log_clear( p_log );
    vlc_spin_destroy( &p_log->data.lock );
    free(p_log);
}
示例#6
0
文件: log.c 项目: Kafay/vlc
void libvlc_log_close( libvlc_log_t *p_log, libvlc_exception_t *p_e )
{
    if( p_log )
    {
        assert( p_log->p_messages );
        msg_Unsubscribe(p_log->p_messages);
        libvlc_release( p_log->p_instance );
        libvlc_log_clear( p_log, p_e );
        vlc_spin_destroy( &p_log->data.lock );
        free(p_log);
    }
    else
        RAISEVOID("Invalid log object!");
}