winlin

for bug #66, output the h264 frame type.

@@ -171,8 +171,13 @@ int main(int argc, char** argv) @@ -171,8 +171,13 @@ int main(int argc, char** argv)
171 if (srs_write_packet(rtmp, type, timestamp, rtmp_data, rtmp_size) != 0) { 171 if (srs_write_packet(rtmp, type, timestamp, rtmp_data, rtmp_size) != 0) {
172 goto rtmp_destroy; 172 goto rtmp_destroy;
173 } 173 }
174 - srs_trace("sent packet: type=%s, time=%d, size=%d, fps=%d",  
175 - srs_type2string(type), timestamp, rtmp_size, fps); 174 +
  175 + // 5bits, 7.3.1 NAL unit syntax,
  176 + // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
  177 + u_int8_t nut = (char)data[0] & 0x1f;
  178 + srs_trace("sent packet: type=%s, time=%d, size=%d, fps=%d, b[0]=%#x(%s)",
  179 + srs_type2string(type), timestamp, rtmp_size, fps, nut,
  180 + (nut == 7? "SPS":(nut == 8? "PPS":(nut == 5? "I":(nut == 1? "P":"Unknown")))));
176 181
177 // @remark, when use encode device, it not need to sleep. 182 // @remark, when use encode device, it not need to sleep.
178 usleep(1000 / fps * 1000); 183 usleep(1000 / fps * 1000);