Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
09cd482d
提交
09cd482d
authored
8月 17, 2022
作者:
Nazar Mokrynskyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix clippy suggestions from latest release
上级
e37dad53
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
38 行增加
和
22 行删除
+38
-22
data_structures.rs
rust/src/data_structures.rs
+2
-2
router.rs
rust/src/router.rs
+1
-0
active_speaker_observer.rs
rust/src/router/active_speaker_observer.rs
+1
-0
audio_level_observer.rs
rust/src/router/audio_level_observer.rs
+1
-0
consumer.rs
rust/src/router/consumer.rs
+4
-3
data_consumer.rs
rust/src/router/data_consumer.rs
+3
-2
data_producer.rs
rust/src/router/data_producer.rs
+3
-2
direct_transport.rs
rust/src/router/direct_transport.rs
+2
-1
pipe_transport.rs
rust/src/router/pipe_transport.rs
+2
-1
plain_transport.rs
rust/src/router/plain_transport.rs
+2
-1
tests.rs
rust/src/router/plain_transport/tests.rs
+2
-4
producer.rs
rust/src/router/producer.rs
+2
-1
transport.rs
rust/src/router/transport.rs
+2
-2
webrtc_transport.rs
rust/src/router/webrtc_transport.rs
+3
-2
webrtc_server.rs
rust/src/webrtc_server.rs
+2
-1
worker.rs
rust/src/worker.rs
+1
-0
channel.rs
rust/src/worker/channel.rs
+2
-0
channel_write_fn.rs
rust/src/worker/utils/channel_write_fn.rs
+2
-0
worker_manager.rs
rust/src/worker_manager.rs
+1
-0
没有找到文件。
rust/src/data_structures.rs
浏览文件 @
09cd482d
...
...
@@ -289,7 +289,7 @@ impl Default for DtlsRole {
/// The hash function algorithm (as defined in the "Hash function Textual Names" registry initially
/// specified in [RFC 4572](https://tools.ietf.org/html/rfc4572#section-8) Section 8) and its
/// corresponding certificate fingerprint value.
#[derive(Copy,
Clone,
PartialOrd,
PartialEq)]
#[derive(Copy,
Clone,
PartialOrd,
Eq,
PartialEq)]
pub
enum
DtlsFingerprint
{
/// sha-1
Sha1
{
...
...
@@ -748,7 +748,7 @@ impl DtlsFingerprint {
}
/// DTLS parameters.
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
pub
struct
DtlsParameters
{
/// DTLS role.
pub
role
:
DtlsRole
,
...
...
rust/src/router.rs
浏览文件 @
09cd482d
...
...
@@ -356,6 +356,7 @@ impl WeakPipeTransportPair {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_transport
:
Bag
<
Arc
<
dyn
Fn
(
NewTransport
<
'_
>
)
+
Send
+
Sync
>>
,
new_rtp_observer
:
Bag
<
Arc
<
dyn
Fn
(
NewRtpObserver
<
'_
>
)
+
Send
+
Sync
>>
,
...
...
rust/src/router/active_speaker_observer.rs
浏览文件 @
09cd482d
...
...
@@ -49,6 +49,7 @@ pub struct ActiveSpeakerObserverDominantSpeaker {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
dominant_speaker
:
Bag
<
Arc
<
dyn
Fn
(
&
ActiveSpeakerObserverDominantSpeaker
)
+
Send
+
Sync
>
,
...
...
rust/src/router/audio_level_observer.rs
浏览文件 @
09cd482d
...
...
@@ -60,6 +60,7 @@ pub struct AudioLevelObserverVolume {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
volumes
:
Bag
<
Arc
<
dyn
Fn
(
&
[
AudioLevelObserverVolume
])
+
Send
+
Sync
>>
,
silence
:
Bag
<
Arc
<
dyn
Fn
()
+
Send
+
Sync
>>
,
...
...
rust/src/router/consumer.rs
浏览文件 @
09cd482d
...
...
@@ -104,7 +104,7 @@ impl ConsumerOptions {
}
}
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
RtpStreamParams
{
...
...
@@ -125,7 +125,7 @@ pub struct RtpStreamParams {
pub
rtc_payload_type
:
Option
<
u8
>
,
}
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
RtpStream
{
...
...
@@ -133,7 +133,7 @@ pub struct RtpStream {
pub
score
:
u8
,
}
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
RtpRtxParameters
{
...
...
@@ -347,6 +347,7 @@ enum PayloadNotification {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
rtp
:
Bag
<
Arc
<
dyn
Fn
(
&
[
u8
])
+
Send
+
Sync
>>
,
pause
:
Bag
<
Arc
<
dyn
Fn
()
+
Send
+
Sync
>>
,
...
...
rust/src/router/data_consumer.rs
浏览文件 @
09cd482d
...
...
@@ -125,7 +125,7 @@ impl DataConsumerOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -140,7 +140,7 @@ pub struct DataConsumerDump {
}
/// RTC statistics of the data consumer.
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[non_exhaustive]
#[allow(missing_docs)]
...
...
@@ -182,6 +182,7 @@ enum PayloadNotification {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
message
:
Bag
<
Arc
<
dyn
Fn
(
&
WebRtcMessage
<
'_
>
)
+
Send
+
Sync
>>
,
sctp_send_buffer_full
:
Bag
<
Arc
<
dyn
Fn
()
+
Send
+
Sync
>>
,
...
...
rust/src/router/data_producer.rs
浏览文件 @
09cd482d
...
...
@@ -95,7 +95,7 @@ pub enum DataProducerType {
Direct
,
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -108,7 +108,7 @@ pub struct DataProducerDump {
}
/// RTC statistics of the data producer.
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[non_exhaustive]
#[allow(missing_docs)]
...
...
@@ -122,6 +122,7 @@ pub struct DataProducerStat {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
transport_close
:
BagOnce
<
Box
<
dyn
FnOnce
()
+
Send
>>
,
close
:
BagOnce
<
Box
<
dyn
FnOnce
()
+
Send
>>
,
...
...
rust/src/router/direct_transport.rs
浏览文件 @
09cd482d
...
...
@@ -49,7 +49,7 @@ impl Default for DirectTransportOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -110,6 +110,7 @@ pub struct DirectTransportStat {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
rtcp
:
Bag
<
Arc
<
dyn
Fn
(
&
[
u8
])
+
Send
+
Sync
>>
,
new_producer
:
Bag
<
Arc
<
dyn
Fn
(
&
Producer
)
+
Send
+
Sync
>
,
Producer
>
,
...
...
rust/src/router/pipe_transport.rs
浏览文件 @
09cd482d
...
...
@@ -82,7 +82,7 @@ impl PipeTransportOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -161,6 +161,7 @@ pub struct PipeTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_producer
:
Bag
<
Arc
<
dyn
Fn
(
&
Producer
)
+
Send
+
Sync
>
,
Producer
>
,
new_consumer
:
Bag
<
Arc
<
dyn
Fn
(
&
Consumer
)
+
Send
+
Sync
>
,
Consumer
>
,
...
...
rust/src/router/plain_transport.rs
浏览文件 @
09cd482d
...
...
@@ -98,7 +98,7 @@ impl PlainTransportOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -190,6 +190,7 @@ pub struct PlainTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_producer
:
Bag
<
Arc
<
dyn
Fn
(
&
Producer
)
+
Send
+
Sync
>
,
Producer
>
,
new_consumer
:
Bag
<
Arc
<
dyn
Fn
(
&
Consumer
)
+
Send
+
Sync
>
,
Consumer
>
,
...
...
rust/src/router/plain_transport/tests.rs
浏览文件 @
09cd482d
...
...
@@ -24,12 +24,10 @@ async fn init() -> Router {
.await
.expect
(
"Failed to create worker"
);
let
router
=
worker
worker
.create_router
(
RouterOptions
::
default
())
.await
.expect
(
"Failed to create router"
);
router
.expect
(
"Failed to create router"
)
}
#[test]
...
...
rust/src/router/producer.rs
浏览文件 @
09cd482d
...
...
@@ -89,7 +89,7 @@ impl ProducerOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
RtpStreamRecv
{
...
...
@@ -278,6 +278,7 @@ enum Notification {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
score
:
Bag
<
Arc
<
dyn
Fn
(
&
[
ProducerScore
])
+
Send
+
Sync
>>
,
video_orientation_change
:
Bag
<
Arc
<
dyn
Fn
(
ProducerVideoOrientation
)
+
Send
+
Sync
>>
,
...
...
rust/src/router/transport.rs
浏览文件 @
09cd482d
...
...
@@ -78,7 +78,7 @@ pub enum TransportTraceEventType {
Bwe
,
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
RtpListener
{
...
...
@@ -101,7 +101,7 @@ pub struct RecvRtpHeaderExtensions {
transport_wide_cc01
:
Option
<
u8
>
,
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
pub
struct
SctpListener
{
...
...
rust/src/router/webrtc_transport.rs
浏览文件 @
09cd482d
...
...
@@ -183,7 +183,7 @@ impl WebRtcTransportOptions {
}
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -258,7 +258,7 @@ pub struct WebRtcTransportStat {
}
/// Remote parameters for [`WebRtcTransport`].
#[derive(Debug,
Clone,
PartialOrd,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
PartialOrd,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
pub
struct
WebRtcTransportRemoteParameters
{
/// Remote DTLS parameters.
...
...
@@ -266,6 +266,7 @@ pub struct WebRtcTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_producer
:
Bag
<
Arc
<
dyn
Fn
(
&
Producer
)
+
Send
+
Sync
>
,
Producer
>
,
new_consumer
:
Bag
<
Arc
<
dyn
Fn
(
&
Consumer
)
+
Send
+
Sync
>
,
Consumer
>
,
...
...
rust/src/webrtc_server.rs
浏览文件 @
09cd482d
...
...
@@ -59,7 +59,7 @@ pub struct WebRtcServerTupleHash {
pub
webrtc_transport_id
:
TransportId
,
}
#[derive(Debug,
Clone,
PartialEq,
Deserialize,
Serialize)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Deserialize,
Serialize)]
#[serde(rename_all
=
"camelCase"
)]
#[doc(hidden)]
#[non_exhaustive]
...
...
@@ -151,6 +151,7 @@ impl WebRtcServerOptions {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_webrtc_transport
:
BagOnce
<
Box
<
dyn
Fn
(
&
WebRtcTransport
)
+
Send
>>
,
worker_close
:
BagOnce
<
Box
<
dyn
FnOnce
()
+
Send
>>
,
...
...
rust/src/worker.rs
浏览文件 @
09cd482d
...
...
@@ -274,6 +274,7 @@ pub enum CreateRouterError {
}
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_router
:
Bag
<
Arc
<
dyn
Fn
(
&
Router
)
+
Send
+
Sync
>
,
Router
>
,
new_webrtc_server
:
Bag
<
Arc
<
dyn
Fn
(
&
WebRtcServer
)
+
Send
+
Sync
>
,
WebRtcServer
>
,
...
...
rust/src/worker/channel.rs
浏览文件 @
09cd482d
...
...
@@ -37,6 +37,7 @@ pub(super) enum InternalMessage {
Unexpected
(
Vec
<
u8
>
),
}
#[allow(clippy
::
type_complexity)]
pub
(
crate
)
struct
BufferMessagesGuard
{
target_id
:
SubscriptionTarget
,
buffered_notifications_for
:
Arc
<
Mutex
<
HashedMap
<
SubscriptionTarget
,
Vec
<
Vec
<
u8
>>>>>
,
...
...
@@ -158,6 +159,7 @@ struct OutgoingMessageBuffer {
messages
:
VecDeque
<
Arc
<
AtomicTake
<
Vec
<
u8
>>>>
,
}
#[allow(clippy
::
type_complexity)]
struct
Inner
{
outgoing_message_buffer
:
Arc
<
Mutex
<
OutgoingMessageBuffer
>>
,
internal_message_receiver
:
async_channel
::
Receiver
<
InternalMessage
>
,
...
...
rust/src/worker/utils/channel_write_fn.rs
浏览文件 @
09cd482d
...
...
@@ -4,6 +4,7 @@ pub(super) use mediasoup_sys::{
use
std
::
os
::
raw
::
c_void
;
use
std
::
slice
;
#[allow(clippy
::
type_complexity)]
pub
(
super
)
struct
ChannelReadCallback
(
Box
<
dyn
FnMut
(
&
[
u8
])
+
Send
+
'static
>
);
pub
(
crate
)
struct
PreparedChannelWrite
{
...
...
@@ -59,6 +60,7 @@ where
}
}
#[allow(clippy
::
type_complexity)]
pub
(
super
)
struct
PayloadChannelReadCallback
(
Box
<
dyn
FnMut
(
&
[
u8
],
&
[
u8
])
+
Send
+
'static
>
);
pub
(
crate
)
struct
PreparedPayloadChannelWrite
{
...
...
rust/src/worker_manager.rs
浏览文件 @
09cd482d
...
...
@@ -17,6 +17,7 @@ use std::sync::Arc;
use
std
::{
fmt
,
io
,
mem
};
#[derive(Default)]
#[allow(clippy
::
type_complexity)]
struct
Handlers
{
new_worker
:
Bag
<
Arc
<
dyn
Fn
(
&
Worker
)
+
Send
+
Sync
>
,
Worker
>
,
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论