Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
8b24bfc0
提交
8b24bfc0
authored
3月 10, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
C++: Add RtpHeaderExtensionUri
上级
c5af2d9d
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
91 行增加
和
14 行删除
+91
-14
RtpDictionaries.hpp
worker/include/RTC/RtpDictionaries.hpp
+30
-8
RtpSender.hpp
worker/include/RTC/RtpSender.hpp
+9
-0
mediasoup-worker.gyp
worker/mediasoup-worker.gyp
+1
-0
RtpCapabilities.cpp
worker/src/RTC/RtpDictionaries/RtpCapabilities.cpp
+4
-3
RtpHeaderExtension.cpp
worker/src/RTC/RtpDictionaries/RtpHeaderExtension.cpp
+3
-0
RtpHeaderExtensionParameters.cpp
.../src/RTC/RtpDictionaries/RtpHeaderExtensionParameters.cpp
+3
-0
RtpHeaderExtensionUri.cpp
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
+37
-0
RtpParameters.cpp
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
+4
-3
没有找到文件。
worker/include/RTC/RtpDictionaries.hpp
浏览文件 @
8b24bfc0
...
...
@@ -123,6 +123,26 @@ namespace RTC
std
::
string
name
;
};
class
RtpHeaderExtensionUri
{
public
:
enum
class
Type
:
uint8_t
{
UNKNOWN
=
0
,
SSRC_AUDIO_LEVEL
=
1
,
TO_OFFSET
=
2
,
ABS_SEND_TIME
=
3
,
VIDEO_ORIENTATION
=
4
,
RTP_STREAM_ID
=
5
};
private
:
static
std
::
unordered_map
<
std
::
string
,
Type
>
string2Type
;
public
:
static
Type
GetType
(
std
::
string
&
uri
);
};
class
RtcpFeedback
{
public
:
...
...
@@ -172,10 +192,11 @@ namespace RTC
Json
::
Value
toJson
();
public
:
Media
::
Kind
kind
=
Media
::
Kind
::
ALL
;
std
::
string
uri
;
uint16_t
preferredId
=
0
;
bool
preferredEncrypt
=
false
;
Media
::
Kind
kind
=
Media
::
Kind
::
ALL
;
std
::
string
uri
;
RtpHeaderExtensionUri
::
Type
type
;
uint16_t
preferredId
=
0
;
bool
preferredEncrypt
=
false
;
};
class
RtpCapabilities
...
...
@@ -254,10 +275,11 @@ namespace RTC
Json
::
Value
toJson
();
public
:
std
::
string
uri
;
uint16_t
id
=
0
;
bool
encrypt
=
false
;
RTC
::
Parameters
parameters
;
std
::
string
uri
;
RtpHeaderExtensionUri
::
Type
type
;
uint16_t
id
=
0
;
bool
encrypt
=
false
;
RTC
::
Parameters
parameters
;
};
class
RtcpParameters
...
...
worker/include/RTC/RtpSender.hpp
浏览文件 @
8b24bfc0
...
...
@@ -30,6 +30,15 @@ namespace RTC
virtual
void
onRtpSenderClosed
(
RtpSender
*
rtpSender
)
=
0
;
};
private
:
struct
Data
{
std
::
string
muxId
;
RTC
::
RtpCodecMime
mediaMime
;
uint32_t
mediaSsrc
=
0
;
// TODO: Add much more and move supportedPayloadTypes here.
};
private
:
// Container of RTP packets to retransmit.
static
std
::
vector
<
RTC
::
RtpPacket
*>
rtpRetransmissionContainer
;
...
...
worker/mediasoup-worker.gyp
浏览文件 @
8b24bfc0
...
...
@@ -52,6 +52,7 @@
'src/RTC/RtpDictionaries/RtpFecParameters.cpp',
'src/RTC/RtpDictionaries/RtpHeaderExtension.cpp',
'src/RTC/RtpDictionaries/RtpHeaderExtensionParameters.cpp',
'src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp',
'src/RTC/RtpDictionaries/RtpParameters.cpp',
'src/RTC/RtpDictionaries/RtpRtxParameters.cpp',
'src/RTC/RTCP/Packet.cpp',
...
...
worker/src/RTC/RtpDictionaries/RtpCapabilities.cpp
浏览文件 @
8b24bfc0
...
...
@@ -41,8 +41,9 @@ namespace RTC
{
RtpHeaderExtension
headerExtension
(
json_array
[
i
]);
// Append to the headerExtensions vector.
this
->
headerExtensions
.
push_back
(
headerExtension
);
// If a known header extension, append to the headerExtensions vector.
if
(
headerExtension
.
type
!=
RtpHeaderExtensionUri
::
Type
::
UNKNOWN
)
this
->
headerExtensions
.
push_back
(
headerExtension
);
}
}
...
...
@@ -114,7 +115,7 @@ namespace RTC
for
(
auto
&
supportedHeaderExtension
:
supportedHeaderExtensions
)
{
if
(
headerExtension
.
uri
==
supportedHeaderExtension
.
uri
&&
headerExtension
.
type
==
supportedHeaderExtension
.
type
&&
(
headerExtension
.
kind
==
supportedHeaderExtension
.
kind
||
supportedHeaderExtension
.
kind
==
RTC
::
Media
::
Kind
::
ALL
...
...
worker/src/RTC/RtpDictionaries/RtpHeaderExtension.cpp
浏览文件 @
8b24bfc0
...
...
@@ -38,6 +38,9 @@ namespace RTC
if
(
this
->
uri
.
empty
())
MS_THROW_ERROR
(
"empty RtpHeaderExtension.uri"
);
// Get the type.
this
->
type
=
RTC
::
RtpHeaderExtensionUri
::
GetType
(
this
->
uri
);
// `preferredId` is mandatory.
if
(
!
data
[
k_preferredId
].
isUInt
())
MS_THROW_ERROR
(
"missing RtpHeaderExtension.preferredId"
);
...
...
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionParameters.cpp
浏览文件 @
8b24bfc0
...
...
@@ -29,6 +29,9 @@ namespace RTC
if
(
this
->
uri
.
empty
())
MS_THROW_ERROR
(
"empty RtpHeaderExtensionParameters.uri"
);
// Get the type.
this
->
type
=
RTC
::
RtpHeaderExtensionUri
::
GetType
(
this
->
uri
);
// `id` is mandatory.
if
(
!
data
[
k_id
].
isUInt
())
MS_THROW_ERROR
(
"missing RtpHeaderExtensionParameters.id"
);
...
...
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
0 → 100644
浏览文件 @
8b24bfc0
#define MS_CLASS "RTC::RtpHeaderExtensionUri"
// #define MS_LOG_DEV
#include "RTC/RtpDictionaries.hpp"
#include "Utils.hpp"
#include "Logger.hpp"
namespace
RTC
{
/* Class variables. */
std
::
unordered_map
<
std
::
string
,
RtpHeaderExtensionUri
::
Type
>
RtpHeaderExtensionUri
::
string2Type
=
{
{
"urn:ietf:params:rtp-hdrext:ssrc-audio-level"
,
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
},
{
"urn:ietf:params:rtp-hdrext:toffset"
,
RtpHeaderExtensionUri
::
Type
::
TO_OFFSET
},
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
,
RtpHeaderExtensionUri
::
Type
::
ABS_SEND_TIME
},
{
"urn:3gpp:video-orientation"
,
RtpHeaderExtensionUri
::
Type
::
VIDEO_ORIENTATION
},
{
"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"
,
RtpHeaderExtensionUri
::
Type
::
RTP_STREAM_ID
}
};
/* Class methods. */
RtpHeaderExtensionUri
::
Type
RtpHeaderExtensionUri
::
GetType
(
std
::
string
&
uri
)
{
MS_TRACE
();
// Force lowcase names.
Utils
::
String
::
ToLowerCase
(
uri
);
auto
it
=
RtpHeaderExtensionUri
::
string2Type
.
find
(
uri
);
if
(
it
!=
RtpHeaderExtensionUri
::
string2Type
.
end
())
return
it
->
second
;
else
return
RtpHeaderExtensionUri
::
Type
::
UNKNOWN
;
}
}
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
浏览文件 @
8b24bfc0
...
...
@@ -71,8 +71,9 @@ namespace RTC
{
RTC
::
RtpHeaderExtensionParameters
headerExtension
(
json_array
[
i
]);
// Append to the headerExtensions vector.
this
->
headerExtensions
.
push_back
(
headerExtension
);
// If a known header extension, append to the headerExtensions vector.
if
(
headerExtension
.
type
!=
RtpHeaderExtensionUri
::
Type
::
UNKNOWN
)
this
->
headerExtensions
.
push_back
(
headerExtension
);
}
}
...
...
@@ -230,7 +231,7 @@ namespace RTC
{
for
(
auto
&
supportedHeaderExtension
:
supportedHeaderExtensions
)
{
if
(
headerExtension
.
uri
==
supportedHeaderExtension
.
uri
)
if
(
headerExtension
.
type
==
supportedHeaderExtension
.
type
)
{
// Set the same id and other properties.
headerExtension
.
id
=
supportedHeaderExtension
.
preferredId
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论