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
......@@ -279,7 +279,7 @@ typedef struct audblk_s
/* Bit allocation pointer results */
u16 fbw_bap[5][256];
//FIXME figure out exactly how many entries there should be (253-37?)
//FIXME figure out exactly how many entries there should be (253-37?)
u16 cpl_bap[256];
u16 lfe_bap[7];
......
This diff is collapsed.
/******************************************************************************
/*****************************************************************************
* audio_decoder.h : audio decoder thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* = Prototyped functions are implemented in audio_decoder/audio_decoder.c
*
* = Required headers :
......@@ -16,7 +16,7 @@
*
* = - MSb = Most Significant bit
* - MSB = Most Significant Byte
******************************************************************************/
*****************************************************************************/
/*
* TODO :
......@@ -28,14 +28,14 @@
#define ADEC_FRAME_SIZE 384
/******************************************************************************
/*****************************************************************************
* adec_frame_t
******************************************************************************/
*****************************************************************************/
typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
/******************************************************************************
/*****************************************************************************
* adec_bank_t
******************************************************************************/
*****************************************************************************/
typedef struct adec_bank_s
{
float v1[512];
......@@ -45,24 +45,24 @@ typedef struct adec_bank_s
} adec_bank_t;
/******************************************************************************
/*****************************************************************************
* adec_thread_t : audio decoder thread descriptor
******************************************************************************
*****************************************************************************
* This type describes an audio decoder thread
******************************************************************************/
*****************************************************************************/
typedef struct adec_thread_s
{
/*
* Thread properties
*/
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
/*
* Input properties
*/
decoder_fifo_t fifo; /* stores the PES stream data */
decoder_fifo_t fifo; /* stores the PES stream data */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
......@@ -75,13 +75,13 @@ typedef struct adec_thread_s
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} adec_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
void adec_DestroyThread ( adec_thread_t * p_adec );
/******************************************************************************
/*****************************************************************************
* audio_dsp.h : header of the dsp functions library
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - "common.h" ( byte_t )
* - "audio_output.h" ( aout_dsp_t )
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int aout_dspOpen ( aout_dsp_t *p_dsp );
int aout_dspReset ( aout_dsp_t *p_dsp );
int aout_dspSetFormat ( aout_dsp_t *p_dsp );
......
/******************************************************************************
/*****************************************************************************
* audio_math.h : PCM and DCT
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
void DCT32(float *x, adec_bank_t *b);
void PCM(adec_bank_t *b, s16 **pcm, int jump);
/******************************************************************************
/*****************************************************************************
* audio_output.h : audio output thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - <sys/soundcard.h> ( audio_buf_info )
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "vlc_thread.h" ( vlc_thread_t )
******************************************************************************/
*****************************************************************************/
/* TODO :
*
......@@ -59,9 +59,9 @@
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).i_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/******************************************************************************
/*****************************************************************************
* aout_dsp_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Path to the audio output device (default is set to "/dev/dsp") */
......@@ -81,13 +81,13 @@ typedef struct
} aout_dsp_t;
/******************************************************************************
/*****************************************************************************
* aout_increment_t
******************************************************************************
*****************************************************************************
* This structure is used to keep the progression of an index up-to-date, in
* order to avoid rounding problems and heavy computations, as the function
* that handles this structure only uses additions.
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* The remainder is used to keep track of the fractional part of the
......@@ -109,9 +109,9 @@ typedef struct
} aout_increment_t;
/******************************************************************************
/*****************************************************************************
* aout_fifo_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* See the fifo types below */
......@@ -155,9 +155,9 @@ typedef struct
#define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4
/******************************************************************************
/*****************************************************************************
* aout_thread_t
******************************************************************************/
*****************************************************************************/
typedef struct aout_thread_s
{
vlc_thread_t thread_id;
......@@ -184,9 +184,9 @@ typedef struct aout_thread_s
} aout_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout, int *pi_status );
......
/*******************************************************************************
/*****************************************************************************
* common.h: common definitions
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* Collection of usefull common types and macros definitions
*******************************************************************************
*****************************************************************************
* required headers:
* config.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Basic types definitions
*******************************************************************************/
*****************************************************************************/
/* Basic types definitions */
typedef signed char s8;
......@@ -23,16 +23,16 @@ typedef unsigned int u32;
typedef unsigned long long u64;
typedef u8 byte_t;
/* Boolean type */
typedef int boolean_t;
/* Counter for statistics and profiling */
typedef unsigned long count_t;
/*******************************************************************************
/*****************************************************************************
* Classes declaration
*******************************************************************************/
*****************************************************************************/
/* Interface */
struct intf_thread_s;
......@@ -76,9 +76,9 @@ typedef struct vdec_thread_s * p_vdec_thread_t;
typedef struct vpar_thread_s * p_vpar_thread_t;
typedef struct video_parser_s * p_video_parser_t;
/*******************************************************************************
/*****************************************************************************
* Macros and inline functions
*******************************************************************************/
*****************************************************************************/
/* CEIL: division with round to nearest greater integer */
#define CEIL(n, d) ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
......@@ -90,7 +90,7 @@ typedef struct video_parser_s * p_video_parser_t;
#define MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
#define MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
/* MSB (big endian)/LSB (little endian) convertions - network order is always
/* MSB (big endian)/LSB (little endian) convertions - network order is always
* MSB, and should be used for both network communications and files. Note that
* byte orders other than little and big endians are not supported, but only
* the VAX seems to have such exotic properties - note that these 'functions'
......@@ -101,13 +101,13 @@ typedef struct video_parser_s * p_video_parser_t;
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
#define ntoh16 ntohs
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64 hton64
#elif __BYTE_ORDER == __BIG_ENDIAN
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( i )
#define hton64(i) ( i )
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64(i) ( i )
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* control.h: user control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************
*****************************************************************************
* Required headers:
* <sys/uio.h>
* <X11/Xlib.h>
......@@ -19,14 +19,14 @@
* "video_output.h"
* "xconsole.h"
* "interface.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_SelectAudioStream ( intf_thread_t *p_intf, int i_input, int i_id );
void intf_DeselectAudioStream( intf_thread_t *p_intf, int i_input, int i_id );
int intf_SelectVideoStream ( intf_thread_t *p_intf, int i_input,
int intf_SelectVideoStream ( intf_thread_t *p_intf, int i_input,
int i_vout, int i_id );
void intf_DeselectVideoStream( intf_thread_t *p_intf, int i_input, int i_id );
......
/*******************************************************************************
/*****************************************************************************
* debug.h: vlc debug macros
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Stand alone file
*******************************************************************************
*****************************************************************************
* Required headers:
* - <string.h>
* - intf_msg.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* ASSERT
*******************************************************************************
*****************************************************************************
* This macro is used to test that a pointer is not nul. It insert the needed
* code when the program is compiled with the debug option, but does nothing
* in release program.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define ASSERT(p_Mem) \
if (!(p_Mem)) \
......@@ -27,15 +27,15 @@ if (!(p_Mem)) \
#define ASSERT(p_Mem)
#endif
/*******************************************************************************
/*****************************************************************************
* RZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initialise a variable to 0. It is very useful when
* used with the ASSERT macro. It also only insert the needed code when the
* program is compiled with the debug option.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define RZERO(r_Var) \
bzero(&(r_Var), sizeof((r_Var)));
......@@ -46,12 +46,12 @@ bzero(&(r_Var), sizeof((r_Var)));
#endif
/*******************************************************************************
/*****************************************************************************
* PZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initiase the memory pointed out by a pointer to 0.
* It has the same purpose than RZERO, but for pointers.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define PZERO(p_Mem) \
bzero((p_Mem), sizeof(*(p_Mem)));
......@@ -62,12 +62,12 @@ bzero((p_Mem), sizeof(*(p_Mem)));
#endif
/*******************************************************************************
/*****************************************************************************
* AZERO
*******************************************************************************
*****************************************************************************
* This macro is used to initiase an array of variables to 0.
* It has the same purpose than RZERO or PZERO, but for array
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
#define AZERO(p_Array, i_Size) \
bzero((p_Array), (i_Size)*sizeof(*(p_Array)));
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* generic_decoder.h : generic decoder thread
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
......@@ -10,75 +10,75 @@
* "input.h"
* "decoder_fifo.h"
* ??
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* gdec_cfg_t: generic decoder configuration structure
*******************************************************************************
*****************************************************************************
* This structure is passed as an initializer when a generic decoder thread is
* created.
*******************************************************************************/
*****************************************************************************/
typedef struct gdec_cfg_s
{
u64 i_properties;
int i_actions; /* decoder actions */
char * psz_base_filename; /* base demux file name */
int i_actions; /* decoder actions */
char * psz_base_filename; /* base demux file name */
} gdec_cfg_t;
/* Properties flags */
#define GDEC_CFG_ACTIONS (1 << 0)
#define GDEC_CFG_FILENAME (1 << 1)
/*******************************************************************************
/*****************************************************************************
* gdec_thread_t: generic decoder thread descriptor
*******************************************************************************
*****************************************************************************
* This type describes a generic decoder thread.
*******************************************************************************/
*****************************************************************************/
typedef struct gdec_thread_s
{
/* Thread properties and locks */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */
vlc_thread_t thread_id; /* id for thread functions */
/* Thread configuration */
int i_actions; /* decoder actions */
int i_actions; /* decoder actions */
/* Input properties */
input_thread_t * p_input; /* input thread */
decoder_fifo_t fifo; /* PES input fifo */
input_thread_t * p_input; /* input thread */
decoder_fifo_t fifo; /* PES input fifo */
/* ?? status info */
int * pi_status;
/* Files array - these files are used to extract ES streams from a
/* Files array - these files are used to extract ES streams from a
* demultiplexed stream */
/* ?? */
#ifdef STATS
/* Statistics */
count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */
count_t c_pes; /* number of PES packets read */
count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */
count_t c_pes; /* number of PES packets read */
#endif
} gdec_thread_t;
/* Decoder actions - this flags select which actions the decoder will perform
* when it receives a PES packet */
#define GDEC_IDENTIFY (1 << 0) /* update input's ES tables */
#define GDEC_SAVE (1 << 1) /* save all PES to a same file */
#define GDEC_SAVE_DEMUX (1 << 2) /* save PES to files by stream id */
#define GDEC_PRINT (1 << 3) /* print PES informations */
#define GDEC_IDENTIFY (1 << 0) /* update input's ES tables */
#define GDEC_SAVE (1 << 1) /* save all PES to a same file */
#define GDEC_SAVE_DEMUX (1 << 2) /* save PES to files by stream id */
#define GDEC_PRINT (1 << 3) /* print PES informations */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
/* Thread management functions */
gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg,
gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg,
input_thread_t *p_input, int *pi_status );
void gdec_DestroyThread ( gdec_thread_t *p_gdec, int *pi_status );
......
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* input_ctrl.h: Decodeur control
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_pid );
int input_DelPgrmElem( input_thread_t *p_input, int i_current_pid );
boolean_t input_IsElemRecv( input_thread_t *p_input, int i_pid );
/*******************************************************************************
/*****************************************************************************
* input_file.h: file streams functions interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_FileOpen ( input_thread_t *p_input );
int input_FileRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count );
......
/*******************************************************************************
/*****************************************************************************
* input_netlist.h: netlist interface
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* The netlists are an essential part of the input structure. We maintain a
* list of free TS packets and free PES packets to avoid continuous malloc
* and free.
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_NetlistInit ( input_thread_t *p_input );
void input_NetlistEnd ( input_thread_t *p_input );
......@@ -17,13 +17,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input, pes_packet
static __inline__ void input_NetlistFreeTS( input_thread_t *p_input, ts_packet_t *p_ts_packet );
static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input );
/******************************************************************************
/*****************************************************************************
* input_NetlistFreePES: add a PES packet to the netlist
*******************************************************************************
*****************************************************************************
* Add a PES packet to the PES netlist, so that the packet can immediately be
* reused by the demultiplexer. We put this function directly in the .h file,
* because it is very frequently called.
*******************************************************************************/
*****************************************************************************/
static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
pes_packet_t *p_pes_packet )
{
......@@ -53,7 +53,7 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
#endif
p_ts_packet = p_ts_packet->p_next_ts;
}
/* Free the PES structure. */
#ifdef INPUT_LIFO_PES_NETLIST
p_input->netlist.i_pes_index--;
......@@ -67,13 +67,13 @@ static __inline__ void input_NetlistFreePES( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock );
}
/*******************************************************************************
/*****************************************************************************
* input_NetlistFreeTS: add a TS packet to the netlist
*******************************************************************************
*****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be
* reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES.
*******************************************************************************/
*****************************************************************************/
static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
ts_packet_t *p_ts_packet )
{
......@@ -95,19 +95,19 @@ static __inline__ void input_NetlistFreeTS( input_thread_t *p_input,
vlc_mutex_unlock( &p_input->netlist.lock );
}
/*******************************************************************************
/*****************************************************************************
* input_NetlistGetPES: remove a PES packet from the netlist
*******************************************************************************
*****************************************************************************
* Add a TS packet to the TS netlist, so that the packet can immediately be
* reused by the demultiplexer. Shouldn't be called by other threads (they
* should only use input_FreePES.
*******************************************************************************/
*****************************************************************************/
static __inline__ pes_packet_t* input_NetlistGetPES( input_thread_t *p_input )
{
pes_packet_t * p_pes_packet;
#ifdef INPUT_LIFO_PES_NETLIST
/* i_pes_index might be accessed by a decoder thread to give back a
/* i_pes_index might be accessed by a decoder thread to give back a
* packet. */
vlc_mutex_lock( &p_input->netlist.lock );
......
/*******************************************************************************
/*****************************************************************************
* input_network.h: network functions interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_NetworkOpen ( input_thread_t *p_input );
int input_NetworkRead ( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count );
......
/*******************************************************************************
/*****************************************************************************
* input_pcr.h: PCR management interface
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/* Maximum number of samples used to compute the dynamic average value,
* it is also the maximum of c_average in the pcr_descriptor_struct.
......@@ -17,10 +17,10 @@
#define SYNCHRO_START 2
#define SYNCHRO_REINIT 3
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_PcrInit ( input_thread_t *p_input );
void input_PcrDecode ( input_thread_t *p_input, es_descriptor_t* p_es,
void input_PcrDecode ( input_thread_t *p_input, es_descriptor_t* p_es,
u8* p_pcr_data );
void input_PcrEnd ( input_thread_t *p_input );
/*******************************************************************************
/*****************************************************************************
* psi.h: PSI management interface
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int input_PsiInit ( input_thread_t *p_input );
void input_PsiDecode ( input_thread_t *p_input, psi_section_t* p_psi_section );
void input_PsiRead ( input_thread_t *p_input );
......
/*******************************************************************************
/*****************************************************************************
* input_vlan.h: vlan input method
* (c)1999 VideoLAN
*******************************************************************************
* ??
*******************************************************************************
*****************************************************************************
* ??
*****************************************************************************
* Required headers:
* <netinet/in.h>
* "vlc_thread.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int input_VlanCreate ( void );
void input_VlanDestroy ( void );
int input_VlanJoin ( int i_vlan_id );
......
/******************************************************************************
/*****************************************************************************
* interface.h: interface access for other threads
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* This library provides basic functions for threads to interact with user
* interface, such as message output.
******************************************************************************
*****************************************************************************
* Required headers:
* <sys/uio.h>
* <X11/Xlib.h>
......@@ -18,33 +18,33 @@
* "video_output.h"
* "audio_output.h"
* "xconsole.h"
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* intf_thread_t: describe an interface thread
******************************************************************************
*****************************************************************************
* This structe describes all interface-specific data of the main (interface)
* thread.
******************************************************************************/
*****************************************************************************/
typedef struct intf_thread_s
{
boolean_t b_die; /* `die' flag */
boolean_t b_die; /* `die' flag */
/* Specific interfaces */
p_intf_console_t p_console; /* console */
p_intf_sys_t p_sys; /* system interface */
/* Specific interfaces */
p_intf_console_t p_console; /* console */
p_intf_sys_t p_sys; /* system interface */
/* Channels array - NULL if not used */
p_intf_channel_t p_channel; /* description of channels */
p_intf_channel_t p_channel; /* description of channels */
/* Main threads - NULL if not active */
p_vout_thread_t p_vout;
p_input_thread_t p_input;
p_input_thread_t p_input;
} intf_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
intf_thread_t * intf_Create ( void );
void intf_Run ( intf_thread_t * p_intf );
void intf_Destroy ( intf_thread_t * p_intf );
......
/*******************************************************************************
/*****************************************************************************
* intf_cmd.h: interface commands parsing and executions functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This file implements the interface commands execution functions. It is used
* by command-line oriented interfaces and scripts. The commands themselves are
* implemented in intf_ctrl.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* intf_arg_t: control fonction argument descriptor
*******************************************************************************
*****************************************************************************
* This structure is used to control an argument type and to transmit
* arguments to control functions. It is also used to parse format string and
* build an easier to use array of arguments.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Argument type */
int i_flags; /* argument type and flags */
int i_index; /* index of mask in format string */
int i_flags; /* argument type and flags */
int i_index; /* index of mask in format string */
/* Converted arguments value */
char * psz_str; /* string value */
char * ps_name; /* name, can be '\0' or '=' terminated */
long i_num; /* integer value */
float f_num; /* float value */
char * psz_str; /* string value */
char * ps_name; /* name, can be '\0' or '=' terminated */
long i_num; /* integer value */
float f_num; /* float value */
} intf_arg_t;
/* Arguments flags */
#define INTF_STR_ARG 1 /* string argument */
#define INTF_INT_ARG 2 /* integer argument */
#define INTF_FLOAT_ARG 4 /* float argument */
#define INTF_NAMED_ARG 16 /* named argument */
#define INTF_OPT_ARG 256 /* optionnal argument */
#define INTF_REP_ARG 512 /* argument can be repeated */
#define INTF_PRESENT_ARG 1024 /* argument has been encountered */
#define INTF_STR_ARG 1 /* string argument */
#define INTF_INT_ARG 2 /* integer argument */
#define INTF_FLOAT_ARG 4 /* float argument */
#define INTF_NAMED_ARG 16 /* named argument */
#define INTF_OPT_ARG 256 /* optionnal argument */
#define INTF_REP_ARG 512 /* argument can be repeated */
#define INTF_PRESENT_ARG 1024 /* argument has been encountered */
/*******************************************************************************
/*****************************************************************************
* intf_command_t: control command descriptor
*******************************************************************************
*****************************************************************************
* This structure describes a control commands. It stores informations needed
* for argument type checking, command execution but also a short inline help.
* See control.c for more informations about fields.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Function control */
char * psz_name; /* command name */
int (* function)( int i_argc, intf_arg_t *p_argv ); /* function */
char * psz_format; /* arguments format */
char * psz_name; /* command name */
int (* function)( int i_argc, intf_arg_t *p_argv ); /* function */
char * psz_format; /* arguments format */
/* Function informations */
char * psz_summary; /* info text */
char * psz_usage; /* usage text */
char * psz_help; /* help text */
char * psz_summary; /* info text */
char * psz_usage; /* usage text */
char * psz_help; /* help text */
} intf_command_t;
/*******************************************************************************
/*****************************************************************************
* Error constants
*******************************************************************************
*****************************************************************************
* These errors should be used as return values for control functions (see
* control.c). The intf_ExecCommand function as different behaviour depending
* of the error it received. Other errors numbers can be used, but their valued
* should be positive to avoid conflict with future error codes.
*******************************************************************************/
*****************************************************************************/
#define INTF_NO_ERROR 0 /* success */
#define INTF_FATAL_ERROR -1 /* fatal error: the program will end */
#define INTF_CRITICAL_ERROR -2 /* critical error: the program will exit */
#define INTF_NO_ERROR 0 /* success */
#define INTF_FATAL_ERROR -1 /* fatal error: the program will end */
#define INTF_CRITICAL_ERROR -2 /* critical error: the program will exit */
#define INTF_USAGE_ERROR -3 /* usage error: command usage will be displayed */
#define INTF_OTHER_ERROR -4 /* other error: command prints its own message */
#define INTF_OTHER_ERROR -4/* other error: command prints its own message */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_ExecCommand ( char *psz_cmd );
int intf_ExecScript ( char *psz_filename );
/*******************************************************************************
/*****************************************************************************
* intf_console.h: generic console methods for interface
* (c)1998 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
p_intf_console_t intf_ConsoleCreate ( void );
void intf_ConsoleDestroy ( p_intf_console_t p_console );
......
/*******************************************************************************
/*****************************************************************************
* intf_ctrl.h: interface commands access to control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all interfaces, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Extern variables
*******************************************************************************/
*****************************************************************************/
extern const intf_command_t control_command[];
/*******************************************************************************
/*****************************************************************************
* intf_msg.h: messages interface
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This library provides basic functions for threads to interact with user
* interface, such as message output. See config.h for output configuration.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* intf_DbgMsg macros and functions
*******************************************************************************
* The intf_DbgMsg* functions are defined as macro to be able to use the
*****************************************************************************
* The intf_DbgMsg* functions are defined as macro to be able to use the
* compiler extensions and print the file, the function and the line number
* from which they have been called. They call _intf_DbgMsg*() functions after
* having added debugging informations.
* Outside DEBUG mode, intf_DbgMsg* functions do nothing.
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
/* DEBUG mode */
void _intf_DbgMsg ( char *psz_file, char *psz_function, int i_line,
void _intf_DbgMsg ( char *psz_file, char *psz_function, int i_line,
char *psz_format, ... );
void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
char *psz_format, ... );
......@@ -31,18 +31,18 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
#else
/* Non-DEBUG mode */
#define intf_DbgMsg( format, args... )
#define intf_DbgMsgImm( format, args...)
#define intf_DbgMsg( format, args... )
#define intf_DbgMsgImm( format, args...)
#endif
/*******************************************************************************
/*****************************************************************************
* intf_FlushMsg macro and function
*******************************************************************************
*****************************************************************************
* intf_FlushMsg is a function which flushs message queue and print all messages
* remaining. It is only usefull if INTF_MSG_QUEUE is defined. In this case, it
* is really a function. In the other case, it is a macro doing nothing.
*******************************************************************************/
*****************************************************************************/
#ifdef INTF_MSG_QUEUE
/* Message queue mode */
......@@ -55,9 +55,9 @@ void intf_FlushMsg ( void );
#endif
/*******************************************************************************
* Prototypes
*******************************************************************************/
/*****************************************************************************
* Prototypes
*****************************************************************************/
p_intf_msg_t intf_MsgCreate ( void );
void intf_MsgDestroy ( void );
......
/*******************************************************************************
/*****************************************************************************
* intf_sys.h: system dependant interface API
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int intf_SysCreate ( p_intf_thread_t p_intf );
void intf_SysDestroy( p_intf_thread_t p_intf );
void intf_SysManage ( p_intf_thread_t p_intf );
/*******************************************************************************
/*****************************************************************************
* main.h: access to all program variables
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Declaration and extern access to global program object.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* main_t, p_main (global variable)
*******************************************************************************
*****************************************************************************
* This structure has an unique instance, declared in main and pointed by the
* only global variable of the program. It should allow access to any variable
* of the program, for user-interface purposes or more easier call of interface
* and common functions (example: the intf_*Msg functions). Please avoid using
* it when you can access the members you need in an other way. In fact, it
* should only be used by interface thread.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Global properties */
int i_argc; /* command line arguments count */
char ** ppsz_argv; /* command line arguments */
char ** ppsz_env; /* environment variables */
int i_argc; /* command line arguments count */
char ** ppsz_argv; /* command line arguments */
char ** ppsz_env; /* environment variables */
/* Generic settings */
boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */
boolean_t b_vlans; /* are vlans supported ? */
boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */
boolean_t b_vlans; /* are vlans supported ? */
/* Unique threads */
p_aout_thread_t p_aout; /* audio output thread */
p_intf_thread_t p_intf; /* main interface thread */
p_aout_thread_t p_aout; /* audio output thread */
p_intf_thread_t p_intf; /* main interface thread */
/* Shared data - these structures are accessed directly from p_main by
* several modules */
p_intf_msg_t p_msg; /* messages interface data */
p_input_vlan_t p_vlan; /* vlan library data */
p_intf_msg_t p_msg; /* messages interface data */
p_input_vlan_t p_vlan; /* vlan library data */
} main_t;
extern main_t *p_main;
/*******************************************************************************
/*****************************************************************************
* Prototypes - these methods are used to get default values for some threads
* and modules.
*******************************************************************************/
*****************************************************************************/
int main_GetIntVariable( char *psz_name, int i_default );
char * main_GetPszVariable( char *psz_name, char *psz_default );
void main_PutIntVariable( char *psz_name, int i_value );
......
/*******************************************************************************
/*****************************************************************************
* mtime.h: high rezolution time management functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header provides portable high precision time management functions,
* which should be the only ones used in other segments of the program, since
* functions like gettimeofday() and ftime() are not always supported.
......@@ -9,46 +9,46 @@
* interfaces to system calls and have to be called frequently.
* 'm' stands for 'micro', since maximum resolution is the microsecond.
* Functions prototyped are implemented in interface/mtime.c.
*******************************************************************************
*****************************************************************************
* Required headers:
* none
* this header includes inline functions
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* mtime_t: high precision date or time interval
*******************************************************************************
*****************************************************************************
* Store an high precision date or time interval. The maximum precision is the
* micro-second, and a 64 bits integer is used to avoid any overflow (maximum
* time interval is then 292271 years, which should be length enough for any
* video). Date are stored as a time interval since a common date.
* Note that date and time intervals can be manipulated using regular arithmetic
* operators, and that no special functions are required.
*******************************************************************************/
*****************************************************************************/
typedef s64 mtime_t;
/*******************************************************************************
/*****************************************************************************
* LAST_MDATE: date which will never happen
*******************************************************************************
*****************************************************************************
* This date can be used as a 'never' date, to mark missing events in a function
* supposed to return a date, such as nothing to display in a function
* returning the date of the first image to be displayed. It can be used in
* comparaison with other values: all existing dates will be earlier.
*******************************************************************************/
*****************************************************************************/
#define LAST_MDATE ((mtime_t)((u64)(-1)/2))
/*******************************************************************************
/*****************************************************************************
* MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
*******************************************************************************
*****************************************************************************
* This values is the maximal possible size of the string returned by the
* mstrtime() function, including '-' and the final '\0'. It should be used to
* allocate the buffer.
*******************************************************************************/
*****************************************************************************/
#define MSTRTIME_MAX_SIZE 22
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
char * mstrtime ( char *psz_buffer, mtime_t date );
mtime_t mdate ( void );
void mwait ( mtime_t date );
......
/*******************************************************************************
/*****************************************************************************
* netutils.h: various network functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This header describe miscellanous utility functions shared between several
* modules.
*******************************************************************************
*****************************************************************************
* Required headers:
* <netinet/in.h>
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* if_descr_t: describes a network interface.
*******************************************************************************
*****************************************************************************
* Note that if the interface is a point to point one, the broadcast address is
* set to the destination address of that interface
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Interface device name (e.g. "eth0") */
char* psz_ifname;
/* Interface physical address */
struct sockaddr sa_phys_addr;
struct sockaddr sa_phys_addr;
/* Interface network address */
struct sockaddr_in sa_net_addr;
/* Interface broadcast address */
......@@ -31,11 +31,11 @@ typedef struct
} if_descr_t;
/*******************************************************************************
/*****************************************************************************
* net_descr_t: describes all the interfaces of the computer
*******************************************************************************
*****************************************************************************
* Nothing special to say :)
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Number of networks interfaces described below */
......@@ -45,9 +45,9 @@ typedef struct
} net_descr_t;
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int ReadIfConf (int i_sockfd, if_descr_t* p_ifdescr, char* psz_name);
int ReadNetConf (int i_sockfd, net_descr_t* p_net_descr);
int BuildInetAddr ( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port );
......
/*******************************************************************************
/*****************************************************************************
* rsc_files.h: resources files manipulation functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* This library describe a general format used to store 'resources'. Resources
* can be anything, including pictures, audio streams, and so on.
*******************************************************************************
*****************************************************************************
* Requires:
* config.h
* common.h
*******************************************************************************/
* common.h
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* 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 */
#define RESOURCE_MAX_NAME 32
/*******************************************************************************
/*****************************************************************************
* resource_descriptor_t: resource descriptor
*******************************************************************************
*****************************************************************************
* This type describe an entry in the resource table.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
u16 i_type; /* type */
u64 i_offset; /* data offset */
u64 i_size; /* data size */
char psz_name[RESOURCE_MAX_NAME + 1]; /* name */
u16 i_type; /* type */
u64 i_offset; /* data offset */
u64 i_size; /* data size */
} resource_descriptor_t;
/* Resources types */
#define EMPTY_RESOURCE 0 /* empty place in table */
#define PICTURE_RESOURCE 10 /* native video picture */
#define EMPTY_RESOURCE 0 /* empty place in table */
#define PICTURE_RESOURCE 10 /* native video picture */
/*******************************************************************************
/*****************************************************************************
* resource_file_t: resource file descriptor
*******************************************************************************
*****************************************************************************
* This type describes a resource file and store it's resources table. It can
* be used through the *Resource functions, or directly with the i_file field.
*******************************************************************************/
*****************************************************************************/
typedef struct
{
/* File informations */
int i_file; /* file descriptor */
int i_type; /* file type */
boolean_t b_up_to_date; /* is file up to date ? */
boolean_t b_read_only; /* read-only mode */
int i_file; /* file descriptor */
int i_type; /* file type */
boolean_t b_up_to_date; /* is file up to date ? */
boolean_t b_read_only; /* read-only mode */
/* Resources table */
int i_size; /* table size */
resource_descriptor_t * p_resource; /* resources table */
int i_size; /* table size */
resource_descriptor_t * p_resource; /* resources table */
} resource_file_t;
/* Resources files types */
#define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
#define VLC_RESOURCE_FILE 0 /* VideoLAN Client resource file */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
resource_file_t * CreateResourceFile ( char *psz_filename, int i_type, int i_size, int i_mode );
resource_file_t * OpenResourceFile ( char *psz_filename, int i_type, int i_flags );
int UpdateResourceFile ( resource_file_t *p_file );
......@@ -68,6 +68,6 @@ int CloseResourceFile ( resource_file_t *p_file );
int SeekResource ( resource_file_t *p_file, char *psz_name, int i_type );
int ReadResource ( resource_file_t *p_file, char *psz_name, int i_type,
size_t max_size, byte_t *p_data );
int WriteResource ( resource_file_t *p_file, char *psz_name, int i_type,
int WriteResource ( resource_file_t *p_file, char *psz_name, int i_type,
size_t size, byte_t *p_data );
/******************************************************************************
/*****************************************************************************
* spu_decoder.h : sub picture unit decoder thread interface
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* spudec_thread_t : sub picture unit decoder thread descriptor
******************************************************************************/
*****************************************************************************/
typedef struct spudec_thread_s
{
/*
* Thread properties and locks
*/
boolean_t b_die; /* `die' flag */
boolean_t b_run; /* `run' flag */
boolean_t b_active; /* `active' flag */
boolean_t b_error; /* `error' flag */
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_run; /* `run' flag */
boolean_t b_active; /* `active' flag */
boolean_t b_error; /* `error' flag */
vlc_thread_t thread_id; /* id for thread functions */
/*
* Input properties
*/
decoder_fifo_t fifo; /* stores the PES stream data */
decoder_fifo_t fifo; /* stores the PES stream data */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
......@@ -32,9 +32,9 @@ typedef struct spudec_thread_s
} spudec_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
spudec_thread_t * spudec_CreateThread( input_thread_t * p_input );
void spudec_DestroyThread( spudec_thread_t * p_spudec );
......@@ -12,7 +12,7 @@
/*****************************************************************************
* Common declarations
*****************************************************************************/
*****************************************************************************/
#ifndef VDEC_DFT
typedef short dctelem_t;
......@@ -87,7 +87,7 @@ struct vdec_thread_s;
*/
#define CONST_BITS 8 /* Jimmy chose this constant :) */
#ifdef EIGHT_BIT_SAMPLES
#define PASS1_BITS 2
#else
......
......@@ -10,7 +10,7 @@
* "video_parser.h"
* "undec_picture.h"
*****************************************************************************/
/*****************************************************************************
* Function pointers
*****************************************************************************/
......
This diff is collapsed.
......@@ -56,7 +56,7 @@ typedef struct vdec_thread_s
u8 * pi_crop;
//#endif
#endif
#ifdef STATS
/* Statistics */
count_t c_loops; /* number of loops */
......@@ -65,7 +65,7 @@ typedef struct vdec_thread_s
count_t c_pictures; /* number of pictures read */
count_t c_i_pictures; /* number of I pictures read */
count_t c_p_pictures; /* number of P pictures read */
count_t c_b_pictures; /* number of B pictures read */
count_t c_b_pictures; /* number of B pictures read */
#endif
count_t c_decoded_pictures; /* number of pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
......
......@@ -18,11 +18,11 @@
#ifdef VDEC_SMP
/* ?? move to inline functions */
#define VIDEO_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end )
#define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start ) \
#define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start )\
& VFIFO_SIZE ) == 0 )
#define VIDEO_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] )
#define VIDEO_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1) \
& VFIFO_SIZE )
& VFIFO_SIZE )
#define VIDEO_FIFO_END( fifo ) ( (fifo).buffer[ (fifo).i_end ] )
#define VIDEO_FIFO_INCEND( fifo ) ( (fifo).i_end = ((fifo).i_end + 1) \
& VFIFO_SIZE )
......@@ -46,12 +46,12 @@ static __inline__ macroblock_t * vpar_GetMacroblock( video_fifo_t * p_fifo )
return( NULL );
}
}
p_mb = VIDEO_FIFO_START( *p_fifo );
VIDEO_FIFO_INCSTART( *p_fifo );
vlc_mutex_unlock( &p_fifo->lock );
return( p_mb );
#else
/* Shouldn't normally be used without SMP. */
......@@ -101,7 +101,7 @@ static __inline__ void vpar_DecodeMacroblock( video_fifo_t * p_fifo,
#ifdef VDEC_SMP
/* Place picture in the video FIFO */
vlc_mutex_lock( &p_fifo->lock );
/* By construction, the video FIFO cannot be full */
VIDEO_FIFO_END( *p_fifo ) = p_mb;
VIDEO_FIFO_INCEND( *p_fifo );
......@@ -136,7 +136,7 @@ static __inline__ void vpar_ReleaseMacroblock( video_fifo_t * p_fifo,
/* Warn Synchro for its records. */
vpar_SynchroEnd( p_fifo->p_vpar );
/* Unlink referenced pictures */
if( p_mb->p_forward != NULL )
{
......
/*******************************************************************************
/*****************************************************************************
* video_graphics.h: pictures manipulation primitives
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Includes function to compose, convert and display pictures, and also basic
* functions to copy pictures data or descriptors.
*******************************************************************************
* functions to copy pictures data or descriptors.
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
* "video.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
This diff is collapsed.
......@@ -75,7 +75,7 @@ typedef struct vpar_thread_s
/* ?? */
/*??*/
// int *pi_status;
/* Input properties */
decoder_fifo_t fifo; /* PES input fifo */
......@@ -85,7 +85,7 @@ typedef struct vpar_thread_s
/* Output properties */
vout_thread_t * p_vout; /* video output thread */
/* Decoder properties */
struct vdec_thread_s * pp_vdec[NB_VDEC];
video_fifo_t vfifo;
......
/*******************************************************************************
/*****************************************************************************
* video_sys.h: system dependant video output display method API
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window );
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
......
/*******************************************************************************
/*****************************************************************************
* video_text.h : text manipulation functions
* (c)1999 VideoLAN
*******************************************************************************/
*****************************************************************************/
/* Text styles - these are primary text styles, used by the vout_Print function.
* They may be ignored or interpreted by higher level functions */
#define WIDE_TEXT 1 /* interspacing is doubled */
#define ITALIC_TEXT 2 /* italic */
#define OPAQUE_TEXT 4 /* text with background */
#define OUTLINED_TEXT 8 /* border around letters */
#define VOID_TEXT 16 /* no foreground */
#define WIDE_TEXT 1 /* interspacing is doubled */
#define ITALIC_TEXT 2 /* italic */
#define OPAQUE_TEXT 4 /* text with background */
#define OUTLINED_TEXT 8 /* border around letters */
#define VOID_TEXT 16 /* no foreground */
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
p_vout_font_t vout_LoadFont ( const char *psz_name );
void vout_UnloadFont ( p_vout_font_t p_font );
void vout_TextSize ( p_vout_font_t p_font, int i_style,
void vout_TextSize ( p_vout_font_t p_font, int i_style,
const char *psz_text,
int *pi_width, int *pi_height );
void vout_Print ( p_vout_font_t p_font, byte_t *p_pic,
void vout_Print ( p_vout_font_t p_font, byte_t *p_pic,
int i_bytes_per_pixel, int i_bytes_per_line,
u32 i_char_color, u32 i_border_color, u32 i_bg_color,
int i_style, const char *psz_text );
......
/*******************************************************************************
/*****************************************************************************
* video_x11.h: X11 video output display method
* (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.
*******************************************************************************
*****************************************************************************
* Required headers:
* <X11/Xlib.h>
* <X11/Xutil.h>
......@@ -14,59 +14,59 @@
* "mtime.h"
* "video.h"
* "video_output.h"
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* vout_x11_t: video output X11 method descriptor
*******************************************************************************
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the X11 specific properties of an output thread. X11 video
* It describes the X11 specific properties of an output thread. X11 video
* output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams.
*******************************************************************************/
*****************************************************************************/
typedef struct vout_x11_s
{
/* User settings */
boolean_t b_shm_ext; /* shared memory extension flag */
boolean_t b_shm_ext; /* shared memory extension flag */
/* Thread configuration - these properties are copied from a video_cfg_t
/* Thread configuration - these properties are copied from a video_cfg_t
* structure to be used in second step of initialization */
char * psz_display; /* display name */
char * psz_title; /* window title */
char * psz_display; /* display name */
char * psz_title; /* window title */
/* Internal settings and properties */
Display * p_display; /* display pointer */
int i_screen; /* screen number */
Window window; /* window instance handler */
GC gc; /* graphic context instance handler */
Display * p_display; /* display pointer */
int i_screen; /* screen number */
Window window; /* window instance handler */
GC gc; /* graphic context instance handler */
/* Window manager hints and atoms */
Atom wm_protocols; /* WM_PROTOCOLS atom */
Atom wm_delete_window; /* WM_DELETE_WINDOW atom */
Atom wm_protocols; /* WM_PROTOCOLS atom */
Atom wm_delete_window; /* WM_DELETE_WINDOW atom */
/* Color maps and translation tables - some of those tables are shifted,
* see x11.c for more informations. */
u8 * trans_16bpp_red; /* red (16 bpp) (SHIFTED !) */
u8 * trans_16bpp_green; /* green (16 bpp) (SHIFTED !) */
u8 * trans_16bpp_blue; /* blue (16 bpp) (SHIFTED !) */
u8 * trans_16bpp_red; /* red (16 bpp) (SHIFTED !) */
u8 * trans_16bpp_green; /* green (16 bpp) (SHIFTED !) */
u8 * trans_16bpp_blue; /* blue (16 bpp) (SHIFTED !) */
/* ?? colormaps ? */
boolean_t b_private_colormap; /* private color map flag */
Colormap private_colormap; /* private color map */
boolean_t b_private_colormap; /* private color map flag */
Colormap private_colormap; /* private color map */
/* Display buffers and shared memory information */
int i_buffer_index; /* buffer index */
XImage * p_ximage[2]; /* XImage pointer */
XShmSegmentInfo shm_info[2]; /* shared memory zone information */
int i_buffer_index; /* buffer index */
XImage * p_ximage[2]; /* XImage pointer */
XShmSegmentInfo shm_info[2]; /* shared memory zone information */
int i_completion_type; /* ?? */
int i_completion_type; /* ?? */
} vout_x11_t;
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_X11AllocOutputMethod ( vout_thread_t *p_vout, video_cfg_t *p_cfg );
void vout_X11FreeOutputMethod ( vout_thread_t *p_vout );
void vout_X11FreeOutputMethod ( vout_thread_t *p_vout );
int vout_X11CreateOutputMethod ( vout_thread_t *p_vout );
void vout_X11DestroyOutputMethod ( vout_thread_t *p_vout );
int vout_X11ManageOutputMethod ( vout_thread_t *p_vout );
......
/*******************************************************************************
/*****************************************************************************
* video_yuv.h: YUV transformation functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Provides functions prototypes to perform the YUV conversion. The functions
* may be implemented in one of the video_yuv_* files.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
int vout_InitYUV ( vout_thread_t *p_vout );
int vout_ResetYUV ( vout_thread_t *p_vout );
void vout_EndYUV ( vout_thread_t *p_vout );
/*******************************************************************************
/*****************************************************************************
* External prototypes
*******************************************************************************/
*****************************************************************************/
#ifdef HAVE_MMX
/* YUV transformations for MMX - in video_yuv_mmx.S
/* YUV transformations for MMX - in video_yuv_mmx.S
* p_y, p_u, p_v: Y U and V planes
* i_width, i_height: frames dimensions (pixels)
* i_ypitch, i_vpitch: Y and V lines sizes (bytes)
......@@ -28,10 +28,10 @@ void vout_EndYUV ( vout_thread_t *p_vout );
* i_offset_to_line_0: ?? x offset for left image border
* i_pitch: RGB line size (bytes)
* i_colortype: 0 for 565, 1 for 555 */
void ConvertYUV420RGB16MMX( u8* p_y, u8* p_u, u8 *p_v,
void ConvertYUV420RGB16MMX( u8* p_y, u8* p_u, u8 *p_v,
unsigned int i_width, unsigned int i_height,
unsigned int i_ypitch, unsigned int i_vpitch,
unsigned int i_aspect, u8 *p_pic,
unsigned int i_aspect, u8 *p_pic,
u32 i_dci_offset, u32 i_offset_to_line_0,
int i_pitch, int i_colortype );
#endif
/*******************************************************************************
/*****************************************************************************
* vlc.h: all headers
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* This header includes all vlc .h headers and depending headers. A source file
* including it would also be able to use any of the structures of the project.
* Note that functions or system headers specific to the file itself are not
* included.
*******************************************************************************
*****************************************************************************
* required headers:
* none
*******************************************************************************/
*****************************************************************************/
/* System headers */
#include <errno.h>
......
/*******************************************************************************
/*****************************************************************************
* vlc_thread.h : thread implementation for vieolan client
* (c)1999 VideoLAN
*******************************************************************************
* This header is supposed to provide a portable threads implementation.
*****************************************************************************
* This header is supposed to provide a portable threads implementation.
* Currently, it is a wrapper to the POSIX pthreads library.
*******************************************************************************/
*****************************************************************************/
#include <pthread.h>
/******************************************************************************
/*****************************************************************************
* Constants
******************************************************************************
* These constants are used by all threads in *_CreateThread() and
*****************************************************************************
* These constants are used by all threads in *_CreateThread() and
* *_DestroyThreads() functions. Since those calls are non-blocking, an integer
* value is used as a shared flag to represent the status of the thread.
*******************************************************************************/
*****************************************************************************/
/* Void status - this value can be used to be sure, in an array of recorded
* threads, that no operation is currently in progress on the concerned thread */
#define THREAD_NOP 0 /* nothing happened */
#define THREAD_NOP 0 /* nothing happened */
/* Creation status */
#define THREAD_CREATE 10 /* thread is initializing */
#define THREAD_START 11 /* thread has forked */
#define THREAD_READY 19 /* thread is ready */
#define THREAD_CREATE 10 /* thread is initializing */
#define THREAD_START 11 /* thread has forked */
#define THREAD_READY 19 /* thread is ready */
/* Destructions status */
#define THREAD_DESTROY 20 /* destruction order has been sent */
#define THREAD_END 21 /* destruction order has been received */
#define THREAD_OVER 29 /* thread does not exist any more */
#define THREAD_DESTROY 20 /* destruction order has been sent */
#define THREAD_END 21 /* destruction order has been received */
#define THREAD_OVER 29 /* thread does not exist any more */
/* Error status */
#define THREAD_ERROR 30 /* an error occured */
#define THREAD_FATAL 31 /* an fatal error occured - program must end */
#define THREAD_ERROR 30 /* an error occured */
#define THREAD_FATAL 31 /* an fatal error occured - program must end */
/******************************************************************************
/*****************************************************************************
* Types definition
******************************************************************************/
*****************************************************************************/
typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t;
typedef void *(*vlc_thread_func_t)(void *p_data);
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, char *psz_name,
vlc_thread_func_t func, void *p_data );
......@@ -62,9 +62,9 @@ static __inline__ int vlc_cond_wait ( vlc_cond_t *p_condvar, vlc_mutex_t *p_
//static _inline__ int vlc_cond_timedwait ( vlc_cond_t * condvar, vlc_mutex_t * mutex,
// mtime_t absoute_timeout_time );
/*******************************************************************************
/*****************************************************************************
* vlc_thread_create: create a thread
******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
char *psz_name, vlc_thread_func_t func,
void *p_data)
......@@ -72,65 +72,65 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
return pthread_create( p_thread, NULL, func, p_data );
}
/******************************************************************************
/*****************************************************************************
* vlc_thread_exit: terminate a thread
*******************************************************************************/
*****************************************************************************/
static __inline__ void vlc_thread_exit( void )
{
pthread_exit( 0 );
}
/*******************************************************************************
/*****************************************************************************
* vlc_thread_join: wait until a thread exits
******************************************************************************/
*****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread )
{
pthread_join( thread, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{
return pthread_mutex_init( p_mutex, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{
return pthread_mutex_lock( p_mutex );
}
/*******************************************************************************
/*****************************************************************************
* vlc_mutex_unlock: unlock a mutex
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{
return pthread_mutex_unlock( p_mutex );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_init: initialize a condition
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{
return pthread_cond_init( p_condvar, NULL );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{
return pthread_cond_signal( p_condvar );
}
/*******************************************************************************
/*****************************************************************************
* vlc_cond_wait: wait until condition completion
*******************************************************************************/
*****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{
return pthread_cond_wait( p_condvar, p_mutex );
......
......@@ -28,7 +28,7 @@ typedef struct macroblock_s
/* which blocks are coded ? */
int i_chroma_nb_blocks; /* number of blocks for
* chroma components */
/* IDCT information */
dctelem_t ppi_blocks[12][64]; /* blocks */
f_idct_t pf_idct[12]; /* sparse IDCT or not ? */
......@@ -47,7 +47,7 @@ typedef struct macroblock_s
int i_l_x, i_c_x;
int i_motion_l_y;
int i_motion_c_y;
int i_l_stride; /* number of yuv_data_t to
int i_l_stride; /* number of yuv_data_t to
* ignore when changing line */
int i_c_stride; /* idem, for chroma */
boolean_t b_P_second; /* Second field of a P picture ?
......@@ -91,9 +91,9 @@ typedef struct lookup_s
int i_length;
} lookup_t;
/******************************************************************************
/*****************************************************************************
* ac_lookup_t : special entry type for lookup tables about ac coefficients
*****************************************************************************/
*****************************************************************************/
typedef struct dct_lookup_s
{
char i_run;
......
......@@ -14,7 +14,7 @@
* "decoder_fifo.h"
* "video_fifo.h"
*****************************************************************************/
/*****************************************************************************
* quant_matrix_t : Quantization Matrix
*****************************************************************************/
......
......@@ -25,7 +25,7 @@ typedef struct video_synchro_tab_s
{
double mean;
double deviation;
} video_synchro_tab_t;
typedef struct video_synchro_fifo_s
......@@ -34,7 +34,7 @@ typedef struct video_synchro_fifo_s
int i_image_type;
mtime_t i_decode_date;
mtime_t i_pts;
} video_synchro_fifo_t;
typedef struct video_synchro_s
......@@ -47,12 +47,12 @@ typedef struct video_synchro_s
/* mean decoding time */
mtime_t i_mean_decode_time;
/* dates */
mtime_t i_last_display_pts; /* pts of the last displayed image */
mtime_t i_last_decode_pts; /* pts of the last decoded image */
mtime_t i_last_i_pts; /* pts of the last I image */
mtime_t i_last_nondropped_i_pts; /* pts of last non-dropped I image */
mtime_t i_last_display_pts; /* pts of the last displayed image */
mtime_t i_last_decode_pts; /* pts of the last decoded image */
mtime_t i_last_i_pts; /* pts of the last I image */
mtime_t i_last_nondropped_i_pts; /* pts of last non-dropped I image */
unsigned int i_images_since_pts;
/* il manquait un compteur */
unsigned int modulo;
......
This diff is collapsed.
......@@ -52,7 +52,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
/*
if(p_ac3dec->bsi.acmod > 7)
dprintf("(downmix) invalid acmod number\n");
dprintf("(downmix) invalid acmod number\n");
*/
//There are two main cases, with or without Dolby Surround
......@@ -91,7 +91,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
left_sur = p_ac3dec->samples.channel[2];
right_sur = p_ac3dec->samples.channel[3];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *left_sur++ + 0.2265f * *right_sur++;
left_tmp = -1 * right_tmp;
......@@ -115,7 +115,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Mono surround
right_sur = p_ac3dec->samples.channel[3];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *right_sur++;
left_tmp = - right_tmp;
......@@ -138,11 +138,11 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Mono surround
right_sur = p_ac3dec->samples.channel[2];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.2265f * *right_sur++;
left_tmp = - right_tmp;
right_tmp += 0.3204f * *right++;
right_tmp += 0.3204f * *right++;
left_tmp += 0.3204f * *left++;
*(out_buf++) = left_tmp * NORM;
......@@ -160,7 +160,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
centre = p_ac3dec->samples.channel[1];
right = p_ac3dec->samples.channel[2];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.3204f * *right++ + 0.2265f * *centre;
left_tmp = 0.3204f * *left++ + 0.2265f * *centre++;
......@@ -191,7 +191,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Mono program!
right = p_ac3dec->samples.channel[0];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
......@@ -209,7 +209,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Dual mono, output selected by user
right = p_ac3dec->samples.channel[global_prefs.dual_mono_channel_select];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
......@@ -239,7 +239,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre + slev * *right_sur++;
left_tmp = 0.4142f * *left++ + clev * *centre++ + slev * *left_sur++;
......@@ -262,7 +262,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + slev * *right_sur++;
left_tmp = 0.4142f * *left++ + slev * *left_sur++;
......@@ -287,7 +287,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre + slev * *right_sur;
left_tmp = 0.4142f * *left++ + clev * *centre++ + slev * *right_sur++;
......@@ -310,7 +310,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
slev = smixlev_lut[p_ac3dec->bsi.surmixlev];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + slev * *right_sur;
left_tmp = 0.4142f * *left++ + slev * *right_sur++;
......@@ -332,10 +332,10 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
clev = cmixlev_lut[p_ac3dec->bsi.cmixlev];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp= 0.4142f * *right++ + clev * *centre;
left_tmp = 0.4142f * *left++ + clev * *centre++;
right_tmp= 0.4142f * *right++ + clev * *centre;
left_tmp = 0.4142f * *left++ + clev * *centre++;
*(out_buf++) = left_tmp * NORM;
*(out_buf++) = right_tmp * NORM;
......@@ -362,7 +362,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Mono program!
right = p_ac3dec->samples.channel[0];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
......@@ -380,7 +380,7 @@ void downmix( ac3dec_thread_t * p_ac3dec, s16 * out_buf )
//Dual mono, output selected by user
right = p_ac3dec->samples.channel[global_prefs.dual_mono_channel_select];
for (j = 0; j < 256; j++)
for (j = 0; j < 256; j++)
{
right_tmp = 0.7071f * *right++;
......
......@@ -43,7 +43,7 @@ static __inline__ void exp_unpack_ch( ac3dec_thread_t * p_ac3dec, u16 type, u16
exp_acc = initial_exp;
j = 0;
/* In the case of a fbw channel then the initial absolute values is
/* In the case of a fbw channel then the initial absolute values is
* also an exponent */
if ( type != UNPACK_CPL )
{
......
......@@ -40,31 +40,31 @@ static complex_t buf[N/4];
/* 128 point bit-reverse LUT */
static u8 bit_reverse_512[] = {
0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70,
0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78,
0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74,
0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c,
0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72,
0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a,
0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76,
0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e,
0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71,
0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79,
0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75,
0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d,
0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73,
0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b,
0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77,
0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70,
0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78,
0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74,
0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c,
0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72,
0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a,
0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76,
0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e,
0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71,
0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79,
0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75,
0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d,
0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73,
0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b,
0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77,
0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f};
static u8 bit_reverse_256[] = {
0x00, 0x20, 0x10, 0x30, 0x08, 0x28, 0x18, 0x38,
0x04, 0x24, 0x14, 0x34, 0x0c, 0x2c, 0x1c, 0x3c,
0x02, 0x22, 0x12, 0x32, 0x0a, 0x2a, 0x1a, 0x3a,
0x06, 0x26, 0x16, 0x36, 0x0e, 0x2e, 0x1e, 0x3e,
0x01, 0x21, 0x11, 0x31, 0x09, 0x29, 0x19, 0x39,
0x05, 0x25, 0x15, 0x35, 0x0d, 0x2d, 0x1d, 0x3d,
0x03, 0x23, 0x13, 0x33, 0x0b, 0x2b, 0x1b, 0x3b,
0x00, 0x20, 0x10, 0x30, 0x08, 0x28, 0x18, 0x38,
0x04, 0x24, 0x14, 0x34, 0x0c, 0x2c, 0x1c, 0x3c,
0x02, 0x22, 0x12, 0x32, 0x0a, 0x2a, 0x1a, 0x3a,
0x06, 0x26, 0x16, 0x36, 0x0e, 0x2e, 0x1e, 0x3e,
0x01, 0x21, 0x11, 0x31, 0x09, 0x29, 0x19, 0x39,
0x05, 0x25, 0x15, 0x35, 0x0d, 0x2d, 0x1d, 0x3d,
0x03, 0x23, 0x13, 0x33, 0x0b, 0x2b, 0x1b, 0x3b,
0x07, 0x27, 0x17, 0x37, 0x0f, 0x2f, 0x1f, 0x3f};
/* Twiddle factor LUT */
......@@ -149,14 +149,14 @@ void imdct_init(void)
/* Twiddle factors to turn IFFT into IMDCT */
for( i=0; i < N/4; i++)
{
xcos1[i] = -cos(2 * M_PI * (8*i+1)/(8*N)) ;
xcos1[i] = -cos(2 * M_PI * (8*i+1)/(8*N)) ;
xsin1[i] = -sin(2 * M_PI * (8*i+1)/(8*N)) ;
}
/* More twiddle factors to turn IFFT into IMDCT */
for( i=0; i < N/8; i++)
{
xcos2[i] = -cos(2 * M_PI * (8*i+1)/(4*N)) ;
xcos2[i] = -cos(2 * M_PI * (8*i+1)/(4*N)) ;
xsin2[i] = -sin(2 * M_PI * (8*i+1)/(4*N)) ;
}
......@@ -223,17 +223,17 @@ imdct_do_512(float x[],float y[],float delay[])
float *delay_ptr;
float *window_ptr;
// Pre IFFT complex multiply plus IFFT cmplx conjugate
// Pre IFFT complex multiply plus IFFT cmplx conjugate
for( i=0; i < N/4; i++)
{
/* z[i] = (X[N/2-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
/* z[i] = (X[N/2-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
buf[i].real = (x[N/2-2*i-1] * xcos1[i]) - (x[2*i] * xsin1[i]);
buf[i].imag = -((x[2*i] * xcos1[i]) + (x[N/2-2*i-1] * xsin1[i]));
}
//Bit reversed shuffling
for(i=0; i<N/4; i++)
{
for(i=0; i<N/4; i++)
{
k = bit_reverse_512[i];
if (k < i)
swap_cmplx(&buf[i],&buf[k]);
......@@ -278,31 +278,31 @@ imdct_do_512(float x[],float y[],float delay[])
delay_ptr = delay;
window_ptr = window;
/* Window and convert to real valued signal */
for(i=0; i<N/8; i++)
{
*y_ptr++ = 2.0f * (-buf[N/8+i].imag * *window_ptr++ + *delay_ptr++);
*y_ptr++ = 2.0f * ( buf[N/8-i-1].real * *window_ptr++ + *delay_ptr++);
for(i=0; i<N/8; i++)
{
*y_ptr++ = 2.0f * (-buf[N/8+i].imag * *window_ptr++ + *delay_ptr++);
*y_ptr++ = 2.0f * ( buf[N/8-i-1].real * *window_ptr++ + *delay_ptr++);
}
for(i=0; i<N/8; i++)
{
*y_ptr++ = 2.0f * (-buf[i].real * *window_ptr++ + *delay_ptr++);
*y_ptr++ = 2.0f * ( buf[N/4-i-1].imag * *window_ptr++ + *delay_ptr++);
for(i=0; i<N/8; i++)
{
*y_ptr++ = 2.0f * (-buf[i].real * *window_ptr++ + *delay_ptr++);
*y_ptr++ = 2.0f * ( buf[N/4-i-1].imag * *window_ptr++ + *delay_ptr++);
}
/* The trailing edge of the window goes into the delay line */
delay_ptr = delay;
for(i=0; i<N/8; i++)
{
*delay_ptr++ = -buf[N/8+i].real * *--window_ptr;
*delay_ptr++ = buf[N/8-i-1].imag * *--window_ptr;
for(i=0; i<N/8; i++)
{
*delay_ptr++ = -buf[N/8+i].real * *--window_ptr;
*delay_ptr++ = buf[N/8-i-1].imag * *--window_ptr;
}
for(i=0; i<N/8; i++)
for(i=0; i<N/8; i++)
{
*delay_ptr++ = buf[i].imag * *--window_ptr;
*delay_ptr++ = -buf[N/4-i-1].real * *--window_ptr;
*delay_ptr++ = buf[i].imag * *--window_ptr;
*delay_ptr++ = -buf[N/4-i-1].real * *--window_ptr;
}
}
......@@ -326,25 +326,25 @@ imdct_do_256(float x[],float y[],float delay[])
buf_2 = &buf[64];
/* Pre IFFT complex multiply plus IFFT cmplx conjugate */
for(k=0; k<N/8; k++)
{
for(k=0; k<N/8; k++)
{
/* X1[k] = X[2*k] */
/* X2[k] = X[2*k+1] */
p = 2 * (N/4-2*k-1);
q = 2 * (2 * k);
/* Z1[k] = (X1[N/4-2*k-1] + j * X1[2*k]) * (xcos2[k] + j * xsin2[k]); */
/* Z1[k] = (X1[N/4-2*k-1] + j * X1[2*k]) * (xcos2[k] + j * xsin2[k]); */
buf_1[k].real = x[p] * xcos2[k] - x[q] * xsin2[k];
buf_1[k].imag = - (x[q] * xcos2[k] + x[p] * xsin2[k]);
/* Z2[k] = (X2[N/4-2*k-1] + j * X2[2*k]) * (xcos2[k] + j * xsin2[k]); */
buf_1[k].imag = - (x[q] * xcos2[k] + x[p] * xsin2[k]);
/* Z2[k] = (X2[N/4-2*k-1] + j * X2[2*k]) * (xcos2[k] + j * xsin2[k]); */
buf_2[k].real = x[p + 1] * xcos2[k] - x[q + 1] * xsin2[k];
buf_2[k].imag = - (x[q + 1] * xcos2[k] + x[p + 1] * xsin2[k]);
buf_2[k].imag = - (x[q + 1] * xcos2[k] + x[p + 1] * xsin2[k]);
}
//IFFT Bit reversed shuffling
for(i=0; i<N/8; i++)
{
for(i=0; i<N/8; i++)
{
k = bit_reverse_256[i];
if (k < i)
{
......@@ -392,12 +392,12 @@ imdct_do_256(float x[],float y[],float delay[])
/* Post IFFT complex multiply */
for( i=0; i < N/8; i++)
{
/* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
/* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
tmp_a_r = buf_1[i].real;
tmp_a_i = - buf_1[i].imag;
buf_1[i].real =(tmp_a_r * xcos2[i]) - (tmp_a_i * xsin2[i]);
buf_1[i].imag =(tmp_a_r * xsin2[i]) + (tmp_a_i * xcos2[i]);
/* y2[n] = z2[n] * (xcos2[n] + j * xsin2[n]) ; */
/* y2[n] = z2[n] * (xcos2[n] + j * xsin2[n]) ; */
tmp_a_r = buf_2[i].real;
tmp_a_i = - buf_2[i].imag;
buf_2[i].real =(tmp_a_r * xcos2[i]) - (tmp_a_i * xsin2[i]);
......@@ -405,22 +405,22 @@ imdct_do_256(float x[],float y[],float delay[])
}
/* Window and convert to real valued signal */
for(i=0; i<N/8; i++)
{
for(i=0; i<N/8; i++)
{
y[2*i] = -buf_1[i].imag * window[2*i];
y[2*i+1] = buf_1[N/8-i-1].real * window[2*i+1];
y[N/4+2*i] = -buf_1[i].real * window[N/4+2*i];
y[2*i+1] = buf_1[N/8-i-1].real * window[2*i+1];
y[N/4+2*i] = -buf_1[i].real * window[N/4+2*i];
y[N/4+2*i+1] = buf_1[N/8-i-1].imag * window[N/4+2*i+1];
y[N/2+2*i] = -buf_2[i].real * window[N/2-2*i-1];
y[N/2+2*i+1] = buf_2[N/8-i-1].imag * window[N/2-2*i-2];
y[3*N/4+2*i] = buf_2[i].imag * window[N/4-2*i-1];
y[3*N/4+2*i+1] = -buf_2[N/8-i-1].real * window[N/4-2*i-2];
y[N/2+2*i] = -buf_2[i].real * window[N/2-2*i-1];
y[N/2+2*i+1] = buf_2[N/8-i-1].imag * window[N/2-2*i-2];
y[3*N/4+2*i] = buf_2[i].imag * window[N/4-2*i-1];
y[3*N/4+2*i+1] = -buf_2[N/8-i-1].real * window[N/4-2*i-2];
}
/* Overlap and add */
for(i=0; i<N/2; i++)
{
y[i] = 2 * (y[i] + delay[i]);
delay[i] = y[N/2+i];
for(i=0; i<N/2; i++)
{
y[i] = 2 * (y[i] + delay[i]);
delay[i] = y[N/2+i];
}
}
......@@ -429,12 +429,12 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
p_ac3dec->audblk.ncplsubnd = (p_ac3dec->audblk.cplendf + 2) - p_ac3dec->audblk.cplbegf + 1;
/* Calculate the start and end bins of the coupling channel */
p_ac3dec->audblk.cplstrtmant = (p_ac3dec->audblk.cplbegf * 12) + 37 ;
p_ac3dec->audblk.cplstrtmant = (p_ac3dec->audblk.cplbegf * 12) + 37 ;
p_ac3dec->audblk.cplendmant = ((p_ac3dec->audblk.cplendf + 3) * 12) + 37;
/* The number of combined subbands is ncplsubnd minus each combined
* band */
p_ac3dec->audblk.ncplbnd = p_ac3dec->audblk.ncplsubnd;
p_ac3dec->audblk.ncplbnd = p_ac3dec->audblk.ncplsubnd;
for(i=1; i< p_ac3dec->audblk.ncplsubnd; i++)
{
......@@ -482,7 +482,7 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
}
/* If we're in dual mono mode, there's going to be some phase info */
if( (p_ac3dec->bsi.acmod == 0x2) && p_ac3dec->audblk.phsflginu &&
if( (p_ac3dec->bsi.acmod == 0x2) && p_ac3dec->audblk.phsflginu &&
(p_ac3dec->audblk.cplcoe[0] || p_ac3dec->audblk.cplcoe[1]))
{
for(j=0;j < p_ac3dec->audblk.ncplbnd; j++)
......@@ -505,9 +505,9 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
p_ac3dec->total_bits_read += 1;
if(p_ac3dec->audblk.rematstr)
{
if (p_ac3dec->audblk.cplinu == 0)
{
for(i = 0; i < 4; i++)
if (p_ac3dec->audblk.cplinu == 0)
{
for(i = 0; i < 4; i++)
{
NeedBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->audblk.rematflg[i] = (u16)(p_ac3dec->bit_stream.fifo.buffer >> (32 - 1));
......@@ -515,9 +515,9 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
p_ac3dec->total_bits_read += 1;
}
}
if((p_ac3dec->audblk.cplbegf > 2) && p_ac3dec->audblk.cplinu)
if((p_ac3dec->audblk.cplbegf > 2) && p_ac3dec->audblk.cplinu)
{
for(i = 0; i < 4; i++)
for(i = 0; i < 4; i++)
{
NeedBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->audblk.rematflg[i] = (u16)(p_ac3dec->bit_stream.fifo.buffer >> (32 - 1));
......@@ -525,18 +525,18 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
p_ac3dec->total_bits_read += 1;
}
}
if((p_ac3dec->audblk.cplbegf <= 2) && p_ac3dec->audblk.cplinu)
{
for(i = 0; i < 3; i++)
if((p_ac3dec->audblk.cplbegf <= 2) && p_ac3dec->audblk.cplinu)
{
for(i = 0; i < 3; i++)
{
NeedBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->audblk.rematflg[i] = (u16)(p_ac3dec->bit_stream.fifo.buffer >> (32 - 1));
DumpBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->total_bits_read += 1;
}
}
if((p_ac3dec->audblk.cplbegf == 0) && p_ac3dec->audblk.cplinu)
for(i = 0; i < 2; i++)
}
if((p_ac3dec->audblk.cplbegf == 0) && p_ac3dec->audblk.cplinu)
for(i = 0; i < 2; i++)
{
NeedBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->audblk.rematflg[i] = (u16)(p_ac3dec->bit_stream.fifo.buffer >> (32 - 1));
......@@ -555,10 +555,10 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
DumpBits( &(p_ac3dec->bit_stream), 2 );
p_ac3dec->total_bits_read += 2;
if(p_ac3dec->audblk.cplexpstr==0)
if(p_ac3dec->audblk.cplexpstr==0)
p_ac3dec->audblk.ncplgrps = 0;
else
p_ac3dec->audblk.ncplgrps = (p_ac3dec->audblk.cplendmant - p_ac3dec->audblk.cplstrtmant) /
p_ac3dec->audblk.ncplgrps = (p_ac3dec->audblk.cplendmant - p_ac3dec->audblk.cplstrtmant) /
(3 << (p_ac3dec->audblk.cplexpstr-1));
}
......@@ -572,7 +572,7 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
}
/* Get the exponent strategy for lfe channel */
if(p_ac3dec->bsi.lfeon)
if(p_ac3dec->bsi.lfeon)
{
NeedBits( &(p_ac3dec->bit_stream), 1 );
p_ac3dec->audblk.lfeexpstr = (u16)(p_ac3dec->bit_stream.fifo.buffer >> (32 - 1));
......@@ -581,13 +581,13 @@ void parse_audblk( ac3dec_thread_t * p_ac3dec )
}
/* Determine the bandwidths of all the fbw channels */
for(i = 0; i < p_ac3dec->bsi.nfchans; i++)
{
for(i = 0; i < p_ac3dec->bsi.nfchans; i++)
{
u16 grp_size;
if(p_ac3dec->audblk.chexpstr[i] != EXP_REUSE)
{
if (p_ac3dec->audblk.cplinu && p_ac3dec->audblk.chincpl[i])
if(p_ac3dec->audblk.chexpstr[i] != EXP_REUSE)
{
if (p_ac3dec->audblk.cplinu && p_ac3dec->audblk.chincpl[i])
{
p_ac3dec->audblk.endmant[i] = p_ac3dec->audblk.cplstrtmant;
}
......
......@@ -40,7 +40,7 @@ static __inline__ u32 min( u32 a, u32 b )
return( a < b ? a : b );
}
/* This routine simply does stereo rematixing for the 2 channel
/* This routine simply does stereo rematixing for the 2 channel
* stereo mode */
void rematrix( ac3dec_thread_t * p_ac3dec )
{
......
This diff is collapsed.
......@@ -6,12 +6,12 @@
* Preamble
*****************************************************************************/
#include <unistd.h>
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* malloc(), free() */
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* malloc(), free() */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* ntohl() */
#include <sys/soundcard.h> /* "audio_output.h" */
#include <netinet/in.h> /* ntohl() */
#include <sys/soundcard.h> /* "audio_output.h" */
#include <sys/uio.h>
#include "config.h"
......@@ -20,7 +20,7 @@
#include "vlc_thread.h"
#include "debug.h"
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
#include "input.h"
#include "input_netlist.h"
......@@ -85,7 +85,7 @@ void DCT32(float *x, adec_bank_t *b)
tt9 , tt10, tt11, tt12, tt13, tt14, tt15, tt16,
tt17, tt18, tt19, tt20, tt21, tt22, tt23, tt24,
tt25, tt26, tt27, tt28, tt29, tt30, tt31, tt32, *y;
/* We unrolled the loops */
/* Odd-even ordering is integrated before the 1st stage */
t17 = c17 * (x[0] - x[31]);
......@@ -458,9 +458,9 @@ void PCM(adec_bank_t *b, s16 **pcm, int jump)
int i;
float tmp, *v;
const float *f;
f = c;
switch(b->pos) {
case 0:
v = b->actual;
......
/******************************************************************************
/*****************************************************************************
* audio_dsp.c : dsp functions library
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/* TODO:
*
......@@ -12,31 +12,31 @@
*
*/
/******************************************************************************
/*****************************************************************************
* Preamble
******************************************************************************/
#include <fcntl.h> /* open(), O_WRONLY */
#include <sys/ioctl.h> /* ioctl() */
#include <unistd.h> /* write(), close() */
*****************************************************************************/
#include <fcntl.h> /* open(), O_WRONLY */
#include <sys/ioctl.h> /* ioctl() */
#include <unistd.h> /* write(), close() */
/* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED, SNDCTL_DSP_GETOSPACE */
#include <sys/soundcard.h>
#include "common.h" /* boolean_t, byte_t */
#include "common.h" /* boolean_t, byte_t */
#include "mtime.h"
#include "vlc_thread.h"
#include "audio_output.h" /* aout_dsp_t */
#include "audio_output.h" /* aout_dsp_t */
#include "audio_dsp.h"
#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)
******************************************************************************
*****************************************************************************
* - This function opens the dsp as an usual non-blocking write-only file, and
* modifies the p_dsp->i_fd with the file's descriptor.
* - p_dsp->psz_device must be set before calling this function !
******************************************************************************/
*****************************************************************************/
int aout_dspOpen( aout_dsp_t *p_dsp )
{
if ( (p_dsp->i_fd = open( p_dsp->psz_device, O_WRONLY )) < 0 )
......@@ -48,9 +48,9 @@ int aout_dspOpen( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspReset: resets the dsp
******************************************************************************/
*****************************************************************************/
int aout_dspReset( aout_dsp_t *p_dsp )
{
if ( ioctl( p_dsp->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
......@@ -62,13 +62,13 @@ int aout_dspReset( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetFormat: sets the dsp output format
******************************************************************************
*****************************************************************************
* This functions tries to initialize the dsp output format with the value
* contained in the dsp structure, and if this value could not be set, the
* default value returned by ioctl is set.
******************************************************************************/
*****************************************************************************/
int aout_dspSetFormat( aout_dsp_t *p_dsp )
{
int i_format;
......@@ -89,11 +89,11 @@ int aout_dspSetFormat( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetChannels: sets the dsp's stereo or mono mode
******************************************************************************
*****************************************************************************
* This function acts just like the previous one...
******************************************************************************/
*****************************************************************************/
int aout_dspSetChannels( aout_dsp_t *p_dsp )
{
boolean_t b_stereo;
......@@ -114,13 +114,13 @@ int aout_dspSetChannels( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspSetRate: sets the dsp's audio output rate
******************************************************************************
*****************************************************************************
* This function tries to initialize the dsp with the rate contained in the
* dsp structure, but if the dsp doesn't support this value, the function uses
* the value returned by ioctl...
******************************************************************************/
*****************************************************************************/
int aout_dspSetRate( aout_dsp_t *p_dsp )
{
long l_rate;
......@@ -141,9 +141,9 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
return( 0 );
}
/******************************************************************************
/*****************************************************************************
* aout_dspGetBufInfo: buffer status query
******************************************************************************
*****************************************************************************
* This function fills in the audio_buf_info structure :
* - int fragments : number of available fragments (partially usend ones not
* counted)
......@@ -151,25 +151,25 @@ int aout_dspSetRate( aout_dsp_t *p_dsp )
* - int fragsize : size of a fragment in bytes
* - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize
******************************************************************************/
*****************************************************************************/
void aout_dspGetBufInfo( aout_dsp_t *p_dsp )
{
ioctl( p_dsp->i_fd, SNDCTL_DSP_GETOSPACE, &p_dsp->buf_info );
}
/******************************************************************************
/*****************************************************************************
* aout_dspPlaySamples: plays a sound samples buffer
******************************************************************************
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
******************************************************************************/
*****************************************************************************/
void aout_dspPlaySamples( aout_dsp_t *p_dsp, byte_t *buffer, int i_size )
{
write( p_dsp->i_fd, buffer, i_size );
}
/******************************************************************************
/*****************************************************************************
* aout_dspClose: closes the dsp audio device
******************************************************************************/
*****************************************************************************/
void aout_dspClose( aout_dsp_t *p_dsp )
{
close( p_dsp->i_fd );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* input_ctrl.c: Decodeur control
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Control the extraction and the decoding of the programs elements carried in
* a stream.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include "vlc.h"
#if 0
#include <errno.h>
#include <sys/uio.h> /* iovec */
#include <stdlib.h> /* atoi(), malloc(), free() */
#include <sys/uio.h> /* iovec */
#include <stdlib.h> /* atoi(), malloc(), free() */
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h> /* ntohs */
#include <netinet/in.h> /* ntohs */
#include "common.h"
#include "config.h"
......@@ -44,18 +44,18 @@
#endif
/******************************************************************************
/*****************************************************************************
* input_AddPgrmElem: Start the extraction and the decoding of a program element
******************************************************************************
*****************************************************************************
* Add the element given by its PID in the list of PID to extract and spawn
* the decoding thread.
* the decoding thread.
* This function only modifies the table of selected es, but must NOT modify
* the table of ES itself.
******************************************************************************/
*****************************************************************************/
int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
{
int i_es_loop, i_selected_es_loop;
/* Since this function is intended to be called by interface, lock the
* elementary stream structure. */
vlc_mutex_lock( &p_input->es_lock );
......@@ -80,7 +80,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
/* Find a free spot in pp_selected_es. */
for( i_selected_es_loop = 0; p_input->pp_selected_es[i_selected_es_loop] != NULL
&& i_selected_es_loop < INPUT_MAX_SELECTED_ES; i_selected_es_loop++ );
if( i_selected_es_loop == INPUT_MAX_SELECTED_ES )
{
/* array full */
......@@ -178,21 +178,21 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
}
}
}
/* We haven't found this PID in the current stream. */
vlc_mutex_unlock( &p_input->es_lock );
intf_ErrMsg("input error: can't find PID %d\n", i_current_id);
return( -1 );
}
/******************************************************************************
/*****************************************************************************
* input_DelPgrmElem: Stop the decoding of a program element
******************************************************************************
*****************************************************************************
* Stop the extraction of the element given by its PID and kill the associated
* decoder thread
* This function only modifies the table of selected es, but must NOT modify
* the table of ES itself.
******************************************************************************/
*****************************************************************************/
int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
{
int i_selected_es_loop, i_last_selected;
......@@ -257,7 +257,7 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
i_last_selected++ );
/* Exchange streams. */
p_input->pp_selected_es[i_selected_es_loop] =
p_input->pp_selected_es[i_selected_es_loop] =
p_input->pp_selected_es[i_last_selected];
p_input->pp_selected_es[i_last_selected] = NULL;
......@@ -275,12 +275,12 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
/******************************************************************************
/*****************************************************************************
* input_IsElemRecv: Test if an element given by its PID is currently received
******************************************************************************
*****************************************************************************
* Cannot return the position of the es in the pp_selected_es, for it can
* change once we have released the lock
******************************************************************************/
*****************************************************************************/
boolean_t input_IsElemRecv( input_thread_t *p_input, int i_id )
{
boolean_t b_is_recv = 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
/*****************************************************************************
* control.c: user control functions
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Library of functions common to all threads, allowing access to various
* structures and settings. Interfaces should only use those functions
* to read or write informations from other threads.
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Preamble
*******************************************************************************/
*****************************************************************************/
#include "vlc.h"
/*??
#include <pthread.h>
......
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.
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.
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.
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