Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
f3ffb583
提交
f3ffb583
authored
9月 10, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Consumer: select a desired RTP profile
上级
652dff13
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
179 行增加
和
27 行删除
+179
-27
Consumer.js
lib/Consumer.js
+36
-0
Request.hpp
worker/include/Channel/Request.hpp
+2
-1
Consumer.hpp
worker/include/RTC/Consumer.hpp
+17
-2
Producer.hpp
worker/include/RTC/Producer.hpp
+2
-2
ProducerListener.hpp
worker/include/RTC/ProducerListener.hpp
+2
-1
Router.hpp
worker/include/RTC/Router.hpp
+4
-1
RtpDictionaries.hpp
worker/include/RTC/RtpDictionaries.hpp
+14
-9
Transport.hpp
worker/include/RTC/Transport.hpp
+4
-1
Request.cpp
worker/src/Channel/Request.cpp
+2
-1
Consumer.cpp
worker/src/RTC/Consumer.cpp
+9
-1
Producer.cpp
worker/src/RTC/Producer.cpp
+4
-6
Router.cpp
worker/src/RTC/Router.cpp
+43
-1
RtpEncodingParameters.cpp
worker/src/RTC/RtpDictionaries/RtpEncodingParameters.cpp
+35
-0
Transport.cpp
worker/src/RTC/Transport.cpp
+4
-1
Worker.cpp
worker/src/Worker.cpp
+1
-0
没有找到文件。
lib/Consumer.js
浏览文件 @
f3ffb583
...
@@ -450,6 +450,42 @@ class Consumer extends EnhancedEventEmitter
...
@@ -450,6 +450,42 @@ class Consumer extends EnhancedEventEmitter
this
.
safeEmit
(
'resume'
,
'remote'
,
appData
);
this
.
safeEmit
(
'resume'
,
'remote'
,
appData
);
}
}
/**
* Sets the preferred RTP profile.
*
* @return {Boolean} true if paused.
*/
setPreferredProfile
(
profile
)
{
logger
.
debug
(
'setPreferredProfile()'
);
if
(
this
.
_closed
)
{
logger
.
error
(
'setPreferredProfile() | Consumer closed'
);
return
false
;
}
const
data
=
{
id
:
this
.
id
,
peerName
:
this
.
peer
.
name
,
profile
:
profile
};
this
.
_channel
.
request
(
'consumer.setPreferredProfile'
,
this
.
_internal
,
{
profile
})
.
then
(()
=>
{
logger
.
debug
(
'"consumer.setPreferredProfile" request succeeded'
);
this
.
emit
(
'@notify'
,
'preferredProfileSet'
,
data
);
})
.
catch
((
error
)
=>
{
logger
.
error
(
'"consumer.setPreferredProfile" request failed: %s'
,
String
(
error
));
});
}
_handleWorkerNotifications
()
_handleWorkerNotifications
()
{
{
// Subscribe to notifications.
// Subscribe to notifications.
...
...
worker/include/Channel/Request.hpp
浏览文件 @
f3ffb583
...
@@ -42,7 +42,8 @@ namespace Channel
...
@@ -42,7 +42,8 @@ namespace Channel
CONSUMER_DUMP
,
CONSUMER_DUMP
,
CONSUMER_ENABLE
,
CONSUMER_ENABLE
,
CONSUMER_PAUSE
,
CONSUMER_PAUSE
,
CONSUMER_RESUME
CONSUMER_RESUME
,
CONSUMER_SET_PREFERRED_PROFILE
};
};
private
:
private
:
...
...
worker/include/RTC/Consumer.hpp
浏览文件 @
f3ffb583
...
@@ -47,12 +47,13 @@ namespace RTC
...
@@ -47,12 +47,13 @@ namespace RTC
bool
IsEnabled
()
const
;
bool
IsEnabled
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
bool
IsPaused
()
const
;
bool
IsPaused
()
const
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
);
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
Rtp
EncodingParameters
::
Profile
profile
);
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
);
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
);
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
);
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
);
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
uint32_t
GetTransmissionRate
(
uint64_t
now
);
uint32_t
GetTransmissionRate
(
uint64_t
now
);
void
RequestFullFrame
();
void
RequestFullFrame
();
void
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
);
private
:
private
:
void
FillSupportedCodecPayloadTypes
();
void
FillSupportedCodecPayloadTypes
();
...
@@ -90,7 +91,8 @@ namespace RTC
...
@@ -90,7 +91,8 @@ namespace RTC
uint32_t
lastRecvRtpTimestamp
{
0
};
uint32_t
lastRecvRtpTimestamp
{
0
};
bool
syncRequired
{
true
};
bool
syncRequired
{
true
};
// RTP profiles.
// RTP profiles.
RTC
::
RtpProfile
effectiveProfile
{
RTC
::
RtpProfile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
preferredProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
effectiveProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
};
};
/* Inline methods. */
/* Inline methods. */
...
@@ -124,6 +126,19 @@ namespace RTC
...
@@ -124,6 +126,19 @@ namespace RTC
{
{
return
this
->
transmittedCounter
.
GetRate
(
now
)
+
this
->
retransmittedCounter
.
GetRate
(
now
);
return
this
->
transmittedCounter
.
GetRate
(
now
)
+
this
->
retransmittedCounter
.
GetRate
(
now
);
}
}
inline
void
Consumer
::
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
{
if
(
this
->
preferredProfile
==
profile
)
return
;
this
->
preferredProfile
=
profile
;
// TODO: Set it dynamically dynamic.
this
->
effectiveProfile
=
profile
;
this
->
syncRequired
=
true
;
RequestFullFrame
();
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/include/RTC/Producer.hpp
浏览文件 @
f3ffb583
...
@@ -76,7 +76,7 @@ namespace RTC
...
@@ -76,7 +76,7 @@ namespace RTC
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
ClearRtpStreams
();
void
ClearRtpStreams
();
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
RTC
::
RtpProfile
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
);
RTC
::
Rtp
EncodingParameters
::
Profile
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
);
/* Pure virtual methods inherited from RTC::RtpStreamRecv::Listener. */
/* Pure virtual methods inherited from RTC::RtpStreamRecv::Listener. */
public
:
public
:
...
@@ -103,7 +103,7 @@ namespace RTC
...
@@ -103,7 +103,7 @@ namespace RTC
// Allocated by this.
// Allocated by this.
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
rtpStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
rtpStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
mapRtxStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
mapRtxStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpProfile
>
rtpProfiles
;
std
::
map
<
uint32_t
,
RTC
::
Rtp
EncodingParameters
::
Profile
>
rtpProfiles
;
Timer
*
fullFrameRequestBlockTimer
{
nullptr
};
Timer
*
fullFrameRequestBlockTimer
{
nullptr
};
// Others.
// Others.
std
::
vector
<
RtpEncodingParameters
>
outputEncodings
;
std
::
vector
<
RtpEncodingParameters
>
outputEncodings
;
...
...
worker/include/RTC/ProducerListener.hpp
浏览文件 @
f3ffb583
...
@@ -16,7 +16,8 @@ namespace RTC
...
@@ -16,7 +16,8 @@ namespace RTC
virtual
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
=
0
;
virtual
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpEncodingParameters
::
Profile
profile
)
=
0
;
};
};
}
// namespace RTC
}
// namespace RTC
...
...
worker/include/RTC/Router.hpp
浏览文件 @
f3ffb583
...
@@ -67,7 +67,10 @@ namespace RTC
...
@@ -67,7 +67,10 @@ namespace RTC
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpEncodingParameters
::
Profile
profile
)
override
;
/* Pure virtual methods inherited from RTC::ConsumerListener. */
/* Pure virtual methods inherited from RTC::ConsumerListener. */
public
:
public
:
...
...
worker/include/RTC/RtpDictionaries.hpp
浏览文件 @
f3ffb583
...
@@ -31,14 +31,6 @@ namespace RTC
...
@@ -31,14 +31,6 @@ namespace RTC
static
std
::
map
<
Kind
,
Json
::
StaticString
>
kind2Json
;
static
std
::
map
<
Kind
,
Json
::
StaticString
>
kind2Json
;
};
};
enum
class
RtpProfile
:
uint8_t
{
DEFAULT
=
0
,
LOW
,
MEDIUM
,
HIGH
};
class
RtpCodecMimeType
class
RtpCodecMimeType
{
{
public
:
public
:
...
@@ -214,6 +206,19 @@ namespace RTC
...
@@ -214,6 +206,19 @@ namespace RTC
class
RtpEncodingParameters
class
RtpEncodingParameters
{
{
public
:
enum
class
Profile
:
uint8_t
{
DEFAULT
=
0
,
LOW
,
MEDIUM
,
HIGH
};
public
:
static
std
::
map
<
std
::
string
,
Profile
>
string2Profile
;
static
std
::
map
<
Profile
,
std
::
string
>
profile2String
;
public
:
public
:
RtpEncodingParameters
(){};
RtpEncodingParameters
(){};
explicit
RtpEncodingParameters
(
Json
::
Value
&
data
);
explicit
RtpEncodingParameters
(
Json
::
Value
&
data
);
...
@@ -234,7 +239,7 @@ namespace RTC
...
@@ -234,7 +239,7 @@ namespace RTC
bool
active
{
true
};
bool
active
{
true
};
std
::
string
encodingId
;
std
::
string
encodingId
;
std
::
vector
<
std
::
string
>
dependencyEncodingIds
;
std
::
vector
<
std
::
string
>
dependencyEncodingIds
;
RTC
::
RtpProfile
profile
{
RTC
::
Rtp
Profile
::
DEFAULT
};
Profile
profile
{
Profile
::
DEFAULT
};
};
};
class
RtpHeaderExtensionParameters
class
RtpHeaderExtensionParameters
...
...
worker/include/RTC/Transport.hpp
浏览文件 @
f3ffb583
...
@@ -153,7 +153,10 @@ namespace RTC
...
@@ -153,7 +153,10 @@ namespace RTC
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpEncodingParameters
::
Profile
profile
)
override
;
/* Pure virtual methods inherited from RTC::ConsumerListener. */
/* Pure virtual methods inherited from RTC::ConsumerListener. */
public
:
public
:
...
...
worker/src/Channel/Request.cpp
浏览文件 @
f3ffb583
...
@@ -37,7 +37,8 @@ namespace Channel
...
@@ -37,7 +37,8 @@ namespace Channel
{
"consumer.dump"
,
Request
::
MethodId
::
CONSUMER_DUMP
},
{
"consumer.dump"
,
Request
::
MethodId
::
CONSUMER_DUMP
},
{
"consumer.enable"
,
Request
::
MethodId
::
CONSUMER_ENABLE
},
{
"consumer.enable"
,
Request
::
MethodId
::
CONSUMER_ENABLE
},
{
"consumer.pause"
,
Request
::
MethodId
::
CONSUMER_PAUSE
},
{
"consumer.pause"
,
Request
::
MethodId
::
CONSUMER_PAUSE
},
{
"consumer.resume"
,
Request
::
MethodId
::
CONSUMER_RESUME
}
{
"consumer.resume"
,
Request
::
MethodId
::
CONSUMER_RESUME
},
{
"consumer.setPreferredProfile"
,
Request
::
MethodId
::
CONSUMER_SET_PREFERRED_PROFILE
}
};
};
// clang-format on
// clang-format on
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
f3ffb583
...
@@ -66,6 +66,8 @@ namespace RTC
...
@@ -66,6 +66,8 @@ namespace RTC
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
static
const
Json
::
StaticString
JsonStringEnabled
{
"enabled"
};
static
const
Json
::
StaticString
JsonStringPaused
{
"paused"
};
static
const
Json
::
StaticString
JsonStringPaused
{
"paused"
};
static
const
Json
::
StaticString
JsonStringSourcePaused
{
"sourcePaused"
};
static
const
Json
::
StaticString
JsonStringSourcePaused
{
"sourcePaused"
};
static
const
Json
::
StaticString
JsonStringPreferredProfile
{
"preferredProfile"
};
static
const
Json
::
StaticString
JsonStringEffectiveProfile
{
"effectiveProfile"
};
Json
::
Value
json
(
Json
::
objectValue
);
Json
::
Value
json
(
Json
::
objectValue
);
...
@@ -85,6 +87,12 @@ namespace RTC
...
@@ -85,6 +87,12 @@ namespace RTC
json
[
JsonStringSourcePaused
]
=
this
->
sourcePaused
;
json
[
JsonStringSourcePaused
]
=
this
->
sourcePaused
;
json
[
JsonStringPreferredProfile
]
=
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
preferredProfile
];
json
[
JsonStringEffectiveProfile
]
=
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
effectiveProfile
];
return
json
;
return
json
;
}
}
...
@@ -245,7 +253,7 @@ namespace RTC
...
@@ -245,7 +253,7 @@ namespace RTC
this
->
retransmittedCounter
.
Reset
();
this
->
retransmittedCounter
.
Reset
();
}
}
void
Consumer
::
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
void
Consumer
::
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
Rtp
EncodingParameters
::
Profile
profile
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
f3ffb583
...
@@ -303,13 +303,13 @@ namespace RTC
...
@@ -303,13 +303,13 @@ namespace RTC
if
(
this
->
paused
)
if
(
this
->
paused
)
return
;
return
;
RTC
::
RtpProfile
profile
;
RTC
::
Rtp
EncodingParameters
::
Profile
profile
;
try
try
{
{
profile
=
GetRtpProfile
(
packet
);
profile
=
GetRtpProfile
(
packet
);
}
}
catch
(
const
MediaSoupError
&
error
)
catch
(
const
MediaSoupError
&
error
)
{
{
return
;
return
;
}
}
...
@@ -418,11 +418,9 @@ namespace RTC
...
@@ -418,11 +418,9 @@ namespace RTC
return
;
return
;
}
}
else
{
// Run the timer.
// Run the timer.
this
->
fullFrameRequestBlockTimer
->
Start
(
FullFrameRequestBlockTimeout
);
this
->
fullFrameRequestBlockTimer
->
Start
(
FullFrameRequestBlockTimeout
);
}
for
(
auto
&
kv
:
this
->
rtpStreams
)
for
(
auto
&
kv
:
this
->
rtpStreams
)
{
{
...
@@ -588,7 +586,7 @@ namespace RTC
...
@@ -588,7 +586,7 @@ namespace RTC
}
}
}
}
RTC
::
RtpProfile
Producer
::
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
)
RTC
::
Rtp
EncodingParameters
::
Profile
Producer
::
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
)
{
{
auto
ssrc
=
packet
->
GetSsrc
();
auto
ssrc
=
packet
->
GetSsrc
();
...
...
worker/src/RTC/Router.cpp
浏览文件 @
f3ffb583
...
@@ -1071,6 +1071,47 @@ namespace RTC
...
@@ -1071,6 +1071,47 @@ namespace RTC
break
;
break
;
}
}
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_SET_PREFERRED_PROFILE
:
{
static
const
Json
::
StaticString
JsonStringProfile
{
"profile"
};
RTC
::
Consumer
*
consumer
;
try
{
consumer
=
GetConsumerFromRequest
(
request
);
}
catch
(
const
MediaSoupError
&
error
)
{
request
->
Reject
(
error
.
what
());
return
;
}
if
(
!
request
->
data
[
JsonStringProfile
].
isString
())
{
request
->
Reject
(
"missing data.profile"
);
return
;
}
std
::
string
profileStr
=
request
->
data
[
JsonStringProfile
].
asString
();
auto
it
=
RTC
::
RtpEncodingParameters
::
string2Profile
.
find
(
profileStr
);
if
(
it
==
RTC
::
RtpEncodingParameters
::
string2Profile
.
end
())
{
request
->
Reject
(
"unknown profile"
);
return
;
}
consumer
->
SetPreferredProfile
(
it
->
second
);
request
->
Accept
();
break
;
}
default
:
default
:
{
{
MS_ERROR
(
"unknown method"
);
MS_ERROR
(
"unknown method"
);
...
@@ -1329,7 +1370,8 @@ namespace RTC
...
@@ -1329,7 +1370,8 @@ namespace RTC
}
}
}
}
void
Router
::
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
void
Router
::
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpEncodingParameters
::
Profile
profile
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/RtpDictionaries/RtpEncodingParameters.cpp
浏览文件 @
f3ffb583
...
@@ -7,6 +7,26 @@
...
@@ -7,6 +7,26 @@
namespace
RTC
namespace
RTC
{
{
/* Class static data. */
// clang-format off
std
::
map
<
std
::
string
,
RTC
::
RtpEncodingParameters
::
Profile
>
RTC
::
RtpEncodingParameters
::
string2Profile
=
{
{
"default"
,
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
},
{
"low"
,
RTC
::
RtpEncodingParameters
::
Profile
::
LOW
},
{
"medium"
,
RTC
::
RtpEncodingParameters
::
Profile
::
MEDIUM
},
{
"high"
,
RTC
::
RtpEncodingParameters
::
Profile
::
HIGH
}
};
std
::
map
<
RTC
::
RtpEncodingParameters
::
Profile
,
std
::
string
>
RTC
::
RtpEncodingParameters
::
profile2String
=
{
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
,
"default"
},
{
RTC
::
RtpEncodingParameters
::
Profile
::
LOW
,
"low"
},
{
RTC
::
RtpEncodingParameters
::
Profile
::
MEDIUM
,
"medium"
},
{
RTC
::
RtpEncodingParameters
::
Profile
::
HIGH
,
"high"
}
};
// clang-format on
/* Instance methods. */
/* Instance methods. */
RtpEncodingParameters
::
RtpEncodingParameters
(
Json
::
Value
&
data
)
RtpEncodingParameters
::
RtpEncodingParameters
(
Json
::
Value
&
data
)
...
@@ -23,6 +43,7 @@ namespace RTC
...
@@ -23,6 +43,7 @@ namespace RTC
static
const
Json
::
StaticString
JsonStringActive
{
"active"
};
static
const
Json
::
StaticString
JsonStringActive
{
"active"
};
static
const
Json
::
StaticString
JsonStringEncodingId
{
"encodingId"
};
static
const
Json
::
StaticString
JsonStringEncodingId
{
"encodingId"
};
static
const
Json
::
StaticString
JsonStringDependencyEncodingIds
{
"dependencyEncodingIds"
};
static
const
Json
::
StaticString
JsonStringDependencyEncodingIds
{
"dependencyEncodingIds"
};
static
const
Json
::
StaticString
JsonStringProfile
{
"profile"
};
if
(
!
data
.
isObject
())
if
(
!
data
.
isObject
())
MS_THROW_ERROR
(
"RtpEncodingParameters is not an object"
);
MS_THROW_ERROR
(
"RtpEncodingParameters is not an object"
);
...
@@ -84,6 +105,17 @@ namespace RTC
...
@@ -84,6 +105,17 @@ namespace RTC
this
->
dependencyEncodingIds
.
push_back
(
entry
.
asString
());
this
->
dependencyEncodingIds
.
push_back
(
entry
.
asString
());
}
}
}
}
// profile is optional.
if
(
data
[
JsonStringProfile
].
isString
())
{
std
::
string
profileStr
=
data
[
JsonStringProfile
].
asString
();
if
(
string2Profile
.
find
(
profileStr
)
==
string2Profile
.
end
())
MS_THROW_ERROR
(
"unknown profile"
);
this
->
profile
=
string2Profile
[
profileStr
];
}
}
}
Json
::
Value
RtpEncodingParameters
::
ToJson
()
const
Json
::
Value
RtpEncodingParameters
::
ToJson
()
const
...
@@ -100,6 +132,7 @@ namespace RTC
...
@@ -100,6 +132,7 @@ namespace RTC
static
const
Json
::
StaticString
JsonStringActive
{
"active"
};
static
const
Json
::
StaticString
JsonStringActive
{
"active"
};
static
const
Json
::
StaticString
JsonStringEncodingId
{
"encodingId"
};
static
const
Json
::
StaticString
JsonStringEncodingId
{
"encodingId"
};
static
const
Json
::
StaticString
JsonStringDependencyEncodingIds
{
"dependencyEncodingIds"
};
static
const
Json
::
StaticString
JsonStringDependencyEncodingIds
{
"dependencyEncodingIds"
};
static
const
Json
::
StaticString
JsonStringProfile
{
"profile"
};
Json
::
Value
json
(
Json
::
objectValue
);
Json
::
Value
json
(
Json
::
objectValue
);
...
@@ -149,6 +182,8 @@ namespace RTC
...
@@ -149,6 +182,8 @@ namespace RTC
}
}
}
}
json
[
JsonStringProfile
]
=
RtpEncodingParameters
::
profile2String
[
this
->
profile
];
return
json
;
return
json
;
}
}
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/Transport.cpp
浏览文件 @
f3ffb583
...
@@ -1555,7 +1555,10 @@ namespace RTC
...
@@ -1555,7 +1555,10 @@ namespace RTC
// Do nothing.
// Do nothing.
}
}
void
Transport
::
OnProducerRtpPacket
(
RTC
::
Producer
*
/*producer*/
,
RTC
::
RtpPacket
*
/*packet*/
,
RTC
::
RtpProfile
/*profile*/
)
void
Transport
::
OnProducerRtpPacket
(
RTC
::
Producer
*
/*producer*/
,
RTC
::
RtpPacket
*
/*packet*/
,
RTC
::
RtpEncodingParameters
::
Profile
/*profile*/
)
{
{
// Do nothing.
// Do nothing.
}
}
...
...
worker/src/Worker.cpp
浏览文件 @
f3ffb583
...
@@ -259,6 +259,7 @@ void Worker::OnChannelRequest(Channel::UnixStreamSocket* /*channel*/, Channel::R
...
@@ -259,6 +259,7 @@ void Worker::OnChannelRequest(Channel::UnixStreamSocket* /*channel*/, Channel::R
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_ENABLE
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_ENABLE
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_PAUSE
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_PAUSE
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_RESUME
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_RESUME
:
case
Channel
:
:
Request
::
MethodId
::
CONSUMER_SET_PREFERRED_PROFILE
:
{
{
RTC
::
Router
*
router
;
RTC
::
Router
*
router
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论