mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
TODO: FIXME: for librtmp, must group NALUs to frame.
This commit is contained in:
parent
80a98cf836
commit
7aaa74b9e0
1 changed files with 9 additions and 3 deletions
|
@ -1296,12 +1296,18 @@ int srs_write_h264_ipb_frame(Context* context,
|
||||||
|
|
||||||
// 5bits, 7.3.1 NAL unit syntax,
|
// 5bits, 7.3.1 NAL unit syntax,
|
||||||
// H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
|
// H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
|
||||||
// 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
|
// 5: I Frame, 1: P/B Frame
|
||||||
SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
|
// @remark for rtmp, we only need to send the I/P/B frames to server,
|
||||||
|
// the aud is used for server to remux stream to annexb.
|
||||||
|
// TODO: FIXME: we must group NALUs between AUD to a frame.
|
||||||
|
SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f);
|
||||||
|
if (nut != SrsAvcNaluTypeIDR && nut != SrsAvcNaluTypeNonIDR) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
// for IDR frame, the frame is keyframe.
|
// for IDR frame, the frame is keyframe.
|
||||||
SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
|
SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
|
||||||
if (nal_unit_type == SrsAvcNaluTypeIDR) {
|
if (nut == SrsAvcNaluTypeIDR) {
|
||||||
frame_type = SrsCodecVideoAVCFrameKeyFrame;
|
frame_type = SrsCodecVideoAVCFrameKeyFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue