mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
GB28181: Support GB28181-2016 protocol. v5.0.74 (#3201)
01. Support GB config as StreamCaster. 02. Support disable GB by --gb28181=off. 03. Add utests for SIP examples. 04. Wireshark plugin to decode TCP/9000 as rtp.rfc4571 05. Support MPEGPS program stream codec. 06. Add utest for PS stream codec. 07. Decode MPEGPS packet stream. 08. Carry RTP and PS packet as helper in PS message. 09. Support recover from error mode. 10. Support process by a pack of PS/TS messages. 11. Add statistic for recovered and msgs dropped. 12. Recover from err position fastly. 13. Define state machine for GB session. 14. Bind context to GB session. 15. Re-invite when media disconnected. 16. Update GitHub actions with GB28181. 17. Support parse CANDIDATE by env or pip. 18. Support mux GB28181 to RTMP. 19. Support regression test by srs-bench.
This commit is contained in:
parent
9c81a0e1bd
commit
5a420ece3b
298 changed files with 43343 additions and 763 deletions
|
@ -68,6 +68,7 @@ SrsTsMessage::SrsTsMessage(SrsTsChannel* c, SrsTsPacket* p)
|
|||
{
|
||||
channel = c;
|
||||
packet = p;
|
||||
ps_helper_ = NULL;
|
||||
|
||||
dts = pts = 0;
|
||||
sid = (SrsTsPESStreamId)0x00;
|
||||
|
@ -108,7 +109,7 @@ srs_error_t SrsTsMessage::dump(SrsBuffer* stream, int* pnb_bytes)
|
|||
stream->skip(nb_bytes);
|
||||
}
|
||||
|
||||
*pnb_bytes = nb_bytes;
|
||||
if (pnb_bytes) *pnb_bytes = nb_bytes;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -123,7 +124,9 @@ bool SrsTsMessage::completed(int8_t payload_unit_start_indicator)
|
|||
|
||||
bool SrsTsMessage::fresh()
|
||||
{
|
||||
return payload->length() == 0;
|
||||
// Note that both must be 0. For PS stream, the payload might be empty but PES_packet_length is not, see
|
||||
// PsPacketDecodePrivateStream of KernelPSTest. For TS stream, both should be 0 in the same time.
|
||||
return PES_packet_length == 0 && payload->length() == 0;
|
||||
}
|
||||
|
||||
bool SrsTsMessage::is_audio()
|
||||
|
@ -1566,6 +1569,11 @@ srs_error_t SrsMpegPES::decode(SrsBuffer* stream)
|
|||
// PES_packet_data_byte
|
||||
// }
|
||||
|
||||
// For PS, the PES packet should never be empty, because there is no continuity for PS packet.
|
||||
if (PES_packet_length <= 0) {
|
||||
return srs_error_new(ERROR_GB_PS_PSE, "ts: Invalid PES_packet_length=%d for PS", PES_packet_length);
|
||||
}
|
||||
|
||||
// The pos_packet equals to stream pos, so the PES_packet_length is actually the payload length.
|
||||
nb_payload_ = PES_packet_length;
|
||||
has_payload_ = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue