Parasitic AsCii Art windows

This forum is about all development around libVLC.
Alexolut
Blank Cone
Blank Cone
Posts: 21
Joined: 28 Aug 2012 12:39

Parasitic AsCii Art windows

Postby Alexolut » 30 Mar 2015 17:54

Hello everyone.

I use libvlc to display the video stream in my .Net program writen on C#.

Most of the time everything is stable. But periodically instead of displaying video
in designated control (UserControl), library automatically creates an additional window
with the title "VLC (Colour AsCii Art)".

Image

To display video I use the following code:

Code: Select all

libvlc_media_player_set_hwnd (player, hWnd); libvlc_media_player_play (player);
Where hWnd - is the result of the call to System.Windows.Forms.Control.Handle property.

If instead of hWnd I pass IntPtr.Zero, library creates expected additional window
"VLC (Direct3D output)". Parasitic windows AsCii thus never observed.

So I have formed the opinion that when displaying video while hWnd != NULL I do not consider some nuances.

Please tell me what action should I take to solve the problem as soon as possible?
It is necessary to eliminate the occurrence of spurious window "AsCii Art".

Thanks in advance.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Parasitic AsCii Art windows

Postby Rémi Denis-Courmont » 30 Mar 2015 18:39

The spurious ASCII Art is a known bug that should already be fixed in VLC 3.0.git.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Alexolut
Blank Cone
Blank Cone
Posts: 21
Joined: 28 Aug 2012 12:39

Re: Parasitic AsCii Art windows

Postby Alexolut » 31 Mar 2015 11:51

Thank you for answer, Rémi.

Parasitic windows are gone.
But if previously opened window in ascii mode, now the video is not displayed at all if a similar situation occured.
Tested on vlc-3.0.0-git-20150329-0002-win32.exe

Any suggestions?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Parasitic AsCii Art windows

Postby Rémi Denis-Courmont » 31 Mar 2015 12:52

If you can't explain the difference between when it works and when it does not, then it is unlikely that anybody will be able to help you.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Alexolut
Blank Cone
Blank Cone
Posts: 21
Joined: 28 Aug 2012 12:39

Re: Parasitic AsCii Art windows

Postby Alexolut » 31 Mar 2015 13:37

All that I do is:
1. Create a form on which I want to display the video;
2. Starts playback for a few seconds;
3. Stop the video;
4. Close the window;
5. Repeat steps 1-4 until the error occurs.

I do not know whether it is important, but in fact I create 4 controls on a single form. Each control displays one video server's channel.

Previously (vlc 2.1.5), this has led to the creation of parasitic AsCii window.
Now (3.0.0-git) the video is not displayed at all.

My VlcWrapper class here:

Code: Select all

private class VlcWrapper { private IntPtr player; private IntPtr libvlc; public void Play(string file, IntPtr hWnd) { libvlc = libvlc_new(0, null); var media = libvlc_media_new_location(libvlc, file); player = libvlc_media_player_new_from_media(media); libvlc_media_release(media); libvlc_media_player_set_hwnd(player, hWnd); libvlc_media_player_play(player); } public void Stop() { if (player != IntPtr.Zero) { libvlc_media_player_stop(player); player = IntPtr.Zero; } if (libvlc != IntPtr.Zero) { libvlc_release(libvlc); libvlc = IntPtr.Zero; } } public bool IsPlaying { get { if (player == IntPtr.Zero) return false; var media = libvlc_media_player_get_media(player); if (media == IntPtr.Zero) return false; LibVlcInputState state = libvlc_media_get_state(media); switch (state) { case LibVlcInputState.libvlc_Opening: case LibVlcInputState.libvlc_Buffering: case LibVlcInputState.libvlc_Playing: return true; default: return false; } } } public int FramesCount { get { if (player == IntPtr.Zero) return 0; MediaStat stat; var media = libvlc_media_player_get_media(player); libvlc_media_get_stats(media, out stat); return stat.i_displayed_pictures; } } [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr libvlc_new( int argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] argv); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr libvlc_media_new_location( IntPtr p_instance, [MarshalAs(UnmanagedType.LPStr)] string path); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr libvlc_media_player_new_from_media(IntPtr media); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern void libvlc_media_player_set_hwnd( IntPtr player, IntPtr hwnd); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern void libvlc_media_player_play(IntPtr player); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern void libvlc_media_player_stop(IntPtr player); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr libvlc_media_player_get_media(IntPtr player); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern void libvlc_media_release(IntPtr media); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern void libvlc_release(IntPtr libvlc); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern LibVlcInputState libvlc_media_get_state(IntPtr media); [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] private static extern int libvlc_media_get_stats(IntPtr media, out MediaStat stat); [StructLayout(LayoutKind.Sequential)] public struct MediaStat { public int i_read_bytes; public float f_input_bitrate; public int i_demux_read_bytes; public float f_demux_bitrate; public int i_demux_corrupted; public int i_demux_discontinuity; public int i_decoded_video; public int i_decoded_audio; public int i_displayed_pictures; public int i_lost_pictures; public int i_played_abuffers; public int i_lost_abuffers; public int i_sent_packets; public int i_sent_bytes; public float f_send_bitrate; } private enum LibVlcInputState { libvlc_NothingSpecial, libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused, libvlc_Stopped, libvlc_Ended, libvlc_Error } }
Maybe I'm doing something wrong in my code?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests