Skip to content

Commit

Permalink
NMS-21800
Browse files Browse the repository at this point in the history
  • Loading branch information
Cilla-luodan committed Jul 12, 2024
1 parent f95c349 commit c875520
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 36 deletions.
32 changes: 18 additions & 14 deletions dita/RTC-NG/API/class_externalvideoframe.dita
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
eglContext(NULL),
eglType(EGL_CONTEXT10),
textureId(0),
metadata_buffer(NULL),
metadata_size(0),
metadataBuffer(NULL),
metadataSize(0),
alphaBuffer(NULL),
fillAlphaBuffer(false),
alphaStitchMode(0),
d3d11_texture_2d(NULL),
texture_slice_index(0){}
d3d11Texture2d(NULL),
textureSliceIndex(0){}
enum EGL_CONTEXT_TYPE {
EGL_CONTEXT10 = 0,
EGL_CONTEXT14 = 1,
Expand All @@ -130,13 +130,13 @@
EGL_CONTEXT_TYPE eglType;
int textureId;
float matrix[16];
uint8_t* metadata_buffer;
int metadata_size;
uint8_t* metadataBuffer;
int metadataSize;
uint8_t* alphaBuffer;
bool fillAlphaBuffer;
int alphaStitchMode;
void *d3d11_texture_2d;
int texture_slice_index;
void *d3d11Texture2d;
int textureSliceIndex;
};</codeblock>
<codeblock props="electron" outputclass="language-typescript">export class ExternalVideoFrame {
type?: VideoBufferType;
Expand Down Expand Up @@ -408,13 +408,13 @@ class ExternalVideoFrame {
<pd>该参数仅适用于 Texture 格式的视频数据。为一个输入的 4x4 变换矩阵,典型值为一个单位矩阵。</pd>
</plentry>
<plentry props="cpp unreal bp unity electron rn cs flutter">
<pt props="cpp unreal bp unity electron rn cs">metadata_buffer</pt>
<pt props="flutter">metadataBuffer</pt>
<pt props="bp unity electron rn cs">metadata_buffer</pt>
<pt props="cpp unreal flutter">metadataBuffer</pt>
<pd>该参数仅适用于 Texture 格式的视频数据。指 MetaData 的数据缓冲区,默认值为 <codeph>NULL</codeph>。</pd>
</plentry>
<plentry props="cpp unreal bp unity electron rn cs flutter">
<pt props="cpp unreal bp unity electron rn cs">metadata_size</pt>
<pt props="flutter">metadataSize</pt>
<pt props="bp unity electron rn cs">metadata_size</pt>
<pt props="cpp unreal flutter">metadataSize</pt>
<pd>该参数仅适用于 Texture 格式的视频数据。指 MetaData 的大小,默认值为 <codeph>0</codeph>。</pd>
</plentry>
<plentry conkeyref="VideoFrame/d3d" props="cpp unity electron">
Expand Down Expand Up @@ -448,9 +448,13 @@ class ExternalVideoFrame {
<pt/>
<pd/>
</plentry>
<plentry conkeyref="VideoFrame/d3d">
<pt/>
<pd/>
</plentry>
<plentry props="cpp unity electron flutter">
<pt props="cpp unity electron">texture_slice_index</pt>
<pt props="flutter">textureSliceIndex</pt>
<pt props="unity electron">texture_slice_index</pt>
<pt props="cpp flutter">textureSliceIndex</pt>
<pd>该参数仅适用于 Windows Texture 格式的视频数据。表示在 <codeph>ID3D11Texture2D</codeph> 数组中,被视频帧使用的某一个 <codeph>ID3D11Texture2D</codeph> 纹理对象的索引。</pd>
</plentry>
<plentry>
Expand Down
33 changes: 18 additions & 15 deletions dita/RTC-NG/API/class_videoencoderconfiguration.dita
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@
static public class AdvanceOptions {
public ENCODING_PREFERENCE encodingPreference;
public COMPRESSION_PREFERENCE compressionPreference;
public AdvanceOptions(
ENCODING_PREFERENCE encodingPreference, COMPRESSION_PREFERENCE compressionPreference) {
public boolean encodeAlpha;
public AdvanceOptions(ENCODING_PREFERENCE encodingPreference,
COMPRESSION_PREFERENCE compressionPreference, boolean encodeAlpha) {
this.encodingPreference = encodingPreference;
this.compressionPreference = compressionPreference;
this.encodeAlpha = encodeAlpha;
}
public AdvanceOptions() {
this.encodingPreference = ENCODING_PREFERENCE.PREFER_AUTO;
this.compressionPreference = COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY;
this.encodeAlpha = false;
}
}
public enum DEGRADATION_PREFERENCE {
Expand Down Expand Up @@ -187,8 +190,8 @@
this.degradationPrefer = DEGRADATION_PREFERENCE.MAINTAIN_QUALITY;
this.mirrorMode = MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED;
this.advanceOptions = new AdvanceOptions(
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_H265;
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY, false);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_NONE;
}
public VideoEncoderConfiguration(VideoDimensions dimensions, FRAME_RATE frameRate, int bitrate,
ORIENTATION_MODE orientationMode) {
Expand All @@ -201,8 +204,8 @@
this.degradationPrefer = DEGRADATION_PREFERENCE.MAINTAIN_QUALITY;
this.mirrorMode = MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED;
this.advanceOptions = new AdvanceOptions(
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_H265;
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY, false);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_NONE;
}
public VideoEncoderConfiguration(VideoDimensions dimensions, FRAME_RATE frameRate, int bitrate,
ORIENTATION_MODE orientationMode, MIRROR_MODE_TYPE mirrorMode) {
Expand All @@ -215,8 +218,8 @@
this.degradationPrefer = DEGRADATION_PREFERENCE.MAINTAIN_QUALITY;
this.mirrorMode = mirrorMode;
this.advanceOptions = new AdvanceOptions(
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_H265;
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY, false);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_NONE;
}
public VideoEncoderConfiguration(
int width, int height, FRAME_RATE frameRate, int bitrate, ORIENTATION_MODE orientationMode) {
Expand All @@ -229,8 +232,8 @@
this.degradationPrefer = DEGRADATION_PREFERENCE.MAINTAIN_QUALITY;
this.mirrorMode = MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED;
this.advanceOptions = new AdvanceOptions(
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_H265;
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY, false);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_NONE;
}
public VideoEncoderConfiguration(int width, int height, FRAME_RATE frameRate, int bitrate,
ORIENTATION_MODE orientationMode, MIRROR_MODE_TYPE mirrorMode) {
Expand All @@ -243,8 +246,8 @@
this.degradationPrefer = DEGRADATION_PREFERENCE.MAINTAIN_QUALITY;
this.mirrorMode = mirrorMode;
this.advanceOptions = new AdvanceOptions(
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_H265;
ENCODING_PREFERENCE.PREFER_AUTO, COMPRESSION_PREFERENCE.PREFER_LOW_LATENCY, false);
this.codecType = VIDEO_CODEC_TYPE.VIDEO_CODEC_NONE;
}
}</codeblock>
<codeblock props="hmos" outputclass="language-arkts">export class VideoEncoderConfiguration{
Expand Down Expand Up @@ -300,7 +303,7 @@
orientationMode(m),
degradationPreference(MAINTAIN_QUALITY),
mirrorMode(mirror),
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY) {}
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY, false) {}
VideoEncoderConfiguration(int width, int height, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror = VIDEO_MIRROR_MODE_DISABLED)
: codecType(VIDEO_CODEC_NONE),
dimensions(width, height),
Expand All @@ -310,7 +313,7 @@
orientationMode(m),
degradationPreference(MAINTAIN_QUALITY),
mirrorMode(mirror),
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY) {}
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY, false) {}
VideoEncoderConfiguration(const VideoEncoderConfiguration&amp; config)
: codecType(config.codecType),
dimensions(config.dimensions),
Expand All @@ -330,7 +333,7 @@
orientationMode(ORIENTATION_MODE_ADAPTIVE),
degradationPreference(MAINTAIN_QUALITY),
mirrorMode(VIDEO_MIRROR_MODE_DISABLED),
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY) {}
advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY, false) {}
VideoEncoderConfiguration&amp; operator=(const VideoEncoderConfiguration&amp; rhs) {
if (this == &amp;rhs) return *this;
codecType = rhs.codecType;
Expand Down
7 changes: 7 additions & 0 deletions dita/RTC-NG/release/release_notes.dita
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
<li props="ios">在 v4.4.0 之前,当你的用户角色为观众时,调用 <codeph><apiname keyref="setAudioScenario"/></codeph> 将音频场景设为聊天室场景(<codeph><apiname keyref="AUDIO_SCENARIO_CHATROOM"/></codeph>)会收到申请麦克风权限的弹窗提示。自 v4.4.0 起,SDK 通过 iOS 原生的 API 控制麦克风开关,因此观众角色在聊天室场景下不会再收到申请麦克风权限的弹窗。</li>
<li props="apple">该版本将 <codeph>receiveMetadata</codeph> 回调改名为 <codeph><apiname keyref="onMetadataReceived"/></codeph>,并删除了回调中的 <codeph>data</codeph>、<codeph>timeStamp</codeph> 参数,你可以通过新增的 <codeph>metadata</codeph> 参数来获取 Metadata 的相关信息,包括 <codeph>timeStamp</codeph>(发送数据的时间戳)、<codeph>uid</codeph>(用户 ID)、<codeph>channelId</codeph>(源频道名称)等。</li>
<li props="android">该版本删除了 <codeph><apiname keyref="onMetadataReceived"/></codeph> 回调中的 <codeph>buffer</codeph>、<codeph>uid</codeph>、<codeph>timeStampMs</codeph> 参数,你可以通过新增的 <codeph>metadata</codeph> 参数来获取 Metadata 的相关信息,包括 <codeph>timeStampMs</codeph>(发送数据的时间戳)、<codeph>uid</codeph>(用户 ID)、<codeph>channelId</codeph>(源频道名称)等。</li>
<li props="cpp">该版本修改了 <xref keyref="ExternalVideoFrame"/> 中的以下成员名称:
<ul>
<li><parmname>d3d11_texture_2d</parmname> 更名为 <parmname>d3d11Texture2d</parmname>。</li>
<li><parmname>texture_slice_index</parmname> 更名为 <parmname>textureSliceIndex</parmname>。</li>
<li><parmname>metadata_buffer</parmname> 更名为 <parmname>metadataBuffer</parmname>。</li>
<li><parmname>metadata_size</parmname> 更名为 <parmname>metadataSize</parmname>。</li>
</ul></li>
</ol>
</body>
</topic>
Expand Down
22 changes: 15 additions & 7 deletions en-US/dita/RTC-NG/release/release_notes.dita
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
<li props="ios">Before v4.4.0, when a user role was set to audience and called <apiname keyref="setAudioScenario"/> to set the audio scenario to chatroom (<apiname keyref="AUDIO_SCENARIO_CHATROOM"/>), the user would see a microphone permission request popup. As of v4.4.0, the SDK uses native iOS APIs to control the microphone, so audience members in a chatroom scenario will no longer receive the microphone permission request popup.</li>
<li props="apple">This version renames the <codeph>receiveMetadata</codeph> callback to <apiname keyref="onMetadataReceived"/> and removes the <codeph>data</codeph> and <codeph>timeStamp</codeph> parameters. You can get metadata-related information, including <codeph>timeStamp</codeph> (timestamp of the sent data), <codeph>uid</codeph> (user ID), and <codeph>channelId</codeph> (channel name) through the newly-added <codeph>metadata</codeph> parameter.</li>
<li props="android">This version removes the <codeph>buffer</codeph>, <codeph>uid</codeph>, and <codeph>timeStampMs</codeph> parameters of the <apiname keyref="onMetadataReceived"/> callback. You can get metadata-related information, including <codeph>timeStampMs</codeph> (timestamp of the sent data), <codeph>uid</codeph> (user ID), and <codeph>channelId</codeph> (channel name) through the newly-added <codeph>metadata</codeph> parameter.</li>
<li props="cpp">This version renames the following members in <xref keyref="ExternalVideoFrame"/>:
<ul>
<li><parmname>d3d11_texture_2d</parmname> is renamed to <parmname>d3d11Texture2d</parmname>.</li>
<li><parmname>texture_slice_index</parmname> is renamed to <parmname>textureSliceIndex</parmname>.</li>
<li><parmname>metadata_buffer</parmname> is renamed to <parmname>metadataBuffer</parmname>.</li>
<li><parmname>metadata_size</parmname> is renamed to <parmname>metadataSize</parmname>.</li>
</ul>
</li>
</ol>
</body>
</topic>
Expand Down Expand Up @@ -91,13 +99,13 @@
<ul>
<li>Deprecates the <codeph>option</codeph> parameter of type int in <codeph><apiname keyref="setRemoteSubscribeFallbackOption"/></codeph>, and adds an overloaded function <codeph><apiname keyref="setRemoteSubscribeFallbackOption2"/></codeph> with the <codeph>option</codeph> parameter of type <codeph><apiname keyref="STREAM_FALLBACK_OPTIONS"/></codeph>.</li>
<li>Deprecates the <codeph>streamType</codeph> parameter of type int in <codeph><apiname keyref="setRemoteVideoStreamType"/></codeph>, <codeph><apiname keyref="setRemoteDefaultVideoStreamType"/></codeph>, and <codeph><apiname keyref="setRemoteVideoStreamTypeEx"/></codeph>, and adds overloaded functions <codeph><apiname keyref="setRemoteVideoStreamType2"/></codeph>, <codeph><apiname keyref="setRemoteDefaultVideoStreamType2"/></codeph>, and <codeph><apiname keyref="setRemoteVideoStreamTypeEx2"/></codeph> with the <codeph>streamType</codeph> parameter of type <codeph><apiname keyref="VIDEO_STREAM_TYPE"/></codeph>.</li></ul></li>
<li>Optimized transmission strategy: calling <apiname keyref="enableInstantMediaRendering"/> no longer impacts the security of the transmission link.</li>
<li props="cpp mac electron unity flutter unreal bp">The <apiname keyref="LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_DISPLAY_DISCONNECTED"/> enumerator is added in <apiname keyref="onLocalVideoStateChanged"/> callback , indicating that the display used for screen capture has been disconnected. (Windows, macOS)</li>
<li props="mac electron unity flutter unreal bp">Optimized the video link for window sharing, reducing CPU usage. (macOS)</li>
<li props="cpp unity flutter electron unreal">Improved echo cancellation for screen sharing scenarios.</li>
<li props="cpp framework">Added the <codeph>channelId</codeph> parameter to <apiname keyref="Metadata"/>, which is used to get the channel name from which the metadata is sent.</li>
<li props="apple cpp framework">Deprecated redundant enumeration values <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"/> and <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"/> in <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REASON"/>.</li>
<li props="android">Deprecated redundant enumeration values <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"/> and <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"/>.</li>
<li>Optimizes transmission strategy: calling <apiname keyref="enableInstantMediaRendering"/> no longer impacts the security of the transmission link.</li>
<li props="cpp mac electron unity flutter unreal bp">The <apiname keyref="LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_DISPLAY_DISCONNECTED"/> enumerator is Adds in <apiname keyref="onLocalVideoStateChanged"/> callback , indicating that the display used for screen capture has been disconnected. (Windows, macOS)</li>
<li props="mac electron unity flutter unreal bp">Optimizes the video link for window sharing, reducing CPU usage. (macOS)</li>
<li props="cpp unity flutter electron unreal">Improves echo cancellation for screen sharing scenarios.</li>
<li props="cpp framework">Adds the <codeph>channelId</codeph> parameter to <apiname keyref="Metadata"/>, which is used to get the channel name from which the metadata is sent.</li>
<li props="apple cpp framework">Deprecates redundant enumeration values <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"/> and <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"/> in <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REASON"/>.</li>
<li props="android">Deprecates redundant enumeration values <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"/> and <apiname keyref="CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"/>.</li>
<li>Optimizes transmission strategy: calling <apiname keyref="enableInstantMediaRendering"/> no longer impacts the security of the transmission link.</li>
<li props="cpp mac electron unity flutter unreal bp">The <apiname keyref="LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_DISPLAY_DISCONNECTED"/> enumerator is added in <apiname keyref="onLocalVideoStateChanged"/> callback, indicating that the display used for screen capture has been disconnected. (Windows, macOS)</li>
<li props="mac electron unity flutter unreal bp">Optimizes the video link for window sharing, reducing CPU usage. (macOS)</li>
Expand Down

0 comments on commit c875520

Please sign in to comment.