NetEq: Removing LastError and LastDecoderError

LastDecoderError was only used in tests. LastError was only used in
conjunction with RemovePayloadType, and always to distinguish between
"decoder not found" and "other error". In AcmReceiver, "decoder not
found" was not treated as an error.

With this change, calling NetEq::RemovePayloadType with a payload type
that is not registered is no longer considered to be an error. This
allows to rewrite the code in AcmReceiver, such that it no longer has
to call LastError.

The internal member variables NetEqImpl::error_code_ and
NetEqImpl::decoder_error_code_ are removed, since they were no longer
read.

Bug: none
Change-Id: Ibfe97265954a2870c3caea4a34aac958351d7ff1
Reviewed-on: https://chromium-review.googlesource.com/535533
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18588}
This commit is contained in:
Henrik Lundin
2017-06-14 12:29:03 +02:00
committed by Commit Bot
parent 2b3aa14ee2
commit c417d9e558
8 changed files with 51 additions and 180 deletions

View File

@ -102,32 +102,6 @@ class NetEq {
kNotImplemented = -2
};
enum ErrorCodes {
kNoError = 0,
kOtherError,
kInvalidRtpPayloadType,
kUnknownRtpPayloadType,
kCodecNotSupported,
kDecoderExists,
kDecoderNotFound,
kInvalidSampleRate,
kInvalidPointer,
kAccelerateError,
kPreemptiveExpandError,
kComfortNoiseErrorCode,
kDecoderErrorCode,
kOtherDecoderError,
kInvalidOperation,
kDtmfParameterError,
kDtmfParsingError,
kDtmfInsertError,
kStereoNotSupported,
kSampleUnderrun,
kDecodedTooMuch,
kRedundancySplitError,
kPacketBufferCorruption
};
// Creates a new NetEq object, with parameters set in |config|. The |config|
// object will only have to be valid for the duration of the call to this
// method.
@ -191,7 +165,8 @@ class NetEq {
const SdpAudioFormat& audio_format) = 0;
// Removes |rtp_payload_type| from the codec database. Returns 0 on success,
// -1 on failure.
// -1 on failure. Removing a payload type that is not registered is ok and
// will not result in an error.
virtual int RemovePayloadType(uint8_t rtp_payload_type) = 0;
// Removes all payload types from the codec database.
@ -282,15 +257,6 @@ class NetEq {
// Not implemented.
virtual int SetTargetSampleRate() = 0;
// Returns the error code for the last occurred error. If no error has
// occurred, 0 is returned.
virtual int LastError() const = 0;
// Returns the error code last returned by a decoder (audio or comfort noise).
// When LastError() returns kDecoderErrorCode or kComfortNoiseErrorCode, check
// this method to get the decoder's error code.
virtual int LastDecoderError() = 0;
// Flushes both the packet buffer and the sync buffer.
virtual void FlushBuffers() = 0;