Let RtpFileSource use RtpFileReader

RtpFileSource used to implement it's own RTP dump file reader, but
with this change it simply uses RtpFileReader. One benefit is that
pcap files are now also supported.

All NetEq test tools that use RtpFileSource are updated.

BUG=2692
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/22839004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7367 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2014-10-02 08:19:38 +00:00
parent 348eac641e
commit 4b133da5fd
6 changed files with 45 additions and 99 deletions

View File

@ -172,12 +172,12 @@ int main(int argc, char* argv[]) {
RegisterPayloadTypes(neteq);
// Read first packet.
if (file_source->EndOfFile()) {
webrtc::scoped_ptr<webrtc::test::Packet> packet(file_source->NextPacket());
if (!packet) {
printf("Warning: RTP file is empty");
webrtc::Trace::ReturnTrace();
return 0;
}
webrtc::scoped_ptr<webrtc::test::Packet> packet(file_source->NextPacket());
bool packet_available = true;
// Set up variables for audio replacement if needed.
@ -195,8 +195,8 @@ int main(int argc, char* argv[]) {
replacement_audio.reset(new int16_t[input_frame_size_timestamps]);
payload_mem_size_bytes = 2 * input_frame_size_timestamps;
payload.reset(new uint8_t[payload_mem_size_bytes]);
assert(!file_source->EndOfFile());
next_packet.reset(file_source->NextPacket());
assert(next_packet);
next_packet_available = true;
}
@ -241,8 +241,9 @@ int main(int argc, char* argv[]) {
}
// Get next packet from file.
if (!file_source->EndOfFile()) {
packet.reset(file_source->NextPacket());
webrtc::test::Packet* temp_packet = file_source->NextPacket();
if (temp_packet) {
packet.reset(temp_packet);
} else {
packet_available = false;
}