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