refactored RTCEngine
This commit is contained in:
@@ -24,7 +24,7 @@ void DataChannel::unregister_observer() {
|
||||
data_channel_->UnregisterObserver();
|
||||
}
|
||||
|
||||
bool DataChannel::send(const DataBuffer& buffer) {
|
||||
bool DataChannel::send(const DataBuffer& buffer) const {
|
||||
return data_channel_->Send(webrtc::DataBuffer{
|
||||
rtc::CopyOnWriteBuffer(buffer.ptr, buffer.len), buffer.binary});
|
||||
}
|
||||
@@ -37,7 +37,7 @@ DataState DataChannel::state() const {
|
||||
return static_cast<DataState>(data_channel_->state());
|
||||
}
|
||||
|
||||
void DataChannel::close() {
|
||||
void DataChannel::close() const {
|
||||
return data_channel_->Close();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@ pub mod ffi {
|
||||
);
|
||||
|
||||
fn unregister_observer(self: Pin<&mut DataChannel>);
|
||||
fn send(self: Pin<&mut DataChannel>, data: &DataBuffer) -> bool;
|
||||
fn send(self: &DataChannel, data: &DataBuffer) -> bool;
|
||||
fn label(self: &DataChannel) -> String;
|
||||
fn state(self: &DataChannel) -> DataState;
|
||||
fn close(self: Pin<&mut DataChannel>);
|
||||
fn close(self: &DataChannel);
|
||||
|
||||
fn create_data_channel_init(init: DataChannelInit) -> UniquePtr<NativeDataChannelInit>;
|
||||
fn create_native_data_channel_observer(
|
||||
|
||||
Reference in New Issue
Block a user