Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoder for Android #79

Open
Android-Unknown opened this issue Nov 9, 2023 · 7 comments
Open

Encoder for Android #79

Android-Unknown opened this issue Nov 9, 2023 · 7 comments

Comments

@Android-Unknown
Copy link

Hi! How can I build an encoder in an android application?

@sz3
Copy link
Owner

sz3 commented Nov 10, 2023

It's a good question, and an open request (see this issue: sz3/cfc#17)

Right now to encode on Android you have to download the cimbar.html file to your phone and open it in the web browser. But I admit this is not great (some phones won't even you do it...).

What I'd like to do if I eventually get some time is either (1) add a WebView to the CFC app that loads the encoder, or (2) add native jni bindings for the encoder code.

@Android-Unknown
Copy link
Author

Android-Unknown commented Nov 10, 2023

@sz3 JNI is a great way! Can you tell me which functions to use and in what format should I send data from the Java layer? I think there will be problems when building source codes for Clang compiler.

@sz3
Copy link
Owner

sz3 commented Nov 11, 2023

The two places to start are probably:

  1. the existing jni bindings the android app uses for decoding, here: https://github.com/sz3/cfc/blob/master/app/src/cpp/cfc-cpp/jni.cpp#L158-L207
  2. the "cimbar_js" interface the wasm uses for encoding, here: https://github.com/sz3/libcimbar/blob/master/src/lib/cimbar_js/cimbar_js.cpp

One possibility with a jni interface for encoding would be to dump the RGB (or is it BGR...) results from the cv::Mat into a shared uint8* buffer for each frame, and have the android app worry about dumping that to the screen.

@Anonymous3-a
Copy link

Just saying, if you install termux (as far as I can tell, the google play version is depreciated, so you'll need to install f-droid or download the apk from f-droid), you can build this from source and encode with the terminal. I'm doing it now, seems to be working.

@sz3
Copy link
Owner

sz3 commented Dec 30, 2023

Just saying, if you install termux (as far as I can tell, the google play version is depreciated, so you'll need to install f-droid or download the apk from f-droid), you can build this from source and encode with the terminal. I'm doing it now, seems to be working.

Cool! I didn't know that worked!

Interesting that it says the apk/play store version is deprecated(?), I haven't seen that on my end.

@Headedbranch225
Copy link
Contributor

Just saying, if you install termux (as far as I can tell, the google play version is depreciated, so you'll need to install f-droid or download the apk from f-droid), you can build this from source and encode with the terminal. I'm doing it now, seems to be working.

Can you tell me how to do this please? I have termux installed

@Anonymous3-a
Copy link

Anonymous3-a commented Jan 28, 2024

It didn't compile, but (and this isn't tested, but when I get motivated I will) you can use something like AnLinux (don't know if it's on play store, but it is on fdroid) to set up a ""VM"" (really just a chroot jail type thing) and compile in that. I might make some sort of script to do all that automatically later.

Edit: Keep in mind, it won't just pop up a window with the animated code, you need a vnc for that. If you use AnLinux, it has scripts for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants