DevX Home    Premier Club    Search    Help    Locator+    Shop DevX    





 
Case Study: Snapstream's Experience Porting to Microsoft® Windows® XP

By Dave Perkovich

Introduction

At the time Snapstream Media decided to port their Windows-98-based "personal video station" (PVS) software to Windows XP, they had already received market kudos — including a Best of Show Finalist nomination at this year's Computer Electronics Show (CES) — for their product that allows consumers to record and then view their favorite television programs from anywhere, on a variety of viewing devices.

In doing the port, Snapstream was able to take advantage of new features in XP to offer handy extra end-user features, including easier CD creation, and parental control.

Seeing the Opportunity

Snapstream PVS was developed as a result of the frustrations of Richard Kuo, who found it a complete pain trying to keep up on his favorite TV shows while traveling throughout the country as a consultant. While he could program a VCR to record his shows (a feat in itself), he couldn't play them back while on the road. Seeing an opportunity, he joined with Rakesh Agrawal in 1999 to form Snapstream Media in Houston, Texas, to develop a Windows-based software application to help manage the recording of TV shows for personal use.

As Richard and Rakesh updated the Snapstream PVS product to embrace new Windows XP features, Microsoft designated Snapstream Media as an early Windows XP ISV.

Snapstream's long-term vision is to build a network video platform which ultimately allows to consumers to access their favorite television shows and movies (and other video entertainment content) anywhere, anytime, on any viewing device.

Product Features

Snapstream PVS makes it possible for the consumer to both record and manage TV shows from their PC. In addition to configuring the software to record TV shows the user is interested in, Snapstream also provides a separate product called PocketPVS that allows the playback of recorded shows to a PocketPC device. In addition, with Windows XP's new "burn to CD" capability, Snapstream PVS also allows users a quick and easy way to archive their recorded shows to CD-ROM for later playback.

Windows 2000 Head Start

Richard and Rakesh originally developed Snapstream PVS in C++. They also used Assembler to develop in some rare cases where they needed additional performance.

Though targeted at Windows 98 and Windows ME, much of the original code base had been developed on the Windows 2000 platform. As a result, Snapstream had a head start in terms of porting to Windows XP. Through the use of Windows API calls and re-usable COM components, the resulting code provided an application architecture more structured for the creation of future updates, such as the upcoming Windows XP version.

Benefits of Porting to Windows XP

As a result, the initial port of Snapstream to Windows XP took about 2 months. This primarily involved ensuring support of existing functionality on the new operating system, as well as leveraging new features of Windows XP for users of Snapstream. Burning to CD and fast user switching are both directly supported by Snapstream PVS.

Improving the End-user Experience

Nothing can be more frustrating in a personal computer video experience than for a user to come home and find their favorite TV shows did not record properly because of a system crash. Overall, one of the biggest benefits of moving to Windows XP has been better operating system stability. Besides running in a more stable environment, Snapstream comfortably runs in the background so the user can interact with their computer and not have to manage the Snapstream application.

XP's Fast User Switching feature allows multiple users to be logged into the computer at the same time, each on an individual private "session." Richard and Rakesh took advantage of this new Windows XP feature to offer parents control over what the system records—for example, they can configure Snapstream to record shows for themselves while blocking access to those same shows, or to whole channels, to their children. Snapstream does this by monitoring the user permission (Admin or limited) and then allowing users with limited access only to channels and shows marked as "common." Users with Admin access can, of course, have free access to Snapstream as well as the ability to configure the common shows.

Another Windows XP feature the team embraced to enhance the end-user experience is the new "Burn to CD" capability inherent to Windows XP. Users can now easily burn data to a CD writer attached to their computer. Richard and Rakesh used Burn to CD to integrate the ability to store the previously recorded TV shows for later playback off the CD into the Snapstream system.

Extending the Platform

Using the Windows Media player, users can now not only watch their shows from a CD, they can play back the shows on a PocketPC using the optional Snapstream PocketPVS module.

Leveraging Windows XP's advanced networking features, Snapstream PVS moved one step closer to the company's goal of a true video platform. Users can watch recorded shows from anywhere on their home or office network. They can pop a wireless card into their laptop and watch Star Trek from the dining room table. Or if they forgot to set up a recording of the Tour De France before leaving the house, they can connect to their SnapStream PVS from work and take care of it.

One final new feature of Snapstream that will be available only on the Windows XP platform is support for AutoPlayHandlers. One of the options in this new feature is the ability for applications, like Snapstream PVS, to quickly and easily import non-Windows Media format files for playback. For example, a user may have previously recorded MPEG or AVI video files using a different application. Windows XP AutoPlayHandlers will allow the user to import these video clips into Snapstream, and allow Snapstream to convert them into the Windows Media format. As a result, the user can then combine these previously disparate video clips into a single presentation that can be played back, or record to CD for later use.

Sample Windows XP Feature Implementation

One specific example of a new Snapstream PVS feature that is available only on the Windows XP platform is support for balloon tooltips. As shown in Figure 1, when the user places the mouse over the PVS system tray icon, a new type of tooltip is presented. In this figure, the tooltip provides the user information about the initialization of the PVS. The tooltip will close automatically based on the Timeout property set by the developer, or when the user clicks the close button in the upper right corner.

 
Figure 1.












Using the following example code, Snapstream developers were able to include this more graphical and user-friendly tip:


NOTIFYICONDATA nif;

hIconIdle = (HICON)LoadImage( ghInstance,
			MAKEINTRESOURCE(IDI_TRAYIDLE),
			IMAGE_ICON, 16, 16, LR_SHARED);

nif.cbSize = sizeof(NOTIFYICONDATA);
nif.hWnd = hWnd;
nif.uID = 77;
nif.uCallbackMessage = TASKBAR_EVENT;
nif.hIcon = hIconIdle;
_tcscpy(nif.szTip, _T("Initializing...") );
nif.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_INFO;
_tcscpy( nif.szInfo, _T("Your PVS will be fully operational in
			few seconds.") );
nif.uTimeout = 10000;
_tcscpy( nif.szInfoTitle, _T("PVS is initializing") );
nif.dwInfoFlags = NIIF_INFO;

Shell_NotifyIcon(NIM_ADD, &nif);


How Snapstream Developers Leveraged Windows XP as a Dev Platform

The application programmers at Snapstream also used Windows XP as a development platform. Some of the new features included in Windows XP helped the team increase their productivity by facilitating better communication. For example, Richard and Rakesh used the new Windows Messenger feature to replace the previous messaging system they had used, ICQ. Besides the normal text-based chats that IM facilitates, Snapstream developers took full advantage of the additional collaborative features such as streaming audio and video.

In addition, the new Most Recently Used program list was a big hit with Snapstream developers, as they could quickly launch frequently used development tools.

Overall, the new features provided by Windows XP has enhanced the user experience as well as increased productivity of the Snapstream developers.

Dave Perkovich is a Microsoft Certified Solution Developer and Microsoft Certified Trainer who focuses on developer certification training. Dave co-founded Training Associates, Inc., a company that delivers online classes using the edCenter® online learning system.




 

Sign up for our Windows XP email newsletter and we'll send you regular updates.

Microsoft Windows XP: What's in It for Developers?
What's New in the Shell
How to Write a
Windows XP Driver

Official Microsoft Windows XP Site
Overview of SOAP Client in Windows XP
Windows XP-Ready PCs from Compaq
Windows XP Home and Professional Editions: The SuperSite Review (by Paul Thurrott)
Windows XP FAQ (from ActiveWin)
CNET Windows XP Superguide
.NET Zone
Get Started With WinForms
C++ Zone