Remove the redundant method GetPayloadSpecifics
It's in the way of a refactoring. Also change PayloadTypeToPayload---the method all callers can use instead---to return Optional<Payload> instead of const Payload* (for thread safety reasons: an object that protects itself with a mutex shouldn't be handing out pointers to parts of itself). BUG=webrtc:8159 Change-Id: I7ef0d545077ffdea016b309f2165e3c4955a2928 Reviewed-on: https://webrtc-review.googlesource.com/2360 Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19917}
This commit is contained in:
@ -48,9 +48,9 @@ bool LoopBackTransport::SendRtp(const uint8_t* data,
|
||||
if (!parser->Parse(data, len, &header)) {
|
||||
return false;
|
||||
}
|
||||
PayloadUnion payload_specific;
|
||||
if (!rtp_payload_registry_->GetPayloadSpecifics(header.payloadType,
|
||||
&payload_specific)) {
|
||||
const auto pl =
|
||||
rtp_payload_registry_->PayloadTypeToPayload(header.payloadType);
|
||||
if (!pl) {
|
||||
return false;
|
||||
}
|
||||
const uint8_t* payload = data + header.headerLength;
|
||||
@ -58,7 +58,7 @@ bool LoopBackTransport::SendRtp(const uint8_t* data,
|
||||
const size_t payload_length = len - header.headerLength;
|
||||
receive_statistics_->IncomingPacket(header, len, false);
|
||||
return rtp_receiver_->IncomingRtpPacket(header, payload, payload_length,
|
||||
payload_specific, true);
|
||||
pl->typeSpecific, true);
|
||||
}
|
||||
|
||||
bool LoopBackTransport::SendRtcp(const uint8_t* data, size_t len) {
|
||||
|
||||
Reference in New Issue
Block a user