mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
1. Parse video codec from PSM packet. 2. Return error and logging if HEVC packet. 3. Ignore invalid AVC NALUs, drop AVC AUD and SEI. 4. Disconnect TCP connection if HEVC.
This commit is contained in:
parent
237d60a55d
commit
af192d6184
6 changed files with 38 additions and 8 deletions
|
@ -48,6 +48,8 @@ SrsPsContext::SrsPsContext()
|
|||
current_ = NULL;
|
||||
helper_.ctx_ = this;
|
||||
detect_ps_integrity_ = false;
|
||||
video_stream_type_ = SrsTsStreamReserved;
|
||||
audio_stream_type_ = SrsTsStreamReserved;
|
||||
}
|
||||
|
||||
SrsPsContext::~SrsPsContext()
|
||||
|
@ -121,9 +123,13 @@ srs_error_t SrsPsContext::decode(SrsBuffer* stream, ISrsPsMessageHandler* handle
|
|||
return srs_error_wrap(err, "decode psm");
|
||||
}
|
||||
|
||||
srs_info("PS: Ignore PSM for video=%#x, audio=%#x", psm.video_elementary_stream_id_, psm.audio_elementary_stream_id_);
|
||||
//context_->set(psm.video_elementary_stream_id_, SrsTsPidApplyVideo);
|
||||
//context_->set(psm.audio_elementary_stream_id_, SrsTsPidApplyAudio);
|
||||
if (video_stream_type_ == SrsTsStreamReserved || audio_stream_type_ == SrsTsStreamReserved) {
|
||||
srs_trace("PS: Got PSM for video=%#x, audio=%#x", psm.video_elementary_stream_id_, psm.audio_elementary_stream_id_);
|
||||
} else {
|
||||
srs_info("PS: Got PSM for video=%#x, audio=%#x", psm.video_elementary_stream_id_, psm.audio_elementary_stream_id_);
|
||||
}
|
||||
video_stream_type_ = (SrsTsStream)psm.video_stream_type_;
|
||||
audio_stream_type_ = (SrsTsStream)psm.audio_stream_type_;
|
||||
} else if (msg->is_video() || msg->is_audio()) {
|
||||
// Update the total messages in pack.
|
||||
helper_.pack_pre_msg_last_seq_ = helper_.rtp_seq_;
|
||||
|
@ -467,7 +473,7 @@ srs_error_t SrsPsPsmPacket::decode(SrsBuffer* stream)
|
|||
b.skip(elementary_stream_info_length);
|
||||
srs_info("PS: Ignore %d bytes descriptor for stream=%#x", elementary_stream_info_length, stream_type);
|
||||
|
||||
if (stream_type == SrsTsStreamVideoH264) {
|
||||
if (stream_type == SrsTsStreamVideoH264 || stream_type == SrsTsStreamVideoHEVC) {
|
||||
video_stream_type_ = stream_type;
|
||||
video_elementary_stream_id_ = elementary_stream_id;
|
||||
video_elementary_stream_info_length_ = elementary_stream_info_length;
|
||||
|
|
|
@ -66,6 +66,10 @@ private:
|
|||
SrsPsPacket* current_;
|
||||
// Whether detect PS packet header integrity.
|
||||
bool detect_ps_integrity_;
|
||||
public:
|
||||
// The stream type parsed from latest PSM packet.
|
||||
SrsTsStream video_stream_type_;
|
||||
SrsTsStream audio_stream_type_;
|
||||
public:
|
||||
SrsPsContext();
|
||||
virtual ~SrsPsContext();
|
||||
|
|
|
@ -131,6 +131,7 @@ enum SrsTsStream
|
|||
// ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved
|
||||
// 0x15-0x7F
|
||||
SrsTsStreamVideoH264 = 0x1b,
|
||||
SrsTsStreamVideoHEVC = 0x24,
|
||||
// User Private
|
||||
// 0x80-0xFF
|
||||
SrsTsStreamAudioAC3 = 0x81,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue