FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.35k stars 72 forks source link

i can use this in android app? #146

Closed nozuonodienobb closed 1 year ago

nozuonodienobb commented 1 year ago

if can use how to render?

fduncanh commented 1 year ago

There is no current support for uxplay running under android, but the source code derives from something that ran on android, so you might be able to get a build on android to work. Recently, support for Windows was added after a user got it working, so it might well be possible to do the same on Android. You would have to do the work, though! Probably the fact that uxplay runs from a command line in a terminal is a difficulty for a simple Android port.

The old code (apparently authored by dsafa22) that supported Android is here : development there stopped long ago. See here.

uxplay uses gstreamer for rendering: The gstreamer site lists support for Android as follows:

Android

Binary releases are available with each in the form of a single "universal" tarball with armv7, arm64, x86, and x86_64 architectures in subfolders.

The Android NDKs used by the stable releases are:

GStreamer version NDK Version
1.20.x r21
1.18.x r21
1.16.x r18b

Older 1.x binary releases are also available.

Android Binary releases are available with each in the form of a single "universal" tarball with armv7, arm64, x86, and x86_64 architectures in subfolders. Android Universal [1.20.4 tarball](https://gstreamer.freedesktop.org/data/pkg/android/1.20.4/gstreamer-1.0-android-universal-1.20.4.tar.xz) (current stable version) Android Universal [1.18.6 tarball](https://gstreamer.freedesktop.org/data/pkg/android/1.18.6/gstreamer-1.0-android-universal-1.18.6.tar.xz) (old stable version) The Android NDKs used by the stable releases are: GStreamer version NDK Version 1.20.x r21 1.18.x r21 1.16.x r18b The Android APIs targeted by the GStreamer 1.16.x, 1.18.x, 1.20.x stable release(s) are: Architecture API Targeted armv7 v16 (Jelly Bean) x86 v16 (Jelly Bean) arm64 v21 (Lollipop) x86_64 v21 (Lollipop) [Older 1.x binary releases](https://gstreamer.freedesktop.org/data/pkg/android) are also available.
nozuonodienobb commented 1 year ago

The difficult part is to play the decoded stream on the Android side? I think the gsteam used by the source code is rendered and played through the command line

nozuonodienobb commented 1 year ago

i can use Exo play the byte[] source.. I did, but I can't work, sad.QAQ

fduncanh commented 1 year ago

I have no understanding of Android, so it's difficult to help you without a test platform.

The code in /lib does the following (1) establish and maintain a RAOP connection ("pairing') with an iOS client. (2) decrypt two seperate encrypted streams from the client, (a) h264 video + (b) AAC-ELD audio (OR a single encripted ALAC audio stream in audio-only mode)

Once the connection is established, two gstreamer pipelines (one audio, one video) are started, and decrypted data is fed into them with timestamps to maintain syncronization. Gstreamer is a "black box" which handles everything about rendering The code for this is in /renderers,

The code in uxplay.cpp handles startup from a terminal command line with various options, and writing informational messages from to the terminal from RAOP, and things like "coverart" in audio mode. It also passes the decrypted audio and video from RAOP in /lib to gstreamer in /renderers.

fduncanh commented 1 year ago

can Android be run on virtualbox, or something like that? That would make the question of Android support more approachable.

fduncanh commented 1 year ago

The code in /lib is LGPL, except for subdirectories lib/playfair (GPL) and llhttp (MIT).

You could reuse the code in an Android app by replacing uxplay.cpp with an Android front end that is not terminal based, and reworking the rendering in /renderers

fduncanh commented 1 year ago

I'll close this as it is not an "issue", but feel free to ask more questions here in this thread, even if its closed.

nozuonodienobb commented 1 year ago

thank s your reply, its give me most of help. very much