Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d7526718
Commit
d7526718
authored
Mar 25, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: h264: parse vui and timing info
Extract frame duration and interlacing
parent
918f4453
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
modules/packetizer/h264.c
modules/packetizer/h264.c
+106
-0
No files found.
modules/packetizer/h264.c
View file @
d7526718
...
@@ -117,6 +117,17 @@ struct decoder_sys_t
...
@@ -117,6 +117,17 @@ struct decoder_sys_t
/* Value from Picture Parameter Set */
/* Value from Picture Parameter Set */
int
i_pic_order_present_flag
;
int
i_pic_order_present_flag
;
/* VUI */
bool
b_timing_info_present_flag
;
uint32_t
i_num_units_in_tick
;
uint32_t
i_time_scale
;
bool
b_fixed_frame_rate
;
bool
b_pic_struct_present_flag
;
uint8_t
i_pic_struct
;
bool
b_cpb_dpb_delays_present_flag
;
uint8_t
i_cpb_removal_delay_length_minus1
;
uint8_t
i_dpb_output_delay_length_minus1
;
/* Useful values of the Slice Header */
/* Useful values of the Slice Header */
slice_t
slice
;
slice_t
slice
;
...
@@ -151,6 +162,7 @@ enum nal_unit_type_e
...
@@ -151,6 +162,7 @@ enum nal_unit_type_e
/* Defined in H.264 annex D */
/* Defined in H.264 annex D */
enum
sei_type_e
enum
sei_type_e
{
{
SEI_PIC_TIMING
=
1
,
SEI_USER_DATA_REGISTERED
=
4
,
SEI_USER_DATA_REGISTERED
=
4
,
SEI_RECOVERY_POINT
=
6
SEI_RECOVERY_POINT
=
6
};
};
...
@@ -231,6 +243,12 @@ static int Open( vlc_object_t *p_this )
...
@@ -231,6 +243,12 @@ static int Open( vlc_object_t *p_this )
p_sys
->
slice
.
i_pic_order_cnt_lsb
=
-
1
;
p_sys
->
slice
.
i_pic_order_cnt_lsb
=
-
1
;
p_sys
->
slice
.
i_delta_pic_order_cnt_bottom
=
-
1
;
p_sys
->
slice
.
i_delta_pic_order_cnt_bottom
=
-
1
;
p_sys
->
b_timing_info_present_flag
=
false
;
p_sys
->
b_pic_struct_present_flag
=
false
;
p_sys
->
b_cpb_dpb_delays_present_flag
=
false
;
p_sys
->
i_cpb_removal_delay_length_minus1
=
0
;
p_sys
->
i_dpb_output_delay_length_minus1
=
0
;
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
;
...
@@ -946,6 +964,71 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag )
...
@@ -946,6 +964,71 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag )
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
}
}
}
/* overscan */
i_tmp
=
bs_read
(
&
s
,
1
);
if
(
i_tmp
)
bs_read
(
&
s
,
1
);
/* video signal type */
i_tmp
=
bs_read
(
&
s
,
1
);
if
(
i_tmp
)
{
bs_read
(
&
s
,
4
);
/* colour desc */
bs_read
(
&
s
,
1
);
if
(
i_tmp
)
bs_read
(
&
s
,
24
);
}
/* chroma loc info */
i_tmp
=
bs_read
(
&
s
,
1
);
if
(
i_tmp
)
{
bs_read_ue
(
&
s
);
bs_read_ue
(
&
s
);
}
/* timing info */
p_sys
->
b_timing_info_present_flag
=
bs_read
(
&
s
,
1
);
if
(
p_sys
->
b_timing_info_present_flag
)
{
p_sys
->
i_num_units_in_tick
=
bs_read
(
&
s
,
32
);
p_sys
->
i_time_scale
=
bs_read
(
&
s
,
32
);
p_sys
->
b_fixed_frame_rate
=
bs_read
(
&
s
,
1
);
}
/* Nal hrd & VC1 hrd parameters */
p_sys
->
b_cpb_dpb_delays_present_flag
=
false
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
i_tmp
=
bs_read
(
&
s
,
1
);
if
(
i_tmp
)
{
p_sys
->
b_cpb_dpb_delays_present_flag
=
true
;
uint32_t
count
=
bs_read_ue
(
&
s
)
+
1
;
bs_read
(
&
s
,
4
);
bs_read
(
&
s
,
4
);
for
(
uint32_t
i
=
0
;
i
<
count
;
i
++
)
{
bs_read_ue
(
&
s
);
bs_read_ue
(
&
s
);
bs_read
(
&
s
,
1
);
}
bs_read
(
&
s
,
5
);
p_sys
->
i_cpb_removal_delay_length_minus1
=
bs_read
(
&
s
,
5
);
p_sys
->
i_dpb_output_delay_length_minus1
=
bs_read
(
&
s
,
5
);
bs_read
(
&
s
,
5
);
}
}
if
(
p_sys
->
b_cpb_dpb_delays_present_flag
)
bs_read
(
&
s
,
1
);
/* pic struct info */
p_sys
->
b_pic_struct_present_flag
=
bs_read
(
&
s
,
1
);
/* + unparsed remains */
}
}
free
(
pb_dec
);
free
(
pb_dec
);
...
@@ -1136,6 +1219,29 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
...
@@ -1136,6 +1219,29 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
if
(
i_used
+
i_size
+
1
>
i_dec
)
if
(
i_used
+
i_size
+
1
>
i_dec
)
break
;
break
;
/* Look for pic timing */
if
(
i_type
==
SEI_PIC_TIMING
)
{
bs_t
s
;
const
int
i_tim
=
i_size
;
const
uint8_t
*
p_tim
=
&
pb_dec
[
i_used
];
bs_init
(
&
s
,
p_tim
,
i_tim
);
if
(
p_sys
->
b_cpb_dpb_delays_present_flag
)
{
bs_read
(
&
s
,
p_sys
->
i_cpb_removal_delay_length_minus1
+
1
);
bs_read
(
&
s
,
p_sys
->
i_dpb_output_delay_length_minus1
+
1
);
}
if
(
p_sys
->
b_pic_struct_present_flag
)
{
p_sys
->
i_pic_struct
=
bs_read
(
&
s
,
4
);
msg_Err
(
p_dec
,
"PIC STRUCT %d"
,
p_sys
->
i_pic_struct
);
}
/* + unparsed remains */
}
/* Look for user_data_registered_itu_t_t35 */
/* Look for user_data_registered_itu_t_t35 */
if
(
i_type
==
SEI_USER_DATA_REGISTERED
)
if
(
i_type
==
SEI_USER_DATA_REGISTERED
)
{
{
...
...
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