正在显示
22 个修改的文件
包含
73 行增加
和
70 行删除
不能预览此文件类型
trunk/doc/ISO_IEC_14496-14-MP4-2003.pdf
0 → 100644
不能预览此文件类型
不能预览此文件类型
| @@ -22,6 +22,9 @@ H.264-AVC-ISO_IEC_14496-10.pdf | @@ -22,6 +22,9 @@ H.264-AVC-ISO_IEC_14496-10.pdf | ||
| 22 | H.264-AVC-ISO_IEC_14496-12_2012-mp4.pdf | 22 | H.264-AVC-ISO_IEC_14496-12_2012-mp4.pdf |
| 23 | mp4标准。 | 23 | mp4标准。 |
| 24 | 24 | ||
| 25 | +ISO_14496-14_2003_mp4-file-format.pdf | ||
| 26 | + mp4文件格式。 | ||
| 27 | + | ||
| 25 | MPEG-DASH-ISO_IEC_23009-1_2012.pdf | 28 | MPEG-DASH-ISO_IEC_23009-1_2012.pdf |
| 26 | MPEG-DASH标准。 | 29 | MPEG-DASH标准。 |
| 27 | 30 |
| @@ -181,7 +181,7 @@ int main(int argc, char** argv) | @@ -181,7 +181,7 @@ int main(int argc, char** argv) | ||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | // 5bits, 7.3.1 NAL unit syntax, | 183 | // 5bits, 7.3.1 NAL unit syntax, |
| 184 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 184 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 185 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD, 6: SEI | 185 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD, 6: SEI |
| 186 | u_int8_t nut = (char)data[nb_start_code] & 0x1f; | 186 | u_int8_t nut = (char)data[nb_start_code] & 0x1f; |
| 187 | srs_human_trace("sent packet: type=%s, time=%d, size=%d, fps=%.2f, b[%d]=%#x(%s)", | 187 | srs_human_trace("sent packet: type=%s, time=%d, size=%d, fps=%.2f, b[%d]=%#x(%s)", |
| @@ -259,8 +259,8 @@ int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg) | @@ -259,8 +259,8 @@ int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg) | ||
| 259 | // for example, when SrsTsStream of SrsTsChannel indicates stream_type is SrsTsStreamVideoMpeg4 and SrsTsStreamAudioMpeg4, | 259 | // for example, when SrsTsStream of SrsTsChannel indicates stream_type is SrsTsStreamVideoMpeg4 and SrsTsStreamAudioMpeg4, |
| 260 | // the elementary stream can be mux in "2.11 Carriage of ISO/IEC 14496 data" in hls-mpeg-ts-iso13818-1.pdf, page 103 | 260 | // the elementary stream can be mux in "2.11 Carriage of ISO/IEC 14496 data" in hls-mpeg-ts-iso13818-1.pdf, page 103 |
| 261 | // @remark, the most popular stream_id is 0xe0 for h.264 over mpegts, which indicates the stream_id is video and | 261 | // @remark, the most popular stream_id is 0xe0 for h.264 over mpegts, which indicates the stream_id is video and |
| 262 | - // stream_number is 0, where I guess the elementary is specified in annexb format(H.264-AVC-ISO_IEC_14496-10.pdf, page 211). | ||
| 263 | - // because when audio stream_number is 0, the elementary is ADTS(aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS). | 262 | + // stream_number is 0, where I guess the elementary is specified in annexb format(ISO_IEC_14496-10-AVC-2003.pdf, page 211). |
| 263 | + // because when audio stream_number is 0, the elementary is ADTS(ISO_IEC_14496-3-AAC-2001.pdf, page 75, 1.A.2.2 ADTS). | ||
| 264 | 264 | ||
| 265 | // about the bytes of PES_packet_data_byte, defined in hls-mpeg-ts-iso13818-1.pdf, page 58 | 265 | // about the bytes of PES_packet_data_byte, defined in hls-mpeg-ts-iso13818-1.pdf, page 58 |
| 266 | // PES_packet_data_byte "C PES_packet_data_bytes shall be contiguous bytes of data from the elementary stream | 266 | // PES_packet_data_byte "C PES_packet_data_bytes shall be contiguous bytes of data from the elementary stream |
| @@ -361,7 +361,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs) | @@ -361,7 +361,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs) | ||
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | // 5bits, 7.3.1 NAL unit syntax, | 363 | // 5bits, 7.3.1 NAL unit syntax, |
| 364 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 364 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 365 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 365 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 366 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); | 366 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); |
| 367 | 367 | ||
| @@ -471,7 +471,7 @@ int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_ | @@ -471,7 +471,7 @@ int SrsMpegtsOverUdp::write_h264_ipb_frame(char* frame, int frame_size, u_int32_ | ||
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | // 5bits, 7.3.1 NAL unit syntax, | 473 | // 5bits, 7.3.1 NAL unit syntax, |
| 474 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 474 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 475 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 475 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 476 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); | 476 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); |
| 477 | 477 |
| @@ -581,7 +581,7 @@ int SrsRtspConn::write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts | @@ -581,7 +581,7 @@ int SrsRtspConn::write_h264_ipb_frame(char* frame, int frame_size, u_int32_t dts | ||
| 581 | int ret = ERROR_SUCCESS; | 581 | int ret = ERROR_SUCCESS; |
| 582 | 582 | ||
| 583 | // 5bits, 7.3.1 NAL unit syntax, | 583 | // 5bits, 7.3.1 NAL unit syntax, |
| 584 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 584 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 585 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 585 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 586 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); | 586 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); |
| 587 | 587 |
| @@ -81,9 +81,9 @@ public: | @@ -81,9 +81,9 @@ public: | ||
| 81 | public: | 81 | public: |
| 82 | bool has_video; | 82 | bool has_video; |
| 83 | SrsCodecVideo vcodec; | 83 | SrsCodecVideo vcodec; |
| 84 | - // profile_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45. | 84 | + // profile_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45. |
| 85 | SrsAvcProfile avc_profile; | 85 | SrsAvcProfile avc_profile; |
| 86 | - // level_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45. | 86 | + // level_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45. |
| 87 | SrsAvcLevel avc_level; | 87 | SrsAvcLevel avc_level; |
| 88 | // the width and height in codec info. | 88 | // the width and height in codec info. |
| 89 | int width; | 89 | int width; |
| @@ -97,7 +97,7 @@ public: | @@ -97,7 +97,7 @@ public: | ||
| 97 | * audio specified | 97 | * audio specified |
| 98 | * audioObjectType, in 1.6.2.1 AudioSpecificConfig, page 33, | 98 | * audioObjectType, in 1.6.2.1 AudioSpecificConfig, page 33, |
| 99 | * 1.5.1.1 Audio object type definition, page 23, | 99 | * 1.5.1.1 Audio object type definition, page 23, |
| 100 | - * in aac-mp4a-format-ISO_IEC_14496-3+2001.pdf. | 100 | + * in ISO_IEC_14496-3-AAC-2001.pdf. |
| 101 | */ | 101 | */ |
| 102 | SrsAacObjectType aac_object; | 102 | SrsAacObjectType aac_object; |
| 103 | public: | 103 | public: |
| @@ -114,7 +114,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size) | @@ -114,7 +114,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size) | ||
| 114 | SrsCodecAudioType aac_packet_type = (SrsCodecAudioType)stream->read_1bytes(); | 114 | SrsCodecAudioType aac_packet_type = (SrsCodecAudioType)stream->read_1bytes(); |
| 115 | if (aac_packet_type == SrsCodecAudioTypeSequenceHeader) { | 115 | if (aac_packet_type == SrsCodecAudioTypeSequenceHeader) { |
| 116 | // AudioSpecificConfig | 116 | // AudioSpecificConfig |
| 117 | - // 1.6.2.1 AudioSpecificConfig, in aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 33. | 117 | + // 1.6.2.1 AudioSpecificConfig, in ISO_IEC_14496-3-AAC-2001.pdf, page 33. |
| 118 | // | 118 | // |
| 119 | // only need to decode the first 2bytes: | 119 | // only need to decode the first 2bytes: |
| 120 | // audioObjectType, 5bits. | 120 | // audioObjectType, 5bits. |
| @@ -150,7 +150,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size) | @@ -150,7 +150,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size) | ||
| 150 | int16_t aac_raw_length = stream->size() - stream->pos(); | 150 | int16_t aac_raw_length = stream->size() - stream->pos(); |
| 151 | 151 | ||
| 152 | // write the ADTS header. | 152 | // write the ADTS header. |
| 153 | - // @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, | 153 | + // @see ISO_IEC_14496-3-AAC-2001.pdf, page 75, |
| 154 | // 1.A.2.2 Audio_Data_Transport_Stream frame, ADTS | 154 | // 1.A.2.2 Audio_Data_Transport_Stream frame, ADTS |
| 155 | // @see https://github.com/ossrs/srs/issues/212#issuecomment-64145885 | 155 | // @see https://github.com/ossrs/srs/issues/212#issuecomment-64145885 |
| 156 | // byte_alignment() | 156 | // byte_alignment() |
| @@ -500,7 +500,7 @@ int SrsAvcAacCodec::audio_aac_demux(char* data, int size, SrsCodecSample* sample | @@ -500,7 +500,7 @@ int SrsAvcAacCodec::audio_aac_demux(char* data, int size, SrsCodecSample* sample | ||
| 500 | 500 | ||
| 501 | if (aac_packet_type == SrsCodecAudioTypeSequenceHeader) { | 501 | if (aac_packet_type == SrsCodecAudioTypeSequenceHeader) { |
| 502 | // AudioSpecificConfig | 502 | // AudioSpecificConfig |
| 503 | - // 1.6.2.1 AudioSpecificConfig, in aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 33. | 503 | + // 1.6.2.1 AudioSpecificConfig, in ISO_IEC_14496-3-AAC-2001.pdf, page 33. |
| 504 | aac_extra_size = stream->size() - stream->pos(); | 504 | aac_extra_size = stream->size() - stream->pos(); |
| 505 | if (aac_extra_size > 0) { | 505 | if (aac_extra_size > 0) { |
| 506 | srs_freepa(aac_extra_data); | 506 | srs_freepa(aac_extra_data); |
| @@ -721,7 +721,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | @@ -721,7 +721,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | ||
| 721 | // guess for the first time. | 721 | // guess for the first time. |
| 722 | if (payload_format == SrsAvcPayloadFormatGuess) { | 722 | if (payload_format == SrsAvcPayloadFormatGuess) { |
| 723 | // One or more NALUs (Full frames are required) | 723 | // One or more NALUs (Full frames are required) |
| 724 | - // try "AnnexB" from H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 724 | + // try "AnnexB" from ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 725 | if ((ret = avc_demux_annexb_format(stream, sample)) != ERROR_SUCCESS) { | 725 | if ((ret = avc_demux_annexb_format(stream, sample)) != ERROR_SUCCESS) { |
| 726 | // stop try when system error. | 726 | // stop try when system error. |
| 727 | if (ret != ERROR_HLS_AVC_TRY_OTHERS) { | 727 | if (ret != ERROR_HLS_AVC_TRY_OTHERS) { |
| @@ -729,7 +729,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | @@ -729,7 +729,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | ||
| 729 | return ret; | 729 | return ret; |
| 730 | } | 730 | } |
| 731 | 731 | ||
| 732 | - // try "ISO Base Media File Format" from H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 732 | + // try "ISO Base Media File Format" from ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 733 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { | 733 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { |
| 734 | return ret; | 734 | return ret; |
| 735 | } else { | 735 | } else { |
| @@ -741,14 +741,14 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | @@ -741,14 +741,14 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | ||
| 741 | srs_info("hls guess avc payload is annexb format."); | 741 | srs_info("hls guess avc payload is annexb format."); |
| 742 | } | 742 | } |
| 743 | } else if (payload_format == SrsAvcPayloadFormatIbmf) { | 743 | } else if (payload_format == SrsAvcPayloadFormatIbmf) { |
| 744 | - // try "ISO Base Media File Format" from H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 744 | + // try "ISO Base Media File Format" from ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 745 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { | 745 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { |
| 746 | return ret; | 746 | return ret; |
| 747 | } | 747 | } |
| 748 | srs_info("hls decode avc payload in ibmf format."); | 748 | srs_info("hls decode avc payload in ibmf format."); |
| 749 | } else { | 749 | } else { |
| 750 | // One or more NALUs (Full frames are required) | 750 | // One or more NALUs (Full frames are required) |
| 751 | - // try "AnnexB" from H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 751 | + // try "AnnexB" from ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 752 | if ((ret = avc_demux_annexb_format(stream, sample)) != ERROR_SUCCESS) { | 752 | if ((ret = avc_demux_annexb_format(stream, sample)) != ERROR_SUCCESS) { |
| 753 | // ok, we guess out the payload is annexb, but maybe changed to ibmf. | 753 | // ok, we guess out the payload is annexb, but maybe changed to ibmf. |
| 754 | if (ret != ERROR_HLS_AVC_TRY_OTHERS) { | 754 | if (ret != ERROR_HLS_AVC_TRY_OTHERS) { |
| @@ -756,7 +756,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | @@ -756,7 +756,7 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample) | ||
| 756 | return ret; | 756 | return ret; |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | - // try "ISO Base Media File Format" from H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 759 | + // try "ISO Base Media File Format" from ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 760 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { | 760 | if ((ret = avc_demux_ibmf_format(stream, sample)) != ERROR_SUCCESS) { |
| 761 | return ret; | 761 | return ret; |
| 762 | } else { | 762 | } else { |
| @@ -775,7 +775,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | @@ -775,7 +775,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | ||
| 775 | int ret = ERROR_SUCCESS; | 775 | int ret = ERROR_SUCCESS; |
| 776 | 776 | ||
| 777 | // AVCDecoderConfigurationRecord | 777 | // AVCDecoderConfigurationRecord |
| 778 | - // 5.2.4.1.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 778 | + // 5.2.4.1.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 779 | avc_extra_size = stream->size() - stream->pos(); | 779 | avc_extra_size = stream->size() - stream->pos(); |
| 780 | if (avc_extra_size > 0) { | 780 | if (avc_extra_size > 0) { |
| 781 | srs_freepa(avc_extra_data); | 781 | srs_freepa(avc_extra_data); |
| @@ -802,7 +802,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | @@ -802,7 +802,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | ||
| 802 | lengthSizeMinusOne &= 0x03; | 802 | lengthSizeMinusOne &= 0x03; |
| 803 | NAL_unit_length = lengthSizeMinusOne; | 803 | NAL_unit_length = lengthSizeMinusOne; |
| 804 | 804 | ||
| 805 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 805 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 806 | // 5.2.4.1 AVC decoder configuration record | 806 | // 5.2.4.1 AVC decoder configuration record |
| 807 | // 5.2.4.1.2 Semantics | 807 | // 5.2.4.1.2 Semantics |
| 808 | // The value of this field shall be one of 0, 1, or 3 corresponding to a | 808 | // The value of this field shall be one of 0, 1, or 3 corresponding to a |
| @@ -814,7 +814,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | @@ -814,7 +814,7 @@ int SrsAvcAacCodec::avc_demux_sps_pps(SrsBuffer* stream) | ||
| 814 | } | 814 | } |
| 815 | 815 | ||
| 816 | // 1 sps, 7.3.2.1 Sequence parameter set RBSP syntax | 816 | // 1 sps, 7.3.2.1 Sequence parameter set RBSP syntax |
| 817 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 45. | 817 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 45. |
| 818 | if (!stream->require(1)) { | 818 | if (!stream->require(1)) { |
| 819 | ret = ERROR_HLS_DECODE_ERROR; | 819 | ret = ERROR_HLS_DECODE_ERROR; |
| 820 | srs_error("avc decode sequenc header sps failed. ret=%d", ret); | 820 | srs_error("avc decode sequenc header sps failed. ret=%d", ret); |
| @@ -890,7 +890,7 @@ int SrsAvcAacCodec::avc_demux_sps() | @@ -890,7 +890,7 @@ int SrsAvcAacCodec::avc_demux_sps() | ||
| 890 | } | 890 | } |
| 891 | 891 | ||
| 892 | // for NALU, 7.3.1 NAL unit syntax | 892 | // for NALU, 7.3.1 NAL unit syntax |
| 893 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 61. | 893 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 61. |
| 894 | if (!stream.require(1)) { | 894 | if (!stream.require(1)) { |
| 895 | ret = ERROR_HLS_DECODE_ERROR; | 895 | ret = ERROR_HLS_DECODE_ERROR; |
| 896 | srs_error("avc decode sps failed. ret=%d", ret); | 896 | srs_error("avc decode sps failed. ret=%d", ret); |
| @@ -916,7 +916,7 @@ int SrsAvcAacCodec::avc_demux_sps() | @@ -916,7 +916,7 @@ int SrsAvcAacCodec::avc_demux_sps() | ||
| 916 | } | 916 | } |
| 917 | 917 | ||
| 918 | // 7.4.1 NAL unit semantics | 918 | // 7.4.1 NAL unit semantics |
| 919 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 61. | 919 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 61. |
| 920 | // nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1. | 920 | // nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1. |
| 921 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(nutv & 0x1f); | 921 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(nutv & 0x1f); |
| 922 | if (nal_unit_type != 7) { | 922 | if (nal_unit_type != 7) { |
| @@ -970,7 +970,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | @@ -970,7 +970,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp) | ||
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | // for SPS, 7.3.2.1.1 Sequence parameter set data syntax | 972 | // for SPS, 7.3.2.1.1 Sequence parameter set data syntax |
| 973 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 62. | 973 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 62. |
| 974 | if (!stream.require(3)) { | 974 | if (!stream.require(3)) { |
| 975 | ret = ERROR_HLS_DECODE_ERROR; | 975 | ret = ERROR_HLS_DECODE_ERROR; |
| 976 | srs_error("sps shall atleast 3bytes. ret=%d", ret); | 976 | srs_error("sps shall atleast 3bytes. ret=%d", ret); |
| @@ -1143,7 +1143,7 @@ int SrsAvcAacCodec::avc_demux_annexb_format(SrsBuffer* stream, SrsCodecSample* s | @@ -1143,7 +1143,7 @@ int SrsAvcAacCodec::avc_demux_annexb_format(SrsBuffer* stream, SrsCodecSample* s | ||
| 1143 | 1143 | ||
| 1144 | // AnnexB | 1144 | // AnnexB |
| 1145 | // B.1.1 Byte stream NAL unit syntax, | 1145 | // B.1.1 Byte stream NAL unit syntax, |
| 1146 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 1146 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 1147 | while (!stream->empty()) { | 1147 | while (!stream->empty()) { |
| 1148 | // find start code | 1148 | // find start code |
| 1149 | int nb_start_code = 0; | 1149 | int nb_start_code = 0; |
| @@ -1191,14 +1191,14 @@ int SrsAvcAacCodec::avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sam | @@ -1191,14 +1191,14 @@ int SrsAvcAacCodec::avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sam | ||
| 1191 | 1191 | ||
| 1192 | int PictureLength = stream->size() - stream->pos(); | 1192 | int PictureLength = stream->size() - stream->pos(); |
| 1193 | 1193 | ||
| 1194 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 1194 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 1195 | // 5.2.4.1 AVC decoder configuration record | 1195 | // 5.2.4.1 AVC decoder configuration record |
| 1196 | // 5.2.4.1.2 Semantics | 1196 | // 5.2.4.1.2 Semantics |
| 1197 | // The value of this field shall be one of 0, 1, or 3 corresponding to a | 1197 | // The value of this field shall be one of 0, 1, or 3 corresponding to a |
| 1198 | // length encoded with 1, 2, or 4 bytes, respectively. | 1198 | // length encoded with 1, 2, or 4 bytes, respectively. |
| 1199 | srs_assert(NAL_unit_length != 2); | 1199 | srs_assert(NAL_unit_length != 2); |
| 1200 | 1200 | ||
| 1201 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 1201 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 1202 | for (int i = 0; i < PictureLength;) { | 1202 | for (int i = 0; i < PictureLength;) { |
| 1203 | // unsigned int((NAL_unit_length+1)*8) NALUnitLength; | 1203 | // unsigned int((NAL_unit_length+1)*8) NALUnitLength; |
| 1204 | if (!stream->require(NAL_unit_length + 1)) { | 1204 | if (!stream->require(NAL_unit_length + 1)) { |
| @@ -1229,7 +1229,7 @@ int SrsAvcAacCodec::avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sam | @@ -1229,7 +1229,7 @@ int SrsAvcAacCodec::avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sam | ||
| 1229 | srs_error("avc decode NALU data failed. ret=%d", ret); | 1229 | srs_error("avc decode NALU data failed. ret=%d", ret); |
| 1230 | return ret; | 1230 | return ret; |
| 1231 | } | 1231 | } |
| 1232 | - // 7.3.1 NAL unit syntax, H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 1232 | + // 7.3.1 NAL unit syntax, ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 1233 | if ((ret = sample->add_sample_unit(stream->data() + stream->pos(), NALUnitLength)) != ERROR_SUCCESS) { | 1233 | if ((ret = sample->add_sample_unit(stream->data() + stream->pos(), NALUnitLength)) != ERROR_SUCCESS) { |
| 1234 | srs_error("avc add video sample failed. ret=%d", ret); | 1234 | srs_error("avc add video sample failed. ret=%d", ret); |
| 1235 | return ret; | 1235 | return ret; |
| @@ -283,7 +283,7 @@ enum SrsCodecAudioSoundType | @@ -283,7 +283,7 @@ enum SrsCodecAudioSoundType | ||
| 283 | 283 | ||
| 284 | /** | 284 | /** |
| 285 | * Table 7-1 - NAL unit type codes, syntax element categories, and NAL unit type classes | 285 | * Table 7-1 - NAL unit type codes, syntax element categories, and NAL unit type classes |
| 286 | - * H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 83. | 286 | + * ISO_IEC_14496-10-AVC-2012.pdf, page 83. |
| 287 | */ | 287 | */ |
| 288 | enum SrsAvcNaluType | 288 | enum SrsAvcNaluType |
| 289 | { | 289 | { |
| @@ -452,15 +452,15 @@ std::string srs_codec_aac_profile2str(SrsAacProfile aac_profile); | @@ -452,15 +452,15 @@ std::string srs_codec_aac_profile2str(SrsAacProfile aac_profile); | ||
| 452 | 452 | ||
| 453 | /** | 453 | /** |
| 454 | * the aac object type, for RTMP sequence header | 454 | * the aac object type, for RTMP sequence header |
| 455 | -* for AudioSpecificConfig, @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 33 | ||
| 456 | -* for audioObjectType, @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 23 | 455 | +* for AudioSpecificConfig, @see ISO_IEC_14496-3-AAC-2001.pdf, page 33 |
| 456 | +* for audioObjectType, @see ISO_IEC_14496-3-AAC-2001.pdf, page 23 | ||
| 457 | */ | 457 | */ |
| 458 | enum SrsAacObjectType | 458 | enum SrsAacObjectType |
| 459 | { | 459 | { |
| 460 | SrsAacObjectTypeReserved = 0, | 460 | SrsAacObjectTypeReserved = 0, |
| 461 | 461 | ||
| 462 | // Table 1.1 - Audio Object Type definition | 462 | // Table 1.1 - Audio Object Type definition |
| 463 | - // @see @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 23 | 463 | + // @see @see ISO_IEC_14496-3-AAC-2001.pdf, page 23 |
| 464 | SrsAacObjectTypeAacMain = 1, | 464 | SrsAacObjectTypeAacMain = 1, |
| 465 | SrsAacObjectTypeAacLC = 2, | 465 | SrsAacObjectTypeAacLC = 2, |
| 466 | SrsAacObjectTypeAacSSR = 3, | 466 | SrsAacObjectTypeAacSSR = 3, |
| @@ -478,7 +478,7 @@ SrsAacProfile srs_codec_aac_rtmp2ts(SrsAacObjectType object_type); | @@ -478,7 +478,7 @@ SrsAacProfile srs_codec_aac_rtmp2ts(SrsAacObjectType object_type); | ||
| 478 | 478 | ||
| 479 | /** | 479 | /** |
| 480 | * the profile for avc/h.264. | 480 | * the profile for avc/h.264. |
| 481 | -* @see Annex A Profiles and levels, H.264-AVC-ISO_IEC_14496-10.pdf, page 205. | 481 | +* @see Annex A Profiles and levels, ISO_IEC_14496-10-AVC-2003.pdf, page 205. |
| 482 | */ | 482 | */ |
| 483 | enum SrsAvcProfile | 483 | enum SrsAvcProfile |
| 484 | { | 484 | { |
| @@ -504,7 +504,7 @@ std::string srs_codec_avc_profile2str(SrsAvcProfile profile); | @@ -504,7 +504,7 @@ std::string srs_codec_avc_profile2str(SrsAvcProfile profile); | ||
| 504 | 504 | ||
| 505 | /** | 505 | /** |
| 506 | * the level for avc/h.264. | 506 | * the level for avc/h.264. |
| 507 | -* @see Annex A Profiles and levels, H.264-AVC-ISO_IEC_14496-10.pdf, page 207. | 507 | +* @see Annex A Profiles and levels, ISO_IEC_14496-10-AVC-2003.pdf, page 207. |
| 508 | */ | 508 | */ |
| 509 | enum SrsAvcLevel | 509 | enum SrsAvcLevel |
| 510 | { | 510 | { |
| @@ -565,11 +565,11 @@ public: | @@ -565,11 +565,11 @@ public: | ||
| 565 | /** | 565 | /** |
| 566 | * video specified | 566 | * video specified |
| 567 | */ | 567 | */ |
| 568 | - // profile_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45. | 568 | + // profile_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45. |
| 569 | SrsAvcProfile avc_profile; | 569 | SrsAvcProfile avc_profile; |
| 570 | - // level_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45. | 570 | + // level_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45. |
| 571 | SrsAvcLevel avc_level; | 571 | SrsAvcLevel avc_level; |
| 572 | - // lengthSizeMinusOne, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 572 | + // lengthSizeMinusOne, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 573 | int8_t NAL_unit_length; | 573 | int8_t NAL_unit_length; |
| 574 | u_int16_t sequenceParameterSetLength; | 574 | u_int16_t sequenceParameterSetLength; |
| 575 | char* sequenceParameterSetNALUnit; | 575 | char* sequenceParameterSetNALUnit; |
| @@ -583,7 +583,7 @@ public: | @@ -583,7 +583,7 @@ public: | ||
| 583 | * audio specified | 583 | * audio specified |
| 584 | * audioObjectType, in 1.6.2.1 AudioSpecificConfig, page 33, | 584 | * audioObjectType, in 1.6.2.1 AudioSpecificConfig, page 33, |
| 585 | * 1.5.1.1 Audio object type definition, page 23, | 585 | * 1.5.1.1 Audio object type definition, page 23, |
| 586 | - * in aac-mp4a-format-ISO_IEC_14496-3+2001.pdf. | 586 | + * in ISO_IEC_14496-3-AAC-2001.pdf. |
| 587 | */ | 587 | */ |
| 588 | SrsAacObjectType aac_object; | 588 | SrsAacObjectType aac_object; |
| 589 | /** | 589 | /** |
| @@ -658,12 +658,12 @@ private: | @@ -658,12 +658,12 @@ private: | ||
| 658 | virtual int avc_demux_sps_rbsp(char* rbsp, int nb_rbsp); | 658 | virtual int avc_demux_sps_rbsp(char* rbsp, int nb_rbsp); |
| 659 | /** | 659 | /** |
| 660 | * demux the avc NALU in "AnnexB" | 660 | * demux the avc NALU in "AnnexB" |
| 661 | - * from H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 661 | + * from ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 662 | */ | 662 | */ |
| 663 | virtual int avc_demux_annexb_format(SrsBuffer* stream, SrsCodecSample* sample); | 663 | virtual int avc_demux_annexb_format(SrsBuffer* stream, SrsCodecSample* sample); |
| 664 | /** | 664 | /** |
| 665 | * demux the avc NALU in "ISO Base Media File Format" | 665 | * demux the avc NALU in "ISO Base Media File Format" |
| 666 | - * from H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 666 | + * from ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 667 | */ | 667 | */ |
| 668 | virtual int avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sample); | 668 | virtual int avc_demux_ibmf_format(SrsBuffer* stream, SrsCodecSample* sample); |
| 669 | }; | 669 | }; |
| @@ -2942,7 +2942,7 @@ int SrsTsCache::do_cache_aac(SrsAvcAacCodec* codec, SrsCodecSample* sample) | @@ -2942,7 +2942,7 @@ int SrsTsCache::do_cache_aac(SrsAvcAacCodec* codec, SrsCodecSample* sample) | ||
| 2942 | void srs_avc_insert_aud(SrsSimpleStream* payload, bool& aud_inserted) | 2942 | void srs_avc_insert_aud(SrsSimpleStream* payload, bool& aud_inserted) |
| 2943 | { | 2943 | { |
| 2944 | // mux the samples in annexb format, | 2944 | // mux the samples in annexb format, |
| 2945 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 324. | 2945 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 324. |
| 2946 | /** | 2946 | /** |
| 2947 | * 00 00 00 01 // header | 2947 | * 00 00 00 01 // header |
| 2948 | * xxxxxxx // data bytes | 2948 | * xxxxxxx // data bytes |
| @@ -2951,7 +2951,7 @@ void srs_avc_insert_aud(SrsSimpleStream* payload, bool& aud_inserted) | @@ -2951,7 +2951,7 @@ void srs_avc_insert_aud(SrsSimpleStream* payload, bool& aud_inserted) | ||
| 2951 | * | 2951 | * |
| 2952 | * nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1. | 2952 | * nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1. |
| 2953 | * Table 7-1 - NAL unit type codes, syntax element categories, and NAL unit type classes | 2953 | * Table 7-1 - NAL unit type codes, syntax element categories, and NAL unit type classes |
| 2954 | - * H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 83. | 2954 | + * ISO_IEC_14496-10-AVC-2012.pdf, page 83. |
| 2955 | * 1, Coded slice of a non-IDR picture slice_layer_without_partitioning_rbsp( ) | 2955 | * 1, Coded slice of a non-IDR picture slice_layer_without_partitioning_rbsp( ) |
| 2956 | * 2, Coded slice data partition A slice_data_partition_a_layer_rbsp( ) | 2956 | * 2, Coded slice data partition A slice_data_partition_a_layer_rbsp( ) |
| 2957 | * 3, Coded slice data partition B slice_data_partition_b_layer_rbsp( ) | 2957 | * 3, Coded slice data partition B slice_data_partition_b_layer_rbsp( ) |
| @@ -3006,7 +3006,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | @@ -3006,7 +3006,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | ||
| 3006 | if (!sample->has_aud) { | 3006 | if (!sample->has_aud) { |
| 3007 | // the aud(access unit delimiter) before each frame. | 3007 | // the aud(access unit delimiter) before each frame. |
| 3008 | // 7.3.2.4 Access unit delimiter RBSP syntax | 3008 | // 7.3.2.4 Access unit delimiter RBSP syntax |
| 3009 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 66. | 3009 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 66. |
| 3010 | // | 3010 | // |
| 3011 | // primary_pic_type u(3), the first 3bits, primary_pic_type indicates that the slice_type values | 3011 | // primary_pic_type u(3), the first 3bits, primary_pic_type indicates that the slice_type values |
| 3012 | // for all slices of the primary coded picture are members of the set listed in Table 7-5 for | 3012 | // for all slices of the primary coded picture are members of the set listed in Table 7-5 for |
| @@ -3020,7 +3020,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | @@ -3020,7 +3020,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | ||
| 3020 | // 6, slice_type 0, 2, 3, 4, 5, 7, 8, 9 | 3020 | // 6, slice_type 0, 2, 3, 4, 5, 7, 8, 9 |
| 3021 | // 7, slice_type 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | 3021 | // 7, slice_type 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
| 3022 | // 7.4.2.4 Access unit delimiter RBSP semantics | 3022 | // 7.4.2.4 Access unit delimiter RBSP semantics |
| 3023 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 102. | 3023 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 102. |
| 3024 | // | 3024 | // |
| 3025 | // slice_type specifies the coding type of the slice according to Table 7-6. | 3025 | // slice_type specifies the coding type of the slice according to Table 7-6. |
| 3026 | // 0, P (P slice) | 3026 | // 0, P (P slice) |
| @@ -3033,7 +3033,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | @@ -3033,7 +3033,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | ||
| 3033 | // 7, I (I slice) | 3033 | // 7, I (I slice) |
| 3034 | // 8, SP (SP slice) | 3034 | // 8, SP (SP slice) |
| 3035 | // 9, SI (SI slice) | 3035 | // 9, SI (SI slice) |
| 3036 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 105. | 3036 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 105. |
| 3037 | static u_int8_t default_aud_nalu[] = { 0x09, 0xf0}; | 3037 | static u_int8_t default_aud_nalu[] = { 0x09, 0xf0}; |
| 3038 | srs_avc_insert_aud(video->payload, aud_inserted); | 3038 | srs_avc_insert_aud(video->payload, aud_inserted); |
| 3039 | video->payload->append((const char*)default_aud_nalu, 2); | 3039 | video->payload->append((const char*)default_aud_nalu, 2); |
| @@ -3051,7 +3051,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | @@ -3051,7 +3051,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample) | ||
| 3051 | } | 3051 | } |
| 3052 | 3052 | ||
| 3053 | // 5bits, 7.3.1 NAL unit syntax, | 3053 | // 5bits, 7.3.1 NAL unit syntax, |
| 3054 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 83. | 3054 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 83. |
| 3055 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(sample_unit->bytes[0] & 0x1f); | 3055 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(sample_unit->bytes[0] & 0x1f); |
| 3056 | 3056 | ||
| 3057 | // Insert sps/pps before IDR when there is no sps/pps in samples. | 3057 | // Insert sps/pps before IDR when there is no sps/pps in samples. |
| @@ -58,7 +58,7 @@ int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v) | @@ -58,7 +58,7 @@ int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v) | ||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | // ue(v) in 9.1 Parsing process for Exp-Golomb codes | 60 | // ue(v) in 9.1 Parsing process for Exp-Golomb codes |
| 61 | - // H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 227. | 61 | + // ISO_IEC_14496-10-AVC-2012.pdf, page 227. |
| 62 | // Syntax elements coded as ue(v), me(v), or se(v) are Exp-Golomb-coded. | 62 | // Syntax elements coded as ue(v), me(v), or se(v) are Exp-Golomb-coded. |
| 63 | // leadingZeroBits = -1; | 63 | // leadingZeroBits = -1; |
| 64 | // for( b = 0; !b; leadingZeroBits++ ) | 64 | // for( b = 0; !b; leadingZeroBits++ ) |
| @@ -112,7 +112,7 @@ extern std::string srs_path_filext(std::string path); | @@ -112,7 +112,7 @@ extern std::string srs_path_filext(std::string path); | ||
| 112 | 112 | ||
| 113 | /** | 113 | /** |
| 114 | * whether stream starts with the avc NALU in "AnnexB" | 114 | * whether stream starts with the avc NALU in "AnnexB" |
| 115 | -* from H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 115 | +* from ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 116 | * start code must be "N[00] 00 00 01" where N>=0 | 116 | * start code must be "N[00] 00 00 01" where N>=0 |
| 117 | * @param pnb_start_code output the size of start code, must >=3. | 117 | * @param pnb_start_code output the size of start code, must >=3. |
| 118 | * NULL to ignore. | 118 | * NULL to ignore. |
| @@ -121,7 +121,7 @@ extern bool srs_avc_startswith_annexb(SrsBuffer* stream, int* pnb_start_code = N | @@ -121,7 +121,7 @@ extern bool srs_avc_startswith_annexb(SrsBuffer* stream, int* pnb_start_code = N | ||
| 121 | 121 | ||
| 122 | /** | 122 | /** |
| 123 | * whether stream starts with the aac ADTS | 123 | * whether stream starts with the aac ADTS |
| 124 | -* from aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS. | 124 | +* from ISO_IEC_14496-3-AAC-2001.pdf, page 75, 1.A.2.2 ADTS. |
| 125 | * start code must be '1111 1111 1111'B, that is 0xFFF | 125 | * start code must be '1111 1111 1111'B, that is 0xFFF |
| 126 | */ | 126 | */ |
| 127 | extern bool srs_aac_startswith_adts(SrsBuffer* stream); | 127 | extern bool srs_aac_startswith_adts(SrsBuffer* stream); |
| @@ -92,7 +92,7 @@ struct Context | @@ -92,7 +92,7 @@ struct Context | ||
| 92 | // for h264 raw stream, | 92 | // for h264 raw stream, |
| 93 | // @see: https://github.com/ossrs/srs/issues/66#issuecomment-62240521 | 93 | // @see: https://github.com/ossrs/srs/issues/66#issuecomment-62240521 |
| 94 | SrsBuffer h264_raw_stream; | 94 | SrsBuffer h264_raw_stream; |
| 95 | - // about SPS, @see: 7.3.2.1.1, H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 62 | 95 | + // about SPS, @see: 7.3.2.1.1, ISO_IEC_14496-10-AVC-2012.pdf, page 62 |
| 96 | std::string h264_sps; | 96 | std::string h264_sps; |
| 97 | std::string h264_pps; | 97 | std::string h264_pps; |
| 98 | // whether the sps and pps sent, | 98 | // whether the sps and pps sent, |
| @@ -1326,7 +1326,7 @@ int srs_write_h264_ipb_frame(Context* context, | @@ -1326,7 +1326,7 @@ int srs_write_h264_ipb_frame(Context* context, | ||
| 1326 | } | 1326 | } |
| 1327 | 1327 | ||
| 1328 | // 5bits, 7.3.1 NAL unit syntax, | 1328 | // 5bits, 7.3.1 NAL unit syntax, |
| 1329 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 1329 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 1330 | // 5: I Frame, 1: P/B Frame | 1330 | // 5: I Frame, 1: P/B Frame |
| 1331 | // @remark we already group sps/pps to sequence header frame; | 1331 | // @remark we already group sps/pps to sequence header frame; |
| 1332 | // for I/P NALU, we send them in isolate frame, each NALU in a frame; | 1332 | // for I/P NALU, we send them in isolate frame, each NALU in a frame; |
| @@ -1445,7 +1445,7 @@ int srs_write_h264_raw_frame(Context* context, | @@ -1445,7 +1445,7 @@ int srs_write_h264_raw_frame(Context* context, | ||
| 1445 | 1445 | ||
| 1446 | // ignore others. | 1446 | // ignore others. |
| 1447 | // 5bits, 7.3.1 NAL unit syntax, | 1447 | // 5bits, 7.3.1 NAL unit syntax, |
| 1448 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 1448 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 1449 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD | 1449 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame, 9: AUD |
| 1450 | SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f); | 1450 | SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f); |
| 1451 | if (nut != SrsAvcNaluTypeSPS && nut != SrsAvcNaluTypePPS | 1451 | if (nut != SrsAvcNaluTypeSPS && nut != SrsAvcNaluTypePPS |
| @@ -360,9 +360,9 @@ extern srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size); | @@ -360,9 +360,9 @@ extern srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size); | ||
| 360 | * @example /trunk/research/librtmp/srs_audio_raw_publish.c | 360 | * @example /trunk/research/librtmp/srs_audio_raw_publish.c |
| 361 | * | 361 | * |
| 362 | * @remark for aac, the frame must be in ADTS format. | 362 | * @remark for aac, the frame must be in ADTS format. |
| 363 | -* @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS | 363 | +* @see ISO_IEC_14496-3-AAC-2001.pdf, page 75, 1.A.2.2 ADTS |
| 364 | * @remark for aac, only support profile 1-4, AAC main/LC/SSR/LTP, | 364 | * @remark for aac, only support profile 1-4, AAC main/LC/SSR/LTP, |
| 365 | -* @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 23, 1.5.1.1 Audio object type | 365 | +* @see ISO_IEC_14496-3-AAC-2001.pdf, page 23, 1.5.1.1 Audio object type |
| 366 | * | 366 | * |
| 367 | * @see https://github.com/ossrs/srs/issues/212 | 367 | * @see https://github.com/ossrs/srs/issues/212 |
| 368 | * @see E.4.2.1 AUDIODATA of video_file_format_spec_v10_1.pdf | 368 | * @see E.4.2.1 AUDIODATA of video_file_format_spec_v10_1.pdf |
| @@ -381,7 +381,7 @@ extern int srs_audio_write_raw_frame(srs_rtmp_t rtmp, | @@ -381,7 +381,7 @@ extern int srs_audio_write_raw_frame(srs_rtmp_t rtmp, | ||
| 381 | * @param ac_raw_size the size of aac raw data. | 381 | * @param ac_raw_size the size of aac raw data. |
| 382 | * | 382 | * |
| 383 | * @reamrk used to check whether current frame is in adts format. | 383 | * @reamrk used to check whether current frame is in adts format. |
| 384 | -* @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS | 384 | +* @see ISO_IEC_14496-3-AAC-2001.pdf, page 75, 1.A.2.2 ADTS |
| 385 | * @example /trunk/research/librtmp/srs_aac_raw_publish.c | 385 | * @example /trunk/research/librtmp/srs_aac_raw_publish.c |
| 386 | * | 386 | * |
| 387 | * @return 0 false; otherwise, true. | 387 | * @return 0 false; otherwise, true. |
| @@ -409,7 +409,7 @@ extern int srs_aac_adts_frame_size(char* aac_raw_data, int ac_raw_size); | @@ -409,7 +409,7 @@ extern int srs_aac_adts_frame_size(char* aac_raw_data, int ac_raw_size); | ||
| 409 | * frames can be one or more than one frame, | 409 | * frames can be one or more than one frame, |
| 410 | * each frame prefixed h.264 annexb header, by N[00] 00 00 01, where N>=0, | 410 | * each frame prefixed h.264 annexb header, by N[00] 00 00 01, where N>=0, |
| 411 | * for instance, frame = header(00 00 00 01) + payload(67 42 80 29 95 A0 14 01 6E 40) | 411 | * for instance, frame = header(00 00 00 01) + payload(67 42 80 29 95 A0 14 01 6E 40) |
| 412 | -* about annexb, @see H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 412 | +* about annexb, @see ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 413 | * @param frames_size the size of h264 raw data. | 413 | * @param frames_size the size of h264 raw data. |
| 414 | * assert frames_size > 0, at least has 1 bytes header. | 414 | * assert frames_size > 0, at least has 1 bytes header. |
| 415 | * @param dts the dts of h.264 raw data. | 415 | * @param dts the dts of h.264 raw data. |
| @@ -711,8 +711,8 @@ int SrsIngestSrsOutput::on_ts_message(SrsTsMessage* msg) | @@ -711,8 +711,8 @@ int SrsIngestSrsOutput::on_ts_message(SrsTsMessage* msg) | ||
| 711 | // for example, when SrsTsStream of SrsTsChannel indicates stream_type is SrsTsStreamVideoMpeg4 and SrsTsStreamAudioMpeg4, | 711 | // for example, when SrsTsStream of SrsTsChannel indicates stream_type is SrsTsStreamVideoMpeg4 and SrsTsStreamAudioMpeg4, |
| 712 | // the elementary stream can be mux in "2.11 Carriage of ISO/IEC 14496 data" in hls-mpeg-ts-iso13818-1.pdf, page 103 | 712 | // the elementary stream can be mux in "2.11 Carriage of ISO/IEC 14496 data" in hls-mpeg-ts-iso13818-1.pdf, page 103 |
| 713 | // @remark, the most popular stream_id is 0xe0 for h.264 over mpegts, which indicates the stream_id is video and | 713 | // @remark, the most popular stream_id is 0xe0 for h.264 over mpegts, which indicates the stream_id is video and |
| 714 | - // stream_number is 0, where I guess the elementary is specified in annexb format(H.264-AVC-ISO_IEC_14496-10.pdf, page 211). | ||
| 715 | - // because when audio stream_number is 0, the elementary is ADTS(aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS). | 714 | + // stream_number is 0, where I guess the elementary is specified in annexb format(ISO_IEC_14496-10-AVC-2003.pdf, page 211). |
| 715 | + // because when audio stream_number is 0, the elementary is ADTS(ISO_IEC_14496-3-AAC-2001.pdf, page 75, 1.A.2.2 ADTS). | ||
| 716 | 716 | ||
| 717 | // about the bytes of PES_packet_data_byte, defined in hls-mpeg-ts-iso13818-1.pdf, page 58 | 717 | // about the bytes of PES_packet_data_byte, defined in hls-mpeg-ts-iso13818-1.pdf, page 58 |
| 718 | // PES_packet_data_byte ¨C PES_packet_data_bytes shall be contiguous bytes of data from the elementary stream | 718 | // PES_packet_data_byte ¨C PES_packet_data_bytes shall be contiguous bytes of data from the elementary stream |
| @@ -970,7 +970,7 @@ int SrsIngestSrsOutput::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs) | @@ -970,7 +970,7 @@ int SrsIngestSrsOutput::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs) | ||
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | // 5bits, 7.3.1 NAL unit syntax, | 972 | // 5bits, 7.3.1 NAL unit syntax, |
| 973 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 973 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 974 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 974 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 975 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); | 975 | SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); |
| 976 | 976 |
| @@ -50,7 +50,7 @@ int SrsRawH264Stream::annexb_demux(SrsBuffer* stream, char** pframe, int* pnb_fr | @@ -50,7 +50,7 @@ int SrsRawH264Stream::annexb_demux(SrsBuffer* stream, char** pframe, int* pnb_fr | ||
| 50 | 50 | ||
| 51 | while (!stream->empty()) { | 51 | while (!stream->empty()) { |
| 52 | // each frame must prefixed by annexb format. | 52 | // each frame must prefixed by annexb format. |
| 53 | - // about annexb, @see H.264-AVC-ISO_IEC_14496-10.pdf, page 211. | 53 | + // about annexb, @see ISO_IEC_14496-10-AVC-2003.pdf, page 211. |
| 54 | int pnb_start_code = 0; | 54 | int pnb_start_code = 0; |
| 55 | if (!srs_avc_startswith_annexb(stream, &pnb_start_code)) { | 55 | if (!srs_avc_startswith_annexb(stream, &pnb_start_code)) { |
| 56 | return ERROR_H264_API_NO_PREFIXED; | 56 | return ERROR_H264_API_NO_PREFIXED; |
| @@ -80,7 +80,7 @@ bool SrsRawH264Stream::is_sps(char* frame, int nb_frame) | @@ -80,7 +80,7 @@ bool SrsRawH264Stream::is_sps(char* frame, int nb_frame) | ||
| 80 | srs_assert(nb_frame > 0); | 80 | srs_assert(nb_frame > 0); |
| 81 | 81 | ||
| 82 | // 5bits, 7.3.1 NAL unit syntax, | 82 | // 5bits, 7.3.1 NAL unit syntax, |
| 83 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 83 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 84 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 84 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 85 | u_int8_t nal_unit_type = (char)frame[0] & 0x1f; | 85 | u_int8_t nal_unit_type = (char)frame[0] & 0x1f; |
| 86 | 86 | ||
| @@ -92,7 +92,7 @@ bool SrsRawH264Stream::is_pps(char* frame, int nb_frame) | @@ -92,7 +92,7 @@ bool SrsRawH264Stream::is_pps(char* frame, int nb_frame) | ||
| 92 | srs_assert(nb_frame > 0); | 92 | srs_assert(nb_frame > 0); |
| 93 | 93 | ||
| 94 | // 5bits, 7.3.1 NAL unit syntax, | 94 | // 5bits, 7.3.1 NAL unit syntax, |
| 95 | - // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 95 | + // ISO_IEC_14496-10-AVC-2003.pdf, page 44. |
| 96 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | 96 | // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame |
| 97 | u_int8_t nal_unit_type = (char)frame[0] & 0x1f; | 97 | u_int8_t nal_unit_type = (char)frame[0] & 0x1f; |
| 98 | 98 | ||
| @@ -166,12 +166,12 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | @@ -166,12 +166,12 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | ||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | // decode the SPS: | 168 | // decode the SPS: |
| 169 | - // @see: 7.3.2.1.1, H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 62 | 169 | + // @see: 7.3.2.1.1, ISO_IEC_14496-10-AVC-2012.pdf, page 62 |
| 170 | if (true) { | 170 | if (true) { |
| 171 | srs_assert((int)sps.length() >= 4); | 171 | srs_assert((int)sps.length() >= 4); |
| 172 | char* frame = (char*)sps.data(); | 172 | char* frame = (char*)sps.data(); |
| 173 | 173 | ||
| 174 | - // @see: Annex A Profiles and levels, H.264-AVC-ISO_IEC_14496-10.pdf, page 205 | 174 | + // @see: Annex A Profiles and levels, ISO_IEC_14496-10-AVC-2003.pdf, page 205 |
| 175 | // Baseline profile profile_idc is 66(0x42). | 175 | // Baseline profile profile_idc is 66(0x42). |
| 176 | // Main profile profile_idc is 77(0x4d). | 176 | // Main profile profile_idc is 77(0x4d). |
| 177 | // Extended profile profile_idc is 88(0x58). | 177 | // Extended profile profile_idc is 88(0x58). |
| @@ -180,7 +180,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | @@ -180,7 +180,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | ||
| 180 | u_int8_t level_idc = frame[3]; | 180 | u_int8_t level_idc = frame[3]; |
| 181 | 181 | ||
| 182 | // generate the sps/pps header | 182 | // generate the sps/pps header |
| 183 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 183 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 184 | // configurationVersion | 184 | // configurationVersion |
| 185 | stream.write_1bytes(0x01); | 185 | stream.write_1bytes(0x01); |
| 186 | // AVCProfileIndication | 186 | // AVCProfileIndication |
| @@ -196,7 +196,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | @@ -196,7 +196,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | ||
| 196 | 196 | ||
| 197 | // sps | 197 | // sps |
| 198 | if (true) { | 198 | if (true) { |
| 199 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 199 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 200 | // numOfSequenceParameterSets, always 1 | 200 | // numOfSequenceParameterSets, always 1 |
| 201 | stream.write_1bytes(0x01); | 201 | stream.write_1bytes(0x01); |
| 202 | // sequenceParameterSetLength | 202 | // sequenceParameterSetLength |
| @@ -207,7 +207,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | @@ -207,7 +207,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | ||
| 207 | 207 | ||
| 208 | // pps | 208 | // pps |
| 209 | if (true) { | 209 | if (true) { |
| 210 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 210 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 211 | // numOfPictureParameterSets, always 1 | 211 | // numOfPictureParameterSets, always 1 |
| 212 | stream.write_1bytes(0x01); | 212 | stream.write_1bytes(0x01); |
| 213 | // pictureParameterSetLength | 213 | // pictureParameterSetLength |
| @@ -217,7 +217,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | @@ -217,7 +217,7 @@ int SrsRawH264Stream::mux_sequence_header(string sps, string pps, u_int32_t dts, | ||
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | // TODO: FIXME: for more profile. | 219 | // TODO: FIXME: for more profile. |
| 220 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 220 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 221 | // profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144 | 221 | // profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144 |
| 222 | 222 | ||
| 223 | sh = ""; | 223 | sh = ""; |
| @@ -244,12 +244,12 @@ int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, string& ibp) | @@ -244,12 +244,12 @@ int SrsRawH264Stream::mux_ipb_frame(char* frame, int nb_frame, string& ibp) | ||
| 244 | return ret; | 244 | return ret; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | - // 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16 | 247 | + // 5.3.4.2.1 Syntax, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16 |
| 248 | // lengthSizeMinusOne, or NAL_unit_length, always use 4bytes size | 248 | // lengthSizeMinusOne, or NAL_unit_length, always use 4bytes size |
| 249 | u_int32_t NAL_unit_length = nb_frame; | 249 | u_int32_t NAL_unit_length = nb_frame; |
| 250 | 250 | ||
| 251 | // mux the avc NALU in "ISO Base Media File Format" | 251 | // mux the avc NALU in "ISO Base Media File Format" |
| 252 | - // from H.264-AVC-ISO_IEC_14496-15.pdf, page 20 | 252 | + // from ISO_IEC_14496-15-AVC-format-2012.pdf, page 20 |
| 253 | // NALUnitLength | 253 | // NALUnitLength |
| 254 | stream.write_4bytes(NAL_unit_length); | 254 | stream.write_4bytes(NAL_unit_length); |
| 255 | // NALUnit | 255 | // NALUnit |
| @@ -488,7 +488,7 @@ int SrsRawAacStream::mux_sequence_header(SrsRawAacStreamCodec* codec, string& sh | @@ -488,7 +488,7 @@ int SrsRawAacStream::mux_sequence_header(SrsRawAacStreamCodec* codec, string& sh | ||
| 488 | sh = ""; | 488 | sh = ""; |
| 489 | 489 | ||
| 490 | char ch = 0; | 490 | char ch = 0; |
| 491 | - // @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf | 491 | + // @see ISO_IEC_14496-3-AAC-2001.pdf |
| 492 | // AudioSpecificConfig (), page 33 | 492 | // AudioSpecificConfig (), page 33 |
| 493 | // 1.6.2.1 AudioSpecificConfig | 493 | // 1.6.2.1 AudioSpecificConfig |
| 494 | // audioObjectType; 5 bslbf | 494 | // audioObjectType; 5 bslbf |
-
请 注册 或 登录 后发表评论