Skip to content

Commit

Permalink
Merge branch 'release/rtc-ng/4.2.3' of github.com:AgoraIO/agora_doc_s…
Browse files Browse the repository at this point in the history
…ource into release/rtc-ng/4.2.3
  • Loading branch information
Cilla-luodan committed Sep 19, 2023
2 parents 2a89ec3 + ea4f7a5 commit ac77927
Show file tree
Hide file tree
Showing 23 changed files with 520 additions and 36 deletions.
22 changes: 10 additions & 12 deletions dita/RTC-NG/API/api_irtcengine_enablecontentinspect.dita
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_irtcengine_enablecontentinspect">
<title><ph keyref="enableContentInspect"/></title>
<shortdesc id="short"><ph id="shortdesc"><ph>开启/关闭视频截图上传。</ph><ph props="hide">开启/关闭视频内容审核。</ph></ph></shortdesc>
<shortdesc id="short"><ph id="shortdesc">开启/关闭视频截图上传。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
Expand Down Expand Up @@ -32,28 +32,26 @@
<section id="detailed_desc">
<title>详情</title>
<p>开启视频截图上传后,SDK 会根据你在 <xref keyref="ContentInspectConfig"/> 中设置的模块类型和频率对本地用户发送的视频进行截图和上传。截图完成后,声网服务器会以 HTTPS 请求的形式,向你的服务器发送回调通知,并将所有截图发送至你指定的第三方云存储。</p>
<p props="hide">开启视频内容审核后,SDK 会根据你在 <xref keyref="ContentInspectConfig"/> 中设置的内容审核模块类型和频率对本地用户发送的视频进行截图、审核和上传。审核完成后,声网内容审核服务器会以 HTTPS 请求的形式,向你的服务器发送审核结果,并将指定类型的截图发送至你指定的第三方云存储。</p>
<note>
<ul>
<li><ph>调用该方法前,请确保已<xref keyref="ticket-link"/>开通视频截图上传服务。</ph><ph props="hide">调用该方法前,请确保已<xref keyref="ticket-link"/>开通视频内容审核服务。详见 <xref keyref="enable-content-inspect"/>。</ph></li>
<li>该方法依赖于视频截图上传动态库 <codeph><ph keyref="moderation"/></codeph>,如果删除该动态库会导致无法正常开启该功能。</li>
</ul></note> </section>
<note>调用该方法前,请确保已<xref keyref="ticket-link"/>开通视频截图上传服务。</note>
</section>
<section id="parameters">
<title>参数</title>
<parml>
<plentry>
<plentry id="enabled">
<pt>enabled</pt>
<pd>设置是否开启<ph>视频截图上传</ph><ph props="hide">视频内容审核</ph>:


<ul>
<li><codeph><ph keyref="true"/></codeph>:<ph>开启视频截图上传</ph>。<ph props="hide">开启视频内容审核。</ph></li>
<li><codeph><ph keyref="false"/></codeph>:<ph>关闭视频截图上传</ph>。<ph props="hide">关闭视频内容审核。</ph></li>
<li><codeph><ph keyref="true"/></codeph>:开启视频截图上传</li>
<li><codeph><ph keyref="false"/></codeph>:关闭视频截图上传</li>
</ul></pd>
</plentry>
<plentry>
<plentry id="config">
<pt>config</pt>
<pd><ph>视频截图上传配置。</ph><ph props="hide">视频内容审核配置。</ph><ph>详见 <xref keyref="ContentInspectConfig"/>。</ph></pd>
<pd><ph>视频截图上传配置。详见 <xref keyref="ContentInspectConfig"/>。</ph>
<note>视频审核模块选择声网自研插件截图上传(<ph keyref="CONTENT_INSPECT_SUPERVISE"/>)时需集成视频截图上传动态库 <codeph><ph keyref="moderation"/></codeph>,如果删除该动态库会导致无法正常开启视频截图上传功能。</note>
</pd>
</plentry>
</parml> </section>
<section id="return_values">
Expand Down
60 changes: 60 additions & 0 deletions dita/RTC-NG/API/api_irtcengine_isfeatureavailableondevice.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_irtcengine_isfeatureavailableondevice">
<title><ph keyref="isFeatureAvailableOnDevice"/></title>
<shortdesc id="short"><ph id="shortdesc">查询设备是否支持指定进阶功能。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="isFeatureAvailableOnDevice"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract boolean isFeatureAvailableOnDevice(int type);</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (BOOL)isFeatureAvailableOnDevice:(AgoraFeatureType)type;</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual bool isFeatureAvailableOnDevice(FeatureType type) = 0;</codeblock>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript">abstract isFeatureAvailableOnDevice(type: FeatureType): boolean;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;bool&gt; isFeatureAvailableOnDevice(FeatureType type);</codeblock> </p>
</section>
<section id="detailed_desc">
<title>详情</title>
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.2.3</dd>
</dlentry>
</dl>
<p>查询当前设备能力是否满足虚拟背景、美颜等进阶功能的要求。</p>
</section>
<section id="scenario">
<title>适用场景</title>
<p>在使用进阶音视频功能前,你可以根据查询结果判断当前设备是否支持这些功能,从而避免在低端设备上开启进阶功能导致性能下降或功能不可用的问题。开发者可以根据 <apiname keyref="isFeatureAvailableOnDevice"/> 的返回值,决定是否显示或启用相应的功能按钮,或者提示用户不支持指定功能。</p>
</section>
<section id="parameters">
<title>参数</title>
<parml>
<plentry>
<pt>type</pt>
<pd props="cpp apple framework">进阶功能类型,详见 <xref keyref="FeatureType"/>。</pd>
<pd props="android">
<p>进阶功能类型:
<ul>
<li><ph keyref="VIDEO_VIRTUAL_BACKGROUND" /> (1):虚拟背景功能。</li>
<li><ph keyref="VIDEO_BEAUTY_EFFECT" /> (2):美颜功能。</li>
</ul></p>
</pd>
</plentry>
</parml> </section>
<section id="return_values">
<title>返回值</title>
<ul>
<li><codeph><ph keyref="true" /></codeph>: 设备支持指定进阶功能。</li>
<li><codeph><ph keyref="false" /></codeph>: 设备不支持指定进阶功能。</li>
</ul> </section>
</refbody>
</reference>
67 changes: 67 additions & 0 deletions dita/RTC-NG/API/api_irtcengineex_enablecontentinspectex.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_irtcengineex_enablecontentinspectex">
<title><ph keyref="enableContentInspectEx"/></title>
<shortdesc id="short"><ph id="shortdesc">开启/关闭视频截图上传。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="enableContentInspectEx"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract int enableContentInspectEx(
boolean enabled, ContentInspectConfig config, RtcConnection connection);</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (int)enableContentInspectEx:(BOOL)enabled config:(AgoraContentInspectConfig* _Nonnull)config connection:(AgoraRtcConnection * _Nonnull)connection NS_SWIFT_NAME(enableContentInspectEx(_:config:connection:));</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual int enableContentInspectEx(bool enabled, const media::ContentInspectConfig &amp;config, const RtcConnection&amp; connection) = 0;</codeblock>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript">abstract enableContentInspectEx(
enabled: boolean,
config: ContentInspectConfig,
connection: RtcConnection
): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;void&gt; enableContentInspectEx(
{required bool enabled,
required ContentInspectConfig config,
required RtcConnection connection});</codeblock> </p>
</section>
<section id="detailed_desc">
<title>详情</title>
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.2.3</dd>
</dlentry>
</dl>
<p>该方法可以对多条视频流截图并上传。开启视频截图上传后,SDK 会根据你在 <xref keyref="ContentInspectConfig"/> 中设置的模块类型和频率对本地用户发送的视频进行截图和上传。截图完成后,声网服务器会以 HTTPS 请求的形式,向你的服务器发送回调通知,并将所有截图发送至你指定的第三方云存储。</p>
<note>调用该方法前,请确保已<xref keyref="ticket-link"/>开通视频截图上传服务。</note>
</section>
<section id="parameters">
<title>参数</title>
<parml>
<plentry conkeyref="enableContentInspect/enabled">
<pt/>
<pd/>
</plentry>
<plentry conkeyref="enableContentInspect/config">
<pt/>
<pd/>
</plentry>
<plentry conkeyref="joinChannelEx/connection">
<pt/>
<pd/>
</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>
<li props="native unreal bp unity rn electron cs">0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul></section>
</refbody>
</reference>
61 changes: 45 additions & 16 deletions dita/RTC-NG/API/class_contentinspectconfig.dita
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
<codeblock props="android">public class ContentInspectConfig {
public final static int CONTENT_INSPECT_TYPE_INVALID = 0;
public final static int CONTENT_INSPECT_TYPE_SUPERVISE = 2;
public final static int CONTENT_INSPECT_TYPE_IMAGE_MODERATION = 3;
public static final int MAX_CONTENT_INSPECT_MODULE_COUNT = 32;
public String extraInfo;
public String serverConfig;
public ContentInspectModule[] modules;
public int moduleCount;

Expand All @@ -22,29 +24,41 @@
type = CONTENT_INSPECT_TYPE_INVALID;
interval = 0;
}
}></codeblock>
}

public ContentInspectConfig() {
modules = new ContentInspectModule[MAX_CONTENT_INSPECT_MODULE_COUNT];
for (int i = 0; i &lt; MAX_CONTENT_INSPECT_MODULE_COUNT; i++) {
modules[i] = new ContentInspectModule();
}
moduleCount = 0;
}
}</codeblock>
<codeblock props="ios mac">__attribute__((visibility("default"))) @interface AgoraContentInspectConfig: NSObject
@property (nonatomic, copy) NSString* _Nullable extraInfo;
@property (nonatomic, copy) NSString* _Nullable serverConfig;
@property(copy, nonatomic) NSArray&lt;AgoraContentInspectModule*&gt;* _Nullable modules;
@end</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">struct ContentInspectConfig {
const char* extraInfo;

const char* serverConfig;

ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
int moduleCount;
ContentInspectConfig&amp; operator=(const ContentInspectConfig&amp; rth)
{
extraInfo = rth.extraInfo;
serverConfig = rth.serverConfig;
moduleCount = rth.moduleCount;
memcpy(&amp;modules, &amp;rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
return *this;
}
ContentInspectConfig() :extraInfo(NULL), moduleCount(0){}
ContentInspectConfig() :extraInfo(NULL), serverConfig(NULL), moduleCount(0){}
};</codeblock>
<codeblock props="electron" outputclass="language-typescript">export class ContentInspectConfig {

extraInfo?: string;

modules?: ContentInspectModule[];

moduleCount?: number;
Expand All @@ -65,26 +79,33 @@

extraInfo?: string;

serverConfig?: string;

modules?: ContentInspectModule[];

moduleCount?: number;
}</codeblock>
<codeblock props="flutter" outputclass="language-dart">class ContentInspectConfig {
<codeblock props="flutter" outputclass="language-dart">@JsonSerializable(explicitToJson: true, includeIfNull: false)
class ContentInspectConfig {
const ContentInspectConfig(
{this.extraInfo, this.serverConfig, this.modules, this.moduleCount});

const ContentInspectConfig({this.extraInfo, this.modules, this.moduleCount});
@JsonKey(name: 'extraInfo')
@JsonKey(name: &#x27;extraInfo&#x27;)
final String? extraInfo;

@JsonKey(name: 'modules')
final List&lt;ContentInspectModule>? modules;
@JsonKey(name: &#x27;serverConfig&#x27;)
final String? serverConfig;

@JsonKey(name: &#x27;modules&#x27;)
final List&lt;ContentInspectModule&gt;? modules;

@JsonKey(name: 'moduleCount')
@JsonKey(name: &#x27;moduleCount&#x27;)
final int? moduleCount;

factory ContentInspectConfig.fromJson(Map&lt;String, dynamic> json) =>
factory ContentInspectConfig.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
_$ContentInspectConfigFromJson(json);

Map&lt;String, dynamic> toJson() => _$ContentInspectConfigToJson(this);
Map&lt;String, dynamic&gt; toJson() =&gt; _$ContentInspectConfigToJson(this);
}</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
Expand All @@ -93,15 +114,19 @@
<parml>
<plentry props="android">
<pt>CONTENT_INSPECT_TYPE_INVALID</pt>
<pd>(默认)无实际功能。请不要将 <parmname>type</parmname> 设为该值。</pd>
<pd>0:(默认)无实际功能。请不要将 <parmname>type</parmname> 设为该值。</pd>
</plentry>
<plentry props="hide">
<pt>CONTENT_INSPECT_TYPE_MODERATION</pt>
<pd>视频鉴黄。SDK 会对本地用户发送的视频进行截图、鉴黄,并将截图和审核结果上传。</pd>
<pd>1:视频鉴黄。SDK 会对本地用户发送的视频进行截图、鉴黄,并将截图和审核结果上传。</pd>
</plentry>
<plentry props="android">
<pt>CONTENT_INSPECT_SUPERVISE</pt>
<pd>视频截图上传。SDK 会对本地用户发送的视频进行截图并上传。</pd>
<pt>CONTENT_INSPECT_TYPE_SUPERVISE</pt>
<pd>2:使用声网自研插件截图上传。SDK 会对本地用户发送的视频进行截图并上传。</pd>
</plentry>
<plentry props="android">
<pt>CONTENT_INSPECT_TYPE_IMAGE_MODERATION</pt>
<pd>3:使用云市场插件截图上传。SDK 会使用云市场视频审核插件对视频流进行截图并上传。</pd>
</plentry>
<plentry props="native unreal bp electron rn flutter">
<pt>extraInfo</pt>
Expand All @@ -111,6 +136,10 @@
<p props="hide">SDK 会将附加信息和截图一起上传至声网内容审核服务器;审核完成后,声网内容审核服务器会将附加信息随审核结果一起发送给你的服务器。</p>
</pd>
</plentry>
<plentry props="native rn flutter unity">
<pt>serverConfig</pt>
<pd>(可选)云市场视频截图上传相关服务端配置,该参数仅在 <xref keyref="ContentInspectModule"/> 中的 <codeph>type</codeph> 设置为 <ph keyref="CONTENT_INSPECT_IMAGE_MODERATION"/> 时生效。如需使用,请<xref keyref="ticket-link" />。</pd>
</plentry>
<plentry>
<pt>modules</pt>
<pd>
Expand Down
3 changes: 2 additions & 1 deletion dita/RTC-NG/API/class_contentinspectmodule.dita
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<ul>
<li><ph keyref="CONTENT_INSPECT_INVALID"/>(0):(默认)该功能模块无实际功能。请不要设为该值。</li>
<li props="hide"><ph keyref="CONTENT_INSPECT_MODERATION"/>(1):视频鉴黄。SDK 会对视频流进行截图、鉴黄,并将截图和审核结果上传。</li>
<li><ph keyref="CONTENT_INSPECT_SUPERVISE"/>(2):视频截图上传。SDK 会对视频流进行截图并上传。</li>
<li><ph keyref="CONTENT_INSPECT_SUPERVISE"/>(2):使用声网自研插件截图上传。SDK 会对视频流进行截图并上传。</li>
<li><ph keyref="CONTENT_INSPECT_IMAGE_MODERATION"/>(3):使用云市场插件截图上传。SDK 会使用云市场视频审核插件对视频流进行截图并上传。</li>
</ul></p>
</pd>
</plentry>
Expand Down
6 changes: 5 additions & 1 deletion dita/RTC-NG/API/enum_contentinspecttype.dita
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
</plentry>
<plentry>
<pt><ph keyref="CONTENT_INSPECT_SUPERVISE"/></pt>
<pd>2:视频截图。SDK 会对视频流进行截图并上传。</pd>
<pd>2:使用声网自研插件截图上传。SDK 会对视频流进行截图并上传。</pd>
</plentry>
<plentry>
<pt><ph keyref="CONTENT_INSPECT_IMAGE_MODERATION"/></pt>
<pd>3:使用云市场插件截图上传。SDK 会使用云市场视频审核插件对视频流进行截图并上传。</pd>
</plentry>
</parml> </section>
</refbody>
Expand Down
28 changes: 28 additions & 0 deletions dita/RTC-NG/API/enum_featuretype.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="enum_featuretype">
<title><ph keyref="FeatureType"/></title>
<shortdesc id="short"><ph id="shortdesc">进阶功能类型。</ph></shortdesc>
<refbody>
<section id="detailed_desc">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.2.3</dd>
</dlentry>
</dl>
</section>
<section id="parameters">
<title>枚举值</title>
<parml>
<plentry>
<pt><ph keyref="VIDEO_VIRTUAL_BACKGROUND"/></pt>
<pd>1: 虚拟背景功能。</pd>
</plentry>
<plentry>
<pt><ph keyref="VIDEO_BEAUTY_EFFECT"/></pt>
<pd>2: 美颜功能。</pd>
</plentry>
</parml>
</section></refbody>
</reference>
Loading

0 comments on commit ac77927

Please sign in to comment.