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 * audio_decoder.h : audio decoder thread interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
****************************************************************************** *****************************************************************************
* = Prototyped functions are implemented in audio_decoder/audio_decoder.c * = Prototyped functions are implemented in audio_decoder/audio_decoder.c
* *
* = Required headers : * = Required headers :
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* = - MSb = Most Significant bit * = - MSb = Most Significant bit
* - MSB = Most Significant Byte * - MSB = Most Significant Byte
******************************************************************************/ *****************************************************************************/
/* /*
* TODO : * TODO :
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
#define ADEC_FRAME_SIZE 384 #define ADEC_FRAME_SIZE 384
/****************************************************************************** /*****************************************************************************
* adec_frame_t * adec_frame_t
******************************************************************************/ *****************************************************************************/
typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ]; typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
/****************************************************************************** /*****************************************************************************
* adec_bank_t * adec_bank_t
******************************************************************************/ *****************************************************************************/
typedef struct adec_bank_s typedef struct adec_bank_s
{ {
float v1[512]; float v1[512];
...@@ -45,11 +45,11 @@ typedef struct adec_bank_s ...@@ -45,11 +45,11 @@ typedef struct adec_bank_s
} adec_bank_t; } adec_bank_t;
/****************************************************************************** /*****************************************************************************
* adec_thread_t : audio decoder thread descriptor * adec_thread_t : audio decoder thread descriptor
****************************************************************************** *****************************************************************************
* This type describes an audio decoder thread * This type describes an audio decoder thread
******************************************************************************/ *****************************************************************************/
typedef struct adec_thread_s typedef struct adec_thread_s
{ {
/* /*
...@@ -80,8 +80,8 @@ typedef struct adec_thread_s ...@@ -80,8 +80,8 @@ typedef struct adec_thread_s
} adec_thread_t; } adec_thread_t;
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ ); adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
void adec_DestroyThread ( adec_thread_t * p_adec ); void adec_DestroyThread ( adec_thread_t * p_adec );
/****************************************************************************** /*****************************************************************************
* audio_dsp.h : header of the dsp functions library * audio_dsp.h : header of the dsp functions library
* (c)1999 VideoLAN * (c)1999 VideoLAN
****************************************************************************** *****************************************************************************
* Required headers: * Required headers:
* - "common.h" ( byte_t ) * - "common.h" ( byte_t )
* - "audio_output.h" ( aout_dsp_t ) * - "audio_output.h" ( aout_dsp_t )
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int aout_dspOpen ( aout_dsp_t *p_dsp ); int aout_dspOpen ( aout_dsp_t *p_dsp );
int aout_dspReset ( aout_dsp_t *p_dsp ); int aout_dspReset ( aout_dsp_t *p_dsp );
int aout_dspSetFormat ( aout_dsp_t *p_dsp ); int aout_dspSetFormat ( aout_dsp_t *p_dsp );
......
/****************************************************************************** /*****************************************************************************
* audio_math.h : PCM and DCT * audio_math.h : PCM and DCT
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
void DCT32(float *x, adec_bank_t *b); void DCT32(float *x, adec_bank_t *b);
void PCM(adec_bank_t *b, s16 **pcm, int jump); void PCM(adec_bank_t *b, s16 **pcm, int jump);
/****************************************************************************** /*****************************************************************************
* audio_output.h : audio output thread interface * audio_output.h : audio output thread interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
****************************************************************************** *****************************************************************************
* Required headers: * Required headers:
* - <sys/soundcard.h> ( audio_buf_info ) * - <sys/soundcard.h> ( audio_buf_info )
* - "common.h" ( boolean_t ) * - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t ) * - "mtime.h" ( mtime_t )
* - "vlc_thread.h" ( vlc_thread_t ) * - "vlc_thread.h" ( vlc_thread_t )
******************************************************************************/ *****************************************************************************/
/* TODO : /* TODO :
* *
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).i_start_frame ) #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 ) #define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/****************************************************************************** /*****************************************************************************
* aout_dsp_t * aout_dsp_t
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Path to the audio output device (default is set to "/dev/dsp") */ /* Path to the audio output device (default is set to "/dev/dsp") */
...@@ -81,13 +81,13 @@ typedef struct ...@@ -81,13 +81,13 @@ typedef struct
} aout_dsp_t; } aout_dsp_t;
/****************************************************************************** /*****************************************************************************
* aout_increment_t * aout_increment_t
****************************************************************************** *****************************************************************************
* This structure is used to keep the progression of an index up-to-date, in * 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 * order to avoid rounding problems and heavy computations, as the function
* that handles this structure only uses additions. * that handles this structure only uses additions.
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* The remainder is used to keep track of the fractional part of the /* The remainder is used to keep track of the fractional part of the
...@@ -109,9 +109,9 @@ typedef struct ...@@ -109,9 +109,9 @@ typedef struct
} aout_increment_t; } aout_increment_t;
/****************************************************************************** /*****************************************************************************
* aout_fifo_t * aout_fifo_t
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* See the fifo types below */ /* See the fifo types below */
...@@ -155,9 +155,9 @@ typedef struct ...@@ -155,9 +155,9 @@ typedef struct
#define AOUT_ADEC_MONO_FIFO 3 #define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4 #define AOUT_ADEC_STEREO_FIFO 4
/****************************************************************************** /*****************************************************************************
* aout_thread_t * aout_thread_t
******************************************************************************/ *****************************************************************************/
typedef struct aout_thread_s typedef struct aout_thread_s
{ {
vlc_thread_t thread_id; vlc_thread_t thread_id;
...@@ -184,9 +184,9 @@ typedef struct aout_thread_s ...@@ -184,9 +184,9 @@ typedef struct aout_thread_s
} aout_thread_t; } aout_thread_t;
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status ); aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout, int *pi_status ); void aout_DestroyThread ( aout_thread_t *p_aout, int *pi_status );
......
/******************************************************************************* /*****************************************************************************
* common.h: common definitions * common.h: common definitions
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* Collection of usefull common types and macros definitions * Collection of usefull common types and macros definitions
******************************************************************************* *****************************************************************************
* required headers: * required headers:
* config.h * config.h
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Basic types definitions * Basic types definitions
*******************************************************************************/ *****************************************************************************/
/* Basic types definitions */ /* Basic types definitions */
typedef signed char s8; typedef signed char s8;
...@@ -30,9 +30,9 @@ typedef int boolean_t; ...@@ -30,9 +30,9 @@ typedef int boolean_t;
/* Counter for statistics and profiling */ /* Counter for statistics and profiling */
typedef unsigned long count_t; typedef unsigned long count_t;
/******************************************************************************* /*****************************************************************************
* Classes declaration * Classes declaration
*******************************************************************************/ *****************************************************************************/
/* Interface */ /* Interface */
struct intf_thread_s; struct intf_thread_s;
...@@ -76,9 +76,9 @@ typedef struct vdec_thread_s * p_vdec_thread_t; ...@@ -76,9 +76,9 @@ typedef struct vdec_thread_s * p_vdec_thread_t;
typedef struct vpar_thread_s * p_vpar_thread_t; typedef struct vpar_thread_s * p_vpar_thread_t;
typedef struct video_parser_s * p_video_parser_t; typedef struct video_parser_s * p_video_parser_t;
/******************************************************************************* /*****************************************************************************
* Macros and inline functions * Macros and inline functions
*******************************************************************************/ *****************************************************************************/
/* CEIL: division with round to nearest greater integer */ /* CEIL: division with round to nearest greater integer */
#define CEIL(n, d) ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) ) #define CEIL(n, d) ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
......
/******************************************************************************* /*****************************************************************************
* config.h: limits and configuration * config.h: limits and configuration
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Defines all compilation-time configuration constants and size limits * Defines all compilation-time configuration constants and size limits
*******************************************************************************/ *****************************************************************************/
/* Conventions regarding names of symbols and variables /* Conventions regarding names of symbols and variables
* ---------------------------------------------------- * ----------------------------------------------------
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
* *
*/ */
/******************************************************************************* /*****************************************************************************
* Program information * Program information
*******************************************************************************/ *****************************************************************************/
/* Program version and copyright message */ /* Program version and copyright message */
#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN" #define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
"version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \ "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
"compilation options: " PROGRAM_OPTIONS "compilation options: " PROGRAM_OPTIONS
/******************************************************************************* /*****************************************************************************
* General compilation options * General compilation options
*******************************************************************************/ *****************************************************************************/
/* Define for DVB support - Note that some extensions or restrictions may be /* Define for DVB support - Note that some extensions or restrictions may be
* incompatible with native MPEG2 streams */ * incompatible with native MPEG2 streams */
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
/* Define for unthreaded version of the program - ?? not yet implemented */ /* Define for unthreaded version of the program - ?? not yet implemented */
//#define NO_THREAD //#define NO_THREAD
/******************************************************************************* /*****************************************************************************
* Debugging options - define or undefine symbols * Debugging options - define or undefine symbols
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
/* General debugging support, which depends of the DEBUG define, is determined /* General debugging support, which depends of the DEBUG define, is determined
* in the Makefile */ * in the Makefile */
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
#endif #endif
/******************************************************************************* /*****************************************************************************
* General configuration * General configuration
*******************************************************************************/ *****************************************************************************/
/* Automagically spawn input, audio and video threads ? */ /* Automagically spawn input, audio and video threads ? */
// ?? used ? // ?? used ?
...@@ -92,9 +92,9 @@ ...@@ -92,9 +92,9 @@
#define FIFO_SIZE 1023 #define FIFO_SIZE 1023
/******************************************************************************* /*****************************************************************************
* Interface configuration * Interface configuration
*******************************************************************************/ *****************************************************************************/
/* Environment variable used to store startup script name and default value */ /* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR "vlc_init" #define INTF_INIT_SCRIPT_VAR "vlc_init"
...@@ -118,9 +118,9 @@ ...@@ -118,9 +118,9 @@
/* Title of the X11 window */ /* Title of the X11 window */
#define VOUT_TITLE "VideoLAN Client" #define VOUT_TITLE "VideoLAN Client"
/******************************************************************************* /*****************************************************************************
* Input thread configuration * Input thread configuration
*******************************************************************************/ *****************************************************************************/
/* ?? */ /* ?? */
#define INPUT_IDLE_SLEEP 100000 #define INPUT_IDLE_SLEEP 100000
...@@ -202,9 +202,9 @@ ...@@ -202,9 +202,9 @@
* mark it to be presented */ * mark it to be presented */
#define INPUT_PTS_DELAY 2000000 #define INPUT_PTS_DELAY 2000000
/******************************************************************************* /*****************************************************************************
* Audio configuration * Audio configuration
*******************************************************************************/ *****************************************************************************/
/* Environment variable used to store dsp device name, and default value */ /* Environment variable used to store dsp device name, and default value */
#define AOUT_DSP_VAR "vlc_dsp" #define AOUT_DSP_VAR "vlc_dsp"
...@@ -218,9 +218,9 @@ ...@@ -218,9 +218,9 @@
#define AOUT_RATE_VAR "vlc_audio_rate" #define AOUT_RATE_VAR "vlc_audio_rate"
#define AOUT_RATE_DEFAULT 44100 #define AOUT_RATE_DEFAULT 44100
/******************************************************************************* /*****************************************************************************
* Video configuration * Video configuration
*******************************************************************************/ *****************************************************************************/
/* /*
* Default settings for video output threads * Default settings for video output threads
...@@ -291,9 +291,9 @@ ...@@ -291,9 +291,9 @@
#define VOUT_FB_DEV_VAR "vlc_fb_dev" #define VOUT_FB_DEV_VAR "vlc_fb_dev"
#define VOUT_FB_DEV_DEFAULT "/dev/fb0" #define VOUT_FB_DEV_DEFAULT "/dev/fb0"
/******************************************************************************* /*****************************************************************************
* Video parser configuration * Video parser configuration
*******************************************************************************/ *****************************************************************************/
#define VPAR_IDLE_SLEEP 100000 #define VPAR_IDLE_SLEEP 100000
...@@ -317,9 +317,9 @@ ...@@ -317,9 +317,9 @@
/* Maximum number of macroblocks in a picture. */ /* Maximum number of macroblocks in a picture. */
#define MAX_MB 2048 #define MAX_MB 2048
/******************************************************************************* /*****************************************************************************
* Video decoder configuration * Video decoder configuration
*******************************************************************************/ *****************************************************************************/
//#define VDEC_SMP //#define VDEC_SMP
...@@ -333,15 +333,15 @@ ...@@ -333,15 +333,15 @@
/* Maximum range of values out of the IDCT + motion compensation. */ /* Maximum range of values out of the IDCT + motion compensation. */
#define VDEC_CROPRANGE 2048 #define VDEC_CROPRANGE 2048
/******************************************************************************* /*****************************************************************************
* Generic decoder configuration * Generic decoder configuration
*******************************************************************************/ *****************************************************************************/
#define GDEC_IDLE_SLEEP 100000 #define GDEC_IDLE_SLEEP 100000
/******************************************************************************* /*****************************************************************************
* Messages and console interfaces configuration * Messages and console interfaces configuration
*******************************************************************************/ *****************************************************************************/
/* Maximal size of the message queue - in case of overflow, all messages in the /* Maximal size of the message queue - in case of overflow, all messages in the
* queue are printed by the calling thread */ * queue are printed by the calling thread */
......
/******************************************************************************* /*****************************************************************************
* control.h: user control functions * control.h: user control functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Library of functions common to all interfaces, allowing access to various * Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions * structures and settings. Interfaces should only use those functions
* to read or write informations from other threads. * to read or write informations from other threads.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* <sys/uio.h> * <sys/uio.h>
* <X11/Xlib.h> * <X11/Xlib.h>
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
* "video_output.h" * "video_output.h"
* "xconsole.h" * "xconsole.h"
* "interface.h" * "interface.h"
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int intf_SelectAudioStream ( intf_thread_t *p_intf, int i_input, int i_id ); 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 ); 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, int intf_SelectVideoStream ( intf_thread_t *p_intf, int i_input,
......
/******************************************************************************* /*****************************************************************************
* debug.h: vlc debug macros * debug.h: vlc debug macros
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Stand alone file * Stand alone file
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* - <string.h> * - <string.h>
* - intf_msg.h * - intf_msg.h
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* ASSERT * ASSERT
******************************************************************************* *****************************************************************************
* This macro is used to test that a pointer is not nul. It insert the needed * 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 * code when the program is compiled with the debug option, but does nothing
* in release program. * in release program.
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
#define ASSERT(p_Mem) \ #define ASSERT(p_Mem) \
if (!(p_Mem)) \ if (!(p_Mem)) \
...@@ -29,13 +29,13 @@ if (!(p_Mem)) \ ...@@ -29,13 +29,13 @@ if (!(p_Mem)) \
#endif #endif
/******************************************************************************* /*****************************************************************************
* RZERO * RZERO
******************************************************************************* *****************************************************************************
* This macro is used to initialise a variable to 0. It is very useful when * 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 * used with the ASSERT macro. It also only insert the needed code when the
* program is compiled with the debug option. * program is compiled with the debug option.
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
#define RZERO(r_Var) \ #define RZERO(r_Var) \
bzero(&(r_Var), sizeof((r_Var))); bzero(&(r_Var), sizeof((r_Var)));
...@@ -46,12 +46,12 @@ bzero(&(r_Var), sizeof((r_Var))); ...@@ -46,12 +46,12 @@ bzero(&(r_Var), sizeof((r_Var)));
#endif #endif
/******************************************************************************* /*****************************************************************************
* PZERO * PZERO
******************************************************************************* *****************************************************************************
* This macro is used to initiase the memory pointed out by a pointer to 0. * 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. * It has the same purpose than RZERO, but for pointers.
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
#define PZERO(p_Mem) \ #define PZERO(p_Mem) \
bzero((p_Mem), sizeof(*(p_Mem))); bzero((p_Mem), sizeof(*(p_Mem)));
...@@ -62,12 +62,12 @@ bzero((p_Mem), sizeof(*(p_Mem))); ...@@ -62,12 +62,12 @@ bzero((p_Mem), sizeof(*(p_Mem)));
#endif #endif
/******************************************************************************* /*****************************************************************************
* AZERO * AZERO
******************************************************************************* *****************************************************************************
* This macro is used to initiase an array of variables to 0. * This macro is used to initiase an array of variables to 0.
* It has the same purpose than RZERO or PZERO, but for array * It has the same purpose than RZERO or PZERO, but for array
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
#define AZERO(p_Array, i_Size) \ #define AZERO(p_Array, i_Size) \
bzero((p_Array), (i_Size)*sizeof(*(p_Array))); bzero((p_Array), (i_Size)*sizeof(*(p_Array)));
......
This diff is collapsed.
/******************************************************************************* /*****************************************************************************
* generic_decoder.h : generic decoder thread * generic_decoder.h : generic decoder thread
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Requires: * Requires:
* "config.h" * "config.h"
* "common.h" * "common.h"
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
* "input.h" * "input.h"
* "decoder_fifo.h" * "decoder_fifo.h"
* ?? * ??
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* gdec_cfg_t: generic decoder configuration structure * gdec_cfg_t: generic decoder configuration structure
******************************************************************************* *****************************************************************************
* This structure is passed as an initializer when a generic decoder thread is * This structure is passed as an initializer when a generic decoder thread is
* created. * created.
*******************************************************************************/ *****************************************************************************/
typedef struct gdec_cfg_s typedef struct gdec_cfg_s
{ {
u64 i_properties; u64 i_properties;
...@@ -30,11 +30,11 @@ typedef struct gdec_cfg_s ...@@ -30,11 +30,11 @@ typedef struct gdec_cfg_s
#define GDEC_CFG_ACTIONS (1 << 0) #define GDEC_CFG_ACTIONS (1 << 0)
#define GDEC_CFG_FILENAME (1 << 1) #define GDEC_CFG_FILENAME (1 << 1)
/******************************************************************************* /*****************************************************************************
* gdec_thread_t: generic decoder thread descriptor * gdec_thread_t: generic decoder thread descriptor
******************************************************************************* *****************************************************************************
* This type describes a generic decoder thread. * This type describes a generic decoder thread.
*******************************************************************************/ *****************************************************************************/
typedef struct gdec_thread_s typedef struct gdec_thread_s
{ {
/* Thread properties and locks */ /* Thread properties and locks */
...@@ -73,9 +73,9 @@ typedef struct gdec_thread_s ...@@ -73,9 +73,9 @@ typedef struct gdec_thread_s
#define GDEC_SAVE_DEMUX (1 << 2) /* save PES to files by stream id */ #define GDEC_SAVE_DEMUX (1 << 2) /* save PES to files by stream id */
#define GDEC_PRINT (1 << 3) /* print PES informations */ #define GDEC_PRINT (1 << 3) /* print PES informations */
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
/* Thread management functions */ /* Thread management functions */
gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg, gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg,
......
/****************************************************************************** /*****************************************************************************
* input.h: input thread interface * input.h: input thread interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Constants related to input * Constants related to input
******************************************************************************/ *****************************************************************************/
#define TS_PACKET_SIZE 188 /* size of a TS packet */ #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 PES_HEADER_SIZE 14 /* size of the first part of a PES header */
#define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */ #define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */
/****************************************************************************** /*****************************************************************************
* ts_packet_t * ts_packet_t
****************************************************************************** *****************************************************************************
* Describe a TS packet. * Describe a TS packet.
******************************************************************************/ *****************************************************************************/
typedef struct ts_packet_s typedef struct ts_packet_s
{ {
/* Nothing before this line, the code relies on that */ /* Nothing before this line, the code relies on that */
...@@ -30,12 +30,12 @@ typedef struct ts_packet_s ...@@ -30,12 +30,12 @@ typedef struct ts_packet_s
struct ts_packet_s * p_next_ts; struct ts_packet_s * p_next_ts;
} ts_packet_t; } ts_packet_t;
/****************************************************************************** /*****************************************************************************
* pes_packet_t * pes_packet_t
****************************************************************************** *****************************************************************************
* Describes an PES packet, with its properties, and pointers to the TS packets * Describes an PES packet, with its properties, and pointers to the TS packets
* containing it. * containing it.
******************************************************************************/ *****************************************************************************/
typedef struct pes_packet_s typedef struct pes_packet_s
{ {
/* PES properties */ /* PES properties */
...@@ -51,7 +51,7 @@ typedef struct pes_packet_s ...@@ -51,7 +51,7 @@ typedef struct pes_packet_s
*/ */
u8 i_stream_id; /* payload type and id */ u8 i_stream_id; /* payload type and id */
int i_pes_size; /* size of the current PES packet */ 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 */ /* Demultiplexer environment */
boolean_t b_discard_payload; /* is the packet messed up ? */ boolean_t b_discard_payload; /* is the packet messed up ? */
...@@ -66,12 +66,12 @@ typedef struct pes_packet_s ...@@ -66,12 +66,12 @@ typedef struct pes_packet_s
* (used by the demultiplexer). */ * (used by the demultiplexer). */
} pes_packet_t; } pes_packet_t;
/****************************************************************************** /*****************************************************************************
* psi_section_t * psi_section_t
****************************************************************************** *****************************************************************************
* Describes a PSI section. Beware, it doesn't contain pointers to the TS * 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 * packets that contain it as for a PES, but the data themselves
******************************************************************************/ *****************************************************************************/
typedef struct psi_section_s typedef struct psi_section_s
{ {
byte_t buffer[PSI_SECTION_SIZE]; byte_t buffer[PSI_SECTION_SIZE];
...@@ -83,12 +83,12 @@ typedef struct psi_section_s ...@@ -83,12 +83,12 @@ typedef struct psi_section_s
} psi_section_t; } psi_section_t;
/****************************************************************************** /*****************************************************************************
* es_descriptor_t: elementary stream descriptor * es_descriptor_t: elementary stream descriptor
****************************************************************************** *****************************************************************************
* Describes an elementary stream, and includes fields required to handle and * Describes an elementary stream, and includes fields required to handle and
* demultiplex this elementary stream. * demultiplex this elementary stream.
******************************************************************************/ *****************************************************************************/
typedef struct es_descriptor_t typedef struct es_descriptor_t
{ {
u16 i_id; /* stream ID, PID for TS streams */ u16 i_id; /* stream ID, PID for TS streams */
...@@ -150,12 +150,12 @@ typedef struct es_descriptor_t ...@@ -150,12 +150,12 @@ typedef struct es_descriptor_t
#define AC3_AUDIO_ES 0x81 #define AC3_AUDIO_ES 0x81
#define DVD_SPU_ES 0x82 /* 0x82 might violate the norm */ #define DVD_SPU_ES 0x82 /* 0x82 might violate the norm */
/****************************************************************************** /*****************************************************************************
* program_descriptor_t * program_descriptor_t
****************************************************************************** *****************************************************************************
* Describes a program and list associated elementary streams. It is build by * Describes a program and list associated elementary streams. It is build by
* the PSI decoder upon the informations carried in program map sections * the PSI decoder upon the informations carried in program map sections
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Program characteristics */ /* Program characteristics */
...@@ -183,11 +183,11 @@ typedef struct ...@@ -183,11 +183,11 @@ typedef struct
#endif #endif
} pgrm_descriptor_t; } pgrm_descriptor_t;
/****************************************************************************** /*****************************************************************************
* pcr_descriptor_t * pcr_descriptor_t
****************************************************************************** *****************************************************************************
* Contains informations used to synchronise the decoder with the server * Contains informations used to synchronise the decoder with the server
******************************************************************************/ *****************************************************************************/
typedef struct pcr_descriptor_struct typedef struct pcr_descriptor_struct
{ {
...@@ -202,12 +202,12 @@ typedef struct pcr_descriptor_struct ...@@ -202,12 +202,12 @@ typedef struct pcr_descriptor_struct
/* counter used to compute dynamic average values */ /* counter used to compute dynamic average values */
} pcr_descriptor_t; } pcr_descriptor_t;
/****************************************************************************** /*****************************************************************************
* stream_descriptor_t * stream_descriptor_t
****************************************************************************** *****************************************************************************
* Describes a transport stream and list its associated programs. Build upon * Describes a transport stream and list its associated programs. Build upon
* the informations carried in program association sections * the informations carried in program association sections
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
u16 i_stream_id; /* stream id */ u16 i_stream_id; /* stream id */
...@@ -245,9 +245,9 @@ typedef struct ...@@ -245,9 +245,9 @@ typedef struct
#endif #endif
} stream_descriptor_t; } stream_descriptor_t;
/****************************************************************************** /*****************************************************************************
* input_netlist_t * input_netlist_t
******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
vlc_mutex_t lock; /* netlist modification lock */ vlc_mutex_t lock; /* netlist modification lock */
...@@ -279,14 +279,14 @@ typedef struct ...@@ -279,14 +279,14 @@ typedef struct
/****************************************************************************** /*****************************************************************************
* input_thread_t * input_thread_t
****************************************************************************** *****************************************************************************
* This structure includes all the local static variables of an input thread, * This structure includes all the local static variables of an input thread,
* including the netlist and the ES descriptors * including the netlist and the ES descriptors
* Note that p_es must be defined as a static table, otherwise we would have to * 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 * update all reference to it each time the table would be reallocated
******************************************************************************/ *****************************************************************************/
/* Function pointers used in structure */ /* Function pointers used in structure */
typedef int (input_open_t) ( p_input_thread_t p_input ); typedef int (input_open_t) ( p_input_thread_t p_input );
...@@ -317,7 +317,7 @@ typedef struct input_thread_s ...@@ -317,7 +317,7 @@ typedef struct input_thread_s
/* General stream description */ /* General stream description */
stream_descriptor_t * p_stream; /* PAT tables */ 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 */ pcr_descriptor_t * p_pcr; /* PCR struct used for synchronisation */
/* List of streams to demux */ /* List of streams to demux */
......
/******************************************************************************* /*****************************************************************************
* input_ctrl.h: Decodeur control * input_ctrl.h: Decodeur control
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Requires: * Requires:
* "config.h" * "config.h"
* "common.h" * "common.h"
* "mtime.h" * "mtime.h"
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_pid ); int input_AddPgrmElem( input_thread_t *p_input, int i_current_pid );
int input_DelPgrmElem( 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 ); boolean_t input_IsElemRecv( input_thread_t *p_input, int i_pid );
/******************************************************************************* /*****************************************************************************
* input_file.h: file streams functions interface * input_file.h: file streams functions interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_FileOpen ( input_thread_t *p_input ); int input_FileOpen ( input_thread_t *p_input );
int input_FileRead ( input_thread_t *p_input, const struct iovec *p_vector, int input_FileRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count ); size_t i_count );
......
/******************************************************************************* /*****************************************************************************
* input_netlist.h: netlist interface * input_netlist.h: netlist interface
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* The netlists are an essential part of the input structure. We maintain a * 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 * list of free TS packets and free PES packets to avoid continuous malloc
* and free. * and free.
*******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_NetlistInit ( input_thread_t *p_input ); int input_NetlistInit ( input_thread_t *p_input );
void input_NetlistEnd ( 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 ...@@ -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__ 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 ); static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input );
/****************************************************************************** /*****************************************************************************
* input_NetlistFreePES: add a PES packet to the netlist * input_NetlistFreePES: add a PES packet to the netlist
******************************************************************************* *****************************************************************************
* Add a PES packet to the PES netlist, so that the packet can immediately be * 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, * reused by the demultiplexer. We put this function directly in the .h file,
* because it is very frequently called. * because it is very frequently called.
*******************************************************************************/ *****************************************************************************/
static __inline__ void input_NetlistFreePES( input_thread_t *p_input, static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
pes_packet_t *p_pes_packet ) pes_packet_t *p_pes_packet )
{ {
...@@ -67,13 +67,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input, ...@@ -67,13 +67,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock ); vlc_mutex_unlock( &p_input->netlist.lock );
} }
/******************************************************************************* /*****************************************************************************
* input_NetlistFreeTS: add a TS packet to the netlist * input_NetlistFreeTS: add a TS packet to the netlist
******************************************************************************* *****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be * 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 * reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES. * should only use input_FreePES.
*******************************************************************************/ *****************************************************************************/
static __inline__ void input_NetlistFreeTS( input_thread_t *p_input, static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
ts_packet_t *p_ts_packet ) ts_packet_t *p_ts_packet )
{ {
...@@ -95,13 +95,13 @@ static __inline__ void input_NetlistFreeTS( input_thread_t *p_input, ...@@ -95,13 +95,13 @@ static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock ); vlc_mutex_unlock( &p_input->netlist.lock );
} }
/******************************************************************************* /*****************************************************************************
* input_NetlistGetPES: remove a PES packet from the netlist * input_NetlistGetPES: remove a PES packet from the netlist
******************************************************************************* *****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be * 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 * reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES. * should only use input_FreePES.
*******************************************************************************/ *****************************************************************************/
static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input ) static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input )
{ {
pes_packet_t * p_pes_packet; pes_packet_t * p_pes_packet;
......
/******************************************************************************* /*****************************************************************************
* input_network.h: network functions interface * input_network.h: network functions interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_NetworkOpen ( input_thread_t *p_input ); int input_NetworkOpen ( input_thread_t *p_input );
int input_NetworkRead ( input_thread_t *p_input, const struct iovec *p_vector, int input_NetworkRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count ); size_t i_count );
......
/******************************************************************************* /*****************************************************************************
* input_pcr.h: PCR management interface * input_pcr.h: PCR management interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/* Maximum number of samples used to compute the dynamic average value, /* Maximum number of samples used to compute the dynamic average value,
* it is also the maximum of c_average in the pcr_descriptor_struct. * it is also the maximum of c_average in the pcr_descriptor_struct.
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#define SYNCHRO_START 2 #define SYNCHRO_START 2
#define SYNCHRO_REINIT 3 #define SYNCHRO_REINIT 3
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_PcrInit ( input_thread_t *p_input ); int input_PcrInit ( input_thread_t *p_input );
void input_PcrDecode ( input_thread_t *p_input, es_descriptor_t* p_es, void input_PcrDecode ( input_thread_t *p_input, es_descriptor_t* p_es,
u8* p_pcr_data ); u8* p_pcr_data );
......
/******************************************************************************* /*****************************************************************************
* psi.h: PSI management interface * psi.h: PSI management interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
int input_PsiInit ( input_thread_t *p_input ); int input_PsiInit ( input_thread_t *p_input );
void input_PsiDecode ( input_thread_t *p_input, psi_section_t* p_psi_section ); void input_PsiDecode ( input_thread_t *p_input, psi_section_t* p_psi_section );
void input_PsiRead ( input_thread_t *p_input ); void input_PsiRead ( input_thread_t *p_input );
......
/******************************************************************************* /*****************************************************************************
* input_vlan.h: vlan input method * input_vlan.h: vlan input method
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* ?? * ??
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* <netinet/in.h> * <netinet/in.h>
* "vlc_thread.h" * "vlc_thread.h"
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int input_VlanCreate ( void ); int input_VlanCreate ( void );
void input_VlanDestroy ( void ); void input_VlanDestroy ( void );
int input_VlanJoin ( int i_vlan_id ); int input_VlanJoin ( int i_vlan_id );
......
/****************************************************************************** /*****************************************************************************
* interface.h: interface access for other threads * interface.h: interface access for other threads
* (c)1999 VideoLAN * (c)1999 VideoLAN
****************************************************************************** *****************************************************************************
* This library provides basic functions for threads to interact with user * This library provides basic functions for threads to interact with user
* interface, such as message output. * interface, such as message output.
****************************************************************************** *****************************************************************************
* Required headers: * Required headers:
* <sys/uio.h> * <sys/uio.h>
* <X11/Xlib.h> * <X11/Xlib.h>
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
* "video_output.h" * "video_output.h"
* "audio_output.h" * "audio_output.h"
* "xconsole.h" * "xconsole.h"
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* intf_thread_t: describe an interface thread * intf_thread_t: describe an interface thread
****************************************************************************** *****************************************************************************
* This structe describes all interface-specific data of the main (interface) * This structe describes all interface-specific data of the main (interface)
* thread. * thread.
******************************************************************************/ *****************************************************************************/
typedef struct intf_thread_s typedef struct intf_thread_s
{ {
boolean_t b_die; /* `die' flag */ boolean_t b_die; /* `die' flag */
...@@ -42,9 +42,9 @@ typedef struct intf_thread_s ...@@ -42,9 +42,9 @@ typedef struct intf_thread_s
p_input_thread_t p_input; p_input_thread_t p_input;
} intf_thread_t; } intf_thread_t;
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
intf_thread_t * intf_Create ( void ); intf_thread_t * intf_Create ( void );
void intf_Run ( intf_thread_t * p_intf ); void intf_Run ( intf_thread_t * p_intf );
void intf_Destroy ( intf_thread_t * p_intf ); void intf_Destroy ( intf_thread_t * p_intf );
......
/******************************************************************************* /*****************************************************************************
* intf_cmd.h: interface commands parsing and executions functions * intf_cmd.h: interface commands parsing and executions functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This file implements the interface commands execution functions. It is used * This file implements the interface commands execution functions. It is used
* by command-line oriented interfaces and scripts. The commands themselves are * by command-line oriented interfaces and scripts. The commands themselves are
* implemented in intf_ctrl. * implemented in intf_ctrl.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* none * none
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* intf_arg_t: control fonction argument descriptor * intf_arg_t: control fonction argument descriptor
******************************************************************************* *****************************************************************************
* This structure is used to control an argument type and to transmit * 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 * arguments to control functions. It is also used to parse format string and
* build an easier to use array of arguments. * build an easier to use array of arguments.
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Argument type */ /* Argument type */
...@@ -39,13 +39,13 @@ typedef struct ...@@ -39,13 +39,13 @@ typedef struct
#define INTF_REP_ARG 512 /* argument can be repeated */ #define INTF_REP_ARG 512 /* argument can be repeated */
#define INTF_PRESENT_ARG 1024 /* argument has been encountered */ #define INTF_PRESENT_ARG 1024 /* argument has been encountered */
/******************************************************************************* /*****************************************************************************
* intf_command_t: control command descriptor * intf_command_t: control command descriptor
******************************************************************************* *****************************************************************************
* This structure describes a control commands. It stores informations needed * This structure describes a control commands. It stores informations needed
* for argument type checking, command execution but also a short inline help. * for argument type checking, command execution but also a short inline help.
* See control.c for more informations about fields. * See control.c for more informations about fields.
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Function control */ /* Function control */
...@@ -59,23 +59,23 @@ typedef struct ...@@ -59,23 +59,23 @@ typedef struct
char * psz_help; /* help text */ char * psz_help; /* help text */
} intf_command_t; } intf_command_t;
/******************************************************************************* /*****************************************************************************
* Error constants * Error constants
******************************************************************************* *****************************************************************************
* These errors should be used as return values for control functions (see * These errors should be used as return values for control functions (see
* control.c). The intf_ExecCommand function as different behaviour depending * control.c). The intf_ExecCommand function as different behaviour depending
* of the error it received. Other errors numbers can be used, but their valued * of the error it received. Other errors numbers can be used, but their valued
* should be positive to avoid conflict with future error codes. * should be positive to avoid conflict with future error codes.
*******************************************************************************/ *****************************************************************************/
#define INTF_NO_ERROR 0 /* success */ #define INTF_NO_ERROR 0 /* success */
#define INTF_FATAL_ERROR -1 /* fatal error: the program will end */ #define INTF_FATAL_ERROR -1 /* fatal error: the program will end */
#define INTF_CRITICAL_ERROR -2 /* critical error: the program will exit */ #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_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 * Prototypes
*******************************************************************************/ *****************************************************************************/
int intf_ExecCommand ( char *psz_cmd ); int intf_ExecCommand ( char *psz_cmd );
int intf_ExecScript ( char *psz_filename ); int intf_ExecScript ( char *psz_filename );
/******************************************************************************* /*****************************************************************************
* intf_console.h: generic console methods for interface * intf_console.h: generic console methods for interface
* (c)1998 VideoLAN * (c)1998 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
p_intf_console_t intf_ConsoleCreate ( void ); p_intf_console_t intf_ConsoleCreate ( void );
void intf_ConsoleDestroy ( p_intf_console_t p_console ); void intf_ConsoleDestroy ( p_intf_console_t p_console );
......
/******************************************************************************* /*****************************************************************************
* intf_ctrl.h: interface commands access to control functions * intf_ctrl.h: interface commands access to control functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Library of functions common to all interfaces, allowing access to various * Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions * structures and settings. Interfaces should only use those functions
* to read or write informations from other threads. * to read or write informations from other threads.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* none * none
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Extern variables * Extern variables
*******************************************************************************/ *****************************************************************************/
extern const intf_command_t control_command[]; extern const intf_command_t control_command[];
/******************************************************************************* /*****************************************************************************
* intf_msg.h: messages interface * intf_msg.h: messages interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This library provides basic functions for threads to interact with user * This library provides basic functions for threads to interact with user
* interface, such as message output. See config.h for output configuration. * interface, such as message output. See config.h for output configuration.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* intf_DbgMsg macros and functions * intf_DbgMsg macros and functions
******************************************************************************* *****************************************************************************
* The intf_DbgMsg* functions are defined as macro to be able to use the * 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 * compiler extensions and print the file, the function and the line number
* from which they have been called. They call _intf_DbgMsg*() functions after * from which they have been called. They call _intf_DbgMsg*() functions after
* having added debugging informations. * having added debugging informations.
* Outside DEBUG mode, intf_DbgMsg* functions do nothing. * Outside DEBUG mode, intf_DbgMsg* functions do nothing.
*******************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef DEBUG
/* DEBUG mode */ /* DEBUG mode */
...@@ -36,13 +36,13 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line, ...@@ -36,13 +36,13 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
#endif #endif
/******************************************************************************* /*****************************************************************************
* intf_FlushMsg macro and function * intf_FlushMsg macro and function
******************************************************************************* *****************************************************************************
* intf_FlushMsg is a function which flushs message queue and print all messages * 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 * 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. * is really a function. In the other case, it is a macro doing nothing.
*******************************************************************************/ *****************************************************************************/
#ifdef INTF_MSG_QUEUE #ifdef INTF_MSG_QUEUE
/* Message queue mode */ /* Message queue mode */
...@@ -55,9 +55,9 @@ void intf_FlushMsg ( void ); ...@@ -55,9 +55,9 @@ void intf_FlushMsg ( void );
#endif #endif
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
p_intf_msg_t intf_MsgCreate ( void ); p_intf_msg_t intf_MsgCreate ( void );
void intf_MsgDestroy ( void ); void intf_MsgDestroy ( void );
......
/******************************************************************************* /*****************************************************************************
* intf_sys.h: system dependant interface API * intf_sys.h: system dependant interface API
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int intf_SysCreate ( p_intf_thread_t p_intf ); int intf_SysCreate ( p_intf_thread_t p_intf );
void intf_SysDestroy( p_intf_thread_t p_intf ); void intf_SysDestroy( p_intf_thread_t p_intf );
void intf_SysManage ( p_intf_thread_t p_intf ); void intf_SysManage ( p_intf_thread_t p_intf );
/******************************************************************************* /*****************************************************************************
* main.h: access to all program variables * main.h: access to all program variables
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Declaration and extern access to global program object. * Declaration and extern access to global program object.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* main_t, p_main (global variable) * main_t, p_main (global variable)
******************************************************************************* *****************************************************************************
* This structure has an unique instance, declared in main and pointed by the * 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 * 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 * of the program, for user-interface purposes or more easier call of interface
* and common functions (example: the intf_*Msg functions). Please avoid using * 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 * it when you can access the members you need in an other way. In fact, it
* should only be used by interface thread. * should only be used by interface thread.
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Global properties */ /* Global properties */
...@@ -39,10 +39,10 @@ typedef struct ...@@ -39,10 +39,10 @@ typedef struct
extern main_t *p_main; extern main_t *p_main;
/******************************************************************************* /*****************************************************************************
* Prototypes - these methods are used to get default values for some threads * Prototypes - these methods are used to get default values for some threads
* and modules. * and modules.
*******************************************************************************/ *****************************************************************************/
int main_GetIntVariable( char *psz_name, int i_default ); int main_GetIntVariable( char *psz_name, int i_default );
char * main_GetPszVariable( char *psz_name, char *psz_default ); char * main_GetPszVariable( char *psz_name, char *psz_default );
void main_PutIntVariable( char *psz_name, int i_value ); void main_PutIntVariable( char *psz_name, int i_value );
......
/******************************************************************************* /*****************************************************************************
* mtime.h: high rezolution time management functions * mtime.h: high rezolution time management functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This header provides portable high precision time management functions, * This header provides portable high precision time management functions,
* which should be the only ones used in other segments of the program, since * which should be the only ones used in other segments of the program, since
* functions like gettimeofday() and ftime() are not always supported. * functions like gettimeofday() and ftime() are not always supported.
...@@ -9,46 +9,46 @@ ...@@ -9,46 +9,46 @@
* interfaces to system calls and have to be called frequently. * interfaces to system calls and have to be called frequently.
* 'm' stands for 'micro', since maximum resolution is the microsecond. * 'm' stands for 'micro', since maximum resolution is the microsecond.
* Functions prototyped are implemented in interface/mtime.c. * Functions prototyped are implemented in interface/mtime.c.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* none * none
* this header includes inline functions * this header includes inline functions
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* mtime_t: high precision date or time interval * mtime_t: high precision date or time interval
******************************************************************************* *****************************************************************************
* Store an high precision date or time interval. The maximum precision is the * 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 * 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 * 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. * video). Date are stored as a time interval since a common date.
* Note that date and time intervals can be manipulated using regular arithmetic * Note that date and time intervals can be manipulated using regular arithmetic
* operators, and that no special functions are required. * operators, and that no special functions are required.
*******************************************************************************/ *****************************************************************************/
typedef s64 mtime_t; typedef s64 mtime_t;
/******************************************************************************* /*****************************************************************************
* LAST_MDATE: date which will never happen * LAST_MDATE: date which will never happen
******************************************************************************* *****************************************************************************
* This date can be used as a 'never' date, to mark missing events in a function * 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 * 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 * 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. * comparaison with other values: all existing dates will be earlier.
*******************************************************************************/ *****************************************************************************/
#define LAST_MDATE ((mtime_t)((u64)(-1)/2)) #define LAST_MDATE ((mtime_t)((u64)(-1)/2))
/******************************************************************************* /*****************************************************************************
* MSTRTIME_MAX_SIZE: maximum possible size of mstrtime * MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
******************************************************************************* *****************************************************************************
* This values is the maximal possible size of the string returned by the * 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 * mstrtime() function, including '-' and the final '\0'. It should be used to
* allocate the buffer. * allocate the buffer.
*******************************************************************************/ *****************************************************************************/
#define MSTRTIME_MAX_SIZE 22 #define MSTRTIME_MAX_SIZE 22
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
char * mstrtime ( char *psz_buffer, mtime_t date ); char * mstrtime ( char *psz_buffer, mtime_t date );
mtime_t mdate ( void ); mtime_t mdate ( void );
void mwait ( mtime_t date ); void mwait ( mtime_t date );
......
/******************************************************************************* /*****************************************************************************
* netutils.h: various network functions * netutils.h: various network functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This header describe miscellanous utility functions shared between several * This header describe miscellanous utility functions shared between several
* modules. * modules.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* <netinet/in.h> * <netinet/in.h>
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* if_descr_t: describes a network interface. * if_descr_t: describes a network interface.
******************************************************************************* *****************************************************************************
* Note that if the interface is a point to point one, the broadcast address is * Note that if the interface is a point to point one, the broadcast address is
* set to the destination address of that interface * set to the destination address of that interface
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Interface device name (e.g. "eth0") */ /* Interface device name (e.g. "eth0") */
...@@ -31,11 +31,11 @@ typedef struct ...@@ -31,11 +31,11 @@ typedef struct
} if_descr_t; } if_descr_t;
/******************************************************************************* /*****************************************************************************
* net_descr_t: describes all the interfaces of the computer * net_descr_t: describes all the interfaces of the computer
******************************************************************************* *****************************************************************************
* Nothing special to say :) * Nothing special to say :)
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Number of networks interfaces described below */ /* Number of networks interfaces described below */
...@@ -45,9 +45,9 @@ typedef struct ...@@ -45,9 +45,9 @@ typedef struct
} net_descr_t; } net_descr_t;
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int ReadIfConf (int i_sockfd, if_descr_t* p_ifdescr, char* psz_name); 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 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 ); int BuildInetAddr ( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port );
......
/******************************************************************************* /*****************************************************************************
* rsc_files.h: resources files manipulation functions * rsc_files.h: resources files manipulation functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This library describe a general format used to store 'resources'. Resources * This library describe a general format used to store 'resources'. Resources
* can be anything, including pictures, audio streams, and so on. * can be anything, including pictures, audio streams, and so on.
******************************************************************************* *****************************************************************************
* Requires: * Requires:
* config.h * config.h
* common.h * common.h
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Constants * Constants
*******************************************************************************/ *****************************************************************************/
/* Maximum length of a resource name (not including the final '\0') - this /* Maximum length of a resource name (not including the final '\0') - this
* constant should not be changed without extreme care */ * constant should not be changed without extreme care */
#define RESOURCE_MAX_NAME 32 #define RESOURCE_MAX_NAME 32
/******************************************************************************* /*****************************************************************************
* resource_descriptor_t: resource descriptor * resource_descriptor_t: resource descriptor
******************************************************************************* *****************************************************************************
* This type describe an entry in the resource table. * This type describe an entry in the resource table.
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
char psz_name[RESOURCE_MAX_NAME + 1]; /* name */ char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
...@@ -35,12 +35,12 @@ typedef struct ...@@ -35,12 +35,12 @@ typedef struct
#define EMPTY_RESOURCE 0 /* empty place in table */ #define EMPTY_RESOURCE 0 /* empty place in table */
#define PICTURE_RESOURCE 10 /* native video picture */ #define PICTURE_RESOURCE 10 /* native video picture */
/******************************************************************************* /*****************************************************************************
* resource_file_t: resource file descriptor * resource_file_t: resource file descriptor
******************************************************************************* *****************************************************************************
* This type describes a resource file and store it's resources table. It can * 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. * be used through the *Resource functions, or directly with the i_file field.
*******************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* File informations */ /* File informations */
...@@ -57,9 +57,9 @@ typedef struct ...@@ -57,9 +57,9 @@ typedef struct
/* Resources files types */ /* Resources files types */
#define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */ #define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
resource_file_t * CreateResourceFile ( char *psz_filename, int i_type, int i_size, int i_mode ); 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 ); resource_file_t * OpenResourceFile ( char *psz_filename, int i_type, int i_flags );
int UpdateResourceFile ( resource_file_t *p_file ); int UpdateResourceFile ( resource_file_t *p_file );
......
/****************************************************************************** /*****************************************************************************
* spu_decoder.h : sub picture unit decoder thread interface * spu_decoder.h : sub picture unit decoder thread interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* spudec_thread_t : sub picture unit decoder thread descriptor * spudec_thread_t : sub picture unit decoder thread descriptor
******************************************************************************/ *****************************************************************************/
typedef struct spudec_thread_s typedef struct spudec_thread_s
{ {
/* /*
...@@ -32,9 +32,9 @@ typedef struct spudec_thread_s ...@@ -32,9 +32,9 @@ typedef struct spudec_thread_s
} spudec_thread_t; } spudec_thread_t;
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
spudec_thread_t * spudec_CreateThread( input_thread_t * p_input ); spudec_thread_t * spudec_CreateThread( input_thread_t * p_input );
void spudec_DestroyThread( spudec_thread_t * p_spudec ); void spudec_DestroyThread( spudec_thread_t * p_spudec );
/******************************************************************************* /*****************************************************************************
* video.h: common video definitions * video.h: common video definitions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This header is required by all modules which have to handle pictures. It * This header is required by all modules which have to handle pictures. It
* includes all common video types and constants. * includes all common video types and constants.
******************************************************************************* *****************************************************************************
* Requires: * Requires:
* "config.h" * "config.h"
* "common.h" * "common.h"
* "mtime.h" * "mtime.h"
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* yuv_data_t: type for storing one Y, U or V sample. * yuv_data_t: type for storing one Y, U or V sample.
*******************************************************************************/ *****************************************************************************/
typedef u8 yuv_data_t; typedef u8 yuv_data_t;
/******************************************************************************* /*****************************************************************************
* picture_t: video picture * picture_t: video picture
******************************************************************************* *****************************************************************************
* Any picture destined to be displayed by a video output thread should be * 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. * 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 * Picture type and flags should only be modified by the output thread. Note
* that an empty picture MUST have its flags set to 0. * that an empty picture MUST have its flags set to 0.
*******************************************************************************/ *****************************************************************************/
typedef struct picture_s typedef struct picture_s
{ {
/* Type and flags - should NOT be modified except by the vout thread */ /* Type and flags - should NOT be modified except by the vout thread */
...@@ -77,7 +77,7 @@ typedef struct picture_s ...@@ -77,7 +77,7 @@ typedef struct picture_s
#define RESERVED_DATED_PICTURE 2 /* picture is waiting for DisplayPicture */ #define RESERVED_DATED_PICTURE 2 /* picture is waiting for DisplayPicture */
#define RESERVED_DISP_PICTURE 3 /* picture is waiting for a DatePixture */ #define RESERVED_DISP_PICTURE 3 /* picture is waiting for a DatePixture */
#define READY_PICTURE 4 /* picture is ready for display */ #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 */ #define DESTROYED_PICTURE 6 /* picture is allocated but no more used */
/* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ /* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
...@@ -86,14 +86,14 @@ typedef struct picture_s ...@@ -86,14 +86,14 @@ typedef struct picture_s
#define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */ #define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */ #define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */
/******************************************************************************* /*****************************************************************************
* subpicture_t: video sub picture unit * subpicture_t: video sub picture unit
******************************************************************************* *****************************************************************************
* Any sub picture unit destined to be displayed by a video output thread should * 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. * 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 * Subtitle type and flags should only be modified by the output thread. Note
* that an empty subtitle MUST have its flags set to 0. * that an empty subtitle MUST have its flags set to 0.
*******************************************************************************/ *****************************************************************************/
typedef struct subpicture_s typedef struct subpicture_s
{ {
/* Type and flags - should NOT be modified except by the vout thread */ /* Type and flags - should NOT be modified except by the vout thread */
...@@ -144,7 +144,7 @@ typedef struct subpicture_s ...@@ -144,7 +144,7 @@ typedef struct subpicture_s
#define FREE_SUBPICTURE 0 /* subpicture is free and not allocated */ #define FREE_SUBPICTURE 0 /* subpicture is free and not allocated */
#define RESERVED_SUBPICTURE 1 /* subpicture is allocated and reserved */ #define RESERVED_SUBPICTURE 1 /* subpicture is allocated and reserved */
#define READY_SUBPICTURE 2 /* subpicture is ready for display */ #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 */ /* Alignment types */
#define RIGHT_ALIGN 10 /* x is absolute for right */ #define RIGHT_ALIGN 10 /* x is absolute for right */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#ifdef VDEC_SMP #ifdef VDEC_SMP
/* ?? move to inline functions */ /* ?? move to inline functions */
#define VIDEO_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end ) #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 ) & VFIFO_SIZE ) == 0 )
#define VIDEO_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] ) #define VIDEO_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] )
#define VIDEO_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1) \ #define VIDEO_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1) \
......
/******************************************************************************* /*****************************************************************************
* video_graphics.h: pictures manipulation primitives * video_graphics.h: pictures manipulation primitives
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Includes function to compose, convert and display pictures, and also basic * Includes function to compose, convert and display pictures, and also basic
* functions to copy pictures data or descriptors. * functions to copy pictures data or descriptors.
******************************************************************************* *****************************************************************************
* Requires: * Requires:
* "config.h" * "config.h"
* "common.h" * "common.h"
* "mtime.h" * "mtime.h"
* "video.h" * "video.h"
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* video_output.h : video output thread * video_output.h : video output thread
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This module describes the programming interface for video output threads. * This module describes the programming interface for video output threads.
* It includes functions allowing to open a new thread, send pictures to a * It includes functions allowing to open a new thread, send pictures to a
* thread, and destroy a previously oppenned video output thread. * thread, and destroy a previously oppenned video output thread.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* vout_yuv_convert_t: YUV convertion function * vout_yuv_convert_t: YUV convertion function
******************************************************************************* *****************************************************************************
* This is the prototype common to all convertion functions. The type of p_pic * This is the prototype common to all convertion functions. The type of p_pic
* will change depending of the screen depth treated. * will change depending of the screen depth treated.
* Parameters: * Parameters:
...@@ -21,18 +21,18 @@ ...@@ -21,18 +21,18 @@
* i_pic_line_width picture total line width * i_pic_line_width picture total line width
* i_matrix_coefficients matrix coefficients * i_matrix_coefficients matrix coefficients
* Picture width and source dimensions must be multiples of 16. * 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, 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, yuv_data_t *p_y, yuv_data_t *p_u, yuv_data_t *p_v,
int i_width, int i_height, int i_width, int i_height,
int i_pic_width, int i_pic_height, int i_pic_line_width, int i_pic_width, int i_pic_height, int i_pic_line_width,
int i_matrix_coefficients ); int i_matrix_coefficients );
/******************************************************************************* /*****************************************************************************
* vout_yuv_t: pre-calculated YUV convertion tables * vout_yuv_t: pre-calculated YUV convertion tables
******************************************************************************* *****************************************************************************
* These tables are used by convertion and scaling functions. * These tables are used by convertion and scaling functions.
*******************************************************************************/ *****************************************************************************/
typedef struct vout_yuv_s typedef struct vout_yuv_s
{ {
/* Convertion functions */ /* Convertion functions */
...@@ -57,12 +57,12 @@ typedef struct vout_yuv_s ...@@ -57,12 +57,12 @@ typedef struct vout_yuv_s
int * p_offset; /* offset array */ int * p_offset; /* offset array */
} vout_yuv_t; } vout_yuv_t;
/******************************************************************************* /*****************************************************************************
* vout_buffer_t: rendering buffer * vout_buffer_t: rendering buffer
******************************************************************************* *****************************************************************************
* This structure store informations about a buffer. Buffers are not completely * This structure store informations about a buffer. Buffers are not completely
* cleared between displays, and modified areas needs to be stored. * cleared between displays, and modified areas needs to be stored.
*******************************************************************************/ *****************************************************************************/
typedef struct vout_buffer_s typedef struct vout_buffer_s
{ {
/* Picture area */ /* Picture area */
...@@ -78,13 +78,13 @@ typedef struct vout_buffer_s ...@@ -78,13 +78,13 @@ typedef struct vout_buffer_s
byte_t * p_data; /* memory address */ byte_t * p_data; /* memory address */
} vout_buffer_t; } vout_buffer_t;
/******************************************************************************* /*****************************************************************************
* vout_thread_t: video output thread descriptor * vout_thread_t: video output thread descriptor
******************************************************************************* *****************************************************************************
* Any independant video output device, such as an X11 window or a GGI device, * 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 * is represented by a video output thread, and described using following
* structure. * structure.
*******************************************************************************/ *****************************************************************************/
typedef void (vout_set_palette_t)( p_vout_thread_t p_vout, typedef void (vout_set_palette_t)( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp ); u16 *red, u16 *green, u16 *blue, u16 *transp );
...@@ -107,7 +107,7 @@ typedef struct vout_thread_s ...@@ -107,7 +107,7 @@ typedef struct vout_thread_s
int i_height; /* current output method height */ int i_height; /* current output method height */
int i_bytes_per_line; /* bytes per line (incl. virtual) */ int i_bytes_per_line; /* bytes per line (incl. virtual) */
int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */ 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 */ float f_gamma; /* gamma */
/* Color masks and shifts in RGB mode - masks are set by system /* Color masks and shifts in RGB mode - masks are set by system
...@@ -172,9 +172,9 @@ typedef struct vout_thread_s ...@@ -172,9 +172,9 @@ typedef struct vout_thread_s
#define VOUT_YUV_CHANGE 0x0800 /* change yuv tables */ #define VOUT_YUV_CHANGE 0x0800 /* change yuv tables */
#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */ #define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */
/******************************************************************************* /*****************************************************************************
* Macros * Macros
*******************************************************************************/ *****************************************************************************/
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */ /* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
#define RGB2PIXEL( p_vout, i_red, i_green, i_blue ) \ #define RGB2PIXEL( p_vout, i_red, i_green, i_blue ) \
...@@ -183,9 +183,9 @@ typedef struct vout_thread_s ...@@ -183,9 +183,9 @@ typedef struct vout_thread_s
((((u32)i_blue) >> p_vout->i_blue_rshift) << p_vout->i_blue_lshift)) ((((u32)i_blue) >> p_vout->i_blue_rshift) << p_vout->i_blue_lshift))
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
int i_width, int i_height, int *pi_status ); int i_width, int i_height, int *pi_status );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status ); void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
......
/******************************************************************************* /*****************************************************************************
* video_sys.h: system dependant video output display method API * video_sys.h: system dependant video output display method API
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window ); 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 ); int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout ); void vout_SysEnd ( p_vout_thread_t p_vout );
......
/******************************************************************************* /*****************************************************************************
* video_text.h : text manipulation functions * video_text.h : text manipulation functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/* Text styles - these are primary text styles, used by the vout_Print function. /* Text styles - these are primary text styles, used by the vout_Print function.
* They may be ignored or interpreted by higher level functions */ * They may be ignored or interpreted by higher level functions */
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#define VOID_TEXT 16 /* no foreground */ #define VOID_TEXT 16 /* no foreground */
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
p_vout_font_t vout_LoadFont ( const char *psz_name ); p_vout_font_t vout_LoadFont ( const char *psz_name );
void vout_UnloadFont ( p_vout_font_t p_font ); void vout_UnloadFont ( p_vout_font_t p_font );
void vout_TextSize ( p_vout_font_t p_font, int i_style, void vout_TextSize ( p_vout_font_t p_font, int i_style,
......
/******************************************************************************* /*****************************************************************************
* video_x11.h: X11 video output display method * video_x11.h: X11 video output display method
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* The X11 method for video output thread. The functions declared here should * The X11 method for video output thread. The functions declared here should
* not be needed by any other module than video_output.c. * not be needed by any other module than video_output.c.
******************************************************************************* *****************************************************************************
* Required headers: * Required headers:
* <X11/Xlib.h> * <X11/Xlib.h>
* <X11/Xutil.h> * <X11/Xutil.h>
...@@ -14,16 +14,16 @@ ...@@ -14,16 +14,16 @@
* "mtime.h" * "mtime.h"
* "video.h" * "video.h"
* "video_output.h" * "video_output.h"
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* vout_x11_t: video output X11 method descriptor * vout_x11_t: video output X11 method descriptor
******************************************************************************* *****************************************************************************
* This structure is part of the video output thread descriptor. * This structure is part of the video output thread descriptor.
* It describes the X11 specific properties of an output thread. X11 video * It describes the X11 specific properties of an output thread. X11 video
* output is performed through regular resizable windows. Windows can be * output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams. * dynamically resized to adapt to the size of the streams.
*******************************************************************************/ *****************************************************************************/
typedef struct vout_x11_s typedef struct vout_x11_s
{ {
/* User settings */ /* User settings */
...@@ -62,9 +62,9 @@ typedef struct vout_x11_s ...@@ -62,9 +62,9 @@ typedef struct vout_x11_s
int i_completion_type; /* ?? */ int i_completion_type; /* ?? */
} vout_x11_t; } vout_x11_t;
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int vout_X11AllocOutputMethod ( vout_thread_t *p_vout, video_cfg_t *p_cfg ); int vout_X11AllocOutputMethod ( vout_thread_t *p_vout, video_cfg_t *p_cfg );
void vout_X11FreeOutputMethod ( vout_thread_t *p_vout ); void vout_X11FreeOutputMethod ( vout_thread_t *p_vout );
int vout_X11CreateOutputMethod ( vout_thread_t *p_vout ); int vout_X11CreateOutputMethod ( vout_thread_t *p_vout );
......
/******************************************************************************* /*****************************************************************************
* video_yuv.h: YUV transformation functions * video_yuv.h: YUV transformation functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Provides functions prototypes to perform the YUV conversion. The functions * Provides functions prototypes to perform the YUV conversion. The functions
* may be implemented in one of the video_yuv_* files. * may be implemented in one of the video_yuv_* files.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Prototypes * Prototypes
*******************************************************************************/ *****************************************************************************/
int vout_InitYUV ( vout_thread_t *p_vout ); int vout_InitYUV ( vout_thread_t *p_vout );
int vout_ResetYUV ( vout_thread_t *p_vout ); int vout_ResetYUV ( vout_thread_t *p_vout );
void vout_EndYUV ( vout_thread_t *p_vout ); void vout_EndYUV ( vout_thread_t *p_vout );
/******************************************************************************* /*****************************************************************************
* External prototypes * External prototypes
*******************************************************************************/ *****************************************************************************/
#ifdef HAVE_MMX #ifdef HAVE_MMX
/* YUV transformations for MMX - in video_yuv_mmx.S /* YUV transformations for MMX - in video_yuv_mmx.S
......
/******************************************************************************* /*****************************************************************************
* vlc.h: all headers * vlc.h: all headers
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* This header includes all vlc .h headers and depending headers. A source file * 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. * 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 * Note that functions or system headers specific to the file itself are not
* included. * included.
******************************************************************************* *****************************************************************************
* required headers: * required headers:
* none * none
*******************************************************************************/ *****************************************************************************/
/* System headers */ /* System headers */
#include <errno.h> #include <errno.h>
......
/******************************************************************************* /*****************************************************************************
* vlc_thread.h : thread implementation for vieolan client * vlc_thread.h : thread implementation for vieolan client
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* This header is supposed to provide a portable threads implementation. * This header is supposed to provide a portable threads implementation.
* Currently, it is a wrapper to the POSIX pthreads library. * Currently, it is a wrapper to the POSIX pthreads library.
*******************************************************************************/ *****************************************************************************/
#include <pthread.h> #include <pthread.h>
/****************************************************************************** /*****************************************************************************
* Constants * Constants
****************************************************************************** *****************************************************************************
* These constants are used by all threads in *_CreateThread() and * These constants are used by all threads in *_CreateThread() and
* *_DestroyThreads() functions. Since those calls are non-blocking, an integer * *_DestroyThreads() functions. Since those calls are non-blocking, an integer
* value is used as a shared flag to represent the status of the thread. * 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 /* 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 */ * threads, that no operation is currently in progress on the concerned thread */
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
#define THREAD_ERROR 30 /* an error occured */ #define THREAD_ERROR 30 /* an error occured */
#define THREAD_FATAL 31 /* an fatal error occured - program must end */ #define THREAD_FATAL 31 /* an fatal error occured - program must end */
/****************************************************************************** /*****************************************************************************
* Types definition * Types definition
******************************************************************************/ *****************************************************************************/
typedef pthread_t vlc_thread_t; typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t; typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t; typedef pthread_cond_t vlc_cond_t;
typedef void *(*vlc_thread_func_t)(void *p_data); typedef void *(*vlc_thread_func_t)(void *p_data);
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, char *psz_name, static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, char *psz_name,
vlc_thread_func_t func, void *p_data ); 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_ ...@@ -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, //static _inline__ int vlc_cond_timedwait ( vlc_cond_t * condvar, vlc_mutex_t * mutex,
// mtime_t absoute_timeout_time ); // mtime_t absoute_timeout_time );
/******************************************************************************* /*****************************************************************************
* vlc_thread_create: create a thread * vlc_thread_create: create a thread
******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
char *psz_name, vlc_thread_func_t func, char *psz_name, vlc_thread_func_t func,
void *p_data) void *p_data)
...@@ -72,65 +72,65 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, ...@@ -72,65 +72,65 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
return pthread_create( p_thread, NULL, func, p_data ); return pthread_create( p_thread, NULL, func, p_data );
} }
/****************************************************************************** /*****************************************************************************
* vlc_thread_exit: terminate a thread * vlc_thread_exit: terminate a thread
*******************************************************************************/ *****************************************************************************/
static __inline__ void vlc_thread_exit( void ) static __inline__ void vlc_thread_exit( void )
{ {
pthread_exit( 0 ); pthread_exit( 0 );
} }
/******************************************************************************* /*****************************************************************************
* vlc_thread_join: wait until a thread exits * vlc_thread_join: wait until a thread exits
******************************************************************************/ *****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread ) static __inline__ void vlc_thread_join( vlc_thread_t thread )
{ {
pthread_join( thread, NULL ); pthread_join( thread, NULL );
} }
/******************************************************************************* /*****************************************************************************
* vlc_mutex_init: initialize a mutex * vlc_mutex_init: initialize a mutex
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{ {
return pthread_mutex_init( p_mutex, NULL ); return pthread_mutex_init( p_mutex, NULL );
} }
/******************************************************************************* /*****************************************************************************
* vlc_mutex_lock: lock a mutex * vlc_mutex_lock: lock a mutex
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{ {
return pthread_mutex_lock( p_mutex ); return pthread_mutex_lock( p_mutex );
} }
/******************************************************************************* /*****************************************************************************
* vlc_mutex_unlock: unlock a mutex * vlc_mutex_unlock: unlock a mutex
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{ {
return pthread_mutex_unlock( p_mutex ); return pthread_mutex_unlock( p_mutex );
} }
/******************************************************************************* /*****************************************************************************
* vlc_cond_init: initialize a condition * vlc_cond_init: initialize a condition
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar ) static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{ {
return pthread_cond_init( p_condvar, NULL ); return pthread_cond_init( p_condvar, NULL );
} }
/******************************************************************************* /*****************************************************************************
* vlc_cond_signal: start a thread on condition completion * vlc_cond_signal: start a thread on condition completion
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{ {
return pthread_cond_signal( p_condvar ); return pthread_cond_signal( p_condvar );
} }
/******************************************************************************* /*****************************************************************************
* vlc_cond_wait: wait until condition completion * vlc_cond_wait: wait until condition completion
*******************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex ) static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{ {
return pthread_cond_wait( p_condvar, p_mutex ); return pthread_cond_wait( p_condvar, p_mutex );
......
...@@ -91,7 +91,7 @@ typedef struct lookup_s ...@@ -91,7 +91,7 @@ typedef struct lookup_s
int i_length; int i_length;
} lookup_t; } lookup_t;
/****************************************************************************** /*****************************************************************************
* ac_lookup_t : special entry type for lookup tables about ac coefficients * ac_lookup_t : special entry type for lookup tables about ac coefficients
*****************************************************************************/ *****************************************************************************/
typedef struct dct_lookup_s typedef struct dct_lookup_s
......
This diff is collapsed.
/****************************************************************************** /*****************************************************************************
* audio_dsp.c : dsp functions library * audio_dsp.c : dsp functions library
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/* TODO: /* TODO:
* *
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
* *
*/ */
/****************************************************************************** /*****************************************************************************
* Preamble * Preamble
******************************************************************************/ *****************************************************************************/
#include <fcntl.h> /* open(), O_WRONLY */ #include <fcntl.h> /* open(), O_WRONLY */
#include <sys/ioctl.h> /* ioctl() */ #include <sys/ioctl.h> /* ioctl() */
#include <unistd.h> /* write(), close() */ #include <unistd.h> /* write(), close() */
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */ #include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
/****************************************************************************** /*****************************************************************************
* aout_dspOpen: opens the audio device (the digital sound processor) * aout_dspOpen: opens the audio device (the digital sound processor)
****************************************************************************** *****************************************************************************
* - This function opens the dsp as an usual non-blocking write-only file, and * - 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. * modifies the p_dsp->i_fd with the file's descriptor.
* - p_dsp->psz_device must be set before calling this function ! * - p_dsp->psz_device must be set before calling this function !
******************************************************************************/ *****************************************************************************/
int aout_dspOpen( aout_dsp_t *p_dsp ) int aout_dspOpen( aout_dsp_t *p_dsp )
{ {
if ( (p_dsp->i_fd = open( p_dsp->psz_device, O_WRONLY )) < 0 ) 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 ) ...@@ -48,9 +48,9 @@ int aout_dspOpen( aout_dsp_t *p_dsp )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspReset: resets the dsp * aout_dspReset: resets the dsp
******************************************************************************/ *****************************************************************************/
int aout_dspReset( aout_dsp_t *p_dsp ) int aout_dspReset( aout_dsp_t *p_dsp )
{ {
if ( ioctl( p_dsp->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 ) if ( ioctl( p_dsp->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
...@@ -62,13 +62,13 @@ int aout_dspReset( aout_dsp_t *p_dsp ) ...@@ -62,13 +62,13 @@ int aout_dspReset( aout_dsp_t *p_dsp )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspSetFormat: sets the dsp output format * aout_dspSetFormat: sets the dsp output format
****************************************************************************** *****************************************************************************
* This functions tries to initialize the dsp output format with the value * 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 * contained in the dsp structure, and if this value could not be set, the
* default value returned by ioctl is set. * default value returned by ioctl is set.
******************************************************************************/ *****************************************************************************/
int aout_dspSetFormat( aout_dsp_t *p_dsp ) int aout_dspSetFormat( aout_dsp_t *p_dsp )
{ {
int i_format; int i_format;
...@@ -89,11 +89,11 @@ int aout_dspSetFormat( aout_dsp_t *p_dsp ) ...@@ -89,11 +89,11 @@ int aout_dspSetFormat( aout_dsp_t *p_dsp )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspSetChannels: sets the dsp's stereo or mono mode * aout_dspSetChannels: sets the dsp's stereo or mono mode
****************************************************************************** *****************************************************************************
* This function acts just like the previous one... * This function acts just like the previous one...
******************************************************************************/ *****************************************************************************/
int aout_dspSetChannels( aout_dsp_t *p_dsp ) int aout_dspSetChannels( aout_dsp_t *p_dsp )
{ {
boolean_t b_stereo; boolean_t b_stereo;
...@@ -114,13 +114,13 @@ int aout_dspSetChannels( aout_dsp_t *p_dsp ) ...@@ -114,13 +114,13 @@ int aout_dspSetChannels( aout_dsp_t *p_dsp )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspSetRate: sets the dsp's audio output rate * aout_dspSetRate: sets the dsp's audio output rate
****************************************************************************** *****************************************************************************
* This function tries to initialize the dsp with the rate contained in the * 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 * dsp structure, but if the dsp doesn't support this value, the function uses
* the value returned by ioctl... * the value returned by ioctl...
******************************************************************************/ *****************************************************************************/
int aout_dspSetRate( aout_dsp_t *p_dsp ) int aout_dspSetRate( aout_dsp_t *p_dsp )
{ {
long l_rate; long l_rate;
...@@ -141,9 +141,9 @@ int aout_dspSetRate( aout_dsp_t *p_dsp ) ...@@ -141,9 +141,9 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspGetBufInfo: buffer status query * aout_dspGetBufInfo: buffer status query
****************************************************************************** *****************************************************************************
* This function fills in the audio_buf_info structure : * This function fills in the audio_buf_info structure :
* - int fragments : number of available fragments (partially usend ones not * - int fragments : number of available fragments (partially usend ones not
* counted) * counted)
...@@ -151,25 +151,25 @@ int aout_dspSetRate( aout_dsp_t *p_dsp ) ...@@ -151,25 +151,25 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
* - int fragsize : size of a fragment in bytes * - int fragsize : size of a fragment in bytes
* - int bytes : available space in bytes (includes partially used fragments) * - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize * Note! 'bytes' could be more than fragments*fragsize
******************************************************************************/ *****************************************************************************/
void aout_dspGetBufInfo( aout_dsp_t *p_dsp ) void aout_dspGetBufInfo( aout_dsp_t *p_dsp )
{ {
ioctl( p_dsp->i_fd, SNDCTL_DSP_GETOSPACE, &p_dsp->buf_info ); ioctl( p_dsp->i_fd, SNDCTL_DSP_GETOSPACE, &p_dsp->buf_info );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspPlaySamples: plays a sound samples buffer * aout_dspPlaySamples: plays a sound samples buffer
****************************************************************************** *****************************************************************************
* This function writes a buffer of i_length bytes in the dsp * 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 ) void aout_dspPlaySamples( aout_dsp_t *p_dsp, byte_t *buffer, int i_size )
{ {
write( p_dsp->i_fd, buffer, i_size ); write( p_dsp->i_fd, buffer, i_size );
} }
/****************************************************************************** /*****************************************************************************
* aout_dspClose: closes the dsp audio device * aout_dspClose: closes the dsp audio device
******************************************************************************/ *****************************************************************************/
void aout_dspClose( aout_dsp_t *p_dsp ) void aout_dspClose( aout_dsp_t *p_dsp )
{ {
close( p_dsp->i_fd ); close( p_dsp->i_fd );
......
/****************************************************************************** /*****************************************************************************
* audio_output.c : audio output thread * audio_output.c : audio output thread
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************/ *****************************************************************************/
/* TODO: /* TODO:
* *
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
* *
*/ */
/****************************************************************************** /*****************************************************************************
* Preamble * Preamble
******************************************************************************/ *****************************************************************************/
#include <unistd.h> #include <unistd.h>
#include <sys/soundcard.h> #include <sys/soundcard.h>
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
#include "audio_dsp.h" #include "audio_dsp.h"
#include "main.h" #include "main.h"
/****************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
******************************************************************************/ *****************************************************************************/
static int aout_SpawnThread( aout_thread_t * p_aout ); static int aout_SpawnThread( aout_thread_t * p_aout );
...@@ -56,9 +56,9 @@ void aout_Thread_U16_Stereo ( 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__ 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 ); static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, mtime_t aout_date );
/****************************************************************************** /*****************************************************************************
* aout_CreateThread: initialize audio thread * aout_CreateThread: initialize audio thread
******************************************************************************/ *****************************************************************************/
aout_thread_t *aout_CreateThread( int *pi_status ) aout_thread_t *aout_CreateThread( int *pi_status )
{ {
aout_thread_t * p_aout; /* thread descriptor */ aout_thread_t * p_aout; /* thread descriptor */
...@@ -129,9 +129,9 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -129,9 +129,9 @@ aout_thread_t *aout_CreateThread( int *pi_status )
return( p_aout ); return( p_aout );
} }
/****************************************************************************** /*****************************************************************************
* aout_SpawnThread * aout_SpawnThread
******************************************************************************/ *****************************************************************************/
static int aout_SpawnThread( aout_thread_t * p_aout ) static int aout_SpawnThread( aout_thread_t * p_aout )
{ {
int i_fifo; int i_fifo;
...@@ -266,9 +266,9 @@ static int aout_SpawnThread( aout_thread_t * p_aout ) ...@@ -266,9 +266,9 @@ static int aout_SpawnThread( aout_thread_t * p_aout )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* aout_DestroyThread * aout_DestroyThread
******************************************************************************/ *****************************************************************************/
void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status ) void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
{ {
//???? pi_status is not handled correctly: check vout how to do! //???? 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 ) ...@@ -289,9 +289,9 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
free( p_aout ); free( p_aout );
} }
/****************************************************************************** /*****************************************************************************
* aout_CreateFifo * aout_CreateFifo
******************************************************************************/ *****************************************************************************/
aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
{ {
int i_fifo; int i_fifo;
...@@ -390,9 +390,9 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_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] ); return( &p_aout->fifo[i_fifo] );
} }
/****************************************************************************** /*****************************************************************************
* aout_DestroyFifo * aout_DestroyFifo
******************************************************************************/ *****************************************************************************/
void aout_DestroyFifo( aout_fifo_t * p_fifo ) void aout_DestroyFifo( aout_fifo_t * p_fifo )
{ {
intf_DbgMsg("aout debug: requesting destruction of audio output fifo (%p)\n", 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 ) ...@@ -402,7 +402,7 @@ void aout_DestroyFifo( aout_fifo_t * p_fifo )
/* Here are the local macros */ /* Here are the local macros */
#define UPDATE_INCREMENT( increment, integer ) \ #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; \ (integer) += (increment).l_euclidean_integer + 1; \
(increment).l_remainder -= (increment).l_euclidean_denominator; \ (increment).l_remainder -= (increment).l_euclidean_denominator; \
...@@ -414,9 +414,9 @@ void aout_DestroyFifo( aout_fifo_t * p_fifo ) ...@@ -414,9 +414,9 @@ void aout_DestroyFifo( aout_fifo_t * p_fifo )
/* Following functions are local */ /* Following functions are local */
/****************************************************************************** /*****************************************************************************
* InitializeIncrement * InitializeIncrement
******************************************************************************/ *****************************************************************************/
static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long l_numerator, long l_denominator ) static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long l_numerator, long l_denominator )
{ {
p_increment->l_remainder = -l_denominator; p_increment->l_remainder = -l_denominator;
...@@ -433,9 +433,9 @@ static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long ...@@ -433,9 +433,9 @@ static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long
p_increment->l_euclidean_denominator = l_denominator; p_increment->l_euclidean_denominator = l_denominator;
} }
/****************************************************************************** /*****************************************************************************
* NextFrame * NextFrame
******************************************************************************/ *****************************************************************************/
static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, mtime_t aout_date ) static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, mtime_t aout_date )
{ {
long l_units, l_rate; long l_units, l_rate;
......
/****************************************************************************** /*****************************************************************************
* generic_decoder.c : generic decoder thread * generic_decoder.c : generic decoder thread
* (c)1999 VideoLAN * (c)1999 VideoLAN
****************************************************************************** *****************************************************************************
* This decoder provides a way to parse packets which do not belong to any * 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 * 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 * from a multiplexed stream, identify automatically ES in a stream missing
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* mode. * mode.
* A single generic decoder is able to handle several ES, therefore it can be * A single generic decoder is able to handle several ES, therefore it can be
* used as a 'default' decoder by the input thread. * used as a 'default' decoder by the input thread.
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include "vlc.h" #include "vlc.h"
/*#include <errno.h> /*#include <errno.h>
...@@ -56,15 +56,15 @@ static void IdentifyPES ( gdec_thread_t *p_gdec, pes_packet_t *p_pes ...@@ -56,15 +56,15 @@ static void IdentifyPES ( gdec_thread_t *p_gdec, pes_packet_t *p_pes
int i_stream_id ); int i_stream_id );
static void PrintPES ( 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 * gdec_CreateThread: create a generic decoder thread
****************************************************************************** *****************************************************************************
* This function creates a new generic decoder thread, and returns a pointer * This function creates a new generic decoder thread, and returns a pointer
* to its description. On error, it returns NULL. * to its description. On error, it returns NULL.
* Following configuration properties are used: * Following configuration properties are used:
* GDEC_CFG_ACTIONS (required) * GDEC_CFG_ACTIONS (required)
* ?? * ??
******************************************************************************/ *****************************************************************************/
gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input, gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input,
int *pi_status ) int *pi_status )
{ {
...@@ -127,13 +127,13 @@ gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input, ...@@ -127,13 +127,13 @@ gdec_thread_t * gdec_CreateThread( gdec_cfg_t *p_cfg, input_thread_t *p_input,
return( p_gdec ); return( p_gdec );
} }
/****************************************************************************** /*****************************************************************************
* gdec_DestroyThread: destroy a generic decoder thread * gdec_DestroyThread: destroy a generic decoder thread
****************************************************************************** *****************************************************************************
* Destroy a terminated thread. This function will return 0 if the thread could * 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 * be destroyed, and non 0 else. The last case probably means that the thread
* was still active, and another try may succeed. * was still active, and another try may succeed.
******************************************************************************/ *****************************************************************************/
void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status ) void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status )
{ {
int i_status; /* thread status */ int i_status; /* thread status */
...@@ -164,12 +164,12 @@ void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status ) ...@@ -164,12 +164,12 @@ void gdec_DestroyThread( gdec_thread_t *p_gdec, int *pi_status )
/* following functions are local */ /* following functions are local */
/****************************************************************************** /*****************************************************************************
* CheckConfiguration: check gdec_CreateThread() configuration * CheckConfiguration: check gdec_CreateThread() configuration
****************************************************************************** *****************************************************************************
* Set default parameters where required. In DEBUG mode, check if configuration * Set default parameters where required. In DEBUG mode, check if configuration
* is valid. * is valid.
******************************************************************************/ *****************************************************************************/
static int CheckConfiguration( gdec_cfg_t *p_cfg ) static int CheckConfiguration( gdec_cfg_t *p_cfg )
{ {
#ifdef DEBUG #ifdef DEBUG
...@@ -183,13 +183,13 @@ static int CheckConfiguration( gdec_cfg_t *p_cfg ) ...@@ -183,13 +183,13 @@ static int CheckConfiguration( gdec_cfg_t *p_cfg )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* InitThread: initialize gdec thread * InitThread: initialize gdec thread
****************************************************************************** *****************************************************************************
* This function is called from RunThread and performs the second step of the * 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 * initialization. It returns 0 on success. Note that the thread's flag are not
* modified inside this function. * modified inside this function.
******************************************************************************/ *****************************************************************************/
static int InitThread( gdec_thread_t *p_gdec ) static int InitThread( gdec_thread_t *p_gdec )
{ {
/* ?? */ /* ?? */
...@@ -210,12 +210,12 @@ static int InitThread( gdec_thread_t *p_gdec ) ...@@ -210,12 +210,12 @@ static int InitThread( gdec_thread_t *p_gdec )
return(0); return(0);
} }
/****************************************************************************** /*****************************************************************************
* RunThread: generic decoder thread * RunThread: generic decoder thread
****************************************************************************** *****************************************************************************
* Generic decoder thread. This function does only returns when the thread is * Generic decoder thread. This function does only returns when the thread is
* terminated. * terminated.
******************************************************************************/ *****************************************************************************/
static void RunThread( gdec_thread_t *p_gdec ) static void RunThread( gdec_thread_t *p_gdec )
{ {
pes_packet_t * p_pes; /* current packet */ pes_packet_t * p_pes; /* current packet */
...@@ -299,13 +299,13 @@ static void RunThread( gdec_thread_t *p_gdec ) ...@@ -299,13 +299,13 @@ static void RunThread( gdec_thread_t *p_gdec )
EndThread( p_gdec ); EndThread( p_gdec );
} }
/****************************************************************************** /*****************************************************************************
* ErrorThread: RunThread() error loop * ErrorThread: RunThread() error loop
****************************************************************************** *****************************************************************************
* This function is called when an error occured during thread main's loop. The * 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 * thread can still receive feed, but must be ready to terminate as soon as
* possible. * possible.
******************************************************************************/ *****************************************************************************/
static void ErrorThread( gdec_thread_t *p_gdec ) static void ErrorThread( gdec_thread_t *p_gdec )
{ {
pes_packet_t * p_pes; /* pes packet */ pes_packet_t * p_pes; /* pes packet */
...@@ -326,12 +326,12 @@ static void ErrorThread( gdec_thread_t *p_gdec ) ...@@ -326,12 +326,12 @@ static void ErrorThread( gdec_thread_t *p_gdec )
} }
} }
/****************************************************************************** /*****************************************************************************
* EndThread: thread destruction * EndThread: thread destruction
****************************************************************************** *****************************************************************************
* This function is called when the thread ends after a sucessfull * This function is called when the thread ends after a sucessfull
* initialization. * initialization.
******************************************************************************/ *****************************************************************************/
static void EndThread( gdec_thread_t *p_gdec ) static void EndThread( gdec_thread_t *p_gdec )
{ {
int * pi_status; /* thread status */ int * pi_status; /* thread status */
...@@ -352,12 +352,12 @@ static void EndThread( gdec_thread_t *p_gdec ) ...@@ -352,12 +352,12 @@ static void EndThread( gdec_thread_t *p_gdec )
intf_DbgMsg("%p\n", p_gdec); intf_DbgMsg("%p\n", p_gdec);
} }
/****************************************************************************** /*****************************************************************************
* IdentifyPES: identify a PES packet * IdentifyPES: identify a PES packet
****************************************************************************** *****************************************************************************
* Update ES tables in the input thread according to the stream_id value. See * Update ES tables in the input thread according to the stream_id value. See
* ISO 13818-1, table 2-18. * ISO 13818-1, table 2-18.
******************************************************************************/ *****************************************************************************/
static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_stream_id ) 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 */ 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 ...@@ -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 * PrintPES: print informations about a PES packet
****************************************************************************** *****************************************************************************
* This function will print information about a received PES packet. It is * This function will print information about a received PES packet. It is
* probably usefull only for debugging purposes, or before demultiplexing a * probably usefull only for debugging purposes, or before demultiplexing a
* stream. It has two different formats, depending of the presence of the DEBUG * stream. It has two different formats, depending of the presence of the DEBUG
* symbol. * symbol.
******************************************************************************/ *****************************************************************************/
static void PrintPES( pes_packet_t *p_pes, int i_stream_id ) static void PrintPES( pes_packet_t *p_pes, int i_stream_id )
{ {
char psz_pes[128]; /* descriptor buffer */ char psz_pes[128]; /* descriptor buffer */
......
This diff is collapsed.
/******************************************************************************* /*****************************************************************************
* input_ctrl.c: Decodeur control * input_ctrl.c: Decodeur control
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Control the extraction and the decoding of the programs elements carried in * Control the extraction and the decoding of the programs elements carried in
* a stream. * a stream.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include "vlc.h" #include "vlc.h"
...@@ -44,14 +44,14 @@ ...@@ -44,14 +44,14 @@
#endif #endif
/****************************************************************************** /*****************************************************************************
* input_AddPgrmElem: Start the extraction and the decoding of a program element * 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 * Add the element given by its PID in the list of PID to extract and spawn
* the decoding thread. * the decoding thread.
* This function only modifies the table of selected es, but must NOT modify * This function only modifies the table of selected es, but must NOT modify
* the table of ES itself. * the table of ES itself.
******************************************************************************/ *****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_id ) int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
{ {
int i_es_loop, i_selected_es_loop; int i_es_loop, i_selected_es_loop;
...@@ -185,14 +185,14 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id ) ...@@ -185,14 +185,14 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
return( -1 ); return( -1 );
} }
/****************************************************************************** /*****************************************************************************
* input_DelPgrmElem: Stop the decoding of a program element * input_DelPgrmElem: Stop the decoding of a program element
****************************************************************************** *****************************************************************************
* Stop the extraction of the element given by its PID and kill the associated * Stop the extraction of the element given by its PID and kill the associated
* decoder thread * decoder thread
* This function only modifies the table of selected es, but must NOT modify * This function only modifies the table of selected es, but must NOT modify
* the table of ES itself. * the table of ES itself.
******************************************************************************/ *****************************************************************************/
int input_DelPgrmElem( input_thread_t *p_input, int i_current_id ) int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
{ {
int i_selected_es_loop, i_last_selected; int i_selected_es_loop, i_last_selected;
...@@ -275,12 +275,12 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id ) ...@@ -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 * 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 * Cannot return the position of the es in the pp_selected_es, for it can
* change once we have released the lock * change once we have released the lock
******************************************************************************/ *****************************************************************************/
boolean_t input_IsElemRecv( input_thread_t *p_input, int i_id ) boolean_t input_IsElemRecv( input_thread_t *p_input, int i_id )
{ {
boolean_t b_is_recv = 0; boolean_t b_is_recv = 0;
......
/******************************************************************************* /*****************************************************************************
* input_file.c: functions to read from a file * input_file.c: functions to read from a file
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
...@@ -17,18 +17,18 @@ ...@@ -17,18 +17,18 @@
#include "input.h" #include "input.h"
#include "input_file.h" #include "input_file.h"
/****************************************************************************** /*****************************************************************************
* input_FileOpen : open a file descriptor * input_FileOpen : open a file descriptor
******************************************************************************/ *****************************************************************************/
int input_FileOpen( input_thread_t *p_input ) int input_FileOpen( input_thread_t *p_input )
{ {
//?? //??
return( 1 ); return( 1 );
} }
/****************************************************************************** /*****************************************************************************
* input_FileRead : read from a file * input_FileRead : read from a file
******************************************************************************/ *****************************************************************************/
int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count ) size_t i_count )
{ {
...@@ -36,9 +36,9 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, ...@@ -36,9 +36,9 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
return( -1 ); return( -1 );
} }
/****************************************************************************** /*****************************************************************************
* input_FileClose : close a file descriptor * input_FileClose : close a file descriptor
******************************************************************************/ *****************************************************************************/
void input_FileClose( input_thread_t *p_input ) void input_FileClose( input_thread_t *p_input )
{ {
//?? //??
......
/******************************************************************************* /*****************************************************************************
* netlist.c: input thread * netlist.c: input thread
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* Manages the TS and PES netlists (see netlist.h). * Manages the TS and PES netlists (see netlist.h).
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
#include "input.h" #include "input.h"
#include "input_netlist.h" #include "input_netlist.h"
/****************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* input_NetlistOpen: initialize the netlists buffers * input_NetlistOpen: initialize the netlists buffers
******************************************************************************/ *****************************************************************************/
int input_NetlistInit( input_thread_t *p_input ) int input_NetlistInit( input_thread_t *p_input )
{ {
int i_base, i_packets, i_iovec; int i_base, i_packets, i_iovec;
...@@ -116,9 +116,9 @@ int input_NetlistInit( input_thread_t *p_input ) ...@@ -116,9 +116,9 @@ int input_NetlistInit( input_thread_t *p_input )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* input_NetlistClean: clean the netlists buffers * input_NetlistClean: clean the netlists buffers
******************************************************************************/ *****************************************************************************/
void input_NetlistEnd( input_thread_t *p_input ) void input_NetlistEnd( input_thread_t *p_input )
{ {
int i; int i;
......
/******************************************************************************* /*****************************************************************************
* network.c: functions to read from the network * network.c: functions to read from the network
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Manages a socket. * Manages a socket.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <string.h> #include <string.h>
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#include "intf_msg.h" #include "intf_msg.h"
#include "main.h" #include "main.h"
/****************************************************************************** /*****************************************************************************
* input_NetworkOpen: initialize a network stream * input_NetworkOpen: initialize a network stream
******************************************************************************/ *****************************************************************************/
int input_NetworkOpen( input_thread_t *p_input ) int input_NetworkOpen( input_thread_t *p_input )
{ {
int i_socket_option; int i_socket_option;
...@@ -186,15 +186,15 @@ int input_NetworkOpen( input_thread_t *p_input ) ...@@ -186,15 +186,15 @@ int input_NetworkOpen( input_thread_t *p_input )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* input_NetworkRead: read a stream from the network * input_NetworkRead: read a stream from the network
****************************************************************************** *****************************************************************************
* Wait for data during up to 1 second and then abort if none is arrived. The * 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 * number of bytes read is returned or -1 if an error occurs (so 0 is returned
* after a timeout) * after a timeout)
* We don't have to make any test on presentation times, since we suppose * We don't have to make any test on presentation times, since we suppose
* the network server sends us data when we need it. * the network server sends us data when we need it.
******************************************************************************/ *****************************************************************************/
int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector, int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count ) size_t i_count )
{ {
...@@ -221,9 +221,9 @@ int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector, ...@@ -221,9 +221,9 @@ int input_NetworkRead( input_thread_t *p_input, const struct iovec *p_vector,
return( i_rc ); return( i_rc );
} }
/****************************************************************************** /*****************************************************************************
* input_NetworkClose: close a network stream * input_NetworkClose: close a network stream
******************************************************************************/ *****************************************************************************/
void input_NetworkClose( input_thread_t *p_input ) void input_NetworkClose( input_thread_t *p_input )
{ {
/* Close local socket. */ /* Close local socket. */
......
/******************************************************************************* /*****************************************************************************
* pcr.c: PCR management * pcr.c: PCR management
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Manages structures containing PCR information. * Manages structures containing PCR information.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> /* iovec */ #include <sys/uio.h> /* iovec */
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
* *
*/ */
/****************************************************************************** /*****************************************************************************
* input_PcrReInit : Reinitialize the pcr_descriptor * input_PcrReInit : Reinitialize the pcr_descriptor
******************************************************************************/ *****************************************************************************/
void input_PcrReInit( input_thread_t *p_input ) void input_PcrReInit( input_thread_t *p_input )
{ {
ASSERT( p_input ); ASSERT( p_input );
...@@ -58,9 +58,9 @@ void input_PcrReInit( input_thread_t *p_input ) ...@@ -58,9 +58,9 @@ void input_PcrReInit( input_thread_t *p_input )
p_input->p_pcr->c_average_count = 0; p_input->p_pcr->c_average_count = 0;
} }
/****************************************************************************** /*****************************************************************************
* input_PcrInit : Initialize PCR decoder * input_PcrInit : Initialize PCR decoder
******************************************************************************/ *****************************************************************************/
int input_PcrInit( input_thread_t *p_input ) int input_PcrInit( input_thread_t *p_input )
{ {
ASSERT( p_input ); ASSERT( p_input );
...@@ -75,9 +75,9 @@ int input_PcrInit( input_thread_t *p_input ) ...@@ -75,9 +75,9 @@ int input_PcrInit( input_thread_t *p_input )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* input_PcrDecode : Decode a PCR frame * input_PcrDecode : Decode a PCR frame
******************************************************************************/ *****************************************************************************/
void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es, void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es,
u8* p_pcr_data ) u8* p_pcr_data )
{ {
...@@ -128,9 +128,9 @@ void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es, ...@@ -128,9 +128,9 @@ void input_PcrDecode( input_thread_t *p_input, es_descriptor_t *p_es,
} }
} }
/****************************************************************************** /*****************************************************************************
* input_PcrEnd : Clean PCR structures before dying * input_PcrEnd : Clean PCR structures before dying
******************************************************************************/ *****************************************************************************/
void input_PcrEnd( input_thread_t *p_input ) void input_PcrEnd( input_thread_t *p_input )
{ {
ASSERT( p_input ); ASSERT( p_input );
......
This diff is collapsed.
/******************************************************************************* /*****************************************************************************
* input_vlan.c: vlan management library * input_vlan.c: vlan management library
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
...@@ -27,29 +27,29 @@ ...@@ -27,29 +27,29 @@
#include "intf_msg.h" #include "intf_msg.h"
#include "main.h" #include "main.h"
/******************************************************************************* /*****************************************************************************
* input_vlan_t: vlan library data * input_vlan_t: vlan library data
******************************************************************************* *****************************************************************************
* Store global vlan library data. * Store global vlan library data.
*******************************************************************************/ *****************************************************************************/
typedef struct input_vlan_s typedef struct input_vlan_s
{ {
int i_vlan_id; /* current vlan number */ int i_vlan_id; /* current vlan number */
mtime_t last_change; /* last change date */ mtime_t last_change; /* last change date */
} input_vlan_t; } input_vlan_t;
/******************************************************************************* /*****************************************************************************
* Local prototypes * Local prototypes
*******************************************************************************/ *****************************************************************************/
static int ZeTrucMucheFunction( int Channel ); static int ZeTrucMucheFunction( int Channel );
/******************************************************************************* /*****************************************************************************
* input_VlanCreate: initialize global vlan method data * input_VlanCreate: initialize global vlan method data
******************************************************************************* *****************************************************************************
* Initialize vlan input method global data. This function should be called * 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*() * once before any input thread is created or any call to other input_Vlan*()
* function is attempted. * function is attempted.
*******************************************************************************/ *****************************************************************************/
int input_VlanCreate( void ) int input_VlanCreate( void )
{ {
/* Allocate structure */ /* Allocate structure */
...@@ -68,12 +68,12 @@ int input_VlanCreate( void ) ...@@ -68,12 +68,12 @@ int input_VlanCreate( void )
return( 0 ); return( 0 );
} }
/******************************************************************************* /*****************************************************************************
* input_VlanDestroy: free global vlan method data * input_VlanDestroy: free global vlan method data
******************************************************************************* *****************************************************************************
* Free resources allocated by input_VlanMethodInit. This function should be * Free resources allocated by input_VlanMethodInit. This function should be
* called at the end of the program. * called at the end of the program.
*******************************************************************************/ *****************************************************************************/
void input_VlanDestroy( void ) void input_VlanDestroy( void )
{ {
/* Return to default vlan */ /* Return to default vlan */
...@@ -86,9 +86,9 @@ void input_VlanDestroy( void ) ...@@ -86,9 +86,9 @@ void input_VlanDestroy( void )
free( p_main->p_vlan ); free( p_main->p_vlan );
} }
/******************************************************************************* /*****************************************************************************
* input_VlanJoin: join a vlan * input_VlanJoin: join a vlan
******************************************************************************* *****************************************************************************
* This function will try to join a vlan. If the relevant interface is already * 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 * 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 * interface is not locked), the vlan server will be contacted and a change will
...@@ -96,7 +96,7 @@ void input_VlanDestroy( void ) ...@@ -96,7 +96,7 @@ void input_VlanDestroy( void )
* that once a vlan is no more used, it's interface should be unlocked using * that once a vlan is no more used, it's interface should be unlocked using
* input_VlanLeave(). * input_VlanLeave().
* Non 0 will be returned in case of error. * Non 0 will be returned in case of error.
*******************************************************************************/ *****************************************************************************/
int input_VlanJoin( int i_vlan_id ) int input_VlanJoin( int i_vlan_id )
{ {
/* If last change is too recent, wait a while */ /* If last change is too recent, wait a while */
...@@ -112,12 +112,12 @@ int input_VlanJoin( int i_vlan_id ) ...@@ -112,12 +112,12 @@ int input_VlanJoin( int i_vlan_id )
return( ZeTrucMucheFunction( i_vlan_id ) ); // ?? join vlan return( ZeTrucMucheFunction( i_vlan_id ) ); // ?? join vlan
} }
/******************************************************************************* /*****************************************************************************
* input_VlanLeave: leave a vlan * input_VlanLeave: leave a vlan
******************************************************************************* *****************************************************************************
* This function tells the vlan library that the designed interface is no more * This function tells the vlan library that the designed interface is no more
* locked and than vlan changes can occur. * locked and than vlan changes can occur.
*******************************************************************************/ *****************************************************************************/
void input_VlanLeave( int i_vlan_id ) void input_VlanLeave( int i_vlan_id )
{ {
// ?? // ??
......
/******************************************************************************* /*****************************************************************************
* control.c: user control functions * control.c: user control functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Library of functions common to all threads, allowing access to various * Library of functions common to all threads, allowing access to various
* structures and settings. Interfaces should only use those functions * structures and settings. Interfaces should only use those functions
* to read or write informations from other threads. * to read or write informations from other threads.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include "vlc.h" #include "vlc.h"
/*?? /*??
#include <pthread.h> #include <pthread.h>
......
/******************************************************************************* /*****************************************************************************
* interface.c: interface access for other threads * interface.c: interface access for other threads
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* This library provides basic functions for threads to interact with user * This library provides basic functions for threads to interact with user
* interface, such as command line. * interface, such as command line.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
#include "intf_sys.h" #include "intf_sys.h"
/******************************************************************************* /*****************************************************************************
* intf_channel_t: channel description * intf_channel_t: channel description
******************************************************************************* *****************************************************************************
* A 'channel' is a descriptor of an input method. It is used to switch easily * 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 * from source to source without having to specify the whole input thread
* configuration. The channels array, stored in the interface thread object, is * configuration. The channels array, stored in the interface thread object, is
* loaded in intf_Create, and unloaded in intf_Destroy. * loaded in intf_Create, and unloaded in intf_Destroy.
*******************************************************************************/ *****************************************************************************/
typedef struct intf_channel_s typedef struct intf_channel_s
{ {
/* Channel description */ /* Channel description */
...@@ -52,19 +52,19 @@ typedef struct intf_channel_s ...@@ -52,19 +52,19 @@ typedef struct intf_channel_s
int i_input_vlan; /* vlan */ int i_input_vlan; /* vlan */
} intf_channel_t; } intf_channel_t;
/******************************************************************************* /*****************************************************************************
* Local prototypes * Local prototypes
*******************************************************************************/ *****************************************************************************/
static int LoadChannels ( intf_thread_t *p_intf, char *psz_filename ); static int LoadChannels ( intf_thread_t *p_intf, char *psz_filename );
static void UnloadChannels ( intf_thread_t *p_intf ); static void UnloadChannels ( intf_thread_t *p_intf );
static int ParseChannel ( intf_channel_t *p_channel, char *psz_str ); static int ParseChannel ( intf_channel_t *p_channel, char *psz_str );
/******************************************************************************* /*****************************************************************************
* intf_Create: prepare interface before main loop * intf_Create: prepare interface before main loop
******************************************************************************* *****************************************************************************
* This function opens output devices and create specific interfaces. It send * This function opens output devices and create specific interfaces. It send
* it's own error messages. * it's own error messages.
*******************************************************************************/ *****************************************************************************/
intf_thread_t* intf_Create( void ) intf_thread_t* intf_Create( void )
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -107,11 +107,11 @@ intf_thread_t* intf_Create( void ) ...@@ -107,11 +107,11 @@ intf_thread_t* intf_Create( void )
return( p_intf ); return( p_intf );
} }
/******************************************************************************* /*****************************************************************************
* intf_Run * intf_Run
******************************************************************************* *****************************************************************************
* Initialization script and main interface loop. * Initialization script and main interface loop.
*******************************************************************************/ *****************************************************************************/
void intf_Run( intf_thread_t *p_intf ) void intf_Run( intf_thread_t *p_intf )
{ {
/* Execute the initialization script - if a positive number is returned, /* Execute the initialization script - if a positive number is returned,
...@@ -149,11 +149,11 @@ void intf_Run( intf_thread_t *p_intf ) ...@@ -149,11 +149,11 @@ void intf_Run( intf_thread_t *p_intf )
} }
} }
/******************************************************************************* /*****************************************************************************
* intf_Destroy: clean interface after main loop * intf_Destroy: clean interface after main loop
******************************************************************************* *****************************************************************************
* This function destroys specific interfaces and close output devices. * This function destroys specific interfaces and close output devices.
*******************************************************************************/ *****************************************************************************/
void intf_Destroy( intf_thread_t *p_intf ) void intf_Destroy( intf_thread_t *p_intf )
{ {
/* Destroy interfaces */ /* Destroy interfaces */
...@@ -167,12 +167,12 @@ void intf_Destroy( intf_thread_t *p_intf ) ...@@ -167,12 +167,12 @@ void intf_Destroy( intf_thread_t *p_intf )
free( p_intf ); free( p_intf );
} }
/******************************************************************************* /*****************************************************************************
* intf_SelectChannel: change channel * intf_SelectChannel: change channel
******************************************************************************* *****************************************************************************
* Kill existing input, if any, and try to open a new one, using an input * Kill existing input, if any, and try to open a new one, using an input
* configuration table. * configuration table.
*******************************************************************************/ *****************************************************************************/
int intf_SelectChannel( intf_thread_t * p_intf, int i_channel ) int intf_SelectChannel( intf_thread_t * p_intf, int i_channel )
{ {
intf_channel_t * p_channel; /* channel */ intf_channel_t * p_channel; /* channel */
...@@ -313,9 +313,9 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key ) ...@@ -313,9 +313,9 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
/* following functions are local */ /* following functions are local */
/******************************************************************************* /*****************************************************************************
* LoadChannels: load channels description from a file * LoadChannels: load channels description from a file
******************************************************************************* *****************************************************************************
* This structe describes all interface-specific data of the main (interface) * This structe describes all interface-specific data of the main (interface)
* thread. * thread.
* Each line of the file is a semicolon separated list of the following * 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 ) ...@@ -329,7 +329,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
* The last field must end with a semicolon. * The last field must end with a semicolon.
* Comments and empty lines are not explicitely allowed, but lines with parsing * Comments and empty lines are not explicitely allowed, but lines with parsing
* errors are ignored without warning. * errors are ignored without warning.
*******************************************************************************/ *****************************************************************************/
static int LoadChannels( intf_thread_t *p_intf, char *psz_filename ) static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
{ {
FILE * p_file; /* file */ FILE * p_file; /* file */
...@@ -391,11 +391,11 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename ) ...@@ -391,11 +391,11 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* UnloadChannels: unload channels description * UnloadChannels: unload channels description
****************************************************************************** *****************************************************************************
* This function free all resources allocated by LoadChannels, if any. * This function free all resources allocated by LoadChannels, if any.
******************************************************************************/ *****************************************************************************/
static void UnloadChannels( intf_thread_t *p_intf ) static void UnloadChannels( intf_thread_t *p_intf )
{ {
int i_channel; /* channel index */ int i_channel; /* channel index */
...@@ -424,11 +424,11 @@ static void UnloadChannels( intf_thread_t *p_intf ) ...@@ -424,11 +424,11 @@ static void UnloadChannels( intf_thread_t *p_intf )
} }
/******************************************************************************* /*****************************************************************************
* ParseChannel: parse a channel description line * ParseChannel: parse a channel description line
******************************************************************************* *****************************************************************************
* See LoadChannels. This function return non 0 on parsing error. * See LoadChannels. This function return non 0 on parsing error.
*******************************************************************************/ *****************************************************************************/
static int ParseChannel( intf_channel_t *p_channel, char *psz_str ) static int ParseChannel( intf_channel_t *p_channel, char *psz_str )
{ {
char * psz_index; /* current character */ char * psz_index; /* current character */
......
/****************************************************************************** /*****************************************************************************
* intf_3dfx.c: 3dfx interface * intf_3dfx.c: 3dfx interface
* (c)2000 VideoLAN * (c)2000 VideoLAN
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Preamble * Preamble
******************************************************************************/ *****************************************************************************/
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> /* stderr */ #include <stdio.h> /* stderr */
...@@ -33,17 +33,17 @@ ...@@ -33,17 +33,17 @@
#include "interface.h" #include "interface.h"
#include "main.h" #include "main.h"
/****************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of 3dfx interface * intf_sys_t: description and status of 3dfx interface
******************************************************************************/ *****************************************************************************/
typedef struct intf_sys_s typedef struct intf_sys_s
{ {
} intf_sys_t; } intf_sys_t;
/****************************************************************************** /*****************************************************************************
* intf_SysCreate: initialize 3dfx interface * intf_SysCreate: initialize 3dfx interface
******************************************************************************/ *****************************************************************************/
int intf_SysCreate( intf_thread_t *p_intf ) int intf_SysCreate( intf_thread_t *p_intf )
{ {
/* Allocate instance and initialize some members */ /* Allocate instance and initialize some members */
...@@ -67,9 +67,9 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -67,9 +67,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
return( 0 ); return( 0 );
} }
/****************************************************************************** /*****************************************************************************
* intf_SysDestroy: destroy 3dfx interface * intf_SysDestroy: destroy 3dfx interface
******************************************************************************/ *****************************************************************************/
void intf_SysDestroy( intf_thread_t *p_intf ) void intf_SysDestroy( intf_thread_t *p_intf )
{ {
/* Close input thread, if any (blocking) */ /* Close input thread, if any (blocking) */
...@@ -89,9 +89,9 @@ void intf_SysDestroy( intf_thread_t *p_intf ) ...@@ -89,9 +89,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
} }
/****************************************************************************** /*****************************************************************************
* intf_SysManage: event loop * intf_SysManage: event loop
******************************************************************************/ *****************************************************************************/
void intf_SysManage( intf_thread_t *p_intf ) void intf_SysManage( intf_thread_t *p_intf )
{ {
unsigned int buf; unsigned int buf;
......
/******************************************************************************* /*****************************************************************************
* intf_cmd.c: interface commands parsing and executions functions * intf_cmd.c: interface commands parsing and executions functions
* (c)1998 VideoLAN * (c)1998 VideoLAN
******************************************************************************* *****************************************************************************
* This file implements the interface commands execution functions. It is used * This file implements the interface commands execution functions. It is used
* by command-line oriented interfaces and scripts. The commands themselves are * by command-line oriented interfaces and scripts. The commands themselves are
* implemented in intf_ctrl. * implemented in intf_ctrl.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -35,9 +35,9 @@ static int CheckCommandArguments ( intf_arg_t argv[INTF_MAX_ARGS], int i_argc ...@@ -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 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 ); static int ConvertArgument ( intf_arg_t *p_arg, int i_flags, char *psz_str );
/******************************************************************************* /*****************************************************************************
* intf_ExecCommand: parse and execute a command * intf_ExecCommand: parse and execute a command
******************************************************************************* *****************************************************************************
* This function is called when a command needs to be executed. It parse the * 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 * 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 * 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_ ...@@ -45,7 +45,7 @@ static int ConvertArgument ( intf_arg_t *p_arg, int i_flags, char *psz_
* function. * function.
* Note that this function may terminate abruptly the program or signify it's * Note that this function may terminate abruptly the program or signify it's
* end to the interface thread. * end to the interface thread.
*******************************************************************************/ *****************************************************************************/
int intf_ExecCommand( char *psz_cmd ) int intf_ExecCommand( char *psz_cmd )
{ {
char * psz_argv[INTF_MAX_ARGS]; /* arguments pointers */ char * psz_argv[INTF_MAX_ARGS]; /* arguments pointers */
...@@ -118,14 +118,14 @@ int intf_ExecCommand( char *psz_cmd ) ...@@ -118,14 +118,14 @@ int intf_ExecCommand( char *psz_cmd )
return( i_return ); return( i_return );
} }
/******************************************************************************* /*****************************************************************************
* intf_ExecScript: parse and execute a command script * intf_ExecScript: parse and execute a command script
******************************************************************************* *****************************************************************************
* This function, based on ExecCommand read a file and tries to execute each * 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 * 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 * number if the script could not be executed and a positive one if an error
* occured during execution. * occured during execution.
*******************************************************************************/ *****************************************************************************/
int intf_ExecScript( char *psz_filename ) int intf_ExecScript( char *psz_filename )
{ {
FILE * p_file; /* file */ FILE * p_file; /* file */
...@@ -176,13 +176,13 @@ int intf_ExecScript( char *psz_filename ) ...@@ -176,13 +176,13 @@ int intf_ExecScript( char *psz_filename )
/* following functions are local */ /* following functions are local */
/******************************************************************************* /*****************************************************************************
* ParseCommandArguments: isolate arguments in a command line * ParseCommandArguments: isolate arguments in a command line
******************************************************************************* *****************************************************************************
* This function modify the original command line, adding '\0' and completes * This function modify the original command line, adding '\0' and completes
* an array of pointers to beginning of arguments. It return the number of * an array of pointers to beginning of arguments. It return the number of
* arguments. * arguments.
*******************************************************************************/ *****************************************************************************/
static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd ) static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd )
{ {
int i_argc; /* number of arguments */ int i_argc; /* number of arguments */
...@@ -223,16 +223,16 @@ static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd ) ...@@ -223,16 +223,16 @@ static int ParseCommandArguments( char *psz_argv[INTF_MAX_ARGS], char *psz_cmd )
return( i_argc ); return( i_argc );
} }
/******************************************************************************* /*****************************************************************************
* CheckCommandArguments: check arguments agains format * CheckCommandArguments: check arguments agains format
******************************************************************************* *****************************************************************************
* This function parse each argument and tries to find a match in the format * This function parse each argument and tries to find a match in the format
* string. It fills the argv array. * string. It fills the argv array.
* If all arguments have been sucessfuly identified and converted, it returns * If all arguments have been sucessfuly identified and converted, it returns
* 0, else, an error message is issued and non 0 is returned. * 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 * Note that no memory is allocated by this function, but that the arguments
* can be modified. * can be modified.
*******************************************************************************/ *****************************************************************************/
static int CheckCommandArguments( intf_arg_t argv[INTF_MAX_ARGS], int i_argc, static int CheckCommandArguments( intf_arg_t argv[INTF_MAX_ARGS], int i_argc,
char *psz_argv[INTF_MAX_ARGS], char *psz_format ) 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, ...@@ -405,13 +405,13 @@ static int CheckCommandArguments( intf_arg_t argv[INTF_MAX_ARGS], int i_argc,
return( 0 ); return( 0 );
} }
/******************************************************************************* /*****************************************************************************
* ConvertArgument: try to convert an argument to a given type * ConvertArgument: try to convert an argument to a given type
******************************************************************************* *****************************************************************************
* This function tries to convert the string argument given in psz_str to * 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, * a type specified in i_flags. It updates p_arg and returns O on success,
* or 1 on error. No error message is issued. * or 1 on error. No error message is issued.
*******************************************************************************/ *****************************************************************************/
static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str ) static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
{ {
char *psz_end; /* end pointer for conversion functions */ 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 ) ...@@ -455,9 +455,9 @@ static int ConvertArgument( intf_arg_t *p_arg, int i_flags, char *psz_str )
return( 0 ); return( 0 );
} }
/******************************************************************************* /*****************************************************************************
* ParseFormatString: parse a format string (ok ?) * ParseFormatString: parse a format string (ok ?)
******************************************************************************* *****************************************************************************
* This function read a format string, as specified in the control_command * This function read a format string, as specified in the control_command
* array, and fill a format array, to allow easier argument identification. * 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 * 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 ) ...@@ -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 * 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 * in a format string, which should be entered by a developper and therefore
* should be correct (TRUST !). * should be correct (TRUST !).
*******************************************************************************/ *****************************************************************************/
static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_format ) static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_format )
{ {
char * psz_index; /* format string index */ char * psz_index; /* format string index */
...@@ -515,7 +515,7 @@ static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_forma ...@@ -515,7 +515,7 @@ static void ParseFormatString( intf_arg_t format[INTF_MAX_ARGS], char *psz_forma
format[i_index].ps_name = psz_start; format[i_index].ps_name = psz_start;
break; break;
#ifdef DEBUG #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); intf_DbgMsg("error: incorrect format string `%s'\n", psz_format);
break; break;
#endif #endif
......
/******************************************************************************* /*****************************************************************************
* intf_console.c: generic console for interface * intf_console.c: generic console for interface
* (c)1998 VideoLAN * (c)1998 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include "config.h" #include "config.h"
/******************************************************************************* /*****************************************************************************
* intf_console_t: console descriptor * intf_console_t: console descriptor
******************************************************************************* *****************************************************************************
* Generic console object. This object will have a representation depending of * Generic console object. This object will have a representation depending of
* the interface. * the interface.
*******************************************************************************/ *****************************************************************************/
typedef struct intf_console_s typedef struct intf_console_s
{ {
/* Text and history arrays - last line/command has indice 0 */ /* Text and history arrays - last line/command has indice 0 */
...@@ -23,16 +23,16 @@ typedef struct intf_console_s ...@@ -23,16 +23,16 @@ typedef struct intf_console_s
char * psz_history[INTF_CONSOLE_MAX_HISTORY]; char * psz_history[INTF_CONSOLE_MAX_HISTORY];
} intf_console_t; } intf_console_t;
/******************************************************************************* /*****************************************************************************
* Local prototypes * Local prototypes
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* intf_ConsoleCreate: create console * intf_ConsoleCreate: create console
******************************************************************************* *****************************************************************************
* This function will initialize the console object. * This function will initialize the console object.
* It returns NULL on error. * It returns NULL on error.
*******************************************************************************/ *****************************************************************************/
intf_console_t *intf_ConsoleCreate( void ) intf_console_t *intf_ConsoleCreate( void )
{ {
intf_console_t *p_console; intf_console_t *p_console;
...@@ -41,42 +41,42 @@ intf_console_t *intf_ConsoleCreate( void ) ...@@ -41,42 +41,42 @@ intf_console_t *intf_ConsoleCreate( void )
return( p_console ); return( p_console );
} }
/******************************************************************************* /*****************************************************************************
* intf_ConsoleDestroy * intf_ConsoleDestroy
******************************************************************************* *****************************************************************************
* Destroy the console instance initialized by intf_ConsoleCreate. * Destroy the console instance initialized by intf_ConsoleCreate.
*******************************************************************************/ *****************************************************************************/
void intf_ConsoleDestroy( intf_console_t *p_console ) void intf_ConsoleDestroy( intf_console_t *p_console )
{ {
free( p_console ); free( p_console );
} }
/******************************************************************************* /*****************************************************************************
* intf_ConsoleClear: clear console * intf_ConsoleClear: clear console
******************************************************************************* *****************************************************************************
* Empty all text. * Empty all text.
*******************************************************************************/ *****************************************************************************/
void intf_ConsoleClear( intf_console_t *p_console ) void intf_ConsoleClear( intf_console_t *p_console )
{ {
//?? //??
} }
/******************************************************************************* /*****************************************************************************
* intf_ConsolePrint: print a message to console * intf_ConsolePrint: print a message to console
******************************************************************************* *****************************************************************************
* Print a message to the console. * Print a message to the console.
*******************************************************************************/ *****************************************************************************/
void intf_ConsolePrint( intf_console_t *p_console, char *psz_str ) void intf_ConsolePrint( intf_console_t *p_console, char *psz_str )
{ {
//?? //??
} }
/******************************************************************************* /*****************************************************************************
* intf_ConsoleExec: execute a command in console * intf_ConsoleExec: execute a command in console
******************************************************************************* *****************************************************************************
* This function will run a command and print its result 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 ) 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 * mtime.c: high rezolution time management functions
* (c)1998 VideoLAN * (c)1998 VideoLAN
****************************************************************************** *****************************************************************************
* Functions are prototyped in mtime.h. * Functions are prototyped in mtime.h.
****************************************************************************** *****************************************************************************
* to-do list: * to-do list:
* see if using Linux real-time extensions is possible and profitable * see if using Linux real-time extensions is possible and profitable
******************************************************************************/ *****************************************************************************/
/****************************************************************************** /*****************************************************************************
* Preamble * Preamble
******************************************************************************/ *****************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
#include "common.h" #include "common.h"
#include "mtime.h" #include "mtime.h"
/****************************************************************************** /*****************************************************************************
* mstrtime: return a date in a readable format * mstrtime: return a date in a readable format
****************************************************************************** *****************************************************************************
* This functions is provided for any interface function which need to print a * 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. psz_buffer should be a buffer long enough to store the formatted
* date. * date.
******************************************************************************/ *****************************************************************************/
char *mstrtime( char *psz_buffer, mtime_t date ) char *mstrtime( char *psz_buffer, mtime_t date )
{ {
sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d", sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d",
...@@ -36,12 +36,12 @@ char *mstrtime( char *psz_buffer, mtime_t date ) ...@@ -36,12 +36,12 @@ char *mstrtime( char *psz_buffer, mtime_t date )
return( psz_buffer ); return( psz_buffer );
} }
/****************************************************************************** /*****************************************************************************
* mdate: return high precision date (inline function) * mdate: return high precision date (inline function)
****************************************************************************** *****************************************************************************
* Uses the gettimeofday() function when possible (1 MHz resolution) or the * Uses the gettimeofday() function when possible (1 MHz resolution) or the
* ftime() function (1 kHz resolution). * ftime() function (1 kHz resolution).
******************************************************************************/ *****************************************************************************/
mtime_t mdate( void ) mtime_t mdate( void )
{ {
struct timeval tv_date; struct timeval tv_date;
...@@ -53,13 +53,13 @@ mtime_t mdate( void ) ...@@ -53,13 +53,13 @@ mtime_t mdate( void )
return( (mtime_t) tv_date.tv_sec * 1000000 + (mtime_t) tv_date.tv_usec ); return( (mtime_t) tv_date.tv_sec * 1000000 + (mtime_t) tv_date.tv_usec );
} }
/****************************************************************************** /*****************************************************************************
* mwait: wait for a date (inline function) * mwait: wait for a date (inline function)
****************************************************************************** *****************************************************************************
* This function uses select() and an system date function to wake up at a * 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 * precise date. It should be used for process synchronization. If current date
* is posterior to wished date, the function returns immediately. * is posterior to wished date, the function returns immediately.
******************************************************************************/ *****************************************************************************/
void mwait( mtime_t date ) void mwait( mtime_t date )
{ {
struct timeval tv_date, tv_delay; struct timeval tv_date, tv_delay;
...@@ -85,11 +85,11 @@ void mwait( mtime_t date ) ...@@ -85,11 +85,11 @@ void mwait( mtime_t date )
#endif #endif
} }
/****************************************************************************** /*****************************************************************************
* msleep: more precise sleep() (inline function) (ok ?) * msleep: more precise sleep() (inline function) (ok ?)
****************************************************************************** *****************************************************************************
* Portable usleep() function. * Portable usleep() function.
******************************************************************************/ *****************************************************************************/
void msleep( mtime_t delay ) void msleep( mtime_t delay )
{ {
#ifndef usleep #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 * video_yuv.c: YUV transformation functions
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Provides functions to perform the YUV conversion. The functions provided here * Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain * are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions. * case by optimized functions.
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
#include "video_yuv.h" #include "video_yuv.h"
#include "intf_msg.h" #include "intf_msg.h"
/******************************************************************************* /*****************************************************************************
* Constants * Constants
*******************************************************************************/ *****************************************************************************/
/* Color masks for different color depths - 8bpp masks can be choosen, since /* Color masks for different color depths - 8bpp masks can be choosen, since
* colormaps instead of hardware-defined colors are used. */ * colormaps instead of hardware-defined colors are used. */
......
/******************************************************************************* /*****************************************************************************
* video_yuv_mmx.S: YUV transformation, optimized for MMX processors * video_yuv_mmx.S: YUV transformation, optimized for MMX processors
* (c)1999 VideoLAN * (c)1999 VideoLAN
******************************************************************************* *****************************************************************************
* Following functions are defined: * Following functions are defined:
* vout_YUV420_16_MMX * vout_YUV420_16_MMX
* This function performs YUV12-to-RGB16 color conversion for H26x. * This function performs YUV12-to-RGB16 color conversion for H26x.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Height may be any amount, but must be a multiple of two. The U * 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 * and V planes may have a different pitch than the Y plane, subject
* to the same limitations. * to the same limitations.
*******************************************************************************/ *****************************************************************************/
//.include iammx.inc //.include iammx.inc
//.include locals.inc //.include locals.inc
......
/******************************************************************************* /*****************************************************************************
* video_fifo.c : video FIFO management * video_fifo.c : video FIFO management
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ *****************************************************************************/
/******************************************************************************* /*****************************************************************************
* Preamble * Preamble
*******************************************************************************/ *****************************************************************************/
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.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