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

Unified Diff: webrtc/media/base/hybriddataengine.h

Issue 2614813003: Revert of Separating SCTP code from BaseChannel/MediaChannel. (Closed)
Patch Set: Also reverting https://codereview.webrtc.org/2612963002 Created 3 years, 11 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
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/hybriddataengine.h
diff --git a/webrtc/media/base/hybriddataengine.h b/webrtc/media/base/hybriddataengine.h
new file mode 100644
index 0000000000000000000000000000000000000000..341f054868053a9982d72523bcdd185a94b40fd6
--- /dev/null
+++ b/webrtc/media/base/hybriddataengine.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012 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 WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
+#define WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
+
+namespace cricket {
+
+class HybridDataEngine : public DataEngineInterface {
+ public:
+ // Takes ownership.
+ HybridDataEngine(DataEngineInterface* first,
+ DataEngineInterface* second)
+ : first_(first),
+ second_(second) {
+ codecs_ = first_->data_codecs();
+ codecs_.insert(
+ codecs_.end(),
+ second_->data_codecs().begin(),
+ second_->data_codecs().end());
+ }
+
+ virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type,
+ const MediaConfig& config) {
+ DataMediaChannel* channel = NULL;
+ if (first_) {
+ channel = first_->CreateChannel(data_channel_type, config);
+ }
+ if (!channel && second_) {
+ channel = second_->CreateChannel(data_channel_type, config);
+ }
+ return channel;
+ }
+
+ virtual const std::vector<DataCodec>& data_codecs() { return codecs_; }
+
+ private:
+ std::unique_ptr<DataEngineInterface> first_;
+ std::unique_ptr<DataEngineInterface> second_;
+ std::vector<DataCodec> codecs_;
+};
+
+} // namespace cricket
+
+#endif // WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698