SAMPLE: AVI Playback (Streaming) onto DirectDraw Surface

Last reviewed: September 5, 1997
Article ID: Q154789
4.00 WINDOWS kbmm kbfile

The information in this article applies to:

  • Microsoft Video For Windows Development Kit

SUMMARY

The AVIDD95 sample demonstrates streaming of video data from an Audio- Video Interleaved (.AVI) file onto a full screen DirectDraw surface (Mode X). It plays the video as fast as possible. The maximum video size supported by the sample is 320x240 and the bit depth is dithered down to 8-bit regardless of the current video mode. This sample includes all source code and supporting files (.mak, .mdp, etc.) as the sample was developed using Microsoft's Visual C++ 4.x Developer Studio. In order to build the sample, the development environment must include the DirectX 2 SDK.

MORE INFORMATION

AVIDD95 uses the following steps to stream the video onto the DirectDraw surface:

  1. Opens the video stream from an .AVI file via AVIStreamOpenFromFile.

  2. Reads the source video stream format via AVIStreamReadFormat.

  3. Reads a frame from the video stream via AVIStreamRead.

  4. Converts the frame from the source format to the target format.

  5. Draws the decompressed frame via standard DirectDraw calls.

  6. Repeats steps 3-5 for every frame (found by AVIStreamLength).

In AVIDD95, Mode X is utilized exclusively, requiring the video stream to be decompressed and dithered down from the native format, such as 16-bit or 24-bit, to 8-bit RGB. Decompression and dithering is accomplished by calling ICDecompress before passing the frame on to the drawing routine.

You can find AVIDD95.EXE (size: 23579 bytes) 
                        , a self-extracting file, on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
    
          Enter kbfile AVIDD95.EXE (size: 23579 bytes) 
                                  , and click GO!
          Open the article, and click the button to download the file
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get AVIDD95.EXE (size: 23579 bytes) 
    

    - Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download AVIDD95.EXE (size: 23579 bytes) 
    
    
    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online Services
    

  • KBCategory: kbmm kbfile
    KBSubcategory: mmvideo
    Additional reference words: 4.00 DD kbdsd Win95 multimedia
    Keywords : MMVideo kbfile kbmm
    Technology : kbDirectXSDK
    Version : 4.00
    Platform : WINDOWS


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: September 5, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.