[Resolved]IO Thread about libVLC.

This forum is about all development around libVLC.
higan
New Cone
New Cone
Posts: 6
Joined: 18 Feb 2016 17:17

[Resolved]IO Thread about libVLC.

Postby higan » 25 Mar 2016 08:38

Hi:
I have some question about thread of libVLC.

I'm using video callback to display Video(xZune.Vlc).
I think libVLC works on multi-thread, decode thread, IO thread or other threads.

But the file IO is not seem in background thread.

It is like:
01.I create a Window running on Main UI thread(ID:1).
02.I create display control in this window, which runs on a new UI thread(ID:2).
03.I create VlcMediaPlayer and VlcMeida on thread(ID:2).
04.I set video callback of Player, it runs on a background thread(ID:3) which distribute by VLC.
05.When video display data updates(in video callback, lock, unlock and display) on thread(ID:3), it will update display control, the update happens on thread(ID:2).
06.User update the main UI which's in thread(ID:1).
07.But the UI updating costs too much time, thread(ID:1) is stuck.
08.The video then pause about 500 ms later.
09.After thread(ID:1) restores, the video may display many gray blocks.

Why I think it maybe file IO problem?
01.Gray block usually appears while playing a Internet stream when network connection is not stable.
02.While the video callback goes on(thread ID 3), but the video is not playing.

So, I want to know how libVLC works with threads. How many threads it works with? Why does VLC use the main thread(ID:1)? I create it on thread(ID:2).

--------------------

BTW, about another issue of libVLC. I am not sure it is a issue of libVLC.
Some people tell to me that some AccessViolationException is thrown when set a VlcMedia to VlcMediaPlayer(libvlc_media_player_set_media function).
I run the same code, same video, same libVLC on my PC, but it work fine.
I am using Windows 10, but he using Windows 7. I am not sure this is the reason.

Note:
When you attempted to read or write protected memory. AccessViolationException will be thrown. This is often an indication that other memory in corrupt.

Thanks for any advice.
Last edited by higan on 25 Mar 2016 10:56, edited 1 time in total.

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

Re: IO Thread about libVLC.

Postby Rémi Denis-Courmont » 25 Mar 2016 09:49

LibVLC performs I/O in the LibVLC input thread. I don't know what you mean by "background".
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

higan
New Cone
New Cone
Posts: 6
Joined: 18 Feb 2016 17:17

Re: IO Thread about libVLC.

Postby higan » 25 Mar 2016 10:26

LibVLC performs I/O in the LibVLC input thread. I don't know what you mean by "background".
Ummm, I have solved it, thank you, because I have use the sync event of libVLC in main UI thread.
When main UI thread stuck, those event will be block the LibVLC input thread, then IO will be stop.

Thank you very much.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests