VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
stream.c File Reference
Include dependency graph for stream.c:

Data Structures

struct  stream_track_t
struct  access_entry_t
struct  stream_sys_t

Macros

#define STREAM_CACHE_TRACK   3
#define STREAM_CACHE_SIZE   (4*STREAM_CACHE_TRACK*1024*1024)
#define STREAM_CACHE_PREBUFFER_SIZE   (128)
#define STREAM_READ_ATONCE   1024
#define STREAM_CACHE_TRACK_SIZE   (STREAM_CACHE_SIZE/STREAM_CACHE_TRACK)
#define STREAM_PROBE_LINE   2048
 Read from the stream untill first newline.
#define STREAM_LINE_MAX   (2048*100)

Enumerations

enum  stream_read_method_t { STREAM_METHOD_BLOCK, STREAM_METHOD_STREAM }

Functions

static int AStreamReadBlock (stream_t *s, void *p_read, unsigned int i_read)
static int AStreamPeekBlock (stream_t *s, const uint8_t **p_peek, unsigned int i_read)
static int AStreamSeekBlock (stream_t *s, uint64_t i_pos)
static void AStreamPrebufferBlock (stream_t *s)
static block_tAReadBlock (stream_t *s, bool *pb_eof)
static int AStreamReadStream (stream_t *s, void *p_read, unsigned int i_read)
static int AStreamPeekStream (stream_t *s, const uint8_t **pp_peek, unsigned int i_read)
static int AStreamSeekStream (stream_t *s, uint64_t i_pos)
static void AStreamPrebufferStream (stream_t *s)
static int AReadStream (stream_t *s, void *p_read, unsigned int i_read)
static int AStreamControl (stream_t *s, int i_query, va_list)
static void AStreamDestroy (stream_t *s)
static void UStreamDestroy (stream_t *s)
static int ASeek (stream_t *s, uint64_t i_pos)
stream_tstream_CommonNew (vlc_object_t *p_obj)
void stream_CommonDelete (stream_t *s)
stream_tstream_UrlNew (((vlc_object_t *)(vlc_object_t *p_parent)), const char *psz_url)
stream_tstream_AccessNew (access_t *p_access, char **ppsz_list)
 This function creates a stream_t from a provided access_t.
static void AStreamControlReset (stream_t *s)
static void AStreamControlUpdate (stream_t *s)
static int AStreamRefillBlock (stream_t *s)
static int AStreamRefillStream (stream_t *s)
static int AStreamReadNoSeekStream (stream_t *s, void *p_read, unsigned int i_read)
char * stream_ReadLine (stream_t *s)
int stream_Read (stream_t *s, void *p_read, int i_read)
 Try to read "i_read" bytes into a buffer pointed by "p_read".
int stream_Peek (stream_t *s, const uint8_t **pp_peek, int i_peek)
 Store in pp_peek a pointer to the next "i_peek" bytes in the stream.
int stream_vaControl (stream_t *s, int i_query, va_list args)
 Use to control the "stream_t *".
void stream_Delete (stream_t *s)
 Destroy a stream.
int stream_Control (stream_t *s, int i_query,...)
block_tstream_Block (stream_t *s, int i_size)
 Read "i_size" bytes and store them in a block_t.
block_tstream_BlockRemaining (stream_t *s, int i_max_size)
 Read the remaining of the data if there is less than i_max_size bytes, otherwise return NULL.

Macro Definition Documentation

#define STREAM_CACHE_PREBUFFER_SIZE   (128)
#define STREAM_CACHE_SIZE   (4*STREAM_CACHE_TRACK*1024*1024)
#define STREAM_CACHE_TRACK   3
#define STREAM_CACHE_TRACK_SIZE   (STREAM_CACHE_SIZE/STREAM_CACHE_TRACK)
#define STREAM_LINE_MAX   (2048*100)

Referenced by stream_ReadLine().

#define STREAM_PROBE_LINE   2048

Read from the stream untill first newline.

Parameters
sStream handle to read from
Returns
A pointer to the allocated output string. You need to free this when you are done.

Referenced by stream_ReadLine().

#define STREAM_READ_ATONCE   1024

Enumeration Type Documentation

Enumerator:
STREAM_METHOD_BLOCK 
STREAM_METHOD_STREAM 

Function Documentation

static block_t * AReadBlock ( stream_t s,
bool *  pb_eof 
)
static
static int AReadStream ( stream_t s,
void *  p_read,
unsigned int  i_read 
)
static
static int ASeek ( stream_t s,
uint64_t  i_pos 
)
static
static int AStreamControl ( stream_t s,
int  i_query,
va_list  args 
)
static
static void AStreamControlReset ( stream_t s)
static
static void AStreamControlUpdate ( stream_t s)
static
static void AStreamDestroy ( stream_t s)
static
static int AStreamPeekBlock ( stream_t s,
const uint8_t **  p_peek,
unsigned int  i_read 
)
static
static int AStreamPeekStream ( stream_t s,
const uint8_t **  pp_peek,
unsigned int  i_read 
)
static
static void AStreamPrebufferBlock ( stream_t s)
static
static void AStreamPrebufferStream ( stream_t s)
static
static int AStreamReadBlock ( stream_t s,
void *  p_read,
unsigned int  i_read 
)
static
static int AStreamReadNoSeekStream ( stream_t s,
void *  p_read,
unsigned int  i_read 
)
static
static int AStreamReadStream ( stream_t s,
void *  p_read,
unsigned int  i_read 
)
static
static int AStreamRefillBlock ( stream_t s)
static
static int AStreamRefillStream ( stream_t s)
static
static int AStreamSeekBlock ( stream_t s,
uint64_t  i_pos 
)
static
static int AStreamSeekStream ( stream_t s,
uint64_t  i_pos 
)
static
stream_t* stream_AccessNew ( access_t p_access,
char **  ppsz_list 
)

This function creates a stream_t from a provided access_t.

An optional NULL terminated list of file may be provided. The content of these extra files will be concatenated after to the main access.

XXX ppsz_list is treated as const (I failed to avoid a warning when using const keywords for pointer of pointers)

References ACCESS_CAN_FASTSEEK, access_Control(), access_Delete(), access_New, AStreamControl(), AStreamDestroy(), AStreamPeekBlock(), AStreamPeekStream(), AStreamPrebufferBlock(), AStreamPrebufferStream(), AStreamReadBlock(), AStreamReadStream(), stream_sys_t::b_fastseek, stream_sys_t::block, stream_sys_t::i_bytes, stream_track_t::i_date, stream_track_t::i_end, stream_sys_t::i_list, stream_sys_t::i_list_index, stream_sys_t::i_offset, stream_sys_t::i_peek, access_t::i_pos, stream_sys_t::i_pos, stream_sys_t::i_read_count, stream_sys_t::i_read_size, stream_sys_t::i_read_time, stream_sys_t::i_seek_count, stream_sys_t::i_seek_time, access_t::i_size, access_entry_t::i_size, stream_sys_t::i_size, stream_track_t::i_start, stream_sys_t::i_start, stream_sys_t::i_tk, stream_sys_t::i_used, access_t::info, stream_sys_t::list, stream_sys_t::method, msg_Dbg, msg_Err, stream_sys_t::p_access, stream_track_t::p_buffer, stream_sys_t::p_buffer, stream_sys_t::p_current, stream_sys_t::p_first, stream_t::p_input, access_t::p_input, stream_sys_t::p_list_access, stream_sys_t::p_peek, stream_t::p_sys, access_t::pf_block, stream_t::pf_control, stream_t::pf_destroy, stream_t::pf_peek, stream_t::pf_read, stream_sys_t::pp_last, stream_t::psz_access, access_t::psz_access, access_t::psz_location, psz_name, stream_t::psz_path, access_entry_t::psz_path, stream_sys_t::stat, strdup(), stream_sys_t::stream, STREAM_CACHE_SIZE, STREAM_CACHE_TRACK, STREAM_CACHE_TRACK_SIZE, stream_CommonDelete(), stream_CommonNew(), STREAM_METHOD_BLOCK, STREAM_METHOD_STREAM, STREAM_READ_ATONCE, TAB_APPEND, TAB_INIT, stream_sys_t::tk, and VLC_OBJECT.

Referenced by InputSourceInit(), and stream_UrlNew().

void stream_CommonDelete ( stream_t s)
stream_t* stream_CommonNew ( vlc_object_t p_obj)
stream_t* stream_UrlNew ( ((vlc_object_t *)(vlc_object_t *p_parent))  ,
const char *  psz_url 
)
static void UStreamDestroy ( stream_t s)
static