Restructure neteq_rtpplay into a library with small executable wrapper.

Most of the code in neteq_rtpplay is moved into a factory class for
NetEqTest. The factory method takes the same argc and argv arguments as
neteq_rtpplay.
This CL also adds a small public API for neteq_test to allow easy
integration into external software.

Bug: webrtc:9667
Change-Id: I5241c1f51736cb6fbe47b0ad25f4bc83dabd727d
Reviewed-on: https://webrtc-review.googlesource.com/96100
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24531}
This commit is contained in:
Ivo Creusen
2018-09-03 11:49:27 +02:00
committed by Commit Bot
parent 88c1a9ecbc
commit 55de08e7ef
16 changed files with 987 additions and 554 deletions

View File

@ -21,6 +21,7 @@
#include "api/audio_codecs/audio_decoder.h"
#include "api/rtp_headers.h"
#include "common_types.h" // NOLINT(build/include)
#include "modules/audio_coding/neteq/defines.h"
#include "modules/audio_coding/neteq/neteq_decoder_enum.h"
#include "rtc_base/constructormagic.h"
#include "rtc_base/scoped_ref_ptr.h"
@ -129,9 +130,14 @@ class NetEq {
// If muted state is enabled (through Config::enable_muted_state), |muted|
// may be set to true after a prolonged expand period. When this happens, the
// |data_| in |audio_frame| is not written, but should be interpreted as being
// all zeros.
// all zeros. For testing purposes, an override can be supplied in the
// |action_override| argument, which will cause NetEq to take this action
// next, instead of the action it would normally choose.
// Returns kOK on success, or kFail in case of an error.
virtual int GetAudio(AudioFrame* audio_frame, bool* muted) = 0;
virtual int GetAudio(
AudioFrame* audio_frame,
bool* muted,
absl::optional<Operations> action_override = absl::nullopt) = 0;
// Replaces the current set of decoders with the given one.
virtual void SetCodecs(const std::map<int, SdpAudioFormat>& codecs) = 0;