home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / amvideo.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  19KB  |  418 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) 1992 - 1997  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // Video related definitions and interfaces for ActiveMovie
  13.  
  14. #ifndef __AMVIDEO__
  15. #define __AMVIDEO__
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif // __cplusplus
  20.  
  21. #include <ddraw.h>
  22.  
  23.  
  24. // This is an interface on the video renderer that provides information about
  25. // DirectDraw with respect to its use by the renderer. For example it allows
  26. // an application to get details of the surface and any hardware capabilities
  27. // that are available. It also allows someone to adjust the surfaces that the
  28. // renderer should use and furthermore even set the DirectDraw instance. We
  29. // allow someone to set the DirectDraw instance because DirectDraw can only
  30. // be opened once per process so it helps resolve conflicts. There is some
  31. // duplication in this interface as the hardware/emulated/FOURCCs available
  32. // can all be found through the IDirectDraw interface, this interface allows
  33. // simple access to that information without calling the DirectDraw provider
  34. // itself. The AMDDS prefix is ActiveMovie DirectDraw Switches abbreviated.
  35.  
  36. #define AMDDS_NONE 0x00             // No use for DCI/DirectDraw
  37. #define AMDDS_DCIPS 0x01            // Use DCI primary surface
  38. #define AMDDS_PS 0x02               // Use DirectDraw primary
  39. #define AMDDS_RGBOVR 0x04           // RGB overlay surfaces
  40. #define AMDDS_YUVOVR 0x08           // YUV overlay surfaces
  41. #define AMDDS_RGBOFF 0x10           // RGB offscreen surfaces
  42. #define AMDDS_YUVOFF 0x20           // YUV offscreen surfaces
  43. #define AMDDS_RGBFLP 0x40           // RGB flipping surfaces
  44. #define AMDDS_YUVFLP 0x80           // YUV flipping surfaces
  45. #define AMDDS_ALL 0xFF              // ALL the previous flags
  46. #define AMDDS_DEFAULT AMDDS_ALL     // Use all available surfaces
  47.  
  48. #define AMDDS_YUV (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP)
  49. #define AMDDS_RGB (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP)
  50. #define AMDDS_PRIMARY (AMDDS_DCIPS | AMDDS_PS)
  51.  
  52. // be nice to our friends in C
  53. #undef INTERFACE
  54. #define INTERFACE IDirectDrawVideo
  55.  
  56. DECLARE_INTERFACE_(IDirectDrawVideo, IUnknown)
  57. {
  58.     // IUnknown methods
  59.  
  60.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  61.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  62.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  63.  
  64.     // IDirectDrawVideo methods
  65.  
  66.     STDMETHOD(GetSwitches)(THIS_ DWORD *pSwitches) PURE;
  67.     STDMETHOD(SetSwitches)(THIS_ DWORD Switches) PURE;
  68.     STDMETHOD(GetCaps)(THIS_ DDCAPS *pCaps) PURE;
  69.     STDMETHOD(GetEmulatedCaps)(THIS_ DDCAPS *pCaps) PURE;
  70.     STDMETHOD(GetSurfaceDesc)(THIS_ DDSURFACEDESC *pSurfaceDesc) PURE;
  71.     STDMETHOD(GetFourCCCodes)(THIS_ DWORD *pCount,DWORD *pCodes) PURE;
  72.     STDMETHOD(SetDirectDraw)(THIS_ LPDIRECTDRAW pDirectDraw) PURE;
  73.     STDMETHOD(GetDirectDraw)(THIS_ LPDIRECTDRAW *ppDirectDraw) PURE;
  74.     STDMETHOD(GetSurfaceType)(THIS_ DWORD *pSurfaceType) PURE;
  75.     STDMETHOD(SetDefault)(THIS) PURE;
  76.     STDMETHOD(UseScanLine)(THIS_ long UseScanLine) PURE;
  77.     STDMETHOD(CanUseScanLine)(THIS_ long *UseScanLine) PURE;
  78.     STDMETHOD(UseOverlayStretch)(THIS_ long UseOverlayStretch) PURE;
  79.     STDMETHOD(CanUseOverlayStretch)(THIS_ long *UseOverlayStretch) PURE;
  80.     STDMETHOD(UseWhenFullScreen)(THIS_ long UseWhenFullScreen) PURE;
  81.     STDMETHOD(WillUseFullScreen)(THIS_ long *UseWhenFullScreen) PURE;
  82. };
  83.  
  84.  
  85. // be nice to our friends in C
  86. #undef INTERFACE
  87. #define INTERFACE IQualProp
  88.  
  89. DECLARE_INTERFACE_(IQualProp, IUnknown)
  90. {
  91.     // IUnknown methods
  92.  
  93.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  94.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  95.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  96.  
  97.     // Compare these with the functions in class CGargle in gargle.h
  98.  
  99.     STDMETHOD(get_FramesDroppedInRenderer)(THIS_ int *pcFrames) PURE;  // Out
  100.     STDMETHOD(get_FramesDrawn)(THIS_ int *pcFramesDrawn) PURE;         // Out
  101.     STDMETHOD(get_AvgFrameRate)(THIS_ int *piAvgFrameRate) PURE;       // Out
  102.     STDMETHOD(get_Jitter)(THIS_ int *iJitter) PURE;                    // Out
  103.     STDMETHOD(get_AvgSyncOffset)(THIS_ int *piAvg) PURE;               // Out
  104.     STDMETHOD(get_DevSyncOffset)(THIS_ int *piDev) PURE;               // Out
  105. };
  106.  
  107.  
  108. // This interface allows an application or plug in distributor to control a
  109. // full screen renderer. The Modex renderer supports this interface. When
  110. // connected a renderer should load the display modes it has available
  111. // The number of modes available can be obtained through CountModes. Then
  112. // information on each individual mode is available by calling GetModeInfo
  113. // and IsModeAvailable. An application may enable and disable any modes
  114. // by calling the SetEnabled flag with OATRUE or OAFALSE (not C/C++ TRUE
  115. // and FALSE values) - the current value may be queried by IsModeEnabled
  116.  
  117. // A more generic way of setting the modes enabled that is easier to use
  118. // when writing applications is the clip loss factor. This defines the
  119. // amount of video that can be lost when deciding which display mode to
  120. // use. Assuming the decoder cannot compress the video then playing an
  121. // MPEG file (say 352x288) into a 320x200 display will lose about 25% of
  122. // the image. The clip loss factor specifies the upper range permissible.
  123. // To allow typical MPEG video to be played in 320x200 it defaults to 25%
  124.  
  125. // be nice to our friends in C
  126. #undef INTERFACE
  127. #define INTERFACE IFullScreenVideo
  128.  
  129. DECLARE_INTERFACE_(IFullScreenVideo, IUnknown)
  130. {
  131.     // IUnknown methods
  132.  
  133.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  134.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  135.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  136.  
  137.     // IFullScreenVideo methods
  138.  
  139.     STDMETHOD(CountModes)(THIS_ long *pModes) PURE;
  140.     STDMETHOD(GetModeInfo)(THIS_ long Mode,long *pWidth,long *pHeight,long *pDepth) PURE;
  141.     STDMETHOD(GetCurrentMode)(THIS_ long *pMode) PURE;
  142.     STDMETHOD(IsModeAvailable)(THIS_ long Mode) PURE;
  143.     STDMETHOD(IsModeEnabled)(THIS_ long Mode) PURE;
  144.     STDMETHOD(SetEnabled)(THIS_ long Mode,long bEnabled) PURE;
  145.     STDMETHOD(GetClipFactor)(THIS_ long *pClipFactor) PURE;
  146.     STDMETHOD(SetClipFactor)(THIS_ long ClipFactor) PURE;
  147.     STDMETHOD(SetMessageDrain)(THIS_ HWND hwnd) PURE;
  148.     STDMETHOD(GetMessageDrain)(THIS_ HWND *hwnd) PURE;
  149.     STDMETHOD(SetMonitor)(THIS_ long Monitor) PURE;
  150.     STDMETHOD(GetMonitor)(THIS_ long *Monitor) PURE;
  151.     STDMETHOD(HideOnDeactivate)(THIS_ long Hide) PURE;
  152.     STDMETHOD(IsHideOnDeactivate)(THIS) PURE;
  153.     STDMETHOD(SetCaption)(THIS_ BSTR strCaption) PURE;
  154.     STDMETHOD(GetCaption)(THIS_ BSTR *pstrCaption) PURE;
  155.     STDMETHOD(SetDefault)(THIS) PURE;
  156. };
  157.  
  158.  
  159. // This adds the accelerator table capabilities in fullscreen. This is being
  160. // added between the original runtime release and the full SDK release. We
  161. // cannot just add the method to IFullScreenVideo as we don't want to force
  162. // applications to have to ship the ActiveMovie support DLLs - this is very
  163. // important to applications that plan on being downloaded over the Internet
  164.  
  165. // be nice to our friends in C
  166. #undef INTERFACE
  167. #define INTERFACE IFullScreenVideoEx
  168.  
  169. DECLARE_INTERFACE_(IFullScreenVideoEx, IFullScreenVideo)
  170. {
  171.     // IUnknown methods
  172.  
  173.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  174.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  175.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  176.  
  177.     // IFullScreenVideo methods
  178.  
  179.     STDMETHOD(CountModes)(THIS_ long *pModes) PURE;
  180.     STDMETHOD(GetModeInfo)(THIS_ long Mode,long *pWidth,long *pHeight,long *pDepth) PURE;
  181.     STDMETHOD(GetCurrentMode)(THIS_ long *pMode) PURE;
  182.     STDMETHOD(IsModeAvailable)(THIS_ long Mode) PURE;
  183.     STDMETHOD(IsModeEnabled)(THIS_ long Mode) PURE;
  184.     STDMETHOD(SetEnabled)(THIS_ long Mode,long bEnabled) PURE;
  185.     STDMETHOD(GetClipFactor)(THIS_ long *pClipFactor) PURE;
  186.     STDMETHOD(SetClipFactor)(THIS_ long ClipFactor) PURE;
  187.     STDMETHOD(SetMessageDrain)(THIS_ HWND hwnd) PURE;
  188.     STDMETHOD(GetMessageDrain)(THIS_ HWND *hwnd) PURE;
  189.     STDMETHOD(SetMonitor)(THIS_ long Monitor) PURE;
  190.     STDMETHOD(GetMonitor)(THIS_ long *Monitor) PURE;
  191.     STDMETHOD(HideOnDeactivate)(THIS_ long Hide) PURE;
  192.     STDMETHOD(IsHideOnDeactivate)(THIS) PURE;
  193.     STDMETHOD(SetCaption)(THIS_ BSTR strCaption) PURE;
  194.     STDMETHOD(GetCaption)(THIS_ BSTR *pstrCaption) PURE;
  195.     STDMETHOD(SetDefault)(THIS) PURE;
  196.  
  197.     // IFullScreenVideoEx
  198.  
  199.     STDMETHOD(SetAcceleratorTable)(THIS_ HWND hwnd,HACCEL hAccel) PURE;
  200.     STDMETHOD(GetAcceleratorTable)(THIS_ HWND *phwnd,HACCEL *phAccel) PURE;
  201.     STDMETHOD(KeepPixelAspectRatio)(THIS_ long KeepAspect) PURE;
  202.     STDMETHOD(IsKeepPixelAspectRatio)(THIS_ long *pKeepAspect) PURE;
  203. };
  204.  
  205.  
  206. // The SDK base classes contain a base video mixer class. Video mixing in a
  207. // software environment is tricky because we typically have multiple streams
  208. // each sending data at unpredictable times. To work with this we defined a
  209. // pin that is the lead pin, when data arrives on this pin we do a mix. As
  210. // an alternative we may not want to have a lead pin but output samples at
  211. // predefined spaces, like one every 1/15 of a second, this interfaces also
  212. // supports that mode of operations (there is a working video mixer sample)
  213.  
  214. // be nice to our friends in C
  215. #undef INTERFACE
  216. #define INTERFACE IBaseVideoMixer
  217.  
  218. DECLARE_INTERFACE_(IBaseVideoMixer, IUnknown)
  219. {
  220.     STDMETHOD(SetLeadPin)(THIS_ int iPin) PURE;
  221.     STDMETHOD(GetLeadPin)(THIS_ int *piPin) PURE;
  222.     STDMETHOD(GetInputPinCount)(THIS_ int *piPinCount) PURE;
  223.     STDMETHOD(IsUsingClock)(THIS_ int *pbValue) PURE;
  224.     STDMETHOD(SetUsingClock)(THIS_ int bValue) PURE;
  225.     STDMETHOD(GetClockPeriod)(THIS_ int *pbValue) PURE;
  226.     STDMETHOD(SetClockPeriod)(THIS_ int bValue) PURE;
  227. };
  228.  
  229. #define iPALETTE_COLORS 256     // Maximum colours in palette
  230. #define iEGA_COLORS 16          // Number colours in EGA palette
  231. #define iMASK_COLORS 3          // Maximum three components
  232. #define iTRUECOLOR 16           // Minimum true colour device
  233. #define iRED 0                  // Index position for RED mask
  234. #define iGREEN 1                // Index position for GREEN mask
  235. #define iBLUE 2                 // Index position for BLUE mask
  236. #define iPALETTE 8              // Maximum colour depth using a palette
  237. #define iMAXBITS 8              // Maximum bits per colour component
  238.  
  239.  
  240. // Used for true colour images that also have a palette
  241.  
  242. typedef struct tag_TRUECOLORINFO {
  243.     DWORD   dwBitMasks[iMASK_COLORS];
  244.     RGBQUAD bmiColors[iPALETTE_COLORS];
  245. } TRUECOLORINFO;
  246.  
  247.  
  248. // The BITMAPINFOHEADER contains all the details about the video stream such
  249. // as the actual image dimensions and their pixel depth. A source filter may
  250. // also request that the sink take only a section of the video by providing a
  251. // clipping rectangle in rcSource. In the worst case where the sink filter
  252. // forgets to check this on connection it will simply render the whole thing
  253. // which isn't a disaster. Ideally a sink filter will check the rcSource and
  254. // if it doesn't support image extraction and the rectangle is not empty then
  255. // it will reject the connection. A filter should use SetRectEmpty to reset a
  256. // rectangle to all zeroes (and IsRectEmpty to later check the rectangle).
  257. // The rcTarget specifies the destination rectangle for the video, for most
  258. // source filters they will set this to all zeroes, a downstream filter may
  259. // request that the video be placed in a particular area of the buffers it
  260. // supplies in which case it will call QueryAccept with a non empty target
  261.  
  262. typedef struct tagVIDEOINFOHEADER {
  263.  
  264.     RECT            rcSource;          // The bit we really want to use
  265.     RECT            rcTarget;          // Where the video should go
  266.     DWORD           dwBitRate;         // Approximate bit data rate
  267.     DWORD           dwBitErrorRate;    // Bit error rate for this stream
  268.     REFERENCE_TIME  AvgTimePerFrame;   // Average time per frame (100ns units)
  269.  
  270.     BITMAPINFOHEADER bmiHeader;
  271.  
  272. } VIDEOINFOHEADER;
  273.  
  274. // make sure the pbmi is initialized before using these macros
  275. #define TRUECOLOR(pbmi)  ((TRUECOLORINFO *)(((LPBYTE)&((pbmi)->bmiHeader)) \
  276.                     + (pbmi)->bmiHeader.biSize))
  277. #define COLORS(pbmi)    ((RGBQUAD *)(((LPBYTE)&((pbmi)->bmiHeader))     \
  278.                     + (pbmi)->bmiHeader.biSize))
  279. #define BITMASKS(pbmi)    ((DWORD *)(((LPBYTE)&((pbmi)->bmiHeader))     \
  280.                     + (pbmi)->bmiHeader.biSize))
  281.  
  282. // All the image based filters use this to communicate their media types. It's
  283. // centred principally around the BITMAPINFO. This structure always contains a
  284. // BITMAPINFOHEADER followed by a number of other fields depending on what the
  285. // BITMAPINFOHEADER contains. If it contains details of a palettised format it
  286. // will be followed by one or more RGBQUADs defining the palette. If it holds
  287. // details of a true colour format then it may be followed by a set of three
  288. // DWORD bit masks that specify where the RGB data can be found in the image
  289. // (For more information regarding BITMAPINFOs see the Win32 documentation)
  290.  
  291. // The rcSource and rcTarget fields are not for use by filters supplying the
  292. // data. The destination (target) rectangle should be set to all zeroes. The
  293. // source may also be zero filled or set with the dimensions of the video. So
  294. // if the video is 352x288 pixels then set it to (0,0,352,288). These fields
  295. // are mainly used by downstream filters that want to ask the source filter
  296. // to place the image in a different position in an output buffer. So when
  297. // using for example the primary surface the video renderer may ask a filter
  298. // to place the video images in a destination position of (100,100,452,388)
  299. // on the display since that's where the window is positioned on the display
  300.  
  301. // !!! WARNING !!!
  302. // DO NOT use this structure unless you are sure that the BITMAPINFOHEADER
  303. // has a normal biSize == sizeof(BITMAPINFOHEADER) !
  304. // !!! WARNING !!!
  305.  
  306. typedef struct tagVIDEOINFO {
  307.  
  308.     RECT            rcSource;          // The bit we really want to use
  309.     RECT            rcTarget;          // Where the video should go
  310.     DWORD           dwBitRate;         // Approximate bit data rate
  311.     DWORD           dwBitErrorRate;    // Bit error rate for this stream
  312.     REFERENCE_TIME  AvgTimePerFrame;   // Average time per frame (100ns units)
  313.  
  314.     BITMAPINFOHEADER bmiHeader;
  315.  
  316.     union {
  317.         RGBQUAD         bmiColors[iPALETTE_COLORS];     // Colour palette
  318.         DWORD           dwBitMasks[iMASK_COLORS];       // True colour masks
  319.         TRUECOLORINFO   TrueColorInfo;                  // Both of the above
  320.     };
  321.  
  322. } VIDEOINFO;
  323.  
  324. // These macros define some standard bitmap format sizes
  325.  
  326. #define SIZE_EGA_PALETTE (iEGA_COLORS * sizeof(RGBQUAD))
  327. #define SIZE_PALETTE (iPALETTE_COLORS * sizeof(RGBQUAD))
  328. #define SIZE_MASKS (iMASK_COLORS * sizeof(DWORD))
  329. #define SIZE_PREHEADER (FIELD_OFFSET(VIDEOINFOHEADER,bmiHeader))
  330. #define SIZE_VIDEOHEADER (sizeof(BITMAPINFOHEADER) + SIZE_PREHEADER)
  331. // !!! for abnormal biSizes
  332. // #define SIZE_VIDEOHEADER(pbmi) ((pbmi)->bmiHeader.biSize + SIZE_PREHEADER)
  333.  
  334. // DIBSIZE calculates the number of bytes required by an image
  335.  
  336. #define WIDTHBYTES(bits) ((DWORD)(((bits)+31) & (~31)) / 8)
  337. #define DIBWIDTHBYTES(bi) (DWORD)WIDTHBYTES((DWORD)(bi).biWidth * (DWORD)(bi).biBitCount)
  338. #define _DIBSIZE(bi) (DIBWIDTHBYTES(bi) * (DWORD)(bi).biHeight)
  339. #define DIBSIZE(bi) ((bi).biHeight < 0 ? (-1)*(_DIBSIZE(bi)) : _DIBSIZE(bi))
  340.  
  341. // This compares the bit masks between two VIDEOINFOHEADERs
  342.  
  343. #define BIT_MASKS_MATCH(pbmi1,pbmi2)                                \
  344.     (((pbmi1)->dwBitMasks[iRED] == (pbmi2)->dwBitMasks[iRED]) &&        \
  345.      ((pbmi1)->dwBitMasks[iGREEN] == (pbmi2)->dwBitMasks[iGREEN]) &&    \
  346.      ((pbmi1)->dwBitMasks[iBLUE] == (pbmi2)->dwBitMasks[iBLUE]))
  347.  
  348. // These zero fill different parts of the VIDEOINFOHEADER structure
  349.  
  350. // Only use these macros for pbmi's with a normal BITMAPINFOHEADER biSize
  351. #define RESET_MASKS(pbmi) (ZeroMemory((PVOID)(pbmi)->dwBitFields,SIZE_MASKS))
  352. #define RESET_HEADER(pbmi) (ZeroMemory((PVOID)(pbmi),SIZE_VIDEOHEADER))
  353. #define RESET_PALETTE(pbmi) (ZeroMemory((PVOID)(pbmi)->bmiColors,SIZE_PALETTE));
  354.  
  355. #if 0
  356. // !!! This is the right way to do it, but may break existing code
  357. #define RESET_MASKS(pbmi) (ZeroMemory((PVOID)(((LPBYTE)(pbmi)->bmiHeader) + \
  358.             (pbmi)->bmiHeader.biSize,SIZE_MASKS)))
  359. #define RESET_HEADER(pbmi) (ZeroMemory((PVOID)(pbmi), SIZE_PREHEADER +        \
  360.             sizeof(BITMAPINFOHEADER)))
  361. #define RESET_PALETTE(pbmi) (ZeroMemory((PVOID)(((LPBYTE)(pbmi)->bmiHeader) + \
  362.             (pbmi)->bmiHeader.biSize,SIZE_PALETTE))
  363. #endif
  364.  
  365. // Other (hopefully) useful bits and bobs
  366.  
  367. #define PALETTISED(pbmi) ((pbmi)->bmiHeader.biBitCount <= iPALETTE)
  368. #define PALETTE_ENTRIES(pbmi) ((DWORD) 1 << (pbmi)->bmiHeader.biBitCount)
  369.  
  370. // Returns the address of the BITMAPINFOHEADER from the VIDEOINFOHEADER
  371. #define HEADER(pVideoInfo) (&(((VIDEOINFOHEADER *) (pVideoInfo))->bmiHeader))
  372.  
  373.  
  374. // MPEG variant - includes a DWORD length followed by the
  375. // video sequence header after the video header.
  376. //
  377. // The sequence header includes the sequence header start code and the
  378. // quantization matrices associated with the first sequence header in the
  379. // stream so is a maximum of 140 bytes long.
  380.  
  381. typedef struct tagMPEG1VIDEOINFO {
  382.  
  383.     VIDEOINFOHEADER hdr;                    // Compatible with VIDEOINFO
  384.     DWORD           dwStartTimeCode;        // 25-bit Group of pictures time code
  385.                                             // at start of data
  386.     DWORD           cbSequenceHeader;       // Length in bytes of bSequenceHeader
  387.     BYTE            bSequenceHeader[1];     // Sequence header including
  388.                                             // quantization matrices if any
  389. } MPEG1VIDEOINFO;
  390.  
  391. #define MAX_SIZE_MPEG1_SEQUENCE_INFO 140
  392. #define SIZE_MPEG1VIDEOINFO(pv) (FIELD_OFFSET(MPEG1VIDEOINFO, bSequenceHeader[0]) + (pv)->cbSequenceHeader)
  393. #define MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader)
  394.  
  395.  
  396. // Analog video variant - Use this when the format is FORMAT_AnalogVideo
  397. //
  398. // rcSource defines the portion of the active video signal to use
  399. // rcTarget defines the destination rectangle
  400. //    both of the above are relative to the dwActiveWidth and dwActiveHeight fields
  401. // dwActiveWidth is currently set to 720 for all formats (but could change for HDTV)
  402. // dwActiveHeight is 483 for NTSC and 575 for PAL/SECAM  (but could change for HDTV)
  403.  
  404. typedef struct tagAnalogVideoInfo {
  405.     RECT            rcSource;           // Width max is 720, height varies w/ TransmissionStd
  406.     RECT            rcTarget;           // Where the video should go
  407.     DWORD           dwActiveWidth;      // Always 720 (CCIR-601 active samples per line)
  408.     DWORD           dwActiveHeight;     // 483 for NTSC, 575 for PAL/SECAM
  409.     REFERENCE_TIME  AvgTimePerFrame;    // Normal ActiveMovie units (100 nS)
  410. } ANALOGVIDEOINFO;
  411.  
  412.  
  413. #ifdef __cplusplus
  414. }
  415. #endif // __cplusplus
  416. #endif // __AMVIDEO__
  417.  
  418.