Page 1 of 1
Mini VLC preview in apps
Posted: 13 Mar 2013 20:59
by AndroidMatth
Hello,
I would like to have a small preview with VLC of a playing stream in my apps. How can I do that ? However I want to continue to use my main apps.
I think it's not possible to embbed the vlc apps in other activity ?
So may be can I start a little VLC player (with size and position parameters) over my apps screen.
If some one have an idea to do that, that's great.
Thank's
Re: Mini VLC preview in apps
Posted: 13 Mar 2013 22:12
by edwardw
I don't think this is supported in any way right now, but you can use Intents to fulfill this or a similar use-case
![Smile :)](./images/smilies/icon_smile.gif)
Re: Mini VLC preview in apps
Posted: 14 Mar 2013 07:18
by gregoiregentil
Do what I have done:
viewtopic.php?t=108078. Integrate the library andthe jni without any modification, do small modif in java code...
Re: Mini VLC preview in apps
Posted: 14 Mar 2013 12:23
by edwardw
Yes, and violate the GPL... great idea.
Re: Mini VLC preview in apps
Posted: 14 Mar 2013 14:09
by AndroidMatth
Thank's for your answer, I'll take a look to use Intent.
Re: Mini VLC preview in apps
Posted: 23 Mar 2013 14:02
by AndroidMatth
Hello,
I'll finally try to use direclty Libvlc.
I have take a look at the topic :
viewtopic.php?t=108078
But I have a problem with the project.
- I compile successfuly vlc android.
- I create a new test project with the differents classes
and when I start the project I have the following exceptions :
Code: Select all
03-23 12:45:08.673: D/dalvikvm(1650): Trying to load lib /data/data/com.mypackage.testvlc/lib/libiomx-gingerbread.so 0x40514678
03-23 12:45:08.673: D/dalvikvm(1650): Added shared lib /data/data/com.mypackage.testvlc/lib/libiomx-gingerbread.so 0x40514678
03-23 12:45:08.673: D/dalvikvm(1650): No JNI_OnLoad found in /data/data/com.mypackage.testvlc/lib/libiomx-gingerbread.so 0x40514678, skipping init
03-23 12:45:08.683: D/dalvikvm(1650): Trying to load lib /data/data/com.mypackage.testvlc/lib/libvlcjni.so 0x40514678
03-23 12:45:08.703: D/dalvikvm(1650): Added shared lib /data/data/com.mypackage.testvlc/lib/libvlcjni.so 0x40514678
03-23 12:45:08.703: V/VLC/LibVLC(1650): Initializing LibVLC
03-23 12:45:08.703: D/AndroidRuntime(1650): Shutting down VM
03-23 12:45:08.703: W/dalvikvm(1650): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-23 12:45:08.723: E/AndroidRuntime(1650): FATAL EXCEPTION: main
03-23 12:45:08.723: E/AndroidRuntime(1650): java.lang.IllegalStateException: Could not execute method of the activity
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.view.View$1.onClick(View.java:2144)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.view.View.performClick(View.java:2485)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.view.View$PerformClick.run(View.java:9153)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.os.Handler.handleCallback(Handler.java:587)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.os.Handler.dispatchMessage(Handler.java:92)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.os.Looper.loop(Looper.java:123)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.app.ActivityThread.main(ActivityThread.java:3647)
03-23 12:45:08.723: E/AndroidRuntime(1650): at java.lang.reflect.Method.invokeNative(Native Method)
03-23 12:45:08.723: E/AndroidRuntime(1650): at java.lang.reflect.Method.invoke(Method.java:507)
03-23 12:45:08.723: E/AndroidRuntime(1650): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-23 12:45:08.723: E/AndroidRuntime(1650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-23 12:45:08.723: E/AndroidRuntime(1650): at dalvik.system.NativeStart.main(Native Method)
03-23 12:45:08.723: E/AndroidRuntime(1650): Caused by: java.lang.reflect.InvocationTargetException
03-23 12:45:08.723: E/AndroidRuntime(1650): at java.lang.reflect.Method.invokeNative(Native Method)
03-23 12:45:08.723: E/AndroidRuntime(1650): at java.lang.reflect.Method.invoke(Method.java:507)
03-23 12:45:08.723: E/AndroidRuntime(1650): at android.view.View$1.onClick(View.java:2139)
03-23 12:45:08.723: E/AndroidRuntime(1650): ... 11 more
03-23 12:45:08.723: E/AndroidRuntime(1650): Caused by: java.lang.NullPointerException
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.VLCApplication.getAppResources(VLCApplication.java:93)
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.Util.readAsset(Util.java:100)
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.Util.hasCompatibleCPU(Util.java:279)
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.LibVLC.init(LibVLC.java:195)
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.LibVLC.getInstance(LibVLC.java:98)
03-23 12:45:08.723: E/AndroidRuntime(1650): at org.videolan.vlc.VideoPlayerActivity.BTN_LoadVLC_click(VideoPlayerActivity.java:47)
03-23 12:45:08.723: E/AndroidRuntime(1650): ... 14 more
I start initialize libvlc on button click : BTN_LoadVLC_click()
The VLCApplication instance is not initialise anywhere ? When getAppResources() method is calling a NullPointerExcption is throw.
Maybe someone have an idea ?
Thank's
Re: Mini VLC preview in apps
Posted: 23 Mar 2013 20:36
by Jean-Baptiste Kempf
Good point, that is a bug.
Re: Mini VLC preview in apps
Posted: 23 Mar 2013 20:41
by edwardw
VLCApplication.java does not have a line 93...
Re: Mini VLC preview in apps
Posted: 23 Mar 2013 23:13
by AndroidMatth
At line 89 in the original file ... When I call getAppResources().
Re: Mini VLC preview in apps
Posted: 23 Mar 2013 23:20
by edwardw
According to Android documentation:
http://developer.android.com/reference/ ... eate%28%29
Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.
Probably you are missing <application android:name="org.videolan.vlc.VLCApplication"> in your AndroidManifest.xml or something.
Re: Mini VLC preview in apps
Posted: 24 Mar 2013 23:34
by Jean-Baptiste Kempf
This is totally wrong anyway, because Libvlc.java should not call VLCApplication
Re: Mini VLC preview in apps
Posted: 25 Mar 2013 03:15
by edwardw
Well, the current purpose of VLC for Android is to be a player, not a VLC SDK. Maybe that will be implemented later on, when we have VLC fully functioning and completely fast and stable.
Re: Mini VLC preview in apps
Posted: 25 Mar 2013 13:27
by AndroidMatth
Thank's for your answer.
I call the VLCApplication constructor, pending a stable version, I can use Libvlc alone.
However, when I call readMedia() that apparent works but I have no video ...
I have a lot of warnings : yuv_rgb_neon filter can't get output picture
That's a problem with hardware decoding ? (when I use directly VLC apps, with the same stream that works fine)
I have also an error before the warning :
Code: Select all
E/VLC(1360): [0x2c3744]: main vout display Failed to set on top
May be that the cause ?
Re: Mini VLC preview in apps
Posted: 25 Mar 2013 13:38
by Jean-Baptiste Kempf
Well, the current purpose of VLC for Android is to be a player, not a VLC SDK.
<ref needed>
It was clearly one of the purposes when the project was started.