Revert "Delete RtpUtility::Payload, and refactor RTPSender to not use it"
This reverts commit 171df9326200d1e01bce530e2ff01ac5890e6cb7. Reason for revert: Breaks downstream project Original change's description: > Delete RtpUtility::Payload, and refactor RTPSender to not use it > > Replaced by a payload type --> video codec map in RTPSenderVideo, > where it is used to select the right packetizer. > > Bug: webrtc:6883 > Change-Id: I43a635d5135c5d519df860a2f4287a4478870b0f > Reviewed-on: https://webrtc-review.googlesource.com/c/119263 > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Niels Moller <nisse@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#26380} TBR=danilchap@webrtc.org,brandtr@webrtc.org,nisse@webrtc.org Change-Id: I76489c29541827aaba72515a76db54bdb7495e28 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:6883 Reviewed-on: https://webrtc-review.googlesource.com/c/119640 Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26385}
This commit is contained in:
@ -41,6 +41,47 @@ const int kBogusRtpRateForAudioRtcp = 8000;
|
||||
// Minimum RTP header size in bytes.
|
||||
const uint8_t kRtpHeaderSize = 12;
|
||||
|
||||
struct AudioPayload {
|
||||
SdpAudioFormat format;
|
||||
uint32_t rate;
|
||||
};
|
||||
|
||||
struct VideoPayload {
|
||||
VideoCodecType videoCodecType;
|
||||
// The H264 profile only matters if videoCodecType == kVideoCodecH264.
|
||||
H264::Profile h264_profile;
|
||||
};
|
||||
|
||||
class PayloadUnion {
|
||||
public:
|
||||
explicit PayloadUnion(const AudioPayload& payload);
|
||||
explicit PayloadUnion(const VideoPayload& payload);
|
||||
PayloadUnion(const PayloadUnion&);
|
||||
PayloadUnion(PayloadUnion&&);
|
||||
~PayloadUnion();
|
||||
|
||||
PayloadUnion& operator=(const PayloadUnion&);
|
||||
PayloadUnion& operator=(PayloadUnion&&);
|
||||
|
||||
bool is_audio() const {
|
||||
return absl::holds_alternative<AudioPayload>(payload_);
|
||||
}
|
||||
bool is_video() const {
|
||||
return absl::holds_alternative<VideoPayload>(payload_);
|
||||
}
|
||||
const AudioPayload& audio_payload() const {
|
||||
return absl::get<AudioPayload>(payload_);
|
||||
}
|
||||
const VideoPayload& video_payload() const {
|
||||
return absl::get<VideoPayload>(payload_);
|
||||
}
|
||||
AudioPayload& audio_payload() { return absl::get<AudioPayload>(payload_); }
|
||||
VideoPayload& video_payload() { return absl::get<VideoPayload>(payload_); }
|
||||
|
||||
private:
|
||||
absl::variant<AudioPayload, VideoPayload> payload_;
|
||||
};
|
||||
|
||||
enum ProtectionType { kUnprotectedPacket, kProtectedPacket };
|
||||
|
||||
enum StorageType { kDontRetransmit, kAllowRetransmission };
|
||||
|
||||
Reference in New Issue
Block a user