Revert of Add EncodedImageCallback::OnEncodedImage(). (patchset #13 id:280001 of https://codereview.webrtc.org/2089773002/ )
Reason for revert: broke internal tests Original issue's description: > Add EncodedImageCallback::OnEncodedImage(). > > OnEncodedImage() is going to replace Encoded(), which is deprecated now. > The new OnEncodedImage() returns Result struct that contains frame_id, > which tells the encoder RTP timestamp for the frame. > > BUG=chromium:621691 > R=niklas.enbom@webrtc.org, sprang@webrtc.org, stefan@webrtc.org > > Committed: https://crrev.com/ad34dbe934d47f88011045671b4aea00dbd5a795 > Cr-Commit-Position: refs/heads/master@{#13613} TBR=pbos@webrtc.org,mflodman@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,niklas.enbom@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:621691 Review-Url: https://codereview.webrtc.org/2206743002 Cr-Commit-Position: refs/heads/master@{#13614}
This commit is contained in:
@ -145,7 +145,7 @@ bool RTPSenderAudio::MarkerBit(FrameType frame_type, int8_t payload_type) {
|
||||
return marker_bit;
|
||||
}
|
||||
|
||||
bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
int32_t RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
int8_t payload_type,
|
||||
uint32_t capture_timestamp,
|
||||
const uint8_t* payload_data,
|
||||
@ -195,7 +195,7 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
if (packet_size_samples >
|
||||
(capture_timestamp - dtmf_timestamp_last_sent_)) {
|
||||
// not time to send yet
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
dtmf_timestamp_last_sent_ = capture_timestamp;
|
||||
@ -228,24 +228,24 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
ended, dtmf_payload_type, dtmf_timestamp_,
|
||||
static_cast<uint16_t>(dtmf_duration_samples), false);
|
||||
} else {
|
||||
if (!SendTelephoneEventPacket(ended, dtmf_payload_type, dtmf_timestamp_,
|
||||
dtmf_duration_samples,
|
||||
!dtmf_event_first_packet_sent_)) {
|
||||
return false;
|
||||
if (SendTelephoneEventPacket(ended, dtmf_payload_type, dtmf_timestamp_,
|
||||
dtmf_duration_samples,
|
||||
!dtmf_event_first_packet_sent_) != 0) {
|
||||
return -1;
|
||||
}
|
||||
dtmf_event_first_packet_sent_ = true;
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
if (payload_size == 0 || payload_data == NULL) {
|
||||
if (frame_type == kEmptyFrame) {
|
||||
// we don't send empty audio RTP packets
|
||||
// no error since we use it to drive DTMF when we use VAD
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
uint8_t data_buffer[IP_PACKET_SIZE];
|
||||
bool marker_bit = MarkerBit(frame_type, payload_type);
|
||||
@ -269,11 +269,11 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
clock_->TimeInMilliseconds());
|
||||
}
|
||||
if (rtpHeaderLength <= 0) {
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
if (max_payload_length < (rtpHeaderLength + payload_size)) {
|
||||
// Too large payload buffer.
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
if (red_payload_type >= 0 && // Have we configured RED?
|
||||
fragmentation && fragmentation->fragmentationVectorSize > 1 &&
|
||||
@ -281,7 +281,7 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
if (timestampOffset <= 0x3fff) {
|
||||
if (fragmentation->fragmentationVectorSize != 2) {
|
||||
// we only support 2 codecs when using RED
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
// only 0x80 if we have multiple blocks
|
||||
data_buffer[rtpHeaderLength++] =
|
||||
@ -290,7 +290,7 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
|
||||
// sanity blockLength
|
||||
if (blockLength > 0x3ff) { // block length 10 bits 1023 bytes
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
uint32_t REDheader = (timestampOffset << 10) + blockLength;
|
||||
ByteWriter<uint32_t>::WriteBigEndian(data_buffer + rtpHeaderLength,
|
||||
@ -349,7 +349,7 @@ bool RTPSenderAudio::SendAudio(FrameType frame_type,
|
||||
TRACE_EVENT_ASYNC_END2("webrtc", "Audio", capture_timestamp, "timestamp",
|
||||
rtp_sender_->Timestamp(), "seqnum",
|
||||
rtp_sender_->SequenceNumber());
|
||||
bool send_result = rtp_sender_->SendToNetwork(
|
||||
int32_t send_result = rtp_sender_->SendToNetwork(
|
||||
data_buffer, payload_size, rtpHeaderLength, rtc::TimeMillis(),
|
||||
kAllowRetransmission, RtpPacketSender::kHighPriority);
|
||||
if (first_packet_sent_()) {
|
||||
@ -403,18 +403,18 @@ int32_t RTPSenderAudio::SendTelephoneEvent(uint8_t key,
|
||||
return AddDTMF(key, time_ms, level);
|
||||
}
|
||||
|
||||
bool RTPSenderAudio::SendTelephoneEventPacket(bool ended,
|
||||
int8_t dtmf_payload_type,
|
||||
uint32_t dtmf_timestamp,
|
||||
uint16_t duration,
|
||||
bool marker_bit) {
|
||||
int32_t RTPSenderAudio::SendTelephoneEventPacket(bool ended,
|
||||
int8_t dtmf_payload_type,
|
||||
uint32_t dtmf_timestamp,
|
||||
uint16_t duration,
|
||||
bool marker_bit) {
|
||||
uint8_t dtmfbuffer[IP_PACKET_SIZE];
|
||||
uint8_t send_count = 1;
|
||||
bool result = 0;
|
||||
uint8_t sendCount = 1;
|
||||
int32_t retVal = 0;
|
||||
|
||||
if (ended) {
|
||||
// resend last packet in an event 3 times
|
||||
send_count = 3;
|
||||
sendCount = 3;
|
||||
}
|
||||
do {
|
||||
// Send DTMF data
|
||||
@ -422,7 +422,7 @@ bool RTPSenderAudio::SendTelephoneEventPacket(bool ended,
|
||||
dtmfbuffer, dtmf_payload_type, marker_bit, dtmf_timestamp,
|
||||
clock_->TimeInMilliseconds());
|
||||
if (header_length <= 0)
|
||||
return false;
|
||||
return -1;
|
||||
|
||||
// reset CSRC and X bit
|
||||
dtmfbuffer[0] &= 0xe0;
|
||||
@ -451,12 +451,12 @@ bool RTPSenderAudio::SendTelephoneEventPacket(bool ended,
|
||||
TRACE_EVENT_INSTANT2(
|
||||
TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "Audio::SendTelephoneEvent",
|
||||
"timestamp", dtmf_timestamp, "seqnum", rtp_sender_->SequenceNumber());
|
||||
result = rtp_sender_->SendToNetwork(dtmfbuffer, 4, 12, rtc::TimeMillis(),
|
||||
retVal = rtp_sender_->SendToNetwork(dtmfbuffer, 4, 12, rtc::TimeMillis(),
|
||||
kAllowRetransmission,
|
||||
RtpPacketSender::kHighPriority);
|
||||
send_count--;
|
||||
} while (send_count > 0 && result == 0);
|
||||
sendCount--;
|
||||
} while (sendCount > 0 && retVal == 0);
|
||||
|
||||
return result;
|
||||
return retVal;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user