#include <vlc_input.h>
#include <vlc_playlist.h>
#include <vlc_meta.h>
+#include <vlc_meta_fetcher.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_stream.h>
+#include <vlc_demux.h>
#define LUA_COMPAT_MODULE
#include <lua.h> /* Low level lua C API */
/*****************************************************************************
* Module entry points
*****************************************************************************/
-int ReadMeta( vlc_object_t * );
-int FetchMeta( vlc_object_t * );
-int FindArt( vlc_object_t * );
+int ReadMeta( demux_meta_t * );
+int FetchMeta( meta_fetcher_t * );
+int FindArt( meta_fetcher_t * );
int Import_LuaPlaylist( vlc_object_t * );
void Close_LuaPlaylist( vlc_object_t * );
#define vlclua_set_this(a, b) vlclua_set_this(a, VLC_OBJECT(b))
vlc_object_t * vlclua_get_this( lua_State * );
+void vlclua_set_playlist_internal( lua_State *, playlist_t * );
+playlist_t * vlclua_get_playlist_internal( lua_State * );
+
/*****************************************************************************
* Lua function bridge
*****************************************************************************/
* Will execute func on all scripts in luadirname, and stop if func returns
* success.
*****************************************************************************/
+typedef struct luabatch_context_t luabatch_context_t;
+struct luabatch_context_t
+{
+ input_item_t *p_item;
+ meta_fetcher_scope_t e_scope;
+ bool (*pf_validator)( const luabatch_context_t *, meta_fetcher_scope_t );
+};
+
int vlclua_scripts_batch_execute( vlc_object_t *p_this, const char * luadirname,
- int (*func)(vlc_object_t *, const char *, void *),
+ int (*func)(vlc_object_t *, const char *, const luabatch_context_t *),
void * user_data );
int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list );
void vlclua_dir_list_free( char **ppsz_dir_list );
int vlclua_add_modules_path( lua_State *, const char *psz_filename );
+/**
+ * File descriptors table
+ */
+typedef struct
+{
+ int *fdv;
+ unsigned fdc;
+ int fd[2];
+} vlclua_dtable_t;
+
+int vlclua_fd_init( lua_State *, vlclua_dtable_t * );
+void vlclua_fd_interrupt( vlclua_dtable_t * );
+void vlclua_fd_cleanup( vlclua_dtable_t * );
+
/**
* Per-interface private state
*/
{
char *psz_filename;
lua_State *L;
-#ifndef _WIN32
- int fd[2];
-#endif
- int fds[64];
-
vlc_thread_t thread;
+ vlclua_dtable_t dtable;
};
-void vlclua_fd_init( struct intf_sys_t * );
-void vlclua_fd_destroy( struct intf_sys_t * );
-
#endif /* VLC_LUA_H */