Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
0937e216
提交
0937e216
authored
9月 05, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More work on removing JSON arguments in C++ methods.
上级
8f73fcb5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
77 行增加
和
45 行删除
+77
-45
Producer.hpp
worker/include/RTC/Producer.hpp
+2
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+22
-44
Router.cpp
worker/src/RTC/Router.cpp
+53
-1
没有找到文件。
worker/include/RTC/Producer.hpp
浏览文件 @
0937e216
...
@@ -60,6 +60,8 @@ namespace RTC
...
@@ -60,6 +60,8 @@ namespace RTC
void
UpdateRtpParameters
(
RTC
::
RtpParameters
&
rtpParameters
);
void
UpdateRtpParameters
(
RTC
::
RtpParameters
&
rtpParameters
);
void
Pause
();
void
Pause
();
void
Resume
();
void
Resume
();
void
SetRtpRawEvent
(
bool
enabled
);
void
SetRtpObjectEvent
(
bool
enabled
);
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
bool
IsPaused
()
const
;
bool
IsPaused
()
const
;
void
ReceiveRtpPacket
(
RTC
::
RtpPacket
*
packet
);
void
ReceiveRtpPacket
(
RTC
::
RtpPacket
*
packet
);
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
0937e216
...
@@ -135,50 +135,6 @@ namespace RTC
...
@@ -135,50 +135,6 @@ namespace RTC
break
;
break
;
}
}
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_RAW_EVENT
:
{
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
if
(
!
request
->
data
[
JsonStringEnabled
].
isBool
())
{
request
->
Reject
(
"Request has invalid data.enabled"
);
return
;
}
this
->
rtpRawEventEnabled
=
request
->
data
[
JsonStringEnabled
].
asBool
();
request
->
Accept
();
// If set, require a full frame.
if
(
this
->
rtpRawEventEnabled
)
RequestFullFrame
(
true
);
break
;
}
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_OBJECT_EVENT
:
{
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
if
(
!
request
->
data
[
JsonStringEnabled
].
isBool
())
{
request
->
Reject
(
"Request has invalid data.enabled"
);
return
;
}
this
->
rtpObjectEventEnabled
=
request
->
data
[
JsonStringEnabled
].
asBool
();
request
->
Accept
();
// If set, require a full frame.
if
(
this
->
rtpObjectEventEnabled
)
RequestFullFrame
(
true
);
break
;
}
default
:
default
:
{
{
MS_ERROR
(
"unknown method"
);
MS_ERROR
(
"unknown method"
);
...
@@ -276,6 +232,28 @@ namespace RTC
...
@@ -276,6 +232,28 @@ namespace RTC
RequestFullFrame
(
true
);
RequestFullFrame
(
true
);
}
}
void
Producer
::
SetRtpRawEvent
(
bool
enabled
)
{
MS_TRACE
();
this
->
rtpRawEventEnabled
=
enabled
;
// If set (and not paused), require a full frame.
if
(
this
->
rtpRawEventEnabled
&&
!
this
->
paused
)
RequestFullFrame
(
true
);
}
void
Producer
::
SetRtpObjectEvent
(
bool
enabled
)
{
MS_TRACE
();
this
->
rtpObjectEventEnabled
=
enabled
;
// If set (and not paused), require a full frame.
if
(
this
->
rtpObjectEventEnabled
&&
!
this
->
paused
)
RequestFullFrame
(
true
);
}
void
Producer
::
ReceiveRtpPacket
(
RTC
::
RtpPacket
*
packet
)
void
Producer
::
ReceiveRtpPacket
(
RTC
::
RtpPacket
*
packet
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/Router.cpp
浏览文件 @
0937e216
...
@@ -920,8 +920,49 @@ namespace RTC
...
@@ -920,8 +920,49 @@ namespace RTC
}
}
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_RAW_EVENT
:
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_RAW_EVENT
:
{
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
RTC
::
Producer
*
producer
;
try
{
producer
=
GetProducerFromRequest
(
request
);
}
catch
(
const
MediaSoupError
&
error
)
{
request
->
Reject
(
error
.
what
());
return
;
}
if
(
producer
==
nullptr
)
{
request
->
Reject
(
"Producer does not exist"
);
return
;
}
if
(
!
request
->
data
[
JsonStringEnabled
].
isBool
())
{
request
->
Reject
(
"Request has invalid data.enabled"
);
return
;
}
bool
enabled
=
request
->
data
[
JsonStringEnabled
].
asBool
();
producer
->
SetRtpRawEvent
(
enabled
);
request
->
Accept
();
break
;
}
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_OBJECT_EVENT
:
case
Channel
:
:
Request
::
MethodId
::
PRODUCER_SET_RTP_OBJECT_EVENT
:
{
{
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
RTC
::
Producer
*
producer
;
RTC
::
Producer
*
producer
;
try
try
...
@@ -942,7 +983,18 @@ namespace RTC
...
@@ -942,7 +983,18 @@ namespace RTC
return
;
return
;
}
}
producer
->
HandleRequest
(
request
);
if
(
!
request
->
data
[
JsonStringEnabled
].
isBool
())
{
request
->
Reject
(
"Request has invalid data.enabled"
);
return
;
}
bool
enabled
=
request
->
data
[
JsonStringEnabled
].
asBool
();
producer
->
SetRtpObjectEvent
(
enabled
);
request
->
Accept
();
break
;
break
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论