Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webrtc/common_types.h

Issue 2954503002: Implement FrameMarking header extension support
Patch Set: Implement Frame Marking header extension Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/config.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 // min = x, max = y indicates that the receiver is free to adapt 691 // min = x, max = y indicates that the receiver is free to adapt
692 // in the range (x, y) based on network jitter. 692 // in the range (x, y) based on network jitter.
693 // 693 //
694 // Note: Given that this gets embedded in a union, it is up-to the owner to 694 // Note: Given that this gets embedded in a union, it is up-to the owner to
695 // initialize these values. 695 // initialize these values.
696 struct PlayoutDelay { 696 struct PlayoutDelay {
697 int min_ms; 697 int min_ms;
698 int max_ms; 698 int max_ms;
699 }; 699 };
700 700
701 // For Frame Marking RTP Header Extension:
702 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-04#page-4
703 // This extensions provides meta-information about the RTP streams outside the
704 // encrypted media payload, an RTP switch can do codec-agnostic
705 // selective forwarding without decrypting the payload
706 // o S: Start of Frame (1 bit) - MUST be 1 in the first packet in a
707 // frame; otherwise MUST be 0.
708 // o E: End of Frame (1 bit) - MUST be 1 in the last packet in a frame;
709 // otherwise MUST be 0.
710 // o I: Independent Frame (1 bit) - MUST be 1 for frames that can be
711 // decoded independent of prior frames, e.g. intra-frame, VPX
712 // keyframe, H.264 IDR [RFC6184], H.265 IDR/CRA/BLA/RAP [RFC7798];
713 // otherwise MUST be 0.
714 // o D: Discardable Frame (1 bit) - MUST be 1 for frames that can be
715 // discarded, and still provide a decodable media stream; otherwise
716 // MUST be 0.
717 // o B: Base Layer Sync (1 bit) - MUST be 1 if this frame only depends
718 // on the base layer; otherwise MUST be 0. If no scalability is
719 // used, this MUST be 0.
720 // o TID: Temporal ID (3 bits) - The base temporal layer starts with 0,
721 // and increases with 1 for each higher temporal layer/sub-layer. If
722 // no scalability is used, this MUST be 0.
723 // o LID: Layer ID (8 bits) - Identifies the spatial and quality layer
724 // encoded. If no scalability is used, this MUST be 0 or omitted.
725 // When omitted, TL0PICIDX MUST also be omitted.
726 // o TL0PICIDX: Temporal Layer 0 Picture Index (8 bits) - Running index
727 // of base temporal layer 0 frames when TID is 0. When TID is not 0,
728 // this indicates a dependency on the given index. If no scalability
729 // is used, this MUST be 0 or omitted. When omitted, LID MUST also
730 // be omitted.
731 struct FrameMarks {
732 bool startOfFrame;
danilchap 2017/06/28 16:07:06 use lowercase_with_underscores style for new code
sergio.garcia.murillo 2017/06/29 12:58:57 Done
733 bool endOfFrame;
734 bool independent;
735 bool discardable;
736 bool baseLayerSync;
737 uint8_t temporalLayerId;
738 uint8_t spatialLayerId;
739 uint8_t tl0PicIdx;
740 };
741
701 // Class to represent RtpStreamId which is a string. 742 // Class to represent RtpStreamId which is a string.
702 // Unlike std::string, it can be copied with memcpy and cleared with memset. 743 // Unlike std::string, it can be copied with memcpy and cleared with memset.
703 // Empty value represent unset RtpStreamId. 744 // Empty value represent unset RtpStreamId.
704 class StreamId { 745 class StreamId {
705 public: 746 public:
706 // Stream id is limited to 16 bytes because it is the maximum length 747 // Stream id is limited to 16 bytes because it is the maximum length
707 // that can be encoded with one-byte header extensions. 748 // that can be encoded with one-byte header extensions.
708 static constexpr size_t kMaxSize = 16; 749 static constexpr size_t kMaxSize = 16;
709 750
710 static bool IsLegalName(rtc::ArrayView<const char> name); 751 static bool IsLegalName(rtc::ArrayView<const char> name);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 bool hasVideoContentType; 804 bool hasVideoContentType;
764 VideoContentType videoContentType; 805 VideoContentType videoContentType;
765 806
766 PlayoutDelay playout_delay = {-1, -1}; 807 PlayoutDelay playout_delay = {-1, -1};
767 808
768 // For identification of a stream when ssrc is not signaled. See 809 // For identification of a stream when ssrc is not signaled. See
769 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09 810 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09
770 // TODO(danilchap): Update url from draft to release version. 811 // TODO(danilchap): Update url from draft to release version.
771 StreamId stream_id; 812 StreamId stream_id;
772 StreamId repaired_stream_id; 813 StreamId repaired_stream_id;
814
815 // For Frame Marking RTP Header Extension:
816 // https://tools.ietf.org/html/draft-ietf-avtext-framemarking-04#page-4
817 bool hasFrameMarks;
818 FrameMarks frameMarks = { false, false, false, false, false, 0, 0, 0};
773 }; 819 };
774 820
775 struct RTPHeader { 821 struct RTPHeader {
776 RTPHeader(); 822 RTPHeader();
777 823
778 bool markerBit; 824 bool markerBit;
779 uint8_t payloadType; 825 uint8_t payloadType;
780 uint16_t sequenceNumber; 826 uint16_t sequenceNumber;
781 uint32_t timestamp; 827 uint32_t timestamp;
782 uint32_t ssrc; 828 uint32_t ssrc;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 enum class RtcpMode { kOff, kCompound, kReducedSize }; 934 enum class RtcpMode { kOff, kCompound, kReducedSize };
889 935
890 enum NetworkState { 936 enum NetworkState {
891 kNetworkUp, 937 kNetworkUp,
892 kNetworkDown, 938 kNetworkDown,
893 }; 939 };
894 940
895 } // namespace webrtc 941 } // namespace webrtc
896 942
897 #endif // WEBRTC_COMMON_TYPES_H_ 943 #endif // WEBRTC_COMMON_TYPES_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/config.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698