Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8d840d90
Commit
8d840d90
authored
Oct 08, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* undo [16970]. Stick to 4 byte startcodes and single packets.
parent
517d31de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
76 deletions
+81
-76
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+81
-76
No files found.
modules/stream_out/rtp.c
View file @
8d840d90
...
...
@@ -2483,24 +2483,31 @@ static int rtp_packetize_h264( sout_stream_t *p_stream, sout_stream_id_t *id,
block_t
*
in
)
{
int
i_max
=
id
->
i_mtu
-
12
;
/* payload max in one packet */
int
i_count
=
(
in
->
i_buffer
+
i_max
-
1
)
/
i_max
;
uint8_t
*
p_data
=
in
->
p_buffer
;
int
i_data
=
in
->
i_buffer
;
block_t
*
out
;
int
i_nal_type
;
int
i_payload
;
while
(
i_data
>
4
)
{
if
(
p_data
[
0
]
==
0x00
&&
p_data
[
1
]
==
0x00
&&
p_data
[
2
]
==
0x01
&&
/* startcode */
(
p_data
[
3
]
&
0x1f
)
>
0
&&
(
p_data
[
3
]
&
0x1f
)
<
24
)
/* naltype should be between 1 and 23 */
while
(
i_data
>
5
&&
(
p_data
[
0
]
!=
0x00
||
p_data
[
1
]
!=
0x00
||
p_data
[
2
]
!=
0x01
||
/* startcode */
(
p_data
[
3
]
&
0x1f
)
<
1
||
(
p_data
[
3
]
&
0x1f
)
>
23
)
)
/* naltype should be between 1 and 23 */
{
p_data
+=
3
;
i_data
-=
3
;
p_data
++
;
i_data
--
;
}
if
(
i_data
<
5
)
return
VLC_SUCCESS
;
p_data
+=
3
;
i_data
-=
3
;
i_nal_type
=
p_data
[
0
]
&
0x1f
;
/* Skip global headers */
if
(
i_nal_type
==
7
||
i_nal_type
==
8
)
continue
;
return
VLC_SUCCESS
;
if
(
i_data
<=
i_max
)
/* The whole pack will fit in one rtp payload */
{
...
...
@@ -2514,27 +2521,26 @@ static int rtp_packetize_h264( sout_stream_t *p_stream, sout_stream_id_t *id,
memcpy
(
&
out
->
p_buffer
[
12
],
p_data
,
i_payload
);
out
->
i_buffer
+=
i_payload
;
out
->
i_buffer
=
12
+
i_payload
;
out
->
i_dts
=
in
->
i_dts
;
out
->
i_length
=
in
->
i_length
;
rtp_packetize_send
(
id
,
out
);
p_data
+=
i_payload
;
i_data
-=
i_payload
;
/*msg_Dbg( p_stream, "nal-out plain %d %02x", i_payload, out->p_buffer[16] );*/
}
else
{
/* FU-A */
uint8_t
nalh
;
/* The nalheader byte */
int
start
=
1
,
end
=
0
;
int
i
=
0
,
start
=
1
,
end
=
0
,
first
=
0
;
/* skip but remember the nalh byte */
nalh
=
*
p_data
;
p_data
++
;
i_data
--
;
i_max
=
id
->
i_mtu
-
14
;
i_count
=
(
i_data
+
i_max
-
1
)
/
i_max
;
/*msg_Dbg( p_stream, "nal-out fragmented %02x %d", nalh, i_rest);*/
...
...
@@ -2555,26 +2561,25 @@ static int rtp_packetize_h264( sout_stream_t *p_stream, sout_stream_id_t *id,
/* FU header */
out
->
p_buffer
[
13
]
=
(
start
<<
7
)
|
(
end
<<
6
)
|
(
nalh
&
0x1f
);
memcpy
(
&
out
->
p_buffer
[
14
],
p_data
,
i_payload
);
memcpy
(
&
out
->
p_buffer
[
14
],
p_data
+
first
,
i_payload
);
out
->
i_buffer
=
14
+
i_payload
;
/* The dts should "slide" ? See the i_count trick and adapt */
// not sure what of these should be used and what it does :)
out
->
i_pts
=
in
->
i_pts
;
out
->
i_dts
=
in
->
i_dts
;
//out->i_dts = in->i_dts + i * in->i_length / i_count;
//out->i_length = in->i_length / i_count;
rtp_packetize_send
(
id
,
out
);
/*msg_Dbg( p_stream, "nal-out fragmented: frag %d %d %02x %02x %d", start,end,
out->p_buffer[12], out->p_buffer[13], i_payload );*/
i_data
-=
i_payload
;
p_data
+-
i_payload
;
start
=
0
;
}
}
}
else
{
p_data
++
;
i_data
--
;
first
+=
i_payload
;
i
++
;
start
=
0
;
}
}
return
VLC_SUCCESS
;
...
...
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