1 /*****************************************************************************
2 * playlist.h: Playlist import module common functions
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
7 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
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.
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.
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 *****************************************************************************/
24 #include <vlc_input.h>
26 char *ProcessMRL( char *, char * );
27 char *FindPrefix( demux_t * );
29 int Import_Old ( vlc_object_t * );
31 int Import_Native ( vlc_object_t * );
32 void Close_Native ( vlc_object_t * );
34 int Import_M3U ( vlc_object_t * );
35 void Close_M3U ( vlc_object_t * );
37 int Import_PLS ( vlc_object_t * );
38 void Close_PLS ( vlc_object_t * );
40 int Import_B4S ( vlc_object_t * );
41 void Close_B4S ( vlc_object_t * );
43 int Import_DVB ( vlc_object_t * );
44 void Close_DVB ( vlc_object_t * );
46 int Import_podcast ( vlc_object_t * );
47 void Close_podcast ( vlc_object_t * );
49 int Import_xspf ( vlc_object_t * );
50 void Close_xspf ( vlc_object_t * );
52 int Import_Shoutcast ( vlc_object_t * );
53 void Close_Shoutcast ( vlc_object_t * );
55 int Import_ASX ( vlc_object_t * );
56 void Close_ASX ( vlc_object_t * );
58 int Import_SGIMB ( vlc_object_t * );
59 void Close_SGIMB ( vlc_object_t * );
61 int Import_QTL ( vlc_object_t * );
62 void Close_QTL ( vlc_object_t * );
64 int Import_GVP ( vlc_object_t * );
65 void Close_GVP ( vlc_object_t * );
67 int Import_IFO ( vlc_object_t * );
68 void Close_IFO ( vlc_object_t * );
70 int Import_VideoPortal ( vlc_object_t * );
71 void Close_VideoPortal ( vlc_object_t * );
73 int Import_iTML ( vlc_object_t * );
74 void Close_iTML ( vlc_object_t * );
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 );
80 #define HANDLE_PLAY_AND_RELEASE \
81 vlc_object_release( p_input_thread );
84 #define STANDARD_DEMUX_INIT_MSG( msg ) do { \
85 DEMUX_INIT_COMMON(); \
86 msg_Dbg( p_demux, "%s", msg ); } while(0)
88 #define DEMUX_BY_EXTENSION_MSG( ext, msg ) \
89 demux_t *p_demux = (demux_t *)p_this; \
90 if( !demux_IsPathExtension( p_demux, ext ) ) \
91 return VLC_EGENERIC; \
92 STANDARD_DEMUX_INIT_MSG( msg );
94 #define DEMUX_BY_EXTENSION_OR_FORCED_MSG( ext, module, msg ) \
95 demux_t *p_demux = (demux_t *)p_this; \
96 if( !demux_IsPathExtension( p_demux, ext ) && !demux_IsForced( p_demux, module ) ) \
97 return VLC_EGENERIC; \
98 STANDARD_DEMUX_INIT_MSG( msg );
101 #define CHECK_PEEK( zepeek, size ) do { \
102 if( stream_Peek( p_demux->s , &zepeek, size ) < size ){ \
103 msg_Dbg( p_demux, "not enough data" ); return VLC_EGENERIC; } } while(0)
105 #define POKE( peek, stuff, size ) (strncasecmp( (const char *)peek, stuff, size )==0)