| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 DataEngineInterface* second) | 28 DataEngineInterface* second) |
| 29 : first_(first), | 29 : first_(first), |
| 30 second_(second) { | 30 second_(second) { |
| 31 codecs_ = first_->data_codecs(); | 31 codecs_ = first_->data_codecs(); |
| 32 codecs_.insert( | 32 codecs_.insert( |
| 33 codecs_.end(), | 33 codecs_.end(), |
| 34 second_->data_codecs().begin(), | 34 second_->data_codecs().begin(), |
| 35 second_->data_codecs().end()); | 35 second_->data_codecs().end()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type) { | 38 virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type, |
| 39 const MediaConfig& config) { |
| 39 DataMediaChannel* channel = NULL; | 40 DataMediaChannel* channel = NULL; |
| 40 if (first_) { | 41 if (first_) { |
| 41 channel = first_->CreateChannel(data_channel_type); | 42 channel = first_->CreateChannel(data_channel_type, config); |
| 42 } | 43 } |
| 43 if (!channel && second_) { | 44 if (!channel && second_) { |
| 44 channel = second_->CreateChannel(data_channel_type); | 45 channel = second_->CreateChannel(data_channel_type, config); |
| 45 } | 46 } |
| 46 return channel; | 47 return channel; |
| 47 } | 48 } |
| 48 | 49 |
| 49 virtual const std::vector<DataCodec>& data_codecs() { return codecs_; } | 50 virtual const std::vector<DataCodec>& data_codecs() { return codecs_; } |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 std::unique_ptr<DataEngineInterface> first_; | 53 std::unique_ptr<DataEngineInterface> first_; |
| 53 std::unique_ptr<DataEngineInterface> second_; | 54 std::unique_ptr<DataEngineInterface> second_; |
| 54 std::vector<DataCodec> codecs_; | 55 std::vector<DataCodec> codecs_; |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace cricket | 58 } // namespace cricket |
| 58 | 59 |
| 59 #endif // WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_ | 60 #endif // WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_ |
| OLD | NEW |