From 670054ca01f0c23d98f02a6056a0b5110dfbce97 Mon Sep 17 00:00:00 2001 From: yangsy Date: Sun, 4 Jan 2026 11:27:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=B5=81=E5=AA=92?= =?UTF-8?q?=E4=BD=93=E6=8E=A8=E6=B5=81=E7=BB=9F=E8=AE=A1=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/model/biz/vimp/index.ts | 2 + src/apis/model/biz/vimp/invite-stream-type.ts | 1 + src/apis/model/biz/vimp/send-rtp-info.ts | 51 +++++++++ .../biz/other/ndm-service-available.ts | 12 ++- .../device/device-card/ndm-server/index.ts | 3 +- .../ndm-server/server-current-diag.vue | 3 +- .../ndm-server/server-stream-push.vue | 100 ++++++++++++++++++ 7 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 src/apis/model/biz/vimp/invite-stream-type.ts create mode 100644 src/apis/model/biz/vimp/send-rtp-info.ts create mode 100644 src/components/device/device-card/ndm-server/server-stream-push.vue diff --git a/src/apis/model/biz/vimp/index.ts b/src/apis/model/biz/vimp/index.ts index 29a8dc2..d3ea6e9 100644 --- a/src/apis/model/biz/vimp/index.ts +++ b/src/apis/model/biz/vimp/index.ts @@ -1 +1,3 @@ +export * from './invite-stream-type'; +export * from './send-rtp-info'; export * from './snap-result'; diff --git a/src/apis/model/biz/vimp/invite-stream-type.ts b/src/apis/model/biz/vimp/invite-stream-type.ts new file mode 100644 index 0000000..7274c10 --- /dev/null +++ b/src/apis/model/biz/vimp/invite-stream-type.ts @@ -0,0 +1 @@ +export type InviteStreamType = 'PLAY' | 'PLAYBACK' | 'DOWNLOAD' | 'PUSH' | 'PROXY' | 'CLOUD_RECORD_PUSH' | 'CLOUD_RECORD_PROXY'; diff --git a/src/apis/model/biz/vimp/send-rtp-info.ts b/src/apis/model/biz/vimp/send-rtp-info.ts new file mode 100644 index 0000000..7f4e7a5 --- /dev/null +++ b/src/apis/model/biz/vimp/send-rtp-info.ts @@ -0,0 +1,51 @@ +import type { InviteStreamType } from '@/apis'; +import type { Nullable } from '@/types'; + +export type SendRtpInfo = Nullable<{ + ip: string; + port: number; + ssrc: string; + platformId: string; + deviceId: string; + channelId: string; + app: string; + streamId: string; + /** + * 推流状态 + * 0 等待设备推流上来 + * 1 等待上级平台回复ack + * 2 推流中 + */ + status: number; + /** + * 是否为tcp + */ + tcp: boolean; + /** + * 是否为tcp主动模式 + */ + tcpActive: boolean; + localPort: number; + mediaServerId: string; + serverId: string; + callId: string; + fromTag: string; + toTag: string; + /** + * 发送时,rtp的pt(uint8_t),不传时默认为96 + */ + pt: number; + /** + * 发送时,rtp的负载类型。为true时,负载为ps;为false时,为es; + */ + usePs: boolean; + /** + * 当usePs 为false时,有效。为1时,发送音频;为0时,发送视频;不传时默认为0 + */ + onlyAudio: boolean; + /** + * 是否开启rtcp保活 + */ + rtcp: boolean; + playType: InviteStreamType; +}>; diff --git a/src/apis/request/biz/other/ndm-service-available.ts b/src/apis/request/biz/other/ndm-service-available.ts index 4b5d33c..60b6a66 100644 --- a/src/apis/request/biz/other/ndm-service-available.ts +++ b/src/apis/request/biz/other/ndm-service-available.ts @@ -1,6 +1,16 @@ -import { ndmClient, userClient, type MediaServerStatus, type Station } from '@/apis'; +import { ndmClient, userClient, type MediaServerStatus, type SendRtpInfo, type Station } from '@/apis'; import { unwrapResponse } from '@/utils'; +export const getAllPushApi = async (options?: { stationCode?: Station['code']; signal?: AbortSignal }) => { + const { stationCode, signal } = options ?? {}; + const client = stationCode ? ndmClient : userClient; + const prefix = stationCode ? `/${stationCode}` : ''; + const endpoint = `${prefix}/api/ndm/ndmServiceAvailable/mediaServer/getAllPush`; + const resp = await client.get(endpoint, { signal }); + const data = unwrapResponse(resp); + return data; +}; + export const isMediaServerAliveApi = async (options?: { stationCode?: Station['code']; signal?: AbortSignal }) => { const { stationCode, signal } = options ?? {}; const client = stationCode ? ndmClient : userClient; diff --git a/src/components/device/device-card/ndm-server/index.ts b/src/components/device/device-card/ndm-server/index.ts index 67c2711..6b8db71 100644 --- a/src/components/device/device-card/ndm-server/index.ts +++ b/src/components/device/device-card/ndm-server/index.ts @@ -2,6 +2,7 @@ import ServerAlive from './server-alive.vue'; import ServerCard from './server-card.vue'; import ServerCurrentDiag from './server-current-diag.vue'; import ServerHistoryDiag from './server-history-diag.vue'; +import ServerStreamPush from './server-stream-push.vue'; import ServerUpdate from './server-update.vue'; -export { ServerAlive, ServerCard, ServerCurrentDiag, ServerHistoryDiag, ServerUpdate }; +export { ServerAlive, ServerCard, ServerCurrentDiag, ServerHistoryDiag, ServerUpdate, ServerStreamPush }; diff --git a/src/components/device/device-card/ndm-server/server-current-diag.vue b/src/components/device/device-card/ndm-server/server-current-diag.vue index 94f2c19..6c73766 100644 --- a/src/components/device/device-card/ndm-server/server-current-diag.vue +++ b/src/components/device/device-card/ndm-server/server-current-diag.vue @@ -1,6 +1,6 @@ + + + +