forked from strfry/qwebrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqwebrtcdatachannel_p.hpp
32 lines (25 loc) · 1.09 KB
/
qwebrtcdatachannel_p.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "qwebrtcdatachannel.hpp"
#include "api/datachannelinterface.h"
class QWebRTCDataChannel_impl : public QWebRTCDataChannel, public webrtc::DataChannelObserver {
Q_OBJECT
public:
virtual bool sendData(const QString&) override;
virtual bool sendData(const QByteArray&) override;
virtual void close() override;
virtual QString label() override;
virtual bool isReliable() override;
virtual QString protocol() override;
virtual bool isNegotiated() override;
virtual ChannelState channelState() override;
virtual uint64_t bufferedAmount() override;
explicit QWebRTCDataChannel_impl(rtc::scoped_refptr<webrtc::DataChannelInterface> nativeDC);
~QWebRTCDataChannel_impl();
virtual void OnStateChange() override;
// A data buffer was successfully received.
virtual void OnMessage(const webrtc::DataBuffer& buffer) override;
// The data channel's buffered_amount has changed.
virtual void OnBufferedAmountChange(uint64_t previous_amount) override;
private:
rtc::scoped_refptr<webrtc::DataChannelInterface> m_nativeDataChannel;
};