Kalay1.0鸿蒙版PSC

KalaySDK升级版PSC


#Architecture and Function

<p>[TOC]</p> <h1>1. Product Architecture</h1> <h2>1.1 System Interaction Diagram</h2> <p>![KalayHarmony服务架构](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=c84a6c35ad4c9a43955c76199657b2c4&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=c84a6c35ad4c9a43955c76199657b2c4&amp;file=file.png</a> &quot;KalayHarmony服务架构&quot;)</p> <p><strong>Service Description:</strong></p> <ul> <li>P2P Service: Provide P2P connection services;</li> </ul> <h2>1.2 Project Structure</h2> <ul> <li><strong>Viewer Layer</strong></li> <li><strong>IOTCamera Framework:</strong> <ul> <li>Decode Module:Audio Encode + Audio Decode + Video Decode</li> <li>P2P Connection Module:IOTC+AVAPI3</li> </ul></li> </ul> <p><code>Codec Module includes:Video Decoding + Audio Encoding(Speaking) + Audio Decoding(Listening)</code></p> <p>![KalayHarmony项目结构](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=676c0ed277e61b58ee138b16c5105c8f&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=676c0ed277e61b58ee138b16c5105c8f&amp;file=file.png</a> &quot;KalayHarmony项目结构&quot;)</p> <p><strong>HarmonyOS Next:</strong></p> <ul> <li>Developed based on ArkTS/C/C++ language;</li> <li>Run in DevEco Studio 4.1.3.700;</li> <li>Provided .so libs;</li> </ul> <h1>2. User Flow</h1> <h2>2.1 User Flow</h2> <p>![KalayHarmony业务流程(en)](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=dd9c8350c7520841a5e32320273a97ee&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=dd9c8350c7520841a5e32320273a97ee&amp;file=file.png</a> &quot;KalayHarmony业务流程(en)&quot;)</p> <h2>2.2 User Flow Description</h2> <p><strong>Step 1: Initialize IOTC:</strong></p> <ul> <li>An IOTC initialization operation is required when the APP is started.</li> <li>Calling interface: <code>[Camera TK_InitSDK:(key:)]</code></li> </ul> <p><strong>Step 2: Scan the QR code or manually enter the UID and password for IOTC connection</strong></p> <ul> <li>The APP needs to register with the KPNS Server after obtaining the deviceToken of the system callback.</li> <li>Calling interface: <code>[camera TK_connect:(uid: authkey:)]</code></li> </ul> <p><strong>Step 3: Establish an AV audio and video channel</strong></p> <ul> <li>Calling interface: <code>[camera TK_start:(uid: channel: password: account:)]</code></li> </ul> <p><strong>Step 4: Start obtaining video stream and decoding rendering</strong></p> <ul> <li>Calling interface: <code>[camera TK_startShow: (uid: channel:)]</code></li> </ul> <p><strong>Step 5: Online status monitoring</strong></p> <ul> <li>Real time upload of device IOTC connection status at the bottom layer;</li> <li> <p>Calling interface: <code>[camera TK_sessionStateCallBack: (uid: cb: (arg: cameraSessionState) =&amp;gt; void)]</code></p> </li> <li>Real time throwing of device AV channel status at the bottom layer;</li> <li>Calling interface: <code>[camera TK_channelStateCallBack: (uid: cb: (arg: cameraChannelState) =&amp;gt; void)]</code></li> </ul> <p><strong>Step 6: Decode information display</strong></p> <ul> <li>The bottom layer will throw up the connection mode, decoded width and height, video fps, audio and video bps, number of online users, current decoding queue frame rate, frame loss rate, and hard and soft decoding values;</li> <li>Callback interface: <code>[camera TK_recvFrameInfoCallBack: (uid: cb: (arg: recvFrameInfoState) =&amp;gt; void)]</code></li> </ul> <p><strong>Step 7: Various operations after successful drawing</strong> A. Switch between hard and soft decoding</p> <ul> <li>Calling interface: <code>[self.camera TK_setHWDecodingAbility: (uid: channel: isHWDecode:)]</code></li> </ul> <p>B. Listening</p> <ul> <li>Calling interface: <code>[self.camera TK_startSoundToPhone: (uid: channel:)]</code></li> </ul> <p>C. Speaking</p> <ul> <li>Calling interface: <code>[self.camera TK_startSoundToDevice: (uid: channel: isResend:)]</code></li> </ul> <p>D. Local recording</p> <ul> <li>After successful recording, MP4 is saved in the sandbox path specified by filePath</li> <li>Calling interface: <code>[self.camera TK_startRecording: (uid: channel: filepath: isListening:)]</code></li> </ul> <p>E. Snapshot</p> <ul> <li>After successful photography, the image is saved in the sandbox path specified by filePath</li> <li>Calling interface: <code>[self.camera TK_snapshot: (uid: channel: filepath:)]</code></li> </ul> <p><strong>Step 8: Disconnect and Exit liveview</strong> A. Stop or cancel all operations currently in use</p> <p>B. Disconnection</p> <ul> <li>Calling interface: <code>[self.camera TK_disconnect: (uid:)]</code></li> </ul> <h1>3. Function Module</h1> <h2>3.1 Total Function Module</h2> <p>![KalaySDK功能模块_v2.5.11](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=dfd064e0f4c9339bb1831e1199e5624a&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=dfd064e0f4c9339bb1831e1199e5624a&amp;file=file.png</a> &quot;KalaySDK功能模块_v2.5.11&quot;)</p> <h2>3.2 Function List</h2> <table> <thead> <tr> <th>Module</th> <th>Main Function</th> <th>V7.0.0</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Add Device</td> <td>Scan QRCode</td> <td>v</td> <td>Scan the UID QR code of the device to connect</td> </tr> <tr> <td>Add Device</td> <td>Enable Device Token</td> <td>v</td> <td>Switch to device token verification mode</td> </tr> <tr> <td>Add Device</td> <td>Enable Authkey</td> <td>v</td> <td>Enable authkey security mechanism</td> </tr> <tr> <td>Liveview</td> <td>Liveview</td> <td>v</td> <td>Live Video Viewing</td> </tr> <tr> <td>Liveview</td> <td>Device Status</td> <td>v</td> <td>1.Online 2.Offline 3.Password Error</td> </tr> <tr> <td>Liveview</td> <td>SW/HW</td> <td>v</td> <td>1.Software 2.Hardware</td> </tr> <tr> <td>Liveview</td> <td>Speaking</td> <td>v</td> <td>Start sending audio data to the device</td> </tr> <tr> <td>Liveview</td> <td>Listening</td> <td>v</td> <td>Start receiving audio data from the device</td> </tr> <tr> <td>Liveview</td> <td>Snapshot</td> <td>v</td> <td>Save a photo to the phone system album</td> </tr> <tr> <td>Liveview</td> <td>Recording</td> <td>v</td> <td>Save a video to the phone system album</td> </tr> <tr> <td>Debug Mode</td> <td>Log Output</td> <td>v</td> <td>Log output</td> </tr> </tbody> </table> <h1>4. UI Flow</h1> <p>![Kalay1.0 简化升级版](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=0fe9fdb187e90e738c211521964274e9&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=0fe9fdb187e90e738c211521964274e9&amp;file=file.png</a> &quot;Kalay1.0 RN版&quot;)</p>

页面列表

ITEM_HTML