home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow_WinXP / VMR / TxtPlayer / mpgcodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  5.2 KB  |  180 lines

  1. //------------------------------------------------------------------------------
  2. // File: mpgcodec.h
  3. //
  4. // Desc: DirectShow sample code - header file for TxtPlayer sample
  5. //
  6. // Copyright (c) 1995 - 2001, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9. #include <mpegtype.h>   // IMpegAudioDecoder
  10.  
  11. typedef struct {
  12.     LONG           lWidth;             //  Native Width in pixels
  13.     LONG           lHeight;            //  Native Height in pixels
  14.     LONG           lvbv;               //  vbv
  15.     REFERENCE_TIME PictureTime;        //  Time per picture in 100ns units
  16.     LONG           lTimePerFrame;      //  Time per picture in MPEG units
  17.     LONG           dwBitRate;          //  Bits per second
  18.     LONG           lXPelsPerMeter;     //  Pel aspect ratio
  19.     LONG           lYPelsPerMeter;     //  Pel aspect ratio
  20.     DWORD          dwStartTimeCode;    //  First GOP time code (or -1)
  21.     LONG           lActualHeaderLen;   //  Length of valid bytes in raw seq hdr
  22.     BYTE           RawHeader[140];     //  The real sequence header
  23. } SEQHDR_INFO;
  24.  
  25.  
  26. #define DECODE_I        0x0001L
  27. #define DECODE_IP       0x0003L
  28. #define DECODE_IPB      0x0007L     // Normal B Frame
  29. #define DECODE_IPB1     0x000FL     // Decode 1 out of 4 B frames
  30. #define DECODE_IPB2     0x0010L     // Decode 2 out of 4 B frames
  31. #define DECODE_IPB3     0x0020L     // Decode 3 out of 4 B frames
  32. #define DECODE_DIS      0x0040L     // No Decode, Convert only
  33.  
  34. #define DECODE_BQUAL_HIGH   0x00000000L  // Normal B Decode
  35. #define DECODE_BQUAL_MEDIUM 0x10000000L  // Fast B Frame (No Half Pixel)
  36. #define DECODE_BQUAL_LOW    0x20000000L  // Super Fast B Frame (No Half Pixel & Fast IDCT)
  37.  
  38. #define MM_NOCONV       0x00000000L     // No Conversion
  39. #define MM_HRESOLUTION  0x10000000L     // Half Resolution
  40. #define MM_CLIPPED      0x20000000L     // Clipped version (RGB8 only at present)
  41.  
  42. #define MM_420PL        0x00000001L     // YU12 :: YCbCr
  43. #define MM_420PL_       0x00000002L     // YV12 :: YCrCb
  44.  
  45. #define MM_422PK        0x00000010L     // YUY2 :: YCbCr
  46. #define MM_422PK_       0x00000020L     // YVY2 :: YCrCb
  47. #define MM_422SPK       0x00000040L     //      :: CbYCrY
  48. #define MM_422SPK_      0x00000080L     //      :: CrYCbY
  49. #define MM_411PK        0x00000100L     // BT41
  50. #define MM_410PL_       0x00000200L     // YVU9 - 16:1:1 Planar format
  51.  
  52.  
  53. #define MM_Y_DIB        0x00001000L     // Luminance Only DIB
  54. #define MM_Y_DDB        0x00002000L     // Luminance Only DDB
  55.  
  56. #define MM_RGB24_DIB    0x00010000L     // RGB 8:8:8 DIB   (Not Supported)
  57. #define MM_RGB24_DDB    0x00020000L     // RGB 8:8:8 DDB   (Not Supported)
  58. #define MM_RGB32_DIB    0x00040000L     // RGB a:8:8:8 DIB   (Not Supported)
  59. #define MM_RGB32_DDB    0x00080000L     // RGB a:8:8:8 DDB   (Not Supported)
  60.  
  61. #define MM_RGB565_DIB   0x00100000L     // RGB 5:6:5 DIB
  62. #define MM_RGB565_DDB   0x00200000L     // RGB 5:6:5 DDB
  63. #define MM_RGB555_DIB   0x00400000L     // RGB 5:5:5 DIB
  64. #define MM_RGB555_DDB   0x00800000L     // RGB 5:5:5 DDB
  65.  
  66. #define MM_RGB8_DIB     0x01000000L     // 8 Bit Paletized RGB DIB
  67. #define MM_RGB8_DDB     0x02000000L     // 8 Bit Paletized RGB DDB
  68.  
  69.  
  70. #define DECODE_HALF_HIQ   0x00004000L
  71. #define DECODE_HALF_FULLQ 0x00008000L
  72.  
  73.  
  74. //
  75. // Structure to describe the caps of the mpeg video decoder.
  76. //
  77. typedef struct {
  78.     DWORD   VideoMaxBitRate;
  79. } MPEG_VIDEO_DECODER_CAPS;
  80.  
  81.  
  82. //
  83. // IMpegVideoDecoder
  84. //
  85. DECLARE_INTERFACE_(IMpegVideoDecoder, IUnknown) {
  86.  
  87.     STDMETHOD(get_CurrentDecoderOption)
  88.     ( THIS_
  89.       DWORD *pOptions
  90.     ) PURE;
  91.  
  92.     STDMETHOD(set_CurrentDecoderOption)
  93.     ( THIS_
  94.       DWORD Options
  95.     ) PURE;
  96.  
  97.     STDMETHOD(get_DefaultDecoderOption)
  98.     ( THIS_
  99.       DWORD *pOptions
  100.     ) PURE;
  101.  
  102.     STDMETHOD(set_DefaultDecoderOption)
  103.     ( THIS_
  104.       DWORD Options
  105.     ) PURE;
  106.  
  107.     STDMETHOD(get_QualityMsgProcessing)
  108.     ( THIS_
  109.       BOOL *pfIgnore
  110.     ) PURE;
  111.  
  112.     STDMETHOD(set_QualityMsgProcessing)
  113.     ( THIS_
  114.       BOOL fIgnore
  115.     ) PURE;
  116.  
  117.     STDMETHOD(get_GreyScaleOutput)
  118.     ( THIS_
  119.       BOOL *pfGrey
  120.     ) PURE;
  121.  
  122.     STDMETHOD(set_GreyScaleOutput)
  123.     ( THIS_
  124.       BOOL fGrey
  125.     ) PURE;
  126.  
  127.     STDMETHOD(get_SequenceHeader)
  128.     ( THIS_
  129.       SEQHDR_INFO *pSeqHdrInfo
  130.     ) PURE;
  131.  
  132.     STDMETHOD(get_OutputFormat)
  133.     ( THIS_
  134.       DWORD *pOutputFormat
  135.     ) PURE;
  136.  
  137.     STDMETHOD(get_FrameStatistics)
  138.     ( THIS_
  139.       DWORD *pIFramesDecoded,
  140.       DWORD *pPFramesDecoded,
  141.       DWORD *pBFramesDecoded,
  142.       DWORD *pIFramesSkipped,
  143.       DWORD *pPFramesSkipped,
  144.       DWORD *pBFramesSkipped
  145.     ) PURE;
  146.  
  147.     STDMETHOD(ResetFrameStatistics)
  148.     ( THIS_
  149.     ) PURE;
  150.  
  151.     STDMETHOD(get_DecoderPaletteInfo)
  152.     ( THIS_
  153.       LPDWORD lpdwFirstEntry,
  154.       LPDWORD lpdwLastEntry
  155.     ) PURE;
  156.  
  157.     STDMETHOD(get_DecoderPaletteEntries)
  158.     ( THIS_
  159.       DWORD dwStartEntry,
  160.       DWORD dwNumEntries,
  161.       LPPALETTEENTRY lppe
  162.     ) PURE;
  163.  
  164.     STDMETHOD(get_EncryptionKey)
  165.     ( THIS_
  166.       DWORD *dwEncrptionKey
  167.     ) PURE;
  168.  
  169.     STDMETHOD(put_EncryptionKey)
  170.     ( THIS_
  171.       DWORD dwEncrptionKey
  172.     ) PURE;
  173.  
  174.     STDMETHOD(get_DecoderCaps)
  175.     ( THIS_
  176.       MPEG_VIDEO_DECODER_CAPS *pCaps
  177.     ) PURE;
  178.  
  179. };
  180.