Skip to content

Compile VLC for Meta.Vlc

HIGAN edited this page Mar 30, 2018 · 1 revision

xZune.Vlc 使用了某些 VLC 的拓展功能,我们目前提供 LibVlc(2.2.0-xZune) 32bit 版本.如果您需要在更低或者更高的 VLC 版本上使用 xZune.Vlc,您可能需要自己编译 VLC for xZune.Vlc,以保证 xZune.Vlc 拓展功能可用.

xZune.Vlc has used some "Expansions" for VLC, we are providing LibVlc(2.2.0-xZune) 32bit version now.But you want to use xZune.Vlc with later or lower version,you could need compile VLC for xZune.Vlc by yourself,to ensure that the expansions are available.

Expansion functions

这里列举了 xZune.Vlc 的拓展功能,如果您不需要这些功能,就可以使用原生的 LibVlc.
There are xZune.Vlc used all Expansions,if you don't need those,you can use xZune.Vlc with native LibVlc.

  1. 可使用鼠标与 DVD 菜单进行交互(需要 VLC 2.0.0 或以上的版本).
    Interact with DVD menu by using mouse.

Start compiling

关于具体的编译过程可以参考 Win32Compile.
About how to compile VLC,see: Win32Compile.

01.搭建编译环境 01.Build compile environment
你可以参考上面的 Wiki,来为编译搭建需要的环境.
You can refer to the Wiki, to build a environment what we need.

02.下载 VLC 源码
02.Get source code of VLC
在上面的 Wiki,你可以找到 VLC 的各个版本的源代码.最新版本是 3.0.0-git,但是我们在编译这个版本中出现了问题,因此我们推荐 2.2.0 版本的源代码.
In Wiki,You can find the source code for each version of VLC.The last version is 3.0.0-git,but we get some wrong with compile this,so we recommend the 2.2 version.

03.在配置文件中更改版本
03.Change version in configure file
xZune.Vlc 使用 DEV 字符串来区分是否是 xZune.Vlc 的拓展功能,首先您需要在源代码的配置文件中更改 DEV 字符串.
xZune.Vlc used the DEV string to distinguish Expansions of xZune.Vlc,first you need to change DEV string in configure file.

01.打开 "configure.ac"
01.Open "configure.ac"

02.修改 "AC_INIT(vlc, 2.2.0-xZune)"
02.Change "AC_INIT(vlc, 2.2.0-xZune)"

03.修改 "VERSION_DEV=" 为 "VERSION_DEV=xZune"
03.Change "VERSION_DEV=" to "VERSION_DEV=xZune"

04.保存更改
04.Save changes

04.修改 VLC 源代码 04.Change code of VLC
修改 VLC 源代码,加入拓展功能.
Change code of VLC to add Expansions.

01.在 "$(vlc)\lib\video.c" 中加入代码
01.Add those code in "$(vlc)\lib\video.c"

int libvlc_video_set_cursor(libvlc_media_player_t *mp, unsigned num,
  int px, int py)
{
  vout_thread_t *p_vout = GetVout(mp, num);
  if (p_vout == NULL)
  	return -1;

  var_SetCoords(p_vout, "mouse-moved", px, py);
  vlc_object_release(p_vout);
  return 0;
}

int libvlc_video_set_mouse_down(libvlc_media_player_t *mp, unsigned num,
  unsigned buttonNumber)
{
  vout_thread_t *p_vout = GetVout(mp, num);
  if (p_vout == NULL)
  	return -1;

  var_OrInteger(p_vout, "mouse-button-down", 1 << buttonNumber);

  int x, y;
  var_GetCoords(p_vout, "mouse-moved", &x, &y);
  var_SetCoords(p_vout, "mouse-clicked", x, y);

  return 0;
}

int libvlc_video_set_mouse_up(libvlc_media_player_t *mp, unsigned num,
  unsigned buttonNumber)
{
  vout_thread_t *p_vout = GetVout(mp, num);
  if (p_vout == NULL)
  	return -1;

  var_NAndInteger(p_vout, "mouse-button-down", 1 << buttonNumber);

  return 0;
}

02.在 "$(vlc)\libvlc_media_player.h" 中加入代码
02.Add those code in "$(vlc)\libvlc_media_player.h"

LIBVLC_API
int libvlc_video_set_cursor(libvlc_media_player_t *mp, unsigned num,
  int px, int py);

LIBVLC_API
int libvlc_video_set_mouse_down(libvlc_media_player_t *mp, unsigned num,
  unsigned buttonNumber);

LIBVLC_API
int libvlc_video_set_mouse_up(libvlc_media_player_t *mp, unsigned num,
  unsigned buttonNumber);

03.在 "$(vlc)\lib\libvlc.sym" 符号表中加入
03.Add those in "$(vlc)\lib\libvlc.sym"

libvlc_video_set_cursor
libvlc_video_set_mouse_down
libvlc_video_set_mouse_up

04.编译 VLC for xZune.Vlc
04.Compile VLC for xZune.Vlc
具体编译步骤参考上面的 Wiki,编译完成后,复制 "libvlc.dll" 和 "libvlccore.dll" 到对应的库目录即可.
VLC for xZune.Vlc 可以与同版本的 VLC 兼容使用.

See the Wiki of VideoLan, after compiling completed, copy "libvlc.dll" and "libvlccore.dll" to folder of libvlc.
VLC for xZune.Vlc can compatible with the same version VLC.

Clone this wiki locally