| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 cricket::DataChannelType dct, | 107 cricket::DataChannelType dct, |
| 108 const std::string& label, | 108 const std::string& label, |
| 109 const InternalDataChannelInit& config); | 109 const InternalDataChannelInit& config); |
| 110 | 110 |
| 111 virtual void RegisterObserver(DataChannelObserver* observer); | 111 virtual void RegisterObserver(DataChannelObserver* observer); |
| 112 virtual void UnregisterObserver(); | 112 virtual void UnregisterObserver(); |
| 113 | 113 |
| 114 virtual std::string label() const { return label_; } | 114 virtual std::string label() const { return label_; } |
| 115 virtual bool reliable() const; | 115 virtual bool reliable() const; |
| 116 virtual bool ordered() const { return config_.ordered; } | 116 virtual bool ordered() const { return config_.ordered; } |
| 117 virtual uint16 maxRetransmitTime() const { | 117 virtual uint16_t maxRetransmitTime() const { |
| 118 return config_.maxRetransmitTime; | 118 return config_.maxRetransmitTime; |
| 119 } | 119 } |
| 120 virtual uint16 maxRetransmits() const { | 120 virtual uint16_t maxRetransmits() const { return config_.maxRetransmits; } |
| 121 return config_.maxRetransmits; | |
| 122 } | |
| 123 virtual std::string protocol() const { return config_.protocol; } | 121 virtual std::string protocol() const { return config_.protocol; } |
| 124 virtual bool negotiated() const { return config_.negotiated; } | 122 virtual bool negotiated() const { return config_.negotiated; } |
| 125 virtual int id() const { return config_.id; } | 123 virtual int id() const { return config_.id; } |
| 126 virtual uint64 buffered_amount() const; | 124 virtual uint64_t buffered_amount() const; |
| 127 virtual void Close(); | 125 virtual void Close(); |
| 128 virtual DataState state() const { return state_; } | 126 virtual DataState state() const { return state_; } |
| 129 virtual bool Send(const DataBuffer& buffer); | 127 virtual bool Send(const DataBuffer& buffer); |
| 130 | 128 |
| 131 // rtc::MessageHandler override. | 129 // rtc::MessageHandler override. |
| 132 virtual void OnMessage(rtc::Message* msg); | 130 virtual void OnMessage(rtc::Message* msg); |
| 133 | 131 |
| 134 // Called if the underlying data engine is closing. | 132 // Called if the underlying data engine is closing. |
| 135 void OnDataEngineClose(); | 133 void OnDataEngineClose(); |
| 136 | 134 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 153 // be called once. | 151 // be called once. |
| 154 void SetSctpSid(int sid); | 152 void SetSctpSid(int sid); |
| 155 // Called when the transport channel is created. | 153 // Called when the transport channel is created. |
| 156 void OnTransportChannelCreated(); | 154 void OnTransportChannelCreated(); |
| 157 | 155 |
| 158 // The following methods are for RTP only. | 156 // The following methods are for RTP only. |
| 159 | 157 |
| 160 // Set the SSRC this channel should use to send data on the | 158 // Set the SSRC this channel should use to send data on the |
| 161 // underlying data engine. |send_ssrc| == 0 means that the channel is no | 159 // underlying data engine. |send_ssrc| == 0 means that the channel is no |
| 162 // longer part of the session negotiation. | 160 // longer part of the session negotiation. |
| 163 void SetSendSsrc(uint32 send_ssrc); | 161 void SetSendSsrc(uint32_t send_ssrc); |
| 164 // Set the SSRC this channel should use to receive data from the | 162 // Set the SSRC this channel should use to receive data from the |
| 165 // underlying data engine. | 163 // underlying data engine. |
| 166 void SetReceiveSsrc(uint32 receive_ssrc); | 164 void SetReceiveSsrc(uint32_t receive_ssrc); |
| 167 | 165 |
| 168 cricket::DataChannelType data_channel_type() const { | 166 cricket::DataChannelType data_channel_type() const { |
| 169 return data_channel_type_; | 167 return data_channel_type_; |
| 170 } | 168 } |
| 171 | 169 |
| 172 protected: | 170 protected: |
| 173 DataChannel(DataChannelProviderInterface* client, | 171 DataChannel(DataChannelProviderInterface* client, |
| 174 cricket::DataChannelType dct, | 172 cricket::DataChannelType dct, |
| 175 const std::string& label); | 173 const std::string& label); |
| 176 virtual ~DataChannel(); | 174 virtual ~DataChannel(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 InternalDataChannelInit config_; | 231 InternalDataChannelInit config_; |
| 234 DataChannelObserver* observer_; | 232 DataChannelObserver* observer_; |
| 235 DataState state_; | 233 DataState state_; |
| 236 cricket::DataChannelType data_channel_type_; | 234 cricket::DataChannelType data_channel_type_; |
| 237 DataChannelProviderInterface* provider_; | 235 DataChannelProviderInterface* provider_; |
| 238 HandshakeState handshake_state_; | 236 HandshakeState handshake_state_; |
| 239 bool connected_to_provider_; | 237 bool connected_to_provider_; |
| 240 bool send_ssrc_set_; | 238 bool send_ssrc_set_; |
| 241 bool receive_ssrc_set_; | 239 bool receive_ssrc_set_; |
| 242 bool writable_; | 240 bool writable_; |
| 243 uint32 send_ssrc_; | 241 uint32_t send_ssrc_; |
| 244 uint32 receive_ssrc_; | 242 uint32_t receive_ssrc_; |
| 245 // Control messages that always have to get sent out before any queued | 243 // Control messages that always have to get sent out before any queued |
| 246 // data. | 244 // data. |
| 247 PacketQueue queued_control_data_; | 245 PacketQueue queued_control_data_; |
| 248 PacketQueue queued_received_data_; | 246 PacketQueue queued_received_data_; |
| 249 PacketQueue queued_send_data_; | 247 PacketQueue queued_send_data_; |
| 250 }; | 248 }; |
| 251 | 249 |
| 252 class DataChannelFactory { | 250 class DataChannelFactory { |
| 253 public: | 251 public: |
| 254 virtual rtc::scoped_refptr<DataChannel> CreateDataChannel( | 252 virtual rtc::scoped_refptr<DataChannel> CreateDataChannel( |
| 255 const std::string& label, | 253 const std::string& label, |
| 256 const InternalDataChannelInit* config) = 0; | 254 const InternalDataChannelInit* config) = 0; |
| 257 | 255 |
| 258 protected: | 256 protected: |
| 259 virtual ~DataChannelFactory() {} | 257 virtual ~DataChannelFactory() {} |
| 260 }; | 258 }; |
| 261 | 259 |
| 262 // Define proxy for DataChannelInterface. | 260 // Define proxy for DataChannelInterface. |
| 263 BEGIN_PROXY_MAP(DataChannel) | 261 BEGIN_PROXY_MAP(DataChannel) |
| 264 PROXY_METHOD1(void, RegisterObserver, DataChannelObserver*) | 262 PROXY_METHOD1(void, RegisterObserver, DataChannelObserver*) |
| 265 PROXY_METHOD0(void, UnregisterObserver) | 263 PROXY_METHOD0(void, UnregisterObserver) |
| 266 PROXY_CONSTMETHOD0(std::string, label) | 264 PROXY_CONSTMETHOD0(std::string, label) |
| 267 PROXY_CONSTMETHOD0(bool, reliable) | 265 PROXY_CONSTMETHOD0(bool, reliable) |
| 268 PROXY_CONSTMETHOD0(bool, ordered) | 266 PROXY_CONSTMETHOD0(bool, ordered) |
| 269 PROXY_CONSTMETHOD0(uint16, maxRetransmitTime) | 267 PROXY_CONSTMETHOD0(uint16_t, maxRetransmitTime) |
| 270 PROXY_CONSTMETHOD0(uint16, maxRetransmits) | 268 PROXY_CONSTMETHOD0(uint16_t, maxRetransmits) |
| 271 PROXY_CONSTMETHOD0(std::string, protocol) | 269 PROXY_CONSTMETHOD0(std::string, protocol) |
| 272 PROXY_CONSTMETHOD0(bool, negotiated) | 270 PROXY_CONSTMETHOD0(bool, negotiated) |
| 273 PROXY_CONSTMETHOD0(int, id) | 271 PROXY_CONSTMETHOD0(int, id) |
| 274 PROXY_CONSTMETHOD0(DataState, state) | 272 PROXY_CONSTMETHOD0(DataState, state) |
| 275 PROXY_CONSTMETHOD0(uint64, buffered_amount) | 273 PROXY_CONSTMETHOD0(uint64_t, buffered_amount) |
| 276 PROXY_METHOD0(void, Close) | 274 PROXY_METHOD0(void, Close) |
| 277 PROXY_METHOD1(bool, Send, const DataBuffer&) | 275 PROXY_METHOD1(bool, Send, const DataBuffer&) |
| 278 END_PROXY() | 276 END_PROXY() |
| 279 | 277 |
| 280 } // namespace webrtc | 278 } // namespace webrtc |
| 281 | 279 |
| 282 #endif // TALK_APP_WEBRTC_DATACHANNEL_H_ | 280 #endif // TALK_APP_WEBRTC_DATACHANNEL_H_ |
| OLD | NEW |