[MPlayer-users] Slave mode bugs (?) and Java Swing embedding

Alex Sherwin alex.sherwin at gmail.com
Wed Oct 1 14:03:13 CEST 2008


I do this in a  Java now.  You can use Swing or SWT (SWT is actually
easier, they expose the window handle  on frames, in Swing you have to
use a hack that is not "supported" in the JDK, but exists and works
from 1.4.2 to the latest 1.6)

Unfortunately, if you read the man page for the -wid option, you will
see that it only works on Windows.  I've spent awhile trying to find a
way to make a x-platform java Swing or SWT app that will embed MPlayer
on Windows Linux and OS X through Java Web Start.  The closest I've
been able to come is to deliver an app that embeds MPlayer on Windows,
and provides a slimmed down interface on Linux and OS X to control
mplayer, which will open its own video display window.

I spent a bit of time on this mailing list and the IRC channel trying
to figure out a way, and had someone point me to the code where the
MPlayer GUI manages to embed the player, but this is able to do it
using shared memory segments to paint the display (which you would not
be able to accomplish with Java)

Good luck on Linux, but I'm going to say its not possible...


On Wed, Oct 1, 2008 at 6:06 AM, Javier Gálvez Guerrero
<javier.galvez.guerrero at gmail.com> wrote:
> Hi Mathieu,
>
> 2008/9/30 Mathieu SCHROETER <mathieu.schroeter at gamesover.ch>:
>> Javier Gálvez Guerrero a écrit :
>>> In order to analyze if MPlayer is such a possible candidate I've
>>> downloaded it (1.0rc2-4.2.3 in Ubuntu Linux, through Synaptics) and
>>> given it a try.
>>
>> <snip>
>>
>>  > MPlayer plays nicely all added items but if I try to "restart" the
>>  > playlist (loadfile path/to/new/file0 0) MPlayer stops playing the
>>  > current item,
>>
>> The last parameter of loadfile is used to *append* when != 0.
>
> Yes, I know that. That's why I use it to add different contents in
> sequence (thus, creating a playlist). Adding 0 or nothing has (or
> should have...) the same effect: start playing the file given as the
> first argument. What I get is not this, but restarting the current
> item. Note that this ONLY happens when, after adding many files to the
> list with 'loadfile path/to/file X' and playing an item different from
> the first one, I try to play a new item (thus restarting the playlist)
> with 'loadfile path/to/new/file' or 'loadfile path/to/new/file 0'.
>
> This is the MPlayer output:
>
>
> loadfile path/to/first/file   <--------- start the playlist with this first item
> ...
> starts playing first item
> ...
> loadfile rtsp://192.168.1.101/metal_KORN  1 <------------ added
> another item to the playlist
> ...
> finishes playing first item
> starts playing the second item (rtsp://192.168.1.101/metal_KORN)
> ...
> VO: [xv] 352x240 => 352x270 Planar YV12
> loadfile rtsp://192.168.1.101:60100/rock_REDHOT  <------- while
> playing the second item, interrupt it and start playing a new item
>
> GNOME screensaver enabled
>
> Playing rtsp://192.168.1.101:60100/metal_KORN.  <-------------- IT
> STARTS PLAYING THE CURRENT ITEM AGAIN!!!
> Resolving 192.168.1.101 for AF_INET6...
> Couldn't resolve name for AF_INET6: 192.168.1.101
> Connecting to server 192.168.1.101[192.168.1.101]: 60100...
> rtsp_session: unsupported RTSP server. Server type is 'VLC Server'.
> STREAM_LIVE555, URL: rtsp://192.168.1.101:60100/metal_KORN
>
>
>
> Checked with local and RTSP streams and different number of items.
>
> How can this be solved? Is it a bug?
>
>>
>>> ('stop' doesn't work at all, MPlayer keeps on playing without taking
>>> care of 'stop' command). I've tried with local files of different
>>> formats and RTSP streams with same results.
>>
>> Because 'stop' is not available in rc2. And I think that is not what
>> you want.
>>
>
> So, any similar command in rc2? Will it be available in the final
> release?  I just wanted to check that the previous issue couldn't be
> solved calling this command before.
>
>>
>> IHMO to manage a playlist, I suggest you to do this job in your
>> application.
>>
>
> Emmmm... What do you mean? I want to develop a media player frontend
> through which I can manage playlists, so obviously, I will do it with
> my application, but I need the embedded a media player to support it.
> I could restart MPlayer every time I needed a new playlist but this is
> inefficient and for sure there is a better alternative using native
> MPlayer commands, isn't it?
>
>
> Any idea, suggestion or piece of advice would be much appreciated.
>
> Thanks,
> Javi
>
>
>
>> Regards,
>> Mathieu
>> _______________________________________________
>> MPlayer-users mailing list
>> MPlayer-users at mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>



-- 
Alexander Sherwin
alex.sherwin at gmail.com



More information about the MPlayer-users mailing list