home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / axcore.idl < prev    next >
Text File  |  1998-04-25  |  49KB  |  1,238 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 - 1996  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // Core streaming interfaces; other ActiveMovie-only interfaces are in
  13. // AXExtend.idl
  14.  
  15. // include unknwn.idl and objidl.idl first
  16.  
  17.  
  18. #define CHARS_IN_GUID 39  // 128 bits, plus { - } punctuation and terminal null
  19.                           // chars NOT BYTES in the standard representation
  20.                           // e.g. {D3588AB0-0781-11ce-B03A-0020AF0BA770} + null
  21. cpp_quote("#define CHARS_IN_GUID     39")
  22.  
  23.  
  24. //=====================================================================
  25. //=====================================================================
  26. // media types & formats
  27. //=====================================================================
  28. //=====================================================================
  29.  
  30. // there is a high-level media type (audio, compressed video,
  31. // mpeg video, midi). Within each type, there is a subtype (cinepak, pcm)
  32. // and a length+untyped data block defining the format in a
  33. // type-specific manner. EG for video/cinepak, the data block would be
  34. // a bitmapinfo.
  35. // the contents of the format block is defined by the formattype GUID
  36. // for example FORMAT_VideoInfo, FORMAT_WaveFormatEx. In the future this
  37. // may be a pointer to an object supporting property style interfaces
  38. // in which case the GUID may be something like FORMAT_IUnknown. When
  39. // you are passed a media type you should check the format type, if
  40. // it isn't a type you recognise then don't touch the format block
  41.  
  42. typedef struct _AMMediaType {
  43.     GUID     majortype;
  44.     GUID     subtype;
  45.     BOOL     bFixedSizeSamples;
  46.     BOOL     bTemporalCompression;
  47.     ULONG    lSampleSize;
  48.     GUID     formattype;
  49.     IUnknown *pUnk;
  50.     ULONG    cbFormat;
  51.     [size_is(cbFormat)] BYTE * pbFormat;
  52. } AM_MEDIA_TYPE;
  53.  
  54. //=====================================================================
  55. //=====================================================================
  56. // pin information
  57. //=====================================================================
  58. //=====================================================================
  59.  
  60. // is this an input or output pin
  61. typedef enum _PinDirection {
  62.     PINDIR_INPUT,
  63.     PINDIR_OUTPUT
  64. } PIN_DIRECTION;
  65.  
  66. // other types that need defining
  67. #define MAX_PIN_NAME     128
  68. cpp_quote("#define MAX_PIN_NAME     128")
  69. cpp_quote("#define MAX_FILTER_NAME  128")
  70. #define MAX_FILTER_NAME  128
  71.  
  72.  
  73. //=====================================================================
  74. //=====================================================================
  75. // time information
  76. //
  77. // This represents a time (either reference or stream) in 100ns units
  78. // The class library contains a CRefTime helper class
  79. // that supports simple comparison and arithmetic operations
  80. //=====================================================================
  81. //=====================================================================
  82.  
  83. typedef LONGLONG REFERENCE_TIME;
  84. typedef double REFTIME;
  85.  
  86. // Win32 HANDLEs have to be cast to these as the MIDL compiler doesn't
  87. // like the HANDLE type or in fact anything remotely associated with
  88. // them. If this ever gets ported to a MAC environment then these will
  89. // have to become an alertable synchronisation object that it supports
  90.  
  91. typedef unsigned long HSEMAPHORE;
  92. typedef unsigned long HEVENT;
  93.  
  94. //=====================================================================
  95. //=====================================================================
  96. // Allocator properties
  97. //
  98. // Used to describe the actual properties of an allocator,
  99. // and used to request properties from an allocator or from an upstream
  100. // filter that could create an allocator. See IMemAllocator and
  101. // IMemInputPin.
  102. //=====================================================================
  103. //=====================================================================
  104. typedef struct _AllocatorProperties {
  105.         long cBuffers;    // count of buffers at this allocator
  106.     long cbBuffer;    // size of each buffer, excluding any prefix
  107.  
  108.         // alignment of the buffer - buffer start will be aligned on a multiple of
  109.         // this amount
  110.         long cbAlign;
  111.  
  112.         // prefix amount. Each buffer is immediately preceeded by cbPrefix bytes.
  113.         // note that GetPointer points to the beginning of the buffer proper.
  114.         // the prefix is aligned, i.e. (GetPointer() - cbPrefix) is aligned on cbAlign.
  115.         long cbPrefix;
  116. } ALLOCATOR_PROPERTIES;
  117.  
  118.  
  119.  
  120.  
  121.  
  122. // forward declarations (in alphabetical order - we were getting duplicates)
  123. interface IAMovieSetup;
  124. interface IEnumFilters;
  125. interface IEnumMediaTypes;
  126. interface IEnumPins;
  127. interface IBaseFilter;
  128. interface IFilterGraph;
  129. interface IMediaFilter;
  130. interface IMediaSample;
  131. interface IMemAllocator;
  132. interface IMemInputPin;
  133. interface IPin;
  134. interface IReferenceClock;
  135.  
  136.  
  137.  
  138. //=====================================================================
  139. //=====================================================================
  140. // Defines IPin interface
  141. //
  142. // interface representing a single, unidirection connection point on a
  143. // filter. A Pin will connect to exactly one other pin on another filter.
  144. // This interface represents the interface other objects can call on
  145. // this pin. The interface between the filter and the pin is private to
  146. // the implementation of a specific filter.
  147. //
  148. // During the connection process, one pin will be instructed to take
  149. // the lead: the connect interface on this pin will be calling, passing
  150. // the IPin* for the other pin. This connecting pin will call the
  151. // ReceiveConnection member function on the other pin, as well as presumably
  152. // other format-enumeration and queryinterface calls to establish whether
  153. // the connection is possible.
  154. //=====================================================================
  155. //=====================================================================
  156.  
  157. [
  158. object,
  159. uuid(56a86891-0ad4-11ce-b03a-0020af0ba770),
  160. pointer_default(unique)
  161. ]
  162. interface IPin : IUnknown {
  163.  
  164.     // initiate a connection to another pin. calls ReceiveConnection on the
  165.     // other pin. Verifies that the connection is possible and may reject
  166.     // it.
  167.     // The mediatype parameter is optional. If it is not null, the pin must
  168.     // connect using that media type if possible. The subtype and/or format
  169.     // type can be GUID_NULL, meaning that the pin can fill them in as desired.
  170.     // This allows an application to partially specify the media type to be
  171.     // used for the connection, insisting on eg YUV 422 but leaving details
  172.     // (such as the image size) to be negotiated between the pins.
  173.     HRESULT Connect(
  174.         [in] IPin * pReceivePin,        // connect yourself to this pin
  175.         [in] const AM_MEDIA_TYPE * pmt  // (optional) connect using this type
  176.     );
  177.  
  178.     // called by a connecting pin to make a connection
  179.     HRESULT ReceiveConnection(
  180.         [in] IPin * pConnector,
  181.         [in] const AM_MEDIA_TYPE *pmt   // this is the media type we will exchange
  182.     );
  183.  
  184.     // break a connection - no params since there is only one connection
  185.     // possible on this pin
  186.     HRESULT Disconnect(void);
  187.  
  188.     // Find the pin this pin is connected to (if any)
  189.     // The pointer returned is AddRef()d
  190.     // Fails if the pin is not connected
  191.     HRESULT ConnectedTo(
  192.         [out] IPin **pPin
  193.     );
  194.  
  195.     // Return the media type of a connection if the pin is connected
  196.     HRESULT ConnectionMediaType(
  197.         [out] AM_MEDIA_TYPE *pmt
  198.     );
  199.  
  200.     // get information about the pin itself
  201.     typedef struct _PinInfo {
  202.     IBaseFilter *pFilter;    // the filter this pin is on
  203.     PIN_DIRECTION dir;    // am I an input or output pin?
  204.     WCHAR achName[MAX_PIN_NAME];    // the name of this pin within this filter
  205.     } PIN_INFO;
  206.  
  207.     HRESULT QueryPinInfo(
  208.         [out] PIN_INFO * pInfo
  209.     );
  210.  
  211.     // We often want to know the direction.  Rather than use the
  212.     // relatively expensive QueryPinInfo, use this
  213.     HRESULT QueryDirection(
  214.         [out] PIN_DIRECTION *pPinDir
  215.     );
  216.  
  217.     // Get an identifier for the pin (allows connections to be saved).
  218.     // The storage will be allocated by the filter using CoTaskMemAlloc
  219.     // The caller should free it using CoTaskMemFree
  220.     HRESULT QueryId(
  221.         [out] LPWSTR * Id
  222.     );
  223.  
  224.     // will the pin accept the format type, S_OK yes, S_FALSE no
  225.     HRESULT QueryAccept(
  226.         [in] const AM_MEDIA_TYPE *pmt
  227.     );
  228.  
  229.     // return an enumerator for this pin's preferred media types
  230.     HRESULT EnumMediaTypes(
  231.         [out] IEnumMediaTypes **ppEnum
  232.     );
  233.  
  234.     // return an array of IPin* - the pins that this pin internally connects to
  235.     // All pins put in the array must be AddReffed (but no others)
  236.     // Errors: "Can't say" - FAIL; not enough slots - return S_FALSE
  237.     // Default: return E_NOTIMPL
  238.     // The filter graph will interpret E_NOTIMPL as any input pin connects to
  239.     // all visible output pins and vise versa.
  240.     // apPin can be NULL if nPin==0 (not otherwise).
  241.     HRESULT QueryInternalConnections(
  242.         [out] IPin* *apPin,     // array of IPin*
  243.         [in, out] ULONG *nPin   // on input, the number of slots
  244.                                 // on output  the number of pins
  245.     );
  246.  
  247.     // notify the pin that no more data is expected until a new run
  248.     // command is issued. End of stream should be queued and delivered after
  249.     // all queued data is delivered. Pass through if there is no queued data.
  250.     // Flush should flush any queued EOS.
  251.     // returns S_OK unless there is some error.
  252.     // input pins only: output pins will normally return E_UNEXPECTED.
  253.     HRESULT EndOfStream(void);
  254.  
  255.     // Flush
  256.  
  257.     // Enter flush state: do the following steps (in order)
  258.     // -- prevent any more Receives succeeding (set a flushing flag)
  259.     // -- discard any queued data
  260.     // -- free anyone blocked on Receive in your filter
  261.     // -- pass BeginFlush to any downstream pins
  262.     HRESULT BeginFlush(void);
  263.  
  264.     // End flush state: do the following steps in order
  265.     // -- ensure no more data will be pushed by your filter
  266.     //    (sync with thread if you have one, stop it pushing and
  267.     //     discard any queued data)
  268.     // -- re-enable Receive (clear internal flushing flag)
  269.     // -- pass EndFlush to any downstream pins
  270.     HRESULT EndFlush(void);
  271.  
  272.     // informational: all data arriving after this call is part of a segment
  273.     // from StartTime to StopTime, played at rate. This allows filters that
  274.     // process buffers containing more than one sample to clip the rendering
  275.     // to within the start and stop times.
  276.     //
  277.     // A source pin will call a destination pin on this method after completing
  278.     // delivery of any previous data, and before any Receive calls for the
  279.     // new data
  280.     HRESULT NewSegment(
  281.                 [in] REFERENCE_TIME tStart,
  282.                 [in] REFERENCE_TIME tStop,
  283.                 [in] double dRate);
  284. }
  285.  
  286. typedef IPin *PPIN;
  287.  
  288.  
  289. //=====================================================================
  290. //=====================================================================
  291. // Defines IEnumPins interface
  292. //
  293. // interface returned from IBaseFilter::EnumPins(). based on IEnumXXXX
  294. //=====================================================================
  295. //=====================================================================
  296.  
  297. [
  298. object,
  299. uuid(56a86892-0ad4-11ce-b03a-0020af0ba770),
  300. pointer_default(unique)
  301. ]
  302. interface IEnumPins : IUnknown {
  303.  
  304.     HRESULT Next(
  305.         [in] ULONG cPins,                       // place this many pins...
  306.         [out, size_is(cPins)] IPin ** ppPins,   // ...in this array
  307.         [out] ULONG * pcFetched                 // actual count passed
  308.     );
  309.  
  310.     HRESULT Skip(
  311.         [in] ULONG cPins);
  312.  
  313.     HRESULT Reset(void);
  314.  
  315.     HRESULT Clone(
  316.         [out] IEnumPins **ppEnum
  317.     );
  318. }
  319.  
  320. typedef IEnumPins *PENUMPINS;
  321.  
  322.  
  323. //=====================================================================
  324. //=====================================================================
  325. // Defines IEnumMediaTypes interface
  326. //
  327. // Enumerates the preferred formats for a pin
  328. //=====================================================================
  329. //=====================================================================
  330.  
  331. [
  332. object,
  333. uuid(89c31040-846b-11ce-97d3-00aa0055595a),
  334. pointer_default(unique)
  335. ]
  336. interface IEnumMediaTypes : IUnknown {
  337.  
  338.     // to call this member function pass in the address of a pointer to a
  339.     // media type. The interface will allocate the necessary AM_MEDIA_TYPE
  340.     // structures and initialise them with the variable format block
  341.  
  342.     HRESULT Next(
  343.         [in] ULONG cMediaTypes,             // place this many types...
  344.         [out, size_is(cMediaTypes)]
  345.              AM_MEDIA_TYPE ** ppMediaTypes, // ...in this array
  346.         [out] ULONG * pcFetched             // actual count passed
  347.     );
  348.  
  349.     HRESULT Skip(
  350.         [in] ULONG cMediaTypes);
  351.  
  352.     HRESULT Reset(void);
  353.  
  354.     HRESULT Clone(
  355.         [out] IEnumMediaTypes **ppEnum
  356.     );
  357. }
  358.  
  359. typedef IEnumMediaTypes *PENUMMEDIATYPES;
  360.  
  361.  
  362.  
  363. //========================================================================
  364. //========================================================================
  365. // Defines IFilterGraph interface
  366. //
  367. // abstraction representing a graph of filters
  368. // This allows filters to be joined into a graph and operated as a unit.
  369. //========================================================================
  370. //========================================================================
  371.  
  372. [
  373. object,
  374. uuid(56a8689f-0ad4-11ce-b03a-0020af0ba770),
  375. pointer_default(unique)
  376. ]
  377. interface IFilterGraph : IUnknown {
  378.  
  379.     //==========================================================================
  380.     // Low level filter functions
  381.     //==========================================================================
  382.  
  383.         // Add a filter to the graph and name it with *pName.
  384.         // If the name is not unique, The request will fail.
  385.         // The Filter graph will call the JoinFilterGraph
  386.         // member function of the filter to inform it.
  387.         // This must be called before attempting Connect, ConnectDirect or Render
  388.         // for pins of the filter.
  389.  
  390.         HRESULT AddFilter
  391.             ( [in] IBaseFilter * pFilter,
  392.               [in, string] LPCWSTR pName
  393.             );
  394.  
  395.  
  396.         // Remove a filter from the graph. The filter graph implementation
  397.         // will inform the filter that it is being removed.
  398.  
  399.         HRESULT RemoveFilter
  400.             ( [in] IBaseFilter * pFilter
  401.             );
  402.  
  403.  
  404.         // Set *ppEnum to be an enumerator for all filters in the graph.
  405.  
  406.         HRESULT EnumFilters
  407.             ( [out] IEnumFilters **ppEnum
  408.             );
  409.  
  410.  
  411.         // Set *ppFilter to be the filter which was added with the name *pName
  412.         // Will fail and set *ppFilter to NULL if the name is not in this graph.
  413.  
  414.         HRESULT FindFilterByName
  415.             ( [in, string] LPCWSTR pName,
  416.               [out] IBaseFilter ** ppFilter
  417.             );
  418.  
  419.     //==========================================================================
  420.     // Low level connection functions
  421.     //==========================================================================
  422.  
  423.         // Connect these two pins directly (i.e. without intervening filters)
  424.         // the media type is optional, and may be partially specified (that is
  425.         // the subtype and/or format type may be GUID_NULL). See IPin::Connect
  426.         // for details of the media type parameter.
  427.         HRESULT ConnectDirect
  428.             ( [in] IPin * ppinOut,              // the output pin
  429.               [in] IPin * ppinIn,               // the input pin
  430.               [in] const AM_MEDIA_TYPE* pmt     // optional mediatype
  431.             );
  432.  
  433.         // Break the connection that this pin has and reconnect it to the
  434.         // same other pin.
  435.  
  436.         HRESULT Reconnect
  437.             ( [in] IPin * ppin        // the pin to disconnect and reconnect
  438.             );
  439.  
  440.  
  441.  
  442.         // Disconnect this pin, if connected.  Successful no-op if not connected.
  443.  
  444.         HRESULT Disconnect
  445.             ( [in] IPin * ppin
  446.             );
  447.  
  448.     //==========================================================================
  449.     // intelligent connectivity - now in IGraphBuilder, axextend.idl
  450.     //==========================================================================
  451.  
  452.     //==========================================================================
  453.     // Whole graph functions
  454.     //==========================================================================
  455.  
  456.     // Once a graph is built, it can behave as a (composite) filter.
  457.     // To control this filter, QueryInterface for IMediaFilter.
  458.  
  459.     // The filtergraph will by default ensure that the graph has a sync source
  460.     // when it is made to Run.  SetSyncSource(NULL) will prevent that and allow
  461.     // all the filters to run unsynchronised until further notice.
  462.     // SetDefaultSyncSource will set the default sync source (the same as would
  463.     // have been set by default on the first call to Run).
  464.     HRESULT SetDefaultSyncSource(void);
  465.  
  466. }
  467.  
  468. typedef IFilterGraph *PFILTERGRAPH;
  469.  
  470.  
  471.  
  472. //==========================================================================
  473. //==========================================================================
  474. // Defines IEnumFilters interface
  475. //
  476. // enumerator interface returned from IFilterGraph::EnumFilters().
  477. // based on IEnum pseudo-template
  478. //==========================================================================
  479. //==========================================================================
  480.  
  481. [
  482. object,
  483. uuid(56a86893-0ad4-11ce-b03a-0020af0ba770),
  484. pointer_default(unique)
  485. ]
  486. interface IEnumFilters : IUnknown {
  487.  
  488.     HRESULT Next
  489.         ( [in]  ULONG cFilters,           // place this many filters...
  490.           [out] IBaseFilter ** ppFilter,  // ...in this array of IBaseFilter*
  491.           [out] ULONG * pcFetched         // actual count passed returned here
  492.         );
  493.  
  494.  
  495.     HRESULT Skip
  496.         ( [in] ULONG cFilters
  497.         );
  498.  
  499.  
  500.     HRESULT Reset(void);
  501.  
  502.  
  503.     HRESULT Clone
  504.         ( [out] IEnumFilters **ppEnum
  505.         );
  506. }
  507.  
  508. typedef IEnumFilters *PENUMFILTERS;
  509.  
  510.  
  511. //=====================================================================
  512. //=====================================================================
  513. // Defines IMediaFilter interface
  514. //
  515. // multimedia components that provide time-based data will expose this.
  516. // this interface abstracts an object that processes time-based data streams
  517. // and represents a multimedia device (possibly implemented in software).
  518. // it controls the active/running state of the object and its synchronization
  519. // to other objects in the system.
  520. //
  521. // derived from IPersist so that all filter-type objects in a graph
  522. // can have their class id serialised.
  523. //=====================================================================
  524. //=====================================================================
  525.  
  526. [
  527. object,
  528. uuid(56a86899-0ad4-11ce-b03a-0020af0ba770),
  529. pointer_default(unique)
  530. ]
  531. interface IMediaFilter : IPersist {
  532.  
  533.     // tell the filter to transition to the new state. The state transition
  534.     // may not be instantaneous (external mechanical activity may be involved,
  535.     // for example). The state functions may return before the state
  536.     // transition has completed
  537.  
  538.     // these functions will return S_OK if the transition is complete, S_FALSE if
  539.     // the transition is not complete but no error has occurred, or some error value
  540.     // if the transition failed.
  541.     HRESULT Stop(void);
  542.     HRESULT Pause(void);
  543.  
  544.     // in order to synchronise independent streams, you must pass a time
  545.     // value with the Run command. This is the difference between stream
  546.     // time and reference time. That is, it is the amount to be added to
  547.     // the IMediaSample timestamp to get the time at which that sample
  548.     // should be rendered according to the reference clock.
  549.     // If we are starting at the beginning of the stream, it will thus be
  550.     // simply the time at which the first sample should appear. If we are
  551.     // restarting from Paused mode in midstream, then it will be the total
  552.     // time we have been paused added to the initial start time.
  553.  
  554.     // the filtergraph will provide this information to its filters. If you
  555.     // are an app calling the filtergraph, it's ok to pass a start time of
  556.     // 0, in which case the filter graph will calculate a soon-as-possible
  557.     // time. FilterGraphs will accept 0 meaning ASAP; most filters will not.
  558.  
  559.     // !!! is this a reason why the filter graph should expose something
  560.     // !!!not quite the same as IMediaFilter?
  561.  
  562.     HRESULT Run(REFERENCE_TIME tStart);
  563.  
  564.  
  565.     // possible states that the filter could be in
  566.     typedef enum _FilterState {
  567.         State_Stopped,            // not in use
  568.         State_Paused,             // holding resources, ready to go
  569.         State_Running            // actively processing media stream
  570.     } FILTER_STATE;
  571.  
  572.     // find out what state the filter is in.
  573.     // If timeout is 0, will return immediately - if a state transition is
  574.     // not complete, it will return the state being transitioned into, and
  575.     // the return code will be VFW_S_STATE_INTERMEDIATE.  if no state
  576.     // transition is in progress the state will be returned and the return
  577.     // code will be S_OK.
  578.     //
  579.     // If timeout is non-zero, GetState will not return until the state
  580.     // transition is complete, or the timeout expires.
  581.     // The timeout is in milliseconds.
  582.     // You can also pass in INFINITE as a special value for the timeout, in
  583.     // which case it will block indefinitely waiting for the state transition
  584.     // to complete. If the timeout expires, the state returned is the
  585.     // state we are trying to reach, and the return code will be
  586.     // VFW_S_STATE_INTERMEDIATE. If no state transition is in progress
  587.     // the routine returns immediately with return code S_OK.
  588.  
  589.     //
  590.     // return State is State_Running, State_Paused or State_Stopped.
  591.     // return code is S_OK, or VFW_S_STATE_INTERMEDIATE if state
  592.     // transition is not complete or an error value if the method failed.
  593.     HRESULT GetState(
  594.                 [in] DWORD dwMilliSecsTimeout,
  595.                 [out] FILTER_STATE *State);
  596.  
  597.  
  598.     // tell the filter the reference clock to which it should synchronize
  599.     // activity. This is most important to rendering filters and may not
  600.     // be of any interest to other filters.
  601.     HRESULT SetSyncSource(
  602.         [in] IReferenceClock * pClock);
  603.  
  604.     // get the reference clock currently in use (it may be NULL)
  605.     HRESULT GetSyncSource(
  606.         [out] IReferenceClock ** pClock);
  607. }
  608.  
  609. typedef IMediaFilter *PMEDIAFILTER;
  610.  
  611.  
  612. //=====================================================================
  613. //=====================================================================
  614. // Defines IBaseFilter interface
  615. //
  616. // all multimedia components will expose this interface
  617. // this interface abstracts an object that has typed input and output
  618. // connections and can be dynamically aggregated.
  619. //
  620. // IMediaFilter supports synchronisation and activity state: IBaseFilter
  621. // is derived from that since all filters need to support IMediaFilter,
  622. // whereas a few objects (plug-in control distributors for example) will
  623. // support IMediaFilter but not IBaseFilter.
  624. //
  625. // IMediaFilter is itself derived from IPersist so that every filter
  626. //supports GetClassID()
  627. //=====================================================================
  628. //=====================================================================
  629.  
  630. [
  631. object,
  632. uuid(56a86895-0ad4-11ce-b03a-0020af0ba770),
  633. pointer_default(unique)
  634. ]
  635. interface IBaseFilter : IMediaFilter {
  636.  
  637.     // enumerate all the pins available on this filter
  638.     // allows enumeration of all pins only.
  639.     //
  640.     HRESULT EnumPins(
  641.         [out] IEnumPins ** ppEnum     // enum interface returned here
  642.     );
  643.  
  644.     // Convert the external identifier of a pin to an IPin *
  645.     // This pin id is quite different from the pin Name in CreatePin.
  646.     // In CreatePin the Name is invented by the caller.  In FindPin the Id
  647.     // must have come from a previous call to IPin::QueryId.  Whether or not
  648.     // this operation would cause a pin to be created depends on the filter
  649.     // design, but if called twice with the same id it should certainly
  650.     // return the same pin both times.
  651.     HRESULT FindPin(
  652.         [in, string] LPCWSTR Id,
  653.         [out] IPin ** ppPin
  654.     );
  655.  
  656.     // find out information about this filter
  657.     typedef struct _FilterInfo {
  658.     WCHAR achName[MAX_FILTER_NAME]; // maybe null if not part of graph
  659.         IFilterGraph * pGraph;                      // null if not part of graph
  660.     } FILTER_INFO;
  661.  
  662.     HRESULT QueryFilterInfo(
  663.         [out] FILTER_INFO * pInfo
  664.     );
  665.  
  666.     // notify a filter that it has joined a filter graph. It is permitted to
  667.     // refuse. The filter should addref and store this interface for later use
  668.     // since it may need to notify events to this interface. A null pointer indicates
  669.     // that the filter is no longer part of a graph.
  670.     HRESULT JoinFilterGraph(
  671.         [in] IFilterGraph * pGraph,
  672.         [in, string] LPCWSTR pName
  673.     );
  674.  
  675.     // return a Vendor information string. Optional - may return E_NOTIMPL.
  676.     // memory returned should be freed using CoTaskMemFree
  677.     HRESULT QueryVendorInfo(
  678.         [out, string] LPWSTR* pVendorInfo
  679.     );
  680. }
  681.  
  682. typedef IBaseFilter *PFILTER;
  683.  
  684.  
  685. //=====================================================================
  686. //=====================================================================
  687. // sync and state management
  688. //=====================================================================
  689. //=====================================================================
  690.  
  691.  
  692. //=====================================================================
  693. //=====================================================================
  694. // Defines IReferenceClock interface
  695. //=====================================================================
  696. //=====================================================================
  697.  
  698. [
  699.         object,
  700.         uuid(56a86897-0ad4-11ce-b03a-0020af0ba770),
  701.         pointer_default(unique)
  702. ]
  703. interface IReferenceClock : IUnknown {
  704.  
  705.     // get the time now
  706.     HRESULT GetTime(
  707.         [out] REFERENCE_TIME *pTime
  708.     );
  709.  
  710.     // ask for an async notification that a time has elapsed
  711.     HRESULT AdviseTime(
  712.         [in] REFERENCE_TIME baseTime,        // base reference time
  713.         [in] REFERENCE_TIME streamTime,        // stream offset time
  714.     [in] HEVENT hEvent,                 // advise via this event
  715.         [out] DWORD * pdwAdviseCookie       // where your cookie goes
  716.     );
  717.  
  718.     // ask for an async periodic notification that a time has elapsed
  719.     HRESULT AdvisePeriodic(
  720.         [in] REFERENCE_TIME startTime,        // starting at this time
  721.         [in] REFERENCE_TIME periodTime,      // time between notifications
  722.         [in] HSEMAPHORE hSemaphore,         // advise via a semaphore
  723.     [out] DWORD * pdwAdviseCookie        // where your cookie goes
  724.     );
  725.  
  726.     // cancel a request for notification
  727.     HRESULT Unadvise(
  728.         [in] DWORD dwAdviseCookie);
  729. }
  730.  
  731. typedef IReferenceClock *PREFERENCECLOCK;
  732.  
  733. //=====================================================================
  734. //=====================================================================
  735. // Defines IReferenceClock2 interface
  736. //=====================================================================
  737. //=====================================================================
  738.  
  739. [
  740.         object,
  741.         uuid(36b73885-c2c8-11cf-8b46-00805f6cef60),
  742.         pointer_default(unique)
  743. ]
  744. interface IReferenceClock2 : IReferenceClock {
  745. }
  746.  
  747. typedef IReferenceClock2 *PREFERENCECLOCK2;
  748.  
  749.  
  750. //=====================================================================
  751. //=====================================================================
  752. // Data transport interfaces
  753. //=====================================================================
  754. //=====================================================================
  755.  
  756.  
  757. //=====================================================================
  758. //=====================================================================
  759. // Defines IMediaSample interface
  760. //=====================================================================
  761. //=====================================================================
  762.  
  763. [
  764.         local,
  765.         object,
  766.         uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770),
  767.         pointer_default(unique)
  768. ]
  769. interface IMediaSample : IUnknown {
  770.  
  771.     // get me a read/write pointer to this buffer's memory. I will actually
  772.     // want to use sizeUsed bytes.
  773.     HRESULT GetPointer([out] BYTE ** ppBuffer);
  774.  
  775.     // return the size in bytes of the buffer data area
  776.     long GetSize(void);
  777.  
  778.     // get the stream time at which this sample should start and finish.
  779.     HRESULT GetTime(
  780.         [out] REFERENCE_TIME * pTimeStart,    // put time here
  781.     [out] REFERENCE_TIME * pTimeEnd
  782.     );
  783.  
  784.     // Set the stream time at which this sample should start and finish.
  785.     // pTimeStart==pTimeEnd==NULL will invalidate the time stamps in
  786.     // this sample
  787.     HRESULT SetTime(
  788.         [in] REFERENCE_TIME * pTimeStart,    // put time here
  789.     [in] REFERENCE_TIME * pTimeEnd
  790.     );
  791.  
  792.     // sync-point property. If true, then the beginning of this
  793.     // sample is a sync-point. (note that if AM_MEDIA_TYPE.bTemporalCompression
  794.     // is false then all samples are sync points). A filter can start
  795.     // a stream at any sync point.  S_FALSE if not sync-point, S_OK if true.
  796.  
  797.     HRESULT IsSyncPoint(void);
  798.     HRESULT SetSyncPoint(BOOL bIsSyncPoint);
  799.  
  800.     // preroll property.  If true, this sample is for preroll only and
  801.     // shouldn't be displayed.
  802.     HRESULT IsPreroll(void);
  803.     HRESULT SetPreroll(BOOL bIsPreroll);
  804.  
  805.     long GetActualDataLength(void);
  806.     HRESULT SetActualDataLength(long);
  807.  
  808.     // these allow for limited format changes in band - if no format change
  809.     // has been made when you receive a sample GetMediaType will return S_FALSE
  810.  
  811.     HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
  812.     HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
  813.  
  814.     // returns S_OK if there is a discontinuity in the data (this frame is
  815.     // not a continuation of the previous stream of data
  816.     // - there has been a seek or some dropped samples).
  817.     HRESULT IsDiscontinuity(void);
  818.     // set the discontinuity property - TRUE if this sample is not a
  819.     // continuation, but a new sample after a seek or a dropped sample.
  820.     HRESULT SetDiscontinuity(BOOL bDiscontinuity);
  821.  
  822.     // get the media times for this sample
  823.     HRESULT GetMediaTime(
  824.         [out] LONGLONG * pTimeStart,
  825.     [out] LONGLONG * pTimeEnd
  826.     );
  827.  
  828.     // Set the media times for this sample
  829.     // pTimeStart==pTimeEnd==NULL will invalidate the media time stamps in
  830.     // this sample
  831.     HRESULT SetMediaTime(
  832.         [in] LONGLONG * pTimeStart,
  833.     [in] LONGLONG * pTimeEnd
  834.     );
  835. }
  836.  
  837. typedef IMediaSample *PMEDIASAMPLE;
  838.  
  839. //  Values for dwFlags for AM_SAMPLE_PROPERTIES
  840. enum tagAM_SAMPLE_PROPERTY_FLAGS
  841.      { AM_SAMPLE_SPLICEPOINT        = 0x01,   /* Is this a splice point
  842.                                                  IE can it be decoded
  843.                                                  without reference to
  844.                                                  previous data */
  845.        AM_SAMPLE_PREROLL            = 0x02,   /* Is this a preroll sample */
  846.        AM_SAMPLE_DATADISCONTINUITY  = 0x04,   /* Set if start of new segment */
  847.        AM_SAMPLE_TYPECHANGED        = 0x08,   /* Has the type changed */
  848.        AM_SAMPLE_TIMEVALID          = 0x10,   /* Set if time is valid */
  849.        AM_SAMPLE_TIMEDISCONTINUITY  = 0x40,   /* time gap in data starts after
  850.                                                  this sample - pbBuffer can
  851.                                                  be NULL
  852.                                               */
  853.        AM_SAMPLE_FLUSH_ON_PAUSE     = 0x80,   /*  For live data - discard
  854.                                                   in paused state
  855.                                               */
  856.        AM_SAMPLE_STOPVALID          = 0x100,  /*  Stop time is valid */
  857.        AM_SAMPLE_ENDOFSTREAM        = 0x200,  /*  End of stream after
  858.                                                   this data
  859.                                                   This is reserved for
  860.                                                   kernel streaming and is
  861.                                                   not currently used by
  862.                                                   ActiveMovie
  863.                                               */
  864.        AM_STREAM_MEDIA              = 0,      /*  Normal data stream id */
  865.        AM_STREAM_CONTROL            = 1       /*  Control stream id */
  866.                                               /*  > 7FFFFFFF is application
  867.                                                   defined stream
  868.                                               */
  869.      };
  870.  
  871. //  Media sample generic properties structure
  872. typedef struct tagAM_SAMPLE2_PROPERTIES {
  873.     DWORD    cbData;         //  Length of generic data for extensiblity
  874.                              //  Number of bytes INCLUDING this field
  875.     DWORD    dwTypeSpecificFlags; // Type specific flag data
  876.     DWORD    dwSampleFlags;  //  Flags bits defined by  AM_SAMPLE_xxx flags
  877.                              //  All undefined bits RESERVED (set to 0,
  878.                              //  leave on copy)
  879.     LONG     lActual;        //  Length of data in buffer
  880.     REFERENCE_TIME tStart;   //  Start time if valid
  881.     REFERENCE_TIME tStop;    //  Stop time if valid
  882.     DWORD    dwStreamId;     //  Stream 0 is normal media transport
  883.                              //  Stream 1 is control
  884.     AM_MEDIA_TYPE *pMediaType; // Copy of media type - INVALID after Release()
  885.     BYTE    *pbBuffer;       //  Pointer to buffer - INVALID after Release()
  886.     LONG     cbBuffer;       //  Length of buffer
  887. } AM_SAMPLE2_PROPERTIES;
  888.  
  889. //=====================================================================
  890. //=====================================================================
  891. // Defines IMediaSample2 interface
  892. //=====================================================================
  893. //=====================================================================
  894.  
  895. [
  896.         local,
  897.         object,
  898.         uuid(36b73884-c2c8-11cf-8b46-00805f6cef60),
  899.         pointer_default(unique)
  900. ]
  901. interface IMediaSample2 : IMediaSample {
  902.  
  903.     //  Get sample properties
  904.     //
  905.     //      cbProperties - length of generic data to retrieve
  906.     //      pbProperties - pointer to generic data buffer - can
  907.     //                     be NULL if cbProperties is NULL
  908.     //                     data conforms to AM_SAMPLE_PROPERTIES
  909.     //
  910.     HRESULT GetProperties(
  911.         [in] DWORD cbProperties,
  912.         [out, size_is(cbProperties)] BYTE * pbProperties
  913.     );
  914.     //  Set sample properties
  915.     //
  916.     //      cbProperties - length of generic data to set
  917.     //      pbProperties - pointer to generic data buffer - can
  918.     //                      be NULL if cbProperties is NULL
  919.     //                      data conforms to AM_SAMPLE_PROPERTIES
  920.     //
  921.     //
  922.     HRESULT SetProperties(
  923.         [in] DWORD cbProperties,
  924.         [in, size_is(cbProperties)] const BYTE * pbProperties
  925.     );
  926.  
  927.  
  928.     // //  Get the clock associated with the sample
  929.     // HRESULT GetClock(
  930.     //     [out] IReferenceClock2 **ppClock
  931.     // );
  932.  
  933.     // //  Get a pointer to the object containing the data
  934.     // //
  935.     // //  riid      - IID of interface required on object
  936.     // //  ppvobject - Pointer to object containing the data
  937.     // //
  938.     // //  Returns
  939.     // //      S_OK - Got the object
  940.     // //      E_NOINTERFACE - object does not support this interface
  941.     // //                      if IUnknown is not supported
  942.     // //                      there is no backing object
  943.     // //      E_NOTIMPL     - samples don't have backing objects
  944.     // //
  945.     // //
  946.     // HRESULT GetBackingObject(
  947.     //     [in]  REFIID riid,
  948.     //     [out] void **ppvObject
  949.     // );
  950. }
  951.  
  952. typedef IMediaSample2 *PMEDIASAMPLE2;
  953.  
  954.  
  955. // flags for dwFlags in IMemAllocator::GetBuffer
  956. // AM_GBF_PREVFRAMESKIPPED is only significant when asking for a buffer from the
  957. // video renderer.  It should be TRUE if and only if the previous frame
  958. // was skipped.  It affects quality management.
  959. // AM_GBF_NOTASYNCPOINT indicates to the downstream filter (most likely the
  960. // video renderer) that you are not going to fill this buffer with a sync point
  961. // (keyframe) so now would be a bad time to return a buffer with a dynamic
  962. // format change, because you will be unable to switch to the new format without
  963. // waiting for the next sync point, causing some frames to be dropped.
  964. #define AM_GBF_PREVFRAMESKIPPED    1
  965. #define AM_GBF_NOTASYNCPOINT    2
  966. cpp_quote("#define AM_GBF_PREVFRAMESKIPPED 1")
  967. cpp_quote("#define AM_GBF_NOTASYNCPOINT 2")
  968.  
  969. // This may not be supported by allocators
  970. cpp_quote("#define AM_GBF_NOWAIT 4")
  971.  
  972. //=====================================================================
  973. //=====================================================================
  974. // Defines IMemAllocator interface
  975. //
  976. // an allocator of IMediaSample blocks to be used for data transfer between
  977. // pins. Can be provided by input, output or a third party. Release
  978. // the IMediaSample object obtained back to the pool by calling
  979. // IMediaSample::Release.
  980. //=====================================================================
  981. //=====================================================================
  982.  
  983. [
  984.         object,
  985.         uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770),
  986.         pointer_default(unique)
  987. ]
  988. interface IMemAllocator : IUnknown {
  989.  
  990.     // negotiate buffer sizes, buffer count and alignment. pRequest is filled
  991.     // in by the caller with the requested values. pActual will be returned
  992.     // by the allocator with the closest that the allocator can come to this.
  993.     // Cannot be called unless the allocator is decommitted.
  994.     // Calls to GetBuffer need not succeed until Commit is called.
  995.     HRESULT SetProperties(
  996.         [in] ALLOCATOR_PROPERTIES* pRequest,
  997.         [out] ALLOCATOR_PROPERTIES* pActual);
  998.  
  999.     // return the properties actually being used on this allocator
  1000.     HRESULT GetProperties(
  1001.         [out] ALLOCATOR_PROPERTIES* pProps);
  1002.  
  1003.  
  1004.     // commit the memory for the agreed buffers
  1005.     HRESULT Commit(void);
  1006.  
  1007.     // release the memory for the agreed buffers. Any threads waiting in
  1008.     // GetBuffer will return with an error. GetBuffer calls will always fail
  1009.     // if called before Commit or after Decommit.
  1010.     HRESULT Decommit(void);
  1011.  
  1012.     // get container for a sample. Blocking, synchronous call to get the
  1013.     // next free buffer (as represented by an IMediaSample interface).
  1014.     // on return, the time etc properties will be invalid, but the buffer
  1015.     // pointer and size will be correct.
  1016.     // Will only succeed if memory is committed. If GetBuffer is blocked
  1017.     // waiting for a buffer and Decommit is called on another thread,
  1018.     // GetBuffer will return with an error.
  1019.     HRESULT GetBuffer(
  1020.         [out] IMediaSample **ppBuffer,
  1021.         [in] REFERENCE_TIME * pStartTime,
  1022.         [in] REFERENCE_TIME * pEndTime,
  1023.         [in] DWORD dwFlags
  1024.     );
  1025.  
  1026.     // put a buffer back on the allocators free list.
  1027.     // this is typically called by the Release() method of the media
  1028.     // sample when the reference count goes to 0
  1029.     //
  1030.     HRESULT ReleaseBuffer(
  1031.         [in] IMediaSample *pBuffer
  1032.     );
  1033. }
  1034.  
  1035. typedef IMemAllocator *PMEMALLOCATOR;
  1036.  
  1037.  
  1038. //=====================================================================
  1039. //=====================================================================
  1040. // Defines IMemInputPin interface
  1041. //
  1042. // basic shared memory transport interface.
  1043. //=====================================================================
  1044. //=====================================================================
  1045.  
  1046. [
  1047.         object,
  1048.         uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770),
  1049.         pointer_default(unique)
  1050. ]
  1051. interface IMemInputPin : IUnknown {
  1052.  
  1053.     // return the allocator interface that this input pin
  1054.     // would like the output pin to use
  1055.     HRESULT GetAllocator(
  1056.                 [out] IMemAllocator ** ppAllocator);
  1057.  
  1058.     // tell the input pin which allocator the output pin is actually
  1059.     // going to use.
  1060.     // If the readonly flag is set, then all samples from this allocator are
  1061.     // to be treated as read-only, and should be copied before being modified.
  1062.     HRESULT NotifyAllocator(
  1063.                 [in] IMemAllocator * pAllocator,
  1064.                 [in] BOOL bReadOnly
  1065.                 );
  1066.  
  1067.     // this method is optional (can return E_NOTIMPL). Output pins are not obliged to call
  1068.     // this method, nor are they obliged to fulfil the request. Input pins making such a
  1069.     // request should check the allocator in NotifyAllocator to see if it meets their needs. If
  1070.     // not, the input pin is responsible for any necessary data copy.
  1071.     // Zero values will be treated as don't care: so a pin can return an alignment value
  1072.     // and leave the other values 0.
  1073.     HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps);
  1074.  
  1075.     // here's the next block of data from the stream. AddRef it if
  1076.     // you need to hold it beyond the end of the Receive call.
  1077.     // call pSample->Release when done with it.
  1078.     //
  1079.     // This is a blocking synchronous call.  Usually no blocking
  1080.     // will occur but if a filter cannot process the sample immediately
  1081.     // it may use the caller's thread to wait until it can.
  1082.     HRESULT Receive(
  1083.                 [in] IMediaSample * pSample);
  1084.     // Same as Receive but with multiple samples.  Useful for
  1085.     // fragmented streams
  1086.     HRESULT ReceiveMultiple(
  1087.                 [in, size_is(nSamples)] IMediaSample **pSamples,
  1088.                 [in] long nSamples,
  1089.                 [out] long *nSamplesProcessed);
  1090.  
  1091.     // See if Receive might block
  1092.     // Returns S_OK if it can block, S_FALSE if it can't or some
  1093.     // failure code (assume it can in this case)
  1094.     HRESULT ReceiveCanBlock();
  1095. }
  1096.  
  1097. typedef IMemInputPin *PMEMINPUTPIN;
  1098.  
  1099.  
  1100. //=====================================================================
  1101. //=====================================================================
  1102. // Defines IAMovieSetup interface
  1103. //
  1104. // exported by filter to allow it to be self-registering
  1105. //=====================================================================
  1106. //=====================================================================
  1107.  
  1108. [
  1109. object,
  1110. uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20),
  1111. pointer_default(unique)
  1112. ]
  1113. interface IAMovieSetup : IUnknown {
  1114.  
  1115.     // methods to register and unregister
  1116.     // filter, etc.
  1117.  
  1118.     HRESULT Register( );
  1119.     HRESULT Unregister( );
  1120. }
  1121.  
  1122. typedef IAMovieSetup *PAMOVIESETUP;
  1123.  
  1124.  
  1125. //=====================================================================
  1126. //=====================================================================
  1127. // Defines IMediaSeeking interface
  1128. //
  1129. // Controls seeking (time, bytes, frames, fields and samples)
  1130. //=====================================================================
  1131. //=====================================================================
  1132.  
  1133. typedef enum AM_SEEKING_SeekingFlags
  1134. {
  1135.     AM_SEEKING_NoPositioning        = 0x00,     // No change
  1136.     AM_SEEKING_AbsolutePositioning    = 0x01,        // Position is supplied and is absolute
  1137.     AM_SEEKING_RelativePositioning    = 0x02,        // Position is supplied and is relative
  1138.     AM_SEEKING_IncrementalPositioning    = 0x03,        // (Stop) position relative to current
  1139.                             // Useful for seeking when paused (use +1)
  1140.     AM_SEEKING_PositioningBitsMask    = 0x03,     // Useful mask
  1141.     AM_SEEKING_SeekToKeyFrame        = 0x04,        // Just seek to key frame (performance gain)
  1142.     AM_SEEKING_ReturnTime        = 0x08,        // Plug the media time equivalents back into the supplied LONGLONGs
  1143.  
  1144.     AM_SEEKING_Segment                  = 0x10,     // At end just do EC_ENDOFSEGMENT,
  1145.                                                     // don't do EndOfStream
  1146.     AM_SEEKING_NoFlush                  = 0x20      // Don't flush
  1147. } AM_SEEKING_SEEKING_FLAGS;
  1148.  
  1149. typedef enum AM_SEEKING_SeekingCapabilities
  1150. {
  1151.     AM_SEEKING_CanSeekAbsolute     = 0x001,
  1152.     AM_SEEKING_CanSeekForwards     = 0x002,
  1153.     AM_SEEKING_CanSeekBackwards    = 0x004,
  1154.     AM_SEEKING_CanGetCurrentPos    = 0x008,
  1155.     AM_SEEKING_CanGetStopPos       = 0x010,
  1156.     AM_SEEKING_CanGetDuration      = 0x020,
  1157.     AM_SEEKING_CanPlayBackwards    = 0x040,
  1158.     AM_SEEKING_CanDoSegments       = 0x080,
  1159.     AM_SEEKING_Source              = 0x100  // Doesn't pass thru used to
  1160.                                             // count segment ends
  1161. } AM_SEEKING_SEEKING_CAPABILITIES;
  1162.  
  1163. [
  1164.         object,
  1165.         uuid(36b73880-c2c8-11cf-8b46-00805f6cef60),
  1166.         pointer_default(unique)
  1167. ]
  1168. interface IMediaSeeking : IUnknown {
  1169.  
  1170.     // Returns the capability flags
  1171.     HRESULT GetCapabilities( [out] DWORD * pCapabilities );
  1172.  
  1173.     // And's the capabilities flag with the capabilities requested.
  1174.     // Returns S_OK if all are present, S_FALSE if some are present, E_FAIL if none.
  1175.     // *pCababilities is always updated with the result of the 'and'ing and can be
  1176.     // checked in the case of an S_FALSE return code.
  1177.     HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities );
  1178.  
  1179.     // returns S_OK if mode is supported, S_FALSE otherwise
  1180.     HRESULT IsFormatSupported([in] const GUID * pFormat);
  1181.     HRESULT QueryPreferredFormat([out] GUID * pFormat);
  1182.  
  1183.     HRESULT GetTimeFormat([out] GUID *pFormat);
  1184.     // Returns S_OK if *pFormat is the current time format, otherwise S_FALSE
  1185.     // This may be used instead of the above and will save the copying of the GUID
  1186.     HRESULT IsUsingTimeFormat([in] const GUID * pFormat);
  1187.  
  1188.     // (may return VFE_E_WRONG_STATE if graph is stopped)
  1189.     HRESULT SetTimeFormat([in] const GUID * pFormat);
  1190.  
  1191.     // return current properties
  1192.     HRESULT GetDuration([out] LONGLONG *pDuration);
  1193.     HRESULT GetStopPosition([out] LONGLONG *pStop);
  1194.     HRESULT GetCurrentPosition([out] LONGLONG *pCurrent);
  1195.  
  1196.     // Convert time from one format to another.
  1197.     // We must be able to convert between all of the formats that we say we support.
  1198.     // (However, we can use intermediate formats (e.g. MEDIA_TIME).)
  1199.     // If a pointer to a format is null, it implies the currently selected format.
  1200.     HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat,
  1201.                               [in]  LONGLONG    Source, [in] const GUID * pSourceFormat );
  1202.  
  1203.  
  1204.     // Set current and end positions in one operation
  1205.     // Either pointer may be null, implying no change
  1206.     HRESULT SetPositions( [in,out] LONGLONG * pCurrent, [in] DWORD dwCurrentFlags
  1207.             , [in,out] LONGLONG * pStop, [in] DWORD dwStopFlags );
  1208.  
  1209.     // Get CurrentPosition & StopTime
  1210.     // Either pointer may be null, implying not interested
  1211.     HRESULT GetPositions( [out] LONGLONG * pCurrent,
  1212.                           [out] LONGLONG * pStop );
  1213.  
  1214.     // Get earliest / latest times to which we can currently seek "efficiently".
  1215.     // This method is intended to help with graphs where the source filter has
  1216.     // a very high latency.  Seeking within the returned limits should just
  1217.     // result in a re-pushing of already cached data.  Seeking beyond these
  1218.     // limits may result in extended delays while the data is fetched (e.g.
  1219.     // across a slow network).
  1220.     // (NULL pointer is OK, means caller isn't interested.)
  1221.     HRESULT GetAvailable( [out] LONGLONG * pEarliest, [out] LONGLONG * pLatest );
  1222.  
  1223.     // Rate stuff
  1224.     HRESULT SetRate([in]  double dRate);
  1225.     HRESULT GetRate([out] double * pdRate);
  1226.  
  1227.     // Preroll
  1228.     HRESULT GetPreroll([out] LONGLONG * pllPreroll);
  1229. }
  1230.  
  1231. typedef IMediaSeeking *PMEDIASEEKING;
  1232.  
  1233. //  Flags for IMediaEventEx
  1234. cpp_quote("enum tagAM_MEDIAEVENT_FLAGS")
  1235. cpp_quote("{")
  1236. cpp_quote("    AM_MEDIAEVENT_NONOTIFY = 0x01")
  1237. cpp_quote("};")
  1238.