Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 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_NETEQ_DELAY_ANALYZER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_DELAY_ANALYZER_H_ | |
| 13 | |
| 14 #include <map> | |
| 15 #include <vector> | |
| 16 | |
| 17 #include "webrtc/base/optional.h" | |
| 18 #include "webrtc/modules/audio_coding/neteq/tools/neteq_input.h" | |
| 19 #include "webrtc/modules/audio_coding/neteq/tools/neteq_test.h" | |
| 20 #include "webrtc/typedefs.h" | |
| 21 | |
| 22 namespace webrtc { | |
| 23 namespace test { | |
| 24 | |
| 25 class NetEqDelayAnalyzer : public test::NetEqPostInsertPacket, | |
| 26 public test::NetEqGetAudioCallback { | |
| 27 public: | |
| 28 void AfterInsertPacket(const test::NetEqInput::PacketData& packet, | |
| 29 NetEq* neteq) override; | |
| 30 | |
| 31 void BeforeGetAudio(NetEq* neteq) override; | |
| 32 | |
| 33 void AfterGetAudio(int64_t time_now_ms, | |
| 34 const AudioFrame& audio_frame, | |
| 35 bool muted, | |
| 36 NetEq* neteq) override; | |
| 37 | |
| 38 void CreateGraphs(std::vector<float>* send_times_s, | |
| 39 std::vector<float>* arrival_delay_ms, | |
| 40 std::vector<float>* corrected_arrival_delay_ms, | |
| 41 std::vector<rtc::Optional<float>>* playout_delay_ms, | |
| 42 std::vector<rtc::Optional<float>>* target_delay_ms) const; | |
| 43 | |
| 44 private: | |
| 45 struct TimingData { | |
| 46 TimingData(uint16_t sn, double at) : rtp_sn(sn), arrival_time_ms(at) {} | |
| 47 uint16_t rtp_sn; | |
|
ivoc
2017/05/16 13:25:50
I think it would be nicer to spell out the abbrevi
hlundin-webrtc
2017/05/30 14:56:06
Turns out I didn't even use it...
| |
| 48 double arrival_time_ms; | |
| 49 rtc::Optional<int64_t> decode_get_audio_count; | |
| 50 rtc::Optional<int64_t> sync_delay_ms; | |
| 51 rtc::Optional<int> target_delay_ms; | |
| 52 rtc::Optional<int> current_delay_ms; | |
| 53 }; | |
| 54 std::map<uint32_t, TimingData> data_; | |
| 55 std::vector<int64_t> get_audio_time_ms_; | |
| 56 size_t get_audio_count_ = 0; | |
| 57 size_t last_sync_buffer_ms_ = 0; | |
| 58 int last_sample_rate_hz_ = 0; | |
| 59 }; | |
| 60 | |
| 61 } // namespace test | |
| 62 } // namespace webrtc | |
| 63 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_DELAY_ANALYZER_H_ | |
| OLD | NEW |