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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 // min = x, max = y indicates that the receiver is free to adapt | 709 // min = x, max = y indicates that the receiver is free to adapt |
710 // in the range (x, y) based on network jitter. | 710 // in the range (x, y) based on network jitter. |
711 // | 711 // |
712 // Note: Given that this gets embedded in a union, it is up-to the owner to | 712 // Note: Given that this gets embedded in a union, it is up-to the owner to |
713 // initialize these values. | 713 // initialize these values. |
714 struct PlayoutDelay { | 714 struct PlayoutDelay { |
715 int min_ms; | 715 int min_ms; |
716 int max_ms; | 716 int max_ms; |
717 }; | 717 }; |
718 | 718 |
| 719 // For Frame Marking RTP Header Extension: |
| 720 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-04 |
| 721 // This extensions provides meta-information about the RTP streams outside the |
| 722 // encrypted media payload, an RTP switch can do codec-agnostic |
| 723 // selective forwarding without decrypting the payload |
| 724 // o S: Start of Frame (1 bit) - MUST be 1 in the first packet in a |
| 725 // frame; otherwise MUST be 0. |
| 726 // o E: End of Frame (1 bit) - MUST be 1 in the last packet in a frame; |
| 727 // otherwise MUST be 0. |
| 728 // o I: Independent Frame (1 bit) - MUST be 1 for frames that can be |
| 729 // decoded independent of prior frames, e.g. intra-frame, VPX |
| 730 // keyframe, H.264 IDR [RFC6184], H.265 IDR/CRA/BLA/RAP [RFC7798]; |
| 731 // otherwise MUST be 0. |
| 732 // o D: Discardable Frame (1 bit) - MUST be 1 for frames that can be |
| 733 // discarded, and still provide a decodable media stream; otherwise |
| 734 // MUST be 0. |
| 735 // o B: Base Layer Sync (1 bit) - MUST be 1 if this frame only depends |
| 736 // on the base layer; otherwise MUST be 0. If no scalability is |
| 737 // used, this MUST be 0. |
| 738 // o TID: Temporal ID (3 bits) - The base temporal layer starts with 0, |
| 739 // and increases with 1 for each higher temporal layer/sub-layer. If |
| 740 // no scalability is used, this MUST be 0. |
| 741 // o LID: Layer ID (8 bits) - Identifies the spatial and quality layer |
| 742 // encoded. If no scalability is used, this MUST be 0 or omitted. |
| 743 // When omitted, TL0PICIDX MUST also be omitted. |
| 744 // o TL0PICIDX: Temporal Layer 0 Picture Index (8 bits) - Running index |
| 745 // of base temporal layer 0 frames when TID is 0. When TID is not 0, |
| 746 // this indicates a dependency on the given index. If no scalability |
| 747 // is used, this MUST be 0 or omitted. When omitted, LID MUST also |
| 748 // be omitted. |
| 749 struct FrameMarks { |
| 750 bool start_of_frame; |
| 751 bool end_of_frame; |
| 752 bool independent; |
| 753 bool discardable; |
| 754 bool base_layer_sync; |
| 755 uint8_t temporal_layer_id; |
| 756 uint8_t layer_id; |
| 757 int16_t tl0_pic_idx; |
| 758 }; |
| 759 |
719 // Class to represent RtpStreamId which is a string. | 760 // Class to represent RtpStreamId which is a string. |
720 // Unlike std::string, it can be copied with memcpy and cleared with memset. | 761 // Unlike std::string, it can be copied with memcpy and cleared with memset. |
721 // Empty value represent unset RtpStreamId. | 762 // Empty value represent unset RtpStreamId. |
722 class StreamId { | 763 class StreamId { |
723 public: | 764 public: |
724 // Stream id is limited to 16 bytes because it is the maximum length | 765 // Stream id is limited to 16 bytes because it is the maximum length |
725 // that can be encoded with one-byte header extensions. | 766 // that can be encoded with one-byte header extensions. |
726 static constexpr size_t kMaxSize = 16; | 767 static constexpr size_t kMaxSize = 16; |
727 | 768 |
728 static bool IsLegalName(rtc::ArrayView<const char> name); | 769 static bool IsLegalName(rtc::ArrayView<const char> name); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 bool has_video_timing; | 825 bool has_video_timing; |
785 VideoTiming video_timing; | 826 VideoTiming video_timing; |
786 | 827 |
787 PlayoutDelay playout_delay = {-1, -1}; | 828 PlayoutDelay playout_delay = {-1, -1}; |
788 | 829 |
789 // For identification of a stream when ssrc is not signaled. See | 830 // For identification of a stream when ssrc is not signaled. See |
790 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09 | 831 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09 |
791 // TODO(danilchap): Update url from draft to release version. | 832 // TODO(danilchap): Update url from draft to release version. |
792 StreamId stream_id; | 833 StreamId stream_id; |
793 StreamId repaired_stream_id; | 834 StreamId repaired_stream_id; |
| 835 |
| 836 // For Frame Marking RTP Header Extension: |
| 837 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-04#page-4 |
| 838 bool hasFrameMarks; |
| 839 FrameMarks frame_marks = {false, false, false, false, false, 0, 0, 0}; |
794 }; | 840 }; |
795 | 841 |
796 struct RTPHeader { | 842 struct RTPHeader { |
797 RTPHeader(); | 843 RTPHeader(); |
798 | 844 |
799 bool markerBit; | 845 bool markerBit; |
800 uint8_t payloadType; | 846 uint8_t payloadType; |
801 uint16_t sequenceNumber; | 847 uint16_t sequenceNumber; |
802 uint32_t timestamp; | 848 uint32_t timestamp; |
803 uint32_t ssrc; | 849 uint32_t ssrc; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 enum class RtcpMode { kOff, kCompound, kReducedSize }; | 955 enum class RtcpMode { kOff, kCompound, kReducedSize }; |
910 | 956 |
911 enum NetworkState { | 957 enum NetworkState { |
912 kNetworkUp, | 958 kNetworkUp, |
913 kNetworkDown, | 959 kNetworkDown, |
914 }; | 960 }; |
915 | 961 |
916 } // namespace webrtc | 962 } // namespace webrtc |
917 | 963 |
918 #endif // WEBRTC_COMMON_TYPES_H_ | 964 #endif // WEBRTC_COMMON_TYPES_H_ |
OLD | NEW |