
Data Structures | |
| struct | stream_sys_t |
| ************************************************************************** Struct definitions More... | |
| struct | item |
| struct | node |
Defines | |
| #define | FILENAME_TEXT N_( "Media in Zip" ) |
| ************************************************************************** Preamble | |
| #define | FILENAME_LONGTEXT N_( "Path to the media in the Zip archive" ) |
Typedefs | |
| typedef struct node | node |
| typedef struct item | item |
Functions | |
| int | vlc_entry__main (module_t *p_module) |
| ************************************************************************** Module descriptor | |
| const char * | vlc_entry_license__main (void) |
| static int | Read (stream_t *, void *p_read, unsigned int i_read) |
| ************************************************************************* Local prototypes | |
| static int | Peek (stream_t *s, const uint8_t **pp_peek, unsigned int i_peek) |
| ************************************************************************* Peek | |
| static int | Control (stream_t *s, int i_query, va_list args) |
| ************************************************************************* Control | |
| static int | Fill (stream_t *) |
| static int | CreatePlaylist (stream_t *s, char **pp_buffer) |
| static int | GetFilesInZip (stream_t *p_this, unzFile file, vlc_array_t *p_filenames, vlc_array_t *p_fileinfos) |
| ************************************************************************** Zip utility functions | |
| static node * | findOrCreateParentNode (node *root, const char *fullpath) |
| ************************************************************************** | |
| static int | WriteXSPF (char **pp_buffer, vlc_array_t *p_filenames, const char *psz_zippath) |
| ************************************************************************** | |
| static int | nodeToXSPF (char **pp_buffer, node *n, bool b_root) |
| ************************************************************************** | |
| static node * | new_node (char *name) |
| ************************************************************************** Some helpers | |
| static item * | new_item (int id) |
| static void | free_all_node (node *root) |
| static int | astrcatf (char **ppsz_dest, const char *psz_fmt_src,...) |
| int | StreamOpen (vlc_object_t *p_this) |
| ************************************************************************** Open | |
| void | StreamClose (vlc_object_t *p_this) |
| ************************************************************************* Close | |
| bool | isAllowedChar (char c) |
| ************************************************************************** XSPF generation functions | |
| static int | escapeToXml (char **ppsz_encoded, const char *psz_url) |
| ************************************************************************** | |
| static void ZCALLBACK * | ZipIO_Open (void *opaque, const char *file, int mode) |
| ************************************************************************** ZipIO function definitions : how to use vlc_stream to read the zip | |
| static unsigned long ZCALLBACK | ZipIO_Read (void *opaque, void *stream, void *buf, unsigned long size) |
| ************************************************************************** | |
| static long ZCALLBACK | ZipIO_Tell (void *opaque, void *stream) |
| ************************************************************************** | |
| static long ZCALLBACK | ZipIO_Seek (void *opaque, void *stream, unsigned long offset, int origin) |
| ************************************************************************** | |
| static int ZCALLBACK | ZipIO_Close (void *opaque, void *stream) |
| ************************************************************************** | |
| static uLong ZCALLBACK | ZipIO_Write (void *opaque, void *stream, const void *buf, uLong size) |
| ************************************************************************** | |
| static int ZCALLBACK | ZipIO_Error (void *opaque, void *stream) |
| ************************************************************************** | |
Variables | |
| static const uint8_t | p_zip_marker [] = { 0x50, 0x4b, 0x03, 0x04 } |
| ************************************************************************** Zip file identifier | |
| static const int | i_zip_marker = 4 |
| #define FILENAME_LONGTEXT N_( "Path to the media in the Zip archive" ) |
| #define FILENAME_TEXT N_( "Media in Zip" ) |
************************************************************************** Preamble
| static int astrcatf | ( | char ** | ppsz_dest, | |
| const char * | psz_fmt_src, | |||
| ... | ||||
| ) | [static] |
| static int Control | ( | stream_t * | s, | |
| int | i_query, | |||
| va_list | args | |||
| ) | [static] |
************************************************************************* Control
References stream_sys_t::i_len, stream_sys_t::i_pos, stream_t::p_source, stream_t::p_sys, p_sys, STREAM_CAN_FASTSEEK, STREAM_CAN_SEEK, STREAM_CONTROL_ACCESS, STREAM_GET_CONTENT_TYPE, STREAM_GET_POSITION, STREAM_GET_SIZE, STREAM_SET_POSITION, STREAM_SET_RECORD_STATE, STREAM_UPDATE_SIZE, stream_vaControl(), VLC_EGENERIC, and VLC_SUCCESS.
| static int CreatePlaylist | ( | stream_t * | s, | |
| char ** | pp_buffer | |||
| ) | [static] |
References GetFilesInZip(), i, stream_t::p_sys, p_sys, stream_sys_t::psz_path, vlc_array_count(), vlc_array_destroy(), vlc_array_item_at_index(), vlc_array_new(), WriteXSPF(), and stream_sys_t::zipFile.
Referenced by Fill().
| static int escapeToXml | ( | char ** | ppsz_encoded, | |
| const char * | psz_url | |||
| ) | [static] |
**************************************************************************
Escape string to be XML valid Allowed chars are defined by the above function isAllowedChar() Invalid chars are escaped using non standard '?XX' notation. NOTE: We cannot trust VLC internal Web encoding functions because they are not able to encode and decode some rare utf-8 characters properly. Also, we don't control exactly when they are called (from this module).
References isAllowedChar(), VLC_ENOMEM, and VLC_SUCCESS.
Referenced by WriteXSPF().
| static int Fill | ( | stream_t * | s | ) | [static] |
References CreatePlaylist(), stream_sys_t::i_len, stream_sys_t::i_pos, stream_t::p_sys, p_sys, stream_sys_t::psz_xspf, VLC_EGENERIC, and VLC_SUCCESS.
**************************************************************************
Either create or find the parent node of the item
References node::child, node::name, new_node(), node::next, and strdup().
Referenced by WriteXSPF().
| static void free_all_node | ( | node * | root | ) | [inline, static] |
| static int GetFilesInZip | ( | stream_t * | p_this, | |
| unzFile | file, | |||
| vlc_array_t * | p_filenames, | |||
| vlc_array_t * | p_fileinfos | |||
| ) | [static] |
************************************************************************** Zip utility functions
************************************************************************** List files in zip and append their names to p_array
| p_this | ||
| file | Opened zip file | |
| p_array | vlc_array_t which will receive all filenames |
References i, msg_Warn, strdup(), vlc_array_append(), VLC_EGENERIC, VLC_ENOMEM, and ZIP_FILENAME_LEN.
Referenced by CreatePlaylist().
| bool isAllowedChar | ( | char | c | ) |
************************************************************************** XSPF generation functions
Common function.
************************************************************************** Check a character for allowance in the Xml. Allowed chars are: a-z, A-Z, 0-9, \, /, ., ' ', _ and :
Referenced by escapeToXml(), and unescapeXml().
| static item* new_item | ( | int | id | ) | [inline, static] |
| static node* new_node | ( | char * | name | ) | [inline, static] |
************************************************************************** Some helpers
References convert_xml_special_chars(), and node::name.
Referenced by findOrCreateParentNode(), and WriteXSPF().
| static int nodeToXSPF | ( | char ** | pp_buffer, | |
| node * | n, | |||
| bool | b_root | |||
| ) | [static] |
**************************************************************************
Recursively convert a node to its XSPF representation
References astrcatf(), node::child, i, item::id, node::media, node::name, item::next, and VLC_SUCCESS.
Referenced by WriteXSPF().
| static int Peek | ( | stream_t * | s, | |
| const uint8_t ** | pp_peek, | |||
| unsigned int | i_peek | |||
| ) | [static] |
************************************************************************* Peek
References __MIN, Fill(), stream_sys_t::i_len, stream_sys_t::i_pos, stream_t::p_sys, p_sys, and stream_sys_t::psz_xspf.
| static int Read | ( | stream_t * | s, | |
| void * | p_read, | |||
| unsigned int | i_read | |||
| ) | [static] |
************************************************************************* Local prototypes
************************************************************************* Stream filters functions
************************************************************************* Read
References __MIN, Fill(), stream_sys_t::i_len, stream_sys_t::i_pos, stream_t::p_sys, p_sys, and stream_sys_t::psz_xspf.
| void StreamClose | ( | vlc_object_t * | p_this | ) |
************************************************************************* Close
References stream_sys_t::fileFunctions, stream_t::p_sys, p_sys, stream_sys_t::psz_path, stream_sys_t::psz_xspf, and stream_sys_t::zipFile.
Referenced by Demux(), and SessionsSetup().
| int StreamOpen | ( | vlc_object_t * | p_this | ) |
************************************************************************** Open
************************************************************************** Module access points: stream_filter
References asprintf(), Control(), stream_sys_t::fileFunctions, i_zip_marker, msg_Warn, stream_t::p_source, stream_t::p_sys, p_sys, p_zip_marker, Peek(), stream_t::pf_control, stream_t::pf_peek, stream_t::pf_read, stream_sys_t::psz_path, stream_t::psz_path, Read(), stream_Peek(), VLC_EGENERIC, VLC_ENOMEM, VLC_SUCCESS, stream_sys_t::zipFile, ZipIO_Close(), ZipIO_Error(), ZipIO_Open(), ZipIO_Read(), ZipIO_Seek(), ZipIO_Tell(), and ZipIO_Write().
| int vlc_entry__main | ( | module_t * | p_module | ) |
************************************************************************** Module descriptor
| const char* vlc_entry_license__main | ( | void | ) |
| static int WriteXSPF | ( | char ** | pp_buffer, | |
| vlc_array_t * | p_filenames, | |||
| const char * | psz_zippath | |||
| ) | [static] |
**************************************************************************
Write the XSPF playlist given the list of files
References asprintf(), astrcatf(), convert_xml_special_chars(), DIR_SEP_CHAR, escapeToXml(), findOrCreateParentNode(), free_all_node(), i, node::media, new_item(), new_node(), item::next, nodeToXSPF(), psz_name, strdup(), vlc_array_count(), vlc_array_item_at_index(), VLC_SUCCESS, and ZIP_SEP.
Referenced by CreatePlaylist().
| static int ZCALLBACK ZipIO_Close | ( | void * | opaque, | |
| void * | stream | |||
| ) | [static] |
**************************************************************************
close the stream
| opaque | should be the stream | |
| stream | stream created by ZipIO_Open |
References VLC_SUCCESS.
| static int ZCALLBACK ZipIO_Error | ( | void * | opaque, | |
| void * | stream | |||
| ) | [static] |
**************************************************************************
I/O functions for the ioapi: test error (man 3 ferror)
| static void ZCALLBACK* ZipIO_Open | ( | void * | opaque, | |
| const char * | file, | |||
| int | mode | |||
| ) | [static] |
************************************************************************** ZipIO function definitions : how to use vlc_stream to read the zip
************************************************************************** interface for unzip module to open a file using a vlc_stream
| opaque | ||
| filename | ||
| mode | how to open the file (read/write ?). We support only read |
References msg_Dbg.
| static unsigned long ZCALLBACK ZipIO_Read | ( | void * | opaque, | |
| void * | stream, | |||
| void * | buf, | |||
| unsigned long | size | |||
| ) | [static] |
**************************************************************************
read something from stream into buffer
| opaque | should be the stream | |
| stream | stream created by ZipIO_Open | |
| buf | buffer to read the file | |
| size | length of this buffer |
References stream_t::p_source, and stream_Read().
| static long ZCALLBACK ZipIO_Seek | ( | void * | opaque, | |
| void * | stream, | |||
| unsigned long | offset, | |||
| int | origin | |||
| ) | [static] |
**************************************************************************
seek in the stream
| opaque | should be the stream | |
| stream | stream created by ZipIO_Open | |
| offset | positive offset to seek | |
| origin | current position in stream |
References long(), stream_t::p_source, and stream_Seek().
| static long ZCALLBACK ZipIO_Tell | ( | void * | opaque, | |
| void * | stream | |||
| ) | [static] |
**************************************************************************
tell size of stream
| opaque | should be the stream | |
| stream | stream created by ZipIO_Open |
References stream_t::p_source, and stream_Size().
| static uLong ZCALLBACK ZipIO_Write | ( | void * | opaque, | |
| void * | stream, | |||
| const void * | buf, | |||
| uLong | size | |||
| ) | [static] |
**************************************************************************
I/O functions for the ioapi: write (assert insteadof segfault)
const int i_zip_marker = 4 [static] |
Referenced by StreamOpen().
const uint8_t p_zip_marker[] = { 0x50, 0x4b, 0x03, 0x04 } [static] |
************************************************************************** Zip file identifier
Referenced by StreamOpen().
1.5.6