-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Kernel: Fix demux SPS error for NVENC and LARIX. v6.0.22 #3389
Merged
winlinvip
merged 8 commits into
ossrs:develop
from
chundonglinlin:bugfix/fix-demux-codec-pps-error
Feb 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dad5998
Kernel: Refine complie warnig.
chundonglinlin defe237
SRT: fix stream with NVENC and LARIX.(#3388)
chundonglinlin 9396723
H265: remove parse pps_range_extension.
chundonglinlin 6cf3672
Kernel: init struct SrsHevcProfileTierLevel.
chundonglinlin fe4bac7
Kernel: dumps SrsHevcProfileTierLevel.
chundonglinlin d93d84e
Kernel: Refine demux hevc pps.
chundonglinlin e6d38b8
Merge branch 'develop' into bugfix/fix-demux-codec-pps-error
winlinvip 366b676
Release v6.0.22
winlinvip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Kernel: dumps SrsHevcProfileTierLevel.
- Loading branch information
commit fe4bac78bf6e7a7315cfa5db2a8186acf2479a09
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -928,6 +928,132 @@ srs_error_t SrsFormat::video_avc_demux(SrsBuffer* stream, int64_t timestamp) | |
// LCOV_EXCL_START | ||
|
||
#ifdef SRS_H265 | ||
// struct ptl | ||
SrsHevcProfileTierLevel::SrsHevcProfileTierLevel() | ||
{ | ||
general_profile_space = 0; | ||
general_tier_flag = 0; | ||
general_profile_idc = 0; | ||
memset(general_profile_compatibility_flag, 0, 32); | ||
general_progressive_source_flag = 0; | ||
general_interlaced_source_flag = 0; | ||
general_non_packed_constraint_flag = 0; | ||
general_frame_only_constraint_flag = 0; | ||
general_max_12bit_constraint_flag = 0; | ||
general_max_10bit_constraint_flag = 0; | ||
general_max_8bit_constraint_flag = 0; | ||
general_max_422chroma_constraint_flag = 0; | ||
general_max_420chroma_constraint_flag = 0; | ||
general_max_monochrome_constraint_flag = 0; | ||
general_intra_constraint_flag = 0; | ||
general_one_picture_only_constraint_flag = 0; | ||
general_lower_bit_rate_constraint_flag = 0; | ||
general_max_14bit_constraint_flag = 0; | ||
general_reserved_zero_7bits = 0; | ||
general_reserved_zero_33bits = 0; | ||
general_reserved_zero_34bits = 0; | ||
general_reserved_zero_35bits = 0; | ||
general_reserved_zero_43bits = 0; | ||
general_inbld_flag = 0; | ||
general_reserved_zero_bit = 0; | ||
general_level_idc = 0; | ||
memset(reserved_zero_2bits, 0, 8); | ||
} | ||
|
||
SrsHevcProfileTierLevel::~SrsHevcProfileTierLevel() | ||
{ | ||
sub_layer_profile_present_flag.clear(); | ||
sub_layer_level_present_flag.clear(); | ||
sub_layer_profile_space.clear(); | ||
sub_layer_tier_flag.clear(); | ||
sub_layer_profile_idc.clear(); | ||
sub_layer_profile_compatibility_flag.clear(); | ||
sub_layer_progressive_source_flag.clear(); | ||
sub_layer_interlaced_source_flag.clear(); | ||
sub_layer_non_packed_constraint_flag.clear(); | ||
sub_layer_frame_only_constraint_flag.clear(); | ||
sub_layer_max_12bit_constraint_flag.clear(); | ||
sub_layer_max_10bit_constraint_flag.clear(); | ||
sub_layer_max_8bit_constraint_flag.clear(); | ||
sub_layer_max_422chroma_constraint_flag.clear(); | ||
sub_layer_max_420chroma_constraint_flag.clear(); | ||
sub_layer_max_monochrome_constraint_flag.clear(); | ||
sub_layer_intra_constraint_flag.clear(); | ||
sub_layer_one_picture_only_constraint_flag.clear(); | ||
sub_layer_lower_bit_rate_constraint_flag.clear(); | ||
sub_layer_reserved_zero_7bits.clear(); | ||
sub_layer_reserved_zero_33bits.clear(); | ||
sub_layer_reserved_zero_34bits.clear(); | ||
sub_layer_reserved_zero_35bits.clear(); | ||
sub_layer_reserved_zero_43bits.clear(); | ||
sub_layer_inbld_flag.clear(); | ||
sub_layer_reserved_zero_bit.clear(); | ||
sub_layer_level_idc.clear(); | ||
} | ||
|
||
srs_error_t SrsHevcProfileTierLevel::dumps(SrsHevcProfileTierLevel* ptl) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just do a direct value copy? *this = *ptl Or maybe we don't need to use dumps, just do a direct assignment. sps->ptl.dumps(&profile_tier_level);
Change it to...
sps->ptl = profile_tier_level;
|
||
{ | ||
srs_error_t err = srs_success; | ||
|
||
general_profile_space = ptl->general_profile_space; | ||
general_tier_flag = ptl->general_tier_flag; | ||
general_profile_idc = ptl->general_profile_idc; | ||
memcpy(general_profile_compatibility_flag, ptl->general_profile_compatibility_flag, 32); | ||
general_progressive_source_flag = ptl->general_progressive_source_flag; | ||
general_interlaced_source_flag = ptl->general_interlaced_source_flag; | ||
general_non_packed_constraint_flag = ptl->general_non_packed_constraint_flag; | ||
general_frame_only_constraint_flag = ptl->general_frame_only_constraint_flag; | ||
general_max_12bit_constraint_flag = ptl->general_max_12bit_constraint_flag; | ||
general_max_10bit_constraint_flag = ptl->general_max_10bit_constraint_flag; | ||
general_max_8bit_constraint_flag = ptl->general_max_8bit_constraint_flag; | ||
general_max_422chroma_constraint_flag = ptl->general_max_422chroma_constraint_flag; | ||
general_max_420chroma_constraint_flag = ptl->general_max_420chroma_constraint_flag; | ||
general_max_monochrome_constraint_flag = ptl->general_max_monochrome_constraint_flag; | ||
general_intra_constraint_flag = ptl->general_intra_constraint_flag; | ||
general_one_picture_only_constraint_flag = ptl->general_one_picture_only_constraint_flag; | ||
general_lower_bit_rate_constraint_flag = ptl->general_lower_bit_rate_constraint_flag; | ||
general_max_14bit_constraint_flag = ptl->general_max_14bit_constraint_flag; | ||
general_reserved_zero_7bits = ptl->general_reserved_zero_7bits; | ||
general_reserved_zero_33bits = ptl->general_reserved_zero_33bits; | ||
general_reserved_zero_34bits = ptl->general_reserved_zero_34bits; | ||
general_reserved_zero_35bits = ptl->general_reserved_zero_35bits; | ||
general_reserved_zero_43bits = ptl->general_reserved_zero_43bits; | ||
general_inbld_flag = ptl->general_inbld_flag; | ||
general_reserved_zero_bit = ptl->general_reserved_zero_bit; | ||
general_level_idc = ptl->general_level_idc; | ||
memcpy(reserved_zero_2bits, ptl->reserved_zero_2bits, 8); | ||
|
||
sub_layer_profile_present_flag.swap(ptl->sub_layer_profile_present_flag); | ||
sub_layer_level_present_flag.swap(ptl->sub_layer_level_present_flag); | ||
sub_layer_profile_space.swap(ptl->sub_layer_profile_space); | ||
sub_layer_tier_flag.swap(ptl->sub_layer_tier_flag); | ||
sub_layer_profile_idc.swap(ptl->sub_layer_profile_idc); | ||
sub_layer_profile_compatibility_flag.swap(ptl->sub_layer_profile_compatibility_flag); | ||
sub_layer_progressive_source_flag.swap(ptl->sub_layer_progressive_source_flag); | ||
sub_layer_interlaced_source_flag.swap(ptl->sub_layer_interlaced_source_flag); | ||
sub_layer_non_packed_constraint_flag.swap(ptl->sub_layer_non_packed_constraint_flag); | ||
sub_layer_frame_only_constraint_flag.swap(ptl->sub_layer_frame_only_constraint_flag); | ||
sub_layer_max_12bit_constraint_flag.swap(ptl->sub_layer_max_12bit_constraint_flag); | ||
sub_layer_max_10bit_constraint_flag.swap(ptl->sub_layer_max_10bit_constraint_flag); | ||
sub_layer_max_8bit_constraint_flag.swap(ptl->sub_layer_max_8bit_constraint_flag); | ||
sub_layer_max_422chroma_constraint_flag.swap(ptl->sub_layer_max_422chroma_constraint_flag); | ||
sub_layer_max_420chroma_constraint_flag.swap(ptl->sub_layer_max_420chroma_constraint_flag); | ||
sub_layer_max_monochrome_constraint_flag.swap(ptl->sub_layer_max_monochrome_constraint_flag); | ||
sub_layer_intra_constraint_flag.swap(ptl->sub_layer_intra_constraint_flag); | ||
sub_layer_one_picture_only_constraint_flag.swap(ptl->sub_layer_one_picture_only_constraint_flag); | ||
sub_layer_lower_bit_rate_constraint_flag.swap(ptl->sub_layer_lower_bit_rate_constraint_flag); | ||
sub_layer_reserved_zero_7bits.swap(ptl->sub_layer_reserved_zero_7bits); | ||
sub_layer_reserved_zero_33bits.swap(ptl->sub_layer_reserved_zero_33bits); | ||
sub_layer_reserved_zero_34bits.swap(ptl->sub_layer_reserved_zero_34bits); | ||
sub_layer_reserved_zero_35bits.swap(ptl->sub_layer_reserved_zero_35bits); | ||
sub_layer_reserved_zero_43bits.swap(ptl->sub_layer_reserved_zero_43bits); | ||
sub_layer_inbld_flag.swap(ptl->sub_layer_inbld_flag); | ||
sub_layer_reserved_zero_bit.swap(ptl->sub_layer_reserved_zero_bit); | ||
sub_layer_level_idc.swap(ptl->sub_layer_level_idc); | ||
|
||
return err; | ||
} | ||
|
||
// Parse the hevc vps/sps/pps | ||
srs_error_t SrsFormat::hevc_demux_hvcc(SrsBuffer* stream) | ||
{ | ||
|
@@ -1339,7 +1465,7 @@ srs_error_t SrsFormat::hevc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | |
sps->sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1; | ||
sps->sps_temporal_id_nesting_flag = sps_temporal_id_nesting_flag; | ||
sps->sps_seq_parameter_set_id = sps_seq_parameter_set_id; | ||
memcpy((void*)&sps->ptl, &profile_tier_level, sizeof(profile_tier_level)); | ||
sps->ptl.dumps(&profile_tier_level); | ||
|
||
// chroma_format_idc ue(v) | ||
if ((err = bs.read_bits_ue(sps->chroma_format_idc)) != srs_success) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When released, these vectors don't need to be taken care of, right? They will be released automatically.
TRANS_BY_GPT3