AVC/HEVC ES: move more code to common base class

This commit is contained in:
Moritz Bunkus 2021-08-25 22:14:38 +02:00
parent d3f57ff1a8
commit ebe7547d9c
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
4 changed files with 10 additions and 2 deletions

View File

@ -148,7 +148,7 @@ void
es_parser_c::handle_slice_nalu(memory_cptr const &nalu,
uint64_t nalu_pos) {
if (!m_configuration_record_ready) {
m_unhandled_nalus.emplace_back(nalu, nalu_pos);
add_nalu_to_unhandled_nalus(nalu, nalu_pos);
return;
}

View File

@ -325,6 +325,13 @@ es_parser_c::build_frame_data() {
}
}
void
es_parser_c::add_nalu_to_unhandled_nalus(memory_cptr const &nalu,
uint64_t nalu_pos) {
nalu->take_ownership();
m_unhandled_nalus.emplace_back(nalu, nalu_pos);
}
void
es_parser_c::flush_unhandled_nalus() {
for (auto const &nalu_with_pos : m_unhandled_nalus)

View File

@ -152,6 +152,7 @@ public:
protected:
void add_nalu_to_extra_data(memory_cptr const &nalu, extra_data_position_e position = extra_data_position_e::pre);
void add_nalu_to_pending_frame_data(memory_cptr const &nalu);
void add_nalu_to_unhandled_nalus(memory_cptr const &nalu, uint64_t nalu_pos);
void add_parameter_sets_to_extra_data();
void build_frame_data();

View File

@ -98,7 +98,7 @@ void
es_parser_c::handle_slice_nalu(memory_cptr const &nalu,
uint64_t nalu_pos) {
if (!m_configuration_record_ready) {
m_unhandled_nalus.emplace_back(nalu, nalu_pos);
add_nalu_to_unhandled_nalus(nalu, nalu_pos);
return;
}