OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 // min = x, max = y indicates that the receiver is free to adapt | 723 // min = x, max = y indicates that the receiver is free to adapt |
724 // in the range (x, y) based on network jitter. | 724 // in the range (x, y) based on network jitter. |
725 // | 725 // |
726 // Note: Given that this gets embedded in a union, it is up-to the owner to | 726 // Note: Given that this gets embedded in a union, it is up-to the owner to |
727 // initialize these values. | 727 // initialize these values. |
728 struct PlayoutDelay { | 728 struct PlayoutDelay { |
729 int min_ms; | 729 int min_ms; |
730 int max_ms; | 730 int max_ms; |
731 }; | 731 }; |
732 | 732 |
| 733 // For Frame Marking RTP Header Extension: |
| 734 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-05 |
| 735 // This extensions provides meta-information about the RTP streams outside the |
| 736 // encrypted media payload, an RTP switch can do codec-agnostic |
| 737 // selective forwarding without decrypting the payload |
| 738 // o S: Start of Frame (1 bit) - MUST be 1 in the first packet in a |
| 739 // frame; otherwise MUST be 0. |
| 740 // o E: End of Frame (1 bit) - MUST be 1 in the last packet in a frame; |
| 741 // otherwise MUST be 0. |
| 742 // o I: Independent Frame (1 bit) - MUST be 1 for frames that can be |
| 743 // decoded independent of prior frames, e.g. intra-frame, VPX |
| 744 // keyframe, H.264 IDR [RFC6184], H.265 IDR/CRA/BLA/RAP [RFC7798]; |
| 745 // otherwise MUST be 0. |
| 746 // o D: Discardable Frame (1 bit) - MUST be 1 for frames that can be |
| 747 // discarded, and still provide a decodable media stream; otherwise |
| 748 // MUST be 0. |
| 749 // o B: Base Layer Sync (1 bit) - MUST be 1 if this frame only depends |
| 750 // on the base layer; otherwise MUST be 0. If no scalability is |
| 751 // used, this MUST be 0. |
| 752 // o TID: Temporal ID (3 bits) - The base temporal layer starts with 0, |
| 753 // and increases with 1 for each higher temporal layer/sub-layer. If |
| 754 // no scalability is used, this MUST be 0. |
| 755 // o LID: Layer ID (8 bits) - Identifies the spatial and quality layer |
| 756 // encoded. If no scalability is used, this MUST be 0 or omitted. |
| 757 // When omitted, TL0PICIDX MUST also be omitted. |
| 758 // o TL0PICIDX: Temporal Layer 0 Picture Index (8 bits) - Running index |
| 759 // of base temporal layer 0 frames when TID is 0. When TID is not 0, |
| 760 // this indicates a dependency on the given index. If no scalability |
| 761 // is used, this MUST be 0 or omitted. When omitted, LID MUST also |
| 762 // be omitted. |
| 763 struct FrameMarks { |
| 764 FrameMarks() |
| 765 : start_of_frame(false), |
| 766 end_of_frame(false), |
| 767 independent(false), |
| 768 discardable(false), |
| 769 base_layer_sync(false), |
| 770 temporal_layer_id(0), |
| 771 layer_id(0), |
| 772 tl0_pic_idx(0) {} |
| 773 |
| 774 bool start_of_frame; |
| 775 bool end_of_frame; |
| 776 bool independent; |
| 777 bool discardable; |
| 778 bool base_layer_sync; |
| 779 uint8_t temporal_layer_id; |
| 780 uint8_t layer_id; |
| 781 int16_t tl0_pic_idx; |
| 782 }; |
| 783 |
733 // Class to represent the value of RTP header extensions that are | 784 // Class to represent the value of RTP header extensions that are |
734 // variable-length strings (e.g., RtpStreamId and RtpMid). | 785 // variable-length strings (e.g., RtpStreamId and RtpMid). |
735 // Unlike std::string, it can be copied with memcpy and cleared with memset. | 786 // Unlike std::string, it can be copied with memcpy and cleared with memset. |
736 // | 787 // |
737 // Empty value represents unset header extension (use empty() to query). | 788 // Empty value represents unset header extension (use empty() to query). |
738 class StringRtpHeaderExtension { | 789 class StringRtpHeaderExtension { |
739 public: | 790 public: |
740 // String RTP header extensions are limited to 16 bytes because it is the | 791 // String RTP header extensions are limited to 16 bytes because it is the |
741 // maximum length that can be encoded with one-byte header extensions. | 792 // maximum length that can be encoded with one-byte header extensions. |
742 static constexpr size_t kMaxSize = 16; | 793 static constexpr size_t kMaxSize = 16; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 | 864 |
814 // For identification of a stream when ssrc is not signaled. See | 865 // For identification of a stream when ssrc is not signaled. See |
815 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09 | 866 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09 |
816 // TODO(danilchap): Update url from draft to release version. | 867 // TODO(danilchap): Update url from draft to release version. |
817 StreamId stream_id; | 868 StreamId stream_id; |
818 StreamId repaired_stream_id; | 869 StreamId repaired_stream_id; |
819 | 870 |
820 // For identifying the media section used to interpret this RTP packet. See | 871 // For identifying the media section used to interpret this RTP packet. See |
821 // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-38 | 872 // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-38 |
822 Mid mid; | 873 Mid mid; |
| 874 |
| 875 // For Frame Marking RTP Header Extension: |
| 876 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-05 |
| 877 bool has_frame_marks; |
| 878 FrameMarks frame_marks; |
823 }; | 879 }; |
824 | 880 |
825 struct RTPHeader { | 881 struct RTPHeader { |
826 RTPHeader(); | 882 RTPHeader(); |
827 | 883 |
828 bool markerBit; | 884 bool markerBit; |
829 uint8_t payloadType; | 885 uint8_t payloadType; |
830 uint16_t sequenceNumber; | 886 uint16_t sequenceNumber; |
831 uint32_t timestamp; | 887 uint32_t timestamp; |
832 uint32_t ssrc; | 888 uint32_t ssrc; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 bool operator==(const RtpKeepAliveConfig& o) const { | 1011 bool operator==(const RtpKeepAliveConfig& o) const { |
956 return timeout_interval_ms == o.timeout_interval_ms && | 1012 return timeout_interval_ms == o.timeout_interval_ms && |
957 payload_type == o.payload_type; | 1013 payload_type == o.payload_type; |
958 } | 1014 } |
959 bool operator!=(const RtpKeepAliveConfig& o) const { return !(*this == o); } | 1015 bool operator!=(const RtpKeepAliveConfig& o) const { return !(*this == o); } |
960 }; | 1016 }; |
961 | 1017 |
962 } // namespace webrtc | 1018 } // namespace webrtc |
963 | 1019 |
964 #endif // WEBRTC_COMMON_TYPES_H_ | 1020 #endif // WEBRTC_COMMON_TYPES_H_ |
OLD | NEW |