Commit 502e3bff by xiongziliang

解决ps rtp解包问题

parent 10884340
media-server @ 737b8d85
Subproject commit 1603194dafdcecda9036e5741ec8d3e8c9ab1e01
Subproject commit 737b8d852eeb1a36bc77854f327fbbef7cfb81be
......@@ -62,7 +62,7 @@ void RtpDecoder::decodeRtp(const void *data, int bytes) {
uint8_t rtp_type = 0x7F & ((uint8_t *) data)[1];
InfoL << "rtp type:" << (int) rtp_type;
_rtp_decoder = rtp_payload_decode_create(rtp_type, "MP4V-ES", &s_func, this);
_rtp_decoder = rtp_payload_decode_create(rtp_type, "MP2P", &s_func, this);
if (!_rtp_decoder) {
WarnL << "unsupported rtp type:" << (int) rtp_type << ",size:" << bytes << ",hexdump" << hexdump(data, bytes > 16 ? 16 : bytes);
}
......
......@@ -180,9 +180,11 @@ void RtpProcess::onRtpDecode(const uint8_t *packet, int bytes, uint32_t timestam
//创建解码器
if(checkTS(packet, bytes)){
//猜测是ts负载
InfoL << "judged to be TS: " << printSSRC(_ssrc);
_decoder = Decoder::createDecoder(Decoder::decoder_ts);
}else{
//猜测是ps负载
InfoL << "judged to be PS: " << printSSRC(_ssrc);
_decoder = Decoder::createDecoder(Decoder::decoder_ps);
}
_decoder->setOnDecode([this](int stream,int codecid,int flags,int64_t pts,int64_t dts,const void *data,int bytes){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论