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
2b75de8f
Commit
2b75de8f
authored
Dec 12, 2001
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Next Generation Buffer Manager, for TS plug-in. Please test in-ten-si-vely !
parent
6a74f9fb
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
69 deletions
+161
-69
include/input_ext-dec.h
include/input_ext-dec.h
+4
-1
include/input_ext-intf.h
include/input_ext-intf.h
+1
-2
include/input_ext-plugins.h
include/input_ext-plugins.h
+102
-32
plugins/mpeg_system/input_ps.c
plugins/mpeg_system/input_ps.c
+2
-2
plugins/mpeg_system/input_ts.c
plugins/mpeg_system/input_ts.c
+48
-29
src/input/mpeg_system.c
src/input/mpeg_system.c
+4
-3
No files found.
include/input_ext-dec.h
View file @
2b75de8f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.4
3 2001/12/12 11:18:38
massiot Exp $
* $Id: input_ext-dec.h,v 1.4
4 2001/12/12 13:48:09
massiot Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
...
@@ -84,6 +84,9 @@ typedef struct pes_packet_s
...
@@ -84,6 +84,9 @@ typedef struct pes_packet_s
p_next fields of the data_packet_t struct) */
p_next fields of the data_packet_t struct) */
data_packet_t
*
p_first
;
/* The first packet contained by this
data_packet_t
*
p_first
;
/* The first packet contained by this
* PES (used by decoders). */
* PES (used by decoders). */
data_packet_t
*
p_last
;
/* The last packet contained by this
PES (used by the buffer allocator) */
int
i_nb_data
;
/* Chained list used by the input buffers manager */
/* Chained list used by the input buffers manager */
struct
pes_packet_s
*
p_next
;
struct
pes_packet_s
*
p_next
;
...
...
include/input_ext-intf.h
View file @
2b75de8f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* control the pace of reading.
* control the pace of reading.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.5
2 2001/12/10 04:53:10 sam
Exp $
* $Id: input_ext-intf.h,v 1.5
3 2001/12/12 13:48:09 massiot
Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
...
@@ -66,7 +66,6 @@ typedef struct es_descriptor_s
...
@@ -66,7 +66,6 @@ typedef struct es_descriptor_s
/* PES parser information */
/* PES parser information */
struct
pes_packet_s
*
p_pes
;
/* Current PES */
struct
pes_packet_s
*
p_pes
;
/* Current PES */
struct
data_packet_s
*
p_last
;
/* The last packet gathered at present */
int
i_pes_real_size
;
/* as indicated by the header */
int
i_pes_real_size
;
/* as indicated by the header */
/* Decoder information */
/* Decoder information */
...
...
include/input_ext-plugins.h
View file @
2b75de8f
This diff is collapsed.
Click to expand it.
plugins/mpeg_system/input_ps.c
View file @
2b75de8f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
* input_ps.c: PS demux and packet management
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ps.c,v 1.
3 2001/12/12 11:18:38
massiot Exp $
* $Id: input_ps.c,v 1.
4 2001/12/12 13:48:09
massiot Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
...
@@ -103,7 +103,7 @@ DECLARE_BUFFERS_END( FLAGS, NB_LIFO );
...
@@ -103,7 +103,7 @@ DECLARE_BUFFERS_END( FLAGS, NB_LIFO );
DECLARE_BUFFERS_NEWPACKET
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_NEWPACKET
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_DELETEPACKET
(
FLAGS
,
NB_LIFO
,
150
);
DECLARE_BUFFERS_DELETEPACKET
(
FLAGS
,
NB_LIFO
,
150
);
DECLARE_BUFFERS_NEWPES
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_NEWPES
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_DELETEPES
(
FLAGS
,
NB_LIFO
,
150
);
DECLARE_BUFFERS_DELETEPES
(
FLAGS
,
NB_LIFO
,
150
,
150
);
/*****************************************************************************
/*****************************************************************************
...
...
plugins/mpeg_system/input_ts.c
View file @
2b75de8f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
* input_ts.c: TS demux and netlist management
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ts.c,v 1.
2 2001/12/10 04:53:11 sam
Exp $
* $Id: input_ts.c,v 1.
3 2001/12/12 13:48:09 massiot
Exp $
*
*
* Authors: Henri Fallon <henri@videolan.org>
* Authors: Henri Fallon <henri@videolan.org>
*
*
...
@@ -91,6 +91,20 @@ static void TSEnd ( struct input_thread_s * );
...
@@ -91,6 +91,20 @@ static void TSEnd ( struct input_thread_s * );
static
int
TSRead
(
struct
input_thread_s
*
,
static
int
TSRead
(
struct
input_thread_s
*
,
data_packet_t
*
p_packets
[
INPUT_READ_ONCE
]
);
data_packet_t
*
p_packets
[
INPUT_READ_ONCE
]
);
/*****************************************************************************
* Declare a buffer manager
*****************************************************************************/
#define FLAGS BUFFERS_UNIQUE_SIZE
#define NB_LIFO 1
DECLARE_BUFFERS_EMBEDDED
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_INIT
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_END
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_NEWPACKET
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_DELETEPACKET
(
FLAGS
,
NB_LIFO
,
1000
);
DECLARE_BUFFERS_NEWPES
(
FLAGS
,
NB_LIFO
);
DECLARE_BUFFERS_DELETEPES
(
FLAGS
,
NB_LIFO
,
1000
,
150
);
DECLARE_BUFFERS_TOIO
(
FLAGS
,
TS_PACKET_SIZE
);
/*****************************************************************************
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* we don't pollute the namespace too much.
...
@@ -108,10 +122,10 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
...
@@ -108,10 +122,10 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
input
.
pf_set_program
=
input_SetProgram
;
input
.
pf_set_program
=
input_SetProgram
;
input
.
pf_read
=
TSRead
;
input
.
pf_read
=
TSRead
;
input
.
pf_demux
=
input_DemuxTS
;
input
.
pf_demux
=
input_DemuxTS
;
input
.
pf_new_packet
=
input_Ne
tlistNe
wPacket
;
input
.
pf_new_packet
=
input_NewPacket
;
input
.
pf_new_pes
=
input_Ne
tlistNe
wPES
;
input
.
pf_new_pes
=
input_NewPES
;
input
.
pf_delete_packet
=
input_
Netlist
DeletePacket
;
input
.
pf_delete_packet
=
input_DeletePacket
;
input
.
pf_delete_pes
=
input_
Netlist
DeletePES
;
input
.
pf_delete_pes
=
input_DeletePES
;
input
.
pf_rewind
=
NULL
;
input
.
pf_rewind
=
NULL
;
input
.
pf_seek
=
NULL
;
input
.
pf_seek
=
NULL
;
#undef input
#undef input
...
@@ -160,7 +174,6 @@ static int TSProbe( probedata_t * p_data )
...
@@ -160,7 +174,6 @@ static int TSProbe( probedata_t * p_data )
*****************************************************************************/
*****************************************************************************/
static
void
TSInit
(
input_thread_t
*
p_input
)
static
void
TSInit
(
input_thread_t
*
p_input
)
{
{
/* Initialize netlist and TS structures */
thread_ts_data_t
*
p_method
;
thread_ts_data_t
*
p_method
;
es_descriptor_t
*
p_pat_es
;
es_descriptor_t
*
p_pat_es
;
es_ts_data_t
*
p_demux_data
;
es_ts_data_t
*
p_demux_data
;
...
@@ -184,11 +197,9 @@ static void TSInit( input_thread_t * p_input )
...
@@ -184,11 +197,9 @@ static void TSInit( input_thread_t * p_input )
p_input
->
p_method_data
=
NULL
;
p_input
->
p_method_data
=
NULL
;
/* Initialize netlist */
if
(
(
p_input
->
p_method_data
=
input_BuffersInit
())
==
NULL
)
if
(
input_NetlistInit
(
p_input
,
NB_DATA
,
NB_DATA
,
NB_PES
,
TS_PACKET_SIZE
,
INPUT_READ_ONCE
)
)
{
{
intf_ErrMsg
(
"TS input : Could not initialize netlist"
)
;
p_input
->
b_error
=
1
;
return
;
return
;
}
}
...
@@ -227,7 +238,7 @@ static void TSEnd( input_thread_t * p_input )
...
@@ -227,7 +238,7 @@ static void TSEnd( input_thread_t * p_input )
input_DelES
(
p_input
,
p_pat_es
);
input_DelES
(
p_input
,
p_pat_es
);
free
(
p_input
->
p_plugin_data
);
free
(
p_input
->
p_plugin_data
);
input_
NetlistEnd
(
p_input
);
input_
BuffersEnd
(
p_input
->
p_method_data
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -243,7 +254,8 @@ static int TSRead( input_thread_t * p_input,
...
@@ -243,7 +254,8 @@ static int TSRead( input_thread_t * p_input,
unsigned
int
i_loop
;
unsigned
int
i_loop
;
int
i_read
;
int
i_read
;
int
i_data
=
1
;
int
i_data
=
1
;
struct
iovec
*
p_iovec
;
struct
iovec
p_iovec
[
INPUT_READ_ONCE
];
data_packet_t
*
p_data
;
struct
timeval
timeout
;
struct
timeval
timeout
;
/* Init */
/* Init */
...
@@ -278,11 +290,12 @@ static int TSRead( input_thread_t * p_input,
...
@@ -278,11 +290,12 @@ static int TSRead( input_thread_t * p_input,
if
(
i_data
)
if
(
i_data
)
{
{
/* Get iovecs */
/* Get iovecs */
p_iovec
=
input_NetlistGetiovec
(
p_input
->
p_method_data
);
p_data
=
input_BuffersToIO
(
p_input
->
p_method_data
,
p_iovec
,
INPUT_READ_ONCE
);
if
(
p_iovec
==
NULL
)
if
(
p_iovec
==
NULL
)
{
{
return
(
-
1
);
/* empty netlist */
return
(
-
1
);
}
}
#if defined( WIN32 )
#if defined( WIN32 )
...
@@ -306,24 +319,13 @@ static int TSRead( input_thread_t * p_input,
...
@@ -306,24 +319,13 @@ static int TSRead( input_thread_t * p_input,
i_read
=
0
;
i_read
=
0
;
}
}
#endif
#endif
if
(
i_read
==
-
1
)
{
intf_ErrMsg
(
"input error: TS readv error"
);
return
(
-
1
);
}
/* EOF */
if
(
i_read
==
0
&&
p_input
->
stream
.
b_seekable
)
{
return
(
1
);
}
input_NetlistMviovec
(
p_input
->
p_method_data
,
(
int
)(((
i_read
-
1
)
/
TS_PACKET_SIZE
)
+
1
)
,
pp_packets
);
/* check correct TS header */
/* check correct TS header */
for
(
i_loop
=
0
;
i_loop
*
TS_PACKET_SIZE
<
i_read
;
i_loop
++
)
for
(
i_loop
=
0
;
i_loop
*
TS_PACKET_SIZE
<
i_read
;
i_loop
++
)
{
{
pp_packets
[
i_loop
]
=
p_data
;
p_data
=
p_data
->
p_next
;
pp_packets
[
i_loop
]
->
p_next
=
NULL
;
if
(
pp_packets
[
i_loop
]
->
p_buffer
[
0
]
!=
0x47
)
if
(
pp_packets
[
i_loop
]
->
p_buffer
[
0
]
!=
0x47
)
intf_ErrMsg
(
"input error: bad TS packet (starts with "
intf_ErrMsg
(
"input error: bad TS packet (starts with "
"0x%.2x, should be 0x47)"
,
"0x%.2x, should be 0x47)"
,
...
@@ -331,9 +333,26 @@ static int TSRead( input_thread_t * p_input,
...
@@ -331,9 +333,26 @@ static int TSRead( input_thread_t * p_input,
}
}
for
(
;
i_loop
<
INPUT_READ_ONCE
;
i_loop
++
)
for
(
;
i_loop
<
INPUT_READ_ONCE
;
i_loop
++
)
{
{
data_packet_t
*
p_next
=
p_data
->
p_next
;
input_DeletePacket
(
p_input
->
p_method_data
,
p_data
);
p_data
=
p_next
;
pp_packets
[
i_loop
]
=
NULL
;
pp_packets
[
i_loop
]
=
NULL
;
}
}
/* Error */
if
(
i_read
==
-
1
)
{
intf_ErrMsg
(
"input error: TS readv error"
);
return
(
-
1
);
}
/* EOF */
if
(
i_read
==
0
&&
p_input
->
stream
.
b_seekable
)
{
return
(
1
);
}
p_input
->
stream
.
p_selected_area
->
i_tell
+=
i_read
;
p_input
->
stream
.
p_selected_area
->
i_tell
+=
i_read
;
}
}
return
0
;
return
0
;
...
...
src/input/mpeg_system.c
View file @
2b75de8f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* Copyright (C) 1998-2001 VideoLAN
* $Id: mpeg_system.c,v 1.7
1 2001/12/11 13:55:55
massiot Exp $
* $Id: mpeg_system.c,v 1.7
2 2001/12/12 13:48:09
massiot Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
@@ -476,10 +476,11 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t * p_data,
...
@@ -476,10 +476,11 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t * p_data,
else
else
{
{
/* Update the relations between the data packets */
/* Update the relations between the data packets */
p_es
->
p_last
->
p_next
=
p_data
;
p_
p
es
->
p_last
->
p_next
=
p_data
;
}
}
p_es
->
p_last
=
p_data
;
p_pes
->
p_last
=
p_data
;
p_pes
->
i_nb_data
++
;
/* Size of the payload carried in the data packet */
/* Size of the payload carried in the data packet */
p_pes
->
i_pes_size
+=
(
p_data
->
p_payload_end
p_pes
->
i_pes_size
+=
(
p_data
->
p_payload_end
...
...
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