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

Unified Diff: webrtc/modules/audio_coding/codecs/audio_decoder.h

Issue 2326003002: Moved codec-specific audio packet splitting into decoders. (Closed)
Patch Set: Created 4 years, 3 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/audio_decoder.h
diff --git a/webrtc/modules/audio_coding/codecs/audio_decoder.h b/webrtc/modules/audio_coding/codecs/audio_decoder.h
index 7abd86c87fad0b4793e24c1150ad8a2c42fbd57e..9d542dabd3b0effe28dfc01847cb85b87d20b660 100644
--- a/webrtc/modules/audio_coding/codecs/audio_decoder.h
+++ b/webrtc/modules/audio_coding/codecs/audio_decoder.h
@@ -11,7 +11,7 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_
-#include <stdlib.h> // NULL
+#include <vector>
#include "webrtc/base/array_view.h"
#include "webrtc/base/buffer.h"
@@ -33,6 +33,12 @@ class AudioDecoder {
// Used by PacketDuration below. Save the value -1 for errors.
enum { kNotImplemented = -2 };
+ struct PacketSplit {
+ size_t byte_offset;
+ size_t num_bytes;
+ size_t timestamp_offset;
+ };
+
AudioDecoder() = default;
virtual ~AudioDecoder() = default;
@@ -118,6 +124,14 @@ class AudioDecoder {
uint32_t rtp_timestamp,
uint32_t arrival_timestamp);
+ // This method is experimental and should not be overriden by external codecs.
+ // It calculates positions where the packet can be split, and the respective
+ // timestamps of those positions. It is part of the work to separate codec
+ // specific functionality from NetEq and will likely be removed soon in favor
+ // of something much better.
+ virtual std::vector<PacketSplit> SplitPacket(
+ rtc::ArrayView<const uint8_t> payload) const;
kwiberg-webrtc 2016/09/12 02:11:01 If you turned the return value into an output argu
ossu 2016/09/12 11:26:37 I've addressed this in the comment on SplitBySampl
+
// Returns the last error code from the decoder.
virtual int ErrorCode();

Powered by Google App Engine
This is Rietveld 408576698