Kalay1.0鸿蒙版PSC

KalaySDK升级版PSC


#架构及功能模块

<p>[TOC]</p> <h1>一、产品架构</h1> <h2>1.1 服务架构</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>服务说明:</strong></p> <ul> <li>P2P服务:提供P2P管理服务;</li> </ul> <h2>1.2 项目结构</h2> <ul> <li>Viewer层调用逻辑</li> <li>IOTCamera层: <ul> <li>Decode模块:音频编解码+视频解码</li> <li>P2P连线模块:IOTC+AVAPI3</li> </ul></li> </ul> <p><code>编解码模块主要包括:视频解码 + 音频编码(对讲)+音频解码(监听)</code></p> <p>![KalayHarmony项目结构](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=a81d46dfe08f46ec3f8f3078607dfbff&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=a81d46dfe08f46ec3f8f3078607dfbff&amp;file=file.png</a> &quot;KalayHarmony项目结构&quot;)</p> <p><strong>HarmonyOS Next:</strong></p> <ul> <li>基于ArkTS/C/C++语言开发;</li> <li>DevEco Studio 4.1.3.700环境运行;</li> <li>以so动态库形式提供;</li> </ul> <h1>二、业务流程</h1> <h2>2.1 业务流程设计</h2> <p>![KalayHarmony业务流程(cn)](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=70def8f928cfab3651344cdf601d5325&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=70def8f928cfab3651344cdf601d5325&amp;file=file.png</a> &quot;KalayHarmony业务流程(cn)&quot;)</p> <h2>2.2 业务流程说明</h2> <p><strong>第一步:初始化IOTC:</strong></p> <ul> <li>APP启动时需进行一次IOTC初始化操作</li> <li>调用接口:<code>[Camera TK_InitSDK:(key:)]</code></li> </ul> <p><strong>第二步:通过二维码扫描或者手动输入uid及手动输入密码进行IOTC连线</strong></p> <ul> <li>调用接口:<code>[camera TK_connect:(uid: authkey:)]</code></li> </ul> <p><strong>第三步:建立av音视频通道</strong></p> <ul> <li>调用接口:<code>[camera TK_start:(uid: channel: password: account:)]</code></li> </ul> <p><strong>第四步:开始获取视频流并解码渲染</strong></p> <ul> <li>调用接口:<code>[camera TK_startShow: (uid: channel:)]</code></li> </ul> <p><strong>第五步:在线状态监听</strong></p> <ul> <li>底层实时将设备IOTC连线状态上抛</li> <li> <p>回调接口:<code>[camera TK_sessionStateCallBack: (uid: cb: (arg: cameraSessionState) =&amp;gt; void)]</code></p> </li> <li>底层实时将设备av通道状态上抛</li> <li>回调接口:<code>[camera TK_channelStateCallBack: (uid: cb: (arg: cameraChannelState) =&amp;gt; void)]</code></li> </ul> <p><strong>第六步:解码信息显示</strong></p> <ul> <li>底层将连线模式及解码后的宽高,视频fps,音视频bps,在线人数及当前解码队列帧数,丢帧数,硬软解码值上抛</li> <li>回调接口:<code>[camera TK_recvFrameInfoCallBack: (uid: cb: (arg: recvFrameInfoState) =&amp;gt; void)]</code></li> </ul> <p><strong>第七步:出图成功后的各项操作</strong> A.切换硬软解码</p> <ul> <li>调用接口:<code>[self.camera TK_setHWDecodingAbility: (uid: channel: isHWDecode:)]</code></li> </ul> <p>B.监听</p> <ul> <li>调用接口:<code>[self.camera TK_startSoundToPhone: (uid: channel:)]</code></li> </ul> <p>C.对讲</p> <ul> <li>调用接口:<code>[self.camera TK_startSoundToDevice: (uid: channel: isResend:)]</code></li> </ul> <p>D.本地录像</p> <ul> <li>录像成功后MP4保存在filePath指定的沙盒路径中</li> <li>调用接口:<code>[self.camera TK_startRecording: (uid: channel: filepath: isListening:)]</code></li> </ul> <p>E.拍照</p> <ul> <li>拍照成功后图片保存在filePath指定的沙盒路径中</li> <li>调用接口:<code>[self.camera TK_snapshot: (uid: channel: filepath:)]</code></li> </ul> <p><strong>第八步:断线并退出liveView</strong> A.stop停止或取消正在使用的所有操作</p> <p>B.断线</p> <ul> <li>调用接口:<code>[self.camera TK_disconnect: (uid:)]</code></li> </ul> <h1>三、功能模块</h1> <h2>3.1 功能模块设计</h2> <p>![KalaySDK功能模块_v2.5.11](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=74dfebaa9f2f4c8db696006ed38f1fce&amp;file=file.png">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=74dfebaa9f2f4c8db696006ed38f1fce&amp;file=file.png</a> &quot;KalaySDK功能模块_v2.5.10&quot;)</p> <h2>3.2 功能列表</h2> <table> <thead> <tr> <th>模块</th> <th>功能</th> <th>V7.0.0</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>添加设备</td> <td>扫码连接设备</td> <td>v</td> <td>扫描设备的UID二维码后进行连接</td> </tr> <tr> <td>添加设备</td> <td>启用Device Token</td> <td>v</td> <td>切换至device token验证模式</td> </tr> <tr> <td>添加设备</td> <td>启用Authkey</td> <td>v</td> <td>开启authkey安全机制</td> </tr> <tr> <td>Liveview</td> <td>实时画面</td> <td>v</td> <td>实时影像观看</td> </tr> <tr> <td>Liveview</td> <td>在线状态</td> <td>v</td> <td>1.在线 2.离线 3.密码错误</td> </tr> <tr> <td>Liveview</td> <td>软硬解切换</td> <td>v</td> <td>1. SW/软解码 2. HW/硬解码</td> </tr> <tr> <td>Liveview</td> <td>对讲</td> <td>v</td> <td>开始发送音频数据给设备</td> </tr> <tr> <td>Liveview</td> <td>监听</td> <td>v</td> <td>开始接收设备的音频数据</td> </tr> <tr> <td>Liveview</td> <td>拍照</td> <td>v</td> <td>保存一张照片至手机系统相册</td> </tr> <tr> <td>Liveview</td> <td>录像</td> <td>v</td> <td>保存一段录像至手机系统相册</td> </tr> <tr> <td>开发者模式</td> <td>日志打印</td> <td>v</td> <td>日志输出</td> </tr> </tbody> </table> <h1>四、UI示意图</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