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

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1996 - 1997 Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // MPEG system stream compound type definition
  13.  
  14. #ifndef __MPEGTYPE__
  15. #define __MPEGTYPE__
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif // __cplusplus
  20.  
  21. //
  22. //  AM_MPEGSYSTEMTYPE defines the format block contents for
  23. //  data of type MEDIATYPE_MPEG1System when the format
  24. //  block GUID is FORMAT_MPEG1System
  25. //
  26. //  The format block consists of elements of type
  27. //  AM_MPEGSYSTEMTYPE up to the length of the format block
  28. //  Each format block is 8-byte aligned from the start of
  29. //  the format block
  30. //
  31.  
  32. typedef struct tagAM_MPEGSTREAMTYPE
  33. {
  34.     DWORD             dwStreamId;     // Stream id of stream to process
  35.     DWORD             dwReserved;     // 8-byte alignment
  36.     AM_MEDIA_TYPE     mt;             // Type for substream - pbFormat is NULL
  37.     BYTE              bFormat[1];     // Format data
  38. } AM_MPEGSTREAMTYPE;
  39.  
  40. typedef struct tagAM_MPEGSYSTEMTYPE
  41. {
  42.     DWORD             dwBitRate;      // Bits per second
  43.     DWORD             cStreams;       // Number of streams
  44.     AM_MPEGSTREAMTYPE Streams[1];
  45. } AM_MPEGSYSTEMTYPE;
  46.  
  47. //
  48. //  Helper macros for AM_MPEGSTREAMTYPE
  49. //
  50. #define AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType)  \
  51.     FIELD_OFFSET(AM_MPEGSTREAMTYPE, bFormat[(pStreamType)->mt.cbFormat])
  52. #define AM_MPEGSTREAMTYPE_NEXT(pStreamType)           \
  53.     ((AM_MPEGSTREAMTYPE *)((PBYTE)(pStreamType) +     \
  54.      ((AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) + 7) & ~7)))
  55.  
  56. //
  57. // IMpegAudioDecoder
  58. //
  59.  
  60. // Values for DualMode
  61. #define AM_MPEG_AUDIO_DUAL_MERGE 0
  62. #define AM_MPEG_AUDIO_DUAL_LEFT  1
  63. #define AM_MPEG_AUDIO_DUAL_RIGHT 2
  64.  
  65. DECLARE_INTERFACE_(IMpegAudioDecoder, IUnknown) {
  66.  
  67.     STDMETHOD(get_FrequencyDivider) (THIS_
  68.                            unsigned long *pDivider   /* [out] */
  69.                            ) PURE;
  70.  
  71.     STDMETHOD(put_FrequencyDivider) (THIS_
  72.                            unsigned long Divider     /* [in] */
  73.                            ) PURE;
  74.  
  75.     STDMETHOD(get_DecoderAccuracy) (THIS_
  76.                            unsigned long *pAccuracy  /* [out] */
  77.                            ) PURE;
  78.  
  79.     STDMETHOD(put_DecoderAccuracy) (THIS_
  80.                            unsigned long Accuracy    /* [in] */
  81.                            ) PURE;
  82.  
  83.     STDMETHOD(get_Stereo) (THIS_
  84.                            unsigned long *pStereo    /* [out] */
  85.                            ) PURE;
  86.  
  87.     STDMETHOD(put_Stereo) (THIS_
  88.                            unsigned long Stereo      /* [in] */
  89.                            ) PURE;
  90.  
  91.     STDMETHOD(get_DecoderWordSize) (THIS_
  92.                            unsigned long *pWordSize  /* [out] */
  93.                            ) PURE;
  94.  
  95.     STDMETHOD(put_DecoderWordSize) (THIS_
  96.                            unsigned long WordSize    /* [in] */
  97.                            ) PURE;
  98.  
  99.     STDMETHOD(get_IntegerDecode) (THIS_
  100.                            unsigned long *pIntDecode /* [out] */
  101.                            ) PURE;
  102.  
  103.     STDMETHOD(put_IntegerDecode) (THIS_
  104.                            unsigned long IntDecode   /* [in] */
  105.                            ) PURE;
  106.  
  107.     STDMETHOD(get_DualMode) (THIS_
  108.                            unsigned long *pIntDecode /* [out] */
  109.                            ) PURE;
  110.  
  111.     STDMETHOD(put_DualMode) (THIS_
  112.                            unsigned long IntDecode   /* [in] */
  113.                            ) PURE;
  114.  
  115.     STDMETHOD(get_AudioFormat) (THIS_
  116.                            MPEG1WAVEFORMAT *lpFmt    /* [out] */
  117.                            ) PURE;
  118. };
  119.  
  120. #ifdef __cplusplus
  121. }
  122. #endif // __cplusplus
  123. #endif // __MPEGTYPE__
  124.