Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12402343
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C/C++

2011-04-09 23:41:02

Table of Contents

Port steps

Building

Port steps

Basically, porting to a new architecture boils沸腾 down to follow the following steps :

1. Building the VLC : That may be the most difficult part, depending on how POSIX the architecture is. You have to produce valid合法正当的 C.

2. Having video : If your architecture features an X server, it should be straightforwardwps_clip_image1wps_clip_image2, though you might have problems with xvideo or xshm. Otherwise you can try to use SDL if it is supported, or end up writing your own video output plugin.

3. Having audio : If your architecture features an OSS compatible wps_clip_image3DSP or ALSA, you can reusewps_clip_image4 an existing wps_clip_image5plugin. Otherwise you will have to write your own audio output plugin.

4. Accessing DVDs : You are going to need a write access to the DVD device. Every system has specific ioctl() for key negociation with the DVD drive, so we have set up an abstration layer in plugins/dvd/dvd_ioctl.c. You might need to add stuff here. Some operating systems won't give you access to the key negociation (MacOS X), so you will have to write a kernel extensionwps_clip_image6 or you will only be able to read unencrypted未被加密的 DVDs. Other operating systems might only give you read access to the DVD device if you are root. Your mileage may vary.

5. Writing a native interface : If your system doesn't support GTK or Qt, you will have to write a native interface plugin (for instance Aqua or Win32). You may also need to rewrite the video output plugin if you're currently using a slow compatibility layer.

6. Optimizing : If your architecture features a special set of multimedia instructions (such as MMX) that is not supported by VLC, you may want to write specific optimizations. Heavy calculation parts are : IDCT (see idct plugin), motion compensation (see motion plugin), and YUV (see video output) if you don't use the YUV overlay support of your video board (SDL or XVideo extension).

Building

This is probably the most complicated part. If your platform is fully POSIX-compliant (such as GNU/Linux), it should be quick, otherwise expect troubles. Known issues are :

· Finding a compiler : We use gcc on all platforms, and mingw32 to cross-compile the win32 port. If you don't you're probably in very big trouble. Good luck.

· Finding GNU make : Our Makefile is heavily GNU make specific, so I suggest you install it.

· Running the configure script : This is basically a shell script, so if you have a UNIX shell on your platform it shouldn't be a problem. It will probe your system for headers and libraries needed. It needs adequate config.sub and config.guess, so if your platform is young your provider may have supplied customized versions. Check with it.

· Compiling the VLC binary : This is the most difficult. Type make or gmake and watch the results. It will probably break soon on a parse error. Add the headers missing, fix mistakes. If you cannot make it to also compiles on other platforms, use #ifdef directives. Add tests for functions or libraries in configure.in and run autoheader and autoconf. Always prefer tests on #ifdef HAVE_MY_HEADER_T, instead of #ifdef SYS_MYOPERATINGSYSTEM. You may especially experience problems with the network code in src/input/input.c.

· Threads : If your system has an exotic thread implementationwps_clip_image7, you will probably need to fill the wrappers in include/threads.h for your system. Currently supported implementations include the POSIX pthreads, the BeOS threads, and the Mach cthreads.

· Linking : You will need special flags to the compiler, to allow symbol exports (otherwise plug-ins won't work). For instance under GNU/Linux you need -rdynamic.

· Compiling plug-ins : You do not need external plug-ins at first, you can build all you need in (see Makefile.opts). In the long run though, it is a good idea to change PCFLAGS and PLCFLAGS to allow run-time loading of libraries. You are going to need libdl, or a similar dynamic loader. To add support for an exotic dynamic loader, have a look at include/modules_core.h . Currently supported implementationswps_clip_image8 include the UNIX dynamic loader and the BeOS image loader.

· Assembling : If you use specific optimizations (such as MMX), you may have problem assembling files, because the assembler syntaxwps_clip_image9 may be different on your platform. Try without it at first. Pay attention to the optimization flags too, you may see a huge difference.

VLC should work both on little endian and big endian systems. All load operations should be alignedwps_clip_image10 on the native size of the type, so that it works on exotic外来的,外国来的

processors like Sparc or Alpha. It should work on 64-bit platforms, though it has not been optimizedwps_clip_image11 for it. A big boost for them would be to have a WORD_TYPE = u64 in include/input_ext-dec.h, but it is currently broken for unknown reasons.

If you experience run-time problems, see the following appendix and pray 请求for you to have gdb...

阅读(2739) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~