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}
diff --git a/webrtc/modules/audio_coding/neteq/include/neteq.h b/webrtc/modules/audio_coding/neteq/include/neteq.h
index 45aae11..648c04f 100644
--- a/webrtc/modules/audio_coding/neteq/include/neteq.h
+++ b/webrtc/modules/audio_coding/neteq/include/neteq.h
@@ -102,32 +102,6 @@
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 @@
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 @@
// 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;