| | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.ToolKits; |
| | | import com.sun.jna.Pointer; |
| | | import lombok.extern.slf4j.Slf4j;
|
| | | |
| | | import static com.ruoyi.device.dhsdk.module.LoginModule.netsdk; |
| | | |
| | |
| | | * 实时预览接口实现 |
| | | * 主要有 :开始拉流、停止拉流功能 |
| | | */ |
| | | @Slf4j(topic = "dhSdk")
|
| | | public class RealPlayModule { |
| | | /** |
| | | * \if ENGLISH_LANG |
| | |
| | | NetSDKLib.NET_OUT_REALPLAY_BY_DATA_TYPE net_out_realplay_by_data_type = new NetSDKLib.NET_OUT_REALPLAY_BY_DATA_TYPE(); |
| | | NetSDKLib.LLong m_hPlayHandle = netsdk.CLIENT_RealPlayByDataType(m_hLoginHandle, net_in_realplay_by_data_type, net_out_realplay_by_data_type, 5000); |
| | | if (m_hPlayHandle.longValue() == 0) { |
| | | System.err.println("开始实时预览失败,错误码" + ToolKits.getErrorCodePrint()); |
| | | log.error("开始实时预览失败,错误码" + ToolKits.getErrorCodePrint());
|
| | | } else { |
| | | System.out.println("Success to start realplay"); |
| | | log.debug("Success to start realplay");
|
| | | } |
| | | return m_hPlayHandle; |
| | | } |
| | |
| | | if (0 != lRealHandle.longValue()) { |
| | | switch (dwDataType) { |
| | | case 0: |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为原始音视频混合数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为原始音视频混合数据");
|
| | | break; |
| | | case 1: |
| | | //标准视频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为标准视频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为标准视频数据");
|
| | | break; |
| | | case 2: |
| | | //yuv 数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为yuv数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为yuv数据");
|
| | | break; |
| | | case 3: |
| | | //pcm 音频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为音频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为音频数据");
|
| | | break; |
| | | case 4: |
| | | //原始音频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为原始音频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为原始音频数据");
|
| | | break; |
| | | default: |
| | | break; |