Moved codec-specific audio packet splitting into decoders.
There's still some code run specifically for Opus w/ FEC. It will be
addressed in a separate CL.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2326003002
Cr-Original-Commit-Position: refs/heads/master@{#14319}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 0d526d558b0f7b677c43f83e64e67ad65a9639c0
diff --git a/modules/audio_coding/codecs/g711/audio_decoder_pcm.cc b/modules/audio_coding/codecs/g711/audio_decoder_pcm.cc
index af164c4..f2fdb1f 100644
--- a/modules/audio_coding/codecs/g711/audio_decoder_pcm.cc
+++ b/modules/audio_coding/codecs/g711/audio_decoder_pcm.cc
@@ -10,12 +10,21 @@
#include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h"
+#include "webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.h"
#include "webrtc/modules/audio_coding/codecs/g711/g711_interface.h"
namespace webrtc {
void AudioDecoderPcmU::Reset() {}
+std::vector<AudioDecoder::ParseResult> AudioDecoderPcmU::ParsePayload(
+ rtc::Buffer&& payload,
+ uint32_t timestamp,
+ bool is_primary) {
+ return LegacyEncodedAudioFrame::SplitBySamples(
+ this, std::move(payload), timestamp, is_primary, 8 * num_channels_, 8);
+}
+
int AudioDecoderPcmU::SampleRateHz() const {
return 8000;
}
@@ -44,6 +53,14 @@
void AudioDecoderPcmA::Reset() {}
+std::vector<AudioDecoder::ParseResult> AudioDecoderPcmA::ParsePayload(
+ rtc::Buffer&& payload,
+ uint32_t timestamp,
+ bool is_primary) {
+ return LegacyEncodedAudioFrame::SplitBySamples(
+ this, std::move(payload), timestamp, is_primary, 8 * num_channels_, 8);
+}
+
int AudioDecoderPcmA::SampleRateHz() const {
return 8000;
}