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

« back to all changes in this revision

Viewing changes to src/input/demux.c

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-06-25 01:09:16 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100625010916-asxhep2mutg6g6pd
Tags: 1.1.0-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports
* Drop xulrunner patches.
* Drop 502_xulrunner_191.diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * demux.c
3
3
 *****************************************************************************
4
4
 * Copyright (C) 1999-2004 the VideoLAN team
5
 
 * $Id: b939c101eb2fdb42bb26dd3b25ff70414bd8f31e $
 
5
 * $Id: 981799ff2d7da30693b11f4065824f186f64c405 $
6
6
 *
7
7
 * Author: Laurent Aimar <fenrir@via.ecp.fr>
8
8
 *
37
37
 * demux_New:
38
38
 *  if s is NULL then load a access_demux
39
39
 *****************************************************************************/
40
 
demux_t *__demux_New( vlc_object_t *p_obj,
 
40
demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
41
41
                       const char *psz_access, const char *psz_demux,
42
42
                       const char *psz_path,
43
43
                       stream_t *s, es_out_t *out, bool b_quick )
49
49
 
50
50
    if( p_demux == NULL ) return NULL;
51
51
 
 
52
    p_demux->p_input = p_parent_input;
 
53
 
52
54
    /* Parse URL */
53
55
    p_demux->psz_access = strdup( psz_access );
54
56
    p_demux->psz_demux  = strdup( psz_demux );
165
167
 
166
168
        p_demux->p_module =
167
169
            module_need( p_demux, "demux", psz_module,
168
 
                         !strcmp( psz_module, p_demux->psz_demux ) ?
169
 
                         true : false );
 
170
                         !strcmp( psz_module, p_demux->psz_demux ) );
170
171
    }
171
172
    else
172
173
    {
173
174
        p_demux->p_module =
174
175
            module_need( p_demux, "access_demux", psz_module,
175
 
                         !strcmp( psz_module, p_demux->psz_access ) ?
176
 
                         true : false );
 
176
                         !strcmp( psz_module, p_demux->psz_access ) );
177
177
    }
178
178
 
179
179
    if( p_demux->p_module == NULL )
180
180
    {
181
 
        vlc_object_detach( p_demux );
182
181
        free( p_demux->psz_path );
183
182
        free( p_demux->psz_demux );
184
183
        free( p_demux->psz_access );
195
194
void demux_Delete( demux_t *p_demux )
196
195
{
197
196
    module_unneed( p_demux, p_demux->p_module );
198
 
    vlc_object_detach( p_demux );
199
197
 
200
198
    free( p_demux->psz_path );
201
199
    free( p_demux->psz_demux );
205
203
}
206
204
 
207
205
/*****************************************************************************
 
206
 * demux_GetParentInput:
 
207
 *****************************************************************************/
 
208
input_thread_t * demux_GetParentInput( demux_t *p_demux )
 
209
{
 
210
    return p_demux->p_input ? vlc_object_hold((vlc_object_t*)p_demux->p_input) : NULL;
 
211
}
 
212
 
 
213
 
 
214
/*****************************************************************************
208
215
 * demux_vaControlHelper:
209
216
 *****************************************************************************/
210
217
int demux_vaControlHelper( stream_t *s,
301
308
 ****************************************************************************/
302
309
decoder_t *demux_PacketizerNew( demux_t *p_demux, es_format_t *p_fmt, const char *psz_msg )
303
310
{
304
 
    decoder_t *p_packetizer = vlc_object_create( p_demux, VLC_OBJECT_PACKETIZER );
305
 
 
 
311
    decoder_t *p_packetizer;
 
312
    p_packetizer = vlc_custom_create( p_demux, sizeof( *p_packetizer ),
 
313
                                      VLC_OBJECT_GENERIC, "demux packetizer" );
306
314
    if( !p_packetizer )
307
315
    {
308
316
        es_format_Clean( p_fmt );
318
326
    p_packetizer->fmt_in = *p_fmt;
319
327
    es_format_Init( &p_packetizer->fmt_out, UNKNOWN_ES, 0 );
320
328
 
 
329
    vlc_object_attach( p_packetizer, p_demux );
321
330
    p_packetizer->p_module = module_need( p_packetizer, "packetizer", NULL, false );
322
331
    if( !p_packetizer->p_module )
323
332
    {
329
338
 
330
339
    return p_packetizer;
331
340
}
 
341
 
332
342
void demux_PacketizerDestroy( decoder_t *p_packetizer )
333
343
{
334
344
    if( p_packetizer->p_module )