Commit d841ab85 authored by Laurent Aimar's avatar Laurent Aimar

* all: - renamed old ts demuxer as ts_old(_dvbpsi).

        - renamed ts2 into ts at the build system level.
        - removed muxer without dvbpsi.
parent 3e666faf
......@@ -884,7 +884,7 @@ dnl
dnl default modules
dnl
AX_ADD_PLUGINS([dummy rc telnet logger gestures memcpy hotkeys netsync])
AX_ADD_PLUGINS([mpgv mpga m4v h264 mpeg_system ps ps2 pva ts avi asf aac mp4 rawdv demux2 nsv real aiff mjpeg])
AX_ADD_PLUGINS([mpgv mpga m4v h264 mpeg_system ps ps2 pva ts_old avi asf aac mp4 rawdv demux2 nsv real aiff mjpeg])
AX_ADD_PLUGINS([cvdsub svcdsub spudec dvbsub mpeg_audio lpcm a52 dts cinepak])
AX_ADD_PLUGINS([deinterlace invert adjust wall transform distort clone crop motionblur])
AX_ADD_PLUGINS([float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32])
......@@ -1111,7 +1111,7 @@ AC_ARG_ENABLE(sout,
if test "${enable_sout}" != "no"
then
AX_ADD_PLUGINS([access_output_dummy access_output_udp access_output_file access_output_http])
AX_ADD_PLUGINS([mux_ts mux_ps mux_avi mux_mp4 mux_asf mux_dummy])
AX_ADD_PLUGINS([mux_ps mux_avi mux_mp4 mux_asf mux_dummy])
AX_ADD_PLUGINS([packetizer_mpegvideo packetizer_h264])
AX_ADD_PLUGINS([packetizer_mpeg4video packetizer_mpeg4audio])
AX_ADD_PLUGINS([packetizer_copy])
......@@ -1455,8 +1455,8 @@ then
if test -z "${with_dvbpsi_tree}"
then
AC_CHECK_HEADERS(dvbpsi/dr.h,
[ AX_ADD_PLUGINS([ts_dvbpsi mux_ts_dvbpsi ts2])
AX_ADD_LDFLAGS([ts_dvbpsi mux_ts_dvbpsi ts2],[-ldvbpsi]) ],
[ AX_ADD_PLUGINS([ts_old_dvbpsi mux_ts ts])
AX_ADD_LDFLAGS([ts_old_dvbpsi mux_ts ts],[-ldvbpsi]) ],
[ AC_MSG_WARN([cannot find libdvbpsi headers]) ],
[#if defined( HAVE_STDINT_H )
# include <stdint.h>
......@@ -1480,9 +1480,9 @@ then
then
dnl Use a custom libdvbpsi
AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
AX_ADD_BUILTINS([ts_dvbpsi mux_ts_dvbpsi ts2])
AX_ADD_CPPFLAGS([ts_dvbpsi mux_ts_dvbpsi ts2],[-I${real_dvbpsi_tree}/src])
AX_ADD_LDFLAGS([ts_dvbpsi mux_ts_dvbpsi ts2],[-L${real_dvbpsi_tree}/src/.libs -ldvbpsi])
AX_ADD_BUILTINS([ts_old_dvbpsi mux_ts ts])
AX_ADD_CPPFLAGS([ts_old_dvbpsi mux_ts ts],[-I${real_dvbpsi_tree}/src])
AX_ADD_LDFLAGS([ts_old_dvbpsi mux_ts ts],[-L${real_dvbpsi_tree}/src/.libs -ldvbpsi])
else
dnl The given libdvbpsi wasn't built
AC_MSG_RESULT(no)
......@@ -1505,9 +1505,9 @@ then
fi
CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
AC_CHECK_HEADERS([dvbpsi/dr.h],[
AX_ADD_PLUGINS([ts_dvbpsi mux_ts_dvbpsi ts2])
AX_ADD_CPPFLAGS([ts_dvbpsi mux_ts_dvbpsi ts2],[${CPPFLAGS_test}])
AX_ADD_LDFLAGS([ts_dvbpsi mux_ts_dvbpsi ts2],[${LDFLAGS_test} -ldvbpsi])
AX_ADD_PLUGINS([ts_old_dvbpsi mux_ts ts])
AX_ADD_CPPFLAGS([ts_old_dvbpsi mux_ts ts],[${CPPFLAGS_test}])
AX_ADD_LDFLAGS([ts_old_dvbpsi mux_ts ts],[${LDFLAGS_test} -ldvbpsi])
],[
if test -n "${enable_dvbpsi}"
......
SOURCES_mpeg_system = system.c system.h
SOURCES_m4v = m4v.c
SOURCES_ps = ps.c
SOURCES_ts = ts.c
SOURCES_ts_dvbpsi = ts.c
SOURCES_ts_old = ts.c
SOURCES_ts_old_dvbpsi = ts.c
SOURCES_mpga = mpga.c
SOURCES_mpgv = mpgv.c
SOURCES_h264 = h264.c
......@@ -31,7 +31,7 @@
#include "iso_lang.h"
#if defined MODULE_NAME_IS_ts_dvbpsi
#if defined MODULE_NAME_IS_ts_old_dvbpsi
# ifdef HAVE_DVBPSI_DR_H
# include <dvbpsi/dvbpsi.h>
# include <dvbpsi/descriptor.h>
......@@ -100,13 +100,13 @@ static int Activate ( vlc_object_t * );
static void Deactivate ( vlc_object_t * );
static int Demux ( input_thread_t * );
#if defined MODULE_NAME_IS_ts
#if defined MODULE_NAME_IS_ts_old
static void TSDemuxPSI ( input_thread_t *, data_packet_t *,
es_descriptor_t *, vlc_bool_t );
static void TSDecodePAT( input_thread_t *, es_descriptor_t *);
static void TSDecodePMT( input_thread_t *, es_descriptor_t *);
#define PSI_CALLBACK TSDemuxPSI
#elif defined MODULE_NAME_IS_ts_dvbpsi
#elif defined MODULE_NAME_IS_ts_olddvbpsi
static void TS_DVBPSI_DemuxPSI ( input_thread_t *, data_packet_t *,
es_descriptor_t *, vlc_bool_t );
static void TS_DVBPSI_HandlePAT ( input_thread_t *, dvbpsi_pat_t * );
......@@ -129,11 +129,11 @@ static void TS_DVBPSI_HandlePMT ( input_thread_t *, dvbpsi_pmt_t * );
"continuity counters, select this option.")
vlc_module_begin();
#if defined MODULE_NAME_IS_ts
#if defined MODULE_NAME_IS_ts_old
set_description( _("ISO 13818-1 MPEG Transport Stream input") );
set_capability( "demux", 6 );
add_shortcut( "ts_old" );
#elif defined MODULE_NAME_IS_ts_dvbpsi
#elif defined MODULE_NAME_IS_ts_old_dvbpsi
set_description( _("ISO 13818-1 MPEG Transport Stream input (libdvbpsi)") );
set_capability( "demux", 5 );
add_shortcut( "ts_old_dvbpsi" );
......@@ -250,7 +250,7 @@ static int Activate( vlc_object_t * p_this )
p_stream_data->i_pat_version = PAT_UNINITIALIZED ;
p_stream_data->b_buggy_psi = config_GetInt( p_input, "buggy-psi" );
#ifdef MODULE_NAME_IS_ts_dvbpsi
#ifdef MODULE_NAME_IS_ts_old_dvbpsi
p_stream_data->p_pat_handle = (dvbpsi_handle *)
dvbpsi_AttachPAT( (dvbpsi_pat_callback) &TS_DVBPSI_HandlePAT, p_input );
......@@ -326,7 +326,7 @@ static int Demux( input_thread_t * p_input )
}
#if defined MODULE_NAME_IS_ts
#if defined MODULE_NAME_IS_ts_old
/*
* PSI demultiplexing and decoding without libdvbpsi
*/
......@@ -821,7 +821,7 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
#undef p_psi
}
#elif defined MODULE_NAME_IS_ts_dvbpsi
#elif defined MODULE_NAME_IS_ts_old_dvbpsi
/*
* PSI Decoding using libdvbpsi
*/
......
......@@ -10,12 +10,3 @@ SOURCES_mux_ts = ts.c \
csa.h \
bits.h \
$(NULL)
SOURCES_mux_ts_dvbpsi = ts.c \
pes.c \
pes.h \
csa.c \
csa.h \
bits.h \
$(NULL)
......@@ -37,22 +37,20 @@
#include "pes.h"
#include "csa.h"
#if defined MODULE_NAME_IS_mux_ts_dvbpsi
# ifdef HAVE_DVBPSI_DR_H
# include <dvbpsi/dvbpsi.h>
# include <dvbpsi/descriptor.h>
# include <dvbpsi/pat.h>
# include <dvbpsi/pmt.h>
# include <dvbpsi/dr.h>
# include <dvbpsi/psi.h>
# else
# include "dvbpsi.h"
# include "descriptor.h"
# include "tables/pat.h"
# include "tables/pmt.h"
# include "descriptors/dr.h"
# include "psi.h"
# endif
#ifdef HAVE_DVBPSI_DR_H
# include <dvbpsi/dvbpsi.h>
# include <dvbpsi/descriptor.h>
# include <dvbpsi/pat.h>
# include <dvbpsi/pmt.h>
# include <dvbpsi/dr.h>
# include <dvbpsi/psi.h>
#else
# include "dvbpsi.h"
# include "descriptor.h"
# include "tables/pat.h"
# include "tables/pmt.h"
# include "descriptors/dr.h"
# include "psi.h"
#endif
/*
......@@ -116,17 +114,9 @@ static void Close ( vlc_object_t * );
#define SOUT_CFG_PREFIX "sout-ts-"
vlc_module_begin();
#if defined MODULE_NAME_IS_mux_ts
set_description( _("TS muxer") );
set_capability( "sout mux", 100 );
add_shortcut( "ts" );
add_shortcut( "ts_nodvbpsi" );
#elif defined MODULE_NAME_IS_mux_ts_dvbpsi
set_description( _("TS muxer (libdvbpsi)") );
set_capability( "sout mux", 120 );
add_shortcut( "ts" );
add_shortcut( "ts_dvbpsi" );
#endif
add_integer( SOUT_CFG_PREFIX "pid-video", 0, NULL,VPID_TEXT, VPID_LONGTEXT,
VLC_TRUE );
......@@ -1547,186 +1537,6 @@ static void PEStoTS( sout_instance_t *p_sout,
return;
}
#if defined MODULE_NAME_IS_mux_ts
static uint32_t CalculateCRC( uint8_t *p_begin, int i_count )
{
static uint32_t CRC32[256] =
{
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
uint32_t i_crc = 0xffffffff;
/* Calculate the CRC */
while( i_count > 0 )
{
i_crc = (i_crc<<8) ^ CRC32[ (i_crc>>24) ^ ((uint32_t)*p_begin) ];
p_begin++;
i_count--;
}
return( i_crc );
}
static void GetPAT( sout_mux_t *p_mux,
sout_buffer_chain_t *c )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
block_t *p_pat;
bits_buffer_t bits;
p_pat = block_New( p_mux, 1024 );
p_pat->i_pts = 0;
p_pat->i_dts = 0;
p_pat->i_length = 0;
bits_initwrite( &bits, 1024, p_pat->p_buffer );
bits_write( &bits, 8, 0 ); // pointer
bits_write( &bits, 8, 0x00 ); // table id
bits_write( &bits, 1, 1 ); // section_syntax_indicator
bits_write( &bits, 1, 0 ); // 0
bits_write( &bits, 2, 0x03 ); // reserved FIXME
bits_write( &bits, 12, 13 ); // XXX for one program only XXX
bits_write( &bits, 16, 0x01 ); // FIXME stream id
bits_write( &bits, 2, 0x03 ); // FIXME
bits_write( &bits, 5, p_sys->i_pat_version_number );
bits_write( &bits, 1, 1 ); // current_next_indicator
bits_write( &bits, 8, 0 ); // section number
bits_write( &bits, 8, 0 ); // last section number
bits_write( &bits, 16, 1 ); // program number
bits_write( &bits, 3, 0x07 ); // reserved
bits_write( &bits, 13, p_sys->pmt.i_pid ); // program map pid
bits_write( &bits, 32, CalculateCRC( bits.p_data + 1, bits.i_data - 1) );
p_pat->i_buffer = bits.i_data;
PEStoTS( p_mux->p_sout, c, p_pat, &p_sys->pat );
}
static void GetPMT( sout_mux_t *p_mux,
sout_buffer_chain_t *c )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
block_t *p_pmt;
bits_buffer_t bits;
int i_stream;
p_pmt = block_New( p_mux, 1024 );
p_pmt->i_pts = 0;
p_pmt->i_dts = 0;
p_pmt->i_length = 0;
bits_initwrite( &bits, 1024, p_pmt->p_buffer );
bits_write( &bits, 8, 0 ); // pointer
bits_write( &bits, 8, 0x02 ); // table id
bits_write( &bits, 1, 1 ); // section_syntax_indicator
bits_write( &bits, 1, 0 ); // 0
bits_write( &bits, 2, 0 ); // reserved FIXME
bits_write( &bits, 12, 13 + 5 * p_mux->i_nb_inputs );
bits_write( &bits, 16, 1 ); // FIXME program number
bits_write( &bits, 2, 0 ); // FIXME
bits_write( &bits, 5, p_sys->i_pmt_version_number );
bits_write( &bits, 1, 1 ); // current_next_indicator
bits_write( &bits, 8, 0 ); // section number
bits_write( &bits, 8, 0 ); // last section number
bits_write( &bits, 3, 0 ); // reserved
bits_write( &bits, 13, p_sys->i_pcr_pid ); // FIXME FXIME PCR_PID FIXME
bits_write( &bits, 4, 0 ); // reserved FIXME
bits_write( &bits, 12, 0 ); // program info len FIXME
for( i_stream = 0; i_stream < p_mux->i_nb_inputs; i_stream++ )
{
ts_stream_t *p_stream;
p_stream = (ts_stream_t*)p_mux->pp_inputs[i_stream]->p_sys;
bits_write( &bits, 8, p_stream->i_stream_type ); // stream_type
bits_write( &bits, 3, 0 ); // reserved
bits_write( &bits, 13, p_stream->i_pid ); // es pid
bits_write( &bits, 4, 0 ); //reserved
bits_write( &bits, 12, 0 ); // es info len FIXME
}
bits_write( &bits, 32, CalculateCRC( bits.p_data + 1, bits.i_data - 1) );
p_pmt->i_buffer = bits.i_data;
PEStoTS( p_mux->p_sout, c, p_pmt, &p_sys->pmt );
}
#elif defined MODULE_NAME_IS_mux_ts_dvbpsi
static block_t *WritePSISection( sout_instance_t *p_sout,
dvbpsi_psi_section_t* p_section )
{
......@@ -2013,6 +1823,3 @@ static void GetPMT( sout_mux_t *p_mux,
dvbpsi_DeletePSISections( p_section );
dvbpsi_EmptyPMT( &pmt );
}
#endif
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