Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.4.0 bugfix 0905 #3772

Merged
merged 11 commits into from
Sep 5, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>声网建议你在加入频道前调用该方法。</p>
<p>该方法需要在加入频道前调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
Expand Down
1 change: 1 addition & 0 deletions dita/RTC-NG/API/api_irtcengine_getconnectionstate.dita
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;ConnectionStateType&gt; getConnectionState();</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title"/>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>加入频道前后均可调用。</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_irtcengine_setlocalvideodatasourceposition">
<title><ph keyref="setLocalVideoDataSourcePosition"/></title>
<shortdesc id="short"><ph id="shortdesc">设置视频帧的观测位置。</ph></shortdesc>
Suri539 marked this conversation as resolved.
Show resolved Hide resolved
<prolog>
<metadata>
<keywords>
<indexterm keyref="setLocalVideoDataSourcePosition"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java"/>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec"/>
<codeblock props="cpp unreal" outputclass="language-cpp"/>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp">public abstract int SetLocalVideoDataSourcePosition(VIDEO_MODULE_POSITION position);</codeblock>
<codeblock props="rn" outputclass="language-typescript"/>
<codeblock props="flutter" outputclass="language-dart"/> </p>
</section>
<section id="timing" deliveryTarget="details">
Suri539 marked this conversation as resolved.
Show resolved Hide resolved
<title>调用时机</title>
<p>该方法需要在创建第一个 <xref keyref="VideoSurface"/> 视图之前调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>该方法仅支持观测通过 <xref keyref="VideoSurface"/> 及其子类渲染的本地视频数据。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt>position</pt>
<pd>视频帧的观测位置,详见 <xref keyref="VIDEO_MODULE_POSITION"/>。
<note type="attention">
<ul><li>该方法目前仅支持将观测位置设为 <codeph><ph keyref="POSITION_POST_CAPTURER"/></codeph> 或 <codeph><ph keyref="POSITION_PRE_ENCODER"/></codeph>。</li>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个内容是不是更适合放到调用限制里;可以考虑把这俩观测位置对应的回调写出来,可能更好理解

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前跟研发确认过,这个方法跟 oncapture那些回调 还有 registervideoframeobserver 没有关系

<li>在 <codeph><ph keyref="POSITION_POST_CAPTURER"/></codeph> 处获取的视频帧未经裁剪且帧率较高,<codeph><ph keyref="POSITION_PRE_ENCODER"/></codeph> 位置获取的视频帧经过发送前的裁剪,帧率小于或等于摄像头采集的帧率。</li></ul></note></pd>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大部分写枚举的时候不用加 codeph,直接写 ph 就行了,目前比较多的是在 true/false 那里加 codeph

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是这个其实是要加代码格式的。。。

</plentry>
</parml> </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>
<ul props="native unreal bp electron unity rn cs">
<li>0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul> </section>
</refbody>
</reference>
1 change: 1 addition & 0 deletions dita/RTC-NG/API/api_irtcengineex_getconnectionstateex.dita
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;ConnectionStateType&gt; getConnectionStateEx(RtcConnection connection);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title"/>
<section id="timing" deliveryTarget="details" conkeyref="getConnectionState/timing"/>
<section id="restriction" deliveryTarget="details" conkeyref="getConnectionState/restriction"/>
<section id="parameters" deliveryTarget="details">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p props="native unreal bp unity cs">你可以在回调中获取本地设备采集到的原始视频数据,并可根据需要进行前处理。完成前处理后,你可以在该回调中直接修改 <parmname>videoFrame</parmname>,并将返回值设置为 <codeph><ph keyref="true"/></codeph>,即可将修改后的视频数据发送给 SDK。</p>
<p props="native unreal bp">如果你需要将处理后的数据发送给 SDK,需要先调用 <xref keyref="getVideoFrameProcessMode"/><codeph>(0)</codeph> 方法,将视频处理模式设置为读写模式。</p>
<p props="native unreal bp">如果你需要将处理后的数据发送给 SDK,需要先调用 <xref keyref="getVideoFrameProcessMode"/><codeph>(1)</codeph> 方法,将视频处理模式设置为读写模式。</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

别的平台我不太确定,但是 Android 平台不太适合这样写,因为如果是一个回调方法,一般不能直接传递参数来设置返回值,(除非你定义变量然后再额外写一个方法去获取视频模式的常量)所以写 getVideoFrameProcessMode(1) 不太对,应该在实现该方法时直接返回期望的处理模式。我扒了一下 Android 的示例代码,里面也是直接写的处理模式。
image

<p props="flutter rn electron">你可以在回调中获取本地设备采集到的原始视频数据。</p>
</section>
<section id="scenario" deliveryTarget="details">
Expand All @@ -49,7 +49,7 @@
<section id="restriction" deliveryTarget="details">
<title>使用限制</title>
<ul>
<li>此处获取的视频数据为原始视频数据,即:未经过水印、裁剪和旋转等前处理的视频数据。</li>
<li props="hide">此处获取的视频数据为原始视频数据,即:未经过水印、裁剪和旋转等前处理的视频数据。</li>
<li>如果你获取到的视频数据类型为 RGBA,SDK 不支持对 Alpha 通道的值进行处理。</li>
<li id="restric1">建议你在修改 <parmname>videoFrame</parmname> 中的参数时,需确保修改后的参数跟视频帧缓冲区中的视频帧实际情况保持一致,否则可能导致本地预览画面和对端的视频画面出现非预期的旋转、失真等问题。</li>
<li props="rn electron">建议你通过 C++ API 实现该回调。</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<p props="native unreal bp unity electron rn cs">完成处理后,你可以在该回调中,传入处理后的视频数据将其发送回 SDK。</p>
<note type="attention">
<ul>
<li props="native unreal bp">如果你需要将处理后的数据发送给 SDK,需要先调用 <xref keyref="getVideoFrameProcessMode"/><codeph>(1)</codeph> 方法,将视频处理模式设置为读写模式。</li>
<li props="native unreal bp cs">你需要通过 <xref keyref="getObservedFramePosition"/> 设置观测 <apiname keyref="POSITION_PRE_ENCODER"/>(1 &lt;&lt; 2) 后,才能使用该回调获取本地视频编码前的视频数据。</li>
<li props="unity">你需要通过 <xref keyref="registerVideoFrameObserver"/> 的 <parmname>position</parmname> 参数设置观测 <apiname keyref="POSITION_PRE_ENCODER"/>(1 &lt;&lt; 2) 后,才能使用该回调获取本地视频编码前的视频数据。</li>
<li props="rn electron">建议你通过 C++ API 实现该回调。</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<p>成功注册视频数据观测器后,SDK 会在捕捉到每个视频帧时触发该回调。你可以在回调中获取远端发送的渲染前的视频数据,然后根据场景需要,对视频数据进行处理。</p>
<note type="attention" props="native unreal bp electron rn flutter">
<ul>
<li props="native unreal bp">如果你需要将处理后的数据发送给 SDK,需要先调用 <xref keyref="getVideoFrameProcessMode"/><codeph>(1)</codeph> 方法,将视频处理模式设置为读写模式。</li>
<li>如果你获取到的视频数据类型为 RGBA,SDK 不支持对 Alpha 通道的值进行处理。</li>
<li props="rn electron">建议你通过 C++ API 实现该回调。</li>
<li props="flutter rn electron">由于框架的限制,该回调不支持将处理后的视频数据发送回 SDK。</li>
Expand Down
Loading
Loading