aboutsummaryrefslogtreecommitdiff
path: root/api/audio_codecs/opus/audio_decoder_multi_channel_opus.h
diff options
context:
space:
mode:
authorAlex Loiko <aleloi@webrtc.org>2019-04-08 17:19:41 +0200
committerCommit Bot <commit-bot@chromium.org>2019-04-08 16:15:37 +0000
commite5b94160b5c01c0276d46813a97baa9d052c4847 (patch)
tree14f6471e0acd653347caa411845f127eff86e9ef /api/audio_codecs/opus/audio_decoder_multi_channel_opus.h
parente9d2b4efdd5dddaa3a476c0ac2a9cf9125b39929 (diff)
downloadwebrtc-e5b94160b5c01c0276d46813a97baa9d052c4847.tar.gz
Decoder for multistream Opus.
See https://webrtc-review.googlesource.com/c/src/+/121764 for the overall vision. This CL adds a multistream Opus decoder. It's a new code-path to not interfere with the standard Opus decoder. We introduce new SDP syntax, which uses terminology of RFC 7845. We also set up the decoder side to parse it. The encoder part will come in a later CL. E.g. this is the new SDP syntax for 6.1 surround sound: "multiopus/48000/6 channel_mapping=0,4,1,2,3,5 num_streams=4 coupled_streams=2" Bug: webrtc:8649 Change-Id: Ifbc584cbb6d07aed373f223512a20d6d72cec5ec Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129768 Commit-Queue: Alex Loiko <aleloi@webrtc.org> Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27493}
Diffstat (limited to 'api/audio_codecs/opus/audio_decoder_multi_channel_opus.h')
-rw-r--r--api/audio_codecs/opus/audio_decoder_multi_channel_opus.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/api/audio_codecs/opus/audio_decoder_multi_channel_opus.h b/api/audio_codecs/opus/audio_decoder_multi_channel_opus.h
new file mode 100644
index 0000000000..b5ca0fe41b
--- /dev/null
+++ b/api/audio_codecs/opus/audio_decoder_multi_channel_opus.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef API_AUDIO_CODECS_OPUS_AUDIO_DECODER_MULTI_CHANNEL_OPUS_H_
+#define API_AUDIO_CODECS_OPUS_AUDIO_DECODER_MULTI_CHANNEL_OPUS_H_
+
+#include <memory>
+#include <vector>
+
+#include "absl/types/optional.h"
+#include "api/audio_codecs/audio_codec_pair_id.h"
+#include "api/audio_codecs/audio_decoder.h"
+#include "api/audio_codecs/audio_format.h"
+#include "api/audio_codecs/opus/audio_decoder_multi_channel_opus_config.h"
+#include "rtc_base/system/rtc_export.h"
+
+namespace webrtc {
+
+// Opus decoder API for use as a template parameter to
+// CreateAudioDecoderFactory<...>().
+struct RTC_EXPORT AudioDecoderMultiChannelOpus {
+ using Config = AudioDecoderMultiChannelOpusConfig;
+ static absl::optional<AudioDecoderMultiChannelOpusConfig> SdpToConfig(
+ const SdpAudioFormat& audio_format);
+ static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
+ static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
+ AudioDecoderMultiChannelOpusConfig config,
+ absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
+};
+
+} // namespace webrtc
+
+#endif // API_AUDIO_CODECS_OPUS_AUDIO_DECODER_MULTI_CHANNEL_OPUS_H_