Commit f1240107 authored by Sam Hocevar's avatar Sam Hocevar

- je ne ferai plus de commits d�biles � 5h du mat

 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
 - je ne ferai plus de commits d�biles � 5h du mat
parent 5e22d74d
/******************************************************************************* /******************************************************************************
* input.h: input thread interface * input.h: input thread interface
* (c)1999 VideoLAN * (c)1999 VideoLAN
*******************************************************************************/ ******************************************************************************/
/* needs : "netlist.h", "config.h", "mtime.h" */ /* needs : "netlist.h", "config.h", "mtime.h" */
/* ?? missing: /* ?? missing:
* tables version control */ * tables version control */
/******************************************************************************* /******************************************************************************
* External structures * External structures
******************************************************************************* ******************************************************************************
* These structures, required here only as pointers destinations, are declared * These structures, required here only as pointers destinations, are declared
* in other headers. * in other headers.
*******************************************************************************/ ******************************************************************************/
struct video_cfg_s; /* video configuration descriptor */ struct video_cfg_s; /* video configuration descriptor */
struct vout_thread_s; /* video output thread */ struct vout_thread_s; /* video output thread */
struct stream_descriptor_s; /* PSI tables */ struct stream_descriptor_s; /* PSI tables */
/******************************************************************************* /******************************************************************************
* Constants related to input * Constants related to input
*******************************************************************************/ ******************************************************************************/
#define TS_PACKET_SIZE 188 /* size of a TS packet */ #define TS_PACKET_SIZE 188 /* size of a TS packet */
#define PES_HEADER_SIZE 14 /* size of the first part of a PES header */ #define PES_HEADER_SIZE 14 /* size of the first part of a PES header */
#define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */ #define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */
/******************************************************************************* /******************************************************************************
* ts_packet_t * ts_packet_t
******************************************************************************* ******************************************************************************
* Describe a TS packet. * Describe a TS packet.
*******************************************************************************/ ******************************************************************************/
typedef struct ts_packet_struct typedef struct ts_packet_struct
{ {
/* Nothing before this line, the code relies on that */ /* Nothing before this line, the code relies on that */
...@@ -46,12 +46,12 @@ typedef struct ts_packet_struct ...@@ -46,12 +46,12 @@ typedef struct ts_packet_struct
} ts_packet_t; } ts_packet_t;
/******************************************************************************* /******************************************************************************
* pes_packet_t * pes_packet_t
******************************************************************************* ******************************************************************************
* Describes an PES packet, with its properties, and pointers to the TS packets * Describes an PES packet, with its properties, and pointers to the TS packets
* containing it. * containing it.
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
/* PES properties */ /* PES properties */
...@@ -83,12 +83,12 @@ typedef struct ...@@ -83,12 +83,12 @@ typedef struct
} pes_packet_t; } pes_packet_t;
/******************************************************************************* /******************************************************************************
* psi_section_t * psi_section_t
******************************************************************************* ******************************************************************************
* Describes a PSI section. Beware, it doesn't contain pointers to the TS * Describes a PSI section. Beware, it doesn't contain pointers to the TS
* packets that contain it as for a PES, but the data themselves * packets that contain it as for a PES, but the data themselves
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
byte_t buffer[PSI_SECTION_SIZE]; byte_t buffer[PSI_SECTION_SIZE];
...@@ -100,12 +100,12 @@ typedef struct ...@@ -100,12 +100,12 @@ typedef struct
} psi_section_t; } psi_section_t;
/******************************************************************************* /******************************************************************************
* es_descriptor_t: elementary stream descriptor * es_descriptor_t: elementary stream descriptor
******************************************************************************* ******************************************************************************
* Describes an elementary stream, and includes fields required to handle and * Describes an elementary stream, and includes fields required to handle and
* demultiplex this elementary stream. * demultiplex this elementary stream.
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
u16 i_id; /* stream ID, PID for TS streams */ u16 i_id; /* stream ID, PID for TS streams */
...@@ -146,7 +146,7 @@ typedef struct ...@@ -146,7 +146,7 @@ typedef struct
#ifdef STATS #ifdef STATS
/* Stats */ /* Stats */
count_t c_bytes; /* total bytes read */ count_t c_bytes; /* total bytes read */
count_t c_payload_bytes; /* total of payload usefull bytes */ count_t c_payload_bytes;/* total of payload usefull bytes */
count_t c_packets; /* total packets read */ count_t c_packets; /* total packets read */
count_t c_invalid_packets; /* invalid packets read */ count_t c_invalid_packets; /* invalid packets read */
/* ?? ... other stats */ /* ?? ... other stats */
...@@ -164,15 +164,14 @@ typedef struct ...@@ -164,15 +164,14 @@ typedef struct
#define MPEG2_VIDEO_ES 0x02 #define MPEG2_VIDEO_ES 0x02
#define MPEG1_AUDIO_ES 0x03 #define MPEG1_AUDIO_ES 0x03
#define MPEG2_AUDIO_ES 0x04 #define MPEG2_AUDIO_ES 0x04
#define AC3_AUDIO_ES 0x05
/******************************************************************************* /******************************************************************************
* program_descriptor_t * program_descriptor_t
******************************************************************************* ******************************************************************************
* Describes a program and list associated elementary streams. It is build by * Describes a program and list associated elementary streams. It is build by
* the PSI decoder upon the informations carried in program map sections * the PSI decoder upon the informations carried in program map sections
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
/* Program characteristics */ /* Program characteristics */
...@@ -200,11 +199,11 @@ typedef struct ...@@ -200,11 +199,11 @@ typedef struct
#endif #endif
} pgrm_descriptor_t; } pgrm_descriptor_t;
/******************************************************************************* /******************************************************************************
* pcr_descriptor_t * pcr_descriptor_t
******************************************************************************* ******************************************************************************
* Contains informations used to synchronise the decoder with the server * Contains informations used to synchronise the decoder with the server
*******************************************************************************/ ******************************************************************************/
typedef struct pcr_descriptor_struct typedef struct pcr_descriptor_struct
{ {
...@@ -227,12 +226,12 @@ typedef struct pcr_descriptor_struct ...@@ -227,12 +226,12 @@ typedef struct pcr_descriptor_struct
#endif #endif
} pcr_descriptor_t; } pcr_descriptor_t;
/******************************************************************************* /******************************************************************************
* stream_descriptor_t * stream_descriptor_t
******************************************************************************* ******************************************************************************
* Describes a transport stream and list its associated programs. Build upon * Describes a transport stream and list its associated programs. Build upon
* the informations carried in program association sections * the informations carried in program association sections
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
u16 i_stream_id; /* stream id */ u16 i_stream_id; /* stream id */
...@@ -240,19 +239,25 @@ typedef struct ...@@ -240,19 +239,25 @@ typedef struct
/* Program Association Table status */ /* Program Association Table status */
u8 i_PAT_version; /* version number */ u8 i_PAT_version; /* version number */
boolean_t b_is_PAT_complete; /* Is the PAT complete ?*/ boolean_t b_is_PAT_complete; /* Is the PAT complete ?*/
u8 i_known_PAT_sections; /* Number of section we received so far */ u8 i_known_PAT_sections;
byte_t a_known_PAT_sections[32]; /* Already received sections */ /* Number of section we received so far */
byte_t a_known_PAT_sections[32];
/* Already received sections */
/* Program Map Table status */ /* Program Map Table status */
boolean_t b_is_PMT_complete; /* Is the PMT complete ?*/ boolean_t b_is_PMT_complete; /* Is the PMT complete ?*/
u8 i_known_PMT_sections; /* Number of section we received so far */ u8 i_known_PMT_sections;
byte_t a_known_PMT_sections[32]; /* Already received sections */ /* Number of section we received so far */
byte_t a_known_PMT_sections[32];
/* Already received sections */
/* Service Description Table status */ /* Service Description Table status */
u8 i_SDT_version; /* version number */ u8 i_SDT_version; /* version number */
boolean_t b_is_SDT_complete; /* Is the SDT complete ?*/ boolean_t b_is_SDT_complete; /* Is the SDT complete ?*/
u8 i_known_SDT_sections; /* Number of section we received so far */ u8 i_known_SDT_sections;
byte_t a_known_SDT_sections[32]; /* Already received sections */ /* Number of section we received so far */
byte_t a_known_SDT_sections[32];
/* Already received sections */
/* Programs description */ /* Programs description */
int i_pgrm_number; /* Number of program number we have */ int i_pgrm_number; /* Number of program number we have */
...@@ -264,9 +269,9 @@ typedef struct ...@@ -264,9 +269,9 @@ typedef struct
#endif #endif
} stream_descriptor_t; } stream_descriptor_t;
/******************************************************************************* /******************************************************************************
* input_netlist_t * input_netlist_t
*******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
vlc_mutex_t lock; /* netlist modification lock */ vlc_mutex_t lock; /* netlist modification lock */
...@@ -280,8 +285,8 @@ typedef struct ...@@ -280,8 +285,8 @@ typedef struct
pes_packet_t * p_pes_packets; pes_packet_t * p_pes_packets;
/* pointer to the first PES packet we allocated */ /* pointer to the first PES packet we allocated */
/* To use the efficiency of the scatter/gather IO operations. We implemented it /* To use the efficiency of the scatter/gather IO operations. We implemented
* in 2 ways, as we don't know yet which one is better : as a FIFO (code * it in 2 ways, as we don't know yet which one is better : as a FIFO (code
* simplier) or as a LIFO stack (when we doesn't care of the ordering, this * simplier) or as a LIFO stack (when we doesn't care of the ordering, this
* allow to drastically improve the cache performance) */ * allow to drastically improve the cache performance) */
#ifdef INPUT_LIFO_TS_NETLIST #ifdef INPUT_LIFO_TS_NETLIST
...@@ -296,14 +301,14 @@ typedef struct ...@@ -296,14 +301,14 @@ typedef struct
#endif #endif
} input_netlist_t; } input_netlist_t;
/******************************************************************************* /******************************************************************************
* input_thread_t * input_thread_t
******************************************************************************* ******************************************************************************
* This structure includes all the local static variables of an input thread, * This structure includes all the local static variables of an input thread,
* including the netlist and the ES descriptors * including the netlist and the ES descriptors
* Note that p_es must be defined as a static table, otherwise we would have to * Note that p_es must be defined as a static table, otherwise we would have to
* update all reference to it each time the table would be reallocated * update all reference to it each time the table would be reallocated
*******************************************************************************/ ******************************************************************************/
/* function pointers */ /* function pointers */
struct input_thread_struct; struct input_thread_struct;
...@@ -363,15 +368,15 @@ typedef struct input_thread_struct ...@@ -363,15 +368,15 @@ typedef struct input_thread_struct
#define INPUT_METHOD_TS_BCAST 22 /* TS UDP broadcast */ #define INPUT_METHOD_TS_BCAST 22 /* TS UDP broadcast */
#define INPUT_METHOD_TS_VLAN_BCAST 32 /* TS UDP broadcast with VLANs */ #define INPUT_METHOD_TS_VLAN_BCAST 32 /* TS UDP broadcast with VLANs */
/******************************************************************************* /******************************************************************************
* input_cfg_t: input thread configuration structure * input_cfg_t: input thread configuration structure
******************************************************************************* ******************************************************************************
* This structure is passed as a parameter to input_CreateTtread(). It includes * This structure is passed as a parameter to input_CreateTtread(). It includes
* several fields describing potential properties of a new object. * several fields describing potential properties of a new object.
* The 'i_properties' field allow to set only a subset of the required * The 'i_properties' field allow to set only a subset of the required
* properties, asking the called function to use default settings for * properties, asking the called function to use default settings for
* the other ones. * the other ones.
*******************************************************************************/ ******************************************************************************/
typedef struct input_cfg_struct typedef struct input_cfg_struct
{ {
u64 i_properties; u64 i_properties;
...@@ -397,9 +402,9 @@ typedef struct input_cfg_struct ...@@ -397,9 +402,9 @@ typedef struct input_cfg_struct
#define INPUT_CFG_PORT (1 << 10) #define INPUT_CFG_PORT (1 << 10)
#define INPUT_CFG_VLAN (1 << 11) #define INPUT_CFG_VLAN (1 << 11)
/****************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
******************************************************************************/ *****************************************************************************/
input_thread_t *input_CreateThread ( input_cfg_t *p_cfg ); input_thread_t *input_CreateThread ( input_cfg_t *p_cfg );
void input_DestroyThread ( input_thread_t *p_input ); void input_DestroyThread ( input_thread_t *p_input );
......
...@@ -388,8 +388,8 @@ static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_strea ...@@ -388,8 +388,8 @@ static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_strea
if( i_stream_id == 0xbd ) if( i_stream_id == 0xbd )
{ {
/* Dolby AC-3 stream - might be specific to DVD PS streams */ /* Dolby AC-3 stream - might be specific to DVD PS streams */
i_type = AC3_AUDIO_ES; i_type = MPEG2_AUDIO_ES;
intf_DbgMsg("PES %p identified as AC3\n", p_pes); intf_DbgMsg("PES %p identified as AUDIO AC3\n", p_pes);
} }
else if( (i_stream_id & 0xe0) == 0xc0 ) else if( (i_stream_id & 0xe0) == 0xc0 )
{ {
...@@ -398,7 +398,7 @@ static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_strea ...@@ -398,7 +398,7 @@ static void IdentifyPES( gdec_thread_t *p_gdec, pes_packet_t *p_pes, int i_strea
* an ISO/IEC 13818-3 is capable of decoding an ISO/IEC 11172-3 stream, * an ISO/IEC 13818-3 is capable of decoding an ISO/IEC 11172-3 stream,
* the first one is used */ * the first one is used */
i_type = MPEG2_AUDIO_ES; i_type = MPEG2_AUDIO_ES;
intf_DbgMsg("PES %p identified as AUDIO\n", p_pes); intf_DbgMsg("PES %p identified as AUDIO MPEG\n", p_pes);
} }
else if( (i_stream_id & 0xf0) == 0xe0 ) else if( (i_stream_id & 0xf0) == 0xe0 )
{ {
......
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