winlin

Merge branch '2.0release' into develop

@@ -7,7 +7,7 @@ RMB 10000+ @@ -7,7 +7,7 @@ RMB 10000+
7 * [2015-03-03 13:25] 郭强 7 * [2015-03-03 13:25] 郭强
8 8
9 RMB 1000-9999 9 RMB 1000-9999
10 -* [2015-xx-xx xx:xx] xxx 10 +* [2015-04-04 16:19] 蔡汉城
11 11
12 RMB 500-999 12 RMB 500-999
13 * [2015-xx-xx xx:xx] xxx 13 * [2015-xx-xx xx:xx] xxx
@@ -487,11 +487,7 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow() @@ -487,11 +487,7 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow()
487 { 487 {
488 // @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-83553950 488 // @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-83553950
489 srs_assert(current); 489 srs_assert(current);
490 -  
491 - // use N% deviation, to smoother.  
492 - double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * hls_fragment_deviation : 0.0;  
493 -  
494 - return current->duration >= hls_aof_ratio * (hls_fragment + deviation); 490 + return current->duration >= hls_aof_ratio * hls_fragment;
495 } 491 }
496 492
497 int SrsHlsMuxer::update_acodec(SrsCodecAudio ac) 493 int SrsHlsMuxer::update_acodec(SrsCodecAudio ac)
@@ -922,7 +918,7 @@ int SrsHlsCache::write_video(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t @@ -922,7 +918,7 @@ int SrsHlsCache::write_video(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
922 // 2. some gops duration overflow. 918 // 2. some gops duration overflow.
923 if (sample->frame_type == SrsCodecVideoAVCFrameKeyFrame && muxer->is_segment_overflow()) { 919 if (sample->frame_type == SrsCodecVideoAVCFrameKeyFrame && muxer->is_segment_overflow()) {
924 if (!sample->has_idr) { 920 if (!sample->has_idr) {
925 - srs_warn("hls: ts starts without IDR, first nalu=%d", sample->first_nalu_type); 921 + srs_warn("hls: ts starts without IDR, first nalu=%d, idr=%d", sample->first_nalu_type, sample->has_idr);
926 } 922 }
927 if ((ret = reap_segment("video", muxer, cache->video->dts)) != ERROR_SUCCESS) { 923 if ((ret = reap_segment("video", muxer, cache->video->dts)) != ERROR_SUCCESS) {
928 return ret; 924 return ret;
@@ -355,11 +355,14 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) @@ -355,11 +355,14 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
355 if ((ret = avc->annexb_demux(avs, &frame, &frame_size)) != ERROR_SUCCESS) { 355 if ((ret = avc->annexb_demux(avs, &frame, &frame_size)) != ERROR_SUCCESS) {
356 return ret; 356 return ret;
357 } 357 }
358 -  
359 - // ignore invalid frame,  
360 - // * atleast 1bytes for SPS to decode the type  
361 - // * ignore the auth bytes '09f0'  
362 - if (frame_size <= 2) { 358 +
  359 + // 5bits, 7.3.1 NAL unit syntax,
  360 + // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
  361 + // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
  362 + SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
  363 +
  364 + // ignore the nalu type sps(7), pps(8), aud(9)
  365 + if (nal_unit_type == SrsAvcNaluTypeAccessUnitDelimiter) {
363 continue; 366 continue;
364 } 367 }
365 368
@@ -402,6 +405,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) @@ -402,6 +405,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs)
402 } 405 }
403 406
404 // ibp frame. 407 // ibp frame.
  408 + // TODO: FIXME: we should group all frames to a rtmp/flv message from one ts message.
405 srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", ibpframe_size, dts); 409 srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", ibpframe_size, dts);
406 if ((ret = write_h264_ipb_frame(frame, frame_size, dts, pts)) != ERROR_SUCCESS) { 410 if ((ret = write_h264_ipb_frame(frame, frame_size, dts, pts)) != ERROR_SUCCESS) {
407 return ret; 411 return ret;
@@ -458,10 +462,20 @@ int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_ @@ -458,10 +462,20 @@ int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_
458 if (!h264_sps_pps_sent) { 462 if (!h264_sps_pps_sent) {
459 return ERROR_H264_DROP_BEFORE_SPS_PPS; 463 return ERROR_H264_DROP_BEFORE_SPS_PPS;
460 } 464 }
  465 +
  466 + // 5bits, 7.3.1 NAL unit syntax,
  467 + // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
  468 + // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
  469 + SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
  470 +
  471 + // for IDR frame, the frame is keyframe.
  472 + SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
  473 + if (nal_unit_type == SrsAvcNaluTypeIDR) {
  474 + frame_type = SrsCodecVideoAVCFrameKeyFrame;
  475 + }
461 476
462 std::string ibp; 477 std::string ibp;
463 - int8_t frame_type;  
464 - if ((ret = avc->mux_ipb_frame(frame, frame_size, dts, pts, ibp, frame_type)) != ERROR_SUCCESS) { 478 + if ((ret = avc->mux_ipb_frame(frame, frame_size, ibp)) != ERROR_SUCCESS) {
465 return ret; 479 return ret;
466 } 480 }
467 481
@@ -579,10 +579,20 @@ int SrsRtspConn::write_h264_sps_pps(u_int32_t dts, u_int32_t pts) @@ -579,10 +579,20 @@ int SrsRtspConn::write_h264_sps_pps(u_int32_t dts, u_int32_t pts)
579 int SrsRtspConn::write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts, u_int32_t pts) 579 int SrsRtspConn::write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts, u_int32_t pts)
580 { 580 {
581 int ret = ERROR_SUCCESS; 581 int ret = ERROR_SUCCESS;
  582 +
  583 + // 5bits, 7.3.1 NAL unit syntax,
  584 + // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
  585 + // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
  586 + SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
  587 +
  588 + // for IDR frame, the frame is keyframe.
  589 + SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
  590 + if (nal_unit_type == SrsAvcNaluTypeIDR) {
  591 + frame_type = SrsCodecVideoAVCFrameKeyFrame;
  592 + }
582 593
583 std::string ibp; 594 std::string ibp;
584 - int8_t frame_type;  
585 - if ((ret = avc->mux_ipb_frame(frame, frame_size, dts, pts, ibp, frame_type)) != ERROR_SUCCESS) { 595 + if ((ret = avc->mux_ipb_frame(frame, frame_size, ibp)) != ERROR_SUCCESS) {
586 return ret; 596 return ret;
587 } 597 }
588 598
@@ -876,6 +876,13 @@ int SrsAvcAacCodec::avc_demux_sps() @@ -876,6 +876,13 @@ int SrsAvcAacCodec::avc_demux_sps()
876 876
877 // XX 00 00 03 XX, the 03 byte should be drop. 877 // XX 00 00 03 XX, the 03 byte should be drop.
878 if (nb_rbsp > 2 && rbsp[nb_rbsp - 2] == 0 && rbsp[nb_rbsp - 1] == 0 && rbsp[nb_rbsp] == 3) { 878 if (nb_rbsp > 2 && rbsp[nb_rbsp - 2] == 0 && rbsp[nb_rbsp - 1] == 0 && rbsp[nb_rbsp] == 3) {
  879 + // read 1byte more.
  880 + if (stream.empty()) {
  881 + break;
  882 + }
  883 + rbsp[nb_rbsp] = stream.read_1bytes();
  884 + nb_rbsp++;
  885 +
879 continue; 886 continue;
880 } 887 }
881 888
@@ -929,7 +936,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -929,7 +936,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
929 return ret; 936 return ret;
930 } 937 }
931 938
932 - int64_t seq_parameter_set_id = -1; 939 + int32_t seq_parameter_set_id = -1;
933 if ((ret = srs_avc_nalu_read_uev(&bs, seq_parameter_set_id)) != ERROR_SUCCESS) { 940 if ((ret = srs_avc_nalu_read_uev(&bs, seq_parameter_set_id)) != ERROR_SUCCESS) {
934 return ret; 941 return ret;
935 } 942 }
@@ -944,7 +951,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -944,7 +951,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
944 || profile_idc == 44 || profile_idc == 83 || profile_idc == 86 || profile_idc == 118 951 || profile_idc == 44 || profile_idc == 83 || profile_idc == 86 || profile_idc == 118
945 || profile_idc == 128 952 || profile_idc == 128
946 ) { 953 ) {
947 - int64_t chroma_format_idc = -1; 954 + int32_t chroma_format_idc = -1;
948 if ((ret = srs_avc_nalu_read_uev(&bs, chroma_format_idc)) != ERROR_SUCCESS) { 955 if ((ret = srs_avc_nalu_read_uev(&bs, chroma_format_idc)) != ERROR_SUCCESS) {
949 return ret; 956 return ret;
950 } 957 }
@@ -955,12 +962,12 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -955,12 +962,12 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
955 } 962 }
956 } 963 }
957 964
958 - int64_t bit_depth_luma_minus8 = -1; 965 + int32_t bit_depth_luma_minus8 = -1;
959 if ((ret = srs_avc_nalu_read_uev(&bs, bit_depth_luma_minus8)) != ERROR_SUCCESS) { 966 if ((ret = srs_avc_nalu_read_uev(&bs, bit_depth_luma_minus8)) != ERROR_SUCCESS) {
960 return ret; 967 return ret;
961 } 968 }
962 969
963 - int64_t bit_depth_chroma_minus8 = -1; 970 + int32_t bit_depth_chroma_minus8 = -1;
964 if ((ret = srs_avc_nalu_read_uev(&bs, bit_depth_chroma_minus8)) != ERROR_SUCCESS) { 971 if ((ret = srs_avc_nalu_read_uev(&bs, bit_depth_chroma_minus8)) != ERROR_SUCCESS) {
965 return ret; 972 return ret;
966 } 973 }
@@ -981,18 +988,18 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -981,18 +988,18 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
981 } 988 }
982 } 989 }
983 990
984 - int64_t log2_max_frame_num_minus4 = -1; 991 + int32_t log2_max_frame_num_minus4 = -1;
985 if ((ret = srs_avc_nalu_read_uev(&bs, log2_max_frame_num_minus4)) != ERROR_SUCCESS) { 992 if ((ret = srs_avc_nalu_read_uev(&bs, log2_max_frame_num_minus4)) != ERROR_SUCCESS) {
986 return ret; 993 return ret;
987 } 994 }
988 995
989 - int64_t pic_order_cnt_type = -1; 996 + int32_t pic_order_cnt_type = -1;
990 if ((ret = srs_avc_nalu_read_uev(&bs, pic_order_cnt_type)) != ERROR_SUCCESS) { 997 if ((ret = srs_avc_nalu_read_uev(&bs, pic_order_cnt_type)) != ERROR_SUCCESS) {
991 return ret; 998 return ret;
992 } 999 }
993 1000
994 if (pic_order_cnt_type == 0) { 1001 if (pic_order_cnt_type == 0) {
995 - int64_t log2_max_pic_order_cnt_lsb_minus4 = -1; 1002 + int32_t log2_max_pic_order_cnt_lsb_minus4 = -1;
996 if ((ret = srs_avc_nalu_read_uev(&bs, log2_max_pic_order_cnt_lsb_minus4)) != ERROR_SUCCESS) { 1003 if ((ret = srs_avc_nalu_read_uev(&bs, log2_max_pic_order_cnt_lsb_minus4)) != ERROR_SUCCESS) {
997 return ret; 1004 return ret;
998 } 1005 }
@@ -1002,17 +1009,17 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -1002,17 +1009,17 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
1002 return ret; 1009 return ret;
1003 } 1010 }
1004 1011
1005 - int64_t offset_for_non_ref_pic = -1; 1012 + int32_t offset_for_non_ref_pic = -1;
1006 if ((ret = srs_avc_nalu_read_uev(&bs, offset_for_non_ref_pic)) != ERROR_SUCCESS) { 1013 if ((ret = srs_avc_nalu_read_uev(&bs, offset_for_non_ref_pic)) != ERROR_SUCCESS) {
1007 return ret; 1014 return ret;
1008 } 1015 }
1009 1016
1010 - int64_t offset_for_top_to_bottom_field = -1; 1017 + int32_t offset_for_top_to_bottom_field = -1;
1011 if ((ret = srs_avc_nalu_read_uev(&bs, offset_for_top_to_bottom_field)) != ERROR_SUCCESS) { 1018 if ((ret = srs_avc_nalu_read_uev(&bs, offset_for_top_to_bottom_field)) != ERROR_SUCCESS) {
1012 return ret; 1019 return ret;
1013 } 1020 }
1014 1021
1015 - int64_t num_ref_frames_in_pic_order_cnt_cycle = -1; 1022 + int32_t num_ref_frames_in_pic_order_cnt_cycle = -1;
1016 if ((ret = srs_avc_nalu_read_uev(&bs, num_ref_frames_in_pic_order_cnt_cycle)) != ERROR_SUCCESS) { 1023 if ((ret = srs_avc_nalu_read_uev(&bs, num_ref_frames_in_pic_order_cnt_cycle)) != ERROR_SUCCESS) {
1017 return ret; 1024 return ret;
1018 } 1025 }
@@ -1023,7 +1030,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -1023,7 +1030,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
1023 } 1030 }
1024 } 1031 }
1025 1032
1026 - int64_t max_num_ref_frames = -1; 1033 + int32_t max_num_ref_frames = -1;
1027 if ((ret = srs_avc_nalu_read_uev(&bs, max_num_ref_frames)) != ERROR_SUCCESS) { 1034 if ((ret = srs_avc_nalu_read_uev(&bs, max_num_ref_frames)) != ERROR_SUCCESS) {
1028 return ret; 1035 return ret;
1029 } 1036 }
@@ -1033,12 +1040,12 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) @@ -1033,12 +1040,12 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
1033 return ret; 1040 return ret;
1034 } 1041 }
1035 1042
1036 - int64_t pic_width_in_mbs_minus1 = -1; 1043 + int32_t pic_width_in_mbs_minus1 = -1;
1037 if ((ret = srs_avc_nalu_read_uev(&bs, pic_width_in_mbs_minus1)) != ERROR_SUCCESS) { 1044 if ((ret = srs_avc_nalu_read_uev(&bs, pic_width_in_mbs_minus1)) != ERROR_SUCCESS) {
1038 return ret; 1045 return ret;
1039 } 1046 }
1040 1047
1041 - int64_t pic_height_in_map_units_minus1 = -1; 1048 + int32_t pic_height_in_map_units_minus1 = -1;
1042 if ((ret = srs_avc_nalu_read_uev(&bs, pic_height_in_map_units_minus1)) != ERROR_SUCCESS) { 1049 if ((ret = srs_avc_nalu_read_uev(&bs, pic_height_in_map_units_minus1)) != ERROR_SUCCESS) {
1043 return ret; 1050 return ret;
1044 } 1051 }
@@ -46,7 +46,7 @@ using namespace std; @@ -46,7 +46,7 @@ using namespace std;
46 // @see SRS_SYS_TIME_RESOLUTION_MS_TIMES 46 // @see SRS_SYS_TIME_RESOLUTION_MS_TIMES
47 #define SYS_TIME_RESOLUTION_US 300*1000 47 #define SYS_TIME_RESOLUTION_US 300*1000
48 48
49 -int srs_avc_nalu_read_uev(SrsBitStream* stream, int64_t& v) 49 +int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v)
50 { 50 {
51 int ret = ERROR_SUCCESS; 51 int ret = ERROR_SUCCESS;
52 52
@@ -67,13 +67,13 @@ int srs_avc_nalu_read_uev(SrsBitStream* stream, int64_t& v) @@ -67,13 +67,13 @@ int srs_avc_nalu_read_uev(SrsBitStream* stream, int64_t& v)
67 b = stream->read_bit(); 67 b = stream->read_bit();
68 } 68 }
69 69
70 - if (leadingZeroBits >= 64) { 70 + if (leadingZeroBits >= 31) {
71 return ERROR_AVC_NALU_UEV; 71 return ERROR_AVC_NALU_UEV;
72 } 72 }
73 73
74 v = (1 << leadingZeroBits) - 1; 74 v = (1 << leadingZeroBits) - 1;
75 for (int i = 0; i < leadingZeroBits; i++) { 75 for (int i = 0; i < leadingZeroBits; i++) {
76 - int64_t b = stream->read_bit(); 76 + int32_t b = stream->read_bit();
77 v += b << (leadingZeroBits - 1); 77 v += b << (leadingZeroBits - 1);
78 } 78 }
79 79
@@ -40,7 +40,7 @@ class SrsBitStream; @@ -40,7 +40,7 @@ class SrsBitStream;
40 #define srs_max(a, b) (((a) < (b))? (b) : (a)) 40 #define srs_max(a, b) (((a) < (b))? (b) : (a))
41 41
42 // read nalu uev. 42 // read nalu uev.
43 -extern int srs_avc_nalu_read_uev(SrsBitStream* stream, int64_t& v); 43 +extern int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v);
44 extern int srs_avc_nalu_read_bit(SrsBitStream* stream, int8_t& v); 44 extern int srs_avc_nalu_read_bit(SrsBitStream* stream, int8_t& v);
45 45
46 // get current system time in ms, use cache to avoid performance problem 46 // get current system time in ms, use cache to avoid performance problem
@@ -1243,10 +1243,20 @@ int srs_write_h264_ipb_frame(Context* context, @@ -1243,10 +1243,20 @@ int srs_write_h264_ipb_frame(Context* context,
1243 if (!context->h264_sps_pps_sent) { 1243 if (!context->h264_sps_pps_sent) {
1244 return ERROR_H264_DROP_BEFORE_SPS_PPS; 1244 return ERROR_H264_DROP_BEFORE_SPS_PPS;
1245 } 1245 }
1246 - 1246 +
  1247 + // 5bits, 7.3.1 NAL unit syntax,
  1248 + // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
  1249 + // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
  1250 + SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f);
  1251 +
  1252 + // for IDR frame, the frame is keyframe.
  1253 + SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame;
  1254 + if (nal_unit_type == SrsAvcNaluTypeIDR) {
  1255 + frame_type = SrsCodecVideoAVCFrameKeyFrame;
  1256 + }
  1257 +
1247 std::string ibp; 1258 std::string ibp;
1248 - int8_t frame_type;  
1249 - if ((ret = context->avc_raw.mux_ipb_frame(frame, frame_size, dts, pts, ibp, frame_type)) != ERROR_SUCCESS) { 1259 + if ((ret = context->avc_raw.mux_ipb_frame(frame, frame_size, ibp)) != ERROR_SUCCESS) {
1250 return ret; 1260 return ret;
1251 } 1261 }
1252 1262
@@ -226,15 +226,10 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, @@ -226,15 +226,10 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts,
226 return ret; 226 return ret;
227 } 227 }
228 228
229 -int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, u_int32_t dts, u_int32_t pts, string& ibp, int8_t& frame_type) 229 +int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, string& ibp)
230 { 230 {
231 int ret = ERROR_SUCCESS; 231 int ret = ERROR_SUCCESS;
232 232
233 - // 5bits, 7.3.1 NAL unit syntax,  
234 - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44.  
235 - // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame  
236 - u_int8_t nal_unit_type = (char)frame[0] & 0x1f;  
237 -  
238 // 4bytes size of nalu: 233 // 4bytes size of nalu:
239 // NALUnitLength 234 // NALUnitLength
240 // Nbytes of nalu. 235 // Nbytes of nalu.
@@ -260,12 +255,6 @@ int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, u_int32_t dts, u_ @@ -260,12 +255,6 @@ int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, u_int32_t dts, u_
260 // NALUnit 255 // NALUnit
261 stream.write_bytes(frame, nb_frame); 256 stream.write_bytes(frame, nb_frame);
262 257
263 - // send out h264 packet.  
264 - frame_type = SrsCodecVideoAVCFrameInterFrame;  
265 - if (nal_unit_type != 1) {  
266 - frame_type = SrsCodecVideoAVCFrameKeyFrame;  
267 - }  
268 -  
269 ibp = ""; 258 ibp = "";
270 ibp.append(packet, nb_packet); 259 ibp.append(packet, nb_packet);
271 260
@@ -281,7 +270,7 @@ int SrsRawH264Stream::mux_avc2flv(string video, int8_t frame_type, int8_t avc_pa @@ -281,7 +270,7 @@ int SrsRawH264Stream::mux_avc2flv(string video, int8_t frame_type, int8_t avc_pa
281 // 1bytes, AVCPacketType 270 // 1bytes, AVCPacketType
282 // 3bytes, CompositionTime, the cts. 271 // 3bytes, CompositionTime, the cts.
283 // @see: E.4.3 Video Tags, video_file_format_spec_v10_1.pdf, page 78 272 // @see: E.4.3 Video Tags, video_file_format_spec_v10_1.pdf, page 78
284 - int size = video.length() + 5; 273 + int size = (int)video.length() + 5;
285 char* data = new char[size]; 274 char* data = new char[size];
286 char* p = data; 275 char* p = data;
287 276
@@ -76,7 +76,7 @@ public: @@ -76,7 +76,7 @@ public:
76 * @param ibp output the packet. 76 * @param ibp output the packet.
77 * @param frame_type output the frame type. 77 * @param frame_type output the frame type.
78 */ 78 */
79 - virtual int mux_ipb_frame(char* frame, int nb_frame, u_int32_t dts, u_int32_t pts, std::string& ibp, int8_t& frame_type); 79 + virtual int mux_ipb_frame(char* frame, int nb_frame, std::string& ibp);
80 /** 80 /**
81 * mux the avc video packet to flv video packet. 81 * mux the avc video packet to flv video packet.
82 * @param frame_type, SrsCodecVideoAVCFrameKeyFrame or SrsCodecVideoAVCFrameInterFrame. 82 * @param frame_type, SrsCodecVideoAVCFrameKeyFrame or SrsCodecVideoAVCFrameInterFrame.