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
986ba8fe
Commit
986ba8fe
authored
Feb 13, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed SPS/PPS transmissions in H264 packetizer.
It closes the other part of #3161.
parent
26ae73ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
modules/packetizer/h264.c
modules/packetizer/h264.c
+20
-4
No files found.
modules/packetizer/h264.c
View file @
986ba8fe
...
@@ -93,6 +93,8 @@ struct decoder_sys_t
...
@@ -93,6 +93,8 @@ struct decoder_sys_t
/* */
/* */
bool
b_slice
;
bool
b_slice
;
block_t
*
p_frame
;
block_t
*
p_frame
;
bool
b_frame_sps
;
bool
b_frame_pps
;
bool
b_header
;
bool
b_header
;
bool
b_sps
;
bool
b_sps
;
...
@@ -205,6 +207,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -205,6 +207,9 @@ static int Open( vlc_object_t *p_this )
p_sys
->
b_slice
=
false
;
p_sys
->
b_slice
=
false
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
b_frame_sps
=
false
;
p_sys
->
b_frame_pps
=
false
;
p_sys
->
b_header
=
false
;
p_sys
->
b_header
=
false
;
p_sys
->
b_sps
=
false
;
p_sys
->
b_sps
=
false
;
p_sys
->
b_pps
=
false
;
p_sys
->
b_pps
=
false
;
...
@@ -502,6 +507,8 @@ static void PacketizeReset( void *p_private, bool b_broken )
...
@@ -502,6 +507,8 @@ static void PacketizeReset( void *p_private, bool b_broken )
if
(
p_sys
->
p_frame
)
if
(
p_sys
->
p_frame
)
block_ChainRelease
(
p_sys
->
p_frame
);
block_ChainRelease
(
p_sys
->
p_frame
);
p_sys
->
p_frame
=
NULL
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
b_frame_sps
=
false
;
p_sys
->
b_frame_pps
=
false
;
p_sys
->
slice
.
i_frame_type
=
0
;
p_sys
->
slice
.
i_frame_type
=
0
;
p_sys
->
b_slice
=
false
;
p_sys
->
b_slice
=
false
;
}
}
...
@@ -612,6 +619,8 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
...
@@ -612,6 +619,8 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
/* Reset context */
/* Reset context */
p_sys
->
slice
.
i_frame_type
=
0
;
p_sys
->
slice
.
i_frame_type
=
0
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
b_frame_sps
=
false
;
p_sys
->
b_frame_pps
=
false
;
p_sys
->
b_slice
=
false
;
p_sys
->
b_slice
=
false
;
cc_Flush
(
&
p_sys
->
cc_next
);
cc_Flush
(
&
p_sys
->
cc_next
);
}
}
...
@@ -641,6 +650,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
...
@@ -641,6 +650,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
{
{
if
(
p_sys
->
b_slice
)
if
(
p_sys
->
b_slice
)
p_pic
=
OutputPicture
(
p_dec
);
p_pic
=
OutputPicture
(
p_dec
);
p_sys
->
b_frame_sps
=
true
;
PutSPS
(
p_dec
,
p_frag
);
PutSPS
(
p_dec
,
p_frag
);
...
@@ -651,6 +661,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
...
@@ -651,6 +661,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_used_ts, block_t *p_fr
{
{
if
(
p_sys
->
b_slice
)
if
(
p_sys
->
b_slice
)
p_pic
=
OutputPicture
(
p_dec
);
p_pic
=
OutputPicture
(
p_dec
);
p_sys
->
b_frame_pps
=
true
;
PutPPS
(
p_dec
,
p_frag
);
PutPPS
(
p_dec
,
p_frag
);
...
@@ -706,7 +717,10 @@ static block_t *OutputPicture( decoder_t *p_dec )
...
@@ -706,7 +717,10 @@ static block_t *OutputPicture( decoder_t *p_dec )
if
(
!
p_sys
->
b_header
&&
p_sys
->
slice
.
i_frame_type
!=
BLOCK_FLAG_TYPE_I
)
if
(
!
p_sys
->
b_header
&&
p_sys
->
slice
.
i_frame_type
!=
BLOCK_FLAG_TYPE_I
)
return
NULL
;
return
NULL
;
if
(
p_sys
->
slice
.
i_frame_type
==
BLOCK_FLAG_TYPE_I
&&
p_sys
->
b_sps
&&
p_sys
->
b_pps
)
const
bool
b_sps_pps_i
=
p_sys
->
slice
.
i_frame_type
==
BLOCK_FLAG_TYPE_I
&&
p_sys
->
b_sps
&&
p_sys
->
b_pps
;
if
(
b_sps_pps_i
||
p_sys
->
b_frame_sps
||
p_sys
->
b_frame_pps
)
{
{
block_t
*
p_head
=
NULL
;
block_t
*
p_head
=
NULL
;
if
(
p_sys
->
p_frame
->
i_flags
&
BLOCK_FLAG_PRIVATE_AUD
)
if
(
p_sys
->
p_frame
->
i_flags
&
BLOCK_FLAG_PRIVATE_AUD
)
...
@@ -716,17 +730,17 @@ static block_t *OutputPicture( decoder_t *p_dec )
...
@@ -716,17 +730,17 @@ static block_t *OutputPicture( decoder_t *p_dec )
}
}
block_t
*
p_list
=
NULL
;
block_t
*
p_list
=
NULL
;
for
(
int
i
=
0
;
i
<
SPS_MAX
;
i
++
)
for
(
int
i
=
0
;
i
<
SPS_MAX
&&
(
b_sps_pps_i
||
p_sys
->
b_frame_sps
)
;
i
++
)
{
{
if
(
p_sys
->
pp_sps
[
i
]
)
if
(
p_sys
->
pp_sps
[
i
]
)
block_ChainAppend
(
&
p_list
,
block_Duplicate
(
p_sys
->
pp_sps
[
i
]
)
);
block_ChainAppend
(
&
p_list
,
block_Duplicate
(
p_sys
->
pp_sps
[
i
]
)
);
}
}
for
(
int
i
=
0
;
i
<
PPS_MAX
;
i
++
)
for
(
int
i
=
0
;
i
<
PPS_MAX
&&
(
b_sps_pps_i
||
p_sys
->
b_frame_pps
)
;
i
++
)
{
{
if
(
p_sys
->
pp_pps
[
i
]
)
if
(
p_sys
->
pp_pps
[
i
]
)
block_ChainAppend
(
&
p_list
,
block_Duplicate
(
p_sys
->
pp_pps
[
i
]
)
);
block_ChainAppend
(
&
p_list
,
block_Duplicate
(
p_sys
->
pp_pps
[
i
]
)
);
}
}
if
(
p_list
)
if
(
b_sps_pps_i
&&
p_list
)
p_sys
->
b_header
=
true
;
p_sys
->
b_header
=
true
;
if
(
p_head
)
if
(
p_head
)
...
@@ -751,6 +765,8 @@ static block_t *OutputPicture( decoder_t *p_dec )
...
@@ -751,6 +765,8 @@ static block_t *OutputPicture( decoder_t *p_dec )
p_sys
->
p_frame
=
NULL
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
i_frame_dts
=
VLC_TS_INVALID
;
p_sys
->
i_frame_dts
=
VLC_TS_INVALID
;
p_sys
->
i_frame_pts
=
VLC_TS_INVALID
;
p_sys
->
i_frame_pts
=
VLC_TS_INVALID
;
p_sys
->
b_frame_sps
=
false
;
p_sys
->
b_frame_pps
=
false
;
p_sys
->
b_slice
=
false
;
p_sys
->
b_slice
=
false
;
/* CC */
/* CC */
...
...
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