Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
ea2366c0
提交
ea2366c0
authored
6月 05, 2016
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't mandate codec.name's MIME type to match the RtpReceiver's kind.
上级
ffb0a1ec
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
77 行增加
和
30 行删除
+77
-30
test_RtpReceiver.js
test/test_RtpReceiver.js
+39
-1
RtpDictionaries.h
worker/include/RTC/RtpDictionaries.h
+20
-7
RtpCodecParameters.cpp
worker/src/RTC/RtpDictionaries/RtpCodecParameters.cpp
+8
-10
RtpParameters.cpp
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
+2
-4
RtpReceiver.cpp
worker/src/RTC/RtpReceiver.cpp
+1
-1
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
main.cpp
worker/src/main.cpp
+6
-6
没有找到文件。
test/test_RtpReceiver.js
浏览文件 @
ea2366c0
...
@@ -325,7 +325,45 @@ tap.test('rtpReceiver.receive() with wrong codecs must fail', { timeout: 2000 },
...
@@ -325,7 +325,45 @@ tap.test('rtpReceiver.receive() with wrong codecs must fail', { timeout: 2000 },
codecs
:
codecs
:
[
[
{
{
name
:
'chicken/FOO'
,
name
:
'opus'
,
payloadType
:
101
}
]
})
.
then
(()
=>
t
.
fail
(
'rtpReceiver.receive() succeeded'
))
.
catch
((
error
)
=>
{
t
.
pass
(
`rtpReceiver.receive() with an invalid codec.name failed:
${
error
}
`
);
});
});
funcs
.
push
(
function
()
{
return
rtpReceiver
.
receive
(
{
codecs
:
[
{
name
:
'/opus'
,
payloadType
:
101
}
]
})
.
then
(()
=>
t
.
fail
(
'rtpReceiver.receive() succeeded'
))
.
catch
((
error
)
=>
{
t
.
pass
(
`rtpReceiver.receive() with an invalid codec.name failed:
${
error
}
`
);
});
});
funcs
.
push
(
function
()
{
return
rtpReceiver
.
receive
(
{
codecs
:
[
{
name
:
'audio/'
,
payloadType
:
101
payloadType
:
101
}
}
]
]
...
...
worker/include/RTC/RtpDictionaries.h
浏览文件 @
ea2366c0
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
#define MS_RTC_RTP_DICTIONARIES_H
#define MS_RTC_RTP_DICTIONARIES_H
#include "common.h"
#include "common.h"
#include "RTC/RtpKind.h"
#include "RTC/CustomParameters.h"
#include "RTC/CustomParameters.h"
#include <string>
#include <string>
#include <vector>
#include <vector>
...
@@ -42,7 +41,7 @@ namespace RTC
...
@@ -42,7 +41,7 @@ namespace RTC
static
std
::
unordered_map
<
std
::
string
,
RtpCodecParameters
::
Subtype
>
string2Subtype
;
static
std
::
unordered_map
<
std
::
string
,
RtpCodecParameters
::
Subtype
>
string2Subtype
;
public
:
public
:
RtpCodecParameters
(
RTC
::
RtpKind
kind
,
Json
::
Value
&
data
);
RtpCodecParameters
(
Json
::
Value
&
data
);
virtual
~
RtpCodecParameters
();
virtual
~
RtpCodecParameters
();
Json
::
Value
toJson
();
Json
::
Value
toJson
();
...
@@ -58,7 +57,6 @@ namespace RTC
...
@@ -58,7 +57,6 @@ namespace RTC
RTC
::
CustomParameters
parameters
;
RTC
::
CustomParameters
parameters
;
public
:
public
:
RTC
::
RtpKind
type
;
Subtype
subtype
;
Subtype
subtype
;
};
};
...
@@ -149,7 +147,7 @@ namespace RTC
...
@@ -149,7 +147,7 @@ namespace RTC
{
{
public
:
public
:
// Constructor for receiver's parameters.
// Constructor for receiver's parameters.
RtpParameters
(
RTC
::
RtpKind
kind
,
Json
::
Value
&
data
);
RtpParameters
(
Json
::
Value
&
data
);
// Constructor for sender's parameters.
// Constructor for sender's parameters.
RtpParameters
(
const
RtpParameters
*
RtpParameters
);
RtpParameters
(
const
RtpParameters
*
RtpParameters
);
virtual
~
RtpParameters
();
virtual
~
RtpParameters
();
...
@@ -168,10 +166,25 @@ namespace RTC
...
@@ -168,10 +166,25 @@ namespace RTC
RtcpParameters
rtcp
;
RtcpParameters
rtcp
;
bool
hasRtcp
=
false
;
bool
hasRtcp
=
false
;
Json
::
Value
userParameters
;
Json
::
Value
userParameters
;
private
:
RTC
::
RtpKind
kind
;
};
};
// class RtpCapabilities
// {
// public:
// RtpCapabilities() {};
// RtpCapabilities(Json::Value& data);
// virtual ~RtpCapabilities();
// Json::Value toJson();
// private:
// void ValidateCodecs();
// public:
// std::vector<RtpCodecCapability> codecs;
// std::vector<RtpHeaderExtensionCapability> headerExtensions;
// std::vector<std::string> fecMechanisms;
// };
}
}
#endif
#endif
worker/src/RTC/RtpDictionaries/RtpCodecParameters.cpp
浏览文件 @
ea2366c0
...
@@ -24,7 +24,7 @@ namespace RTC
...
@@ -24,7 +24,7 @@ namespace RTC
/* Instance methods. */
/* Instance methods. */
RtpCodecParameters
::
RtpCodecParameters
(
RTC
::
RtpKind
kind
,
Json
::
Value
&
data
)
RtpCodecParameters
::
RtpCodecParameters
(
Json
::
Value
&
data
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -46,16 +46,14 @@ namespace RTC
...
@@ -46,16 +46,14 @@ namespace RTC
this
->
name
=
data
[
k_name
].
asString
();
this
->
name
=
data
[
k_name
].
asString
();
// Get and check name MIME type.
if
(
kind
==
RTC
::
RtpKind
::
AUDIO
&&
this
->
name
.
compare
(
0
,
6
,
"audio/"
)
==
0
)
this
->
type
=
RTC
::
RtpKind
::
AUDIO
;
else
if
(
kind
==
RTC
::
RtpKind
::
VIDEO
&&
this
->
name
.
compare
(
0
,
6
,
"video/"
)
==
0
)
this
->
type
=
RTC
::
RtpKind
::
VIDEO
;
else
MS_THROW_ERROR
(
"invalid RtpCodecParameters.name MIME type [name:%s]"
,
this
->
name
.
c_str
());
// Get name MIME subtype.
// Get name MIME subtype.
std
::
string
subtype
=
this
->
name
.
substr
(
6
);
auto
slash_pos
=
this
->
name
.
find
(
'/'
);
if
(
slash_pos
==
std
::
string
::
npos
||
slash_pos
==
0
||
slash_pos
==
this
->
name
.
length
()
-
1
)
MS_THROW_ERROR
(
"wrong RtpCodecParameters.name"
);
std
::
string
subtype
=
this
->
name
.
substr
(
slash_pos
+
1
);
if
(
RtpCodecParameters
::
string2Subtype
.
find
(
subtype
)
==
RtpCodecParameters
::
string2Subtype
.
end
())
if
(
RtpCodecParameters
::
string2Subtype
.
find
(
subtype
)
==
RtpCodecParameters
::
string2Subtype
.
end
())
this
->
subtype
=
Subtype
::
MEDIA
;
this
->
subtype
=
Subtype
::
MEDIA
;
...
...
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
浏览文件 @
ea2366c0
...
@@ -9,8 +9,7 @@ namespace RTC
...
@@ -9,8 +9,7 @@ namespace RTC
{
{
/* Instance methods. */
/* Instance methods. */
RtpParameters
::
RtpParameters
(
RTC
::
RtpKind
kind
,
Json
::
Value
&
data
)
:
RtpParameters
::
RtpParameters
(
Json
::
Value
&
data
)
kind
(
kind
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -37,7 +36,7 @@ namespace RTC
...
@@ -37,7 +36,7 @@ namespace RTC
for
(
Json
::
UInt
i
=
0
;
i
<
json_codecs
.
size
();
i
++
)
for
(
Json
::
UInt
i
=
0
;
i
<
json_codecs
.
size
();
i
++
)
{
{
RtpCodecParameters
codec
(
this
->
kind
,
json_codecs
[
i
]);
RtpCodecParameters
codec
(
json_codecs
[
i
]);
// Append to the codecs vector.
// Append to the codecs vector.
this
->
codecs
.
push_back
(
codec
);
this
->
codecs
.
push_back
(
codec
);
...
@@ -99,7 +98,6 @@ namespace RTC
...
@@ -99,7 +98,6 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
this
->
kind
=
rtpParameters
->
kind
;
this
->
muxId
=
rtpParameters
->
muxId
;
this
->
muxId
=
rtpParameters
->
muxId
;
this
->
codecs
=
rtpParameters
->
codecs
;
this
->
codecs
=
rtpParameters
->
codecs
;
this
->
encodings
=
rtpParameters
->
encodings
;
this
->
encodings
=
rtpParameters
->
encodings
;
...
...
worker/src/RTC/RtpReceiver.cpp
浏览文件 @
ea2366c0
...
@@ -129,7 +129,7 @@ namespace RTC
...
@@ -129,7 +129,7 @@ namespace RTC
try
try
{
{
this
->
rtpParameters
=
new
RTC
::
RtpParameters
(
this
->
kind
,
request
->
data
);
this
->
rtpParameters
=
new
RTC
::
RtpParameters
(
request
->
data
);
}
}
catch
(
const
MediaSoupError
&
error
)
catch
(
const
MediaSoupError
&
error
)
{
{
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
ea2366c0
...
@@ -986,7 +986,7 @@ namespace RTC
...
@@ -986,7 +986,7 @@ namespace RTC
MS_DEBUG
(
"DTLS application data received [size:%zu]"
,
len
);
MS_DEBUG
(
"DTLS application data received [size:%zu]"
,
len
);
// T
MP
// T
ODO: remove
MS_DEBUG
(
"data: %s"
,
std
::
string
((
char
*
)
data
,
len
).
c_str
());
MS_DEBUG
(
"data: %s"
,
std
::
string
((
char
*
)
data
,
len
).
c_str
());
}
}
}
}
worker/src/main.cpp
浏览文件 @
ea2366c0
...
@@ -69,17 +69,17 @@ int main(int argc, char* argv[])
...
@@ -69,17 +69,17 @@ int main(int argc, char* argv[])
MS_DEBUG
(
"starting "
MS_PROCESS_NAME
" [pid:%ld]"
,
(
long
)
getpid
());
MS_DEBUG
(
"starting "
MS_PROCESS_NAME
" [pid:%ld]"
,
(
long
)
getpid
());
#if defined(MS_LITTLE_ENDIAN)
#if defined(MS_LITTLE_ENDIAN)
MS_DEBUG
(
"
detected Little-Endian CPU
"
);
MS_DEBUG
(
"
Little-Endian CPU detected
"
);
#elif defined(MS_BIG_ENDIAN)
#elif defined(MS_BIG_ENDIAN)
MS_DEBUG
(
"
detected Big-Endian CPU
"
);
MS_DEBUG
(
"
Big-Endian CPU detected
"
);
#endif
#endif
#if defined(INTPTR_MAX) && defined(INT32_MAX) && (INTPTR_MAX == INT32_MAX)
#if defined(INTPTR_MAX) && defined(INT32_MAX) && (INTPTR_MAX == INT32_MAX)
MS_DEBUG
(
"
detected 32 bits architecture
"
);
MS_DEBUG
(
"
32 bits architecture detected
"
);
#elif defined(INTPTR_MAX) && defined(INT64_MAX) && (INTPTR_MAX == INT64_MAX)
#elif defined(INTPTR_MAX) && defined(INT64_MAX) && (INTPTR_MAX == INT64_MAX)
MS_DEBUG
(
"
detected 64 bits architecture
"
);
MS_DEBUG
(
"
64 bits architecture detected
"
);
#else
#else
MS_WARN
(
"cannot determine whether the architecture is 32 or 64 bits"
);
MS_WARN
(
"can
not determine whether the architecture is 32 or 64 bits"
);
#endif
#endif
try
try
...
@@ -145,7 +145,7 @@ void ignoreSignals()
...
@@ -145,7 +145,7 @@ void ignoreSignals()
for
(
auto
it
=
ignored_signals
.
begin
();
it
!=
ignored_signals
.
end
();
++
it
)
for
(
auto
it
=
ignored_signals
.
begin
();
it
!=
ignored_signals
.
end
();
++
it
)
{
{
std
::
string
sig_name
=
it
->
first
;
auto
&
sig_name
=
it
->
first
;
int
sig_id
=
it
->
second
;
int
sig_id
=
it
->
second
;
err
=
sigaction
(
sig_id
,
&
act
,
nullptr
);
err
=
sigaction
(
sig_id
,
&
act
,
nullptr
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论