playlist.h 3.46 KB
Newer Older
1 2 3
/*****************************************************************************
 * playlist.h:  Playlist import module common functions
 *****************************************************************************
4
 * Copyright (C) 2004 the VideoLAN team
5
 * $Id$
6
 *
7
 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
Antoine Cellerier's avatar
Antoine Cellerier committed
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23
 *****************************************************************************/

24 25
#include <vlc_input.h>

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
26 27
char *ProcessMRL( char *, char * );
char *FindPrefix( demux_t * );
28

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
29
int Import_Old ( vlc_object_t * );
30

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
31 32
int Import_Native ( vlc_object_t * );
void Close_Native ( vlc_object_t * );
Clément Stenac's avatar
Clément Stenac committed
33

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
34 35
int Import_M3U ( vlc_object_t * );
void Close_M3U ( vlc_object_t * );
36

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
37 38
int Import_PLS ( vlc_object_t * );
void Close_PLS ( vlc_object_t * );
39

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
40 41
int Import_B4S ( vlc_object_t * );
void Close_B4S ( vlc_object_t * );
42

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
43 44
int Import_DVB ( vlc_object_t * );
void Close_DVB ( vlc_object_t * );
45

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
46 47
int Import_podcast ( vlc_object_t * );
void Close_podcast ( vlc_object_t * );
48

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
49 50
int Import_xspf ( vlc_object_t * );
void Close_xspf ( vlc_object_t * );
51

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
52 53
int Import_Shoutcast ( vlc_object_t * );
void Close_Shoutcast ( vlc_object_t * );
54

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
55 56
int Import_ASX ( vlc_object_t * );
void Close_ASX ( vlc_object_t * );
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
57

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
58 59
int Import_SGIMB ( vlc_object_t * );
void Close_SGIMB ( vlc_object_t * );
60

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
61 62
int Import_QTL ( vlc_object_t * );
void Close_QTL ( vlc_object_t * );
63

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
64 65
int Import_GVP ( vlc_object_t * );
void Close_GVP ( vlc_object_t * );
66

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
67 68
int Import_IFO ( vlc_object_t * );
void Close_IFO ( vlc_object_t * );
69

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
70 71
int Import_VideoPortal ( vlc_object_t * );
void Close_VideoPortal ( vlc_object_t * );
72

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
73 74
int Import_iTML ( vlc_object_t * );
void Close_iTML ( vlc_object_t * );
75

76
#define INIT_PLAYLIST_STUFF \
77
    input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
78
    input_item_t *p_current_input = input_GetItem( p_input_thread );
79 80

#define HANDLE_PLAY_AND_RELEASE \
81
    vlc_object_release( p_input_thread );
Laurent Aimar's avatar
Laurent Aimar committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106


#define STANDARD_DEMUX_INIT_MSG( msg ) do { \
    DEMUX_INIT_COMMON();                    \
    msg_Dbg( p_demux, "%s", msg ); } while(0)

#define DEMUX_BY_EXTENSION_MSG( ext, msg ) \
    demux_t *p_demux = (demux_t *)p_this; \
    if( !demux_IsPathExtension( p_demux, ext ) ) \
        return VLC_EGENERIC; \
    STANDARD_DEMUX_INIT_MSG( msg );

#define DEMUX_BY_EXTENSION_OR_FORCED_MSG( ext, module, msg ) \
    demux_t *p_demux = (demux_t *)p_this; \
    if( !demux_IsPathExtension( p_demux, ext ) && !demux_IsForced( p_demux, module ) ) \
        return VLC_EGENERIC; \
    STANDARD_DEMUX_INIT_MSG( msg );


#define CHECK_PEEK( zepeek, size ) do { \
    if( stream_Peek( p_demux->s , &zepeek, size ) < size ){ \
        msg_Dbg( p_demux, "not enough data" ); return VLC_EGENERIC; } } while(0)

#define POKE( peek, stuff, size ) (strncasecmp( (const char *)peek, stuff, size )==0)