| 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 |
| 11 #ifndef WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ | 11 #ifndef WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ |
| 12 #define WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ | 12 #define WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "webrtc/base/timing.h" | 18 #include "webrtc/base/timing.h" |
| 18 #include "webrtc/media/base/constants.h" | 19 #include "webrtc/media/base/constants.h" |
| 19 #include "webrtc/media/base/mediachannel.h" | 20 #include "webrtc/media/base/mediachannel.h" |
| 20 #include "webrtc/media/base/mediaengine.h" | 21 #include "webrtc/media/base/mediaengine.h" |
| 21 | 22 |
| 22 namespace cricket { | 23 namespace cricket { |
| 23 | 24 |
| 24 struct DataCodec; | 25 struct DataCodec; |
| 25 | 26 |
| 26 class RtpDataEngine : public DataEngineInterface { | 27 class RtpDataEngine : public DataEngineInterface { |
| 27 public: | 28 public: |
| 28 RtpDataEngine(); | 29 RtpDataEngine(); |
| 29 | 30 |
| 30 virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type); | 31 virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type); |
| 31 | 32 |
| 32 virtual const std::vector<DataCodec>& data_codecs() { | 33 virtual const std::vector<DataCodec>& data_codecs() { |
| 33 return data_codecs_; | 34 return data_codecs_; |
| 34 } | 35 } |
| 35 | 36 |
| 36 // Mostly for testing with a fake clock. Ownership is passed in. | 37 // Mostly for testing with a fake clock. Ownership is passed in. |
| 37 void SetTiming(rtc::Timing* timing) { | 38 void SetTiming(rtc::Timing* timing) { |
| 38 timing_.reset(timing); | 39 timing_.reset(timing); |
| 39 } | 40 } |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 std::vector<DataCodec> data_codecs_; | 43 std::vector<DataCodec> data_codecs_; |
| 43 rtc::scoped_ptr<rtc::Timing> timing_; | 44 std::unique_ptr<rtc::Timing> timing_; |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // Keep track of sequence number and timestamp of an RTP stream. The | 47 // Keep track of sequence number and timestamp of an RTP stream. The |
| 47 // sequence number starts with a "random" value and increments. The | 48 // sequence number starts with a "random" value and increments. The |
| 48 // timestamp starts with a "random" value and increases monotonically | 49 // timestamp starts with a "random" value and increases monotonically |
| 49 // according to the clockrate. | 50 // according to the clockrate. |
| 50 class RtpClock { | 51 class RtpClock { |
| 51 public: | 52 public: |
| 52 RtpClock(int clockrate, uint16_t first_seq_num, uint32_t timestamp_offset) | 53 RtpClock(int clockrate, uint16_t first_seq_num, uint32_t timestamp_offset) |
| 53 : clockrate_(clockrate), | 54 : clockrate_(clockrate), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 bool SetRecvCodecs(const std::vector<DataCodec>& codecs); | 110 bool SetRecvCodecs(const std::vector<DataCodec>& codecs); |
| 110 | 111 |
| 111 bool sending_; | 112 bool sending_; |
| 112 bool receiving_; | 113 bool receiving_; |
| 113 rtc::Timing* timing_; | 114 rtc::Timing* timing_; |
| 114 std::vector<DataCodec> send_codecs_; | 115 std::vector<DataCodec> send_codecs_; |
| 115 std::vector<DataCodec> recv_codecs_; | 116 std::vector<DataCodec> recv_codecs_; |
| 116 std::vector<StreamParams> send_streams_; | 117 std::vector<StreamParams> send_streams_; |
| 117 std::vector<StreamParams> recv_streams_; | 118 std::vector<StreamParams> recv_streams_; |
| 118 std::map<uint32_t, RtpClock*> rtp_clock_by_send_ssrc_; | 119 std::map<uint32_t, RtpClock*> rtp_clock_by_send_ssrc_; |
| 119 rtc::scoped_ptr<rtc::RateLimiter> send_limiter_; | 120 std::unique_ptr<rtc::RateLimiter> send_limiter_; |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace cricket | 123 } // namespace cricket |
| 123 | 124 |
| 124 #endif // WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ | 125 #endif // WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ |
| OLD | NEW |