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

Review URL: https://codereview.webrtc.org/2089773002 .

Committed: https://crrev.com/ad34dbe934d47f88011045671b4aea00dbd5a795
Cr-Original-Commit-Position: refs/heads/master@{#13613}
Cr-Commit-Position: refs/heads/master@{#13615}
This commit is contained in:
Sergey Ulanov
2016-08-02 15:14:39 -07:00
parent ac4dc2cefe
commit 4c7f4cd2ef
43 changed files with 475 additions and 380 deletions

View File

@ -225,8 +225,21 @@ class RtpRtcp : public Module {
// |payload_size| - size of payload buffer to send
// |fragmentation| - fragmentation offset data for fragmented frames such
// as layers or RED
// Returns -1 on failure else 0.
virtual int32_t SendOutgoingData(
// |transport_frame_id_out| - set to RTP timestamp.
// Returns true on success.
virtual bool SendOutgoingData(FrameType frame_type,
int8_t payload_type,
uint32_t timestamp,
int64_t capture_time_ms,
const uint8_t* payload_data,
size_t payload_size,
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* rtp_video_header,
uint32_t* transport_frame_id_out) = 0;
// Deprecated version of the method above.
int32_t SendOutgoingData(
FrameType frame_type,
int8_t payload_type,
uint32_t timestamp,
@ -234,7 +247,14 @@ class RtpRtcp : public Module {
const uint8_t* payload_data,
size_t payload_size,
const RTPFragmentationHeader* fragmentation = nullptr,
const RTPVideoHeader* rtp_video_header = nullptr) = 0;
const RTPVideoHeader* rtp_video_header = nullptr) {
return SendOutgoingData(frame_type, payload_type, timestamp,
capture_time_ms, payload_data, payload_size,
fragmentation, rtp_video_header,
/*frame_id_out=*/nullptr)
? 0
: -1;
}
virtual bool TimeToSendPacket(uint32_t ssrc,
uint16_t sequence_number,