]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/playlist.h
Split RAM playlist support from m3u to its own demuxer and fix its support.
[vlc] / modules / demux / playlist / playlist.h
index 3103ae8d71965ef4cef43acbefe7c64bd2e64922..13803f6bb580d1c4017006295a5342a16e5bda8f 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-char *E_(ProcessMRL)( char *, char * );
-char *E_(FindPrefix)( demux_t * );
+#include <vlc_input.h>
 
-vlc_bool_t E_(FindItem)( demux_t *, playlist_t *, playlist_item_t **);
+char *ProcessMRL( char *, char * );
+char *FindPrefix( demux_t * );
 
-void E_(AddToPlaylist)( demux_t *, playlist_t*,input_item_t*,playlist_item_t*,int );
+int Import_Old ( vlc_object_t * );
 
-int E_(Import_Old) ( vlc_object_t * );
+int Import_Native ( vlc_object_t * );
+void Close_Native ( vlc_object_t * );
 
-int E_(Import_Native) ( vlc_object_t * );
-void E_(Close_Native) ( vlc_object_t * );
+int Import_M3U ( vlc_object_t * );
+void Close_M3U ( vlc_object_t * );
 
-int E_(Import_M3U) ( vlc_object_t * );
-void E_(Close_M3U) ( vlc_object_t * );
+int Import_RAM ( vlc_object_t * );
+void Close_RAM ( vlc_object_t * );
 
-int E_(Import_PLS) ( vlc_object_t * );
-void E_(Close_PLS) ( vlc_object_t * );
+int Import_PLS ( vlc_object_t * );
+void Close_PLS ( vlc_object_t * );
 
-int E_(Import_B4S) ( vlc_object_t * );
-void E_(Close_B4S) ( vlc_object_t * );
+int Import_B4S ( vlc_object_t * );
+void Close_B4S ( vlc_object_t * );
 
-int E_(Import_DVB) ( vlc_object_t * );
-void E_(Close_DVB) ( vlc_object_t * );
+int Import_DVB ( vlc_object_t * );
+void Close_DVB ( vlc_object_t * );
 
-int E_(Import_podcast) ( vlc_object_t * );
-void E_(Close_podcast) ( vlc_object_t * );
+int Import_podcast ( vlc_object_t * );
+void Close_podcast ( vlc_object_t * );
 
-int E_(xspf_import_Activate) ( vlc_object_t * );
+int Import_xspf ( vlc_object_t * );
+void Close_xspf ( vlc_object_t * );
 
-int E_(Import_Shoutcast) ( vlc_object_t * );
-void E_(Close_Shoutcast) ( vlc_object_t * );
+int Import_Shoutcast ( vlc_object_t * );
+void Close_Shoutcast ( vlc_object_t * );
+
+int Import_ASX ( vlc_object_t * );
+void Close_ASX ( vlc_object_t * );
+
+int Import_SGIMB ( vlc_object_t * );
+void Close_SGIMB ( vlc_object_t * );
+
+int Import_QTL ( vlc_object_t * );
+void Close_QTL ( vlc_object_t * );
+
+int Import_GVP ( vlc_object_t * );
+void Close_GVP ( vlc_object_t * );
+
+int Import_IFO ( vlc_object_t * );
+void Close_IFO ( vlc_object_t * );
+
+int Import_VideoPortal ( vlc_object_t * );
+void Close_VideoPortal ( vlc_object_t * );
+
+int Import_iTML ( vlc_object_t * );
+void Close_iTML ( vlc_object_t * );
 
 #define INIT_PLAYLIST_STUFF \
-    int i_parent_id; \
-    vlc_bool_t b_play; \
-    playlist_item_t *p_current, *p_item_in_category = NULL; \
-    input_item_t *p_input; \
-    playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_demux, \
-                                        VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); \
-    if( !p_playlist ) \
-    { \
-        msg_Err( p_demux, "can't find playlist" ); \
-        return VLC_EGENERIC; \
-    } \
-    i_parent_id = var_CreateGetInteger( p_demux, "parent-item" ); \
-    if( i_parent_id > 0 ) \
-    { \
-        b_play = VLC_FALSE;     \
-        p_current = playlist_ItemGetById( p_playlist, i_parent_id );    \
-    } \
-    else \
-    { \
-        b_play = E_(FindItem)( p_demux, p_playlist, &p_current ); \
-        p_item_in_category = playlist_ItemToNode( p_playlist, p_current ); \
-        p_current->p_input->i_type = ITEM_TYPE_PLAYLIST;        \
-    }
+    input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
+    input_item_t *p_current_input = input_GetItem( p_input_thread );
 
 #define HANDLE_PLAY_AND_RELEASE \
-    /* Go back and play the playlist */ \
-    if( b_play && p_playlist->status.p_item && \
-                  p_playlist->status.p_item->i_children > 0 ) \
-    { \
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242, \
-                          p_playlist->status.p_item, NULL ); \
-    } \
-    vlc_object_release( p_playlist );
+    vlc_object_release( p_input_thread );
+
+
+#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)