mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +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,
|
||||
// H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
|
||||
// 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
|
||||
SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
|
||||
// 5: I Frame, 1: P/B Frame
|
||||
// @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.
|
||||
SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
|
||||
if (nal_unit_type == SrsAvcNaluTypeIDR) {
|
||||
if (nut == SrsAvcNaluTypeIDR) {
|
||||
frame_type = SrsCodecVideoAVCFrameKeyFrame;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue