added frame rate calculation to AVC parser (#307)

* added frame rate calculation to AVC parser

* fixed typo in avc_parser.h and removed cout debug statements from avc_parser.cpp

* made all changes discussed with Jeff

---------

Co-authored-by: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com>
Этот коммит содержится в:
Pavel Tcherniaev
2024-04-05 05:15:15 -07:00
коммит произвёл GitHub
родитель 2d877cd357
Коммит f8bf587f92
+11
Просмотреть файл
@@ -1142,6 +1142,17 @@ ParserResult AvcVideoParser::ParseSliceHeader(uint8_t *p_stream, size_t stream_s
new_sps_activated_ = true; // Note: clear this flag after the actions are taken.
}
// Set frame rate if available
if (new_sps_activated_) {
if (p_sps->vui_seq_parameters.timing_info_present_flag) {
frame_rate_.numerator = p_sps->vui_seq_parameters.time_scale;
frame_rate_.denominator = 2 * p_sps->vui_seq_parameters.num_units_in_tick;
} else {
frame_rate_.numerator = 0;
frame_rate_.denominator = 0;
}
}
if (p_sps->separate_colour_plane_flag == 1) {
p_slice_header->colour_plane_id = Parser::ReadBits(p_stream, offset, 2);
}