home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / appavcap.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  6KB  |  148 lines

  1. //****************************************************************************
  2. //  File:       APPAVCAP.H
  3. //  Content:    
  4. //     Network audio/video application capability interface. Provides
  5. //     data structures for adding, removing, enumerating, prioritizing,
  6. //     and enabling/disabling codecs independently for send/receive.
  7. //
  8. //  Copyright (c) Microsoft Corporation 1997, All rights reserved
  9. //
  10. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  11. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  12. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  13. // PARTICULAR PURPOSE.
  14. //****************************************************************************
  15.  
  16.  
  17. #ifndef _APPAVCAP_H
  18. #define _APPAVCAP_H
  19.  
  20. #include <mmreg.h>
  21. #include <msacm.h>
  22.  
  23. #include <pshpack8.h> /* Assume 8 byte packing throughout */
  24.  
  25. // For use as dimension for variable size arrays
  26. #define VARIABLE_DIM 1
  27.  
  28. // CPU utilization numbers for NetMeeting-provided codecs
  29. #define LNH_48_CPU 97
  30. #define LNH_8_CPU  47
  31. #define LNH_12_CPU 48
  32. #define LNH_16_CPU 49
  33. #define MS_G723_CPU 70
  34. #define CCITT_A_CPU 24
  35. #define    CCITT_U_CPU 25
  36.  
  37.  
  38. // AUDIO_FORMAT_ID is an index into an array of AUDCAPS structures
  39. typedef DWORD AUDIO_FORMAT_ID;
  40. #define INVALID_AUDIO_FORMAT 0xffffffff
  41. typedef DWORD MEDIA_FORMAT_ID;
  42. #define INVALID_MEDIA_FORMAT 0xffffffff
  43. // VIDEO_FORMAT_ID is an index into an array of VIDCAPS structures
  44. typedef DWORD VIDEO_FORMAT_ID;
  45. #define INVALID_VIDEO_FORMAT 0xffffffff
  46.  
  47. /*
  48.  *  @doc  EXTERNAL DATASTRUC
  49.  *
  50.  *    AUDIO capabilities info structure
  51.  *
  52.  *    @struct AUDCAP_INFO | AUDIO capabilities info structure.
  53.  *    Use for both input and output when calling capabilties APIs.
  54.  *    The fields are input-only, output-only or input/output depending on the API used.
  55.  *    Behavior is undefined if these are altered.
  56.  */
  57.  
  58. // basic audcap structure
  59. typedef struct BasicAudCapInfo
  60. {
  61.     WORD wFormatTag;            // @field The ACM format tag
  62.     AUDIO_FORMAT_ID    Id;            // @field (OUTPUT only) The local id (a.k.a. *Handle*) of this capability entry
  63.     char szFormat[ACMFORMATDETAILS_FORMAT_CHARS];    // @field (OUTPUT only) Descriptive string of
  64.                                                     // the format, e.g. "Microsoft GSM 6.10"
  65.     UINT uMaxBitrate;            // @field (OUTPUT only) Worst case bitrate
  66.     UINT uAvgBitrate;            // @field The average bitrate for this codec
  67.     WORD wCPUUtilizationEncode;    // @field % of Pentium 90Mhz needed for compress
  68.     WORD wCPUUtilizationDecode;    // @field % of Pentium 90Mhz needed for decompress
  69.     
  70.     BOOL bSendEnabled;            // @field OK to use this format for sending
  71.     BOOL bRecvEnabled;            // @field OK to use this format for receiving
  72.     WORD wSortIndex;            // @field The ordered position of this entry
  73.                                 // in the capability table. Can be used as input only 
  74.                                 // in ReorderFormats
  75. }BASIC_AUDCAP_INFO, *PBASIC_AUDCAP_INFO, AUDCAP_INFO, *PAUDCAP_INFO;
  76.  
  77. /*
  78.  *    @struct AUDCAP_INFO_LIST | List of AUDCAP_INFO structures
  79.  */
  80. typedef struct _audcapinfolist
  81. {
  82.     ULONG    cFormats;            // @field Number of AUDCAP_INFO structures in this list
  83.     AUDCAP_INFO    aFormats[VARIABLE_DIM];    // @field cFormats AUDCAP_INFO structures
  84. } AUDCAP_INFO_LIST, *PAUDCAP_INFO_LIST;
  85.  
  86. /*
  87.  *    @enum VIDEO_SIZES | Enumeration values for the three video sizes supported by NetMeeting
  88.  */
  89. typedef enum
  90. {
  91.     Small = 0,    // @emem Small size video
  92.     Medium,        // @emem Medium size video
  93.     Large        // @emem Large size video
  94. } VIDEO_SIZES;
  95.  
  96. /*
  97.  *    VIDEO capabilities info structure
  98.  *
  99.  *    @struct VIDCAP_INFO | VIDEO capabilities info structure.
  100.  *    Use for both input and output when calling capabilties APIs.
  101.  *    The fields are input-only, output-only or input/output depending on the API used.
  102.  *    Behavior is undefined if these are altered.
  103.  */
  104.  
  105. // VIDCAP_INFO structure
  106. typedef struct BasicVidCapInfo
  107. {
  108.     // format identification
  109.     DWORD dwFormatTag;            // @field The format tag of this format
  110.     VIDEO_FORMAT_ID    Id;            // @field (OUTPUT only) The local id (a.k.a. *Handle*) of this capability entry
  111.     char szFormat[ACMFORMATDETAILS_FORMAT_CHARS];    // @field (OUTPUT only) Descriptive string of,
  112.                                                     // the formate.g. "Microsoft H.263"
  113.     // NetMeeting specific info
  114.     WORD wCPUUtilizationEncode;    // @field % of Pentium 90Mhz needed for compress
  115.     WORD wCPUUtilizationDecode;    // @field % of Pentium 90Mhz needed for decompress
  116.     BOOL bSendEnabled;            // @field OK to use this format for sending
  117.     BOOL bRecvEnabled;            // @field OK to use this format for receiving
  118.     WORD wSortIndex;            // @field (OUTPUT only) The ordered position of this entry
  119.                                 // in the capability table.
  120.  
  121.     // video format details
  122.     VIDEO_SIZES enumVideoSize;    // @field The video size for this format. Different video sizes for 
  123.                                 // the same formats must be added as separate formats 
  124.     BITMAPINFOHEADER bih;        // @field The BITMAPINFOHEADER sturcture for the video 
  125.                                 // size in enumVideosize
  126.     UINT uFrameRate;            // @field Number of frames per second
  127.     DWORD dwBitsPerSample;        // @field number of bits per sample for this format. Must
  128.                                 // match the value in bih.biBitCount
  129.     UINT uAvgBitrate;            // @field The average bitrate for this codec
  130.     UINT uMaxBitrate;            // (OUTPUT only) Worst case bitrate
  131. }BASIC_VIDCAP_INFO, *PBASIC_VIDCAP_INFO, VIDCAP_INFO, *PVIDCAP_INFO;
  132.  
  133.  
  134. /*
  135.  *    @struct VIDCAP_INFO_LIST | List of VIDCAP_INFO structures
  136.  */
  137. typedef struct _vidcapinfolist
  138. {
  139.     ULONG    cFormats;// @field Number of VIDCAP_INFO structures in this list
  140.     VIDCAP_INFO    aFormats[VARIABLE_DIM];    // @field cFormats VIDCAP_INFO structures
  141. } VIDCAP_INFO_LIST, *PVIDCAP_INFO_LIST;
  142.  
  143. #include <poppack.h> /* End byte packing */
  144.  
  145.  
  146. #endif    //#ifndef _APPAVCAP_H
  147.  
  148.