c++ - How to use LibVLC with Qt 5 -


I am trying to use LibVL in a QT5 program to open VLC examples and play a video. The following code is using Linux in I

.pro:

  TEMPLATE = app TARGET = include projectLoic + =. VLC QT + = Widgets #Input Headers + Source = = Main CPP LIBS + = - lvlc  

Main:

  #include < Vlc / vlc.h> # Include & lt; QApplication & gt; Int main (int argc, char * argv []) {Q Application app (argc, argv); Libvlc_instance_t * inst; Libvlc_media_player_t * mp; Libvlc_media_t * m; // Load the VLC engine instantly = libvlc_new (0, NULL); // Create a new item m = libvlc_media_new_path (inst, "/ home / ****"); // Create a Media Player environment environment mp = libvlc_media_player_new_from_media (m); // play media_player libvlc_media_player_play (mp); Return app.exec (); }  

The compilation is okay. But when I create it (with the QT manufacturer) the program instantly crashes any thoughts?

Many thanks to this issue, this issue can be the reason for this accident:

Many thanks to this issue.

The cause of the accident in my case was due to this bug because in the vlc ubuntu package:

P> When libvlc_new () calls the vlc module And their dependent libraries are loaded into memory LibVLC's qt module was searching for Qt5 instead of shared objects (Qt5 (manually installed).

Solution module was used to rebuild the cache that was indicated to Qt4 binaries. You can reset it to the command line:

  sudo / usr / lib / vlc / vlc-cache-gen / f / usr / lib / vlc / plugins /  

or pass the VLC option:

  - reset-plugin-cache  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -