Darwin Streaming Server Source Code

Developer Notes

 

 

Table of Contents

Building
Installation
Configuration and Testing 

 

Licensing

The Darwin Streaming Server is distributed under the terms of the Apple Public Source License. For more information, refer to the license terms at www.publicsource.apple.com. Note that the Apple Public Source License does not allow you to use the terms "QuickTime" or "QuickTime Streaming Server" in descriptions of products developed using Darwin Streaming Server open source code, nor use any Apple trademarks or logos associated with QuickTime and QuickTime Streaming Server.

  

Building

If you downloaded a binary package of Darwin Streaming Server, skip to the "Installing" section.

To build Darwin Streaming Server on UNIX platforms including MacOS X, type "./Buildit" from within the Darwin Streaming source directory. The script determines the current OS and hardware platform, and builds all of the targets for that platform: DarwinStreamingServer, PlaylistBroadcaster, qtpasswd, and dynamic modules included in the "StreamingServerModules" folder.

To build Darwin Streaming Server on Windows NT or Windows 2000, you must have a copy of Visual C++. There is a VC++ workspace file located inside the WinNTSupport directory. Once the workspace is open, from the Build menu select Batch Build.

** Note: StreamingLoadTool source is not publicly available from Apple and the related build targets will not build.

Building the Installer

On OS X, type "./BuildOSXInstallerPkg dss". An OS X installer package will be created.

On Unix platforms, type "./Buildit install". A DarwinStreamingSrvr-Platform install directory and tar file will be created.

On Windows, after building using the WinNTSupport project, run the MakeZip.bat file inside WinNTSupport directory. A WinNTSupport\DarwinStreamingServer install directory will be created.

Installing

On OS X, double click the DarwinStreamignServer.pkg created by the BuildOSXInstallerPkg script.

On Unix platforms, type ./Install from within the DarwinStreamingSrvr-Platform directory.

On Windows, run the Install script from within the DarwinStreamingServer directory.

How to build your dynamic QTSS API modules

For building new dynamic QTSS API modules on Mac OS X, follow the instructions in the QTSS API developer documentation, "QTSSAPIDocs.pdf".

For platforms other that Mac OS X, your module must be built as a shared object, and it must include APIStubLib/QTSS_Private.cpp. This file is the "stub library" that all modules must link against.

On most UNIX platforms, building a shared object is like building any other executable, with the addition of one command-line argument to the linker. On Linux, the -shared option tells the linker that it is producing a shared object, on Solaris, the option is -G.

The dynamic QTSS API modules that come with Darwin Streaming Server each have a Makefile.POSIX makefile in their respective source directories. These makefiles execute when the Buildit script runs, and contain the make rules to make the dynamic module for each currently supported UNIX platform. It is easiest to use these existing makefiles as a template to copy and modify for your new QTSS API module.

 

Installation

The next step is to install and configure the server. On all platforms, the server reads its preferences from a config file. A default config file, streamingserver.xml, comes with both the source and binary packages. On Mac OS X, the server looks for the file in /Library/QuickTimeStreaming/Config. On Windows, the server looks for the file in "C:\Darwin Streaming Server". On UNIX platforms, the server looks for this file in /etc/streaming. If the streamingserver.xml file isn't available in the directory, the server will create one with the default configuration settings.

Once the server is built, you will have an executable called DarwinStreamingServer. The server can be run from the directory where it is built, or you can copy it to another location. On Mac OS X, the binary is called QuickTimeStreamingServer and will be placed in the build directory.

To run the server from the directory where it is compiled, just type ./DarwinStreamingServer.

 

Configuration and Testing

The server serves all streaming content out of its "media folder". By default, on Mac OS X, this media folder is located at /Library/QuickTimeStreaming/Movies. This path is one of the preferences in the config file. If you want your media folder to be located somewhere else, you must edit the "movie_folder" preference before starting the server. You can also set the movie folder in the web based administration interface. You can start administering by going to http://localhost:1220/ on your server.

Once you have a media folder, you can place streaming media into the folder. All QuickTime files must be "hinted" with QuickTime Player Pro or other QuickTime authoring applications before they can be streamed. Once the movie is hinted, copy the file to the streaming media folder on your server.

Sample movies (sample_100kbitmov, sample_300kbit.mov, sample_100kbit.mp4, sample_300kbit.mp4) are included in the package and in the source directory. The sample movies are already hinted, so you can place them into your media folder. From the QuickTime client, attempt to access those movie through an rtsp URL (e.g. rtsp://my.server.com/sample_100kbit.mov), and the server will stream that movie to the client.

In order to "reflect" a live broadcast, you must setup and start a broadcaster application, such as the QuickTime Broadcaster. The broadcaster produces an SDP file that describes the live broadcast. Place that SDP file into your media folder, access the URL from a QuickTime Client, and the server will "reflect" the live broadcast to the client. You can also do an automatic unicast from broadcasters that support this feature. You do not have to copy the SDP file to the media folder if you select this option.

Also included with the Darwin Streaming Server is StreamingLoadTool, a stress tool for testing the server. StreamingLoadTool realistically simulates many RTSP clients viewing a movie from the server. The tool offers many command-line options that can create different types of simulations. Typing ./StreamingLoadTool will print a description of all available options.

StreamingLoadTool will only work if there is a movie called "StreamingLoadTool.mov" in the root movie folder of the target server. This file must be a valid, hinted QuickTime movie.

For more information about authoring, hinting, and streaming QuickTime media, refer to the QuickTime Streaming Server documentation.

 

©right; 1999-2003 Apple Computer, Inc. All rights reserved. Apple, the Apple logo, Mac, Macintosh, PowerBook, Power Macintosh, and QuickTime are trademarks of Apple Computer, Inc., registered in the United States and other countries. eMac, iBook, iMac, Power Mac and Xserve are trademarks of Apple Computer, Inc. All other product names are trademarks or registered trademarks of their respective holders.