OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |
| 13 |
| 14 #include <string> |
| 15 |
| 16 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/scoped_ptr.h" |
| 18 #include "webrtc/modules/audio_coding/neteq/tools/packet_source.h" |
| 19 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
| 20 |
| 21 namespace webrtc { |
| 22 |
| 23 class RtpHeaderParser; |
| 24 |
| 25 namespace rtclog { |
| 26 class EventStream; |
| 27 } // namespace rtclog |
| 28 |
| 29 namespace test { |
| 30 |
| 31 class Packet; |
| 32 |
| 33 class RtcEventLogSource : public PacketSource { |
| 34 public: |
| 35 // Creates an RtcEventLogSource reading from |file_name|. If the file cannot |
| 36 // be opened, or has the wrong format, NULL will be returned. |
| 37 static RtcEventLogSource* Create(const std::string& file_name); |
| 38 |
| 39 virtual ~RtcEventLogSource(); |
| 40 |
| 41 // Registers an RTP header extension and binds it to |id|. |
| 42 virtual bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); |
| 43 |
| 44 // Returns a pointer to the next packet. Returns NULL if end of file was |
| 45 // reached. |
| 46 Packet* NextPacket() override; |
| 47 |
| 48 // Returns the timestamp of the next audio output event, in milliseconds. The |
| 49 // maximum value of int64_t is returned if there are no more audio output |
| 50 // events available. |
| 51 int64_t NextAudioOutputEventMs(); |
| 52 |
| 53 private: |
| 54 RtcEventLogSource(); |
| 55 |
| 56 bool OpenFile(const std::string& file_name); |
| 57 |
| 58 int rtp_packet_index_ = 0; |
| 59 int audio_output_index_ = 0; |
| 60 |
| 61 rtc::scoped_ptr<rtclog::EventStream> event_log_; |
| 62 rtc::scoped_ptr<RtpHeaderParser> parser_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(RtcEventLogSource); |
| 65 }; |
| 66 |
| 67 } // namespace test |
| 68 } // namespace webrtc |
| 69 |
| 70 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTC_EVENT_LOG_SOURCE_H_ |
OLD | NEW |