Commit 2ad5fa64 authored by Sam Hocevar's avatar Sam Hocevar

Je vous avais pr�venu. Le demoronifier a frapp�.

 D�sol� pour le flood. Les en-t�tes de fonctions ne font plus 81
caract�res, et il n'y a plus d'espaces inutiles, Tous les trailing
spaces ont disparu, j'ai essay� de v�rifier que �a ne p�tait rien,
mais j'ai pu oublier un truc con. J'accepte tous types de ch�timents
� base d'orties fra�ches.

 D�sol� d'avoir aussi modifi� les fichiers de ceux qui formataient
bien proprement leurs en-t�tes � 80 et pas 79 sans emb�ter personne,
mais j'ai d� choisir entre les deux.

 Dor�navant ce serait bien de formater les en-t�tes et les commentaires
justifi�s � droite � 79 colonnes, ou au pire � 80.

 . 1343 moronic long lines destroyed
 . 12893 trailing spaces eradicated
 . 115 ugly macros fixed
 . 959 innocent a_bit_long lines shortened
 But hey, 40054 lines were OK !
parent db2b7d18
This diff is collapsed.
/******************************************************************************
/*****************************************************************************
* audio_decoder.h : audio decoder thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* = Prototyped functions are implemented in audio_decoder/audio_decoder.c
*
* = Required headers :
......@@ -16,7 +16,7 @@
*
* = - MSb = Most Significant bit
* - MSB = Most Significant Byte
******************************************************************************/
*****************************************************************************/
/*
* TODO :
......@@ -28,14 +28,14 @@
#define ADEC_FRAME_SIZE 384
/******************************************************************************
/*****************************************************************************
* adec_frame_t
******************************************************************************/
*****************************************************************************/
typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
/******************************************************************************
/*****************************************************************************
* adec_bank_t
******************************************************************************/
*****************************************************************************/
typedef struct adec_bank_s
{
float v1[512];
......@@ -45,11 +45,11 @@ typedef struct adec_bank_s
} adec_bank_t;
/******************************************************************************
/*****************************************************************************
* adec_thread_t : audio decoder thread descriptor
******************************************************************************
*****************************************************************************
* This type describes an audio decoder thread
******************************************************************************/
*****************************************************************************/
typedef struct adec_thread_s
{
/*
......@@ -80,8 +80,8 @@ typedef struct adec_thread_s
} adec_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
void adec_DestroyThread ( adec_thread_t * p_adec );
/******************************************************************************
/*****************************************************************************
* audio_dsp.h : header of the dsp functions library
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - "common.h" ( byte_t )
* - "audio_output.h" ( aout_dsp_t )
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int aout_dspOpen ( aout_dsp_t *p_dsp );
int aout_dspReset ( aout_dsp_t *p_dsp );
int aout_dspSetFormat ( aout_dsp_t *p_dsp );
......
/******************************************************************************
/*****************************************************************************
* audio_math.h : PCM and DCT
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
void DCT32(float *x, adec_bank_t *b);
void PCM(adec_bank_t *b, s16 **pcm, int jump);
/******************************************************************************
/*****************************************************************************
* audio_output.h : audio output thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - <sys/soundcard.h> ( audio_buf_info )
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "vlc_thread.h" ( vlc_thread_t )
******************************************************************************/
*****************************************************************************/
/* TODO :
*
......@@ -59,9 +59,9 @@
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).i_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/******************************************************************************
/*****************************************************************************
* aout_dsp_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Path to the audio output device (default is set to "/dev/dsp") */
......@@ -81,13 +81,13 @@ typedef struct
} aout_dsp_t;
/******************************************************************************
/*****************************************************************************
* aout_increment_t
******************************************************************************
*****************************************************************************
* This structure is used to keep the progression of an index up-to-date, in
* order to avoid rounding problems and heavy computations, as the function
* that handles this structure only uses additions.
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* The remainder is used to keep track of the fractional part of the
......@@ -109,9 +109,9 @@ typedef struct
} aout_increment_t;
/******************************************************************************
/*****************************************************************************
* aout_fifo_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* See the fifo types below */
......@@ -155,9 +155,9 @@ typedef struct
#define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4
/******************************************************************************
/*****************************************************************************
* aout_thread_t
******************************************************************************/
*****************************************************************************/
typedef struct aout_thread_s
{
vlc_thread_t thread_id;
......@@ -184,9 +184,9 @@ typedef struct aout_thread_s
} aout_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout, int *pi_status );
......
/*******************************************************************************
/*****************************************************************************
* common.h: common definitions
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* Collection of usefull common types and macros definitions
*******************************************************************************
*****************************************************************************
* required headers:
* config.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Basic types definitions
*******************************************************************************/
*****************************************************************************/
/* Basic types definitions */
typedef signed char s8;
......@@ -30,9 +30,9 @@ typedef int boolean_t;
/* Counter for statistics and profiling */
typedef unsigned long count_t;
/*******************************************************************************
/*****************************************************************************
* Classes declaration
*******************************************************************************/
*****************************************************************************/
/* Interface */
struct intf_thread_s;
......@@ -76,9 +76,9 @@ typedef struct vdec_thread_s * p_vdec_thread_t;
typedef struct vpar_thread_s * p_vpar_thread_t;
typedef struct video_parser_s * p_video_parser_t;
/*******************************************************************************
/*****************************************************************************
* Macros and inline functions
*******************************************************************************/
*****************************************************************************/
/* CEIL: division with round to nearest greater integer */
#define CEIL(n, d) ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
......
/*******************************************************************************
/*****************************************************************************
* config.h: limits and configuration
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Defines all compilation-time configuration constants and size limits
*******************************************************************************/
*****************************************************************************/
/* Conventions regarding names of symbols and variables
* ----------------------------------------------------
......@@ -19,9 +19,9 @@
*
*/
/*******************************************************************************
/*****************************************************************************
* Program information
*******************************************************************************/
*****************************************************************************/
/* Program version and copyright message */
#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
......@@ -29,9 +29,9 @@
"version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
"compilation options: " PROGRAM_OPTIONS
/*******************************************************************************
/*****************************************************************************
* General compilation options
*******************************************************************************/
*****************************************************************************/
/* Define for DVB support - Note that some extensions or restrictions may be
* incompatible with native MPEG2 streams */
......@@ -50,9 +50,9 @@
/* Define for unthreaded version of the program - ?? not yet implemented */
//#define NO_THREAD
/*******************************************************************************
/*****************************************************************************
* Debugging options - define or undefine symbols
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
/* General debugging support, which depends of the DEBUG define, is determined
* in the Makefile */
......@@ -72,9 +72,9 @@
#endif
/*******************************************************************************
/*****************************************************************************
* General configuration
*******************************************************************************/
*****************************************************************************/
/* Automagically spawn input, audio and video threads ? */
// ?? used ?
......@@ -92,9 +92,9 @@
#define FIFO_SIZE 1023
/*******************************************************************************
/*****************************************************************************
* Interface configuration
*******************************************************************************/
*****************************************************************************/
/* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR "vlc_init"
......@@ -118,9 +118,9 @@
/* Title of the X11 window */
#define VOUT_TITLE "VideoLAN Client"
/*******************************************************************************
/*****************************************************************************
* Input thread configuration
*******************************************************************************/
*****************************************************************************/
/* ?? */
#define INPUT_IDLE_SLEEP 100000
......@@ -202,9 +202,9 @@
* mark it to be presented */
#define INPUT_PTS_DELAY 2000000
/*******************************************************************************
/*****************************************************************************
* Audio configuration
*******************************************************************************/
*****************************************************************************/
/* Environment variable used to store dsp device name, and default value */
#define AOUT_DSP_VAR "vlc_dsp"
......@@ -218,9 +218,9 @@
#define AOUT_RATE_VAR "vlc_audio_rate"
#define AOUT_RATE_DEFAULT 44100
/*******************************************************************************
/*****************************************************************************
* Video configuration
*******************************************************************************/
*****************************************************************************/
/*
* Default settings for video output threads
......@@ -291,9 +291,9 @@
#define VOUT_FB_DEV_VAR "vlc_fb_dev"
#define VOUT_FB_DEV_DEFAULT "/dev/fb0"
/*******************************************************************************
/*****************************************************************************
* Video parser configuration
*******************************************************************************/
*****************************************************************************/
#define VPAR_IDLE_SLEEP 100000
......@@ -317,9 +317,9 @@
/* Maximum number of macroblocks in a picture. */
#define MAX_MB 2048
/*******************************************************************************
/*****************************************************************************
* Video decoder configuration
*******************************************************************************/
*****************************************************************************/
//#define VDEC_SMP
......@@ -333,15 +333,15 @@
/* Maximum range of values out of the IDCT + motion compensation. */
#define VDEC_CROPRANGE 2048
/*******************************************************************************
/*****************************************************************************
* Generic decoder configuration
*******************************************************************************/
*****************************************************************************/
#define GDEC_IDLE_SLEEP 100000
/*******************************************************************************
/*****************************************************************************
* Messages and console interfaces configuration
*******************************************************************************/
*****************************************************************************/
/* Maximal size of the message queue - in case of overflow, all messages in the
* queue are printed by the calling thread */
......
/*******************************************************************************
/*****************************************************************************
* control.h: user control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************
*****************************************************************************
* Required headers:
* <sys/uio.h>
* <X11/Xlib.h>
......@@ -19,11 +19,11 @@
* "video_output.h"
* "xconsole.h"
* "interface.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_SelectAudioStream ( intf_thread_t *p_intf, int i_input, int i_id );
void intf_DeselectAudioStream( intf_thread_t *p_intf, int i_input, int i_id );
int intf_SelectVideoStream ( intf_thread_t *p_intf, int i_input,
......
/*******************************************************************************
/*****************************************************************************
* debug.h: vlc debug macros
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Stand alone file
*******************************************************************************
*****************************************************************************
* Required headers:
* - <string.h>
* - intf_msg.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* ASSERT
*******************************************************************************
*****************************************************************************
* This macro is used to test that a pointer is not nul. It insert the needed
* code when the program is compiled with the debug option, but does nothing
* in release program.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define ASSERT(p_Mem) \
if (!(p_Mem)) \
......@@ -29,13 +29,13 @@ if (!(p_Mem)) \
#endif
/*******************************************************************************
/*****************************************************************************
* RZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initialise a variable to 0. It is very useful when
* used with the ASSERT macro. It also only insert the needed code when the
* program is compiled with the debug option.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define RZERO(r_Var) \
bzero(&(r_Var), sizeof((r_Var)));
......@@ -46,12 +46,12 @@ bzero(&(r_Var), sizeof((r_Var)));
#endif
/*******************************************************************************
/*****************************************************************************
* PZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initiase the memory pointed out by a pointer to 0.
* It has the same purpose than RZERO, but for pointers.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define PZERO(p_Mem) \
bzero((p_Mem), sizeof(*(p_Mem)));
......@@ -62,12 +62,12 @@ bzero((p_Mem), sizeof(*(p_Mem)));
#endif
/*******************************************************************************
/*****************************************************************************
* AZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initiase an array of variables to 0.
* It has the same purpose than RZERO or PZERO, but for array
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define AZERO(p_Array, i_Size) \
bzero((p_Array), (i_Size)*sizeof(*(p_Array)));
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* generic_decoder.h : generic decoder thread
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
......@@ -10,14 +10,14 @@
* "input.h"
* "decoder_fifo.h"
* ??
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* gdec_cfg_t: generic decoder configuration structure
*******************************************************************************
*****************************************************************************
* This structure is passed as an initializer when a generic decoder thread is
* created.
*******************************************************************************/
*****************************************************************************/
typedef struct gdec_cfg_s
{
u64 i_properties;
......@@ -30,11 +30,11 @@ typedef struct gdec_cfg_s
#define GDEC_CFG_ACTIONS (1 << 0)
#define GDEC_CFG_FILENAME (1 << 1)
/*******************************************************************************
/*****************************************************************************
* gdec_thread_t: generic decoder thread descriptor
*******************************************************************************
*****************************************************************************
* This type describes a generic decoder thread.
*******************************************************************************/
*****************************************************************************/
typedef struct gdec_thread_s
{
/* Thread properties and locks */
......@@ -73,9 +73,9 @@ typedef struct gdec_thread_s
#define GDEC_SAVE_DEMUX (1 << 2) /* save PES to files by stream id */
#define GDEC_PRINT (1 << 3) /* print PES informations */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
/* Thread management functions */
gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg,
......
/******************************************************************************
/*****************************************************************************
* input.h: input thread interface
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Constants related to input
******************************************************************************/
*****************************************************************************/
#define TS_PACKET_SIZE 188 /* size of a TS packet */
#define PES_HEADER_SIZE 14 /* size of the first part of a PES header */
#define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */
/******************************************************************************
/*****************************************************************************
* ts_packet_t
******************************************************************************
*****************************************************************************
* Describe a TS packet.
******************************************************************************/
*****************************************************************************/
typedef struct ts_packet_s
{
/* Nothing before this line, the code relies on that */
......@@ -30,12 +30,12 @@ typedef struct ts_packet_s
struct ts_packet_s * p_next_ts;
} ts_packet_t;
/******************************************************************************
/*****************************************************************************
* pes_packet_t
******************************************************************************
*****************************************************************************
* Describes an PES packet, with its properties, and pointers to the TS packets
* containing it.
******************************************************************************/
*****************************************************************************/
typedef struct pes_packet_s
{
/* PES properties */
......@@ -51,7 +51,7 @@ typedef struct pes_packet_s
*/
u8 i_stream_id; /* payload type and id */
int i_pes_size; /* size of the current PES packet */
int i_ts_packets; /* number of TS packets in this PES */
int i_ts_packets;/* number of TS packets in this PES */
/* Demultiplexer environment */
boolean_t b_discard_payload; /* is the packet messed up ? */
......@@ -66,12 +66,12 @@ typedef struct pes_packet_s
* (used by the demultiplexer). */
} pes_packet_t;
/******************************************************************************
/*****************************************************************************
* psi_section_t
******************************************************************************
*****************************************************************************
* Describes a PSI section. Beware, it doesn't contain pointers to the TS
* packets that contain it as for a PES, but the data themselves
******************************************************************************/
*****************************************************************************/
typedef struct psi_section_s
{
byte_t buffer[PSI_SECTION_SIZE];
......@@ -83,12 +83,12 @@ typedef struct psi_section_s
} psi_section_t;
/******************************************************************************
/*****************************************************************************
* es_descriptor_t: elementary stream descriptor
******************************************************************************
*****************************************************************************
* Describes an elementary stream, and includes fields required to handle and
* demultiplex this elementary stream.
******************************************************************************/
*****************************************************************************/
typedef struct es_descriptor_t
{
u16 i_id; /* stream ID, PID for TS streams */
......@@ -150,12 +150,12 @@ typedef struct es_descriptor_t
#define AC3_AUDIO_ES 0x81
#define DVD_SPU_ES 0x82 /* 0x82 might violate the norm */
/******************************************************************************
/*****************************************************************************
* program_descriptor_t
******************************************************************************
*****************************************************************************
* Describes a program and list associated elementary streams. It is build by
* the PSI decoder upon the informations carried in program map sections
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Program characteristics */
......@@ -183,11 +183,11 @@ typedef struct
#endif
} pgrm_descriptor_t;
/******************************************************************************
/*****************************************************************************
* pcr_descriptor_t
******************************************************************************
*****************************************************************************
* Contains informations used to synchronise the decoder with the server
******************************************************************************/
*****************************************************************************/
typedef struct pcr_descriptor_struct
{
......@@ -202,12 +202,12 @@ typedef struct pcr_descriptor_struct
/* counter used to compute dynamic average values */
} pcr_descriptor_t;
/******************************************************************************
/*****************************************************************************
* stream_descriptor_t
******************************************************************************
*****************************************************************************
* Describes a transport stream and list its associated programs. Build upon
* the informations carried in program association sections
******************************************************************************/
*****************************************************************************/
typedef struct
{
u16 i_stream_id; /* stream id */
......@@ -245,9 +245,9 @@ typedef struct
#endif
} stream_descriptor_t;
/******************************************************************************
/*****************************************************************************
* input_netlist_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
vlc_mutex_t lock; /* netlist modification lock */
......@@ -279,14 +279,14 @@ typedef struct
/******************************************************************************
/*****************************************************************************
* input_thread_t
******************************************************************************
*****************************************************************************
* This structure includes all the local static variables of an input thread,
* including the netlist and the ES descriptors
* Note that p_es must be defined as a static table, otherwise we would have to
* update all reference to it each time the table would be reallocated
******************************************************************************/
*****************************************************************************/
/* Function pointers used in structure */
typedef int (input_open_t) ( p_input_thread_t p_input );
......@@ -317,7 +317,7 @@ typedef struct input_thread_s
/* General stream description */
stream_descriptor_t * p_stream; /* PAT tables */
es_descriptor_t p_es[INPUT_MAX_ES]; /* carried elementary streams */
es_descriptor_t p_es[INPUT_MAX_ES];/* carried elementary streams */
pcr_descriptor_t * p_pcr; /* PCR struct used for synchronisation */
/* List of streams to demux */
......
/*******************************************************************************
/*****************************************************************************
* input_ctrl.h: Decodeur control
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_pid );
int input_DelPgrmElem( input_thread_t *p_input, int i_current_pid );
boolean_t input_IsElemRecv( input_thread_t *p_input, int i_pid );
/*******************************************************************************
/*****************************************************************************
* input_file.h: file streams functions interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_FileOpen ( input_thread_t *p_input );
int input_FileRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count );
......
/*******************************************************************************
/*****************************************************************************
* input_netlist.h: netlist interface
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* The netlists are an essential part of the input structure. We maintain a
* list of free TS packets and free PES packets to avoid continuous malloc
* and free.
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_NetlistInit ( input_thread_t *p_input );
void input_NetlistEnd ( input_thread_t *p_input );
......@@ -17,13 +17,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input, pes_packet
static __inline__ void input_NetlistFreeTS( input_thread_t *p_input, ts_packet_t *p_ts_packet );
static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input );
/******************************************************************************
/*****************************************************************************
* input_NetlistFreePES: add a PES packet to the netlist
*******************************************************************************
*****************************************************************************
* Add a PES packet to the PES netlist, so that the packet can immediately be
* reused by the demultiplexer. We put this function directly in the .h file,
* because it is very frequently called.
*******************************************************************************/
*****************************************************************************/
static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
pes_packet_t *p_pes_packet )
{
......@@ -67,13 +67,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock );
}
/*******************************************************************************
/*****************************************************************************
* input_NetlistFreeTS: add a TS packet to the netlist
*******************************************************************************
*****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be
* reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES.
*******************************************************************************/
*****************************************************************************/
static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
ts_packet_t *p_ts_packet )
{
......@@ -95,13 +95,13 @@ static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock );
}
/*******************************************************************************
/*****************************************************************************
* input_NetlistGetPES: remove a PES packet from the netlist
*******************************************************************************
*****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be
* reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES.
*******************************************************************************/
*****************************************************************************/
static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input )
{
pes_packet_t * p_pes_packet;
......
/*******************************************************************************
/*****************************************************************************
* input_network.h: network functions interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_NetworkOpen ( input_thread_t *p_input );
int input_NetworkRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count );
......
/*******************************************************************************
/*****************************************************************************
* input_pcr.h: PCR management interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/* Maximum number of samples used to compute the dynamic average value,
* it is also the maximum of c_average in the pcr_descriptor_struct.
......@@ -17,9 +17,9 @@
#define SYNCHRO_START 2
#define SYNCHRO_REINIT 3
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_PcrInit ( input_thread_t *p_input );
void input_PcrDecode ( input_thread_t *p_input, es_descriptor_t* p_es,
u8* p_pcr_data );
......
/*******************************************************************************
/*****************************************************************************
* psi.h: PSI management interface
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_PsiInit ( input_thread_t *p_input );
void input_PsiDecode ( input_thread_t *p_input, psi_section_t* p_psi_section );
void input_PsiRead ( input_thread_t *p_input );
......
/*******************************************************************************
/*****************************************************************************
* input_vlan.h: vlan input method
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* ??
*******************************************************************************
*****************************************************************************
* Required headers:
* <netinet/in.h>
* "vlc_thread.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int input_VlanCreate ( void );
void input_VlanDestroy ( void );
int input_VlanJoin ( int i_vlan_id );
......
/******************************************************************************
/*****************************************************************************
* interface.h: interface access for other threads
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* This library provides basic functions for threads to interact with user
* interface, such as message output.
******************************************************************************
*****************************************************************************
* Required headers:
* <sys/uio.h>
* <X11/Xlib.h>
......@@ -18,14 +18,14 @@
* "video_output.h"
* "audio_output.h"
* "xconsole.h"
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* intf_thread_t: describe an interface thread
******************************************************************************
*****************************************************************************
* This structe describes all interface-specific data of the main (interface)
* thread.
******************************************************************************/
*****************************************************************************/
typedef struct intf_thread_s
{
boolean_t b_die; /* `die' flag */
......@@ -42,9 +42,9 @@ typedef struct intf_thread_s
p_input_thread_t p_input;
} intf_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
intf_thread_t * intf_Create ( void );
void intf_Run ( intf_thread_t * p_intf );
void intf_Destroy ( intf_thread_t * p_intf );
......
/*******************************************************************************
/*****************************************************************************
* intf_cmd.h: interface commands parsing and executions functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This file implements the interface commands execution functions. It is used
* by command-line oriented interfaces and scripts. The commands themselves are
* implemented in intf_ctrl.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* intf_arg_t: control fonction argument descriptor
*******************************************************************************
*****************************************************************************
* This structure is used to control an argument type and to transmit
* arguments to control functions. It is also used to parse format string and
* build an easier to use array of arguments.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Argument type */
......@@ -39,13 +39,13 @@ typedef struct
#define INTF_REP_ARG 512 /* argument can be repeated */
#define INTF_PRESENT_ARG 1024 /* argument has been encountered */
/*******************************************************************************
/*****************************************************************************
* intf_command_t: control command descriptor
*******************************************************************************
*****************************************************************************
* This structure describes a control commands. It stores informations needed
* for argument type checking, command execution but also a short inline help.
* See control.c for more informations about fields.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Function control */
......@@ -59,23 +59,23 @@ typedef struct
char * psz_help; /* help text */
} intf_command_t;
/*******************************************************************************
/*****************************************************************************
* Error constants
*******************************************************************************
*****************************************************************************
* These errors should be used as return values for control functions (see
* control.c). The intf_ExecCommand function as different behaviour depending
* of the error it received. Other errors numbers can be used, but their valued
* should be positive to avoid conflict with future error codes.
*******************************************************************************/
*****************************************************************************/
#define INTF_NO_ERROR 0 /* success */
#define INTF_FATAL_ERROR -1 /* fatal error: the program will end */
#define INTF_CRITICAL_ERROR -2 /* critical error: the program will exit */
#define INTF_USAGE_ERROR -3 /* usage error: command usage will be displayed */
#define INTF_OTHER_ERROR -4 /* other error: command prints its own message */
#define INTF_OTHER_ERROR -4/* other error: command prints its own message */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_ExecCommand ( char *psz_cmd );
int intf_ExecScript ( char *psz_filename );
/*******************************************************************************
/*****************************************************************************
* intf_console.h: generic console methods for interface
* (c)1998 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
p_intf_console_t intf_ConsoleCreate ( void );
void intf_ConsoleDestroy ( p_intf_console_t p_console );
......
/*******************************************************************************
/*****************************************************************************
* intf_ctrl.h: interface commands access to control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Extern variables
*******************************************************************************/
*****************************************************************************/
extern const intf_command_t control_command[];
/*******************************************************************************
/*****************************************************************************
* intf_msg.h: messages interface
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This library provides basic functions for threads to interact with user
* interface, such as message output. See config.h for output configuration.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* intf_DbgMsg macros and functions
*******************************************************************************
*****************************************************************************
* The intf_DbgMsg* functions are defined as macro to be able to use the
* compiler extensions and print the file, the function and the line number
* from which they have been called. They call _intf_DbgMsg*() functions after
* having added debugging informations.
* Outside DEBUG mode, intf_DbgMsg* functions do nothing.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
/* DEBUG mode */
......@@ -36,13 +36,13 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
#endif
/*******************************************************************************
/*****************************************************************************
* intf_FlushMsg macro and function
*******************************************************************************
*****************************************************************************
* intf_FlushMsg is a function which flushs message queue and print all messages
* remaining. It is only usefull if INTF_MSG_QUEUE is defined. In this case, it
* is really a function. In the other case, it is a macro doing nothing.
*******************************************************************************/
*****************************************************************************/
#ifdef INTF_MSG_QUEUE
/* Message queue mode */
......@@ -55,9 +55,9 @@ void intf_FlushMsg ( void );
#endif
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
p_intf_msg_t intf_MsgCreate ( void );
void intf_MsgDestroy ( void );
......
/*******************************************************************************
/*****************************************************************************
* intf_sys.h: system dependant interface API
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_SysCreate ( p_intf_thread_t p_intf );
void intf_SysDestroy( p_intf_thread_t p_intf );
void intf_SysManage ( p_intf_thread_t p_intf );
/*******************************************************************************
/*****************************************************************************
* main.h: access to all program variables
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Declaration and extern access to global program object.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* main_t, p_main (global variable)
*******************************************************************************
*****************************************************************************
* This structure has an unique instance, declared in main and pointed by the
* only global variable of the program. It should allow access to any variable
* of the program, for user-interface purposes or more easier call of interface
* and common functions (example: the intf_*Msg functions). Please avoid using
* it when you can access the members you need in an other way. In fact, it
* should only be used by interface thread.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Global properties */
......@@ -39,10 +39,10 @@ typedef struct
extern main_t *p_main;
/*******************************************************************************
/*****************************************************************************
* Prototypes - these methods are used to get default values for some threads
* and modules.
*******************************************************************************/
*****************************************************************************/
int main_GetIntVariable( char *psz_name, int i_default );
char * main_GetPszVariable( char *psz_name, char *psz_default );
void main_PutIntVariable( char *psz_name, int i_value );
......
/*******************************************************************************
/*****************************************************************************
* mtime.h: high rezolution time management functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header provides portable high precision time management functions,
* which should be the only ones used in other segments of the program, since
* functions like gettimeofday() and ftime() are not always supported.
......@@ -9,46 +9,46 @@
* interfaces to system calls and have to be called frequently.
* 'm' stands for 'micro', since maximum resolution is the microsecond.
* Functions prototyped are implemented in interface/mtime.c.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
* this header includes inline functions
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* mtime_t: high precision date or time interval
*******************************************************************************
*****************************************************************************
* Store an high precision date or time interval. The maximum precision is the
* micro-second, and a 64 bits integer is used to avoid any overflow (maximum
* time interval is then 292271 years, which should be length enough for any
* video). Date are stored as a time interval since a common date.
* Note that date and time intervals can be manipulated using regular arithmetic
* operators, and that no special functions are required.
*******************************************************************************/
*****************************************************************************/
typedef s64 mtime_t;
/*******************************************************************************
/*****************************************************************************
* LAST_MDATE: date which will never happen
*******************************************************************************
*****************************************************************************
* This date can be used as a 'never' date, to mark missing events in a function
* supposed to return a date, such as nothing to display in a function
* returning the date of the first image to be displayed. It can be used in
* comparaison with other values: all existing dates will be earlier.
*******************************************************************************/
*****************************************************************************/
#define LAST_MDATE ((mtime_t)((u64)(-1)/2))
/*******************************************************************************
/*****************************************************************************
* MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
*******************************************************************************
*****************************************************************************
* This values is the maximal possible size of the string returned by the
* mstrtime() function, including '-' and the final '\0'. It should be used to
* allocate the buffer.
*******************************************************************************/
*****************************************************************************/
#define MSTRTIME_MAX_SIZE 22
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
char * mstrtime ( char *psz_buffer, mtime_t date );
mtime_t mdate ( void );
void mwait ( mtime_t date );
......
/*******************************************************************************
/*****************************************************************************
* netutils.h: various network functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header describe miscellanous utility functions shared between several
* modules.
*******************************************************************************
*****************************************************************************
* Required headers:
* <netinet/in.h>
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* if_descr_t: describes a network interface.
*******************************************************************************
*****************************************************************************
* Note that if the interface is a point to point one, the broadcast address is
* set to the destination address of that interface
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Interface device name (e.g. "eth0") */
......@@ -31,11 +31,11 @@ typedef struct
} if_descr_t;
/*******************************************************************************
/*****************************************************************************
* net_descr_t: describes all the interfaces of the computer
*******************************************************************************
*****************************************************************************
* Nothing special to say :)
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Number of networks interfaces described below */
......@@ -45,9 +45,9 @@ typedef struct
} net_descr_t;
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int ReadIfConf (int i_sockfd, if_descr_t* p_ifdescr, char* psz_name);
int ReadNetConf (int i_sockfd, net_descr_t* p_net_descr);
int BuildInetAddr ( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port );
......
/*******************************************************************************
/*****************************************************************************
* rsc_files.h: resources files manipulation functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This library describe a general format used to store 'resources'. Resources
* can be anything, including pictures, audio streams, and so on.
*******************************************************************************
*****************************************************************************
* Requires:
* config.h
* common.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Constants
*******************************************************************************/
*****************************************************************************/
/* Maximum length of a resource name (not including the final '\0') - this
* constant should not be changed without extreme care */
#define RESOURCE_MAX_NAME 32
/*******************************************************************************
/*****************************************************************************
* resource_descriptor_t: resource descriptor
*******************************************************************************
*****************************************************************************
* This type describe an entry in the resource table.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
......@@ -35,12 +35,12 @@ typedef struct
#define EMPTY_RESOURCE 0 /* empty place in table */
#define PICTURE_RESOURCE 10 /* native video picture */
/*******************************************************************************
/*****************************************************************************
* resource_file_t: resource file descriptor
*******************************************************************************
*****************************************************************************
* This type describes a resource file and store it's resources table. It can
* be used through the *Resource functions, or directly with the i_file field.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* File informations */
......@@ -57,9 +57,9 @@ typedef struct
/* Resources files types */
#define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
resource_file_t * CreateResourceFile ( char *psz_filename, int i_type, int i_size, int i_mode );
resource_file_t * OpenResourceFile ( char *psz_filename, int i_type, int i_flags );
int UpdateResourceFile ( resource_file_t *p_file );
......
/******************************************************************************
/*****************************************************************************
* spu_decoder.h : sub picture unit decoder thread interface
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* spudec_thread_t : sub picture unit decoder thread descriptor
******************************************************************************/
*****************************************************************************/
typedef struct spudec_thread_s
{
/*
......@@ -32,9 +32,9 @@ typedef struct spudec_thread_s
} spudec_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
spudec_thread_t * spudec_CreateThread( input_thread_t * p_input );
void spudec_DestroyThread( spudec_thread_t * p_spudec );
/*******************************************************************************
/*****************************************************************************
* video.h: common video definitions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header is required by all modules which have to handle pictures. It
* includes all common video types and constants.
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* yuv_data_t: type for storing one Y, U or V sample.
*******************************************************************************/
*****************************************************************************/
typedef u8 yuv_data_t;
/*******************************************************************************
/*****************************************************************************
* picture_t: video picture
*******************************************************************************
*****************************************************************************
* Any picture destined to be displayed by a video output thread should be
* stored in this structure from it's creation to it's effective display.
* Picture type and flags should only be modified by the output thread. Note
* that an empty picture MUST have its flags set to 0.
*******************************************************************************/
*****************************************************************************/
typedef struct picture_s
{
/* Type and flags - should NOT be modified except by the vout thread */
......@@ -77,7 +77,7 @@ typedef struct picture_s
#define RESERVED_DATED_PICTURE 2 /* picture is waiting for DisplayPicture */
#define RESERVED_DISP_PICTURE 3 /* picture is waiting for a DatePixture */
#define READY_PICTURE 4 /* picture is ready for display */
#define DISPLAYED_PICTURE 5 /* picture has been displayed but is linked */
#define DISPLAYED_PICTURE 5/* picture has been displayed but is linked */
#define DESTROYED_PICTURE 6 /* picture is allocated but no more used */
/* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
......@@ -86,14 +86,14 @@ typedef struct picture_s
#define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */
/*******************************************************************************
/*****************************************************************************
* subpicture_t: video sub picture unit
*******************************************************************************
*****************************************************************************
* Any sub picture unit destined to be displayed by a video output thread should
* be stored in this structure from it's creation to it's effective display.
* Subtitle type and flags should only be modified by the output thread. Note
* that an empty subtitle MUST have its flags set to 0.
*******************************************************************************/
*****************************************************************************/
typedef struct subpicture_s
{
/* Type and flags - should NOT be modified except by the vout thread */
......@@ -144,7 +144,7 @@ typedef struct subpicture_s
#define FREE_SUBPICTURE 0 /* subpicture is free and not allocated */
#define RESERVED_SUBPICTURE 1 /* subpicture is allocated and reserved */
#define READY_SUBPICTURE 2 /* subpicture is ready for display */
#define DESTROYED_SUBPICTURE 3 /* subpicture is allocated but no more used */
#define DESTROYED_SUBPICTURE 3/* subpicture is allocated but no more used */
/* Alignment types */
#define RIGHT_ALIGN 10 /* x is absolute for right */
......
......@@ -18,7 +18,7 @@
#ifdef VDEC_SMP
/* ?? move to inline functions */
#define VIDEO_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end )
#define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start ) \
#define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start )\
& VFIFO_SIZE ) == 0 )
#define VIDEO_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] )
#define VIDEO_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1) \
......
/*******************************************************************************
/*****************************************************************************
* video_graphics.h: pictures manipulation primitives
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Includes function to compose, convert and display pictures, and also basic
* functions to copy pictures data or descriptors.
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
* "video.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* video_output.h : video output thread
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This module describes the programming interface for video output threads.
* It includes functions allowing to open a new thread, send pictures to a
* thread, and destroy a previously oppenned video output thread.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* vout_yuv_convert_t: YUV convertion function
*******************************************************************************
*****************************************************************************
* This is the prototype common to all convertion functions. The type of p_pic
* will change depending of the screen depth treated.
* Parameters:
......@@ -21,18 +21,18 @@
* i_pic_line_width picture total line width
* i_matrix_coefficients matrix coefficients
* Picture width and source dimensions must be multiples of 16.
*******************************************************************************/
*****************************************************************************/
typedef void (vout_yuv_convert_t)( p_vout_thread_t p_vout, void *p_pic,
yuv_data_t *p_y, yuv_data_t *p_u, yuv_data_t *p_v,
int i_width, int i_height,
int i_pic_width, int i_pic_height, int i_pic_line_width,
int i_matrix_coefficients );
/*******************************************************************************
/*****************************************************************************
* vout_yuv_t: pre-calculated YUV convertion tables
*******************************************************************************
*****************************************************************************
* These tables are used by convertion and scaling functions.
*******************************************************************************/
*****************************************************************************/
typedef struct vout_yuv_s
{
/* Convertion functions */
......@@ -57,12 +57,12 @@ typedef struct vout_yuv_s
int * p_offset; /* offset array */
} vout_yuv_t;
/*******************************************************************************
/*****************************************************************************
* vout_buffer_t: rendering buffer
*******************************************************************************
*****************************************************************************
* This structure store informations about a buffer. Buffers are not completely
* cleared between displays, and modified areas needs to be stored.
*******************************************************************************/
*****************************************************************************/
typedef struct vout_buffer_s
{
/* Picture area */
......@@ -78,13 +78,13 @@ typedef struct vout_buffer_s
byte_t * p_data; /* memory address */
} vout_buffer_t;
/*******************************************************************************
/*****************************************************************************
* vout_thread_t: video output thread descriptor
*******************************************************************************
*****************************************************************************
* Any independant video output device, such as an X11 window or a GGI device,
* is represented by a video output thread, and described using following
* structure.
*******************************************************************************/
*****************************************************************************/
typedef void (vout_set_palette_t)( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
......@@ -107,7 +107,7 @@ typedef struct vout_thread_s
int i_height; /* current output method height */
int i_bytes_per_line; /* bytes per line (incl. virtual) */
int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */
int i_bytes_per_pixel; /* real screen depth: 1, 2, 3 or 4 */
int i_bytes_per_pixel;/* real screen depth: 1, 2, 3 or 4 */
float f_gamma; /* gamma */
/* Color masks and shifts in RGB mode - masks are set by system
......@@ -172,9 +172,9 @@ typedef struct vout_thread_s
#define VOUT_YUV_CHANGE 0x0800 /* change yuv tables */
#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */
/*******************************************************************************
/*****************************************************************************
* Macros
*******************************************************************************/
*****************************************************************************/
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
#define RGB2PIXEL( p_vout, i_red, i_green, i_blue ) \
......@@ -183,9 +183,9 @@ typedef struct vout_thread_s
((((u32)i_blue) >> p_vout->i_blue_rshift) << p_vout->i_blue_lshift))
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
int i_width, int i_height, int *pi_status );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
......
/*******************************************************************************
/*****************************************************************************
* video_sys.h: system dependant video output display method API
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window );
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
......
/*******************************************************************************
/*****************************************************************************
* video_text.h : text manipulation functions
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/* Text styles - these are primary text styles, used by the vout_Print function.
* They may be ignored or interpreted by higher level functions */
......@@ -12,9 +12,9 @@
#define VOID_TEXT 16 /* no foreground */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
p_vout_font_t vout_LoadFont ( const char *psz_name );
void vout_UnloadFont ( p_vout_font_t p_font );
void vout_TextSize ( p_vout_font_t p_font, int i_style,
......
/*******************************************************************************
/*****************************************************************************
* video_x11.h: X11 video output display method
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* The X11 method for video output thread. The functions declared here should
* not be needed by any other module than video_output.c.
*******************************************************************************
*****************************************************************************
* Required headers:
* <X11/Xlib.h>
* <X11/Xutil.h>
......@@ -14,16 +14,16 @@
* "mtime.h"
* "video.h"
* "video_output.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* vout_x11_t: video output X11 method descriptor
*******************************************************************************
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the X11 specific properties of an output thread. X11 video
* output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams.
*******************************************************************************/
*****************************************************************************/
typedef struct vout_x11_s
{
/* User settings */
......@@ -62,9 +62,9 @@ typedef struct vout_x11_s
int i_completion_type; /* ?? */
} vout_x11_t;
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_X11AllocOutputMethod ( vout_thread_t *p_vout, video_cfg_t *p_cfg );
void vout_X11FreeOutputMethod ( vout_thread_t *p_vout );
int vout_X11CreateOutputMethod ( vout_thread_t *p_vout );
......
/*******************************************************************************
/*****************************************************************************
* video_yuv.h: YUV transformation functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Provides functions prototypes to perform the YUV conversion. The functions
* may be implemented in one of the video_yuv_* files.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_InitYUV ( vout_thread_t *p_vout );
int vout_ResetYUV ( vout_thread_t *p_vout );
void vout_EndYUV ( vout_thread_t *p_vout );
/*******************************************************************************
/*****************************************************************************
* External prototypes
*******************************************************************************/
*****************************************************************************/
#ifdef HAVE_MMX
/* YUV transformations for MMX - in video_yuv_mmx.S
......
/*******************************************************************************
/*****************************************************************************
* vlc.h: all headers
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* This header includes all vlc .h headers and depending headers. A source file
* including it would also be able to use any of the structures of the project.
* Note that functions or system headers specific to the file itself are not
* included.
*******************************************************************************
*****************************************************************************
* required headers:
* none
*******************************************************************************/
*****************************************************************************/
/* System headers */
#include <errno.h>
......
/*******************************************************************************
/*****************************************************************************
* vlc_thread.h : thread implementation for vieolan client
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header is supposed to provide a portable threads implementation.
* Currently, it is a wrapper to the POSIX pthreads library.
*******************************************************************************/
*****************************************************************************/
#include <pthread.h>
/******************************************************************************
/*****************************************************************************
* Constants
******************************************************************************
*****************************************************************************
* These constants are used by all threads in *_CreateThread() and
* *_DestroyThreads() functions. Since those calls are non-blocking, an integer
* value is used as a shared flag to represent the status of the thread.
*******************************************************************************/
*****************************************************************************/
/* Void status - this value can be used to be sure, in an array of recorded
* threads, that no operation is currently in progress on the concerned thread */
......@@ -33,18 +33,18 @@
#define THREAD_ERROR 30 /* an error occured */
#define THREAD_FATAL 31 /* an fatal error occured - program must end */
/******************************************************************************
/*****************************************************************************
* Types definition
******************************************************************************/
*****************************************************************************/
typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t;
typedef void *(*vlc_thread_func_t)(void *p_data);
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, char *psz_name,
vlc_thread_func_t func, void *p_data );
......@@ -62,9 +62,9 @@ static __inline__ int vlc_cond_wait ( vlc_cond_t *p_condvar, vlc_mutex_t *p_
//static _inline__ int vlc_cond_timedwait ( vlc_cond_t * condvar, vlc_mutex_t * mutex,
// mtime_t absoute_timeout_time );
/*******************************************************************************
/*****************************************************************************
* vlc_thread_create: create a thread
******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
char *psz_name, vlc_thread_func_t func,
void *p_data)
......@@ -72,65 +72,65 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
return pthread_create( p_thread, NULL, func, p_data );
}
/******************************************************************************
/*****************************************************************************
* vlc_thread_exit: terminate a thread
*******************************************************************************/
*****************************************************************************/
static __inline__ void vlc_thread_exit( void )
{
pthread_exit( 0 );
}
/*******************************************************************************
/*****************************************************************************
* vlc_thread_join: wait until a thread exits
******************************************************************************/
*****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread )
{
pthread_join( thread, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{
return pthread_mutex_init( p_mutex, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{
return pthread_mutex_lock( p_mutex );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_unlock: unlock a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{
return pthread_mutex_unlock( p_mutex );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_init: initialize a condition
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{
return pthread_cond_init( p_condvar, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{
return pthread_cond_signal( p_condvar );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_wait: wait until condition completion
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{
return pthread_cond_wait( p_condvar, p_mutex );
......
......@@ -91,7 +91,7 @@ typedef struct lookup_s
int i_length;
} lookup_t;
/******************************************************************************
/*****************************************************************************
* ac_lookup_t : special entry type for lookup tables about ac coefficients
*****************************************************************************/
typedef struct dct_lookup_s
......
This diff is collapsed.
/******************************************************************************
/*****************************************************************************
* audio_dsp.c : dsp functions library
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/* TODO:
*
......@@ -12,9 +12,9 @@
*
*/
/******************************************************************************
/*****************************************************************************
* Preamble
******************************************************************************/
*****************************************************************************/
#include <fcntl.h> /* open(), O_WRONLY */
#include <sys/ioctl.h> /* ioctl() */
#include <unistd.h> /* write(), close() */
......@@ -30,13 +30,13 @@
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
/******************************************************************************
/*****************************************************************************
* aout_dspOpen: opens the audio device (the digital sound processor)
******************************************************************************
*****************************************************************************
* - This function opens the dsp as an usual non-blocking write-only file, and
* modifies the p_dsp->i_fd with the file's descriptor.
* - p_dsp->psz_device must be set before calling this function !
******************************************************************************/
*****************************************************************************/
int aout_dspOpen( aout_dsp_t *p_dsp )
{
if ( (p_dsp->i_fd = open( p_dsp->psz_device, O_WRONLY )) < 0 )
......@@ -48,9 +48,9 @@ int aout_dspOpen( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspReset: resets the dsp
******************************************************************************/
*****************************************************************************/
int aout_dspReset( aout_dsp_t *p_dsp )
{
if ( ioctl( p_dsp->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
......@@ -62,13 +62,13 @@ int aout_dspReset( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetFormat: sets the dsp output format
******************************************************************************
*****************************************************************************
* This functions tries to initialize the dsp output format with the value
* contained in the dsp structure, and if this value could not be set, the
* default value returned by ioctl is set.
******************************************************************************/
*****************************************************************************/
int aout_dspSetFormat( aout_dsp_t *p_dsp )
{
int i_format;
......@@ -89,11 +89,11 @@ int aout_dspSetFormat( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetChannels: sets the dsp's stereo or mono mode
******************************************************************************
*****************************************************************************
* This function acts just like the previous one...
******************************************************************************/
*****************************************************************************/
int aout_dspSetChannels( aout_dsp_t *p_dsp )
{
boolean_t b_stereo;
......@@ -114,13 +114,13 @@ int aout_dspSetChannels( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetRate: sets the dsp's audio output rate
******************************************************************************
*****************************************************************************
* This function tries to initialize the dsp with the rate contained in the
* dsp structure, but if the dsp doesn't support this value, the function uses
* the value returned by ioctl...
******************************************************************************/
*****************************************************************************/
int aout_dspSetRate( aout_dsp_t *p_dsp )
{
long l_rate;
......@@ -141,9 +141,9 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspGetBufInfo: buffer status query
******************************************************************************
*****************************************************************************
* This function fills in the audio_buf_info structure :
* - int fragments : number of available fragments (partially usend ones not
* counted)
......@@ -151,25 +151,25 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
* - int fragsize : size of a fragment in bytes
* - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize
******************************************************************************/
*****************************************************************************/
void aout_dspGetBufInfo( aout_dsp_t *p_dsp )
{
ioctl( p_dsp->i_fd, SNDCTL_DSP_GETOSPACE, &p_dsp->buf_info );
}
/******************************************************************************
/*****************************************************************************
* aout_dspPlaySamples: plays a sound samples buffer
******************************************************************************
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
******************************************************************************/
*****************************************************************************/
void aout_dspPlaySamples( aout_dsp_t *p_dsp, byte_t *buffer, int i_size )
{
write( p_dsp->i_fd, buffer, i_size );
}
/******************************************************************************
/*****************************************************************************
* aout_dspClose: closes the dsp audio device
******************************************************************************/
*****************************************************************************/
void aout_dspClose( aout_dsp_t *p_dsp )
{
close( p_dsp->i_fd );
......
/******************************************************************************
/*****************************************************************************
* audio_output.c : audio output thread
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/* TODO:
*
......@@ -15,9 +15,9 @@
*
*/
/******************************************************************************
/*****************************************************************************
* Preamble
******************************************************************************/
*****************************************************************************/
#include <unistd.h>
#include <sys/soundcard.h>
......@@ -35,9 +35,9 @@
#include "audio_dsp.h"
#include "main.h"
/******************************************************************************
/*****************************************************************************
* Local prototypes
******************************************************************************/
*****************************************************************************/
static int aout_SpawnThread( aout_thread_t * p_aout );
......@@ -56,9 +56,9 @@ void aout_Thread_U16_Stereo ( aout_thread_t * p_aout );
static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long l_numerator, long l_denominator );
static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, mtime_t aout_date );
/******************************************************************************
/*****************************************************************************
* aout_CreateThread: initialize audio thread
******************************************************************************/
*****************************************************************************/
aout_thread_t *aout_CreateThread( int *pi_status )
{
aout_thread_t * p_aout; /* thread descriptor */
......@@ -129,9 +129,9 @@ aout_thread_t *aout_CreateThread( int *pi_status )
return( p_aout );
}
/******************************************************************************
/*****************************************************************************
* aout_SpawnThread
******************************************************************************/
*****************************************************************************/
static int aout_SpawnThread( aout_thread_t * p_aout )
{
int i_fifo;
......@@ -266,9 +266,9 @@ static int aout_SpawnThread( aout_thread_t * p_aout )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_DestroyThread
******************************************************************************/
*****************************************************************************/
void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
{
//???? pi_status is not handled correctly: check vout how to do!
......@@ -289,9 +289,9 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
free( p_aout );
}
/******************************************************************************
/*****************************************************************************
* aout_CreateFifo
******************************************************************************/
*****************************************************************************/
aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
{
int i_fifo;
......@@ -390,9 +390,9 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
return( &p_aout->fifo[i_fifo] );
}
/******************************************************************************
/*****************************************************************************
* aout_DestroyFifo
******************************************************************************/
*****************************************************************************/
void aout_DestroyFifo( aout_fifo_t * p_fifo )
{
intf_DbgMsg("aout debug: requesting destruction of audio output fifo (%p)\n", p_fifo);
......@@ -402,7 +402,7 @@ void aout_DestroyFifo( aout_fifo_t * p_fifo )
/* Here are the local macros */
#define UPDATE_INCREMENT( increment, integer ) \
if ( ((increment).l_remainder += (increment).l_euclidean_remainder) >= 0 ) \
if ( ((increment).l_remainder += (increment).l_euclidean_remainder) >= 0 )\
{ \
(integer) += (increment).l_euclidean_integer + 1; \
(increment).l_remainder -= (increment).l_euclidean_denominator; \
......@@ -414,9 +414,9 @@ void aout_DestroyFifo( aout_fifo_t * p_fifo )
/* Following functions are local */
/******************************************************************************
/*****************************************************************************
* InitializeIncrement
******************************************************************************/
*****************************************************************************/
static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long l_numerator, long l_denominator )
{
p_increment->l_remainder = -l_denominator;
......@@ -433,9 +433,9 @@ static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long
p_increment->l_euclidean_denominator = l_denominator;
}
/******************************************************************************
/*****************************************************************************
* NextFrame
******************************************************************************/
*****************************************************************************/
static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, mtime_t aout_date )
{
long l_units, l_rate;
......
/******************************************************************************
/*****************************************************************************
* generic_decoder.c : generic decoder thread
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* This decoder provides a way to parse packets which do not belong to any
* known stream type, or to redirect packets to files. It can extract PES files
* from a multiplexed stream, identify automatically ES in a stream missing
......@@ -10,11 +10,11 @@
* mode.
* A single generic decoder is able to handle several ES, therefore it can be
* used as a 'default' decoder by the input thread.
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include "vlc.h"
/*#include <errno.h>
......@@ -56,15 +56,15 @@ static void IdentifyPES ( gdec_thread_t *p_gdec, pes_packet_t *p_pes
int i_stream_id );
static void PrintPES ( pes_packet_t *p_pes, int i_stream_id );
/******************************************************************************
/*****************************************************************************
* gdec_CreateThread: create a generic decoder thread
******************************************************************************
*****************************************************************************
* This function creates a new generic decoder thread, and returns a pointer
* to its description. On error, it returns NULL.
* Following configuration properties are used:
* GDEC_CFG_ACTIONS (required)
* ??
******************************************************************************/
*****************************************************************************/
gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input,
int *pi_status )
{
......@@ -127,13 +127,13 @@ gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input,
return( p_gdec );
}
/******************************************************************************
/*****************************************************************************
* gdec_DestroyThread: destroy a generic decoder thread
******************************************************************************
*****************************************************************************
* Destroy a terminated thread. This function will return 0 if the thread could
* be destroyed, and non 0 else. The last case probably means that the thread
* was still active, and another try may succeed.
******************************************************************************/
*****************************************************************************/
void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status )
{
int i_status; /* thread status */
......@@ -164,12 +164,12 @@ void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status )
/* following functions are local */
/******************************************************************************
/*****************************************************************************
* CheckConfiguration: check gdec_CreateThread() configuration
******************************************************************************
*****************************************************************************
* Set default parameters where required. In DEBUG mode, check if configuration
* is valid.
******************************************************************************/
*****************************************************************************/
static int CheckConfiguration( gdec_cfg_t *p_cfg )
{
#ifdef DEBUG
......@@ -183,13 +183,13 @@ static int CheckConfiguration( gdec_cfg_t *p_cfg )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* InitThread: initialize gdec thread
******************************************************************************
*****************************************************************************
* This function is called from RunThread and performs the second step of the
* initialization. It returns 0 on success. Note that the thread's flag are not
* modified inside this function.
******************************************************************************/
*****************************************************************************/
static int InitThread( gdec_thread_t *p_gdec )
{
/* ?? */
......@@ -210,12 +210,12 @@ static int InitThread( gdec_thread_t *p_gdec )
return(0);
}
/******************************************************************************
/*****************************************************************************
* RunThread: generic decoder thread
******************************************************************************
*****************************************************************************
* Generic decoder thread. This function does only returns when the thread is
* terminated.
******************************************************************************/
*****************************************************************************/
static void RunThread( gdec_thread_t *p_gdec )
{
pes_packet_t * p_pes; /* current packet */
......@@ -299,13 +299,13 @@ static void RunThread( gdec_thread_t *p_gdec )
EndThread( p_gdec );
}
/******************************************************************************
/*****************************************************************************
* ErrorThread: RunThread() error loop
******************************************************************************
*****************************************************************************
* This function is called when an error occured during thread main's loop. The
* thread can still receive feed, but must be ready to terminate as soon as
* possible.
******************************************************************************/
*****************************************************************************/
static void ErrorThread( gdec_thread_t *p_gdec )
{
pes_packet_t * p_pes; /* pes packet */
......@@ -326,12 +326,12 @@ static void ErrorThread( gdec_thread_t *p_gdec )
}
}
/******************************************************************************
/*****************************************************************************
* EndThread: thread destruction
******************************************************************************
*****************************************************************************
* This function is called when the thread ends after a sucessfull
* initialization.
******************************************************************************/
*****************************************************************************/
static void EndThread( gdec_thread_t *p_gdec )
{
int * pi_status; /* thread status */
......@@ -352,12 +352,12 @@ static void EndThread( gdec_thread_t *p_gdec )
intf_DbgMsg("%p\n", p_gdec);
}
/******************************************************************************
/*****************************************************************************
* IdentifyPES: identify a PES packet
******************************************************************************
*****************************************************************************
* Update ES tables in the input thread according to the stream_id value. See
* ISO 13818-1, table 2-18.
******************************************************************************/
*****************************************************************************/
static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_stream_id )
{
int i_id; /* stream id in es table */
......@@ -420,14 +420,14 @@ static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_strea
/* ?? */
}
/******************************************************************************
/*****************************************************************************
* PrintPES: print informations about a PES packet
******************************************************************************
*****************************************************************************
* This function will print information about a received PES packet. It is
* probably usefull only for debugging purposes, or before demultiplexing a
* stream. It has two different formats, depending of the presence of the DEBUG
* symbol.
******************************************************************************/
*****************************************************************************/
static void PrintPES( pes_packet_t *p_pes, int i_stream_id )
{
char psz_pes[128]; /* descriptor buffer */
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* input_ctrl.c: Decodeur control
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Control the extraction and the decoding of the programs elements carried in
* a stream.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include "vlc.h"
......@@ -44,14 +44,14 @@
#endif
/******************************************************************************
/*****************************************************************************
* input_AddPgrmElem: Start the extraction and the decoding of a program element
******************************************************************************
*****************************************************************************
* Add the element given by its PID in the list of PID to extract and spawn
* the decoding thread.
* This function only modifies the table of selected es, but must NOT modify
* the table of ES itself.
******************************************************************************/
*****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
{
int i_es_loop, i_selected_es_loop;
......@@ -185,14 +185,14 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
return( -1 );
}
/******************************************************************************
/*****************************************************************************
* input_DelPgrmElem: Stop the decoding of a program element
******************************************************************************
*****************************************************************************
* Stop the extraction of the element given by its PID and kill the associated
* decoder thread
* This function only modifies the table of selected es, but must NOT modify
* the table of ES itself.
******************************************************************************/
*****************************************************************************/
int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
{
int i_selected_es_loop, i_last_selected;
......@@ -275,12 +275,12 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
/******************************************************************************
/*****************************************************************************
* input_IsElemRecv: Test if an element given by its PID is currently received
******************************************************************************
*****************************************************************************
* Cannot return the position of the es in the pp_selected_es, for it can
* change once we have released the lock
******************************************************************************/
*****************************************************************************/
boolean_t input_IsElemRecv( input_thread_t *p_input, int i_id )
{
boolean_t b_is_recv = 0;
......
/*******************************************************************************
/*****************************************************************************
* input_file.c: functions to read from a file
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <sys/types.h>
#include <sys/uio.h>
......@@ -17,18 +17,18 @@
#include "input.h"
#include "input_file.h"
/******************************************************************************
/*****************************************************************************
* input_FileOpen : open a file descriptor
******************************************************************************/
*****************************************************************************/
int input_FileOpen( input_thread_t *p_input )
{
//??
return( 1 );
}
/******************************************************************************
/*****************************************************************************
* input_FileRead : read from a file
******************************************************************************/
*****************************************************************************/
int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count )
{
......@@ -36,9 +36,9 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
return( -1 );
}
/******************************************************************************
/*****************************************************************************
* input_FileClose : close a file descriptor
******************************************************************************/
*****************************************************************************/
void input_FileClose( input_thread_t *p_input )
{
//??
......
/*******************************************************************************
/*****************************************************************************
* netlist.c: input thread
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* Manages the TS and PES netlists (see netlist.h).
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <sys/types.h>
#include <sys/uio.h>
#include <stdlib.h>
......@@ -24,13 +24,13 @@
#include "input.h"
#include "input_netlist.h"
/******************************************************************************
/*****************************************************************************
* Local prototypes
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* input_NetlistOpen: initialize the netlists buffers
******************************************************************************/
*****************************************************************************/
int input_NetlistInit( input_thread_t *p_input )
{
int i_base, i_packets, i_iovec;
......@@ -116,9 +116,9 @@ int input_NetlistInit( input_thread_t *p_input )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* input_NetlistClean: clean the netlists buffers
******************************************************************************/
*****************************************************************************/
void input_NetlistEnd( input_thread_t *p_input )
{
int i;
......
/*******************************************************************************
/*****************************************************************************
* network.c: functions to read from the network
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Manages a socket.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <sys/types.h>
#include <sys/uio.h>
#include <string.h>
......@@ -33,9 +33,9 @@
#include "intf_msg.h"
#include "main.h"
/******************************************************************************
/*****************************************************************************
* input_NetworkOpen: initialize a network stream
******************************************************************************/
*****************************************************************************/
int input_NetworkOpen( input_thread_t *p_input )
{
int i_socket_option;
......@@ -186,15 +186,15 @@ int input_NetworkOpen( input_thread_t *p_input )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* input_NetworkRead: read a stream from the network
******************************************************************************
*****************************************************************************
* Wait for data during up to 1 second and then abort if none is arrived. The
* number of bytes read is returned or -1 if an error occurs (so 0 is returned
* after a timeout)
* We don't have to make any test on presentation times, since we suppose
* the network server sends us data when we need it.
******************************************************************************/
*****************************************************************************/
int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count )
{
......@@ -221,9 +221,9 @@ int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector,
return( i_rc );
}
/******************************************************************************
/*****************************************************************************
* input_NetworkClose: close a network stream
******************************************************************************/
*****************************************************************************/
void input_NetworkClose( input_thread_t *p_input )
{
/* Close local socket. */
......
/*******************************************************************************
/*****************************************************************************
* pcr.c: PCR management
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Manages structures containing PCR information.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <stdio.h>
#include <sys/types.h>
#include <sys/uio.h> /* iovec */
......@@ -46,9 +46,9 @@
*
*/
/******************************************************************************
/*****************************************************************************
* input_PcrReInit : Reinitialize the pcr_descriptor
******************************************************************************/
*****************************************************************************/
void input_PcrReInit( input_thread_t *p_input )
{
ASSERT( p_input );
......@@ -58,9 +58,9 @@ void input_PcrReInit( input_thread_t *p_input )
p_input->p_pcr->c_average_count = 0;
}
/******************************************************************************
/*****************************************************************************
* input_PcrInit : Initialize PCR decoder
******************************************************************************/
*****************************************************************************/
int input_PcrInit( input_thread_t *p_input )
{
ASSERT( p_input );
......@@ -75,9 +75,9 @@ int input_PcrInit( input_thread_t *p_input )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* input_PcrDecode : Decode a PCR frame
******************************************************************************/
*****************************************************************************/
void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es,
u8* p_pcr_data )
{
......@@ -128,9 +128,9 @@ void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es,
}
}
/******************************************************************************
/*****************************************************************************
* input_PcrEnd : Clean PCR structures before dying
******************************************************************************/
*****************************************************************************/
void input_PcrEnd( input_thread_t *p_input )
{
ASSERT( p_input );
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* input_vlan.c: vlan management library
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
......@@ -27,29 +27,29 @@
#include "intf_msg.h"
#include "main.h"
/*******************************************************************************
/*****************************************************************************
* input_vlan_t: vlan library data
*******************************************************************************
*****************************************************************************
* Store global vlan library data.
*******************************************************************************/
*****************************************************************************/
typedef struct input_vlan_s
{
int i_vlan_id; /* current vlan number */
mtime_t last_change; /* last change date */
} input_vlan_t;
/*******************************************************************************
/*****************************************************************************
* Local prototypes
*******************************************************************************/
*****************************************************************************/
static int ZeTrucMucheFunction( int Channel );
/*******************************************************************************
/*****************************************************************************
* input_VlanCreate: initialize global vlan method data
*******************************************************************************
*****************************************************************************
* Initialize vlan input method global data. This function should be called
* once before any input thread is created or any call to other input_Vlan*()
* function is attempted.
*******************************************************************************/
*****************************************************************************/
int input_VlanCreate( void )
{
/* Allocate structure */
......@@ -68,12 +68,12 @@ int input_VlanCreate( void )
return( 0 );
}
/*******************************************************************************
/*****************************************************************************
* input_VlanDestroy: free global vlan method data
*******************************************************************************
*****************************************************************************
* Free resources allocated by input_VlanMethodInit. This function should be
* called at the end of the program.
*******************************************************************************/
*****************************************************************************/
void input_VlanDestroy( void )
{
/* Return to default vlan */
......@@ -86,9 +86,9 @@ void input_VlanDestroy( void )
free( p_main->p_vlan );
}
/*******************************************************************************
/*****************************************************************************
* input_VlanJoin: join a vlan
*******************************************************************************
*****************************************************************************
* This function will try to join a vlan. If the relevant interface is already
* on the good vlan, nothing will be done. Else, and if possible (if the
* interface is not locked), the vlan server will be contacted and a change will
......@@ -96,7 +96,7 @@ void input_VlanDestroy( void )
* that once a vlan is no more used, it's interface should be unlocked using
* input_VlanLeave().
* Non 0 will be returned in case of error.
*******************************************************************************/
*****************************************************************************/
int input_VlanJoin( int i_vlan_id )
{
/* If last change is too recent, wait a while */
......@@ -112,12 +112,12 @@ int input_VlanJoin( int i_vlan_id )
return( ZeTrucMucheFunction( i_vlan_id ) ); // ?? join vlan
}
/*******************************************************************************
/*****************************************************************************
* input_VlanLeave: leave a vlan
*******************************************************************************
*****************************************************************************
* This function tells the vlan library that the designed interface is no more
* locked and than vlan changes can occur.
*******************************************************************************/
*****************************************************************************/
void input_VlanLeave( int i_vlan_id )
{
// ??
......
/*******************************************************************************
/*****************************************************************************
* control.c: user control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all threads, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include "vlc.h"
/*??
#include <pthread.h>
......
/*******************************************************************************
/*****************************************************************************
* interface.c: interface access for other threads
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* This library provides basic functions for threads to interact with user
* interface, such as command line.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -31,14 +31,14 @@
#include "intf_sys.h"
/*******************************************************************************
/*****************************************************************************
* intf_channel_t: channel description
*******************************************************************************
*****************************************************************************
* A 'channel' is a descriptor of an input method. It is used to switch easily
* from source to source without having to specify the whole input thread
* configuration. The channels array, stored in the interface thread object, is
* loaded in intf_Create, and unloaded in intf_Destroy.
*******************************************************************************/
*****************************************************************************/
typedef struct intf_channel_s
{
/* Channel description */
......@@ -52,19 +52,19 @@ typedef struct intf_channel_s
int i_input_vlan; /* vlan */
} intf_channel_t;
/*******************************************************************************
/*****************************************************************************
* Local prototypes
*******************************************************************************/
*****************************************************************************/
static int LoadChannels ( intf_thread_t *p_intf, char *psz_filename );
static void UnloadChannels ( intf_thread_t *p_intf );
static int ParseChannel ( intf_channel_t *p_channel, char *psz_str );
/*******************************************************************************
/*****************************************************************************
* intf_Create: prepare interface before main loop
*******************************************************************************
*****************************************************************************
* This function opens output devices and create specific interfaces. It send
* it's own error messages.
*******************************************************************************/
*****************************************************************************/
intf_thread_t* intf_Create( void )
{
intf_thread_t *p_intf;
......@@ -107,11 +107,11 @@ intf_thread_t* intf_Create( void )
return( p_intf );
}
/*******************************************************************************
/*****************************************************************************
* intf_Run
*******************************************************************************
*****************************************************************************
* Initialization script and main interface loop.
*******************************************************************************/
*****************************************************************************/
void intf_Run( intf_thread_t *p_intf )
{
/* Execute the initialization script - if a positive number is returned,
......@@ -149,11 +149,11 @@ void intf_Run( intf_thread_t *p_intf )
}
}
/*******************************************************************************
/*****************************************************************************
* intf_Destroy: clean interface after main loop
*******************************************************************************
*****************************************************************************
* This function destroys specific interfaces and close output devices.
*******************************************************************************/
*****************************************************************************/
void intf_Destroy( intf_thread_t *p_intf )
{
/* Destroy interfaces */
......@@ -167,12 +167,12 @@ void intf_Destroy( intf_thread_t *p_intf )
free( p_intf );
}
/*******************************************************************************
/*****************************************************************************
* intf_SelectChannel: change channel
*******************************************************************************
*****************************************************************************
* Kill existing input, if any, and try to open a new one, using an input
* configuration table.
*******************************************************************************/
*****************************************************************************/
int intf_SelectChannel( intf_thread_t * p_intf, int i_channel )
{
intf_channel_t * p_channel; /* channel */
......@@ -313,9 +313,9 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
/* following functions are local */
/*******************************************************************************
/*****************************************************************************
* LoadChannels: load channels description from a file
*******************************************************************************
*****************************************************************************
* This structe describes all interface-specific data of the main (interface)
* thread.
* Each line of the file is a semicolon separated list of the following
......@@ -329,7 +329,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
* The last field must end with a semicolon.
* Comments and empty lines are not explicitely allowed, but lines with parsing
* errors are ignored without warning.
*******************************************************************************/
*****************************************************************************/
static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
{
FILE * p_file; /* file */
......@@ -391,11 +391,11 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* UnloadChannels: unload channels description
******************************************************************************
*****************************************************************************
* This function free all resources allocated by LoadChannels, if any.
******************************************************************************/
*****************************************************************************/
static void UnloadChannels( intf_thread_t *p_intf )
{
int i_channel; /* channel index */
......@@ -424,11 +424,11 @@ static void UnloadChannels( intf_thread_t *p_intf )
}
/*******************************************************************************
/*****************************************************************************
* ParseChannel: parse a channel description line
*******************************************************************************
*****************************************************************************
* See LoadChannels. This function return non 0 on parsing error.
*******************************************************************************/
*****************************************************************************/
static int ParseChannel( intf_channel_t *p_channel, char *psz_str )
{
char * psz_index; /* current character */
......
/******************************************************************************
/*****************************************************************************
* intf_3dfx.c: 3dfx interface
* (c)2000 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Preamble
******************************************************************************/
*****************************************************************************/
#include <errno.h>
#include <signal.h>
#include <stdio.h> /* stderr */
......@@ -33,17 +33,17 @@
#include "interface.h"
#include "main.h"
/******************************************************************************
/*****************************************************************************
* intf_sys_t: description and status of 3dfx interface
******************************************************************************/
*****************************************************************************/
typedef struct intf_sys_s
{
} intf_sys_t;
/******************************************************************************
/*****************************************************************************
* intf_SysCreate: initialize 3dfx interface
******************************************************************************/
*****************************************************************************/
int intf_SysCreate( intf_thread_t *p_intf )
{
/* Allocate instance and initialize some members */
......@@ -67,9 +67,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* intf_SysDestroy: destroy 3dfx interface
******************************************************************************/
*****************************************************************************/
void intf_SysDestroy( intf_thread_t *p_intf )
{
/* Close input thread, if any (blocking) */
......@@ -89,9 +89,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
}
/******************************************************************************
/*****************************************************************************
* intf_SysManage: event loop
******************************************************************************/
*****************************************************************************/
void intf_SysManage( intf_thread_t *p_intf )
{
unsigned int buf;
......
/*******************************************************************************
/*****************************************************************************
* intf_cmd.c: interface commands parsing and executions functions
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* This file implements the interface commands execution functions. It is used
* by command-line oriented interfaces and scripts. The commands themselves are
* implemented in intf_ctrl.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -35,9 +35,9 @@ static int CheckCommandArguments ( intf_arg_t argv[INTF_MAX_ARGS], int i_argc
static void ParseFormatString ( intf_arg_t format[INTF_MAX_ARGS], char *psz_format );
static int ConvertArgument ( intf_arg_t *p_arg, int i_flags, char *psz_str );
/*******************************************************************************
/*****************************************************************************
* intf_ExecCommand: parse and execute a command
*******************************************************************************
*****************************************************************************
* This function is called when a command needs to be executed. It parse the
* command line, build an argument array, find the command in control commands
* array and run the command. It returns the return value of the command, or
......@@ -45,7 +45,7 @@ static int ConvertArgument ( intf_arg_t *p_arg, int i_flags, char *psz_
* function.
* Note that this function may terminate abruptly the program or signify it's
* end to the interface thread.
*******************************************************************************/
*****************************************************************************/
int intf_ExecCommand( char *psz_cmd )
{
char * psz_argv[INTF_MAX_ARGS]; /* arguments pointers */
......@@ -118,14 +118,14 @@ int intf_ExecCommand( char *psz_cmd )
return( i_return );
}
/*******************************************************************************
/*****************************************************************************
* intf_ExecScript: parse and execute a command script
*******************************************************************************
*****************************************************************************
* This function, based on ExecCommand read a file and tries to execute each
* of its line as a command. It returns 0 if everything succeeded, a negative
* number if the script could not be executed and a positive one if an error
* occured during execution.
*******************************************************************************/
*****************************************************************************/
int intf_ExecScript( char *psz_filename )
{
FILE * p_file; /* file */
......@@ -176,13 +176,13 @@ int intf_ExecScript( char *psz_filename )
/* following functions are local */
/*******************************************************************************
/*****************************************************************************
* ParseCommandArguments: isolate arguments in a command line
*******************************************************************************
*****************************************************************************
* This function modify the original command line, adding '\0' and completes
* an array of pointers to beginning of arguments. It return the number of
* arguments.
*******************************************************************************/
*****************************************************************************/
static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd )
{
int i_argc; /* number of arguments */
......@@ -223,16 +223,16 @@ static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd )
return( i_argc );
}
/*******************************************************************************
/*****************************************************************************
* CheckCommandArguments: check arguments agains format
*******************************************************************************
*****************************************************************************
* This function parse each argument and tries to find a match in the format
* string. It fills the argv array.
* If all arguments have been sucessfuly identified and converted, it returns
* 0, else, an error message is issued and non 0 is returned.
* Note that no memory is allocated by this function, but that the arguments
* can be modified.
*******************************************************************************/
*****************************************************************************/
static int CheckCommandArguments( intf_arg_t argv[INTF_MAX_ARGS], int i_argc,
char *psz_argv[INTF_MAX_ARGS], char *psz_format )
{
......@@ -405,13 +405,13 @@ static int CheckCommandArguments( intf_arg_t argv[INTF_MAX_ARGS], int i_argc,
return( 0 );
}
/*******************************************************************************
/*****************************************************************************
* ConvertArgument: try to convert an argument to a given type
*******************************************************************************
*****************************************************************************
* This function tries to convert the string argument given in psz_str to
* a type specified in i_flags. It updates p_arg and returns O on success,
* or 1 on error. No error message is issued.
*******************************************************************************/
*****************************************************************************/
static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
{
char *psz_end; /* end pointer for conversion functions */
......@@ -455,9 +455,9 @@ static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
return( 0 );
}
/*******************************************************************************
/*****************************************************************************
* ParseFormatString: parse a format string (ok ?)
*******************************************************************************
*****************************************************************************
* This function read a format string, as specified in the control_command
* array, and fill a format array, to allow easier argument identification.
* Note that no memory is allocated by this function, but that, in a named
......@@ -466,7 +466,7 @@ static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
* Note that this function is designed to be efficient, not to check everything
* in a format string, which should be entered by a developper and therefore
* should be correct (TRUST !).
*******************************************************************************/
*****************************************************************************/
static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_format )
{
char * psz_index; /* format string index */
......@@ -515,7 +515,7 @@ static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_forma
format[i_index].ps_name = psz_start;
break;
#ifdef DEBUG
default: /* error which should never happen: incorrect format */
default:/* error which should never happen: incorrect format */
intf_DbgMsg("error: incorrect format string `%s'\n", psz_format);
break;
#endif
......
/*******************************************************************************
/*****************************************************************************
* intf_console.c: generic console for interface
* (c)1998 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <stdlib.h>
#include "config.h"
/*******************************************************************************
/*****************************************************************************
* intf_console_t: console descriptor
*******************************************************************************
*****************************************************************************
* Generic console object. This object will have a representation depending of
* the interface.
*******************************************************************************/
*****************************************************************************/
typedef struct intf_console_s
{
/* Text and history arrays - last line/command has indice 0 */
......@@ -23,16 +23,16 @@ typedef struct intf_console_s
char * psz_history[INTF_CONSOLE_MAX_HISTORY];
} intf_console_t;
/*******************************************************************************
/*****************************************************************************
* Local prototypes
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* intf_ConsoleCreate: create console
*******************************************************************************
*****************************************************************************
* This function will initialize the console object.
* It returns NULL on error.
*******************************************************************************/
*****************************************************************************/
intf_console_t *intf_ConsoleCreate( void )
{
intf_console_t *p_console;
......@@ -41,42 +41,42 @@ intf_console_t *intf_ConsoleCreate( void )
return( p_console );
}
/*******************************************************************************
/*****************************************************************************
* intf_ConsoleDestroy
*******************************************************************************
*****************************************************************************
* Destroy the console instance initialized by intf_ConsoleCreate.
*******************************************************************************/
*****************************************************************************/
void intf_ConsoleDestroy( intf_console_t *p_console )
{
free( p_console );
}
/*******************************************************************************
/*****************************************************************************
* intf_ConsoleClear: clear console
*******************************************************************************
*****************************************************************************
* Empty all text.
*******************************************************************************/
*****************************************************************************/
void intf_ConsoleClear( intf_console_t *p_console )
{
//??
}
/*******************************************************************************
/*****************************************************************************
* intf_ConsolePrint: print a message to console
*******************************************************************************
*****************************************************************************
* Print a message to the console.
*******************************************************************************/
*****************************************************************************/
void intf_ConsolePrint( intf_console_t *p_console, char *psz_str )
{
//??
}
/*******************************************************************************
/*****************************************************************************
* intf_ConsoleExec: execute a command in console
*******************************************************************************
*****************************************************************************
* This function will run a command and print its result in console.
*******************************************************************************/
*****************************************************************************/
void intf_ConsoleExec( intf_console_t *p_console, char *psz_str )
{
//??
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/******************************************************************************
/*****************************************************************************
* mtime.c: high rezolution time management functions
* (c)1998 VideoLAN
******************************************************************************
*****************************************************************************
* Functions are prototyped in mtime.h.
******************************************************************************
*****************************************************************************
* to-do list:
* see if using Linux real-time extensions is possible and profitable
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Preamble
******************************************************************************/
*****************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
......@@ -18,13 +18,13 @@
#include "common.h"
#include "mtime.h"
/******************************************************************************
/*****************************************************************************
* mstrtime: return a date in a readable format
******************************************************************************
*****************************************************************************
* This functions is provided for any interface function which need to print a
* date. psz_buffer should be a buffer long enough to store the formatted
* date.
******************************************************************************/
*****************************************************************************/
char *mstrtime( char *psz_buffer, mtime_t date )
{
sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d",
......@@ -36,12 +36,12 @@ char *mstrtime( char *psz_buffer, mtime_t date )
return( psz_buffer );
}
/******************************************************************************
/*****************************************************************************
* mdate: return high precision date (inline function)
******************************************************************************
*****************************************************************************
* Uses the gettimeofday() function when possible (1 MHz resolution) or the
* ftime() function (1 kHz resolution).
******************************************************************************/
*****************************************************************************/
mtime_t mdate( void )
{
struct timeval tv_date;
......@@ -53,13 +53,13 @@ mtime_t mdate( void )
return( (mtime_t) tv_date.tv_sec * 1000000 + (mtime_t) tv_date.tv_usec );
}
/******************************************************************************
/*****************************************************************************
* mwait: wait for a date (inline function)
******************************************************************************
*****************************************************************************
* This function uses select() and an system date function to wake up at a
* precise date. It should be used for process synchronization. If current date
* is posterior to wished date, the function returns immediately.
******************************************************************************/
*****************************************************************************/
void mwait( mtime_t date )
{
struct timeval tv_date, tv_delay;
......@@ -85,11 +85,11 @@ void mwait( mtime_t date )
#endif
}
/******************************************************************************
/*****************************************************************************
* msleep: more precise sleep() (inline function) (ok ?)
******************************************************************************
*****************************************************************************
* Portable usleep() function.
******************************************************************************/
*****************************************************************************/
void msleep( mtime_t delay )
{
#ifndef usleep
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* video_yuv.c: YUV transformation functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <math.h>
#include <errno.h>
#include <string.h>
......@@ -24,9 +24,9 @@
#include "video_yuv.h"
#include "intf_msg.h"
/*******************************************************************************
/*****************************************************************************
* Constants
*******************************************************************************/
*****************************************************************************/
/* Color masks for different color depths - 8bpp masks can be choosen, since
* colormaps instead of hardware-defined colors are used. */
......
/*******************************************************************************
/*****************************************************************************
* video_yuv_mmx.S: YUV transformation, optimized for MMX processors
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Following functions are defined:
* vout_YUV420_16_MMX
* This function performs YUV12-to-RGB16 color conversion for H26x.
......@@ -19,7 +19,7 @@
* Height may be any amount, but must be a multiple of two. The U
* and V planes may have a different pitch than the Y plane, subject
* to the same limitations.
*******************************************************************************/
*****************************************************************************/
//.include iammx.inc
//.include locals.inc
......
/*******************************************************************************
/*****************************************************************************
* video_fifo.c : video FIFO management
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
......
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