How to build
============

1. ffmpeg
---------

CyTV includes a slightly modified version of ffmpeg. The first difference is that AVI encoding is deliberately broken in CyTV's version, making it possibly to break the 1, 2, and 4 GB barriers while streaming with transcoding. Second, timestamp discontinuities will be repaired after 1 second instead of 10.

To build the modified version, go to the ffmpeg-<version> directory and type "./configure; make" in a Terminal window. This should result in an excutable file "ffmpeg" being built in the ffmpeg-<version> directory. Copy this file to its parent directory (i.e. to the same level where the directories "CyTV Client", "CyTV Server", etc. reside).


2. VLC modules
--------------

To prevent caching issues and to allow chosing an aspect ratio in the client, CyTV uses customized VLC modules. Additionally, it includes modifications to support the Plextor ConvertX (which produces slightly broken streams). The modified modules have to be built for each VLC version seperately (even for point releases like 0.8.1) because VLC initializes each plugin with a version-specifc call.

To build the modules, download the VLC source code, cd to the directory with the source and execute "patch -p1 </path/to/cytv/source/vlc.patch" (versions 0.8.0 and 0.8.1) or "patch -p1 </path/to/cytv/source/vlc_[version].patch". Now build VLC according to its documentation. Afterwards, copy the files "modules/access/libaccess_http_plugin.dylib" and "modules/video_filter/libcrop_plugin.dylib" to the "vlc" subdirectory of the CyTV source code, prefixing them with the VLC version they were built for (e.g. 0_8_0_libaccess_http_plugin.dylib).


3. corkscrew
------------

CyTV uses Pat Padgett's corkscrew available at "http://www.agroman.net/corkscrew/". Download the source, build it, and copy the generated executable "corkscrew" to the CyTV source directory.


4. plistmodule
--------------

Open the "plistmodule" project in Xcode and build it. It enables easy access to preferences files from python code.


5. realtimemodule
-----------------

Open the "realtimemodule" project in Xcode and build it. It contains the necessary support for realtime threads.


6. RealtimeWrapper
------------------

Open the "RealtimeWrapper" project in Xcode and build it. It contains support for realtime threads (not used in the current version, but a build dependency nevertheless).


7. SSHAskPassHelper
-------------------

Open the "SSHAskPassHelper" project in Xcode and build it. It contains necessary functionality for the client side of the secure server option.


8. osascript
------------

Open the "osascript" project in Xcode and build it. It contains a small wrapper around the NSAppleScript class and allows CyTV to work on systems where the BSD subsystem is missing (at least on OS X 10.2).


9. CyTV Server
--------------

Open the "CyTV Server" project in Xcode and build it.


10. CyTV Client
--------------

Open the "CyTV Client" project in Xcode and build it.


11. Distribution
----------------

If you want to use CyTV on other machines than the one you built it on, you have to change the build styles of all Xcode projects to "Deployment". This  deactivates ZeroLink (which produces executables that only work on the development machine).
