Skip to content

Commit

Permalink
Merge pull request #3684 from AgoraIO/api-ld-batch3
Browse files Browse the repository at this point in the history
ld batch3
  • Loading branch information
Cilla-luodan authored Jul 9, 2024
2 parents edece7f + d8663cc commit a48e9fe
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ol> </p>
<note type="attention">
<ul>
<li>请在加入频道前调用该方法。</li>
<li>该方法需要在加入频道前调用。</li>
</ul></note> </section>
<section id="parameters">
<title>参数</title>
Expand Down
31 changes: 18 additions & 13 deletions dita/RTC-NG/API/api_imediaengine_registervideoframeobserver.dita
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,29 @@
<codeblock props="flutter" outputclass="language-dart">void registerVideoFrameObserver(VideoFrameObserver observer);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>如果你想要观测原始视频帧 (如 YUV 或 RGBA 格式),声网推荐你通过该方法注册一个 <xref keyref="IVideoFrameObserver"/> 类。</p>
<p>调用该方法注册视频观测器时,你可以根据需要注册 <apiname keyref="IVideoFrameObserver"/> 类中的回调。在成功注册视频观测器后,SDK 会在捕捉到每个视频帧时,触发你所注册的上述回调。</p>
<p conkeyref="registerVideoEncodedFrameObserver/mix"/>
<note type="attention">
<ul>
<li>该方法需要在加入频道前调用。</li>
<li>在处理回调时,你需要考虑视频帧中 <parmname>width</parmname> 和 <parmname>height</parmname> 参数的变化,因为观测得到的视频帧可能会随以下情况变化:

<ul id="ul_qms_zys_r4b">
</section>
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p>注册原始视频观测器后,你可以将获取到的原始视频数据应用于各种视频前处理场景,例如自行实现虚拟背景、美颜等场景。</p>
<p props="android ios">声网在 GitHub 上提供了开源的示例项目 <xref keyref="beautyapi-link"/> 供你参考。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道前调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>在处理回调时,你需要考虑视频帧中 <parmname>width</parmname> 和 <parmname>height</parmname> 参数的变化,因为观测得到的视频帧可能会随以下情况变化:
<ul>
<li>当网络状况差时,分辨率会阶梯式下降。</li>
<li>当用户自行调整分辨率时,回调中报告的分辨率也会变化。</li>
</ul></li>
</ul> </note>
<note type="tip" props="android ios">注册原始视频观测器后,你可以将获取到的原始视频数据应用于各种视频前处理场景,例如自行实现虚拟背景、美颜等场景,声网在 GitHub 上提供了开源的示例项目 <xref keyref="beautyapi-link"/> 供你参考。
</note></section>
<section id="parameters">
</ul></p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
23 changes: 17 additions & 6 deletions dita/RTC-NG/API/api_irtcengine_enableencryption.dita
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@
{required bool enabled, required EncryptionConfig config});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<p id="desc1">在安全要求较高的场景下,建议你在加入频道前,调用本方法开启内置加密。</p>
<p id="desc2">同一频道内所有用户必须使用相同的加密模式和密钥。用户离开频道后,SDK 会自动关闭加密。如需重新开启加密,你需要在用户再次加入频道前调用该方法。</p>
<note type="attention">如果开启了内置加密,则不能使用旁路推流功能。</note> </section>
<section id="parameters">
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>用户离开频道后,SDK 会自动关闭加密。如需重新开启加密,你需要在用户再次加入频道前调用该方法。</p>
</section>
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p>对安全要求较高的场景。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道前调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<ul><li>同一频道内的所有用户在调用该方法时,必须设置相同的加密模式和密钥。</li>
<li>如果开启了内置加密,则不能使用旁路推流功能。</li></ul>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry id="enable">
Expand Down
14 changes: 10 additions & 4 deletions dita/RTC-NG/API/api_irtcengine_enableinstantmediarendering.dita
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,27 @@
<codeblock props="rn" outputclass="language-typescript">abstract enableInstantMediaRendering(): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;void> enableInstantMediaRendering();</codeblock> </p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.1.1</dd>
</dlentry>
</dl>
<p>成功调用该方法后,SDK 会开启加速出图和出声模式,可加快用户加入频道后的首帧出图与出声速度。</p>
<note type="attention">一旦开启快速渲染功能,只能通过调用 <xref keyref="release"/> 方法销毁 <apiname keyref="IRtcEngine"/> 对象来取消。</note>
</section>
<section id="scenario">
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p>声网推荐在直播场景下,对观众开启该模式。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>声网建议你在加入频道前调用该方法。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>一旦成功调用该方法,只能通过调用 <xref keyref="release"/> 方法销毁 <apiname keyref="IRtcEngine"/> 对象来取消加速渲染。</p>
</section>
<section id="return_values">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></p>
Expand Down
17 changes: 12 additions & 5 deletions dita/RTC-NG/API/api_irtcengine_getcallid.dita
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;String&gt; getCallId();</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p id="detail">客户端在每次加入频道后会生成一个对应的 <parmname>callId</parmname>,标识该客户端的此次通话。你可以调用该方法获取 <parmname>callId</parmname> 参数,然后在调用 <xref keyref="rate" />、<xref keyref="complain" /> 等方法时填入。</p>
<note id="seq" type="attention">该方法需要在加入频道后调用。</note> </section>
<section id="parameters" props="cpp unreal bp unity cs">
<title>参数</title>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry id="callid">
<pt>callId</pt>
Expand Down
37 changes: 24 additions & 13 deletions dita/RTC-NG/API/api_irtcengine_setlocalrendermode2.dita
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,21 @@
VideoMirrorModeType.videoMirrorModeAuto});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<p>初始化本地用户视图后,你可以调用该方法更新本地用户视图的渲染和镜像模式。该方法只影响本地用户看到的视频画面,不影响本地发布视频。</p>
<note type="attention">
<ul>
<li props="native unreal bp electron flutter unity cs">请在调用 <xref keyref="setupLocalVideo" /> 方法初始化本地视图后,调用该方法。</li>
<li>你可以在通话中多次调用该方法,多次更新本地用户视图的显示模式。</li>
<li props="cpp bp unreal apple electron unity cs flutter">该方法仅对第一个摄像头 <codeph>(<ph keyref="PRIMARY_CAMERA_SOURCE"/>)</codeph> 生效。在自定义视频采集或使用其他类型视频源的场景下,你需要使用 <xref keyref="setupLocalVideo"/> 方法替代该方法。</li>
</ul> </note> </section>
<section id="parameters">
<title>参数</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>初始化本地用户视图后,你可以调用该方法更新本地用户视图的渲染和镜像模式。该方法只影响本地用户看到的视频画面,不影响本地视频的发布。</p>
</section>
<section id="timing" deliveryTarget="details">
<title><ph props="native unreal bp electron rn flutter">调用时机</ph></title>
<ul props="native unreal bp electron rn flutter"><li>请在调用 <xref keyref="setupLocalVideo" /> 方法初始化本地视图后,调用该方法。</li>
<li>你可以在通话中多次调用该方法,多次更新本地用户视图的显示模式。</li></ul>
</section>
<section id="restriction" deliveryTarget="details">
<title><ph props="native unreal bp electron rn flutter">调用限制</ph></title>
<p props="cpp bp unreal apple electron flutter">该方法仅对第一个摄像头 <codeph>(<ph keyref="PRIMARY_CAMERA_SOURCE"/>)</codeph> 生效。在自定义视频采集或使用其他类型视频源的场景下,你需要使用 <xref keyref="setupLocalVideo"/> 方法替代该方法。</p>
<p props="android hmos rn">无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt props="android cpp unreal bp unity flutter rn electron cs">renderMode</pt>
Expand All @@ -57,12 +61,19 @@
<ul id="rendermodetype">
<li><ph keyref="RENDER_MODE_HIDDEN" /> (1):优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,多出的视频将被截掉。</li>
<li><ph keyref="RENDER_MODE_FIT" /> (2):优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频长宽与显示窗口不同,视窗上未被填满的区域将被涂黑。</li>
<li><ph keyref="RENDER_MODE_ADAPTIVE" /> (3): 该模式已废弃,不推荐使用。</li>
<li><ph keyref="RENDER_MODE_ADAPTIVE" /> (3):匹配模式。
<dl outputclass="deprecated">
<dlentry>
<dt>弃用:</dt>
<dd>该枚举已废弃,不推荐使用。</dd>
</dlentry>
</dl>
</li>
</ul> </p>
</pd>
</plentry>
<plentry>
<pt props="android cpp unreal bp unity flutter rn electron cs">mirrorMode</pt>
<pt props="android hmos cpp unreal bp unity flutter rn electron cs">mirrorMode</pt>
<pt props="ios mac">mirror</pt>
<pd>
<p props="ios mac cpp unreal bp unity flutter rn electron cs">本地视图的镜像模式,详见 <xref keyref="VIDEO_MIRROR_MODE_TYPE" />。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;void&gt; setRemoteDefaultVideoStreamType(VideoStreamType streamType);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="deprecated" props="android">
<dlentry>
<dt>弃用:</dt>
Expand All @@ -35,13 +34,17 @@
</dl>
<p conkeyref="setRemoteVideoStreamType/desc1"/>
<p conkeyref="setRemoteVideoStreamType/desc2"/>
<note type="attention" id="note">
<ul>
<li>该方法只能在加入频道前调用。SDK 不支持你在加入频道后修改默认订阅的视频流类型。</li>
<li>如果你既调用了该方法,也调用了 <xref keyref="setRemoteVideoStreamType" />,则 SDK 以 <apiname keyref="setRemoteVideoStreamType" /> 中的设置为准。</li>
</ul></note> </section>
<section id="parameters">
<title>参数</title>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法只能在加入频道前调用。SDK 不支持你在加入频道后修改默认订阅的视频流类型。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>如果你既调用了该方法,也调用了 <xref keyref="setRemoteVideoStreamType" />,则 SDK 以 <apiname keyref="setRemoteVideoStreamType" /> 中的设置为准。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt>streamType</pt>
Expand Down
Loading

0 comments on commit a48e9fe

Please sign in to comment.