README.TXT

------------------------------------------------------------------ 
    Microsoft Broadcast Architecture SDK UseVideo Readme File 
                         August 1997 
------------------------------------------------------------------ 
 
             (c) Copyright Microsoft Corporation, 1997 
 
CONTENTS 
======== 
 
Using the Video ActiveX Control 
 
 
SUMMARY 
======= 
 
The UseVideo samples demonstrate presenting audio and video  
in an application, a Web browser, and in a control you create. 
The following four programs are contained in the UseVideo sample: 
 
1. Video Test Project (VidCntrl) demonstrates a project containing a  
   standard Visual Basic form that hosts and manipulates an instance  
   of the Video ActiveX control. 
 
2. Video Web Page (WebTune) demonstrates embedding and using the  
   Video ActiveX control in a Web page. 
 
3. Video Test Control (Vid_Tune) demonstrates creating a control that  
   contains the Video ActiveX control as a constituent control. 
 
4. Video MFC Test describes building an application for Windows with  
   C++ classes from the Microsoft Foundation Class Library (MFC). 
 
In addition to presenting audio and video, these samples show how to embed  
a Video ActiveX control in your program and how to select different devices  
to provide input to such a control. If your computer contains a tuner card, 
these samples show how to tune to a channel. 
 
///////////////////////////////////////////////////////////////////////////// 
MORE INFORMATION 
================ 
 
The following information describes running the UseVideo samples. 
For information on system requirements, see the Client Hardware Requirements  
section of the the Broadcast Architecture Device-Driver Development Kit (DDK). 
 
NOTE: For these samples to have maximum value, you should have the  
      following components installed: 
       
   1. Microsoft  Windows  98, including the optional TV Viewer component. 
 
   2. Microsoft Visual Basic version 5.0. For more information on installing  
      and using Visual Basic 5.0, see the Visual Basic 5.0 documentation. 
 
   3. Microsoft Visual C++ version 5.0. For more information on installing  
      and using Visual C++ 5.0, including the Microsoft Foundation Class  
      (MFC) Library, see the Visual C++ 5.0 documentation.  
 
 
///////////////////////////////////////////////////////////////////////////// 
To Run VidCntrl  
----------------------------- 
 
1. Start Microsoft Visual Basic 5.0. 
 
2. When the New Project dialog box appears, select the Existing tab and  
   open the VidCntrl.vbp project file. 
 
3. From the Run menu, select Start. 
 
4. When the Video Control Test form appears in run mode, click the  
   File Source (Async.) item in the list box to select it for the  
   video control s input source. Enter the file name of a particular  
   MPEG-1 file along with the required path to locate such file in  
   the text box and click the Set Input command button to assign the  
   file you specified as the input source for audio and video. Click the  
   Play button to play the file, click the Pause button to temporarily  
   suspend playing, click the Stop command button to stop the file.  
   Click the Volume slider to change the intensity of the video control s  
   sound and the Balance slider to change the video control s stereo balance. 
 
5. If your computer contains a tuner card for analog television, click  
   the WDM TvTuner item in the list box to select it for the video control s  
   input source. Enter a channel number in the text box and click the  
   Set Input button to tune your card to the channel number you specified. 
 
VidCntrl Files 
------------ 
 
VidCntrl.frm  
    This file contains the form image in addition to the images of all the  
    elements on the form and the code to manipulate the video control.  
    The form's code uses the following properties and methods of the video control 
    and other objects associated with video control: 
    a. Declares and allocates storage for variables of BPCDevices and  
       BPCDeviceBase object types.  
    b. Obtains a reference to each device of the video control's Devices property.  
    c. Obtains the name of each device with the BPCDeviceBase Name property.  
    d. Determines if the computer contains any tuner cards that supports the tuning  
       space for Analog Cable TV with the video control's TSDeviceCount method.  
    e. If so, tunes to a channel with the video control's Tune method.  
    f. Sets the video control's Input property equal to one of the devices in 
       the video control's Devices property.  
    g. Determines if the video control's input source is from a tuner with the  
       BPCDeviceBase HasChannel property.  
    h. If so, sets the channel number of the tuner with the BPCDeviceBase Channel  
       property.  
    i. Determines if the the video control's input source is from a file with the  
       BPCDeviceBase HasFilename property.  
    j. If so, sets the name of the file with the BPCDeviceBase filename property.  
    k. For file sources, plays, pauses, stops, changes the volume and balance with the  
       video control's Run, Pause, Stop, Volume, and Balance properties respectively. 
 
VidCntrl.vbp  
    This file is the makefile for the project. 
 
 
///////////////////////////////////////////////////////////////////////////// 
To Run WebTune 
------------- 
 
1. Start Microsoft Internet Explorer 4.0 (IE4). 
 
2. In IE4, select the menu command File, Open.  
   When the Open dialog box appears, click on Browse and locate 
   the Vid_Test.htm file, and then click Open. When the Open  
   dialog box reappears, click OK. 
 
3. When the Web page loads and IE4 displays the page's text and objects, 
   enter the file name of a particular MPEG-1 file along with the required  
   path to locate such file in the text box. Click the Set File button to  
   assign the file you specified as the input source for audio and video  
   and to play the file and click the Stop File button to stop the file. 
 
4. If your computer contains a tuner card for analog television, enter  
   a channel number in the text box and click the Set Chan button to  
   tune your card to the channel number you specified. 
 
WebTune File 
------------ 
 
Vid_Test.htm  
    This file is an HTML document that contains the text, input elements, 
    the Video ActiveX control object, and code written in VBScript that  
    manipulates the video control. The code enclosed in the SCRIPT tag 
    uses all the same properties and methods as those used in the VidCntrl.frm  
    code. 
 
 
///////////////////////////////////////////////////////////////////////////// 
To Run Vid_Tune 
------------- 
 
1. Start Microsoft Visual Basic 5.0. 
 
2. When the New Project dialog box appears, select the Existing tab and  
   open the Vid_Tune.vbg group project file. 
 
3. From the Run menu, select Start. 
 
4. When the form for the video test control appears in run mode, enter  
   the file name of a particular MPEG-1 file along with the required path  
   to locate such file in the text box. 
 
5. Click the File button to assign the MPEG-1 file you specified as the  
   input source for audio and video and to play the file and click the Stop  
   button to stop playing the file. 
 
6. If your computer contains a tuner card for analog television, click any  
   of the channel buttons to assign the WDM TvTuner as the input source for  
   audio and video and to tune your card to the channel number specified by  
   the button. 
 
Vid_Tune Files 
------------ 
 
Vid_Tune.ctl  
    This file contains the images of all the elements on the control's  
    designer and the code to manipulate the video control. The designer's code  
    uses all the same properties and methods as those used in the VidCntrl.frm  
    code. In addition, code in the designer exposes custom properties, creates 
    and raises a click event, and creates the MyTune method. 
 
Test_Vid.frm  
    This file contains the form image, the image of the Video Test control,  
    and the code to manipulate the Video Test control. The form's code contains  
    the click event procedure that calls the Video Test control's MyTune method. 
 
Vid_Tune.vbp  
    This file is the makefile for the Video Test Control project. 
 
Test_Vid.vbp  
    This file is the makefile for the test project that verifies the Video  
    Test Control. 
 
Vid_Tune.vbg  
    This file is the group file containing the Control project and the test  
    project. 
    
 
///////////////////////////////////////////////////////////////////////////// 
To Run VideoMFC 
----------------------------- 
 
1. Start Microsoft Visual C++ 5.0. 
 
2. From the File menu, select Open Workspace. 
 
3. When the Open Workspace dialog box appears, go to the appropriate  
   directory and open the VdMFC.mak file.  
 
4. From the Build menu, select the Win32 Release configuration from  
   the Set Active Configuration menu item. After setting the project  
   configuration, select Build VdMFC.exe from the Build menu. After  
   building the project, select Execute VdMFC.exe from the Build menu.  
    
5. When the VdMFC application starts, click the File Source (Async.)  
   item in the list box to select it for the Vid control's input source.  
   Enter the file name of a particular MPEG-1 file along with the required  
   path to locate such file in the edit box. Click the Set Input command  
   button to assign the MPEG-1 file you specified as the input source for  
   audio and video. Click the Set File Name and then Play command buttons  
   to start playing the MPEG-1 file you specified. Click the Pause command  
   button to temporarily suspend playing. Click the Stop command button to  
   stop playing the file. 
 
6. If your computer contains a tuner card for analog television, click the  
   WDM TvTuner item in the list box and then the Set Input command button  
   to select it for the video control's input source. Enter a channel number  
   in the edit box and then click the Set Channels command button to tune  
   your card to the channel number you specified. Click the On/Off Video  
   command button to allow the Vid control to receive video or to prevent it  
   from receiving video. 
 
///////////////////////////////////////////////////////////////////////////// 
To Run VideoMFC from the command line  
----------------------------- 
 
1. Open a Command Prompt window, switch to the directory on your  
   computer that contains the makefile (VdMFC.mak) and the source files  
   for the video MFC application, and then type the following exactly  
   as shown including the case of the text: 
   NMAKE /f "VdMFC.mak" CFG="VdMFC - Win32 Release" 
 
2. To run the built VdMFC application, switch to the \Release directory  
   created within the directory containing the source files and type VdMFC. 
 
VideoMFC Files 
------------ 
The MFC AppWizard created all but one of the skeleton files for the VdMFC   
application. Most of the files did not require modification. The following  
summaries of the contents of each of the files that make up VdMFC are divided  
into either the group requiring modifications or not.  
 
********************* 
NOT CREATED BY MFC APPWIZARD 
********************* 
Vidtypes.h 
    This file contains the definitions for all the constants and interfaces  
    that make up the Vid control. This file was not generated by the MFC 
    AppWizard. This file was added to the project. 
 
********************* 
NO EDITING REQUIRED 
********************* 
VdMFC.h 
    Main header file for the application that includes other project-specific  
    headers (including Resource.h) and defines the CVdMFCApp application class. 
    This file was generated by the MFC AppWizard and did not require editing. 
 
VdMFC.cpp 
    This is the main application source file that contains the application 
    class CVdMFCApp. This file was generated by the MFC AppWizard and did not  
    require editing. 
 
VdMFC.rc 
    Lists all of the Microsoft Windows resources that the VdMFC application 
    uses including the icon stored in the RES subdirectory. This file was  
    generated by the MFC AppWizard and did not require editing. 
 
res\VdMFC.ico 
    This is an icon file, which is used as the application's icon.  This 
    icon is included by the main resource file VdMFC.rc. 
 
res\VdMFC.rc2 
    This file contains resources that are not edited by Microsoft Developer  
    Studio. This file was generated by the MFC AppWizard and did not  
    require editing. 
 
VdMFC.mak  
    This file is the makefile for the project. 
 
VdMFC.dsp  
    This file is the project file. 
 
StdAfx.h, StdAfx.cpp 
    These files are used to build a precompiled header (PCH) file 
    named VdMFC.pch and a precompiled types file named StdAfx.obj.  
    These files were generated by the MFC AppWizard and did not  
    require editing. 
 
Resource.h 
    This is the standard header file, which defines new resource IDs. 
    This file was generated by the MFC AppWizard and did not  
    require editing.  
 
bpcvid.h, bpcvid.cpp  
    These files contain the CBPCVid class, which defines the behavior  
    of the object that provides streaming video functionality. These  
    files were generated by the MFC AppWizard and did not require editing. 
 
bpcbase.h, bpcbase.cpp  
    These files contain the CBPCDeviceBase class, which defines the behavior  
    of the object that represents either an input or an output device for  
    the Vid control. These files were generated by the MFC AppWizard and  
    did not require editing. 
 
********************* 
EDITING REQUIRED 
********************* 
VdMFCDlg.h, VdMFCDlg.cpp - the dialog 
    These files contain the CVdMFCDlg class. This class defines the  
    behavior of the application's main dialog. These files were generated  
    by the MFC AppWizard. The following additions were made to these files: 
    a. Includes the header files that define the CBPCVid, CBPCDevices, and  
       CBPCDeviceBase classes and the data types and interfaces for the Vid 
       control. 
    b. ClassWizard was used to create variable names for the Vid control and  
       for values typed in the edit box for setting channels (m_channel) and  
       for strings typed in the edit box for setting file names (m_filename). 
       The class definition was edited to create protected variables for the 
       list box (box) and an available input or output device for the Vid 
       control (m_id). The class definition was also edited to create a private  
       variable for a pointer to the IBPCDeviceBase interface. 
    c. The constructor for this class initializes the channel and file name  
       variable.  
    d. The DoDataExchange() method for this class associates the variable names  
       with the appropriate elements.  
    e. The class definition declares methods to be associated with click events  
       for elements of the user interface. The class implementation associates 
       the click events with the ON_BN_CLICKED() macro. 
    f. The OnInitDialog() method for this class was edited to:  
       Assign the list-box control of the user interface to the CListBox  
       variable, box. 
       Obtain pointers to unknown and enumerate-variant objects that are part  
       of the MFC library. 
       Declare and allocate a CBPCDevices object and assign the collection of  
       all the available input and output devices for the Vid control to it. 
       Assign the unknown object to the value returned from the custom  
       CBPCDevices::GetNewEnum() method. 
       Query the unknown object to obtain an enumerate-variant object and then  
       release the unknown object. 
       Enter a while loop set to repeat until there are no more variants in  
       the enumerate-variant object.  
       Get the next variant in the enumerate-variant object and obtain a dispatch  
       for such a variant. Declare and allocate a CBPCDeviceBase object and assign  
       the dispatch value of the obtained variant to such an object. Retrieve the  
       name of the device-base object with the CBPCDeviceBase::GetName() method  
       and add it to the list box. Clear the variant. 
       After exiting the while loop, release the enumerate-variant object.  
    g. The OnSetInput() and OnSetOutput() methods for this class were implemented to: 
       Obtain pointers to unknown and enumerate-variant objects. 
       Obtain an interface pointer to IBPCDeviceBase defined in Vidtypes.h. 
       Declare and allocate a CBPCDevices object and assign the collection of  
       all the available input and output devices for the Vid control to it. 
       Assign the unknown object to the value returned from the custom  
       CBPCDevices::GetNewEnum() method. 
       Query the unknown object to obtain an enumerate-variant object and then  
       release the unknown object. 
       Enter a for loop set to repeat the number of times determined by the  
       CBPCVid::GetDeviceCount() method. 
       For each iteration of the loop:  
         Obtain the next variant in the enumerate-variant object. 
         Query the variant object to obtain an IBPCDeviceBase interface pointer. 
         Get the name property of the device with the interface's get_Name() method. 
         Gets the selected item in the list box and then gets the string  
         associated with the item. 
         If this string is the same as the device name, assign the video control's  
         input and output to that particular device with the SetInput() and  
         SetOutput() methods of the CBPCVid class. Also, assign the device to 
         the private member variable for the device, m_pDeviceBase. 
    h. The OnSetChannel() method for this class was implemented to dispatch a  
       pointer to the selected item of the list box, then attach such pointer  
       to a CBPCDeviceBase variable with the CBPCDeviceBase::AttachDispatch()  
       method, and then assign the channel number specified in the edit box with  
       the CBPCDeviceBase::SetChannel() method. 
    i. The OnVideoOn() method for this class was implemented to reverse the  
       VideoOn value of the Vid control by first retrieving such value and then  
       setting it to the opposite value. 
    j. The OnSetFile() method for this class was implemented to assign the file  
       name specified in the edit box with the CBPCVid::SetFileName() method. 
    k. The OnPlay(), OnPause(), and OnStop() methods for this class were  
       implemented to play, suspend play, and stop the file with the Run(),  
       Pause(), and Stop() methods respectively of the CBPCVid class. 
 
bpcdev.h, bpcdev.cpp  
    These files contain the CBPCDevices class, which defines the behavior  
    of the object that represents a collection of all the available input  
    and output devices for the Vid control. These files were generated  
    by the MFC AppWizard.  
    A declaration and an implementation were added for the GetNewEnum()  
    method. This method retrieves an unknown object that refers to an  
    enumerate-variant object.