1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Support dropping h.264 SEI from NALUs. v5.0.213 v6.0.125 (#4057)

try to fix #4052.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
Jacob Su 2024-06-03 16:25:49 +08:00 committed by GitHub
parent 282d94d7bb
commit 1656391c67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 141 additions and 66 deletions

View file

@ -1120,7 +1120,7 @@ std::string srs_hevc_level2str(SrsHevcLevel level);
/**
* A sample is the unit of frame.
* It's a NALU for H.264.
* It's a NALU for H.264, H.265.
* It's the whole AAC raw data for AAC.
* @remark Neither SPS/PPS or ASC is sample unit, it's codec sequence header.
*/
@ -1131,15 +1131,11 @@ public:
int size;
// The ptr of unit, user must free it.
char* bytes;
// Whether is B frame.
bool bframe;
public:
SrsSample();
SrsSample(char* b, int s);
~SrsSample();
public:
// If we need to know whether sample is bframe, we have to parse the NALU payload.
srs_error_t parse_bframe();
// Copy sample, share the bytes pointer.
SrsSample* copy();
};
@ -1322,6 +1318,9 @@ public:
virtual srs_error_t add_sample(char* bytes, int size);
public:
virtual SrsVideoCodecConfig* vcodec();
public:
static srs_error_t parse_avc_nalu_type(const SrsSample* sample, SrsAvcNaluType& avc_nalu_type);
static srs_error_t parse_avc_b_frame(const SrsSample* sample, bool& is_b_frame);
};
/**