Index: webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc |
diff --git a/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc b/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc |
index 379293b748b043985488e180934c2dd5c9baf060..93b24bdf2c718405fbbbab56fea7c4d8cada2473 100644 |
--- a/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc |
+++ b/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc |
@@ -13,6 +13,7 @@ |
#include <string.h> |
#include "webrtc/base/checks.h" |
+#include "webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.h" |
#include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" |
namespace webrtc { |
@@ -47,6 +48,14 @@ void AudioDecoderG722::Reset() { |
WebRtcG722_DecoderInit(dec_state_); |
} |
+std::vector<AudioDecoder::ParseResult> AudioDecoderG722::ParsePayload( |
+ rtc::Buffer&& payload, |
+ uint32_t timestamp, |
+ bool is_primary) { |
+ return LegacyEncodedAudioFrame::SplitBySamples(this, std::move(payload), |
+ timestamp, is_primary, 8, 16); |
+} |
+ |
int AudioDecoderG722::PacketDuration(const uint8_t* encoded, |
size_t encoded_len) const { |
// 1/2 encoded byte per sample per channel. |
@@ -117,6 +126,14 @@ void AudioDecoderG722Stereo::Reset() { |
WebRtcG722_DecoderInit(dec_state_right_); |
} |
+std::vector<AudioDecoder::ParseResult> AudioDecoderG722Stereo::ParsePayload( |
+ rtc::Buffer&& payload, |
+ uint32_t timestamp, |
+ bool is_primary) { |
+ return LegacyEncodedAudioFrame::SplitBySamples( |
+ this, std::move(payload), timestamp, is_primary, 2 * 8, 16); |
+} |
+ |
// Split the stereo packet and place left and right channel after each other |
// in the output array. |
void AudioDecoderG722Stereo::SplitStereoPacket(const uint8_t* encoded, |