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/4c7f4cd2ef76821edca6d773d733a924b0bedd25
Committed: https://crrev.com/ad34dbe934d47f88011045671b4aea00dbd5a795
Cr-Original-Original-Commit-Position: refs/heads/master@{#13615}
Cr-Original-Commit-Position: refs/heads/master@{#13617}
Cr-Original-Original-Original-Commit-Position: refs/heads/master@{#13613}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 525df3ffd1626efa0dc6be5824bc64297a0e9931
diff --git a/modules/rtp_rtcp/test/testAPI/test_api_audio.cc b/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
index f9e5001..4bbcc32 100644
--- a/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
+++ b/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
@@ -171,8 +171,9 @@
// Send an empty RTP packet.
// Should fail since we have not registered the payload type.
- EXPECT_EQ(-1, module1->SendOutgoingData(webrtc::kAudioFrameSpeech,
- 96, 0, -1, NULL, 0));
+ EXPECT_FALSE(module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, 0, -1,
+ nullptr, 0, nullptr, nullptr,
+ nullptr));
CodecInst voice_codec;
memset(&voice_codec, 0, sizeof(voice_codec));
@@ -197,8 +198,9 @@
(voice_codec.rate < 0) ? 0 : voice_codec.rate));
const uint8_t test[5] = "test";
- EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
- 0, -1, test, 4));
+ EXPECT_EQ(true,
+ module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, 0, -1,
+ test, 4, nullptr, nullptr, nullptr));
EXPECT_EQ(test_ssrc, rtp_receiver2_->SSRC());
uint32_t timestamp;
@@ -271,9 +273,9 @@
const uint8_t test[5] = "test";
// Send a RTP packet.
- EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech,
- 96, 160, -1, test, 4,
- &fragmentation));
+ EXPECT_TRUE(module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, 160, -1,
+ test, 4, &fragmentation, nullptr,
+ nullptr));
EXPECT_EQ(0, module1->SetSendREDPayloadType(-1));
EXPECT_EQ(-1, module1->SendREDPayloadType(&red));
@@ -333,16 +335,18 @@
// Send RTP packets for 16 tones a 160 ms 100ms
// pause between = 2560ms + 1600ms = 4160ms
for (; timeStamp <= 250 * 160; timeStamp += 160) {
- EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
- timeStamp, -1, test, 4));
+ EXPECT_TRUE(module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
+ timeStamp, -1, test, 4, nullptr,
+ nullptr, nullptr));
fake_clock.AdvanceTimeMilliseconds(20);
module1->Process();
}
EXPECT_EQ(0, module1->SendTelephoneEventOutband(32, 9000, 10));
for (; timeStamp <= 740 * 160; timeStamp += 160) {
- EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
- timeStamp, -1, test, 4));
+ EXPECT_TRUE(module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
+ timeStamp, -1, test, 4, nullptr,
+ nullptr, nullptr));
fake_clock.AdvanceTimeMilliseconds(20);
module1->Process();
}
diff --git a/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc b/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
index f33507e..e19cf35 100644
--- a/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
+++ b/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
@@ -165,8 +165,9 @@
// the receiving module.
// send RTP packet with the data "testtest"
const uint8_t test[9] = "testtest";
- EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96,
- 0, -1, test, 8));
+ EXPECT_EQ(true,
+ module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, 0, -1,
+ test, 8, nullptr, nullptr, nullptr));
}
virtual void TearDown() {
diff --git a/modules/rtp_rtcp/test/testAPI/test_api_video.cc b/modules/rtp_rtcp/test/testAPI/test_api_video.cc
index e784386..a701c9e 100644
--- a/modules/rtp_rtcp/test/testAPI/test_api_video.cc
+++ b/modules/rtp_rtcp/test/testAPI/test_api_video.cc
@@ -147,11 +147,9 @@
TEST_F(RtpRtcpVideoTest, BasicVideo) {
uint32_t timestamp = 3000;
- EXPECT_EQ(0, video_module_->SendOutgoingData(kVideoFrameDelta, 123,
- timestamp,
- timestamp / 90,
- video_frame_,
- payload_data_length_));
+ EXPECT_TRUE(video_module_->SendOutgoingData(
+ kVideoFrameDelta, 123, timestamp, timestamp / 90, video_frame_,
+ payload_data_length_, nullptr, nullptr, nullptr));
}
TEST_F(RtpRtcpVideoTest, PaddingOnlyFrames) {