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