Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
c51f45f9
提交
c51f45f9
authored
1月 21, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpStream: pass clockRate as argument
上级
7cc292c4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
20 行删除
+50
-20
RtpStream.h
worker/include/RTC/RtpStream.h
+3
-1
Room.cpp
worker/src/RTC/Room.cpp
+3
-0
RtpReceiver.cpp
worker/src/RTC/RtpReceiver.cpp
+42
-14
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+2
-5
没有找到文件。
worker/include/RTC/RtpStream.h
浏览文件 @
c51f45f9
...
@@ -24,7 +24,7 @@ namespace RTC
...
@@ -24,7 +24,7 @@ namespace RTC
};
};
public
:
public
:
explicit
RtpStream
(
size_t
bufferSize
);
explicit
RtpStream
(
uint32_t
clockRate
,
size_t
bufferSize
);
~
RtpStream
();
~
RtpStream
();
bool
ReceivePacket
(
RTC
::
RtpPacket
*
packet
);
bool
ReceivePacket
(
RTC
::
RtpPacket
*
packet
);
...
@@ -38,6 +38,8 @@ namespace RTC
...
@@ -38,6 +38,8 @@ namespace RTC
void
Dump
();
void
Dump
();
private
:
private
:
// Given as argument.
uint32_t
clockRate
=
0
;
bool
started
=
false
;
// Whether at least a RTP packet has been received.
bool
started
=
false
;
// Whether at least a RTP packet has been received.
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
uint16_t
max_seq
=
0
;
// Highest seq. number seen.
uint16_t
max_seq
=
0
;
// Highest seq. number seen.
...
...
worker/src/RTC/Room.cpp
浏览文件 @
c51f45f9
...
@@ -649,6 +649,9 @@ namespace RTC
...
@@ -649,6 +649,9 @@ namespace RTC
rtpSender
->
RetransmitRtpPacket
(
packet
);
rtpSender
->
RetransmitRtpPacket
(
packet
);
}
}
// Reset the container by setting its first element to nullptr.
this
->
rtpRetransmissionContainer
[
0
]
=
nullptr
;
}
}
break
;
break
;
...
...
worker/src/RTC/RtpReceiver.cpp
浏览文件 @
c51f45f9
...
@@ -22,20 +22,6 @@ namespace RTC
...
@@ -22,20 +22,6 @@ namespace RTC
notifier
(
notifier
)
notifier
(
notifier
)
{
{
MS_TRACE
();
MS_TRACE
();
// Create an RtpStream.
switch
(
kind
)
{
case
RTC
:
:
Media
::
Kind
::
VIDEO
:
case
RTC
:
:
Media
::
Kind
::
DEPTH
:
this
->
rtpStream
=
new
RTC
::
RtpStream
(
200
);
// Buffer up to 200 packets.
break
;
case
RTC
:
:
Media
::
Kind
::
AUDIO
:
this
->
rtpStream
=
new
RTC
::
RtpStream
(
0
);
// No buffer for audio streams.
break
;
default
:
;
}
}
}
RtpReceiver
::~
RtpReceiver
()
RtpReceiver
::~
RtpReceiver
()
...
@@ -174,6 +160,45 @@ namespace RTC
...
@@ -174,6 +160,45 @@ namespace RTC
// And notify again.
// And notify again.
this
->
listener
->
onRtpReceiverParametersDone
(
this
);
this
->
listener
->
onRtpReceiverParametersDone
(
this
);
// Set the RtpStream.
// TODO: This assumes a single stream for now.
// TODO: We need a much better way to get the clock rate.
uint8_t
streamPayloadType
=
this
->
rtpParameters
->
encodings
[
0
].
codecPayloadType
;
uint32_t
streamClockRate
;
auto
it
=
this
->
rtpParameters
->
codecs
.
begin
();
for
(;
it
!=
this
->
rtpParameters
->
codecs
.
end
();
it
++
)
{
auto
&
codec
=
*
it
;
if
(
codec
.
payloadType
==
streamPayloadType
)
{
streamClockRate
=
codec
.
clockRate
;
break
;
}
}
// This should never happen.
if
(
it
==
this
->
rtpParameters
->
codecs
.
end
())
MS_ABORT
(
"no valid codec payload type found for the first encoding"
);
switch
(
this
->
kind
)
{
case
RTC
:
:
Media
::
Kind
::
VIDEO
:
case
RTC
:
:
Media
::
Kind
::
DEPTH
:
// Buffer up to 200 packets.
this
->
rtpStream
=
new
RTC
::
RtpStream
(
streamClockRate
,
200
);
break
;
case
RTC
:
:
Media
::
Kind
::
AUDIO
:
// No buffer for audio streams.
this
->
rtpStream
=
new
RTC
::
RtpStream
(
streamClockRate
,
0
);
break
;
default
:
;
}
break
;
break
;
}
}
...
@@ -234,6 +259,9 @@ namespace RTC
...
@@ -234,6 +259,9 @@ namespace RTC
// TODO: Check if stopped, etc (not yet done).
// TODO: Check if stopped, etc (not yet done).
// TODO: Handle multiple streams.
MS_ASSERT
(
this
->
rtpStream
,
"no RtpStream set"
);
// Process the packet.
// Process the packet.
// TODO: Must check what kind of packet we are checking. For example, RTX
// TODO: Must check what kind of packet we are checking. For example, RTX
// packets (once implemented) should have a different handling.
// packets (once implemented) should have a different handling.
...
...
worker/src/RTC/RtpStream.cpp
浏览文件 @
c51f45f9
...
@@ -15,7 +15,8 @@ namespace RTC
...
@@ -15,7 +15,8 @@ namespace RTC
{
{
/* Instance methods. */
/* Instance methods. */
RtpStream
::
RtpStream
(
size_t
bufferSize
)
:
RtpStream
::
RtpStream
(
uint32_t
clockRate
,
size_t
bufferSize
)
:
clockRate
(
clockRate
),
storage
(
bufferSize
)
storage
(
bufferSize
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -73,10 +74,6 @@ namespace RTC
...
@@ -73,10 +74,6 @@ namespace RTC
// 17: 16 bit mask + the initial sequence number.
// 17: 16 bit mask + the initial sequence number.
static
size_t
maxRequestedPackets
=
17
;
static
size_t
maxRequestedPackets
=
17
;
// First of all, set the first element of the container to null so, in case
// no packet is inserted into it, the reader will know it.
container
[
0
]
=
nullptr
;
// If the buffer is empty, just return.
// If the buffer is empty, just return.
if
(
this
->
buffer
.
size
()
==
0
)
if
(
this
->
buffer
.
size
()
==
0
)
return
;
return
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论