]> git.sesse.net Git - vlc/blob - src/input/access.c
Remove access-filter support.
[vlc] / src / input / access.c
1 /*****************************************************************************
2  * access.c
3  *****************************************************************************
4  * Copyright (C) 1999-2008 the VideoLAN team
5  * $Id$
6  *
7  * Author: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifdef HAVE_CONFIG_H
25 # include "config.h"
26 #endif
27
28 #include "access.h"
29 #include <libvlc.h>
30
31 /*****************************************************************************
32  * access_New:
33  *****************************************************************************/
34 access_t *__access_New( vlc_object_t *p_obj, const char *psz_access,
35                         const char *psz_demux, const char *psz_path )
36 {
37     access_t *p_access = vlc_custom_create( p_obj, sizeof (*p_access),
38                                             VLC_OBJECT_GENERIC, "access" );
39
40     if( p_access == NULL )
41         return NULL;
42
43     /* */
44     msg_Dbg( p_obj, "creating access '%s' path='%s'",
45              psz_access, psz_path );
46
47     p_access->psz_path   = strdup( psz_path );
48     p_access->psz_access = strdup( psz_access );
49     p_access->psz_demux  = strdup( psz_demux );
50
51     p_access->pf_read    = NULL;
52     p_access->pf_block   = NULL;
53     p_access->pf_seek    = NULL;
54     p_access->pf_control = NULL;
55     p_access->p_sys      = NULL;
56
57     access_InitFields( p_access );
58
59     /* Before module_need (for var_Create...) */
60     vlc_object_attach( p_access, p_obj );
61
62     p_access->p_module = module_need( p_access, "access", psz_access, true );
63
64     if( p_access->p_module == NULL )
65     {
66         vlc_object_detach( p_access );
67         free( p_access->psz_access );
68         free( p_access->psz_path );
69         free( p_access->psz_demux );
70         vlc_object_release( p_access );
71         return NULL;
72     }
73
74     return p_access;
75 }
76
77 /*****************************************************************************
78  * access_Delete:
79  *****************************************************************************/
80 void access_Delete( access_t *p_access )
81 {
82     module_unneed( p_access, p_access->p_module );
83     vlc_object_detach( p_access );
84
85     free( p_access->psz_access );
86     free( p_access->psz_path );
87     free( p_access->psz_demux );
88
89     vlc_object_release( p_access );
90 }
91