Exemplo n.º 1
0
VLMDialog::~VLMDialog()
{
    delete vlmWrapper;

    //writeSettings( "VLM" );
   /* TODO :you have to destroy vlm here to close
    * but we shouldn't destroy vlm here in case somebody else wants it */
    if( p_vlm )
    {
        vlm_Delete( p_vlm );
    }
}
Exemplo n.º 2
0
VLMDialog::~VLMDialog()
{
    delete vlmWrapper;

    getSettings()->setValue("VLM/geometry", saveGeometry());
   /* TODO :you have to destroy vlm here to close
    * but we shouldn't destroy vlm here in case somebody else wants it */
    if( p_vlm )
    {
        vlm_Delete( p_vlm );
    }
}
Exemplo n.º 3
0
void libvlc_vlm_release( libvlc_instance_t *p_instance, libvlc_exception_t *p_exception)
{
#ifdef ENABLE_VLM
    vlm_t *p_vlm;

    VLM(p_vlm);

    vlm_Delete( p_vlm );
#else
    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
    return VLC_EGENERIC;
#endif
}
Exemplo n.º 4
0
/**
 * Cleanup a libvlc instance. The instance is not completely deallocated
 * \param p_libvlc the instance to clean
 */
void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
{
    libvlc_priv_t *priv = libvlc_priv (p_libvlc);

    /* Ask the interfaces to stop and destroy them */
    msg_Dbg( p_libvlc, "removing all interfaces" );
    libvlc_Quit( p_libvlc );
    intf_DestroyAll( p_libvlc );

#ifdef ENABLE_VLM
    /* Destroy VLM if created in libvlc_InternalInit */
    if( priv->p_vlm )
    {
        vlm_Delete( priv->p_vlm );
    }
#endif

    /* Free playlist now, all threads are gone */
    playlist_t *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
    if( p_playlist != NULL )
        playlist_Destroy( p_playlist );

#if !defined( _WIN32 ) && !defined( __OS2__ )
    char *pidfile = var_InheritString( p_libvlc, "pidfile" );
    if( pidfile != NULL )
    {
        msg_Dbg( p_libvlc, "removing PID file %s", pidfile );
        if( unlink( pidfile ) )
            msg_Warn( p_libvlc, "cannot remove PID file %s: %s",
                      pidfile, vlc_strerror_c(errno) );
        free( pidfile );
    }
#endif

    if (priv->parser != NULL)
        playlist_preparser_Delete(priv->parser);

    vlc_DeinitActions( p_libvlc, priv->actions );

    /* Save the configuration */
    if( !var_InheritBool( p_libvlc, "ignore-config" ) )
        config_AutoSaveConfigFile( VLC_OBJECT(p_libvlc) );

    /* Free module bank. It is refcounted, so we call this each time  */
    module_EndBank (true);
    vlc_LogDeinit (p_libvlc);
#if defined(_WIN32) || defined(__OS2__)
    system_End( );
#endif
}
Exemplo n.º 5
0
Arquivo: http.c Projeto: paa/vlc
/*****************************************************************************
 * Close: destroy interface
 *****************************************************************************/
static void Close ( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;
    intf_sys_t    *p_sys = p_intf->p_sys;
    int i;
    httpd_handler_sys_t *p_art_handler_sys = NULL;

#ifdef ENABLE_VLM
    if( p_sys->p_vlm )
        vlm_Delete( p_sys->p_vlm );
#endif
    for( i = 0; i < p_sys->i_files; i++ )
    {
        if( p_sys->pp_files[i]->b_handler )
            httpd_HandlerDelete( ((httpd_handler_sys_t *)p_sys->pp_files[i])->p_handler );
        else
            httpd_FileDelete( p_sys->pp_files[i]->p_file );
        if( p_sys->pp_files[i]->p_redir )
            httpd_RedirectDelete( p_sys->pp_files[i]->p_redir );
        if( p_sys->pp_files[i]->p_redir2 )
            httpd_RedirectDelete( p_sys->pp_files[i]->p_redir2 );

        free( p_sys->pp_files[i]->file );
        free( p_sys->pp_files[i]->name );
        free( p_sys->pp_files[i] );
    }
    free( p_sys->pp_files );
    for( i = 0; i < p_sys->i_handlers; i++ )
    {
        http_association_t *p_handler = p_sys->pp_handlers[i];
        int j;
        free( p_handler->psz_ext );
        for( j = 0; j < p_handler->i_argc; j++ )
            free( p_handler->ppsz_argv[j] );
        if( p_handler->i_argc )
            free( p_handler->ppsz_argv );
        free( p_handler );
    }
    if( p_sys->i_handlers )
        free( p_sys->pp_handlers );
    if( p_sys->p_art_handler )
        p_art_handler_sys = httpd_HandlerDelete( p_sys->p_art_handler );
    httpd_HostDelete( p_sys->p_httpd_host );
    free( p_sys->psz_address );
    free( p_sys );
    free( p_art_handler_sys );
}
Exemplo n.º 6
0
Arquivo: vlm.c Projeto: Aakash-729/vlc
static void libvlc_vlm_release_internal( libvlc_instance_t *p_instance )
{
    vlm_t *p_vlm = p_instance->libvlc_vlm.p_vlm;
    if( !p_instance->libvlc_vlm.p_vlm )
        return;
    /* We need to remove medias in order to receive events */
    vlm_Control( p_vlm, VLM_CLEAR_MEDIAS );
    vlm_Control( p_vlm, VLM_CLEAR_SCHEDULES );

    var_DelCallback( (vlc_object_t *)p_vlm, "intf-event", VlmEvent,
                     p_instance->libvlc_vlm.p_event_manager );
    p_instance->libvlc_vlm.pf_release = NULL;
    libvlc_event_manager_release( p_instance->libvlc_vlm.p_event_manager );
    p_instance->libvlc_vlm.p_event_manager = NULL;
    vlm_Delete( p_vlm );
    p_instance->libvlc_vlm.p_vlm = NULL;
}
Exemplo n.º 7
0
Arquivo: vlm.c Projeto: IAPark/vlc
void libvlc_vlm_release( libvlc_instance_t *p_instance )
{
    vlm_t *p_vlm = p_instance->vlm->p_vlm;
    if( !p_vlm )
        return;
    /* We need to remove medias in order to receive events */
    vlm_Control( p_vlm, VLM_CLEAR_MEDIAS );
    vlm_Control( p_vlm, VLM_CLEAR_SCHEDULES );

    var_DelCallback( (vlc_object_t *)p_vlm, "intf-event", VlmEvent,
                     &p_instance->vlm->event_manager );
    libvlc_event_manager_destroy( &p_instance->vlm->event_manager );
    vlm_Delete( p_vlm );
    free( p_instance->vlm );
    p_instance->vlm = NULL;
    libvlc_release( p_instance );
}
Exemplo n.º 8
0
/*****************************************************************************
 * Close:
 *****************************************************************************/
static void Close( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t*)p_this;
    intf_sys_t    *p_sys  = p_intf->p_sys;
    int i;

    for( i = 0; i < p_sys->i_clients; i++ )
    {
        telnet_client_t *cl = p_sys->clients[i];

        net_Close( cl->fd );
        free( cl );
    }
    if( p_sys->clients != NULL ) free( p_sys->clients );

    net_ListenClose( p_sys->pi_fd );

    vlm_Delete( p_sys->mediatheque );

    free( p_sys );
}
Exemplo n.º 9
0
/**
 * Cleanup a libvlc instance. The instance is not completely deallocated
 * \param p_libvlc the instance to clean
 */
void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
{
    libvlc_priv_t *priv = libvlc_priv (p_libvlc);
    playlist_t    *p_playlist = libvlc_priv (p_libvlc)->p_playlist;

    /* Deactivate the playlist */
    msg_Dbg( p_libvlc, "deactivating the playlist" );
    pl_Deactivate( p_libvlc );

    /* Remove all services discovery */
    msg_Dbg( p_libvlc, "removing all services discovery tasks" );
    playlist_ServicesDiscoveryKillAll( p_playlist );

    /* Ask the interfaces to stop and destroy them */
    msg_Dbg( p_libvlc, "removing all interfaces" );
    libvlc_Quit( p_libvlc );
    intf_DestroyAll( p_libvlc );

#ifdef ENABLE_VLM
    /* Destroy VLM if created in libvlc_InternalInit */
    if( priv->p_vlm )
    {
        vlm_Delete( priv->p_vlm );
    }
#endif

#if defined(MEDIA_LIBRARY)
    media_library_t* p_ml = priv->p_ml;
    if( p_ml )
    {
        ml_Destroy( VLC_OBJECT( p_ml ) );
        vlc_object_release( p_ml );
        libvlc_priv(p_playlist->p_libvlc)->p_ml = NULL;
    }
#endif

    /* Free playlist now, all threads are gone */
    playlist_Destroy( p_playlist );

    msg_Dbg( p_libvlc, "removing stats" );

#if !defined( WIN32 ) && !defined( __OS2__ )
    char* psz_pidfile = NULL;

    if( b_daemon )
    {
        psz_pidfile = var_CreateGetNonEmptyString( p_libvlc, "pidfile" );
        if( psz_pidfile != NULL )
        {
            msg_Dbg( p_libvlc, "removing pid file %s", psz_pidfile );
            if( unlink( psz_pidfile ) == -1 )
            {
                msg_Dbg( p_libvlc, "removing pid file %s: %m",
                        psz_pidfile );
            }
        }
        free( psz_pidfile );
    }
#endif

    /* Save the configuration */
    if( !var_InheritBool( p_libvlc, "ignore-config" ) )
        config_AutoSaveConfigFile( VLC_OBJECT(p_libvlc) );

    /* Free module bank. It is refcounted, so we call this each time  */
    module_EndBank (true);

    vlc_DeinitActions( p_libvlc, priv->actions );
}
Exemplo n.º 10
0
static int vlclua_vlm_delete( lua_State *L )
{
    vlm_t **pp_vlm = (vlm_t**)luaL_checkudata( L, 1, "vlm" );
    vlm_Delete( *pp_vlm );
    return 0;
}