Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only sanity check available SEIs if deprecated API #251

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/src/signed_video_h26x_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,10 @@ prepare_for_nalus_to_prepend(signed_video_t *self)
// proceed. But if there are vital SEI-nalus waiting to be pulled we return an error message
// (SV_NOT_SUPPORTED).

SV_THROW_IF_WITH_MSG(
self->num_of_completed_seis > 0, SV_NOT_SUPPORTED, "There are remaining SEIs.");
if (!self->avoid_checking_available_seis) {
SV_THROW_IF_WITH_MSG(
self->num_of_completed_seis > 0, SV_NOT_SUPPORTED, "There are remaining SEIs.");
}
SV_CATCH()
SV_DONE(status)

Expand Down Expand Up @@ -652,6 +654,9 @@ signed_video_get_sei(signed_video_t *self,
// Only display a SEI if the |peek_nalu| is a primary picture NAL Unit.
if (!((nalu_info.nalu_type == NALU_TYPE_I || nalu_info.nalu_type == NALU_TYPE_P) &&
nalu_info.is_primary_slice)) {
// Flip the sanity check flag since there are pending SEIs, which could not be fetched without
// breaking the H.26x standard.
self->avoid_checking_available_seis = true;
return SV_OK;
}
}
Expand Down
4 changes: 4 additions & 0 deletions lib/src/signed_video_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ struct _signed_video_t {
// unnecessary.
bool gop_hash_off; // Flag indicating if the GENERAL TAG doesn't include GOP hash.
// TODO: |gop_hash_off| will be deprecated when the feature is fully integrated.
// TODO: Remove this flag when the deprecated API get_nalus_to_prepend have been removed.
bool avoid_checking_available_seis; // Temporary flag to avoid checking for available SEIs when
// peek NAL Units are used when getting SEIs, since they
// might be postponed.

// For signing plugin
void *plugin_handle;
Expand Down
Loading