Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
e8a5eed8
Unverified
提交
e8a5eed8
authored
11月 29, 2021
作者:
Nazar Mokrynskyi
提交者:
GitHub
11月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #720 from nazar-pc/new-rust-release
New Rust release
上级
f90462b9
5bc1d589
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
38 行增加
和
25 行删除
+38
-25
CHANGELOG.md
rust/CHANGELOG.md
+5
-1
Cargo.toml
rust/Cargo.toml
+2
-2
ortc.rs
rust/src/ortc.rs
+6
-6
rtp_parameters.rs
rust/src/rtp_parameters.rs
+24
-14
Cargo.toml
worker/Cargo.toml
+1
-2
没有找到文件。
rust/CHANGELOG.md
浏览文件 @
e8a5eed8
# Changelog
# Changelog
#
Unreleased
#
0.9.0
*
Fix for receiving data over payload channel
*
Fix for receiving data over payload channel
*
Support thread initializer function for worker threads, can be used for pinning worker threads to CPU cores
*
Support thread initializer function for worker threads, can be used for pinning worker threads to CPU cores
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
*
Various optimizations that caused minor breaking changes to public API
*
Various optimizations that caused minor breaking changes to public API
*
Requests no longer have internal timeout, but they can now be cancelled, add your own timeouts on top if needed
*
Requests no longer have internal timeout, but they can now be cancelled, add your own timeouts on top if needed
*
Windows support
*
Windows support
*
General mediasoup changes:
*
Replaces GYP build system with fully-functional Meson build system (PR #622).
*
`Consumer`
: Modification of bitrate allocation algorithm (PR #708).
*
Single H264/H265 codec configuration in
`supportedRtpCapabilities`
(PR #718).
# 0.8.5
# 0.8.5
...
...
rust/Cargo.toml
浏览文件 @
e8a5eed8
[package]
[package]
name
=
"mediasoup"
name
=
"mediasoup"
version
=
"0.
8.5
"
version
=
"0.
9.0
"
description
=
"Cutting Edge WebRTC Video Conferencing in Rust"
description
=
"Cutting Edge WebRTC Video Conferencing in Rust"
categories
=
[
"api-bindings"
,
"multimedia"
,
"network-programming"
]
categories
=
[
"api-bindings"
,
"multimedia"
,
"network-programming"
]
authors
=
[
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
]
authors
=
[
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
]
...
@@ -44,7 +44,7 @@ version = "0.6.6"
...
@@ -44,7 +44,7 @@ version = "0.6.6"
[dependencies.mediasoup-sys]
[dependencies.mediasoup-sys]
path
=
"../worker"
path
=
"../worker"
version
=
"0.
2.5
"
version
=
"0.
3.0
"
[dependencies.parking_lot]
[dependencies.parking_lot]
version
=
"0.11.2"
version
=
"0.11.2"
...
...
rust/src/ortc.rs
浏览文件 @
e8a5eed8
...
@@ -57,7 +57,7 @@ pub struct RtpMapping {
...
@@ -57,7 +57,7 @@ pub struct RtpMapping {
pub
enum
RtpParametersError
{
pub
enum
RtpParametersError
{
/// Invalid codec apt parameter.
/// Invalid codec apt parameter.
#[error(
"Invalid codec apt parameter {0}"
)]
#[error(
"Invalid codec apt parameter {0}"
)]
InvalidAptParameter
(
String
),
InvalidAptParameter
(
Cow
<
'static
,
str
>
),
}
}
/// Error caused by invalid RTP capabilities.
/// Error caused by invalid RTP capabilities.
...
@@ -74,7 +74,7 @@ pub enum RtpCapabilitiesError {
...
@@ -74,7 +74,7 @@ pub enum RtpCapabilitiesError {
CannotAllocate
,
CannotAllocate
,
/// Invalid codec apt parameter.
/// Invalid codec apt parameter.
#[error(
"Invalid codec apt parameter {0}"
)]
#[error(
"Invalid codec apt parameter {0}"
)]
InvalidAptParameter
(
String
),
InvalidAptParameter
(
Cow
<
'static
,
str
>
),
/// Duplicated preferred payload type
/// Duplicated preferred payload type
#[error(
"Duplicated preferred payload type {0}"
)]
#[error(
"Duplicated preferred payload type {0}"
)]
DuplicatedPreferredPayloadType
(
u8
),
DuplicatedPreferredPayloadType
(
u8
),
...
@@ -135,7 +135,7 @@ pub(crate) fn validate_rtp_parameters(
...
@@ -135,7 +135,7 @@ pub(crate) fn validate_rtp_parameters(
fn
validate_rtp_codec_parameters
(
codec
:
&
RtpCodecParameters
)
->
Result
<
(),
RtpParametersError
>
{
fn
validate_rtp_codec_parameters
(
codec
:
&
RtpCodecParameters
)
->
Result
<
(),
RtpParametersError
>
{
for
(
key
,
value
)
in
codec
.parameters
()
.iter
()
{
for
(
key
,
value
)
in
codec
.parameters
()
.iter
()
{
// Specific parameters validation.
// Specific parameters validation.
if
key
.as_
str
()
==
"apt"
{
if
key
.as_
ref
()
==
"apt"
{
match
value
{
match
value
{
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
{
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
{
// Good
// Good
...
@@ -154,7 +154,7 @@ fn validate_rtp_codec_parameters(codec: &RtpCodecParameters) -> Result<(), RtpPa
...
@@ -154,7 +154,7 @@ fn validate_rtp_codec_parameters(codec: &RtpCodecParameters) -> Result<(), RtpPa
fn
validate_rtp_codec_capability
(
codec
:
&
RtpCodecCapability
)
->
Result
<
(),
RtpCapabilitiesError
>
{
fn
validate_rtp_codec_capability
(
codec
:
&
RtpCodecCapability
)
->
Result
<
(),
RtpCapabilitiesError
>
{
for
(
key
,
value
)
in
codec
.parameters
()
.iter
()
{
for
(
key
,
value
)
in
codec
.parameters
()
.iter
()
{
// Specific parameters validation.
// Specific parameters validation.
if
key
.as_
str
()
==
"apt"
{
if
key
.as_
ref
()
==
"apt"
{
match
value
{
match
value
{
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
{
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
{
// Good
// Good
...
@@ -1019,7 +1019,7 @@ fn match_codecs(
...
@@ -1019,7 +1019,7 @@ fn match_codecs(
.parameters
.parameters
.get
(
"profile-level-id"
)
.get
(
"profile-level-id"
)
.and_then
(|
p
|
match
p
{
.and_then
(|
p
|
match
p
{
RtpCodecParametersParametersValue
::
String
(
s
)
=>
Some
(
s
.as_
str
()),
RtpCodecParametersParametersValue
::
String
(
s
)
=>
Some
(
s
.as_
ref
()),
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
None
,
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
None
,
});
});
let
profile_level_id_b
=
let
profile_level_id_b
=
...
@@ -1027,7 +1027,7 @@ fn match_codecs(
...
@@ -1027,7 +1027,7 @@ fn match_codecs(
.parameters
.parameters
.get
(
"profile-level-id"
)
.get
(
"profile-level-id"
)
.and_then
(|
p
|
match
p
{
.and_then
(|
p
|
match
p
{
RtpCodecParametersParametersValue
::
String
(
s
)
=>
Some
(
s
.as_
str
()),
RtpCodecParametersParametersValue
::
String
(
s
)
=>
Some
(
s
.as_
ref
()),
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
None
,
RtpCodecParametersParametersValue
::
Number
(
_
)
=>
None
,
});
});
...
...
rust/src/rtp_parameters.rs
浏览文件 @
e8a5eed8
...
@@ -17,13 +17,15 @@ use std::num::{NonZeroU32, NonZeroU8};
...
@@ -17,13 +17,15 @@ use std::num::{NonZeroU32, NonZeroU8};
/// Codec specific parameters. Some parameters (such as `packetization-mode` and `profile-level-id`
/// Codec specific parameters. Some parameters (such as `packetization-mode` and `profile-level-id`
/// in H264 or `profile-id` in VP9) are critical for codec matching.
/// in H264 or `profile-id` in VP9) are critical for codec matching.
#[derive(Debug,
Default,
Clone,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Deserialize,
Serialize)]
#[derive(Debug,
Default,
Clone,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Deserialize,
Serialize)]
pub
struct
RtpCodecParametersParameters
(
BTreeMap
<
String
,
RtpCodecParametersParametersValue
>
);
pub
struct
RtpCodecParametersParameters
(
BTreeMap
<
Cow
<
'static
,
str
>
,
RtpCodecParametersParametersValue
>
,
);
impl
RtpCodecParametersParameters
{
impl
RtpCodecParametersParameters
{
/// Insert another parameter into collection.
/// Insert another parameter into collection.
pub
fn
insert
<
K
,
V
>
(
&
mut
self
,
key
:
K
,
value
:
V
)
->
&
mut
Self
pub
fn
insert
<
K
,
V
>
(
&
mut
self
,
key
:
K
,
value
:
V
)
->
&
mut
Self
where
where
K
:
Into
<
String
>
,
K
:
Into
<
Cow
<
'static
,
str
>
>
,
V
:
Into
<
RtpCodecParametersParametersValue
>
,
V
:
Into
<
RtpCodecParametersParametersValue
>
,
{
{
self
.
0
.insert
(
key
.into
(),
value
.into
());
self
.
0
.insert
(
key
.into
(),
value
.into
());
...
@@ -34,7 +36,8 @@ impl RtpCodecParametersParameters {
...
@@ -34,7 +36,8 @@ impl RtpCodecParametersParameters {
#[must_use]
#[must_use]
pub
fn
iter
(
pub
fn
iter
(
&
self
,
&
self
,
)
->
std
::
collections
::
btree_map
::
Iter
<
'_
,
String
,
RtpCodecParametersParametersValue
>
{
)
->
std
::
collections
::
btree_map
::
Iter
<
'_
,
Cow
<
'static
,
str
>
,
RtpCodecParametersParametersValue
>
{
self
.
0
.iter
()
self
.
0
.iter
()
}
}
...
@@ -48,7 +51,7 @@ impl RtpCodecParametersParameters {
...
@@ -48,7 +51,7 @@ impl RtpCodecParametersParameters {
impl
<
K
,
const
N
:
usize
>
From
<
[(
K
,
RtpCodecParametersParametersValue
);
N
]
>
impl
<
K
,
const
N
:
usize
>
From
<
[(
K
,
RtpCodecParametersParametersValue
);
N
]
>
for
RtpCodecParametersParameters
for
RtpCodecParametersParameters
where
where
K
:
Into
<
String
>
,
K
:
Into
<
Cow
<
'static
,
str
>
>
,
{
{
fn
from
(
array
:
[(
K
,
RtpCodecParametersParametersValue
);
N
])
->
Self
{
fn
from
(
array
:
[(
K
,
RtpCodecParametersParametersValue
);
N
])
->
Self
{
std
::
array
::
IntoIter
::
new
(
array
)
.collect
()
std
::
array
::
IntoIter
::
new
(
array
)
.collect
()
...
@@ -56,20 +59,21 @@ where
...
@@ -56,20 +59,21 @@ where
}
}
impl
IntoIterator
for
RtpCodecParametersParameters
{
impl
IntoIterator
for
RtpCodecParametersParameters
{
type
Item
=
(
String
,
RtpCodecParametersParametersValue
);
type
Item
=
(
Cow
<
'static
,
str
>
,
RtpCodecParametersParametersValue
);
type
IntoIter
=
type
IntoIter
=
std
::
collections
::
btree_map
::
IntoIter
<
String
,
RtpCodecParametersParametersValue
>
;
std
::
collections
::
btree_map
::
IntoIter
<
Cow
<
'static
,
str
>
,
RtpCodecParametersParametersValue
>
;
fn
into_iter
(
fn
into_iter
(
self
,
self
,
)
->
std
::
collections
::
btree_map
::
IntoIter
<
String
,
RtpCodecParametersParametersValue
>
{
)
->
std
::
collections
::
btree_map
::
IntoIter
<
Cow
<
'static
,
str
>
,
RtpCodecParametersParametersValue
>
{
self
.
0
.into_iter
()
self
.
0
.into_iter
()
}
}
}
}
impl
<
K
>
Extend
<
(
K
,
RtpCodecParametersParametersValue
)
>
for
RtpCodecParametersParameters
impl
<
K
>
Extend
<
(
K
,
RtpCodecParametersParametersValue
)
>
for
RtpCodecParametersParameters
where
where
K
:
Into
<
String
>
,
K
:
Into
<
Cow
<
'static
,
str
>
>
,
{
{
fn
extend
<
T
:
IntoIterator
<
Item
=
(
K
,
RtpCodecParametersParametersValue
)
>>
(
&
mut
self
,
iter
:
T
)
{
fn
extend
<
T
:
IntoIterator
<
Item
=
(
K
,
RtpCodecParametersParametersValue
)
>>
(
&
mut
self
,
iter
:
T
)
{
iter
.into_iter
()
.for_each
(|(
k
,
v
)|
{
iter
.into_iter
()
.for_each
(|(
k
,
v
)|
{
...
@@ -80,7 +84,7 @@ where
...
@@ -80,7 +84,7 @@ where
impl
<
K
>
FromIterator
<
(
K
,
RtpCodecParametersParametersValue
)
>
for
RtpCodecParametersParameters
impl
<
K
>
FromIterator
<
(
K
,
RtpCodecParametersParametersValue
)
>
for
RtpCodecParametersParameters
where
where
K
:
Into
<
String
>
,
K
:
Into
<
Cow
<
'static
,
str
>
>
,
{
{
fn
from_iter
<
T
:
IntoIterator
<
Item
=
(
K
,
RtpCodecParametersParametersValue
)
>>
(
iter
:
T
)
->
Self
{
fn
from_iter
<
T
:
IntoIterator
<
Item
=
(
K
,
RtpCodecParametersParametersValue
)
>>
(
iter
:
T
)
->
Self
{
Self
(
iter
.into_iter
()
.map
(|(
k
,
v
)|
(
k
.into
(),
v
))
.collect
())
Self
(
iter
.into_iter
()
.map
(|(
k
,
v
)|
(
k
.into
(),
v
))
.collect
())
...
@@ -538,20 +542,26 @@ pub struct RtpParameters {
...
@@ -538,20 +542,26 @@ pub struct RtpParameters {
#[serde(untagged)]
#[serde(untagged)]
pub
enum
RtpCodecParametersParametersValue
{
pub
enum
RtpCodecParametersParametersValue
{
/// String value
/// String value
String
(
String
),
String
(
Cow
<
'static
,
str
>
),
/// Numerical value
/// Numerical value
Number
(
u32
),
Number
(
u32
),
}
}
impl
From
<
Cow
<
'static
,
str
>>
for
RtpCodecParametersParametersValue
{
fn
from
(
s
:
Cow
<
'static
,
str
>
)
->
Self
{
Self
::
String
(
s
)
}
}
impl
From
<
String
>
for
RtpCodecParametersParametersValue
{
impl
From
<
String
>
for
RtpCodecParametersParametersValue
{
fn
from
(
s
:
String
)
->
Self
{
fn
from
(
s
:
String
)
->
Self
{
Self
::
String
(
s
)
Self
::
String
(
s
.into
()
)
}
}
}
}
impl
From
<&
str
>
for
RtpCodecParametersParametersValue
{
impl
From
<&
'static
str
>
for
RtpCodecParametersParametersValue
{
fn
from
(
s
:
&
str
)
->
Self
{
fn
from
(
s
:
&
'static
str
)
->
Self
{
Self
::
String
(
s
.
to_string
())
Self
::
String
(
s
.
into
())
}
}
}
}
...
...
worker/Cargo.toml
浏览文件 @
e8a5eed8
[package]
[package]
name
=
"mediasoup-sys"
name
=
"mediasoup-sys"
version
=
"0.
2.5
"
version
=
"0.
3.0
"
description
=
"FFI bindings to C++ libmediasoup-worker"
description
=
"FFI bindings to C++ libmediasoup-worker"
authors
=
[
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
]
authors
=
[
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
]
edition
=
"2018"
edition
=
"2018"
...
@@ -9,7 +9,6 @@ documentation = "https://docs.rs/mediasoup-sys"
...
@@ -9,7 +9,6 @@ documentation = "https://docs.rs/mediasoup-sys"
repository
=
"https://github.com/versatica/mediasoup/tree/v3/worker"
repository
=
"https://github.com/versatica/mediasoup/tree/v3/worker"
include
=
[
include
=
[
"/deps/libwebrtc"
,
"/deps/libwebrtc"
,
"!/deps/libwebrtc/deps/abseil-cpp"
,
"/fuzzer/include"
,
"/fuzzer/include"
,
"/fuzzer/src"
,
"/fuzzer/src"
,
"/include"
,
"/include"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论