Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: webrtc/call/flexfec_receive_stream_unittest.cc

Issue 2589393002: Revert of Parse FlexFEC RTP headers in Call and add integration with BWE. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/call/flexfec_receive_stream_impl.cc ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/flexfec_receive_stream_unittest.cc
diff --git a/webrtc/call/flexfec_receive_stream_unittest.cc b/webrtc/call/flexfec_receive_stream_unittest.cc
index 07d3943257acd3dfec05709cea627bc171feb202..314d9c0efe5d9846b47e265a5cb81a8443f64edb 100644
--- a/webrtc/call/flexfec_receive_stream_unittest.cc
+++ b/webrtc/call/flexfec_receive_stream_unittest.cc
@@ -8,36 +8,24 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/base/array_view.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/call/flexfec_receive_stream_impl.h"
#include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
-#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
#include "webrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
namespace webrtc {
-namespace {
-
-RtpPacketReceived ParsePacket(rtc::ArrayView<const uint8_t> packet) {
- RtpPacketReceived parsed_packet(nullptr);
- EXPECT_TRUE(parsed_packet.Parse(packet));
- return parsed_packet;
-}
-
-} // namespace
-
TEST(FlexfecReceiveStreamTest, ConstructDestruct) {
FlexfecReceiveStream::Config config;
config.payload_type = 118;
config.remote_ssrc = 424223;
config.protected_media_ssrcs = {912512};
- MockRecoveredPacketReceiver recovered_packet_receiver;
+ MockRecoveredPacketReceiver callback;
- FlexfecReceiveStreamImpl receive_stream(config, &recovered_packet_receiver);
+ FlexfecReceiveStreamImpl receive_stream(config, &callback);
}
TEST(FlexfecReceiveStreamTest, StartStop) {
@@ -45,11 +33,25 @@
config.payload_type = 118;
config.remote_ssrc = 1652392;
config.protected_media_ssrcs = {23300443};
- MockRecoveredPacketReceiver recovered_packet_receiver;
- FlexfecReceiveStreamImpl receive_stream(config, &recovered_packet_receiver);
+ MockRecoveredPacketReceiver callback;
+ FlexfecReceiveStreamImpl receive_stream(config, &callback);
receive_stream.Start();
receive_stream.Stop();
+}
+
+TEST(FlexfecReceiveStreamTest, DoesNotProcessPacketWhenNoMediaSsrcGiven) {
+ FlexfecReceiveStream::Config config;
+ config.payload_type = 118;
+ config.remote_ssrc = 424223;
+ config.protected_media_ssrcs = {};
+ MockRecoveredPacketReceiver callback;
+ FlexfecReceiveStreamImpl receive_stream(config, &callback);
+ const uint8_t packet[] = {0x00, 0x11, 0x22, 0x33};
+ const size_t packet_length = sizeof(packet);
+
+ EXPECT_FALSE(
+ receive_stream.AddAndProcessReceivedPacket(packet, packet_length));
}
// Create a FlexFEC packet that protects a single media packet and ensure
@@ -89,6 +91,7 @@
// FEC payload.
kPayloadBits, kPayloadBits, kPayloadBits, kPayloadBits};
// clang-format on
+ constexpr size_t kFlexfecPacketLength = sizeof(kFlexfecPacket);
FlexfecReceiveStream::Config config;
config.payload_type = kFlexfecPlType;
@@ -99,14 +102,16 @@
FlexfecReceiveStreamImpl receive_stream(config, &recovered_packet_receiver);
// Do not call back before being started.
- receive_stream.AddAndProcessReceivedPacket(ParsePacket(kFlexfecPacket));
+ receive_stream.AddAndProcessReceivedPacket(kFlexfecPacket,
+ kFlexfecPacketLength);
// Call back after being started.
receive_stream.Start();
EXPECT_CALL(
recovered_packet_receiver,
OnRecoveredPacket(::testing::_, kRtpHeaderSize + kPayloadLength[1]));
- receive_stream.AddAndProcessReceivedPacket(ParsePacket(kFlexfecPacket));
+ receive_stream.AddAndProcessReceivedPacket(kFlexfecPacket,
+ kFlexfecPacketLength);
}
} // namespace webrtc
« no previous file with comments | « webrtc/call/flexfec_receive_stream_impl.cc ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698