Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1e8a2b5c
Commit
1e8a2b5c
authored
Feb 10, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS Mux: split Mux()
parent
8917116d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
317 additions
and
310 deletions
+317
-310
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+317
-310
No files found.
modules/mux/mpeg/ts.c
View file @
1e8a2b5c
...
@@ -1247,29 +1247,12 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -1247,29 +1247,12 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
/* returns true if needs more data */
* Mux: Call each time there is new data for at least one stream
static
bool
MuxStreams
(
sout_mux_t
*
p_mux
)
*****************************************************************************
*
*****************************************************************************/
static
int
Mux
(
sout_mux_t
*
p_mux
)
{
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
ts_stream_t
*
p_pcr_stream
;
ts_stream_t
*
p_pcr_stream
=
(
ts_stream_t
*
)
p_sys
->
p_pcr_input
->
p_sys
;
if
(
p_sys
->
i_pcr_pid
==
0x1fff
)
{
for
(
int
i
=
0
;
i
<
p_mux
->
i_nb_inputs
;
i
++
)
{
block_FifoEmpty
(
p_mux
->
pp_inputs
[
i
]
->
p_fifo
);
}
msg_Dbg
(
p_mux
,
"waiting for PCR streams"
);
return
VLC_SUCCESS
;
}
p_pcr_stream
=
(
ts_stream_t
*
)
p_sys
->
p_pcr_input
->
p_sys
;
for
(;;)
{
sout_buffer_chain_t
chain_ts
;
sout_buffer_chain_t
chain_ts
;
mtime_t
i_shaping_delay
=
p_pcr_stream
->
b_key_frame
mtime_t
i_shaping_delay
=
p_pcr_stream
->
b_key_frame
?
p_pcr_stream
->
i_pes_length
?
p_pcr_stream
->
i_pes_length
...
@@ -1299,11 +1282,12 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -1299,11 +1282,12 @@ static int Mux( sout_mux_t *p_mux )
p_input
=
p_mux
->
pp_inputs
[
i
];
p_input
=
p_mux
->
pp_inputs
[
i
];
p_stream
=
(
ts_stream_t
*
)
p_input
->
p_sys
;
p_stream
=
(
ts_stream_t
*
)
p_input
->
p_sys
;
if
(
(
(
p_stream
==
p_pcr_stream
)
&&
if
(
(
p_stream
!=
p_pcr_stream
||
(
p_stream
->
i_pes_length
<
i_shaping_delay
)
)
||
p_stream
->
i_pes_length
>=
i_shaping_delay
)
&&
(
p_stream
->
i_pes_dts
+
p_stream
->
i_pes_length
<
p_stream
->
i_pes_dts
+
p_stream
->
i_pes_length
>=
p_pcr_stream
->
i_pes_dts
+
p_pcr_stream
->
i_pes_length
)
)
p_pcr_stream
->
i_pes_dts
+
p_pcr_stream
->
i_pes_length
)
{
continue
;
/* Need more data */
/* Need more data */
if
(
block_FifoCount
(
p_input
->
p_fifo
)
<=
1
)
if
(
block_FifoCount
(
p_input
->
p_fifo
)
<=
1
)
{
{
...
@@ -1311,7 +1295,7 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -1311,7 +1295,7 @@ static int Mux( sout_mux_t *p_mux )
(
p_input
->
p_fmt
->
i_cat
==
VIDEO_ES
)
)
(
p_input
->
p_fmt
->
i_cat
==
VIDEO_ES
)
)
{
{
/* We need more data */
/* We need more data */
return
VLC_SUCCESS
;
return
true
;
}
}
else
if
(
block_FifoCount
(
p_input
->
p_fifo
)
<=
0
)
else
if
(
block_FifoCount
(
p_input
->
p_fifo
)
<=
0
)
{
{
...
@@ -1504,11 +1488,10 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -1504,11 +1488,10 @@ static int Mux( sout_mux_t *p_mux )
}
}
}
}
}
}
}
/* save */
/* save */
mtime_t
i_pcr_dts
=
p_pcr_stream
->
i_pes_dts
;
const
mtime_t
i_pcr_dts
=
p_pcr_stream
->
i_pes_dts
;
mtime_t
i_pcr_length
=
p_pcr_stream
->
i_pes_length
;
const
mtime_t
i_pcr_length
=
p_pcr_stream
->
i_pes_length
;
p_pcr_stream
->
b_key_frame
=
0
;
p_pcr_stream
->
b_key_frame
=
0
;
/* msg_Dbg( p_mux, "starting muxing %lldms", i_pcr_length / 1000 ); */
/* msg_Dbg( p_mux, "starting muxing %lldms", i_pcr_length / 1000 ); */
...
@@ -1610,7 +1593,31 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -1610,7 +1593,31 @@ static int Mux( sout_mux_t *p_mux )
/* 4: date and send */
/* 4: date and send */
TSSchedule
(
p_mux
,
&
chain_ts
,
i_pcr_length
,
i_pcr_dts
);
TSSchedule
(
p_mux
,
&
chain_ts
,
i_pcr_length
,
i_pcr_dts
);
return
false
;
}
/*****************************************************************************
* Mux: Call each time there is new data for at least one stream
*****************************************************************************
*
*****************************************************************************/
static
int
Mux
(
sout_mux_t
*
p_mux
)
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
if
(
p_sys
->
i_pcr_pid
==
0x1fff
)
{
for
(
int
i
=
0
;
i
<
p_mux
->
i_nb_inputs
;
i
++
)
{
block_FifoEmpty
(
p_mux
->
pp_inputs
[
i
]
->
p_fifo
);
}
}
msg_Dbg
(
p_mux
,
"waiting for PCR streams"
);
return
VLC_SUCCESS
;
}
while
(
!
MuxStreams
(
p_mux
))
;
return
VLC_SUCCESS
;
}
}
#define STD_PES_PAYLOAD 170
#define STD_PES_PAYLOAD 170
...
...
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