home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / mac / SiteBldr / AMOVIE / SDK / _SETUP / COMMON.Z / ax_spec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-26  |  13.1 KB  |  519 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *               INTEL CORPORATION PROPRIETARY INFORMATION               *
  4. *                                                                       *
  5. *    This listing is supplied under the terms of a license agreement    *
  6. *      with INTEL Corporation and may not be copied nor disclosed       *
  7. *        except in accordance with the terms of that agreement.         *
  8. *                                                                       *
  9. *************************************************************************
  10. *                                                                       *
  11. *               Copyright (c) 1994-1995 Intel Corporation.              *
  12. *                         All Rights Reserved.                          *
  13. *                                                                       *
  14. ************************************************************************/
  15.  
  16. /*
  17.  *  Tabs set to 4
  18.  *
  19.  *  ax_spec.h
  20.  *
  21.  *  DESCRIPTION:
  22.  *  The Indeo(R) Video Interactive codec provides access to new features
  23.  *  using the ICM_SETCODECSTATE and ICM_GETCODECSTATE messages for VfW.
  24.  *    This header file defines the data structures used in these messages.
  25.  */
  26.  
  27. /* $Header:   I:/proj/src/quartz/vcs/ax_spec.h_v   1.1   02 Apr 1996 13:38:36   mkearnes  $
  28.  */
  29.  
  30. /*  Custom interface for Indeo(r) codecs
  31.  */
  32.  
  33. #ifndef __AX_SPEC_H__
  34. #define __AX_SPEC_H__
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #ifndef FOURCC_IV41
  41.  
  42. #    ifndef mmioFOURCC
  43. #    define mmioFOURCC( ch0, ch1, ch2, ch3 )                \
  44.         ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |    \
  45.         ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  46. #    endif
  47.  
  48. #define FOURCC_IV41 mmioFOURCC('I','V','4','1')
  49. #endif
  50.  
  51. #ifndef __VFW_SPEC_H__
  52. #define __VFW_SPEC_H__
  53.  
  54.  
  55. /* The specific interface version is defined as follows:
  56.  */
  57. #define INTERFACE_MAJOR_NUMBER(v)            ((v) >> 16)
  58. #define INTERFACE_MINOR_NUMBER(v)            ((v) & 0xffff)
  59. #define CREATE_INTERFACE_VERSION(maj,min)    ((((DWORD)maj)<<16) | (((DWORD)min) & 0xffff))
  60. #define SPECIFIC_INTERFACE_VERSION             CREATE_INTERFACE_VERSION(1,1)
  61.  
  62. /* The codec specific information is handled by the general state
  63.  * handler.
  64.  */
  65. #define ICM_GETCODECSTATE                    ICM_GETSTATE
  66. #define ICM_SETCODECSTATE                    ICM_SETSTATE
  67.  
  68. /* OS Environments - Within the Microsoft Windows domain (Win 3.1, Win 95,
  69.  * and Win NT), both applications and codecs can be compiled in either 16 or
  70.  * 32-bit formats.  Any combination is allowed with the knowledge that data
  71.  * pointers will not be thunked.
  72.  */
  73. typedef enum {
  74.     OE_UNDEFINED,
  75.     OE_16,
  76.     OE_32,
  77. } R4_OS_ENVIRONMENT;
  78.  
  79.  
  80. /* The type field identifies the kind of operation that should be done as part
  81.  * of the ICM_GETCODECSTATE and ICM_SETCODECSTATE messages.
  82.  *
  83.  * The MT_UNDEFINED value is not a supported type - it should only be used
  84.  * to initialize variables to an "undefined" state.
  85.  */
  86. typedef enum {
  87.     MT_UNDEFINED,
  88.     MT_DECODE_FRAME_DEFAULT,
  89.     MT_DECODE_FRAME_VALUE,
  90.     MT_DECODE_SEQ_DEFAULT,
  91.     MT_DECODE_SEQ_VALUE,
  92.     MT_ENCODE_SEQ_DEFAULT,
  93.     MT_ENCODE_SEQ_VALUE
  94. } R4_MESSAGE_TYPE;
  95.  
  96. /*
  97.  * MT_QUEUE is for 16-bit applications that call 32-bit codecs, only.  It
  98.  * is necessary to pre-set ICM_GETCODECSTATE messages by first issuing an
  99.  * ICM_SETCODECSTATE with the MT_QUEUE flag or'ed with the desired
  100.  * message type to get.  The ICM_GETCODECSTATE message which follows
  101.  * must set its dwFourCC field to 0.
  102.  */
  103. #define    MT_QUEUE  (1UL<<31)
  104.  
  105.  
  106. /* A flag is false if it is zero, otherwise it is true.
  107.  */
  108. typedef DWORD R4_FLAG;
  109.  
  110. /* Pointer to a Flag - A pointer to a flag is used by the codec to write 
  111.  * status information at a later time.
  112.  */
  113. typedef R4_FLAG FAR * PTR_R4_FLAG;
  114.  
  115.  
  116. /* Rectangle - The following structure is used to describe a rectangle.
  117.  */
  118. typedef struct {
  119.     DWORD dwX;
  120.     DWORD dwY;
  121.     DWORD dwWidth;
  122.     DWORD dwHeight;
  123. } R4_RECT, FAR * PTR_R4_RECT;
  124.  
  125.  
  126. /* Transparency Bitmask - A transparency bitmask contains one bit for each 
  127.  * pixel in the source image. If a bit is zero the data is transparent.  
  128.  * The first bit in each byte is identified by the mask 0x80.  The last 
  129.  * bit in each byte is identified by the mask 0x01. 
  130.  * 
  131.  * To allow faster access each row must begin on a DWORD boundary and the 
  132.  * total number of bytes must be rounded-up to a multipe of four.
  133.  */
  134. typedef BYTE FAR * PTR_R4_BITMASK;
  135.  
  136.  
  137. /* Playback Platform - The codec supports several playback options.  This is
  138.  * not hardware specific.  Instead it rates the relative capabilities of the  
  139.  * hardware.
  140.  */
  141. typedef enum {
  142.     PP_LOW,
  143.     PP_MEDIUM,
  144.     PP_HIGH,
  145. } R4_PLAYBACK_PLATFORM;
  146.  
  147.  
  148. /* Transparency Method - The codec supports a number of tranparency encoding
  149.  * methods. The enumeration specifies the transparency method.
  150.  */
  151. typedef enum {
  152.     TM_UNDEFINED,
  153.     TM_NONE,
  154.     TM_RANGE,
  155.     TM_BITMASK,
  156.     TM_FRAME,
  157.     TM_ALPHA_CHANNEL        /* XRGB color formats only */
  158. } R4_TRANS_METHOD;
  159.  
  160.  
  161. /* Transparency Range - A transparency range is specified using minimum 
  162.  * and maximum values for R, G, and B. Any pixel with values within this range 
  163.  * (inclusive) is considered transparent.
  164.  */
  165. typedef struct {
  166.     WORD  u16Reserved;
  167.     UCHAR u8BlueLow;
  168.     UCHAR u8BlueHigh;
  169.     UCHAR u8GreenLow;
  170.     UCHAR u8GreenHigh;
  171.     UCHAR u8RedLow;
  172.     UCHAR u8RedHigh;
  173. } R4_RANGE, FAR * PTR_R4_RANGE;
  174.  
  175.  
  176. /* The structure header is a set fields that are common,
  177.  * to each of the data structures that follows.
  178.  */
  179. typedef struct {
  180.     DWORD    dwSize;
  181.     DWORD    dwFourCC;
  182.     DWORD    dwVersion;
  183.     LONG    mtType;    
  184.     LONG    oeEnvironment;
  185.     DWORD    dwFlags;
  186. } R4_HEADER, FAR * PTR_R4_HEADER;
  187. /* The structure header size is enough room for dwSize, dwFourCC,
  188.  * dwVersion, dwType, dwEnvironment, and dwFlags
  189.  */
  190. #define R4_STRUCTURE_HEADER_SIZE (sizeof(R4_HEADER))
  191.  
  192.  
  193. /* Some decode parameters can be changed prior to either an ICM_DECOMPRESS or 
  194.  * ICM_DECOMPRESSEX mesage. These are found in the  R4_DEC_FRAME_DATA 
  195.  * structure.  See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  196.  */
  197. #define DECFRAME_TIME_LIMIT        (1UL<<0)
  198. #define DECFRAME_DECODE_RECT    (1UL<<1)
  199. #define DECFRAME_VIEW_RECT        (1UL<<2)
  200. #define DECFRAME_BOUNDING_RECT    (1UL<<3)
  201. #define DECFRAME_TRANS_BITMASK    (1UL<<4)
  202. #define DECFRAME_BRIGHTNESS        (1UL<<5)
  203. #define DECFRAME_SATURATION        (1UL<<6)
  204. #define DECFRAME_CONTRAST        (1UL<<7)
  205. #define DECFRAME_VALID            (1UL<<31)
  206.  
  207. typedef struct {
  208.     DWORD dwSize;
  209.     DWORD dwFourCC;
  210.     DWORD dwVersion;
  211.     LONG mtType;    
  212.     LONG oeEnvironment;
  213.     DWORD dwFlags;
  214.  
  215.     DWORD dwTimeLimit;                        /* version 1.0 */
  216.     R4_RECT rDecodeRect;                    /* version 1.0 */
  217.     R4_RECT rViewRect;                        /* version 1.0 */
  218.     PTR_R4_RECT prBoundingRect;                /* version 1.0 */
  219.     PTR_R4_BITMASK pbmTransparencyBitmask;    /* version 1.0 */
  220.     PTR_R4_FLAG pfUpdatedTransparencyBitmask; /* version 1.0 */
  221.     LONG lBrightness;                        /* version 1.0 */
  222.     LONG lSaturation;                        /* version 1.0 */
  223.     LONG lContrast;                            /* version 1.0 */
  224. } R4_DEC_FRAME_DATA, FAR * PTR_R4_DEC_FRAME_DATA;
  225.  
  226.  
  227. /* Other decode parameters can only be changed prior to either an 
  228.  * ICM_DECOMPRESS_BEGIN or an ICM_DECOMPRESSEX_BEGIN message.  These 
  229.  * are found in the R4_DEC_SEQ_DATA structure.
  230.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  231.  */ 
  232. #define DECSEQ_KEY                (1UL<<0)
  233. #define DECSEQ_SCALABILITY        (1UL<<1)
  234. #define DECSEQ_FILL_TRANSPARENT    (1UL<<2)
  235. #define DECSEQ_ALT_LINE            (1UL<<3)
  236. #define DECSEQ_VALID             (1UL<<31)
  237.  
  238. typedef struct {
  239.     DWORD dwSize;
  240.     DWORD dwFourCC;
  241.     DWORD dwVersion;
  242.     LONG mtType;
  243.     LONG oeEnvironment;
  244.     DWORD dwFlags;
  245.  
  246.     DWORD dwKey;                            /* version 1.0 */
  247.     R4_FLAG fEnabledKey;                    /* version 1.0 */
  248.     R4_FLAG fScalability;                    /* version 1.0 */
  249.     R4_FLAG fFillTransparentPixels;            /* version 1.0 */
  250.     R4_FLAG fAltLine;                        /* version 1.1 */
  251. } R4_DEC_SEQ_DATA, FAR * PTR_R4_DEC_SEQ_DATA;
  252.  
  253.  
  254. /* Encode parameters can only be changed prior to an ICM_COMPRESS_BEGIN 
  255.  * messsage.  These are found in the R4_ENC_SEQ_DATA structure (these 
  256.  * include the parameters that can be set in the super dialog box).
  257.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  258.  */  
  259. #define ENCSEQ_KEY                    (1UL<<0)
  260. #define ENCSEQ_MINIMUM_VIEWPORT        (1UL<<1)
  261. #define ENCSEQ_TRANSPARENCY            (1UL<<2)
  262. #define ENCSEQ_SCALABILITY            (1UL<<3)
  263. #define ENCSEQ_BI_DIR_PREDICTION    (1UL<<4)
  264. #define ENCSEQ_PLAYBACK_PLATFORM    (1UL<<5)
  265. #define ENCSEQ_RANDOM_KEY_AND_BIDIR (1UL<<6)
  266. #define ENCSEQ_FRAME_INFO            (1UL<<7)
  267. #define ENCSEQ_QUICK_COMPRESS        (1UL<<8)
  268. #define ENCSEQ_VALID                (1UL<<31)
  269.  
  270. typedef struct {
  271.     DWORD dwSize;
  272.     DWORD dwFourCC;
  273.     DWORD dwVersion;
  274.     LONG mtType;    
  275.     LONG oeEnvironment;
  276.     DWORD dwFlags;
  277.  
  278.     DWORD dwKey;                            /* version 1.0 */
  279.     DWORD dwMinViewportWidth;                /* version 1.0 */
  280.     DWORD dwMinViewportHeight;                /* version 1.0 */
  281.     R4_RANGE rngTransparencyRange;            /* version 1.0 */
  282.     PTR_R4_BITMASK pbmTransparencyBitmask;    /* version 1.0 */
  283.     LONG tmTransparencyMethod;                /* version 1.0 */
  284.     R4_FLAG fEnabledKey;                    /* version 1.0 */
  285.     R4_FLAG fScalability;                    /* version 1.0 */
  286.     R4_FLAG fBiDirPrediction;                /* version 1.0 */
  287.     R4_FLAG fRandomKeyAndBiDir;                /* version 1.0 */
  288.     DWORD dwPlaybackPlatform;                /* version 1.0 */
  289.     WORD wFrameLatency;                        /* version 1.0 */
  290.     WORD wDeadFrames;                        /* version 1.0 */
  291.     R4_FLAG fQuickCompress;                    /* version 1.1 */
  292. } R4_ENC_SEQ_DATA, FAR * PTR_R4_ENC_SEQ_DATA;
  293.  
  294.  
  295. #endif /* __VFW_SPEC_H__ */
  296. /* Temporary Encode parameters used to set up the compression information
  297.  */ 
  298.  
  299. typedef struct { 
  300.     DWORD dwFrameRate;
  301.     DWORD dwKeyFrameInterval;
  302.     DWORD dwDataRate;
  303.     DWORD dwQuality;
  304.     R4_FLAG fPadding;
  305. } R4_ENC_CMP_DATA, FAR * PTR_R4_ENC_CMP_DATA;
  306.  
  307. /*    AX_SPEC's GUID's
  308.  *
  309.  *    {CCDA9131-CE8A-11CE-82DD-0800095A5B55}    for Encode
  310.  *    {CCDA9132-CE8A-11CE-82DD-0800095A5B55}  for Decode
  311.  *
  312.  */
  313.  
  314. #define EC_KEY_FRAME (EC_USER + 1)
  315. #define EC_DECODE_RECT_CHANGED (EC_USER + 2)
  316.  
  317. DEFINE_GUID(IID_IIndeoEncode,
  318. 0xCCDA9131, 0xCE8A, 0x11CE, 0x82, 0xDD, 0x08, 0x00, 0x09, 0x5A, 0x5B, 0x55);
  319.  
  320. /*    AX_SPEC    interface definition
  321. */
  322.  
  323. #undef    INTERFACE
  324. #define    INTERFACE IIndeoEncode
  325.  
  326. DECLARE_INTERFACE_(IIndeoEncode, IUnknown)
  327. {
  328.  
  329.     /*
  330.      *    IUnknown methods
  331.      */
  332.  
  333.     STDMETHOD(QueryInterface)
  334.     (
  335.         THIS_
  336.         REFIID riid,
  337.         LPVOID FAR* ppvObj
  338.     ) PURE;
  339.  
  340.     STDMETHOD_(ULONG,AddRef)
  341.     (
  342.         THIS
  343.     ) PURE;
  344.  
  345.     STDMETHOD_(ULONG,Release)
  346.     (
  347.         THIS
  348.     ) PURE;
  349.  
  350.     /*
  351.      *    Query methods
  352.      */
  353.  
  354.     STDMETHOD(query_EncodeSequence)
  355.     (
  356.         THIS_
  357.         DWORD *pdwFlags             /* [out] */ // get data pointer
  358.     ) PURE;
  359.  
  360.     STDMETHOD(query_ImageDimensions)
  361.     (
  362.         THIS_
  363.         DWORD *pdwWidth,            /* [out] */ // get data pointer
  364.         DWORD *pdwHeight            /* [out] */ // get data pointer
  365.     ) PURE;
  366.  
  367.     /*
  368.      *    Get methods
  369.      */
  370.  
  371.     STDMETHOD(get_EncodeSequence)
  372.     (
  373.         THIS_
  374.         PTR_R4_ENC_SEQ_DATA pData    /* [out] */ // get data pointer
  375.     ) PURE;
  376.  
  377.     STDMETHOD(get_EncodePersistent)
  378.     (
  379.         THIS_
  380.         PTR_R4_ENC_SEQ_DATA pData    /* [out] */ // get data pointer
  381.     ) PURE;
  382.  
  383.     STDMETHOD(get_EncodeCompression)
  384.     (
  385.         THIS_
  386.         PTR_R4_ENC_CMP_DATA pData    /* [out] */ // get data pointer
  387.     ) PURE;
  388.  
  389.     STDMETHOD(get_EncodeCompressionDefault)
  390.     (
  391.         THIS_
  392.         PTR_R4_ENC_CMP_DATA pData    /* [out] */ // get data pointer
  393.     ) PURE;
  394.  
  395.  
  396.     /*
  397.      *    Set methods
  398.      */
  399.  
  400.     STDMETHOD(set_EncodeSequence)
  401.     (
  402.         THIS_
  403.         PTR_R4_ENC_SEQ_DATA pData    /* [in] */ // set data pointer
  404.     ) PURE;
  405.  
  406.     STDMETHOD(set_EncodePersistent)
  407.     (
  408.         THIS_
  409.         PTR_R4_ENC_SEQ_DATA pData    /* [in] */ // set data pointer
  410.     ) PURE;
  411.  
  412.     STDMETHOD(set_EncodeCompression)
  413.     (
  414.         THIS_
  415.         PTR_R4_ENC_CMP_DATA pData    /* [in] */ // set data pointer
  416.     ) PURE;
  417. };
  418.  
  419.  
  420. DEFINE_GUID(IID_IIndeoDecode,
  421. 0xCCDA9132, 0xCE8A, 0x11CE, 0x82, 0xDD, 0x08, 0x00, 0x09, 0x5A, 0x5B, 0x55);
  422.  
  423. #undef    INTERFACE
  424. #define    INTERFACE IIndeoDecode
  425.  
  426. DECLARE_INTERFACE_(IIndeoDecode, IUnknown)
  427. {
  428.  
  429.     /*
  430.      *    IUnknown methods
  431.      */
  432.  
  433.     STDMETHOD(QueryInterface)
  434.     (
  435.         THIS_
  436.         REFIID riid,
  437.         LPVOID FAR* ppvObj
  438.     ) PURE;
  439.  
  440.     STDMETHOD_(ULONG,AddRef)
  441.     (
  442.         THIS
  443.     ) PURE;
  444.  
  445.     STDMETHOD_(ULONG,Release)
  446.     (
  447.         THIS
  448.     ) PURE;
  449.  
  450.     /*
  451.      *    Query methods
  452.      */
  453.  
  454.     STDMETHOD(query_DecodeSequence)
  455.     (
  456.         THIS_
  457.         DWORD *pdwFlags                /* [out] */ // query data pointer
  458.     ) PURE;
  459.  
  460.     STDMETHOD(query_DecodeFrame)
  461.     (
  462.         THIS_
  463.         DWORD *pdwFlags                /* [out] */ // query data pointer
  464.     ) PURE;
  465.  
  466.     STDMETHOD(query_ImageDimensions)
  467.     (
  468.         THIS_
  469.         DWORD *pdwWidth,            /* [out] */ // get data pointer
  470.         DWORD *pdwHeight            /* [out] */ // get data pointer
  471.     ) PURE;
  472.  
  473.     /*
  474.      *    Get methods
  475.      */
  476.  
  477.     STDMETHOD(get_DecodeSequence)
  478.     (
  479.         THIS_
  480.         PTR_R4_DEC_SEQ_DATA pData     /* [out] */ // get data pointer
  481.     ) PURE;
  482.  
  483.     STDMETHOD(get_DecodeFrame)
  484.     (
  485.         THIS_
  486.         PTR_R4_DEC_FRAME_DATA pData    /* [out] */ // get data pointer
  487.     ) PURE;
  488.  
  489.  
  490.     /*
  491.      *    Set methods
  492.      */
  493.  
  494.     STDMETHOD(set_DecodeSequence)
  495.     (
  496.         THIS_
  497.         PTR_R4_DEC_SEQ_DATA pData    /* [in] */ // set data pointer
  498.     ) PURE;
  499.  
  500.     STDMETHOD(set_DecodeFrame)
  501.     (
  502.         THIS_
  503.         PTR_R4_DEC_FRAME_DATA pData    /* [in] */ // set data pointer
  504.     ) PURE;
  505.  
  506.     STDMETHOD(set_NotifyKeyFrame)
  507.     (
  508.         THIS_
  509.         DWORD bState                /* [in] */ // Set notify on/off
  510.     ) PURE;
  511. };
  512.  
  513. #ifdef __cplusplus
  514. }
  515. #endif
  516.  
  517. #endif /* __AX_SPEC_H__ */
  518.  
  519.