Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
3439df81
Commit
3439df81
authored
Nov 24, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: removed decoder_fifo_t.
parent
057d2ab9
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
314 additions
and
795 deletions
+314
-795
Makefile.am
Makefile.am
+1
-2
include/input_ext-dec.h
include/input_ext-dec.h
+1
-447
include/input_ext-intf.h
include/input_ext-intf.h
+3
-2
include/input_ext-plugins.h
include/input_ext-plugins.h
+6
-3
include/vlc_codec.h
include/vlc_codec.h
+1
-7
include/vlc_common.h
include/vlc_common.h
+1
-3
include/vlc_es.h
include/vlc_es.h
+6
-1
include/vlc_objects.h
include/vlc_objects.h
+1
-3
modules/access/cdda.c
modules/access/cdda.c
+3
-3
modules/access/cddax.c
modules/access/cddax.c
+3
-3
modules/access/dshow/dshow.cpp
modules/access/dshow/dshow.cpp
+3
-3
modules/access/dvb/access.c
modules/access/dvb/access.c
+2
-2
modules/access/satellite/access.c
modules/access/satellite/access.c
+2
-2
modules/access/v4l/v4l.c
modules/access/v4l/v4l.c
+5
-12
modules/codec/dvbsub.c
modules/codec/dvbsub.c
+84
-66
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/audio.c
+9
-5
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video.c
+9
-5
modules/codec/spudec/parse.c
modules/codec/spudec/parse.c
+3
-6
modules/demux/flac.c
modules/demux/flac.c
+1
-3
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+9
-9
modules/demux/mpeg/m4v.c
modules/demux/mpeg/m4v.c
+3
-3
modules/demux/mpeg/mpgv.c
modules/demux/mpeg/mpgv.c
+1
-3
modules/demux/mpeg/system.c
modules/demux/mpeg/system.c
+9
-9
modules/demux/rawdv.c
modules/demux/rawdv.c
+10
-10
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.cpp
+2
-2
modules/gui/gtk/menu.c
modules/gui/gtk/menu.c
+2
-2
modules/stream_out/display.c
modules/stream_out/display.c
+3
-3
src/input/input.c
src/input/input.c
+13
-34
src/input/input_dec.c
src/input/input_dec.c
+101
-121
src/input/input_ext-intf.c
src/input/input_ext-intf.c
+2
-2
src/input/input_programs.c
src/input/input_programs.c
+11
-11
src/misc/objects.c
src/misc/objects.c
+1
-5
src/video_output/video_output.c
src/video_output/video_output.c
+3
-3
No files found.
Makefile.am
View file @
3439df81
...
...
@@ -321,8 +321,7 @@ SOURCES_libvlc_common = \
src/input/stream.c
\
src/input/demux.c
\
src/input/subtitles.c
\
src/input/input_ext-plugins.c
\
src/input/input_ext-dec.c
\
src/input/input_ext-plugins.c
\
src/input/input_ext-intf.c
\
src/input/input_dec.c
\
src/input/input_programs.c
\
...
...
include/input_ext-dec.h
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_ext-dec.h,v 1.8
2 2003/11/06 16:36:41 nitrox
Exp $
* $Id: input_ext-dec.h,v 1.8
3 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
...
...
@@ -80,455 +80,9 @@ struct pes_packet_t
unsigned
int
i_nb_data
;
/* Number of data packets in the chained list */
};
/*****************************************************************************
* decoder_fifo_t
*****************************************************************************
* This rotative FIFO contains PES packets that are to be decoded.
*****************************************************************************/
struct
decoder_fifo_t
{
VLC_COMMON_MEMBERS
/* Thread structures */
vlc_mutex_t
data_lock
;
/* fifo data lock */
vlc_cond_t
data_wait
;
/* fifo data conditional variable */
/* Data */
pes_packet_t
*
p_first
;
pes_packet_t
**
pp_last
;
int
i_depth
;
/* number of PES packets in the stack */
/* Communication interface between input and decoders */
input_buffers_t
*
p_packets_mgt
;
/* packets management services data */
/* Standard pointers given to the decoders as a toolbox. */
uint16_t
i_id
;
vlc_fourcc_t
i_fourcc
;
es_sys_t
*
p_demux_data
;
stream_ctrl_t
*
p_stream_ctrl
;
sout_instance_t
*
p_sout
;
void
*
p_waveformatex
;
void
*
p_bitmapinfoheader
;
void
*
p_spuinfo
;
decoder_t
*
p_dec
;
};
/*****************************************************************************
* bit_fifo_t : bit fifo descriptor
*****************************************************************************
* This type describes a bit fifo used to store bits while working with the
* input stream at the bit level.
*****************************************************************************/
typedef
uint32_t
WORD_TYPE
;
typedef
struct
bit_fifo_t
{
/* This unsigned integer allows us to work at the bit level. This buffer
* can contain 32 bits, and the used space can be found on the MSb's side
* and the available space on the LSb's side. */
WORD_TYPE
buffer
;
/* Number of bits available in the bit buffer */
int
i_available
;
}
bit_fifo_t
;
/*****************************************************************************
* bit_stream_t : bit stream descriptor
*****************************************************************************
* This type, based on a PES stream, includes all the structures needed to
* handle the input stream like a bit stream.
*****************************************************************************/
struct
bit_stream_t
{
/*
* Bit structures
*/
bit_fifo_t
fifo
;
/*
* Input structures
*/
/* The decoder fifo contains the data of the PES stream */
decoder_fifo_t
*
p_decoder_fifo
;
/* Callback to the decoder used when changing data packets ; set
* to NULL if your decoder doesn't need it. */
void
(
*
pf_bitstream_callback
)(
bit_stream_t
*
,
vlc_bool_t
);
/* Optional argument to the callback */
void
*
p_callback_arg
;
/*
* PTS retrieval
*/
mtime_t
i_pts
,
i_dts
;
byte_t
*
p_pts_validity
;
/*
* Byte structures
*/
/* Current PES packet (extracted from the PES stream) */
pes_packet_t
*
p_pes
;
/* Current data packet (in the current PES packet) */
data_packet_t
*
p_data
;
/* Pointer to the next byte that is to be read (in the current packet) */
byte_t
*
p_byte
;
/* Pointer to the last byte that is to be read (in the current packet */
byte_t
*
p_end
;
/* Temporary buffer in case we're not aligned when changing data packets */
WORD_TYPE
i_showbits_buffer
;
data_packet_t
showbits_data
;
};
/*****************************************************************************
* Inline functions used by the decoders to read bit_stream_t
*****************************************************************************/
/*
* DISCUSSION : How to use the bit_stream structures
*
* sizeof(WORD_TYPE) (usually 32) bits are read at the same time, thus
* minimizing the number of p_byte changes.
* Bits are read via GetBits() or ShowBits.
*
* XXX : Be aware that if, in the forthcoming functions, i_bits > 24,
* the data have to be already aligned on an 8-bit boundary, or wrong
* results will be returned. Use RealignBits() if unsure.
*/
#if (WORD_TYPE == uint32_t)
# define WORD_AT U32_AT
# define WORD_SIGNED int32_t
#elif (WORD_TYPE == uint64_t)
# define WORD_AT U64_AT
# define WORD_SIGNED int64_t
#else
# error Unsupported WORD_TYPE
#endif
/*****************************************************************************
* Prototypes from input_ext-dec.c
*****************************************************************************/
VLC_EXPORT
(
void
,
input_ExtractPES
,
(
decoder_fifo_t
*
,
pes_packet_t
**
)
);
VLC_EXPORT
(
void
,
input_DeletePES
,
(
input_buffers_t
*
,
pes_packet_t
*
)
);
VLC_EXPORT
(
int
,
InitBitstream
,
(
bit_stream_t
*
,
decoder_fifo_t
*
,
void
(
*
)(
bit_stream_t
*
,
vlc_bool_t
),
void
*
p_callback_arg
)
);
VLC_EXPORT
(
vlc_bool_t
,
NextDataPacket
,
(
decoder_fifo_t
*
,
bit_stream_t
*
)
);
VLC_EXPORT
(
void
,
BitstreamNextDataPacket
,
(
bit_stream_t
*
)
);
VLC_EXPORT
(
uint32_t
,
UnalignedShowBits
,
(
bit_stream_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
UnalignedRemoveBits
,
(
bit_stream_t
*
)
);
VLC_EXPORT
(
uint32_t
,
UnalignedGetBits
,
(
bit_stream_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
CloseBitstream
,
(
bit_stream_t
*
)
);
VLC_EXPORT
(
void
,
CurrentPTS
,
(
bit_stream_t
*
,
mtime_t
*
,
mtime_t
*
)
);
VLC_EXPORT
(
void
,
NextPTS
,
(
bit_stream_t
*
,
mtime_t
*
,
mtime_t
*
)
);
/*****************************************************************************
* AlignWord : fill in the bit buffer so that the byte pointer be aligned
* on a word boundary (XXX: there must be at least sizeof(WORD_TYPE) - 1
* empty bytes in the bit buffer)
*****************************************************************************/
static
inline
void
AlignWord
(
bit_stream_t
*
p_bit_stream
)
{
while
(
(
ptrdiff_t
)
p_bit_stream
->
p_byte
&
(
sizeof
(
WORD_TYPE
)
-
1
)
)
{
if
(
p_bit_stream
->
p_byte
<
p_bit_stream
->
p_end
)
{
p_bit_stream
->
fifo
.
buffer
|=
*
(
p_bit_stream
->
p_byte
++
)
<<
(
8
*
sizeof
(
WORD_TYPE
)
-
8
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
i_available
+=
8
;
}
else
{
BitstreamNextDataPacket
(
p_bit_stream
);
p_bit_stream
->
fifo
.
buffer
|=
*
(
p_bit_stream
->
p_byte
++
)
<<
(
8
*
sizeof
(
WORD_TYPE
)
-
8
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
i_available
+=
8
;
}
}
}
/*****************************************************************************
* ShowBits : return i_bits bits from the bit stream
*****************************************************************************/
static
inline
uint32_t
ShowBits
(
bit_stream_t
*
p_bit_stream
,
unsigned
int
i_bits
)
{
if
(
(
unsigned
int
)
p_bit_stream
->
fifo
.
i_available
>=
i_bits
)
{
return
(
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
)
);
}
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
return
(
(
p_bit_stream
->
fifo
.
buffer
|
(
WORD_AT
(
p_bit_stream
->
p_byte
)
>>
p_bit_stream
->
fifo
.
i_available
))
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
)
);
}
return
(
UnalignedShowBits
(
p_bit_stream
,
i_bits
)
);
}
/*****************************************************************************
* ShowSignedBits : return i_bits bits from the bit stream, using signed
* arithmetic
*****************************************************************************/
static
inline
int32_t
ShowSignedBits
(
bit_stream_t
*
p_bit_stream
,
unsigned
int
i_bits
)
{
if
(
(
unsigned
int
)
p_bit_stream
->
fifo
.
i_available
>=
i_bits
)
{
return
(
(
WORD_SIGNED
)
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
)
);
}
/* You can probably do something a little faster, but now I'm tired. */
return
(
(
WORD_SIGNED
)(
ShowBits
(
p_bit_stream
,
i_bits
)
<<
(
32
-
i_bits
))
>>
(
32
-
i_bits
)
);
}
/*****************************************************************************
* RemoveBits : removes i_bits bits from the bit buffer
* XXX: do not use for 32 bits, see RemoveBits32
*****************************************************************************/
static
inline
void
RemoveBits
(
bit_stream_t
*
p_bit_stream
,
unsigned
int
i_bits
)
{
p_bit_stream
->
fifo
.
i_available
-=
i_bits
;
if
(
p_bit_stream
->
fifo
.
i_available
>=
0
)
{
p_bit_stream
->
fifo
.
buffer
<<=
i_bits
;
return
;
}
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
p_bit_stream
->
fifo
.
buffer
=
WORD_AT
(
p_bit_stream
->
p_byte
)
<<
(
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
p_bit_stream
->
fifo
.
i_available
+=
sizeof
(
WORD_TYPE
)
*
8
;
return
;
}
UnalignedRemoveBits
(
p_bit_stream
);
}
/*****************************************************************************
* RemoveBits32 : removes 32 bits from the bit buffer (and as a side effect,
* refill it)
*****************************************************************************/
#if (WORD_TYPE == uint32_t)
static
inline
void
RemoveBits32
(
bit_stream_t
*
p_bit_stream
)
{
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
if
(
p_bit_stream
->
fifo
.
i_available
)
{
p_bit_stream
->
fifo
.
buffer
=
WORD_AT
(
p_bit_stream
->
p_byte
)
<<
(
32
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
return
;
}
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
return
;
}
p_bit_stream
->
fifo
.
i_available
-=
32
;
UnalignedRemoveBits
(
p_bit_stream
);
}
#else
# define RemoveBits32( p_bit_stream ) RemoveBits( p_bit_stream, 32 )
#endif
/*****************************************************************************
* GetBits : returns i_bits bits from the bit stream and removes them
* XXX: do not use for 32 bits, see GetBits32
*****************************************************************************/
static
inline
uint32_t
GetBits
(
bit_stream_t
*
p_bit_stream
,
unsigned
int
i_bits
)
{
uint32_t
i_result
;
p_bit_stream
->
fifo
.
i_available
-=
i_bits
;
if
(
p_bit_stream
->
fifo
.
i_available
>=
0
)
{
i_result
=
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
);
p_bit_stream
->
fifo
.
buffer
<<=
i_bits
;
return
(
i_result
);
}
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
i_result
=
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
);
p_bit_stream
->
fifo
.
buffer
=
WORD_AT
(
p_bit_stream
->
p_byte
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
i_result
|=
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
+
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
buffer
<<=
(
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
i_available
+=
sizeof
(
WORD_TYPE
)
*
8
;
return
(
i_result
);
}
return
UnalignedGetBits
(
p_bit_stream
,
i_bits
);
}
/*****************************************************************************
* GetSignedBits : returns i_bits bits from the bit stream and removes them,
* using signed arithmetic
* XXX: do not use for 32 bits
*****************************************************************************/
static
inline
int32_t
GetSignedBits
(
bit_stream_t
*
p_bit_stream
,
unsigned
int
i_bits
)
{
if
(
(
unsigned
int
)
p_bit_stream
->
fifo
.
i_available
>=
i_bits
)
{
int32_t
i_result
;
p_bit_stream
->
fifo
.
i_available
-=
i_bits
;
i_result
=
(
WORD_SIGNED
)
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
);
p_bit_stream
->
fifo
.
buffer
<<=
i_bits
;
return
(
i_result
);
}
/* You can probably do something a little faster, but now I'm tired. */
return
(
(
WORD_SIGNED
)(
GetBits
(
p_bit_stream
,
i_bits
)
<<
(
32
-
i_bits
))
>>
(
32
-
i_bits
)
);
}
/*****************************************************************************
* GetBits32 : returns 32 bits from the bit stream and removes them
*****************************************************************************/
#if (WORD_TYPE == uint32_t)
static
inline
uint32_t
GetBits32
(
bit_stream_t
*
p_bit_stream
)
{
uint32_t
i_result
;
if
(
p_bit_stream
->
fifo
.
i_available
==
32
)
{
p_bit_stream
->
fifo
.
i_available
=
0
;
i_result
=
p_bit_stream
->
fifo
.
buffer
;
p_bit_stream
->
fifo
.
buffer
=
0
;
return
(
i_result
);
}
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
if
(
p_bit_stream
->
fifo
.
i_available
)
{
i_result
=
p_bit_stream
->
fifo
.
buffer
;
p_bit_stream
->
fifo
.
buffer
=
WORD_AT
(
p_bit_stream
->
p_byte
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
i_result
|=
p_bit_stream
->
fifo
.
buffer
>>
(
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
buffer
<<=
(
32
-
p_bit_stream
->
fifo
.
i_available
);
return
(
i_result
);
}
i_result
=
WORD_AT
(
p_bit_stream
->
p_byte
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
(
((
WORD_TYPE
*
)
p_bit_stream
->
p_byte
)
+
1
);
return
(
i_result
);
}
p_bit_stream
->
fifo
.
i_available
-=
32
;
return
UnalignedGetBits
(
p_bit_stream
,
32
);
}
#else
# define GetBits32( p_bit_stream ) GetBits( p_bit_stream, 32 )
#endif
/*****************************************************************************
* RealignBits : realigns the bit buffer on an 8-bit boundary
*****************************************************************************/
static
inline
void
RealignBits
(
bit_stream_t
*
p_bit_stream
)
{
p_bit_stream
->
fifo
.
buffer
<<=
(
p_bit_stream
->
fifo
.
i_available
&
0x7
);
p_bit_stream
->
fifo
.
i_available
&=
~
0x7
;
}
/*****************************************************************************
* GetChunk : reads a large chunk of data
*****************************************************************************
* The position in the stream must be byte-aligned, if unsure call
* RealignBits(). p_buffer must point to a buffer at least as big as i_buf_len
* otherwise your code will crash.
*****************************************************************************/
static
inline
void
GetChunk
(
bit_stream_t
*
p_bit_stream
,
byte_t
*
p_buffer
,
size_t
i_buf_len
)
{
ptrdiff_t
i_available
;
/* We need to take care because i_buf_len may be < 4. */
while
(
p_bit_stream
->
fifo
.
i_available
>
0
&&
i_buf_len
)
{
*
p_buffer
=
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
8
);
p_buffer
++
;
i_buf_len
--
;
p_bit_stream
->
fifo
.
buffer
<<=
8
;
p_bit_stream
->
fifo
.
i_available
-=
8
;
}
i_available
=
p_bit_stream
->
p_end
-
p_bit_stream
->
p_byte
;
if
(
i_available
>=
(
ptrdiff_t
)
i_buf_len
)
{
p_bit_stream
->
p_decoder_fifo
->
p_vlc
->
pf_memcpy
(
p_buffer
,
p_bit_stream
->
p_byte
,
i_buf_len
);
p_bit_stream
->
p_byte
+=
i_buf_len
;
}
else
{
do
{
p_bit_stream
->
p_decoder_fifo
->
p_vlc
->
pf_memcpy
(
p_buffer
,
p_bit_stream
->
p_byte
,
i_available
);
p_bit_stream
->
p_byte
=
p_bit_stream
->
p_end
;
p_buffer
+=
i_available
;
i_buf_len
-=
i_available
;
BitstreamNextDataPacket
(
p_bit_stream
);
if
(
p_bit_stream
->
p_decoder_fifo
->
b_die
)
return
;
}
while
(
(
i_available
=
p_bit_stream
->
p_end
-
p_bit_stream
->
p_byte
)
<=
(
ptrdiff_t
)
i_buf_len
);
if
(
i_buf_len
)
{
p_bit_stream
->
p_decoder_fifo
->
p_vlc
->
pf_memcpy
(
p_buffer
,
p_bit_stream
->
p_byte
,
i_buf_len
);
p_bit_stream
->
p_byte
+=
i_buf_len
;
}
}
if
(
p_bit_stream
->
p_byte
<=
p_bit_stream
->
p_end
-
sizeof
(
WORD_TYPE
)
)
{
AlignWord
(
p_bit_stream
);
}
}
/*
* Communication interface between input and decoders
*/
/*****************************************************************************
* Prototypes from input_dec.c
*****************************************************************************/
VLC_EXPORT
(
void
,
DecoderError
,
(
decoder_fifo_t
*
p_fifo
)
);
#endif
/* "input_ext-dec.h" */
include/input_ext-intf.h
View file @
3439df81
...
...
@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.
99 2003/11/22 18:04:10 gbazin
Exp $
* $Id: input_ext-intf.h,v 1.
100 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -68,10 +68,11 @@ struct es_descriptor_t
/* Decoder information */
es_format_t
fmt
;
decoder_fifo_t
*
p_decoder_fifo
;
void
*
p_waveformatex
;
void
*
p_bitmapinfoheader
;
void
*
p_spuinfo
;
/* Decoder */
decoder_t
*
p_dec
;
count_t
c_packets
;
/* total packets read */
count_t
c_invalid_packets
;
/* invalid packets read */
...
...
include/input_ext-plugins.h
View file @
3439df81
...
...
@@ -3,7 +3,7 @@
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.4
2 2003/05/05 22:23:31 gbazin
Exp $
* $Id: input_ext-plugins.h,v 1.4
3 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -55,9 +55,12 @@ VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) );
/*****************************************************************************
* Prototypes from input_dec.c
*****************************************************************************/
decoder_
fifo_
t
*
input_RunDecoder
(
input_thread_t
*
,
es_descriptor_t
*
);
decoder_t
*
input_RunDecoder
(
input_thread_t
*
,
es_descriptor_t
*
);
void
input_EndDecoder
(
input_thread_t
*
,
es_descriptor_t
*
);
VLC_EXPORT
(
void
,
input_DecodePES
,
(
decoder_fifo_t
*
,
pes_packet_t
*
)
);
VLC_EXPORT
(
void
,
input_DecodePES
,
(
decoder_t
*
,
pes_packet_t
*
)
);
void
input_DecodeBlock
(
decoder_t
*
,
block_t
*
);
void
input_EscapeDiscontinuity
(
input_thread_t
*
);
void
input_EscapeAudioDiscontinuity
(
input_thread_t
*
);
VLC_EXPORT
(
void
,
input_NullPacket
,
(
input_thread_t
*
,
es_descriptor_t
*
)
);
...
...
include/vlc_codec.h
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* vlc_codec.h: codec related structures
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: vlc_codec.h,v 1.
4 2003/11/16 21:07:30 gbazin
Exp $
* $Id: vlc_codec.h,v 1.
5 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -48,12 +48,6 @@ struct decoder_t
module_t
*
p_module
;
decoder_sys_t
*
p_sys
;
/* Deprecated */
int
(
*
pf_decode
)(
decoder_t
*
,
block_t
*
);
decoder_fifo_t
*
p_fifo
;
int
(
*
pf_run
)
(
decoder_fifo_t
*
);
/* End deprecated */
picture_t
*
(
*
pf_decode_video
)(
decoder_t
*
,
block_t
**
);
aout_buffer_t
*
(
*
pf_decode_audio
)(
decoder_t
*
,
block_t
**
);
void
(
*
pf_decode_sub
)
(
decoder_t
*
,
block_t
**
);
...
...
include/vlc_common.h
View file @
3439df81
...
...
@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.
89 2003/11/22 13:56:21 ipkiss
Exp $
* $Id: vlc_common.h,v 1.
90 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
...
...
@@ -270,7 +270,6 @@ typedef struct sout_cfg_t sout_cfg_t;
typedef struct slp_session_t slp_session_t;*/
/* Decoders */
typedef
struct
decoder_fifo_t
decoder_fifo_t
;
typedef
struct
decoder_t
decoder_t
;
typedef
struct
decoder_sys_t
decoder_sys_t
;
...
...
@@ -284,7 +283,6 @@ typedef struct data_buffer_t data_buffer_t;
typedef
struct
stream_position_t
stream_position_t
;
typedef
struct
stream_ctrl_t
stream_ctrl_t
;
typedef
struct
pes_packet_t
pes_packet_t
;
typedef
struct
bit_stream_t
bit_stream_t
;
typedef
struct
network_socket_t
network_socket_t
;
typedef
struct
iso639_lang_t
iso639_lang_t
;
...
...
include/vlc_es.h
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* vlc_es.h
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: vlc_es.h,v 1.
3 2003/11/22 18:04:10 gbazin
Exp $
* $Id: vlc_es.h,v 1.
4 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -87,6 +87,11 @@ struct subs_format_t
{
char
*
psz_encoding
;
struct
{
/* FIXME */
uint32_t
palette
[
16
+
1
];
}
spu
;
};
/**
...
...
include/vlc_objects.h
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* vlc_objects.h: vlc_object_t definition.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlc_objects.h,v 1.2
0 2003/10/14 22:41:41 gbazin
Exp $
* $Id: vlc_objects.h,v 1.2
1 2003/11/24 00:39:00 fenrir
Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -40,8 +40,6 @@
#define VLC_OBJECT_ITEM (-6)
#define VLC_OBJECT_INPUT (-7)
#define VLC_OBJECT_DECODER (-8)
/* tmp for backward compat */
#define VLC_OBJECT_DECODER_FIFO (-999)
#define VLC_OBJECT_VOUT (-9)
#define VLC_OBJECT_AOUT (-10)
#define VLC_OBJECT_SOUT (-11)
...
...
modules/access/cdda.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* cdda.c : CD digital audio input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: cdda.c,v 1.
6 2003/09/07 22:49:05
fenrir Exp $
* $Id: cdda.c,v 1.
7 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -492,9 +492,9 @@ static int CDDADemux( input_thread_t * p_input )
p_input
->
stream
.
p_selected_program
,
p_demux
->
i_pts
);
if
(
p_demux
->
p_es
->
p_dec
oder_fifo
)
if
(
p_demux
->
p_es
->
p_dec
)
{
input_DecodePES
(
p_demux
->
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_demux
->
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
modules/access/cddax.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* cddax.c : CD digital audio input module for vlc using libcdio
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: cddax.c,v 1.
4 2003/11/23 14:34:19 rocky
Exp $
* $Id: cddax.c,v 1.
5 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -629,9 +629,9 @@ static int CDDADemux( input_thread_t * p_input )
p_input
->
stream
.
p_selected_program
,
p_demux
->
i_pts
);
if
(
p_demux
->
p_es
->
p_dec
oder_fifo
)
if
(
p_demux
->
p_es
->
p_dec
)
{
input_DecodePES
(
p_demux
->
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_demux
->
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
modules/access/dshow/dshow.cpp
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* dshow.cpp : DirectShow access module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: dshow.cpp,v 1.1
3 2003/11/05 02:43:55 gbazin
Exp $
* $Id: dshow.cpp,v 1.1
4 2003/11/24 00:39:01 fenrir
Exp $
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -1331,7 +1331,7 @@ static int Demux( input_thread_t *p_input )
p_pes
->
p_first
->
p_payload_start
+=
16
;
p_pes
->
i_pes_size
-=
16
;
if
(
p_es
&&
p_es
->
p_dec
oder_fifo
)
if
(
p_es
&&
p_es
->
p_dec
)
{
/* Call the pace control. */
input_ClockManageRef
(
p_input
,
p_input
->
stream
.
p_selected_program
,
...
...
@@ -1341,7 +1341,7 @@ static int Demux( input_thread_t *p_input )
input_ClockGetTS
(
p_input
,
p_input
->
stream
.
p_selected_program
,
i_pcr
);
input_DecodePES
(
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
modules/access/dvb/access.c
View file @
3439df81
...
...
@@ -554,7 +554,7 @@ void E_(Close) ( vlc_object_t *p_this )
i_es_index
++
)
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if
(
p_es
->
p_dec
oder_fifo
)
if
(
p_es
->
p_dec
)
{
ioctl_UnsetDMXFilter
(
p_input
,
p_es
->
i_demux_fd
);
}
...
...
@@ -641,7 +641,7 @@ int SatelliteSetProgram( input_thread_t * p_input,
i_es_index
++
)
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if
(
p_es
->
p_dec
oder_fifo
)
if
(
p_es
->
p_dec
)
{
input_UnselectES
(
p_input
,
p_es
);
}
...
...
modules/access/satellite/access.c
View file @
3439df81
...
...
@@ -331,7 +331,7 @@ void E_(Close) ( vlc_object_t *p_this )
i_es_index
++
)
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if
(
p_es
->
p_dec
oder_fifo
)
if
(
p_es
->
p_dec
)
{
ioctl_UnsetDMXFilter
(
p_es
->
i_demux_fd
);
}
...
...
@@ -420,7 +420,7 @@ int SatelliteSetProgram( input_thread_t * p_input,
i_es_index
++
)
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if
(
p_es
->
p_dec
oder_fifo
)
if
(
p_es
->
p_dec
)
{
input_UnselectES
(
p_input
,
p_es
);
}
...
...
modules/access/v4l/v4l.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: v4l.c,v 1.3
1 2003/11/23 18:31:54 alexis
Exp $
* $Id: v4l.c,v 1.3
2 2003/11/24 00:39:01 fenrir
Exp $
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
* Paul Forgey <paulf at aphrodite dot com>
...
...
@@ -1657,19 +1657,12 @@ static int Demux( input_thread_t *p_input )
p_pes
->
p_first
->
p_payload_start
+=
16
;
p_pes
->
i_pes_size
-=
16
;
if
(
p_es
&&
p_es
->
p_dec
oder_fifo
)
if
(
p_es
&&
p_es
->
p_dec
)
{
vlc_mutex_lock
(
&
p_es
->
p_decoder_fifo
->
data_lock
);
if
(
p_es
->
p_decoder_fifo
->
i_depth
>=
MAX_PACKETS_IN_FIFO
)
{
/* Wait for the decoder. */
vlc_cond_wait
(
&
p_es
->
p_decoder_fifo
->
data_wait
,
&
p_es
->
p_decoder_fifo
->
data_lock
);
}
vlc_mutex_unlock
(
&
p_es
->
p_decoder_fifo
->
data_lock
);
p_pes
->
i_pts
=
p_pes
->
i_dts
=
i_pts
+
p_input
->
i_pts_delay
;
p_pes
->
i_pts
=
p_pes
->
i_dts
=
i_pts
+
p_input
->
i_pts_delay
;
input_DecodePES
(
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
modules/codec/dvbsub.c
View file @
3439df81
...
...
@@ -2,7 +2,8 @@
* dvbsub.c : DVB subtitles decoder thread
*****************************************************************************
* Copyright (C) 2003 ANEVIA
* $Id: dvbsub.c,v 1.4 2003/11/22 23:39:14 fenrir Exp $
* Copyright (C) 2003 VideoLAN
* $Id: dvbsub.c,v 1.5 2003/11/24 00:39:01 fenrir Exp $
*
* Authors: Damien LUCAS <damien.lucas@anevia.com>
*
...
...
@@ -27,7 +28,21 @@
#include <vlc/vout.h>
#include <vlc/decoder.h>
#include "codecs.h"
#include "vlc_bits.h"
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
p_this
);
static
void
Close
(
vlc_object_t
*
p_this
);
vlc_module_begin
();
add_category_hint
(
N_
(
"subtitles"
),
NULL
,
VLC_TRUE
);
set_description
(
_
(
"subtitles decoder"
)
);
set_capability
(
"decoder"
,
50
);
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
// Wow, that's ugly but very usefull for a memory leak track
// so I just keep it
...
...
@@ -175,16 +190,7 @@ typedef struct
dvbsub_object_t
*
p_objects
;
subpicture_t
*
p_spu
[
16
];
}
dvbsub_all_t
;
typedef
struct
{
/* Thread properties and locks */
vlc_thread_t
thread_id
;
/* Id for thread functions */
/* Input properties */
decoder_fifo_t
*
p_fifo
;
/* Stores the PES stream data */
bit_stream_t
bit_stream
;
/* PES data at the bit level */
/* Output properties */
vout_thread_t
*
p_vout
;
/* Needed to create the subpictures */
}
dvbsub_thread_t
;
struct
subpicture_sys_t
{
mtime_t
i_pts
;
...
...
@@ -192,6 +198,16 @@ struct subpicture_sys_t
vlc_object_t
*
p_input
;
/* Link to the input */
vlc_bool_t
b_obsolete
;
};
struct
decoder_sys_t
{
vout_thread_t
*
p_vout
;
mtime_t
i_pts
;
bs_t
bs
;
};
// List of different SEGMENT TYPES
// According to EN 300-743, table 2
#define DVBSUB_ST_PAGE_COMPOSITION 0x10
...
...
@@ -218,11 +234,10 @@ struct subpicture_sys_t
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
RunDecoder
(
decoder_fifo_t
*
);
static
int
InitThread
(
dvbsub_thread_t
*
);
static
void
EndThread
(
dvbsub_thread_t
*
i
,
dvbsub_all_t
*
);
static
vout_thread_t
*
FindVout
(
dvbsub_thread_t
*
);
static
void
Decode
(
decoder_t
*
,
block_t
**
);
static
vout_thread_t
*
FindVout
(
decoder_t
*
);
static
void
RenderI42x
(
vout_thread_t
*
,
picture_t
*
,
const
subpicture_t
*
,
vlc_bool_t
);
static
void
RenderYUY2
(
vout_thread_t
*
,
picture_t
*
,
const
subpicture_t
*
,
...
...
@@ -256,30 +271,59 @@ static void free_all ( dvbsub_all_t* p_a );
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
vlc_module_begin
();
add_category_hint
(
N_
(
"subtitles"
),
NULL
,
VLC_TRUE
);
set_description
(
_
(
"subtitles decoder"
)
);
set_capability
(
"decoder"
,
50
);
set_callbacks
(
OpenDecoder
,
NULL
);
vlc_module_end
();
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
* Open: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static
int
Open
Decoder
(
vlc_object_t
*
p_this
)
static
int
Open
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
;
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
'd'
,
'v'
,
'b'
,
's'
)
)
{
return
VLC_EGENERIC
;
}
p_dec
->
pf_run
=
RunDecoder
;
p_dec
->
pf_decode_subs
=
Decode
;
p_sys
=
p_dec
->
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
)
);
p_sys
->
p_vout
=
NULL
;
p_sys
->
i_pts
=
0
;
es_format_Init
(
&
p_dec
->
fmt_out
,
SPU_ES
,
VLC_FOURCC
(
'd'
,
'v'
,
'b'
,
's'
)
);
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Close:
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_sys
->
p_vout
&&
p_sys
->
p_vout
->
p_subpicture
!=
NULL
)
{
subpicture_t
*
p_subpic
;
int
i_subpic
;
for
(
i_subpic
=
0
;
i_subpic
<
VOUT_MAX_SUBPICTURES
;
i_subpic
++
)
{
p_subpic
=
&
p_sys
->
p_vout
->
p_subpicture
[
i_subpic
];
if
(
p_subpic
!=
NULL
&&
(
(
p_subpic
->
i_status
==
RESERVED_SUBPICTURE
)
||
(
p_subpic
->
i_status
==
READY_SUBPICTURE
)
)
)
{
vout_DestroySubPicture
(
p_sys
->
p_vout
,
p_subpic
);
}
}
}
trox_call
();
}
/*****************************************************************************
* RunDecoder: this function is called just after the thread is created
*****************************************************************************/
...
...
@@ -350,56 +394,30 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
free_all
(
&
dvbsub
);
return
0
;
}
/* following functions are local */
/*****************************************************************************
* InitThread: initialize dvbsub decoder thread
*****************************************************************************
* This function is called from RunThread and performs the second step of the
* initialization. It returns 0 on success. Note that the thread's flag are not
* modified inside this function.
*****************************************************************************/
static
int
InitThread
(
dvbsub_thread_t
*
p_dvbsubdec
)
{
int
i_ret
;
/* Call InitBitstream anyway so p_spudec->bit_stream is in a known
* state before calling CloseBitstream */
i_ret
=
InitBitstream
(
&
p_dvbsubdec
->
bit_stream
,
p_dvbsubdec
->
p_fifo
,
NULL
,
NULL
);
/* Check for a video output */
p_dvbsubdec
->
p_vout
=
FindVout
(
p_dvbsubdec
);
if
(
!
p_dvbsubdec
->
p_vout
)
{
return
-
1
;
}
/* It was just a check */
vlc_object_release
(
p_dvbsubdec
->
p_vout
);
p_dvbsubdec
->
p_vout
=
NULL
;
return
i_ret
;
}
/*****************************************************************************
* FindVout: Find a vout or wait for one to be created.
*****************************************************************************/
static
vout_thread_t
*
FindVout
(
d
vbsub_thread_t
*
p_spu
dec
)
static
vout_thread_t
*
FindVout
(
d
ecoder_t
*
p_
dec
)
{
vout_thread_t
*
p_vout
=
NULL
;
/* Find an available video output */
do
for
(
;;
)
{
if
(
p_spudec
->
p_fifo
->
b_die
||
p_spudec
->
p_fifo
->
b_error
)
vout_thread_t
*
p_vout
;
if
(
p_dec
->
b_die
||
p_dec
->
b_error
)
{
break
;
return
NULL
;
}
p_vout
=
vlc_object_find
(
p_spudec
->
p_fifo
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
p_vout
=
vlc_object_find
(
p_dec
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
if
(
p_vout
)
{
break
;
return
p_vout
;
}
msleep
(
VOUT_OUTMEM_SLEEP
);
}
while
(
1
);
return
p_vout
;
}
/*****************************************************************************
* EndThread: thread destruction
*****************************************************************************
...
...
modules/codec/ffmpeg/audio.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: audio.c,v 1.2
5 2003/11/22 23:39:14
fenrir Exp $
* $Id: audio.c,v 1.2
6 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -79,6 +79,9 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
AVCodec
*
p_codec
,
int
i_codec_id
,
char
*
psz_namecodec
)
{
decoder_sys_t
*
p_sys
;
vlc_value_t
lockval
;
var_Get
(
p_dec
->
p_libvlc
,
"avcodec"
,
&
lockval
);
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
...
...
@@ -110,15 +113,16 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
}
/* ***** Open the codec ***** */
vlc_mutex_lock
(
lockval
.
p_address
);
if
(
avcodec_open
(
p_sys
->
p_context
,
p_sys
->
p_codec
)
<
0
)
{
vlc_mutex_unlock
(
lockval
.
p_address
);
msg_Err
(
p_dec
,
"cannot open codec (%s)"
,
p_sys
->
psz_namecodec
);
return
VLC_EGENERIC
;
}
else
{
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
}
vlc_mutex_unlock
(
lockval
.
p_address
);
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
p_sys
->
p_output
=
malloc
(
3
*
AVCODEC_MAX_AUDIO_FRAME_SIZE
);
...
...
modules/codec/ffmpeg/video.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* video.c: video decoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.5
1 2003/11/23 20:37:04 gbazin
Exp $
* $Id: video.c,v 1.5
2 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -184,9 +184,13 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
AVCodec
*
p_codec
,
int
i_codec_id
,
char
*
psz_namecodec
)
{
decoder_sys_t
*
p_sys
;
vlc_value_t
lockval
;
vlc_value_t
val
;
int
i_tmp
;
var_Get
(
p_dec
->
p_libvlc
,
"avcodec"
,
&
lockval
);
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
...
...
@@ -224,15 +228,15 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
#endif
/* ***** Open the codec ***** */
vlc_mutex_lock
(
lockval
.
p_address
);
if
(
avcodec_open
(
p_sys
->
p_context
,
p_sys
->
p_codec
)
<
0
)
{
vlc_mutex_unlock
(
lockval
.
p_address
);
msg_Err
(
p_dec
,
"cannot open codec (%s)"
,
p_sys
->
psz_namecodec
);
return
VLC_EGENERIC
;
}
else
{
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
}
vlc_mutex_unlock
(
lockval
.
p_address
);
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
/* ***** ffmpeg frame skipping ***** */
var_Create
(
p_dec
,
"ffmpeg-hurry-up"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
...
...
modules/codec/spudec/parse.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: parse.c,v 1.1
5 2003/11/22 23:39:14
fenrir Exp $
* $Id: parse.c,v 1.1
6 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -225,8 +225,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
case
SPU_CMD_SET_PALETTE
:
/* 03xxxx (palette) */
if
(
p_dec
->
p_fifo
->
p_demux_data
&&
*
(
int
*
)
p_dec
->
p_fifo
->
p_demux_data
==
0xBeeF
)
if
(
p_dec
->
fmt_in
.
subs
.
spu
.
palette
[
0
]
==
0xBeeF
)
{
unsigned
int
idx
[
4
];
...
...
@@ -239,9 +238,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
for
(
i
=
0
;
i
<
4
;
i
++
)
{
uint32_t
i_color
;
i_color
=
((
uint32_t
*
)((
char
*
)
p_dec
->
p_fifo
->
p_demux_data
+
sizeof
(
int
)))[
idx
[
i
]];
uint32_t
i_color
=
p_dec
->
fmt_in
.
subs
.
spu
.
palette
[
1
+
idx
[
i
]];
/* FIXME: this job should be done sooner */
p_spu
->
p_sys
->
pi_yuv
[
3
-
i
][
0
]
=
(
i_color
>>
16
)
&
0xff
;
...
...
modules/demux/flac.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* flac.c : FLAC demux module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: flac.c,v 1.
8 2003/11/21 20:49:13 gbazin
Exp $
* $Id: flac.c,v 1.
9 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -117,12 +117,10 @@ static int Open( vlc_object_t * p_this )
* Load the FLAC packetizer
*/
p_sys
->
p_packetizer
=
vlc_object_create
(
p_input
,
VLC_OBJECT_DECODER
);
p_sys
->
p_packetizer
->
pf_decode
=
0
;
p_sys
->
p_packetizer
->
pf_decode_audio
=
0
;
p_sys
->
p_packetizer
->
pf_decode_video
=
0
;
p_sys
->
p_packetizer
->
pf_decode_sub
=
0
;
p_sys
->
p_packetizer
->
pf_packetize
=
0
;
p_sys
->
p_packetizer
->
pf_run
=
0
;
/* Initialization of decoder structure */
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
AUDIO_ES
,
...
...
modules/demux/mp4/mp4.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.4
1 2003/11/23 13:15:27 gbazin
Exp $
* $Id: mp4.c,v 1.4
2 2003/11/24 00:39:01 fenrir
Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -425,11 +425,11 @@ static int Demux( input_thread_t *p_input )
}
else
if
(
track
.
b_ok
)
{
if
(
track
.
b_selected
&&
track
.
p_es
->
p_dec
oder_fifo
==
NULL
)
if
(
track
.
b_selected
&&
track
.
p_es
->
p_dec
==
NULL
)
{
MP4_TrackUnselect
(
p_input
,
&
track
);
}
else
if
(
!
track
.
b_selected
&&
track
.
p_es
->
p_dec
oder_fifo
!=
NULL
)
else
if
(
!
track
.
b_selected
&&
track
.
p_es
->
p_dec
!=
NULL
)
{
MP4_TrackSelect
(
p_input
,
&
track
,
MP4_GetMoviePTS
(
p_demux
)
);
}
...
...
@@ -532,11 +532,11 @@ static int Demux( input_thread_t *p_input )
p_pes
->
i_pts
=
0
;
}
if
(
track
.
p_es
->
p_dec
oder_fifo
)
if
(
track
.
p_es
->
p_dec
)
{
p_pes
->
i_rate
=
p_input
->
stream
.
control
.
i_rate
;
input_DecodePES
(
track
.
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
track
.
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
@@ -1372,19 +1372,19 @@ static int TrackGotoChunkSample( input_thread_t *p_input,
}
/* select again the new decoder */
if
(
p_track
->
b_selected
&&
p_track
->
p_es
&&
p_track
->
p_es
->
p_dec
oder_fifo
==
NULL
)
if
(
p_track
->
b_selected
&&
p_track
->
p_es
&&
p_track
->
p_es
->
p_dec
==
NULL
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
input_SelectES
(
p_input
,
p_track
->
p_es
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
if
(
p_track
->
p_es
->
p_dec
oder_fifo
)
if
(
p_track
->
p_es
->
p_dec
)
{
if
(
p_track
->
p_pes_init
!=
NULL
)
{
p_track
->
p_pes_init
->
i_rate
=
p_input
->
stream
.
control
.
i_rate
;
input_DecodePES
(
p_track
->
p_es
->
p_dec
oder_fifo
,
input_DecodePES
(
p_track
->
p_es
->
p_dec
,
p_track
->
p_pes_init
);
p_track
->
p_pes_init
=
NULL
;
}
...
...
@@ -1663,7 +1663,7 @@ static void MP4_TrackUnselect(input_thread_t *p_input,
return
;
}
if
(
p_track
->
p_es
->
p_dec
oder_fifo
)
if
(
p_track
->
p_es
->
p_dec
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
input_UnselectES
(
p_input
,
p_track
->
p_es
);
...
...
modules/demux/mpeg/m4v.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* m4v.c : MPEG-4 video Stream input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: m4v.c,v 1.
8 2003/09/10 11:51:00
fenrir Exp $
* $Id: m4v.c,v 1.
9 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -275,7 +275,7 @@ static int Demux( input_thread_t * p_input )
p_input
->
stream
.
p_selected_program
,
p_demux
->
i_dts
);
if
(
!
p_demux
->
p_es
->
p_dec
oder_fifo
)
if
(
!
p_demux
->
p_es
->
p_dec
)
{
msg_Err
(
p_input
,
"no video decoder"
);
input_DeletePES
(
p_input
->
p_method_data
,
p_pes
);
...
...
@@ -283,7 +283,7 @@ static int Demux( input_thread_t * p_input )
}
else
{
input_DecodePES
(
p_demux
->
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_demux
->
p_es
->
p_dec
,
p_pes
);
}
/* FIXME FIXME FIXME FIXME */
p_demux
->
i_dts
+=
(
mtime_t
)
90000
/
25
;
...
...
modules/demux/mpeg/mpgv.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* mpgv.c : MPEG-I/II Video demuxer
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mpgv.c,v 1.
1 2003/11/22 17:03:57
fenrir Exp $
* $Id: mpgv.c,v 1.
2 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -130,12 +130,10 @@ static int Open( vlc_object_t * p_this )
* Load the mpegvideo packetizer
*/
p_sys
->
p_packetizer
=
vlc_object_create
(
p_input
,
VLC_OBJECT_PACKETIZER
);
p_sys
->
p_packetizer
->
pf_decode
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_audio
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_video
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_sub
=
NULL
;
p_sys
->
p_packetizer
->
pf_packetize
=
NULL
;
p_sys
->
p_packetizer
->
pf_run
=
NULL
;
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
VIDEO_ES
,
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
)
);
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_out
,
UNKNOWN_ES
,
0
);
p_sys
->
p_packetizer
->
p_module
=
...
...
modules/demux/mpeg/system.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: system.c,v 1.
19 2003/11/06 16:36:41 nitrox
Exp $
* $Id: system.c,v 1.
20 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
...
@@ -414,11 +414,11 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
/* Now we can eventually put the PES packet in the decoder's
* PES fifo */
if
(
p_es
->
p_dec
oder_fifo
!=
NULL
)
if
(
p_es
->
p_dec
!=
NULL
)
{
input_DecodePES
(
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_es
->
p_dec
,
p_pes
);
}
else
if
(
p_es
->
p_dec
oder_fifo
==
NULL
&&
else
if
(
p_es
->
p_dec
==
NULL
&&
((
es_ts_data_t
*
)
p_es
->
p_demux_data
)
->
b_dvbsub
)
{
es_descriptor_t
*
p_dvbsub
;
...
...
@@ -430,9 +430,9 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
for
(
i
=
0
;
i
<
i_count
;
i
++
)
{
p_dvbsub
=
((
es_ts_data_t
*
)
p_es
->
p_demux_data
)
->
p_dvbsub_es
[
i
];
if
(
p_dvbsub
->
p_dec
oder_fifo
!=
NULL
)
if
(
p_dvbsub
->
p_dec
!=
NULL
)
{
input_DecodePES
(
p_dvbsub
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_dvbsub
->
p_dec
,
p_pes
);
break
;
}
}
...
...
@@ -1112,7 +1112,7 @@ static void DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
p_es
=
ParsePS
(
p_input
,
p_data
);
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
if
(
p_es
!=
NULL
&&
p_es
->
p_dec
oder_fifo
!=
NULL
if
(
p_es
!=
NULL
&&
p_es
->
p_dec
!=
NULL
&&
(
p_es
->
i_cat
!=
AUDIO_ES
||
!
p_input
->
stream
.
control
.
b_mute
)
)
{
vlc_mutex_unlock
(
&
p_input
->
stream
.
control
.
control_lock
);
...
...
@@ -1271,7 +1271,7 @@ static void DemuxTS( input_thread_t * p_input, data_packet_t * p_data,
/* Not selected. Just read the adaptation field for a PCR. */
b_trash
=
1
;
}
else
if
(
p_es
->
p_dec
oder_fifo
==
NULL
&&
!
b_psi
&&
!
b_dvbsub
)
else
if
(
p_es
->
p_dec
==
NULL
&&
!
b_psi
&&
!
b_dvbsub
)
{
b_trash
=
1
;
}
...
...
@@ -1284,7 +1284,7 @@ static void DemuxTS( input_thread_t * p_input, data_packet_t * p_data,
* may still be null. Who said it was ugly ?
* I have written worse. --Meuuh */
if
(
(
p_es
)
&&
((
p_es
->
p_dec
oder_fifo
!=
NULL
)
||
b_psi
||
b_pcr
||
b_dvbsub
)
)
((
p_es
->
p_dec
!=
NULL
)
||
b_psi
||
b_pcr
||
b_dvbsub
)
)
{
p_es
->
c_packets
++
;
...
...
modules/demux/rawdv.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* rawdv.c : raw dv input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rawdv.c,v 1.1
0 2003/09/07 22:48:29
fenrir Exp $
* $Id: rawdv.c,v 1.1
1 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -374,7 +374,7 @@ static int Demux( input_thread_t * p_input )
}
/* Build video PES packet */
if
(
p_rawdv
->
p_video_es
->
p_dec
oder_fifo
)
if
(
p_rawdv
->
p_video_es
->
p_dec
)
{
p_pes
=
input_NewPES
(
p_input
->
p_method_data
);
if
(
p_pes
==
NULL
)
...
...
@@ -394,7 +394,7 @@ static int Demux( input_thread_t * p_input )
}
/* Do the same for audio */
if
(
p_rawdv
->
p_audio_es
->
p_dec
oder_fifo
)
if
(
p_rawdv
->
p_audio_es
->
p_dec
)
{
p_audio_pes
=
input_NewPES
(
p_input
->
p_method_data
);
if
(
p_audio_pes
==
NULL
)
...
...
@@ -405,7 +405,7 @@ static int Demux( input_thread_t * p_input )
}
p_audio_pes
->
i_rate
=
p_input
->
stream
.
control
.
i_rate
;
if
(
p_rawdv
->
p_video_es
->
p_dec
oder_fifo
)
if
(
p_rawdv
->
p_video_es
->
p_dec
)
p_audio_pes
->
p_first
=
p_audio_pes
->
p_last
=
input_ShareBuffer
(
p_input
->
p_method_data
,
p_data
->
p_buffer
);
else
...
...
@@ -422,15 +422,15 @@ static int Demux( input_thread_t * p_input )
}
/* Decode PES packets if stream is selected */
if
(
p_rawdv
->
p_video_es
->
p_dec
oder_fifo
)
input_DecodePES
(
p_rawdv
->
p_video_es
->
p_dec
oder_fifo
,
p_pes
);
if
(
p_rawdv
->
p_audio_es
->
p_dec
oder_fifo
)
input_DecodePES
(
p_rawdv
->
p_audio_es
->
p_dec
oder_fifo
,
p_audio_pes
);
if
(
p_rawdv
->
p_video_es
->
p_dec
)
input_DecodePES
(
p_rawdv
->
p_video_es
->
p_dec
,
p_pes
);
if
(
p_rawdv
->
p_audio_es
->
p_dec
)
input_DecodePES
(
p_rawdv
->
p_audio_es
->
p_dec
,
p_audio_pes
);
p_rawdv
->
i_pcr
+=
(
90000
/
p_rawdv
->
f_rate
);
if
(
!
p_rawdv
->
p_video_es
->
p_dec
oder_fifo
&&
!
p_rawdv
->
p_audio_es
->
p_dec
oder_fifo
)
if
(
!
p_rawdv
->
p_video_es
->
p_dec
&&
!
p_rawdv
->
p_audio_es
->
p_dec
)
input_DeletePacket
(
p_input
->
p_method_data
,
p_data
);
return
1
;
...
...
modules/gui/beos/VlcWrapper.cpp
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.cpp,v 1.3
8 2003/10/21 01:48:02 tite
r Exp $
* $Id: VlcWrapper.cpp,v 1.3
9 2003/11/24 00:39:01 fenri
r Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -1005,7 +1005,7 @@ void VlcWrapper::FilterChange()
for
(
unsigned
int
i
=
0
;
i
<
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
(
p_input
->
stream
.
pp_es
[
i
]
->
i_cat
==
VIDEO_ES
)
&&
(
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
oder_fifo
!=
NULL
)
)
(
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
!=
NULL
)
)
{
input_UnselectES
(
p_input
,
p_input
->
stream
.
pp_es
[
i
]
);
input_SelectES
(
p_input
,
p_input
->
stream
.
pp_es
[
i
]
);
...
...
modules/gui/gtk/menu.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: menu.c,v 1.1
1 2003/08/04 12:34:20 jpsaman
Exp $
* $Id: menu.c,v 1.1
2 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
...
...
@@ -398,7 +398,7 @@ static void GtkDeinterlaceUpdate( intf_thread_t *p_intf, char *psz_mode )
for
(
i
=
0
;
i
<
p_intf
->
p_sys
->
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
(
ES
->
i_cat
==
VIDEO_ES
)
&&
ES
->
p_dec
oder_fifo
!=
NULL
)
ES
->
p_dec
!=
NULL
)
{
input_UnselectES
(
p_intf
->
p_sys
->
p_input
,
ES
);
input_SelectES
(
p_intf
->
p_sys
->
p_input
,
ES
);
...
...
modules/stream_out/display.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* display.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: display.c,v 1.
7 2003/11/21 15:32:08
fenrir Exp $
* $Id: display.c,v 1.
8 2003/11/24 00:39:01
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -271,9 +271,9 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
p_buffer
->
p_buffer
,
p_buffer
->
i_size
);
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
input_DecodePES
(
id
->
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
id
->
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
src/input/input.c
View file @
3439df81
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.26
0 2003/11/22 13:19:30 gbazin
Exp $
* $Id: input.c,v 1.26
1 2003/11/24 00:39:01 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -30,6 +30,7 @@
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <vlc/decoder.h>
#include <vlc/vout.h>
#ifdef HAVE_SYS_TIMES_H
...
...
@@ -1134,7 +1135,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
msg_Err
(
p_input
,
"FIXME unselect es in es_out_Add"
);
}
input_SelectES
(
p_input
,
id
->
p_es
);
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
out
->
p_sys
->
i_audio
=
fmt
->
i_priority
;
}
...
...
@@ -1146,7 +1147,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
msg_Err
(
p_input
,
"FIXME unselect es in es_out_Add"
);
}
input_SelectES
(
p_input
,
id
->
p_es
);
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
out
->
p_sys
->
i_video
=
fmt
->
i_priority
;
}
...
...
@@ -1220,31 +1221,9 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
static
int
EsOutSend
(
es_out_t
*
out
,
es_out_id_t
*
id
,
block_t
*
p_block
)
{
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
pes_packet_t
*
p_pes
;
if
(
!
(
p_pes
=
input_NewPES
(
out
->
p_sys
->
p_input
->
p_method_data
)
)
)
{
return
VLC_SUCCESS
;
}
p_pes
->
p_first
=
p_pes
->
p_last
=
input_NewPacket
(
out
->
p_sys
->
p_input
->
p_method_data
,
p_block
->
i_buffer
);
p_pes
->
i_nb_data
=
1
;
p_pes
->
i_pts
=
p_block
->
i_pts
;
p_pes
->
i_dts
=
p_block
->
i_dts
;
p_pes
->
p_first
->
p_payload_end
=
p_pes
->
p_first
->
p_payload_start
+
p_block
->
i_buffer
;
memcpy
(
p_pes
->
p_first
->
p_payload_start
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
block_Release
(
p_block
);
input_DecodePES
(
id
->
p_es
->
p_decoder_fifo
,
p_pes
);
input_DecodeBlock
(
id
->
p_es
->
p_dec
,
p_block
);
}
else
{
...
...
@@ -1255,9 +1234,9 @@ static int EsOutSend( es_out_t *out, es_out_id_t *id, block_t *p_block )
static
int
EsOutSendPES
(
es_out_t
*
out
,
es_out_id_t
*
id
,
pes_packet_t
*
p_pes
)
{
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
input_DecodePES
(
id
->
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
id
->
p_es
->
p_dec
,
p_pes
);
}
else
{
...
...
@@ -1273,7 +1252,7 @@ static void EsOutDel( es_out_t *out, es_out_id_t *id )
TAB_REMOVE
(
p_sys
->
i_id
,
p_sys
->
id
,
id
);
vlc_mutex_lock
(
&
p_sys
->
p_input
->
stream
.
stream_lock
);
if
(
id
->
p_es
->
p_dec
oder_fifo
)
if
(
id
->
p_es
->
p_dec
)
{
input_UnselectES
(
p_sys
->
p_input
,
id
->
p_es
);
}
...
...
@@ -1304,13 +1283,13 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
vlc_mutex_lock
(
&
p_sys
->
p_input
->
stream
.
stream_lock
);
id
=
(
es_out_id_t
*
)
va_arg
(
args
,
es_out_id_t
*
);
b
=
(
vlc_bool_t
)
va_arg
(
args
,
vlc_bool_t
);
if
(
b
&&
id
->
p_es
->
p_dec
oder_fifo
==
NULL
)
if
(
b
&&
id
->
p_es
->
p_dec
==
NULL
)
{
input_SelectES
(
p_sys
->
p_input
,
id
->
p_es
);
vlc_mutex_unlock
(
&
p_sys
->
p_input
->
stream
.
stream_lock
);
return
id
->
p_es
->
p_dec
oder_fifo
?
VLC_SUCCESS
:
VLC_EGENERIC
;
return
id
->
p_es
->
p_dec
?
VLC_SUCCESS
:
VLC_EGENERIC
;
}
else
if
(
!
b
&&
id
->
p_es
->
p_dec
oder_fifo
)
else
if
(
!
b
&&
id
->
p_es
->
p_dec
)
{
input_UnselectES
(
p_sys
->
p_input
,
id
->
p_es
);
vlc_mutex_unlock
(
&
p_sys
->
p_input
->
stream
.
stream_lock
);
...
...
@@ -1320,7 +1299,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
id
=
(
es_out_id_t
*
)
va_arg
(
args
,
es_out_id_t
*
);
pb
=
(
vlc_bool_t
*
)
va_arg
(
args
,
vlc_bool_t
*
);
*
pb
=
id
->
p_es
->
p_dec
oder_fifo
?
VLC_TRUE
:
VLC_FALSE
;
*
pb
=
id
->
p_es
->
p_dec
?
VLC_TRUE
:
VLC_FALSE
;
return
VLC_SUCCESS
;
default:
...
...
src/input/input_dec.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dec.c,v 1.7
5 2003/11/23 18:21:48 gbazin
Exp $
* $Id: input_dec.c,v 1.7
6 2003/11/24 00:39:02 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -52,14 +52,32 @@ static void vout_del_buffer( decoder_t *, picture_t * );
static
es_format_t
null_es_format
=
{
0
};
struct
decoder_owner_sys_t
{
aout_instance_t
*
p_aout
;
aout_input_t
*
p_aout_input
;
vout_thread_t
*
p_vout
;
sout_packetizer_input_t
*
p_sout
;
/* Current format in use by the output */
video_format_t
video
;
audio_format_t
audio
;
es_format_t
sout
;
/* fifo */
block_fifo_t
*
p_fifo
;
};
/*****************************************************************************
* input_RunDecoder: spawns a new decoder thread
*****************************************************************************/
decoder_fifo_t
*
input_RunDecoder
(
input_thread_t
*
p_input
,
es_descriptor_t
*
p_es
)
decoder_t
*
input_RunDecoder
(
input_thread_t
*
p_input
,
es_descriptor_t
*
p_es
)
{
vlc_value_t
val
;
decoder_t
*
p_dec
=
NULL
;
vlc_value_t
val
;
int
i_priority
;
/* If we are in sout mode, search for packetizer module */
...
...
@@ -112,7 +130,7 @@ decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
{
msg_Err
(
p_dec
,
"no suitable decoder module for fourcc `%4.4s'.
\n
"
"VLC probably does not support this sound or video format."
,
(
char
*
)
&
p_dec
->
p_fifo
->
i_fourc
c
);
(
char
*
)
&
p_dec
->
fmt_in
.
i_code
c
);
DeleteDecoder
(
p_dec
);
vlc_object_destroy
(
p_dec
);
...
...
@@ -142,7 +160,7 @@ decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
p_input
->
stream
.
b_changed
=
1
;
return
p_dec
->
p_fifo
;
return
p_dec
;
}
/*****************************************************************************
...
...
@@ -150,11 +168,10 @@ decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
*****************************************************************************/
void
input_EndDecoder
(
input_thread_t
*
p_input
,
es_descriptor_t
*
p_es
)
{
decoder_t
*
p_dec
=
p_es
->
p_dec
;
int
i_dummy
;
decoder_t
*
p_dec
=
p_es
->
p_decoder_fifo
->
p_dec
;
p_es
->
p_decoder_fifo
->
b_die
=
1
;
p_es
->
p_decoder_fifo
->
p_dec
->
b_die
=
1
;
p_dec
->
b_die
=
VLC_TRUE
;
/* Make sure the thread leaves the NextDataPacket() function by
* sending it a few null packets. */
...
...
@@ -165,7 +182,7 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
if
(
p_es
->
p_pes
!=
NULL
)
{
input_DecodePES
(
p_es
->
p_dec
oder_fifo
,
p_es
->
p_pes
);
input_DecodePES
(
p_es
->
p_dec
,
p_es
->
p_pes
);
}
/* Waiting for the thread to exit */
...
...
@@ -189,7 +206,7 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
vlc_object_destroy
(
p_dec
);
/* Tell the input there is no more decoder */
p_es
->
p_dec
oder_fifo
=
NULL
;
p_es
->
p_dec
=
NULL
;
p_input
->
stream
.
b_changed
=
1
;
}
...
...
@@ -199,18 +216,46 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
*****************************************************************************
* Put a PES in the decoder's fifo.
*****************************************************************************/
void
input_DecodePES
(
decoder_
fifo_t
*
p_decoder_fifo
,
pes_packet_t
*
p_pes
)
void
input_DecodePES
(
decoder_
t
*
p_dec
,
pes_packet_t
*
p_pes
)
{
vlc_mutex_lock
(
&
p_decoder_fifo
->
data_lock
);
data_packet_t
*
p_data
;
int
i_size
=
0
;
p_pes
->
p_next
=
NULL
;
*
p_decoder_fifo
->
pp_last
=
p_pes
;
p_decoder_fifo
->
pp_last
=
&
p_pes
->
p_next
;
p_decoder_fifo
->
i_depth
++
;
for
(
p_data
=
p_pes
->
p_first
;
p_data
!=
NULL
;
p_data
=
p_data
->
p_next
)
{
i_size
+=
p_data
->
p_payload_end
-
p_data
->
p_payload_start
;
}
if
(
i_size
>
0
)
{
block_t
*
p_block
=
block_New
(
p_dec
,
i_size
);
if
(
p_block
)
{
uint8_t
*
p_buffer
=
p_block
->
p_buffer
;
for
(
p_data
=
p_pes
->
p_first
;
p_data
!=
NULL
;
p_data
=
p_data
->
p_next
)
{
int
i_copy
=
p_data
->
p_payload_end
-
p_data
->
p_payload_start
;
memcpy
(
p_buffer
,
p_data
->
p_payload_start
,
i_copy
);
/* Warn the decoder that it's got work to do. */
vlc_cond_signal
(
&
p_decoder_fifo
->
data_wait
);
vlc_mutex_unlock
(
&
p_decoder_fifo
->
data_lock
);
p_buffer
+=
i_copy
;
}
p_block
->
i_pts
=
p_pes
->
i_pts
;
p_block
->
i_dts
=
p_pes
->
i_dts
;
p_block
->
b_discontinuity
=
p_pes
->
b_discontinuity
;
block_FifoPut
(
p_dec
->
p_owner
->
p_fifo
,
p_block
);
}
}
}
/*****************************************************************************
* input_DecodeBlock
*****************************************************************************
* Put a block_t in the decoder's fifo.
*****************************************************************************/
void
input_DecodeBlock
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
{
block_FifoPut
(
p_dec
->
p_owner
->
p_fifo
,
p_block
);
}
/*****************************************************************************
...
...
@@ -254,7 +299,7 @@ void input_NullPacket( input_thread_t * p_input,
p_pes
->
p_first
=
p_pes
->
p_last
=
p_pad_data
;
p_pes
->
i_nb_data
=
1
;
p_pes
->
b_discontinuity
=
1
;
input_DecodePES
(
p_es
->
p_dec
oder_fifo
,
p_pes
);
input_DecodePES
(
p_es
->
p_dec
,
p_pes
);
}
}
...
...
@@ -269,7 +314,7 @@ void input_EscapeDiscontinuity( input_thread_t * p_input )
{
es_descriptor_t
*
p_es
=
p_input
->
stream
.
pp_selected_es
[
i_es
];
if
(
p_es
->
p_dec
oder_fifo
!=
NULL
)
if
(
p_es
->
p_dec
!=
NULL
)
{
for
(
i
=
0
;
i
<
PADDING_PACKET_NUMBER
;
i
++
)
{
...
...
@@ -290,7 +335,7 @@ void input_EscapeAudioDiscontinuity( input_thread_t * p_input )
{
es_descriptor_t
*
p_es
=
p_input
->
stream
.
pp_selected_es
[
i_es
];
if
(
p_es
->
p_dec
oder_fifo
!=
NULL
&&
p_es
->
i_cat
==
AUDIO_ES
)
if
(
p_es
->
p_dec
!=
NULL
&&
p_es
->
i_cat
==
AUDIO_ES
)
{
for
(
i
=
0
;
i
<
PADDING_PACKET_NUMBER
;
i
++
)
{
...
...
@@ -300,21 +345,6 @@ void input_EscapeAudioDiscontinuity( input_thread_t * p_input )
}
}
struct
decoder_owner_sys_t
{
aout_instance_t
*
p_aout
;
aout_input_t
*
p_aout_input
;
vout_thread_t
*
p_vout
;
sout_packetizer_input_t
*
p_sout
;
/* Current format in use by the output */
video_format_t
video
;
audio_format_t
audio
;
es_format_t
sout
;
};
/*****************************************************************************
* CreateDecoder: create a decoder object
*****************************************************************************/
...
...
@@ -330,12 +360,10 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
return
NULL
;
}
p_dec
->
pf_decode
=
0
;
p_dec
->
pf_decode_audio
=
0
;
p_dec
->
pf_decode_video
=
0
;
p_dec
->
pf_decode_sub
=
0
;
p_dec
->
pf_packetize
=
0
;
p_dec
->
pf_run
=
0
;
/* Select a new ES */
INSERT_ELEM
(
p_input
->
stream
.
pp_selected_es
,
...
...
@@ -343,14 +371,6 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
p_input
->
stream
.
i_selected_es_number
,
p_es
);
/* Allocate the memory needed to store the decoder's fifo */
p_dec
->
p_fifo
=
vlc_object_create
(
p_input
,
VLC_OBJECT_DECODER_FIFO
);
if
(
p_dec
->
p_fifo
==
NULL
)
{
msg_Err
(
p_input
,
"out of memory"
);
return
NULL
;
}
/* Initialize the decoder fifo */
p_dec
->
p_module
=
NULL
;
...
...
@@ -387,6 +407,18 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
p_dec
->
fmt_in
.
video
.
i_width
=
p_bih
->
biWidth
;
p_dec
->
fmt_in
.
video
.
i_height
=
p_bih
->
biHeight
;
}
/* FIXME
* - 1: beurk
* - 2: I'm not sure there isn't any endian problem here ... */
if
(
p_es
->
i_cat
==
SPU_ES
&&
(
p_es
->
i_fourcc
==
VLC_FOURCC
(
's'
,
'p'
,
'u'
,
' '
)
||
p_es
->
i_fourcc
==
VLC_FOURCC
(
's'
,
'p'
,
'u'
,
'b'
)
)
&&
p_es
->
p_demux_data
&&
*
((
uint32_t
*
)
p_es
->
p_demux_data
)
==
0xBeef
)
{
memcpy
(
p_dec
->
fmt_in
.
subs
.
spu
.
palette
,
p_es
->
p_demux_data
,
17
*
4
);
}
p_dec
->
fmt_in
.
i_cat
=
p_es
->
i_cat
;
p_dec
->
fmt_in
.
i_codec
=
p_es
->
i_fourcc
;
...
...
@@ -404,6 +436,12 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
p_dec
->
p_owner
->
p_aout_input
=
NULL
;
p_dec
->
p_owner
->
p_vout
=
NULL
;
p_dec
->
p_owner
->
p_sout
=
NULL
;
/* decoder fifo */
if
(
(
p_dec
->
p_owner
->
p_fifo
=
block_FifoNew
(
p_dec
)
)
==
NULL
)
{
msg_Err
(
p_dec
,
"out of memory"
);
return
NULL
;
}
/* Set buffers allocation callbacks for the decoders */
p_dec
->
pf_aout_buffer_new
=
aout_new_buffer
;
...
...
@@ -411,26 +449,6 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
p_dec
->
pf_vout_buffer_new
=
vout_new_buffer
;
p_dec
->
pf_vout_buffer_del
=
vout_del_buffer
;
/* For old decoders only */
vlc_mutex_init
(
p_input
,
&
p_dec
->
p_fifo
->
data_lock
);
vlc_cond_init
(
p_input
,
&
p_dec
->
p_fifo
->
data_wait
);
p_es
->
p_decoder_fifo
=
p_dec
->
p_fifo
;
p_dec
->
p_fifo
->
i_id
=
p_es
->
i_id
;
p_dec
->
p_fifo
->
i_fourcc
=
p_es
->
i_fourcc
;
p_dec
->
p_fifo
->
p_demux_data
=
p_es
->
p_demux_data
;
p_dec
->
p_fifo
->
p_waveformatex
=
p_es
->
p_waveformatex
;
p_dec
->
p_fifo
->
p_bitmapinfoheader
=
p_es
->
p_bitmapinfoheader
;
p_dec
->
p_fifo
->
p_spuinfo
=
p_es
->
p_spuinfo
;
p_dec
->
p_fifo
->
p_stream_ctrl
=
&
p_input
->
stream
.
control
;
p_dec
->
p_fifo
->
p_sout
=
p_input
->
stream
.
p_sout
;
p_dec
->
p_fifo
->
p_first
=
NULL
;
p_dec
->
p_fifo
->
pp_last
=
&
p_dec
->
p_fifo
->
p_first
;
p_dec
->
p_fifo
->
i_depth
=
0
;
p_dec
->
p_fifo
->
b_die
=
p_dec
->
p_fifo
->
b_error
=
0
;
p_dec
->
p_fifo
->
p_packets_mgt
=
p_input
->
p_method_data
;
p_dec
->
p_fifo
->
p_dec
=
p_dec
;
vlc_object_attach
(
p_dec
->
p_fifo
,
p_input
);
vlc_object_attach
(
p_dec
,
p_input
);
return
p_dec
;
...
...
@@ -441,50 +459,19 @@ static decoder_t * CreateDecoder( input_thread_t * p_input,
*****************************************************************************/
static
int
DecoderThread
(
decoder_t
*
p_dec
)
{
pes_packet_t
*
p_pes
;
data_packet_t
*
p_data
;
block_t
*
p_block
;
/* Temporary wrapper to keep old decoder api functional */
if
(
p_dec
->
pf_run
)
{
p_dec
->
pf_run
(
p_dec
->
p_fifo
);
return
0
;
}
/* The decoder's main loop */
while
(
!
p_dec
->
p_fifo
->
b_die
&&
!
p_dec
->
p_fifo
->
b_error
&&
!
p_dec
->
b_die
&&
!
p_dec
->
b_error
)
while
(
!
p_dec
->
b_die
&&
!
p_dec
->
b_error
)
{
int
i_size
;
input_ExtractPES
(
p_dec
->
p_fifo
,
&
p_pes
);
if
(
!
p_pes
)
if
(
(
p_block
=
block_FifoGet
(
p_dec
->
p_owner
->
p_fifo
)
)
==
NULL
)
{
p_dec
->
p_fifo
->
b_error
=
1
;
p_dec
->
b_error
=
1
;
break
;
}
for
(
i_size
=
0
,
p_data
=
p_pes
->
p_first
;
p_data
!=
NULL
;
p_data
=
p_data
->
p_next
)
{
i_size
+=
p_data
->
p_payload_end
-
p_data
->
p_payload_start
;
}
p_block
=
block_New
(
p_dec
,
i_size
);
for
(
i_size
=
0
,
p_data
=
p_pes
->
p_first
;
p_data
!=
NULL
;
p_data
=
p_data
->
p_next
)
{
if
(
p_data
->
p_payload_end
==
p_data
->
p_payload_start
)
continue
;
memcpy
(
p_block
->
p_buffer
+
i_size
,
p_data
->
p_payload_start
,
p_data
->
p_payload_end
-
p_data
->
p_payload_start
);
i_size
+=
p_data
->
p_payload_end
-
p_data
->
p_payload_start
;
}
p_block
->
i_pts
=
p_pes
->
i_pts
;
p_block
->
i_dts
=
p_pes
->
i_dts
;
p_block
->
b_discontinuity
=
p_pes
->
b_discontinuity
;
if
(
p_dec
->
i_object_type
==
VLC_OBJECT_PACKETIZER
)
{
block_t
*
p_sout_block
;
...
...
@@ -572,14 +559,16 @@ static int DecoderThread( decoder_t * p_dec )
p_dec
->
b_error
=
1
;
break
;
}
input_DeletePES
(
p_dec
->
p_fifo
->
p_packets_mgt
,
p_pes
);
}
while
(
!
p_dec
->
p_fifo
->
b_die
&&
!
p_dec
->
b_die
)
while
(
!
p_dec
->
b_die
)
{
/* Trash all received PES packets */
input_ExtractPES
(
p_dec
->
p_fifo
,
NULL
);
p_block
=
block_FifoGet
(
p_dec
->
p_owner
->
p_fifo
);
if
(
p_block
)
{
block_Release
(
p_block
);
}
}
/* XXX We do it here because of dll loader that want close in the
...
...
@@ -596,25 +585,17 @@ static int DecoderThread( decoder_t * p_dec )
static
void
DeleteDecoder
(
decoder_t
*
p_dec
)
{
vlc_object_detach
(
p_dec
);
vlc_object_detach
(
p_dec
->
p_fifo
);
msg_Dbg
(
p_dec
,
"killing decoder fo
r 0x%x, fo
urcc `%4.4s', %d PES in FIFO"
,
p_dec
->
p_fifo
->
i_id
,
(
char
*
)
&
p_dec
->
p_fifo
->
i_fourc
c
,
p_dec
->
p_fifo
->
i_depth
);
"killing decoder fourcc `%4.4s', %d PES in FIFO"
,
(
char
*
)
&
p_dec
->
fmt_in
.
i_code
c
,
p_dec
->
p_
owner
->
p_
fifo
->
i_depth
);
/* Free all packets still in the decoder fifo. */
input_DeletePES
(
p_dec
->
p_fifo
->
p_packets_mgt
,
p_dec
->
p_fifo
->
p_first
);
/* Destroy the lock and cond */
vlc_cond_destroy
(
&
p_dec
->
p_fifo
->
data_wait
);
vlc_mutex_destroy
(
&
p_dec
->
p_fifo
->
data_lock
);
block_FifoEmpty
(
p_dec
->
p_owner
->
p_fifo
);
block_FifoRelease
(
p_dec
->
p_owner
->
p_fifo
);
/* Free fifo */
vlc_object_destroy
(
p_dec
->
p_fifo
);
/* Cleanup */
/* Cleanup */
if
(
p_dec
->
p_owner
->
p_aout_input
)
aout_DecDelete
(
p_dec
->
p_owner
->
p_aout
,
p_dec
->
p_owner
->
p_aout_input
);
...
...
@@ -644,7 +625,6 @@ static void DeleteDecoder( decoder_t * p_dec )
sout_InputDelete
(
p_dec
->
p_owner
->
p_sout
);
free
(
p_dec
->
p_owner
);
}
/*****************************************************************************
...
...
src/input/input_ext-intf.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.5
1 2003/07/13 19:58:41 massiot
Exp $
* $Id: input_ext-intf.c,v 1.5
2 2003/11/24 00:39:02 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -360,7 +360,7 @@ void input_DumpStream( input_thread_t * p_input )
msg_Dbg
(
p_input
,
"ES 0x%x, "
"stream 0x%x, fourcc `%4.4s', %s [OK:%ld/ERR:%ld]"
,
ES
->
i_id
,
ES
->
i_stream_id
,
(
char
*
)
&
ES
->
i_fourcc
,
ES
->
p_dec
oder_fifo
!=
NULL
?
"selected"
:
"not selected"
,
ES
->
p_dec
!=
NULL
?
"selected"
:
"not selected"
,
ES
->
c_packets
,
ES
->
c_invalid_packets
);
#undef ES
}
...
...
src/input/input_programs.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_programs.c,v 1.12
1 2003/11/16 21:07:31 gbazin
Exp $
* $Id: input_programs.c,v 1.12
2 2003/11/24 00:39:02 fenrir
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -425,7 +425,7 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
i_es_index
++
)
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if
(
p_es
->
p_dec
oder_fifo
)
/* if the ES was selected */
if
(
p_es
->
p_dec
)
/* if the ES was selected */
{
input_UnselectES
(
p_input
,
p_es
);
}
...
...
@@ -614,7 +614,7 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
/* Init its values */
p_es
->
i_id
=
i_es_id
;
p_es
->
p_pes
=
NULL
;
p_es
->
p_dec
oder_fifo
=
NULL
;
p_es
->
p_dec
=
NULL
;
p_es
->
i_cat
=
i_category
;
p_es
->
i_demux_fd
=
0
;
p_es
->
c_packets
=
0
;
...
...
@@ -756,7 +756,7 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * p_es )
}
/* Kill associated decoder, if any. */
if
(
p_es
->
p_dec
oder_fifo
!=
NULL
)
if
(
p_es
->
p_dec
!=
NULL
)
{
input_UnselectES
(
p_input
,
p_es
);
}
...
...
@@ -860,7 +860,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
msg_Dbg
(
p_input
,
"selecting ES 0x%x"
,
p_es
->
i_id
);
if
(
p_es
->
p_dec
oder_fifo
!=
NULL
)
if
(
p_es
->
p_dec
!=
NULL
)
{
msg_Err
(
p_input
,
"ES 0x%x is already selected"
,
p_es
->
i_id
);
return
-
1
;
...
...
@@ -869,10 +869,10 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
/* Release the lock, not to block the input thread during
* the creation of the thread. */
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
p_es
->
p_dec
oder_fifo
=
input_RunDecoder
(
p_input
,
p_es
);
p_es
->
p_dec
=
input_RunDecoder
(
p_input
,
p_es
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
if
(
p_es
->
p_dec
oder_fifo
==
NULL
)
if
(
p_es
->
p_dec
==
NULL
)
{
return
-
1
;
}
...
...
@@ -917,7 +917,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
msg_Dbg
(
p_input
,
"unselecting ES 0x%x"
,
p_es
->
i_id
);
if
(
p_es
->
p_dec
oder_fifo
==
NULL
)
if
(
p_es
->
p_dec
==
NULL
)
{
msg_Err
(
p_input
,
"ES 0x%x is not selected"
,
p_es
->
i_id
);
return
(
-
1
);
...
...
@@ -947,7 +947,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
input_EndDecoder
(
p_input
,
p_es
);
p_es
->
p_pes
=
NULL
;
if
(
(
p_es
->
p_dec
oder_fifo
==
NULL
)
&&
if
(
(
p_es
->
p_dec
==
NULL
)
&&
(
p_input
->
stream
.
i_selected_es_number
>
0
)
)
{
while
(
(
i_index
<
p_input
->
stream
.
i_selected_es_number
-
1
)
&&
...
...
@@ -1140,7 +1140,7 @@ static int ESCallback( vlc_object_t *p_this, char const *psz_cmd,
for
(
i
=
0
;
i
<
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
p_input
->
stream
.
pp_es
[
i
]
->
i_id
==
oldval
.
i_int
&&
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
oder_fifo
!=
NULL
)
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
!=
NULL
)
{
input_UnselectES
(
p_input
,
p_input
->
stream
.
pp_es
[
i
]
);
}
...
...
@@ -1150,7 +1150,7 @@ static int ESCallback( vlc_object_t *p_this, char const *psz_cmd,
for
(
i
=
0
;
i
<
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
p_input
->
stream
.
pp_es
[
i
]
->
i_id
==
newval
.
i_int
&&
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
oder_fifo
==
NULL
)
p_input
->
stream
.
pp_es
[
i
]
->
p_dec
==
NULL
)
{
input_SelectES
(
p_input
,
p_input
->
stream
.
pp_es
[
i
]
);
}
...
...
src/misc/objects.c
View file @
3439df81
...
...
@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.4
2 2003/10/14 22:41:41 gbazin
Exp $
* $Id: objects.c,v 1.4
3 2003/11/24 00:39:02 fenrir
Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -131,10 +131,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
i_size
=
sizeof
(
decoder_t
);
psz_type
=
"decoder"
;
break
;
case
VLC_OBJECT_DECODER_FIFO
:
/* tmp for backward compat */
i_size
=
sizeof
(
decoder_fifo_t
);
psz_type
=
"decoder"
;
break
;
case
VLC_OBJECT_PACKETIZER
:
i_size
=
sizeof
(
decoder_t
);
psz_type
=
"packetizer"
;
...
...
src/video_output/video_output.c
View file @
3439df81
...
...
@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.2
39 2003/10/26 13:10:05 sigmunau
Exp $
* $Id: video_output.c,v 1.2
40 2003/11/24 00:39:02 fenrir
Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
...
...
@@ -1360,7 +1360,7 @@ static int DeinterlaceCallback( vlc_object_t *p_this, char const *psz_cmd,
for
(
i
=
0
;
i
<
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
(
ES
->
i_cat
==
VIDEO_ES
)
&&
ES
->
p_dec
oder_fifo
!=
NULL
)
if
(
(
ES
->
i_cat
==
VIDEO_ES
)
&&
ES
->
p_dec
!=
NULL
)
{
input_UnselectES
(
p_input
,
ES
);
input_SelectES
(
p_input
,
ES
);
...
...
@@ -1401,7 +1401,7 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
for
(
i
=
0
;
i
<
p_input
->
stream
.
i_es_number
;
i
++
)
{
if
(
(
ES
->
i_cat
==
VIDEO_ES
)
&&
ES
->
p_dec
oder_fifo
!=
NULL
)
if
(
(
ES
->
i_cat
==
VIDEO_ES
)
&&
ES
->
p_dec
!=
NULL
)
{
input_UnselectES
(
p_input
,
ES
);
input_SelectES
(
p_input
,
ES
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment