MCPcopy Create free account
hub / github.com/apache/brpc / GetBasicHeaderLength

Function GetBasicHeaderLength

src/brpc/policy/rtmp_protocol.cpp:564–576  ·  view source on GitHub ↗

Get size of the basic header according to chunk stream id.

Source from the content-addressed store, hash-verified

562
563// Get size of the basic header according to chunk stream id.
564inline size_t GetBasicHeaderLength(uint32_t cs_id) {
565 if (cs_id < 2) {
566 return 0;
567 } else if (cs_id <= 63) {
568 return 1;
569 } else if (cs_id <= 319) {
570 return 2;
571 } else if (cs_id <= RTMP_MAX_CHUNK_STREAM_ID) {
572 return 3;
573 } else {
574 return 0;
575 }
576}
577
578// Write a basic header into buf and forward the buf.
579static void

Callers 1

SerializeMessageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected