Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
d687f935
提交
d687f935
authored
5月 15, 2016
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Add custom userParameters into RtpParameters
- Allow float/double parameter values in Dictionaries
上级
8847e9ac
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
86 行增加
和
9 行删除
+86
-9
test_RtpReceiver.js
test/test_RtpReceiver.js
+8
-0
test_scene_1.js
test/test_scene_1.js
+23
-3
RtpParameters.h
worker/include/RTC/RtpParameters.h
+6
-2
CustomParameterValue.cpp
worker/src/RTC/RtpParameters/CustomParameterValue.cpp
+7
-0
RtpCodecParameters.cpp
worker/src/RTC/RtpParameters/RtpCodecParameters.cpp
+15
-2
RtpHeaderExtensionParameters.cpp
...er/src/RTC/RtpParameters/RtpHeaderExtensionParameters.cpp
+15
-2
RtpParameters.cpp
worker/src/RTC/RtpParameters/RtpParameters.cpp
+12
-0
没有找到文件。
test/test_RtpReceiver.js
浏览文件 @
d687f935
...
...
@@ -94,6 +94,14 @@ tap.test('rtpReceiver.receive() with valid `rtpParameters` must succeed', { time
cname
:
'a7sdihkj3sdsdflqwkejl98ujk'
,
ssrc
:
88888888
,
reducedSize
:
true
},
userParameters
:
{
foo
:
123
,
bar
:
'BAR'
,
baz
:
true
,
cas
:
-
123.123
,
arr
:
[
1
,
'2'
,
3.3
,
{
qwe
:
'QWE'
,
asd
:
123
,
zxc
:
null
}
]
}
};
...
...
test/test_scene_1.js
浏览文件 @
d687f935
...
...
@@ -48,6 +48,10 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
cname
:
'ALICEAUDIO'
,
ssrc
:
51000011
,
reducedSize
:
false
},
userParameters
:
{
msid
:
'alice-msid'
}
};
let
aliceVideoParameters
=
...
...
@@ -83,6 +87,10 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
cname
:
'ALICEVIDEO'
,
ssrc
:
51000021
,
reducedSize
:
true
},
userParameters
:
{
msid
:
'alice-msid'
}
};
let
bobVideoParameters
=
...
...
@@ -118,6 +126,10 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
cname
:
'BOBVIDEO'
,
ssrc
:
52000021
,
reducedSize
:
true
},
userParameters
:
{
msid
:
'bob-msid'
}
};
let
carolAudioParameters
=
...
...
@@ -143,6 +155,10 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
cname
:
'CAROLAUDIO'
,
ssrc
:
53000011
,
reducedSize
:
true
},
userParameters
:
{
msid
:
'carol-msid'
}
};
let
carolVideoParameters
=
...
...
@@ -177,6 +193,10 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
cname
:
'CAROLVIDEO'
,
ssrc
:
53000021
,
reducedSize
:
true
},
userParameters
:
{
msid
:
'carol-msid'
}
};
...
...
@@ -187,9 +207,9 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
{
kind
:
'audio'
,
rtpParameters
:
aliceAudioParameters
},
{
kind
:
'video'
,
rtpParameters
:
aliceVideoParameters
}
])
// Once transport
is created let's check the already existing RtpSenders
//
and listen for 'newrtpsender' if all the expected ones are not yet
// present
// Once transport
and rtpReceivers are created let's check the already
//
existing RtpSenders and listen for 'newrtpsender' if all the expected
//
ones are not yet
present
.
then
(()
=>
{
const
EXPECTED_RTPSENDERS
=
1
;
...
...
worker/include/RTC/RtpParameters.h
浏览文件 @
d687f935
...
...
@@ -15,14 +15,16 @@ namespace RTC
enum
class
Type
{
BOOLEAN
=
1
,
STRING
,
INTEGER
INTEGER
,
DOUBLE
,
STRING
};
public
:
CustomParameterValue
()
{};
CustomParameterValue
(
bool
booleanValue
);
CustomParameterValue
(
uint32_t
integerValue
);
CustomParameterValue
(
double
doubleValue
);
CustomParameterValue
(
std
::
string
&
stringValue
);
virtual
~
CustomParameterValue
();
...
...
@@ -32,6 +34,7 @@ namespace RTC
Type
type
;
bool
booleanValue
=
false
;
uint32_t
integerValue
=
0
;
double
doubleValue
=
0
.
0
;
std
::
string
stringValue
;
};
...
...
@@ -167,6 +170,7 @@ namespace RTC
std
::
vector
<
RtpHeaderExtensionParameters
>
headerExtensions
;
RtcpParameters
rtcp
;
bool
hasRtcp
=
false
;
Json
::
Value
userParameters
;
};
}
...
...
worker/src/RTC/RtpParameters/CustomParameterValue.cpp
浏览文件 @
d687f935
...
...
@@ -20,6 +20,13 @@ namespace RTC
MS_TRACE
();
}
CustomParameterValue
::
CustomParameterValue
(
double
doubleValue
)
:
type
(
Type
::
DOUBLE
),
doubleValue
(
doubleValue
)
{
MS_TRACE
();
}
CustomParameterValue
::
CustomParameterValue
(
std
::
string
&
stringValue
)
:
type
(
Type
::
STRING
),
stringValue
(
stringValue
)
...
...
worker/src/RTC/RtpParameters/RtpCodecParameters.cpp
浏览文件 @
d687f935
...
...
@@ -71,9 +71,9 @@ namespace RTC
// `parameters` is optional.
if
(
data
[
k_parameters
].
isObject
())
{
auto
&
parameters
=
data
[
k_parameters
];
auto
&
json_
parameters
=
data
[
k_parameters
];
for
(
Json
::
Value
::
iterator
it
=
parameters
.
begin
();
it
!=
parameters
.
end
();
++
it
)
for
(
Json
::
Value
::
iterator
it
=
json_parameters
.
begin
();
it
!=
json_
parameters
.
end
();
++
it
)
{
std
::
string
key
=
it
.
key
().
asString
();
Json
::
Value
value
=
(
*
it
);
...
...
@@ -99,6 +99,15 @@ namespace RTC
break
;
}
case
Json
:
:
realValue
:
{
double
doubleValue
=
value
.
asDouble
();
this
->
parameters
[
key
]
=
RTC
::
CustomParameterValue
(
doubleValue
);
break
;
}
case
Json
:
:
stringValue
:
{
std
::
string
stringValue
=
value
.
asString
();
...
...
@@ -188,6 +197,10 @@ namespace RTC
json_parameters
[
key
]
=
(
Json
::
UInt
)
parameterValue
.
integerValue
;
break
;
case
RTC
:
:
CustomParameterValue
::
Type
::
DOUBLE
:
json_parameters
[
key
]
=
parameterValue
.
doubleValue
;
break
;
case
RTC
:
:
CustomParameterValue
::
Type
::
STRING
:
json_parameters
[
key
]
=
parameterValue
.
stringValue
;
break
;
...
...
worker/src/RTC/RtpParameters/RtpHeaderExtensionParameters.cpp
浏览文件 @
d687f935
...
...
@@ -41,9 +41,9 @@ namespace RTC
// `parameters` is optional.
if
(
data
[
k_parameters
].
isObject
())
{
auto
&
parameters
=
data
[
k_parameters
];
auto
&
json_
parameters
=
data
[
k_parameters
];
for
(
Json
::
Value
::
iterator
it
=
parameters
.
begin
();
it
!=
parameters
.
end
();
++
it
)
for
(
Json
::
Value
::
iterator
it
=
json_parameters
.
begin
();
it
!=
json_
parameters
.
end
();
++
it
)
{
std
::
string
key
=
it
.
key
().
asString
();
Json
::
Value
value
=
(
*
it
);
...
...
@@ -69,6 +69,15 @@ namespace RTC
break
;
}
case
Json
:
:
realValue
:
{
double
doubleValue
=
value
.
asDouble
();
this
->
parameters
[
key
]
=
RTC
::
CustomParameterValue
(
doubleValue
);
break
;
}
case
Json
:
:
stringValue
:
{
std
::
string
stringValue
=
value
.
asString
();
...
...
@@ -130,6 +139,10 @@ namespace RTC
json_parameters
[
key
]
=
(
Json
::
UInt
)
parameterValue
.
integerValue
;
break
;
case
RTC
:
:
CustomParameterValue
::
Type
::
DOUBLE
:
json_parameters
[
key
]
=
parameterValue
.
doubleValue
;
break
;
case
RTC
:
:
CustomParameterValue
::
Type
::
STRING
:
json_parameters
[
key
]
=
parameterValue
.
stringValue
;
break
;
...
...
worker/src/RTC/RtpParameters/RtpParameters.cpp
浏览文件 @
d687f935
...
...
@@ -17,6 +17,7 @@ namespace RTC
static
const
Json
::
StaticString
k_encodings
(
"encodings"
);
static
const
Json
::
StaticString
k_headerExtensions
(
"headerExtensions"
);
static
const
Json
::
StaticString
k_rtcp
(
"rtcp"
);
static
const
Json
::
StaticString
k_userParameters
(
"userParameters"
);
// `muxId` is optional.
if
(
data
[
k_muxId
].
isString
())
...
...
@@ -77,6 +78,12 @@ namespace RTC
this
->
rtcp
=
RtcpParameters
(
data
[
k_rtcp
]);
this
->
hasRtcp
=
true
;
}
// `userParameters` is optional.
if
(
data
[
k_userParameters
].
isObject
())
this
->
userParameters
=
data
[
k_userParameters
];
else
this
->
userParameters
=
Json
::
objectValue
;
}
RtpParameters
::
RtpParameters
(
const
RtpParameters
*
rtpParameters
)
...
...
@@ -89,6 +96,7 @@ namespace RTC
this
->
headerExtensions
=
rtpParameters
->
headerExtensions
;
this
->
rtcp
=
rtpParameters
->
rtcp
;
this
->
hasRtcp
=
rtpParameters
->
hasRtcp
;
this
->
userParameters
=
rtpParameters
->
userParameters
;
}
RtpParameters
::~
RtpParameters
()
...
...
@@ -105,6 +113,7 @@ namespace RTC
static
const
Json
::
StaticString
k_encodings
(
"encodings"
);
static
const
Json
::
StaticString
k_headerExtensions
(
"headerExtensions"
);
static
const
Json
::
StaticString
k_rtcp
(
"rtcp"
);
static
const
Json
::
StaticString
k_userParameters
(
"userParameters"
);
Json
::
Value
json
(
Json
::
objectValue
);
...
...
@@ -149,6 +158,9 @@ namespace RTC
if
(
this
->
hasRtcp
)
json
[
k_rtcp
]
=
this
->
rtcp
.
toJson
();
// Add `userParameters`.
json
[
k_userParameters
]
=
this
->
userParameters
;
return
json
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论