Commit e5d74d3
committed
feat(cast): DLNA/UPnP casting as first-class GSY capability (jUPnP 3.0.3)
Refactor the cast feature from a private HTTP loopback demo into a
kernel-native DLNA/UPnP capability shipped with gsyVideoPlayer-java.
Kernel side (gsyVideoPlayer-java/.../cast):
- CastCapability facade + CastProvider/CastSession/CastListener SPI so
callers depend on a stable API instead of protocol details.
- CastMediaInfo carries an immutable startPositionMs so casting from a
mid-playback position no longer restarts from 0 on the remote end.
- DLNA provider stack (dlna/JupnpDlnaProvider, JupnpDlnaSession,
DidlLite) implemented on top of jUPnP 3.0.3 support library:
SetAVTransportURI -> Play -> Seek chain, 1Hz GetPositionInfo /
GetTransportInfo polling, DIDL-Lite metadata, seek/pause/stop.
- Registered as an optional module inside GSYVideoBaseManager so it can
be enabled/disabled without touching video_layout_standard.
App demo side:
- SampleCastControlVideo collapses to a remote-control overlay while
casting, releases the local surface, and resumes at the last remote
position on disconnect. Reads local position on the main thread
before releaseAllVideos and forwards it via CastMediaInfo.
- CastDemoActivity + activity_cast_demo layout expose the DLNA device
picker, connect/disconnect flow, and the loopback receiver toggle.
- Loopback dev receiver (DevReceiverService, LoopbackDeviceFactory,
LoopbackAvTransportService, LoopbackRenderingControlService) runs in
a dedicated :dlna process and advertises a fake TV so the whole SOAP
path can be smoke-tested on one phone.
- CastReceiverFloatingWindow + CastReceiverPlayer + CastReceiverManager
render the incoming stream in a system-alert floating window and
expose read-only position/duration/state snapshots that the loopback
AVTransport service feeds back to the sender.
- DevReceiverService broadcasts READY/STOPPED/ERROR across the :dlna
boundary via setPackage-scoped intents (with RECEIVER_NOT_EXPORTED on
API 33+), because static listener fields are invisible across
processes; CastDemoActivity registers a BroadcastReceiver in
onStart/onStop to keep the toggle label in sync.
Cleanup:
- Delete the legacy gsyVideoPlayer-cast module, the standalone
gsy-cast-receiver JavaFX project, and the private GSY-Cast v1 HTTP
protocol together with their unit tests; the DLNA capability
supersedes all of them.
- Update settings.gradle, gradle/dependencies.gradle, and
gsyVideoPlayer-java/build.gradle to wire jUPnP 3.0.3 and drop the
removed modules.
- Refresh doc/CAST_FEATURE_PLAN.md and doc/CAST_TEST_PLAYBOOK.md to
describe the DLNA-first architecture and the loopback smoke test.
All strings live in res/values{,-zh-rCN}/strings.xml, no hardcoded
copy. AVTransport heavy lifting runs on a dedicated executor so the UI
thread only touches surface/state changes.1 parent 5cbab19 commit e5d74d3
45 files changed
Lines changed: 5653 additions & 0 deletions
File tree
- app
- src/main
- java/com/example/gsyvideoplayer
- cast
- video
- manager
- res
- layout
- values-zh-rCN
- values
- doc
- gradle
- gsyVideoPlayer-java
- src/main/java/com/shuyu/gsyvideoplayer
- cast
- dlna
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
329 | 337 | | |
330 | 338 | | |
331 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
493 | 502 | | |
494 | 503 | | |
495 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
127 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
13 | 31 | | |
14 | 32 | | |
15 | 33 | | |
| |||
253 | 271 | | |
254 | 272 | | |
255 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
256 | 301 | | |
257 | 302 | | |
258 | 303 | | |
| |||
0 commit comments