Commit bc72d967 authored by Jean-Philippe Andre's avatar Jean-Philippe Andre

Zip: add a stream_filter and an access

The stream_filter does the following job:
[zip stream] -->filter--> [xspf playlist]

The access is called zip or unzip and takes MRLs of the form:
zip://[web-encoded-path]![file-in-zip]

As there is some automatic web-form decoding of the MRL,
the MRLs in the playlist generated by zipstream are encoded
two times.
parent 7032aafa
if HAVE_ZLIB
SOURCES_zip = \
zipstream.c \
zipaccess.c \
$(NULL)
endif
/*****************************************************************************
* zip.h: Module (access+demux) to extract different archives, based on zlib
*****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id$
*
* Authors: Jean-Philippe André <jpeg@videolan.org>
*
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/** **************************************************************************
* Common includes and shared headers
*****************************************************************************/
#ifndef ZIP_ACCESSDEMUX_H
#define ZIP_ACCESSDEMUX_H
#include <vlc/vlc.h>
#include <vlc_common.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_arrays.h>
#include <vlc_plugin.h>
#include <vlc_stream.h>
#include "unzip.h"
#include "ioapi.h"
#include <assert.h>
#define ZIP_FILENAME_LEN 512
#define ZIP_BUFFER_LEN 32768
#define ZIP_SEP "|"
#define ZIP_SEP_CHAR '|'
/** **************************************************************************
* Module access points: stream_filter
*****************************************************************************/
int StreamOpen( vlc_object_t* );
void StreamClose( vlc_object_t* );
/** **************************************************************************
* Module access points: access
*****************************************************************************/
int AccessOpen( vlc_object_t *p_this );
void AccessClose( vlc_object_t *p_this );
/** **************************************************************************
* zipIO function headers : how to use vlc_stream to read the zip
* Note: static because the implementations differ
*****************************************************************************/
static void* ZCALLBACK ZipIO_Open( void* opaque, const char* filename, int m );
static uLong ZCALLBACK ZipIO_Read( void*, void* stream, void* buf, uLong sz );
static uLong ZCALLBACK ZipIO_Write( void*, void* stream, const void*, uLong );
static long ZCALLBACK ZipIO_Tell( void*, void* stream );
static long ZCALLBACK ZipIO_Seek( void*, void* stream, uLong offset, int ori );
static int ZCALLBACK ZipIO_Close( void*, void* stream );
static int ZCALLBACK ZipIO_Error( void*, void* stream );
#endif /* ZIP_ACCESSDEMUX_H */
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment