winlin

librtmp: refine comment for NALU process.

@@ -181,11 +181,11 @@ int main(int argc, char** argv) @@ -181,11 +181,11 @@ int main(int argc, char** argv)
181 181
182 // 5bits, 7.3.1 NAL unit syntax, 182 // 5bits, 7.3.1 NAL unit syntax,
183 // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. 183 // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
184 - // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD 184 + // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD, 6: SEI
185 u_int8_t nut = (char)data[nb_start_code] & 0x1f; 185 u_int8_t nut = (char)data[nb_start_code] & 0x1f;
186 srs_human_trace("sent packet: type=%s, time=%d, size=%d, fps=%.2f, b[%d]=%#x(%s)", 186 srs_human_trace("sent packet: type=%s, time=%d, size=%d, fps=%.2f, b[%d]=%#x(%s)",
187 srs_human_flv_tag_type2string(SRS_RTMP_TYPE_VIDEO), dts, size, fps, nb_start_code, (char)data[nb_start_code], 187 srs_human_flv_tag_type2string(SRS_RTMP_TYPE_VIDEO), dts, size, fps, nb_start_code, (char)data[nb_start_code],
188 - (nut == 7? "SPS":(nut == 8? "PPS":(nut == 5? "I":(nut == 1? "P":(nut == 9? "AUD":"Unknown")))))); 188 + (nut == 7? "SPS":(nut == 8? "PPS":(nut == 5? "I":(nut == 1? "P":(nut == 9? "AUD":(nut == 6? "SEI":"Unknown")))))));
189 189
190 // @remark, when use encode device, it not need to sleep. 190 // @remark, when use encode device, it not need to sleep.
191 if (count == 10) { 191 if (count == 10) {
@@ -1297,9 +1297,10 @@ int srs_write_h264_ipb_frame(Context* context, @@ -1297,9 +1297,10 @@ int srs_write_h264_ipb_frame(Context* context,
1297 // 5bits, 7.3.1 NAL unit syntax, 1297 // 5bits, 7.3.1 NAL unit syntax,
1298 // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. 1298 // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
1299 // 5: I Frame, 1: P/B Frame 1299 // 5: I Frame, 1: P/B Frame
1300 - // @remark for rtmp, we only need to send the I/P/B frames to server,  
1301 - // the aud is used for server to remux stream to annexb.  
1302 - // TODO: FIXME: we must group NALUs between AUD to a frame. 1300 + // @remark we already group sps/pps to sequence header frame;
  1301 + // for I/P NALU, we send them in isolate frame, each NALU in a frame;
  1302 + // for other NALU, for example, AUD/SEI, we just ignore them, because
  1303 + // AUD used in annexb to split frame, while SEI generally we can ignore it.
1303 SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f); 1304 SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f);
1304 if (nut != SrsAvcNaluTypeIDR && nut != SrsAvcNaluTypeNonIDR) { 1305 if (nut != SrsAvcNaluTypeIDR && nut != SrsAvcNaluTypeNonIDR) {
1305 return ret; 1306 return ret;