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

Support fast padding

This commit is contained in:
winlin 2020-04-17 18:04:52 +08:00
parent e4eb501c57
commit cf52390cf2
7 changed files with 37 additions and 6 deletions

View file

@ -310,10 +310,14 @@ private:
int nn_samples;
// For RTC video, whether NALUs has IDR.
bool has_idr;
public:
// For RTC audio, we may need to transcode AAC to opus,
// so there must be an extra payloads, which is transformed from payload.
SrsSample* extra_payloads;
int nn_extra_payloads;
// The max size payload in extras.
// @remark For GSO to fast guess the best padding.
int nn_max_extra_payloads;
#endif
public:
SrsSharedPtrPayload();
@ -363,6 +367,9 @@ public:
void set_extra_payloads(SrsSample* payloads, int nn_payloads);
int nn_extra_payloads() { return ptr->nn_extra_payloads; }
SrsSample* extra_payloads() { return ptr->extra_payloads; }
// The max extra payload size.
void set_max_extra_payload(int v) { ptr->nn_max_extra_payloads = v; }
int nn_max_extra_payloads() { return ptr->nn_max_extra_payloads; }
// Whether samples has idr.
bool has_idr() { return ptr->has_idr; }
void set_has_idr(bool v) { ptr->has_idr = v; }