coderReview/Android-VLC-Patches

Bugfixes

Closed this issue · 14 comments

Hi,

I went back to working with my multivideo project and I tried the new build.

Just a couple of things I had to change in order to make it work, that maybe you want to check/update:

  • public constructor for EventHandler

  • In the LibVLC class I had to change the constructor to

    public LibVLC() {
    mAout = new AudioOutput();
    sInstance = this;
    }

Because without sInstance set it would display anything on the surface.

Thanks.

No need to have public constructor for EventHandler. It's used internally by LibVLC class. You can get the instance using getEventHandler() method.

The sInstance is to be used with static methods and to keep the VLC application working without any update.

Please try the latest code posted.
Thank you.

Thanks, I'm testing the new version but the patch fails with:

ambi@ambimacbook:~/Desktop/android/vlc$ git apply --verbose ../../Android-VLC-Patches/vlc/0004-Add-support-to-play-multiple-video-instances-in-Andr.patch
Checking patch modules/codec/omxil/android_mediacodec.c...
error: while searching for:
/* If the VideoPlayerActivity is not started, MediaCodec opaque
direct rendering should be disabled since no surface will be
attached to the JNI. */
p_sys->direct_rendering = jni_IsVideoPlayerActivityCreated() && var_InheritBool(p_dec, CFG_PREFIX "dr");
if (p_sys->direct_rendering) {
if (p_dec->fmt_in.video.orientation != ORIENT_NORMAL) {
int i_angle;

I had checked out the commit in the README.

Did you apply the other 3 patches first without any issue ?

Yep! Only the Add-support-to-play-multiple-video-instances-in-Andr.patch gave me problems.
I tried with the commit marked in the README for the vlc repo and also with the latest one.

Try like this:
git am < patches/0001-Fix-issue-with-jni_ConfigureSurface-return-value.-On.patch
git am < patches/0002-Update-surface-object-when-it-s-destroyed-and-recrea.patch
git am < patches/0003-Add-android-object-to-Android-surface-information.patch
git am < patches/0004-Add-support-to-play-multiple-video-instances-in-Andr.patch

Did you also checkout the VLC code to the provided HASH ? Not only Android VLC port.

Yes I did! Followed exactly the readme, with the android folder checked out to 8b51735dab3c473f9697aa14c0b4b800fc217987 and the vlc check both to 5967150642d875f12aa69ecc853e935fc593077a and the latest.
I'll try with these commands you suggested now

Ok I've redone all the process really carefully and there was no problem with the patches! Sorry, I hope you doidn't wast time for that!! :/

There is a problem when I try to compile with ./compile.sh --build though, it stops here:

../../modules/video_output/android/android_window.c:1005: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/android_window.c:970: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/surface.c:411: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/surface.c:378: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
collect2: error: ld returned 1 exit status
make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1
make[1]: Leaving directory `/home/ambi/Desktop/android/libvlc'
make: *** [libvlc/obj/local/armeabi-v7a/libvlcjni.so] Error 2
rm android-libs/libutils.c android-libs/libmedia.c android-libs/libstagefright.c android-libs/libui.c android-libs/libcutils.c android-libs/libbinder.c android-libs/libhardware.c

(I also couldn't compile the previous version and I used your precompiled version)

Could you apply one by one and compile after the patch is applied ?

This also gives me errors :/ Can't you maybe also update the sdk in the repo so I can test the new version?

I will try in a clean clone to see what is going on. SDK library updated.

I write here to give you some feedback.
The latest sdk runs very well, I can go up to 6 instances and the performance is still very good (on nexus 5).
I noticed that if I don't handle properly rotation changes and I create new ones (like 8-12 really fast) the devices just freezes and I had to soft reset (but it's not a problem of your patch).

I'm going to work with this multiple instance on streams so maybe something can come out, but for now it's really performing well!

Hi, thanks for the feedback. As for the compile issue, as soon as I have some more time I will do a clean clone and see what is going on.

Hi,

No stress at all, but do you think you're going to take a look at the problem of the patches that do not apply?

If not I will try to do it by hand, but I wanted to ask just to be sure 😄

Thanks!