Get size of the basic header according to chunk stream id.
| 562 | |
| 563 | // Get size of the basic header according to chunk stream id. |
| 564 | inline 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. |
| 579 | static void |