Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
bf7a3973
Unverified
提交
bf7a3973
authored
2月 05, 2024
作者:
Paul Olteanu
提交者:
GitHub
2月 05, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Send and Sync to dyn Errors (#1329)
上级
482afa44
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
158 行增加
和
134 行删除
+158
-134
messages.rs
rust/src/messages.rs
+73
-73
ortc.rs
rust/src/ortc.rs
+3
-3
consumer.rs
rust/src/router/consumer.rs
+13
-7
data_consumer.rs
rust/src/router/data_consumer.rs
+3
-1
data_producer.rs
rust/src/router/data_producer.rs
+3
-1
direct_transport.rs
rust/src/router/direct_transport.rs
+10
-8
pipe_transport.rs
rust/src/router/pipe_transport.rs
+10
-8
plain_transport.rs
rust/src/router/plain_transport.rs
+10
-8
producer.rs
rust/src/router/producer.rs
+5
-3
transport.rs
rust/src/router/transport.rs
+10
-6
webrtc_transport.rs
rust/src/router/webrtc_transport.rs
+10
-8
rtp_parameters.rs
rust/src/rtp_parameters.rs
+7
-7
worker.rs
rust/src/worker.rs
+1
-1
没有找到文件。
rust/src/messages.rs
浏览文件 @
bf7a3973
...
...
@@ -64,7 +64,7 @@ where
/// Convert generic response into specific type of this request.
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
;
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
;
}
pub
(
crate
)
trait
Notification
:
Debug
{
...
...
@@ -102,7 +102,7 @@ impl Request for WorkerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -133,7 +133,7 @@ impl Request for WorkerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
WorkerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -215,7 +215,7 @@ impl Request for WorkerUpdateSettingsRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -255,7 +255,7 @@ impl Request for WorkerCreateWebRtcServerRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -294,7 +294,7 @@ impl Request for WebRtcServerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -325,7 +325,7 @@ impl Request for WebRtcServerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
WebRtcServerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -407,7 +407,7 @@ impl Request for WorkerCreateRouterRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -442,7 +442,7 @@ impl Request for RouterCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -473,7 +473,7 @@ impl Request for RouterDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
RouterDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -486,12 +486,12 @@ impl Request for RouterDumpRequest {
.map_consumer_id_producer_id
.into_iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
.parse
()
?
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_data_consumer_id_data_producer_id
:
data
.map_data_consumer_id_data_producer_id
.into_iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
.parse
()
?
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_data_producer_id_data_consumer_ids
:
data
.map_data_producer_id_data_consumer_ids
.into_iter
()
...
...
@@ -505,7 +505,7 @@ impl Request for RouterDumpRequest {
.collect
::
<
Result
<
_
,
_
>>
()
?
,
))
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_producer_id_consumer_ids
:
data
.map_producer_id_consumer_ids
.into_iter
()
...
...
@@ -519,7 +519,7 @@ impl Request for RouterDumpRequest {
.collect
::
<
Result
<
_
,
_
>>
()
?
,
))
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_producer_id_observer_ids
:
data
.map_producer_id_observer_ids
.into_iter
()
...
...
@@ -533,7 +533,7 @@ impl Request for RouterDumpRequest {
.collect
::
<
Result
<
_
,
_
>>
()
?
,
))
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
rtp_observer_ids
:
data
.rtp_observer_ids
.into_iter
()
...
...
@@ -618,7 +618,7 @@ impl Request for RouterCreateDirectTransportRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -784,7 +784,7 @@ impl Request for RouterCreateWebRtcTransportRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
WebRtcTransportDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -861,7 +861,7 @@ impl Request for RouterCreateWebRtcTransportWithServerRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
WebRtcTransportDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -994,7 +994,7 @@ impl Request for RouterCreatePlainTransportRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
PlainTransportDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1120,7 +1120,7 @@ impl Request for RouterCreatePipeTransportRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
PipeTransportDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1221,7 +1221,7 @@ impl Request for RouterCreateAudioLevelObserverRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1286,7 +1286,7 @@ impl Request for RouterCreateActiveSpeakerObserverRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1317,7 +1317,7 @@ impl Request for TransportDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -1352,7 +1352,7 @@ impl Request for TransportGetStatsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -1393,7 +1393,7 @@ impl Request for TransportCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1434,7 +1434,7 @@ impl Request for WebRtcTransportConnectRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
WebRtcTransportConnectResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1488,7 +1488,7 @@ impl Request for PipeTransportConnectRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
PipeTransportConnectResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1547,7 +1547,7 @@ impl Request for TransportConnectPlainRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
PlainTransportConnectResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1597,7 +1597,7 @@ impl Request for TransportSetMaxIncomingBitrateRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1633,7 +1633,7 @@ impl Request for TransportSetMaxOutgoingBitrateRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1669,7 +1669,7 @@ impl Request for TransportSetMinOutgoingBitrateRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -1699,7 +1699,7 @@ impl Request for TransportRestartIceRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
TransportRestartIceResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1761,7 +1761,7 @@ impl Request for TransportProduceRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
TransportProduceResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1833,7 +1833,7 @@ impl Request for TransportConsumeRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
TransportConsumeResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -1915,7 +1915,7 @@ impl Request for TransportProduceDataRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataProducerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2006,7 +2006,7 @@ impl Request for TransportConsumeDataRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataConsumerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2067,7 +2067,7 @@ impl Request for TransportEnableTraceEventRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
...
...
@@ -2138,7 +2138,7 @@ impl Request for ProducerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2169,7 +2169,7 @@ impl Request for ProducerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
ProducerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2204,7 +2204,7 @@ impl Request for ProducerGetStatsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -2240,7 +2240,7 @@ impl Request for ProducerPauseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2271,7 +2271,7 @@ impl Request for ProducerResumeRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2313,7 +2313,7 @@ impl Request for ProducerEnableTraceEventRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
...
...
@@ -2384,7 +2384,7 @@ impl Request for ConsumerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2415,7 +2415,7 @@ impl Request for ConsumerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
ConsumerDumpResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2450,7 +2450,7 @@ impl Request for ConsumerGetStatsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -2486,7 +2486,7 @@ impl Request for ConsumerPauseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2517,7 +2517,7 @@ impl Request for ConsumerResumeRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2557,7 +2557,7 @@ impl Request for ConsumerSetPreferredLayersRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
ConsumerSetPreferredLayersResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2607,7 +2607,7 @@ impl Request for ConsumerSetPriorityRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
ConsumerSetPriorityResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -2645,7 +2645,7 @@ impl Request for ConsumerRequestKeyFrameRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2687,7 +2687,7 @@ impl Request for ConsumerEnableTraceEventRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
...
...
@@ -2730,7 +2730,7 @@ impl Request for DataProducerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2761,7 +2761,7 @@ impl Request for DataProducerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -2797,7 +2797,7 @@ impl Request for DataProducerGetStatsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -2833,7 +2833,7 @@ impl Request for DataProducerPauseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2864,7 +2864,7 @@ impl Request for DataProducerResumeRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2941,7 +2941,7 @@ impl Request for DataConsumerCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -2972,7 +2972,7 @@ impl Request for DataConsumerDumpRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -3008,7 +3008,7 @@ impl Request for DataConsumerGetStatsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
match
response
{
Some
(
data
)
=>
Ok
(
data
.try_into
()
.unwrap
()),
_
=>
{
...
...
@@ -3044,7 +3044,7 @@ impl Request for DataConsumerPauseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3075,7 +3075,7 @@ impl Request for DataConsumerResumeRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3111,7 +3111,7 @@ impl Request for DataConsumerGetBufferedAmountRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataConsumerGetBufferedAmountResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -3162,7 +3162,7 @@ impl Request for DataConsumerSetBufferedAmountLowThresholdRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3200,7 +3200,7 @@ impl Request for DataConsumerSendRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3248,7 +3248,7 @@ impl Request for DataConsumerSetSubchannelsRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataConsumerSetSubchannelsResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -3298,7 +3298,7 @@ impl Request for DataConsumerAddSubchannelRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataConsumerAddSubchannelResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -3348,7 +3348,7 @@ impl Request for DataConsumerRemoveSubchannelRequest {
fn
convert_response
(
response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
Some
(
response
::
BodyRef
::
DataConsumerRemoveSubchannelResponse
(
data
))
=
response
else
{
panic!
(
"Wrong message from worker: {response:?}"
);
};
...
...
@@ -3393,7 +3393,7 @@ impl Request for RtpObserverCloseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3423,7 +3423,7 @@ impl Request for RtpObserverPauseRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3453,7 +3453,7 @@ impl Request for RtpObserverResumeRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3492,7 +3492,7 @@ impl Request for RtpObserverAddProducerRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
...
...
@@ -3531,7 +3531,7 @@ impl Request for RtpObserverRemoveProducerRequest {
fn
convert_response
(
_response
:
Option
<
response
::
BodyRef
<
'_
>>
,
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
::
Response
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(())
}
}
rust/src/ortc.rs
浏览文件 @
bf7a3973
...
...
@@ -80,7 +80,7 @@ impl RtpMapping {
pub
(
crate
)
fn
from_fbs_ref
(
mapping
:
rtp_parameters
::
RtpMappingRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
codecs
:
mapping
.codecs
()
?
...
...
@@ -91,7 +91,7 @@ impl RtpMapping {
mapped_payload_type
:
mapping
?
.mapped_payload_type
()
?
,
})
})
.collect
::
<
Result
<
Vec
<
_
>
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
Vec
<
_
>
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
encodings
:
mapping
.encodings
()
?
.iter
()
...
...
@@ -107,7 +107,7 @@ impl RtpMapping {
mapped_ssrc
:
mapping
?
.mapped_ssrc
()
?
,
})
})
.collect
::
<
Result
<
Vec
<
_
>
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
Vec
<
_
>
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
})
}
}
...
...
rust/src/router/consumer.rs
浏览文件 @
bf7a3973
...
...
@@ -163,7 +163,9 @@ pub struct RtpStreamParams {
}
impl
RtpStreamParams
{
pub
(
crate
)
fn
from_fbs_ref
(
params
:
rtp_stream
::
ParamsRef
<
'_
>
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs_ref
(
params
:
rtp_stream
::
ParamsRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
clock_rate
:
params
.clock_rate
()
?
,
cname
:
params
.cname
()
?
.to_string
(),
...
...
@@ -197,7 +199,9 @@ pub struct RtxStreamParams {
}
impl
RtxStreamParams
{
pub
(
crate
)
fn
from_fbs_ref
(
params
:
rtx_stream
::
ParamsRef
<
'_
>
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs_ref
(
params
:
rtx_stream
::
ParamsRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
clock_rate
:
params
.clock_rate
()
?
,
cname
:
params
.cname
()
?
.to_string
(),
...
...
@@ -218,7 +222,9 @@ pub struct RtpStream {
}
impl
RtpStream
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
rtp_stream
::
DumpRef
<
'_
>
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
rtp_stream
::
DumpRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
params
:
RtpStreamParams
::
from_fbs_ref
(
dump
.params
()
?
)
?
,
score
:
dump
.score
()
?
,
...
...
@@ -267,7 +273,7 @@ pub struct ConsumerDump {
impl
ConsumerDump
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
consumer
::
DumpResponseRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
let
dump
=
dump
.data
();
Ok
(
Self
{
...
...
@@ -286,7 +292,7 @@ impl ConsumerDump {
.trace_event_types
()
?
.iter
()
.map
(|
trace_event_type
|
Ok
(
ConsumerTraceEventType
::
from_fbs
(
trace_event_type
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
r
#
type
:
ConsumerType
::
from_fbs
(
dump
?
.base
()
?
.type_
()
?
),
consumable_rtp_encodings
:
dump
?
.base
()
?
...
...
@@ -295,12 +301,12 @@ impl ConsumerDump {
.map
(|
encoding_parameters
|
{
RtpEncodingParameters
::
from_fbs_ref
(
encoding_parameters
?
)
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
rtp_streams
:
dump
?
.rtp_streams
()
?
.iter
()
.map
(|
stream
|
RtpStream
::
from_fbs_ref
(
stream
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
preferred_spatial_layer
:
dump
?
.preferred_spatial_layer
()
?
,
target_spatial_layer
:
dump
?
.target_spatial_layer
()
?
,
current_spatial_layer
:
dump
?
.current_spatial_layer
()
?
,
...
...
rust/src/router/data_consumer.rs
浏览文件 @
bf7a3973
...
...
@@ -163,7 +163,9 @@ pub struct DataConsumerDump {
}
impl
DataConsumerDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
data_consumer
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
data_consumer
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
id
:
dump
.id
.parse
()
?
,
data_producer_id
:
dump
.data_producer_id
.parse
()
?
,
...
...
rust/src/router/data_producer.rs
浏览文件 @
bf7a3973
...
...
@@ -116,7 +116,9 @@ pub struct DataProducerDump {
}
impl
DataProducerDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
data_producer
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
data_producer
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
id
:
dump
.id
.parse
()
?
,
r
#
type
:
if
dump
.type_
==
data_producer
::
Type
::
Sctp
{
...
...
rust/src/router/direct_transport.rs
浏览文件 @
bf7a3973
...
...
@@ -75,7 +75,9 @@ pub struct DirectTransportDump {
}
impl
DirectTransportDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
direct_transport
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
direct_transport
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
id
:
dump
.base.id
.parse
()
?
,
direct
:
true
,
...
...
@@ -84,37 +86,37 @@ impl DirectTransportDump {
.producer_ids
.iter
()
.map
(|
producer_id
|
Ok
(
producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
consumer_ids
:
dump
.base
.consumer_ids
.iter
()
.map
(|
consumer_id
|
Ok
(
consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_ssrc_consumer_id
:
dump
.base
.map_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_rtx_ssrc_consumer_id
:
dump
.base
.map_rtx_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_producer_ids
:
dump
.base
.data_producer_ids
.iter
()
.map
(|
data_producer_id
|
Ok
(
data_producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_consumer_ids
:
dump
.base
.data_consumer_ids
.iter
()
.map
(|
data_consumer_id
|
Ok
(
data_consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
recv_rtp_header_extensions
:
RecvRtpHeaderExtensions
::
from_fbs
(
dump
.base.recv_rtp_header_extensions
.as_ref
(),
),
...
...
@@ -182,7 +184,7 @@ pub struct DirectTransportStat {
impl
DirectTransportStat
{
pub
(
crate
)
fn
from_fbs
(
stats
:
direct_transport
::
GetStatsResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
transport_id
:
stats
.base.transport_id
.parse
()
?
,
timestamp
:
stats
.base.timestamp
,
...
...
rust/src/router/pipe_transport.rs
浏览文件 @
bf7a3973
...
...
@@ -106,7 +106,9 @@ pub struct PipeTransportDump {
}
impl
PipeTransportDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
pipe_transport
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
pipe_transport
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
// Common to all Transports.
id
:
dump
.base.id
.parse
()
?
,
...
...
@@ -116,37 +118,37 @@ impl PipeTransportDump {
.producer_ids
.iter
()
.map
(|
producer_id
|
Ok
(
producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
consumer_ids
:
dump
.base
.consumer_ids
.iter
()
.map
(|
consumer_id
|
Ok
(
consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_ssrc_consumer_id
:
dump
.base
.map_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_rtx_ssrc_consumer_id
:
dump
.base
.map_rtx_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_producer_ids
:
dump
.base
.data_producer_ids
.iter
()
.map
(|
data_producer_id
|
Ok
(
data_producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_consumer_ids
:
dump
.base
.data_consumer_ids
.iter
()
.map
(|
data_consumer_id
|
Ok
(
data_consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
recv_rtp_header_extensions
:
RecvRtpHeaderExtensions
::
from_fbs
(
dump
.base.recv_rtp_header_extensions
.as_ref
(),
),
...
...
@@ -223,7 +225,7 @@ pub struct PipeTransportStat {
impl
PipeTransportStat
{
pub
(
crate
)
fn
from_fbs
(
stats
:
pipe_transport
::
GetStatsResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
transport_id
:
stats
.base.transport_id
.parse
()
?
,
timestamp
:
stats
.base.timestamp
,
...
...
rust/src/router/plain_transport.rs
浏览文件 @
bf7a3973
...
...
@@ -127,7 +127,9 @@ pub struct PlainTransportDump {
}
impl
PlainTransportDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
plain_transport
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
plain_transport
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
// Common to all Transports.
id
:
dump
.base.id
.parse
()
?
,
...
...
@@ -137,37 +139,37 @@ impl PlainTransportDump {
.producer_ids
.iter
()
.map
(|
producer_id
|
Ok
(
producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
consumer_ids
:
dump
.base
.consumer_ids
.iter
()
.map
(|
consumer_id
|
Ok
(
consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_ssrc_consumer_id
:
dump
.base
.map_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_rtx_ssrc_consumer_id
:
dump
.base
.map_rtx_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_producer_ids
:
dump
.base
.data_producer_ids
.iter
()
.map
(|
data_producer_id
|
Ok
(
data_producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_consumer_ids
:
dump
.base
.data_consumer_ids
.iter
()
.map
(|
data_consumer_id
|
Ok
(
data_consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
recv_rtp_header_extensions
:
RecvRtpHeaderExtensions
::
from_fbs
(
dump
.base.recv_rtp_header_extensions
.as_ref
(),
),
...
...
@@ -251,7 +253,7 @@ pub struct PlainTransportStat {
impl
PlainTransportStat
{
pub
(
crate
)
fn
from_fbs
(
stats
:
plain_transport
::
GetStatsResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
transport_id
:
stats
.base.transport_id
.parse
()
?
,
timestamp
:
stats
.base.timestamp
,
...
...
rust/src/router/producer.rs
浏览文件 @
bf7a3973
...
...
@@ -108,7 +108,9 @@ pub struct RtpStreamRecv {
}
impl
RtpStreamRecv
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
rtp_stream
::
DumpRef
<
'_
>
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
rtp_stream
::
DumpRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
params
:
RtpStreamParams
::
from_fbs_ref
(
dump
.params
()
?
)
?
,
score
:
dump
.score
()
?
,
...
...
@@ -141,7 +143,7 @@ pub struct ProducerDump {
impl
ProducerDump
{
pub
(
crate
)
fn
from_fbs_ref
(
dump
:
producer
::
DumpResponseRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
id
:
dump
.id
()
?
.parse
()
?
,
kind
:
MediaKind
::
from_fbs
(
dump
.kind
()
?
),
...
...
@@ -152,7 +154,7 @@ impl ProducerDump {
.rtp_streams
()
?
.iter
()
.map
(|
rtp_stream
|
RtpStreamRecv
::
from_fbs_ref
(
rtp_stream
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
trace_event_types
:
dump
.trace_event_types
()
?
.iter
()
...
...
rust/src/router/transport.rs
浏览文件 @
bf7a3973
...
...
@@ -122,23 +122,25 @@ pub struct RtpListener {
}
impl
RtpListener
{
pub
(
crate
)
fn
from_fbs
(
rtp_listener
:
&
transport
::
RtpListener
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
rtp_listener
:
&
transport
::
RtpListener
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
mid_table
:
rtp_listener
.mid_table
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
.to_string
(),
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
rid_table
:
rtp_listener
.rid_table
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
.to_string
(),
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
ssrc_table
:
rtp_listener
.ssrc_table
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
})
}
}
...
...
@@ -175,13 +177,15 @@ pub struct SctpListener {
}
impl
SctpListener
{
pub
(
crate
)
fn
from_fbs
(
listener
:
&
transport
::
SctpListener
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
listener
:
&
transport
::
SctpListener
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
stream_id_table
:
listener
.stream_id_table
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
})
}
}
...
...
rust/src/router/webrtc_transport.rs
浏览文件 @
bf7a3973
...
...
@@ -213,7 +213,9 @@ pub struct WebRtcTransportDump {
}
impl
WebRtcTransportDump
{
pub
(
crate
)
fn
from_fbs
(
dump
:
web_rtc_transport
::
DumpResponse
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
pub
(
crate
)
fn
from_fbs
(
dump
:
web_rtc_transport
::
DumpResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
// Common to all Transports.
id
:
dump
.base.id
.parse
()
?
,
...
...
@@ -223,37 +225,37 @@ impl WebRtcTransportDump {
.producer_ids
.iter
()
.map
(|
producer_id
|
Ok
(
producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
consumer_ids
:
dump
.base
.consumer_ids
.iter
()
.map
(|
consumer_id
|
Ok
(
consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_ssrc_consumer_id
:
dump
.base
.map_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
map_rtx_ssrc_consumer_id
:
dump
.base
.map_rtx_ssrc_consumer_id
.iter
()
.map
(|
key_value
|
Ok
((
key_value
.key
,
key_value
.value
.parse
()
?
)))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_producer_ids
:
dump
.base
.data_producer_ids
.iter
()
.map
(|
data_producer_id
|
Ok
(
data_producer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
data_consumer_ids
:
dump
.base
.data_consumer_ids
.iter
()
.map
(|
data_consumer_id
|
Ok
(
data_consumer_id
.parse
()
?
))
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
recv_rtp_header_extensions
:
RecvRtpHeaderExtensions
::
from_fbs
(
dump
.base.recv_rtp_header_extensions
.as_ref
(),
),
...
...
@@ -342,7 +344,7 @@ pub struct WebRtcTransportStat {
impl
WebRtcTransportStat
{
pub
(
crate
)
fn
from_fbs
(
stats
:
web_rtc_transport
::
GetStatsResponse
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
transport_id
:
stats
.base.transport_id
.parse
()
?
,
timestamp
:
stats
.base.timestamp
,
...
...
rust/src/rtp_parameters.rs
浏览文件 @
bf7a3973
...
...
@@ -789,7 +789,7 @@ pub struct RtpParameters {
impl
RtpParameters
{
pub
(
crate
)
fn
from_fbs_ref
(
rtp_parameters
:
rtp_parameters
::
RtpParametersRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
mid
:
rtp_parameters
.mid
()
?
.map
(|
mid
|
mid
.to_string
()),
codecs
:
rtp_parameters
...
...
@@ -824,7 +824,7 @@ impl RtpParameters {
},
))
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
;
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
;
let
rtcp_feedback
=
codec
?
.rtcp_feedback
()
?
.unwrap_or
(
planus
::
Vector
::
new_empty
())
...
...
@@ -835,7 +835,7 @@ impl RtpParameters {
rtcp_feedback
?
.parameter
()
?
.unwrap_or_default
(),
)
?
)
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
;
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
;
Ok
(
match
MimeType
::
from_str
(
codec
?
.mime_type
()
?
)
?
{
MimeType
::
Audio
(
mime_type
)
=>
RtpCodecParameters
::
Audio
{
...
...
@@ -858,7 +858,7 @@ impl RtpParameters {
},
})
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
header_extensions
:
rtp_parameters
.header_extensions
()
?
.into_iter
()
...
...
@@ -869,7 +869,7 @@ impl RtpParameters {
encrypt
:
header_extension_parameters
?
.encrypt
()
?
,
})
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
encodings
:
rtp_parameters
.encodings
()
?
.into_iter
()
...
...
@@ -894,7 +894,7 @@ impl RtpParameters {
max_bitrate
:
encoding
?
.max_bitrate
()
?
,
})
})
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
>>>
()
?
,
.collect
::
<
Result
<
_
,
Box
<
dyn
Error
+
Send
+
Sync
>>>
()
?
,
rtcp
:
RtcpParameters
{
cname
:
rtp_parameters
.rtcp
()
?
...
...
@@ -1310,7 +1310,7 @@ impl RtpEncodingParameters {
pub
(
crate
)
fn
from_fbs_ref
(
encoding_parameters
:
rtp_parameters
::
RtpEncodingParametersRef
<
'_
>
,
)
->
Result
<
Self
,
Box
<
dyn
Error
>>
{
)
->
Result
<
Self
,
Box
<
dyn
Error
+
Send
+
Sync
>>
{
Ok
(
Self
{
ssrc
:
encoding_parameters
.ssrc
()
?
,
rid
:
encoding_parameters
.rid
()
?
.map
(|
rid
|
rid
.to_string
()),
...
...
rust/src/worker.rs
浏览文件 @
bf7a3973
...
...
@@ -67,7 +67,7 @@ pub enum RequestError {
NoData
,
/// Response conversion error.
#[error(
"Response conversion error: {0}"
)]
ResponseConversion
(
Box
<
dyn
Error
>
),
ResponseConversion
(
Box
<
dyn
Error
+
Send
+
Sync
>
),
}
/// Logging level for logs generated by the media worker thread (check the
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论