~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to src/input/access.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * access.c
3
3
 *****************************************************************************
4
4
 * Copyright (C) 1999-2004 the VideoLAN team
5
 
 * $Id: 394bf9814ef879bd59af347fd78864d1e295906d $
 
5
 * $Id$
6
6
 *
7
7
 * Author: Laurent Aimar <fenrir@via.ecp.fr>
8
8
 *
21
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
22
 *****************************************************************************/
23
23
 
24
 
#include <stdlib.h>
25
 
#include <vlc/vlc.h>
26
 
#include <vlc/input.h>
 
24
#ifdef HAVE_CONFIG_H
 
25
# include "config.h"
 
26
#endif
 
27
 
 
28
#include <vlc_common.h>
27
29
 
28
30
#include "input_internal.h"
29
31
 
30
32
/*****************************************************************************
31
 
 * access2_InternalNew:
 
33
 * access_InternalNew:
32
34
 *****************************************************************************/
33
 
static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
34
 
                                      char *psz_demux, char *psz_path,
35
 
                                      access_t *p_source, vlc_bool_t b_quick )
 
35
static access_t *access_InternalNew( vlc_object_t *p_obj, const char *psz_access,
 
36
                                      const char *psz_demux, const char *psz_path,
 
37
                                      access_t *p_source )
36
38
{
37
 
    access_t *p_access = vlc_object_create( p_obj, VLC_OBJECT_ACCESS );
 
39
    static const char typename[] = "access";
 
40
    access_t *p_access = vlc_custom_create( p_obj, sizeof (*p_access),
 
41
                                            VLC_OBJECT_GENERIC, typename );
38
42
 
39
43
    if( p_access == NULL )
40
 
    {
41
 
        msg_Err( p_obj, "vlc_object_create() failed" );
42
44
        return NULL;
43
 
    }
44
45
 
45
46
    /* Parse URL */
46
47
    p_access->p_source = p_source;
47
48
    if( p_source )
48
49
    {
49
50
        msg_Dbg( p_obj, "creating access filter '%s'", psz_access );
50
 
        p_access->psz_access = strdup( p_source->psz_access );
51
 
        p_access->psz_path   = strdup( p_source->psz_path );
52
 
        p_access->psz_demux   = strdup( p_source->psz_demux );
53
51
    }
54
52
    else
55
53
    {
 
54
        msg_Dbg( p_obj, "creating access '%s' path='%s'",
 
55
                 psz_access, psz_path );
56
56
        p_access->psz_path   = strdup( psz_path );
57
 
        p_access->psz_access =
58
 
            b_quick ? strdup( "file" ) : strdup( psz_access );
59
 
        p_access->psz_demux  = strdup( psz_demux );
60
 
 
61
 
        if( !b_quick )
62
 
            msg_Dbg( p_obj, "creating access '%s' path='%s'",
63
 
                     psz_access, psz_path );
64
57
    }
 
58
    p_access->psz_access = strdup( psz_access );
 
59
    p_access->psz_demux  = strdup( psz_demux );
65
60
 
66
61
    p_access->pf_read    = NULL;
67
62
    p_access->pf_block   = NULL;
71
66
    p_access->info.i_update = 0;
72
67
    p_access->info.i_size   = 0;
73
68
    p_access->info.i_pos    = 0;
74
 
    p_access->info.b_eof    = VLC_FALSE;
75
 
    p_access->info.b_prebuffered = VLC_FALSE;
 
69
    p_access->info.b_eof    = false;
 
70
    p_access->info.b_prebuffered = false;
76
71
    p_access->info.i_title  = 0;
77
72
    p_access->info.i_seekpoint = 0;
78
73
 
80
75
    /* Before module_Need (for var_Create...) */
81
76
    vlc_object_attach( p_access, p_obj );
82
77
 
83
 
    if( p_source )
84
 
    {
85
 
        p_access->p_module =
86
 
            module_Need( p_access, "access_filter", psz_access, VLC_FALSE );
87
 
    }
88
 
    else
89
 
    {
90
 
        p_access->p_module =
91
 
            module_Need( p_access, "access2", p_access->psz_access,
92
 
                         b_quick ? VLC_TRUE : VLC_FALSE );
93
 
    }
 
78
    p_access->p_module =
 
79
         module_Need( p_access, p_source ? "access_filter" : "access",
 
80
                      psz_access, true );
94
81
 
95
82
    if( p_access->p_module == NULL )
96
83
    {
 
84
        msg_StackAdd( "could not create access" );
97
85
        vlc_object_detach( p_access );
98
86
        free( p_access->psz_access );
99
87
        free( p_access->psz_path );
100
88
        free( p_access->psz_demux );
101
 
        vlc_object_destroy( p_access );
 
89
        vlc_object_release( p_access );
102
90
        return NULL;
103
91
    }
104
92
 
106
94
}
107
95
 
108
96
/*****************************************************************************
109
 
 * access2_New:
110
 
 *****************************************************************************/
111
 
access_t *__access2_New( vlc_object_t *p_obj, char *psz_access,
112
 
                         char *psz_demux, char *psz_path, vlc_bool_t b_quick )
113
 
{
114
 
    return access2_InternalNew( p_obj, psz_access, psz_demux,
115
 
                                psz_path, NULL, b_quick );
116
 
}
117
 
 
118
 
/*****************************************************************************
119
 
 * access2_FilterNew:
120
 
 *****************************************************************************/
121
 
access_t *access2_FilterNew( access_t *p_source, char *psz_access_filter )
122
 
{
123
 
    return access2_InternalNew( VLC_OBJECT(p_source), psz_access_filter,
124
 
                                NULL, NULL, p_source, VLC_FALSE );
125
 
}
126
 
 
127
 
/*****************************************************************************
128
 
 * access2_Delete:
129
 
 *****************************************************************************/
130
 
void access2_Delete( access_t *p_access )
 
97
 * access_New:
 
98
 *****************************************************************************/
 
99
access_t *__access_New( vlc_object_t *p_obj, const char *psz_access,
 
100
                         const char *psz_demux, const char *psz_path )
 
101
{
 
102
    return access_InternalNew( p_obj, psz_access, psz_demux,
 
103
                                psz_path, NULL );
 
104
}
 
105
 
 
106
/*****************************************************************************
 
107
 * access_FilterNew:
 
108
 *****************************************************************************/
 
109
access_t *access_FilterNew( access_t *p_source, const char *psz_access_filter )
 
110
{
 
111
    return access_InternalNew( VLC_OBJECT(p_source), psz_access_filter,
 
112
                                p_source->psz_demux, p_source->psz_path,
 
113
                                p_source );
 
114
}
 
115
 
 
116
/*****************************************************************************
 
117
 * access_Delete:
 
118
 *****************************************************************************/
 
119
void access_Delete( access_t *p_access )
131
120
{
132
121
    module_Unneed( p_access, p_access->p_module );
133
122
    vlc_object_detach( p_access );
138
127
 
139
128
    if( p_access->p_source )
140
129
    {
141
 
        access2_Delete( p_access->p_source );
 
130
        access_Delete( p_access->p_source );
142
131
    }
143
132
 
144
 
    vlc_object_destroy( p_access );
 
133
    vlc_object_release( p_access );
145
134
}
146
135