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

Side by Side Diff: webrtc/media/base/hybriddataengine.h

Issue 2564333002: Reland of: Separating SCTP code from BaseChannel/MediaChannel. (Closed)
Patch Set: Merge with master. 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
12 #define WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
13
14 #include <memory>
15 #include <string>
16 #include <vector>
17
18 #include "webrtc/media/base/codec.h"
19 #include "webrtc/media/base/mediachannel.h"
20 #include "webrtc/media/base/mediaengine.h"
21
22 namespace cricket {
23
24 class HybridDataEngine : public DataEngineInterface {
25 public:
26 // Takes ownership.
27 HybridDataEngine(DataEngineInterface* first,
28 DataEngineInterface* second)
29 : first_(first),
30 second_(second) {
31 codecs_ = first_->data_codecs();
32 codecs_.insert(
33 codecs_.end(),
34 second_->data_codecs().begin(),
35 second_->data_codecs().end());
36 }
37
38 virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type,
39 const MediaConfig& config) {
40 DataMediaChannel* channel = NULL;
41 if (first_) {
42 channel = first_->CreateChannel(data_channel_type, config);
43 }
44 if (!channel && second_) {
45 channel = second_->CreateChannel(data_channel_type, config);
46 }
47 return channel;
48 }
49
50 virtual const std::vector<DataCodec>& data_codecs() { return codecs_; }
51
52 private:
53 std::unique_ptr<DataEngineInterface> first_;
54 std::unique_ptr<DataEngineInterface> second_;
55 std::vector<DataCodec> codecs_;
56 };
57
58 } // namespace cricket
59
60 #endif // WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
OLDNEW
« 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