-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathapi_imediaengine_setexternalvideosource.dita
More file actions
93 lines (93 loc) · 5.86 KB
/
Copy pathapi_imediaengine_setexternalvideosource.dita
File metadata and controls
93 lines (93 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_imediaengine_setexternalvideosource">
<title><ph keyref="setExternalVideoSource" /></title>
<shortdesc id="short"><ph id="shortdesc">设置外部视频源。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="setExternalVideoSource" />
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract int setExternalVideoSource(
boolean enable, boolean useTexture, Constants.ExternalVideoSourceType sourceType);</codeblock>
<codeblock props="hmos" outputclass="language-arkts">public abstract setExternalVideoSource(enable: boolean, useTexture: boolean, sourceType: Constants.ExternalVideoSourceType): number;</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (void)setExternalVideoSource:(BOOL)enable useTexture:(BOOL)useTexture sourceType:(AgoraExternalVideoSourceType)sourceType;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">virtual int setExternalVideoSource(
bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType = VIDEO_FRAME,
rtc::SenderOptions encodedVideoOption = rtc::SenderOptions()) = 0;</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract setExternalVideoSource(
enabled: boolean,
useTexture: boolean,
sourceType?: ExternalVideoSourceType,
encodedVideoOption?: SenderOptions
): number;</codeblock>
<codeblock props="unity cs" outputclass="language-csharp">public abstract int SetExternalVideoSource(bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType, SenderOptions encodedVideoOption);</codeblock>
<codeblock props="rn" outputclass="language-typescript">abstract setExternalVideoSource(
enabled: boolean,
useTexture: boolean,
sourceType?: ExternalVideoSourceType,
encodedVideoOption?: SenderOptions
): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future<void> setExternalVideoSource(
{required bool enabled,
required bool useTexture,
ExternalVideoSourceType sourceType = ExternalVideoSourceType.videoFrame,
SenderOptions encodedVideoOption = const SenderOptions()});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p props="android cpp apple framework">调用该方法启用外部视频源后,你可以调用 <xref keyref="pushVideoFrame"/> 向 SDK 推送外部视频数据。</p>
<p props="hmos">调用该方法启用外部视频源后,你可以调用 <xref keyref="pushVideoFrame3"/> 向 SDK 推送外部视频数据。</p>
</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>
<pt props="android hmos apple">enable</pt>
<pt props="cpp framework">enabled</pt>
<pd>是否启用外部视频源:
<ul>
<li><codeph><ph keyref="true" /></codeph>: 启用外部视频源。SDK 准备接收外部视频帧。</li>
<li><codeph><ph keyref="false" /></codeph>:(默认)不启用外部视频源。</li>
</ul></pd>
</plentry>
<plentry>
<pt>useTexture</pt>
<pd>是否使用 Texture 格式的外部视频帧:
<ul>
<li><codeph><ph keyref="true" /></codeph>: 使用 Texture 格式的外部视频帧。</li>
<li><codeph><ph keyref="false" /></codeph>: 不使用 Texture 格式的外部视频帧。</li>
</ul></pd>
</plentry>
<plentry>
<pt>sourceType</pt>
<pd>外部视频帧是否编码,详见 <xref keyref="EXTERNAL_VIDEO_SOURCE_TYPE" />。</pd>
</plentry>
<plentry props="cpp framework">
<pt>encodedVideoOption</pt>
<pd>视频编码选项。如果 <parmname>sourceType</parmname> 为 <apiname keyref="ENCODED_VIDEO_FRAME" />,则需要设置该参数。你可以<xref keyref="ticket-link" />了解如何设置该参数。</pd>
</plentry>
</parml> </section>
<section id="return_values" props="android hmos cpp framework">
<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="android hmos cpp unreal bp electron unity rn cs">
<li>0:方法调用成功。</li>
<li>< 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul>
</section>
</refbody>
</reference>