1 /* 2 * Copyright (c) 2018 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 MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_EVENT_LOG_INPUT_H_ 12 #define MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_EVENT_LOG_INPUT_H_ 13 14 #include <map> 15 #include <memory> 16 #include <string> 17 18 #include "modules/audio_coding/neteq/tools/neteq_packet_source_input.h" 19 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" 20 21 namespace webrtc { 22 namespace test { 23 24 class RtcEventLogSource; 25 26 // Implementation of NetEqPacketSourceInput to be used with an 27 // RtcEventLogSource. 28 class NetEqEventLogInput final : public NetEqPacketSourceInput { 29 public: 30 static NetEqEventLogInput* CreateFromFile( 31 const std::string& file_name, 32 absl::optional<uint32_t> ssrc_filter); 33 static NetEqEventLogInput* CreateFromString( 34 const std::string& file_contents, 35 absl::optional<uint32_t> ssrc_filter); 36 37 absl::optional<int64_t> NextOutputEventTime() const override; 38 void AdvanceOutputEvent() override; 39 40 protected: 41 PacketSource* source() override; 42 43 private: 44 NetEqEventLogInput(std::unique_ptr<RtcEventLogSource> source); 45 std::unique_ptr<RtcEventLogSource> source_; 46 }; 47 48 } // namespace test 49 } // namespace webrtc 50 #endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_EVENT_LOG_INPUT_H_ 51