Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc

Issue 2281453002: Moved codec-specific audio packet splitting into decoders. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc
diff --git a/webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc b/webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc
index dce5f4c516ae91bd723614a4050ac7ef2ffe98c4..b9b0bd8fe9533290e3c879abf45e4145aeac6910 100644
--- a/webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc
+++ b/webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc
@@ -44,6 +44,17 @@ int AudioDecoderPcm16B::DecodeInternal(const uint8_t* encoded,
return static_cast<int>(ret);
}
+AudioDecoder::PacketSplits AudioDecoderPcm16B::SplitPacket(
+ const uint8_t* payload,
+ size_t payload_len) const {
+ // TODO(ossu): Investigate if we can ever get 44.1KHz audio here, in which
+ // case rounding will break. Consider replacing with
+ // CheckedDivExact to catch that happening.
kwiberg-webrtc 2016/08/26 12:39:25 Could you handle that by letting SplitBySamples wo
+ return SplitBySamples(payload, payload_len,
+ sample_rate_hz_ * 2 * num_channels_ / 1000,
+ sample_rate_hz_ / 1000);
+}
+
int AudioDecoderPcm16B::PacketDuration(const uint8_t* encoded,
size_t encoded_len) const {
// Two encoded byte per sample per channel.

Powered by Google App Engine
This is Rietveld 408576698