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}
This commit is contained in:
@ -41,47 +41,6 @@ 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