Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.h |
| diff --git a/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.h |
| similarity index 50% |
| copy from webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h |
| copy to webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.h |
| index d711685950e8b84094ba948dd81e854604848cad..03828429300fb432b8af0340da5bdfc5e1b35624 100644 |
| --- a/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h |
| +++ b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.h |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| + * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| * |
| * Use of this source code is governed by a BSD-style license |
| * that can be found in the LICENSE file in the root of the source |
| @@ -7,16 +7,13 @@ |
| * in the file PATENTS. All contributing project authors may |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| +#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |
|
minyue-webrtc
2015/08/28 14:50:21
a line break before
ivoc
2015/09/01 10:03:50
Done.
|
| +#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |
| -#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_FILE_SOURCE_H_ |
| -#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_FILE_SOURCE_H_ |
| - |
| -#include <stdio.h> |
| #include <string> |
| #include "webrtc/base/constructormagic.h" |
| #include "webrtc/base/scoped_ptr.h" |
| -#include "webrtc/common_types.h" |
| #include "webrtc/modules/audio_coding/neteq/tools/packet_source.h" |
| #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
| @@ -24,40 +21,48 @@ namespace webrtc { |
| class RtpHeaderParser; |
| +namespace rtclog { |
| +class EventStream; |
| +} // namespace rtclog |
| + |
| namespace test { |
| -class RtpFileReader; |
| +class Packet; |
| -class RtpFileSource : public PacketSource { |
| +class RtcEventLogSource : public PacketSource { |
| public: |
| - // Creates an RtpFileSource reading from |file_name|. If the file cannot be |
| - // opened, or has the wrong format, NULL will be returned. |
| - static RtpFileSource* Create(const std::string& file_name); |
| + // Creates an RtcEventLogSource reading from |file_name|. If the file cannot |
| + // be opened, or has the wrong format, NULL will be returned. |
| + static RtcEventLogSource* Create(const std::string& file_name); |
| - virtual ~RtpFileSource(); |
| + virtual ~RtcEventLogSource(); |
| // Registers an RTP header extension and binds it to |id|. |
| virtual bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); |
| // Returns a pointer to the next packet. Returns NULL if end of file was |
| - // reached, or if a the data was corrupt. |
| + // reached. |
| Packet* NextPacket() override; |
| - private: |
| - static const int kFirstLineLength = 40; |
| - static const int kRtpFileHeaderSize = 4 + 4 + 4 + 2 + 2; |
| - static const size_t kPacketHeaderSize = 8; |
| + // Returns the timestamp of the next audio output event, in milliseconds. A |
| + // value of -1 is returned if the end of the file is reached. |
|
hlundin-webrtc
2015/08/28 12:06:25
Is it end of file that is reached, or are there si
ivoc
2015/09/01 10:03:50
Updated to say that there are no more audio output
|
| + int NextAudioOutputEventMs(); |
| - RtpFileSource(); |
| + private: |
| + RtcEventLogSource(); |
| bool OpenFile(const std::string& file_name); |
| - rtc::scoped_ptr<RtpFileReader> rtp_reader_; |
| + int rtp_packet_index_ = 0; |
| + int audio_output_index_ = 0; |
| + |
| + rtc::scoped_ptr<rtclog::EventStream> event_log_; |
| rtc::scoped_ptr<RtpHeaderParser> parser_; |
| - DISALLOW_COPY_AND_ASSIGN(RtpFileSource); |
| + DISALLOW_COPY_AND_ASSIGN(RtcEventLogSource); |
| }; |
| } // namespace test |
| } // namespace webrtc |
| -#endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_FILE_SOURCE_H_ |
| + |
| +#endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |