Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeoFlyApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GeoFly
GeoFlyApi
Commits
1b7145b9
Commit
1b7145b9
authored
Mar 24, 2026
by
guoxuejian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LiveStartPushResponse class and update liveStartPush method to use it
parent
186c6ad5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
15 deletions
+31
-15
cloud-sdk/src/main/java/com/dji/sdk/cloudapi/livestream/LiveStartPushResponse.java
+27
-0
cloud-sdk/src/main/java/com/dji/sdk/cloudapi/livestream/api/AbstractLivestreamService.java
+2
-2
sample/src/main/java/com/dji/sample/manage/service/impl/LiveStreamServiceImpl.java
+2
-13
No files found.
cloud-sdk/src/main/java/com/dji/sdk/cloudapi/livestream/LiveStartPushResponse.java
0 → 100644
View file @
1b7145b9
package
com
.
dji
.
sdk
.
cloudapi
.
livestream
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* Response output for live_start_push services_reply.
* Newer DJI firmware returns {"origin_video_id": []} in the output field.
*/
public
class
LiveStartPushResponse
{
@JsonProperty
(
"origin_video_id"
)
private
List
<
String
>
originVideoId
;
public
LiveStartPushResponse
()
{
}
public
List
<
String
>
getOriginVideoId
()
{
return
originVideoId
;
}
public
LiveStartPushResponse
setOriginVideoId
(
List
<
String
>
originVideoId
)
{
this
.
originVideoId
=
originVideoId
;
return
this
;
}
}
cloud-sdk/src/main/java/com/dji/sdk/cloudapi/livestream/api/AbstractLivestreamService.java
View file @
1b7145b9
...
...
@@ -52,9 +52,9 @@ public abstract class AbstractLivestreamService {
* @param request data
* @return services_reply
*/
public
TopicServicesResponse
<
ServicesReplyData
<
String
>>
liveStartPush
(
GatewayManager
gateway
,
LiveStartPushRequest
request
)
{
public
TopicServicesResponse
<
ServicesReplyData
<
LiveStartPushResponse
>>
liveStartPush
(
GatewayManager
gateway
,
LiveStartPushRequest
request
)
{
return
servicesPublish
.
publish
(
new
TypeReference
<
String
>()
{},
new
TypeReference
<
LiveStartPushResponse
>()
{},
gateway
.
getGatewaySn
(),
LiveStreamMethodEnum
.
LIVE_START_PUSH
.
getMethod
(),
request
,
...
...
sample/src/main/java/com/dji/sample/manage/service/impl/LiveStreamServiceImpl.java
View file @
1b7145b9
...
...
@@ -153,7 +153,6 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
Set
<
String
>
existingSessions
=
findSessionKeys
(
liveParam
.
getVideoId
());
boolean
streamAlreadyRunning
=
!
forceMqttPush
&&
existingSessions
!=
null
&&
!
existingSessions
.
isEmpty
();
String
rtspOutputUrl
=
null
;
// RTSP 特殊:播放地址来自设备响应
if
(
streamAlreadyRunning
)
{
log
.
info
(
"Stream already running with {} viewer(s), skip MQTT push and reuse. videoId={}"
,
...
...
@@ -166,7 +165,7 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
// videoQuality 为空时默认 AUTO(refresh 场景前端可能不传)
VideoQualityEnum
quality
=
liveParam
.
getVideoQuality
()
!=
null
?
liveParam
.
getVideoQuality
()
:
VideoQualityEnum
.
AUTO
;
TopicServicesResponse
<
ServicesReplyData
<
String
>>
response
=
abstractLivestreamService
.
liveStartPush
(
TopicServicesResponse
<
ServicesReplyData
<
LiveStartPushResponse
>>
response
=
abstractLivestreamService
.
liveStartPush
(
SDKManager
.
getDeviceSDK
(
responseResult
.
getData
().
getDeviceSn
()),
new
LiveStartPushRequest
()
.
setUrl
(
url
)
...
...
@@ -184,11 +183,6 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
return
HttpResultResponse
.
error
(
response
.
getData
().
getResult
());
}
}
// 保存 RTSP 设备返回的 output(仅首次推流时设备会返回)
if
(
StringUtils
.
hasText
(
response
.
getData
().
getOutput
()))
{
rtspOutputUrl
=
response
.
getData
().
getOutput
();
}
}
// ========== 构造播放地址(无论首个还是复用,URL 构造逻辑一致) ==========
...
...
@@ -212,12 +206,7 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
.
toString
());
break
;
case
RTSP:
// RTSP 优先用设备返回的 output 地址,复用时回退到配置 URL
if
(
StringUtils
.
hasText
(
rtspOutputUrl
))
{
live
.
setUrl
(
rtspOutputUrl
);
}
else
{
live
.
setUrl
(
url
.
toString
());
}
live
.
setUrl
(
url
.
toString
());
break
;
case
WHIP:
live
.
setUrl
(
url
.
toString
().
replace
(
"whip"
,
"whep"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment