`
`Page 1 of8
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CPersistStream Class
`
`CPersistStream
`
`CPersistStream is the base class for persistent properties of filters (that is, filter properties in
`saved graphs).
`
`The simplest way to use CPersistStream iS to:
`
`1. Arrange for your filter to inherit this class.
`2. Implement WriteToStream and ReadfromStream in your class. These wm override the
`functions here, which do nothing but act as placeholders.
`3. Change your NonDelegatingQ1.1eryinterface to handle IPersistStream.
`4. Implement Si:zeMax to return an upper bound on the number of bytes of data you save.
`
`If you save Unicode data, rememberthat a WCHAR is 2 bytes.
`
`S. When your data changes, call SetDirty.
`
`Version N1.1mbers
`
`At some point you might decide to alter or extend the format of your data. You will then wish
`you had a version number in all the old saved streams so you can tell, when you read them,
`whether they represent the old or new form. To assist you, this class writes and reads a
`version number. When it writes, it calls GetSoft:wareVersion to inquire as to the version of the
`software being used at the moment. (ln effect, this is a version number of the data layout in
`the file.) It writes this as the first thing in the data. If you want to change the version,
`implement (override) GetSoftwareVersion. It reads the version number from the file into
`mPS dwfi!eVersion before calling ReadfromStream, so in ReadFl'QmStream you can check
`mPS_dWFileVersion to see if you are reading an old version file. Usually you should accept
`files whose version is no newer than the software version that is reading them.
`
`Protected Data Members
`Name
`Description
`mPS_dWFileVersion Version number of the file.
`mPS_fDirty
`Data for this stream must be saved.
`
`Member F1.1nctions
`Name
`Description
`CPersistStream Constructs a CPersistStream object.
`SetDirty
`Indicates that the object must be saved to the stream.
`
`1636
`
`
`
`CPersistStream Class
`
`Page 2of8
`
`Overridable Member Functions
`Name
`Description
`GetClassID
`Returns the class identifier of this stream.
`GetSoftwareVersion Returns the version number for this file format.
`ReadFromStream Reads the filter's data from the stream.
`SizeMax
`Returns the number of bytes needed for data (not including version
`number).
`Writes the filter's data to the stream.
`
`WriteToStream
`
`CPersistStream implements IPersistStream. For more implementation information, see the
`COM Reference in the Microsoft Platform SDK.
`
`Implemented IPersistStream Methods
`Name
`Description
`GetSizeMax Returns the number of bytes needed for data (including version number).
`IsDirty
`Checks if the object must be saved.
`Loads the data from the stream into memory.
`Load
`Saves the data from memory to the stream.
`Save
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M MB.HS
`
`Topic Contents
`
`i@fa111¥M
`
`8 4'41[.]1!,M 1!1·H¥
`
`Topic Contents
`
`i@fai11¥M
`
`CPersistStrea m: :CPersistStrea m
`
`CPersistStream Class
`
`Constructs a CPersistStream object.
`
`CPersistStream (
`!Unknown *pUnk,
`HRESULT *phr
`);
`
`Parameters
`
`pUnk
`
`phr
`
`IUnknown interface of the delegating object.
`
`Pointer to the general COM return value. Note that this value is changed only if this
`function fails.
`
`1637
`
`
`
`CPersistStream Class
`
`Page 3of8
`
`Return Values
`
`No return value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQij[.jlj,M l!i.! 111j
`
`Topic Contents
`
`lml!Jl l!lltiM
`
`CPersistStrea m: :GetClassI D
`
`CPersistStream Class
`
`Retrieves the class identifier for this filter.
`
`HRESULT GetClassID(
`CLSID *pC/sID
`);
`
`Parameters
`
`pC/sID
`Pointer to a CLSID structure. Copy your class ID to here.
`
`Return Values
`
`Returns an HRESULT value.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use .
`
`MQ<§i[.jlj,M 111.],.(j
`
`Topic Contents
`
`l!ftl!JlllMM
`
`CPersistStrea m: :GetSizeMax
`
`CPersistStream Class
`
`Returns the maximum byte size needed for the current stream, including the version number.
`
`HRESULT GetSizeMax(
`ULARGE_INTEGER * pcbSize
`);
`
`Parameters
`
`1638
`
`
`
`CPersistStream Class
`
`Page 4of8
`
`pcbSize
`Size in bytes needed to save this stream, including the version number.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IPersistStream: :GetSizeMax method.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jjj,M l!i.! 11ij Topic Contents
`
`l@i§lllMM
`
`CPersistStrea m: :GetSoftwa reversion
`
`CPersistStream Class
`
`Returns the software version for this stream.
`
`virtual DWORD GetSoftwareVersion(void);
`
`Return Values
`
`Returns a DWORD containing the version number. Each time the format of the stream is
`changed, this function should be altered to return a larger number than before.
`
`Remarks
`
`See Version Numbers for an explanation as to why file format version numbers are useful.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`MQl§i[.jjj,M 111.Hj Topic Contents •@!§' 1gnw
`
`CPersistStream::lsDirty
`
`CPersistStream Class
`
`Indicates whether the object has changed since it was last saved to its current stream.
`
`1639
`
`
`
`CPersistStream Class
`
`Page 5of8
`
`HRESULT IsDirty( );
`
`Return Values
`
`Returns S_OK if the filter needs saving and S_FALSE if it does not need saving.
`
`Remarks
`
`This member function implements the IPersistStream: :IsDirty method.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M 111.l:.!j
`
`Topic Contents
`
`l@i§i llfttiM
`
`CPersistStream::Load
`
`CPersistStream Class
`
`Loads the filter's data from a given stream.
`
`HRESULT Load(
`LPSTREAM pStm
`);
`
`Parameters
`
`pStm
`
`Pointer to the stream from which to be loaded.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IPersistStream: :Load method.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.! 111j Topic Contents
`
`l@i§lllMM
`
`CPersistStrea m:: ReadFromStrea m
`
`1640
`
`
`
`CPersistStream Class
`
`Page 6of8
`
`CPersistStream Class
`
`Reads the filter's data from the given stream.
`
`virtual HRESULT ReadFromStream(
`IStream *pStream
`);
`
`Parameters
`
`pStream
`Pointer to an !Stream interface from which data is to be read.
`
`Return Values
`
`Returns NOERROR by default; the overriding member function should return a valid HRESULT
`value.
`
`Remarks
`
`The default version reads nothing; it can be overridden to read data specific to your class.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M MB.HS
`
`Topic Contents
`
`i@faii!MM
`
`CPersistStream::Save
`
`CPersistStream Class
`
`Saves the filter's data to the given stream.
`
`HRESULT Save(
`LPSTREAM pStm,
`BOOL fC/earDirty
`);
`
`Parameters
`
`pStm
`
`Pointer to the stream to which data is to be saved.
`fC/earDirty
`Flag that indicates whether to reset the current stream's dirty flag. When called as part
`of Save, the flag is normally reset; when called as part of Save As, the flag is normally
`not reset.
`
`1641
`
`
`
`CPersistStream Class
`
`Page 7of8
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IPersistStream: :Save method. It calls Writelnt with the
`software version, calls CPersistStream: :WriteToStream with the stream in pStm, and resets
`mPS fDirty.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Q'41[.]i!,+ 1 !1·HM
`
`Topic Contents
`
`ifflj[§ii!¥M
`
`CPersistStream::SetDirty
`
`CPersistStream Class
`
`Changes the dirty flag for the current stream.
`
`HRESULT SetDirty(
`BOOL fDirty
`);
`
`Parameters
`
`fDirty
`New dirty flag for this stream. TRUE means that the data has not been saved.
`
`Return Values
`
`Returns an HRESULT value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jjj,M M!i.11119 Topic Contents i@i§iil¥M
`
`CPersistStrea m: :Size Max
`
`CPersistStream Class
`
`Retrieves the maximum byte size needed for the current stream, not including the version
`
`1642
`
`
`
`CPersistStream Class
`
`Page 8of8
`
`number.
`
`virtual int SizeMax( );
`
`Return Values
`
`Returns the number of bytes needed for data, not including the version number.
`
`Remarks
`
`The default version returns zero; it should be overridden to provide some other appropriate
`value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`•;1;1.111,; 111.1::11
`
`Topic Contents
`
`l@i§i 11111+
`
`CPersistStrea m: :WriteToStrea m
`
`CPersistStream Class
`
`Writes the filter's data to the given stream.
`
`virtual HRESULT WriteToStream(
`!Stream *pStream
`);
`
`Parameters
`
`pStream
`Pointer to an !Stream interface that specifies the filter data's destination stream.
`
`Return Values
`
`Returns NOERROR by default; the overriding member function should return a valid HRESULT
`value.
`
`Remarks
`
`The default version writes nothing; it can be overridden to write data specific to your class.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1643
`
`
`
`CPosPas sThru CI ass
`
`Page 1of26
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CPosPassThru Class
`
`CBaseObject
`
`INonDelegatingUnknown
`
`CUnknown
`
`!Dispatch
`
`CM ediaPosition
`
`CPosPassThru
`
`The CPosPassThru class is a utility class that handles the IMediaPosition and IMediaSeeking
`interfaces for single-input pin renderers and transform filters.
`
`IMediaPosition is the interface originally used for seeking in time-based media streams.
`IMediaSeeking is an interface intended to replace IMediaPositlon in filter graphs that require
`seeking to units other than time, such as samples or fields, or that require more precise time(cid:173)
`based seeking.
`
`Renderers wm use this class to implement IMediaPosition and IMediaSeeking from the filter;
`transform filters will use it to implement these two interfaces from the output pin. In both
`cases, the methods will be implemented by calls to the IMediaPosltlon or IMedlaSeeklng
`interface provided by the output pin of the connected upstream filter, effectively passing the
`position information through to the next filter.
`
`Create a class derived from CPosPassThru, giving it the lei.a. pointer to your input pin, and
`delegate all IMediaPosition and IMediaSeeking methods to it. The class wm find the output pin
`connected to the input pin, query thiS output pin for the IMedlaPosltlon or IMediaSeeklng
`interface, and respond appropriately.
`
`Protected Data Members
`Name Deso-lptlon
`m_Pin Pointer to the input pin of the filter.
`
`Member Functions
`Name
`Description
`CPosPas.sThri r Constructs a CPos?assTu n r object.
`FooceRetresh Releases any cached interfaces held on the upstream pin.
`
`1644
`
`
`
`CPosPassThru Class
`
`Page 2 of26
`
`Overridable Member Functions
`Name
`Description
`GetMediaTime Retrieves the starting and ending media times.
`
`CanSeekForward
`
`get Duration
`get PrerollTime
`
`Implemented IMediaPosition Methods
`Name
`Description
`Ca nSeekBackwa rd
`Determines if the current position can be moved backward in the media
`stream.
`Determines if the current position can be moved forward in the media
`stream.
`get CurrentPosition Retrieves the current position in terms of the total length of the media
`stream.
`Retrieves the total duration of the media stream.
`Retrieves the time before the start position that the filter graph will start
`any nonrandom access device rolling.
`get Rate
`Retrieves the playback rate, relative to normal playback of the media.
`Retrieves the position within the media at which playback should stop.
`get StooTime
`out CurrentPosition Sets the position within the media at which playback should start.
`Sets the time before the start position that the filter graph will start any
`out PrerollTime
`nonrandom access device rolling.
`Sets the playback rate, relative to normal playback of the media.
`Sets the position within the media at which playback should stop.
`
`out Rate
`out StooTime
`
`Implemented IMediaSeeking Methods
`Name
`Description
`CheckCaoabilities
`Determines which capabilities exist on a media stream by applying
`seeking capability flags and checking the returned value.
`Converts a time from one time format to another.
`ConvertTimeFormat
`Returns the range of times in which seeking is efficient.
`GetAvailable
`Retrieves the seeking capabilities of the media stream.
`GetCaoabilities
`Retrieves the current position within the media stream.
`GetCurrentPosition
`Retrieves the length of time that the media stream will play.
`GetDuration
`Get Positions
`Retrieves the current start and stop position settings.
`Retrieves the preroll settings.
`GetPreroll
`Retrieves the current rate.
`GetRate
`Retrieves the position at which the media stream stops.
`GetStooPosition
`GetTimeFormat
`Retrieves the current media time format.
`IsFormatSuooorted
`Determines if a specified time format is supported.
`IsUsingTimeFormat Determines if the time format being used in the call is the same as the
`one the interface currently uses.
`OueryPreferredFormat Retrieves the preferred time format the interface will use.
`Sets current and stop positions and applies flags to both.
`SetPositions
`SetRate
`Sets a new playback rate.
`SetTimeFormat
`Sets the time format, which determines the format of units used during
`seeking.
`
`1645
`
`
`
`CPosPassThru Class
`
`Page 3of26
`
`Implemented INonDelegatingUnknown Methods
`Name
`Description
`NonDeleqatinqQueryinterface Returns a specified reference-counted interface.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Q'41[.]I!:+ +!!.HM Topic Contents
`
`ifflj[§ii!¥M
`
`+Qi@[.]I!:+ 111.11119 Topic Contents 1@1§11!¥+
`
`CPosPassThru::CanSeekBackward
`
`CPosPassThru Class
`
`Determines if the current position can be moved backward in the media stream.
`
`H RESULT CanSeekBackward (
`LONG *pCanSeekBackward
`);
`
`Parameters
`
`pCanSeekBackward
`Set to OATRUE if able to seek backward; otherwise set to OAFALSE.
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :CanSeekBackward on the
`connected pin.
`
`Remarks
`
`This member function calls IMediaPosition: :CanSeekBackward on the connected pin and
`returns the result.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi@[.]I!:+ 111.11119 Topic Contents
`
`i@i§i 11111+
`
`CPosPassTh ru: :Ca nSeekForwa rd
`
`1646
`
`
`
`CPosPassThru Class
`
`CPosPassThru Class
`
`Page 4of26
`
`Determines if the current position can be moved forward in the media stream.
`
`HRESULT CanSeekForward(
`LONG *pCanSeekForward
`);
`
`Parameters
`
`pCanSeekForward
`Set to OATRUE if able to seek forward; otherwise set to OAFALSE.
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :CanSeekForward on the
`connected pin.
`
`Remarks
`
`This member function calls IMediaPosition: :CanSeekForward on the upstream output pin
`connected to the peer input pin and returns the result.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.l:.ij Topic Contents
`
`l@i§i llfttiM
`
`CPosPassThru::CheckCapabilities
`
`CPosPassThru Class
`
`Determines which capabilities exist on a media stream by applying seeking capability flags and
`checking the returned value.
`
`HRESULT CheckCapabilities(
`DWORD * pCapabilities
`);
`
`Parameters
`
`pCapabilities
`Pointer to an AM_SEEKING_SEEKING_CAPABILITIES enumerator containing the
`seeking capabilities flags to apply. These flags can be any combination of the following:
`
`1647
`
`
`
`CPosPassThru Class
`
`Page 5of26
`
`AM SEE KI NG_ Ca nGetCu rrentPos
`AM_SEEKI NG_ Ca nGetDu ration
`AM_SEEKI NG_ Ca nGetStop Pos
`AM_SEEKI NG_ Ca nPlayBackwa rds
`AM SEE KI NG_ Ca nSeekAbsol ute
`AM SEE KI NG_ Ca nSeekBackwa rds
`AM SEE KI NG_ Ca nSeekForwa rds
`
`Return Values
`
`Returns S_OK if all capabilities in pCapabilities are present, S_FALSE if some are present, or
`E_FAIL if none are present.
`
`Remarks
`
`This member function implements IMediaSeekinq: :CheckCaoabilities, by calling the
`IMediaSeeking::CheckCapabilities method on the upstream output pin connected to the
`peer input pin. The pin that performs the seek operation will return whether the flags
`presented in the pCapabilities parameter are present. This returned value will then, in turn,
`propagate to calls made from CPosPassThru::CheckCapabilities member functions in
`intervening filters.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]lj,i '!!·!:.!¥ Topic Contents
`
`i@i§ll!¥+
`
`+Qi@[.]+• 111.1,.19 Topic Contents
`
`i@i§i i!fttiM
`
`CPosPassTh ru: :ConvertTi meFormat
`
`CPosPassThru Class
`
`Converts a time from one format to another.
`
`HRESULT ConvertTimeFormat(
`LONGLONG * pTarget,
`const GUID * pTargetFormat,
`LONGLONG Source,
`con st GUI D * pSourceFormat
`);
`
`Parameters
`
`pTarget
`Time in converted format.
`pTargetFormat
`
`1648
`
`
`
`CPosPassThru Class
`
`Page 6of26
`
`GUID of the format to convert to, or the currently selected format if NULL.
`Source
`Time in original format.
`pSourceFormat
`GUID of the format to be converted from, or the currently selected format if NULL.
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :ConvertTimeFormat on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :ConvertTimeFormat method by calling
`this same method on the upstream filter's output pin.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]jj,i '!!·!:.!¥
`
`Topic Contents i@i§ll!¥+
`
`+Qi@[.]+• 111.1,.19
`
`Topic Contents
`
`i@i§i i!fttiM
`
`CPosPassThru::CPosPassThru
`
`CPosPassThru Class
`
`Constructs a CPosPassThru object.
`
`CPosPassThru (
`const TCHAR *pName,
`LPUNKNOWN pUnk,
`HRESULT * phr,
`IPin * pPin
`);
`
`Parameters
`
`pName
`Name of the object used in the CPosPassThru constructor for debugging purposes.
`
`pUnk
`
`phr
`
`pPin
`
`Pointer to the owner of this object.
`
`Pointer to an HRESULT value for resulting information.
`
`Pointer to the input pin for the filter.
`
`Return Values
`
`1649
`
`
`
`CPosPassThru Class
`
`Page 7of26
`
`No return value.
`
`Remarks
`
`Allocate the pName parameter in static memory. This name appears on the debugging terminal
`upon creation and deletion of the object.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`•;<MM+' MB.HM Topic Contents
`
`i@fa111¥M
`
`8 4'41M+• 1!1·H¥ Topic Contents
`
`i@fai11¥M
`
`CPosPassTh ru:: ForceRefresh
`
`CPosPassThru Class
`
`Releases any cached interfaces on the upstream pin.
`
`HRESULT ForceRefresh( );
`
`Return Values
`
`Returns S OK.
`
`Remarks
`
`For efficiency, the CPosPassThru class can cache the IMediaPosition interface of the connected
`upstream output pin. This method releases any cached interface pointers and forces them to
`be obtained again via Querylnterface if needed.
`
`Presently, this class does not cache the upstream IMediaPosition so this member function is
`not necessary. It is left in for future flexibility.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`•;<MM+• MB.],.[¥ Topic Contents
`
`i@fa111¥M
`
`CPosPassThru::GetAvailable
`
`CPosPassThru Class
`
`1650
`
`
`
`CPosPassThru Class
`
`Page 8of26
`
`Returns the range of times in which seeking is efficient.
`
`HRESULT GetAvailable(
`LONGLONG * pEarliest,
`LONGLONG * platest
`);
`
`Parameters
`
`pEarliest
`Earliest time that can be efficiently seeked to.
`platest
`Latest time that can be efficiently seeked to.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeekinq: :GetAvailable on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :GetAvailable method by calling this
`same method on the upstream filter's output pin.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`w Q<M [.] +• 111.H5
`MQi§i[.]11,M 11!.HM
`
`Topic Contents
`
`•=@• 1gnw
`
`Topic Contents
`
`l@l§il!MM
`
`CPosPassThru::GetCapabilities
`
`CPosPassThru Class
`
`Returns the seeking capabilities of the media stream.
`
`HRESULT GetCapabilities(
`DWORD * pCapabilities
`);
`
`Parameters
`
`pCapabilities
`Seeking capability flags, which can be any combination of the following.
`
`1651
`
`
`
`CPosPassThru Class
`
`Page 9of26
`
`AM SEE KI NG_ Ca nGetCu rrentPos
`AM_SEEKI NG_ Ca nGetDu ration
`AM_SEEKI NG_ Ca nGetStop Pos
`AM_SEEKI NG_ Ca nPlayBackwa rds
`AM SEE KI NG_ Ca nSeekAbsol ute
`AM SEE KI NG_ Ca nSeekBackwa rds
`AM SEE KI NG_ Ca nSeekForwa rds
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :GetCapabilities on the
`connected pin.
`
`Remarks
`
`This member function implements IMediaSeeking: :GetCapabilities by calling the
`IMediaSeeking::GetCapabilities method on the upstream output pin connected to the peer
`input pin. The pin that performs the seek operation will return the capabilities present in the
`pCapabilities parameter. These returned capabilities will then, in turn, propagate to calls made
`from CPosPassThru::GetCapabilities member functions in intervening filters.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`•;1;1.111,; 111.1::11 Topic Contents
`
`l@i§i 11111+
`
`MQ<§i[.]jj,+ 111.Hj Topic Contents
`
`l@i§lllMM
`
`CPosPassThru::GetCurrentPosition
`
`CPosPassThru Class
`
`Retrieves the current position in terms of the media stream's total length.
`
`HRESULT GetCurrentPosition(
`LONGLONG* pCurrent
`);
`
`Parameters
`
`pCurrent
`Current position in current time format units.
`
`Return Values
`
`1652
`
`
`
`CPosPassThru Class
`
`Page 10of26
`
`Returns NOERROR if successful. Otherwise, returns the HRESULT value returned from calling
`IMediaSeekinq: :GetCurrentPosition on the connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :GetCurrentPosition interface. It calls the
`CPosPassThru: :GetMediaTime virtual member function, which you should override and
`implement in your derived class to return the current position. If this fails (which it does by
`default), the IMediaSeeking::GetCurrentPosition on the upstream filter's output pin is
`called.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M MB.HS Topic Contents
`
`i@faii!MM
`
`CPosPassTh ru: :get_ Cu rrentPosition
`
`CPosPassThru Class
`
`Retrieves the current position in terms of the total length of the media stream.
`
`HRESULT get_CurrentPosition(
`REFTIME* pl/Time
`);
`
`Parameters
`
`pl/Time
`Returned start time as a double value in seconds.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :get CurrentPosition on the
`connected pin.
`
`Remarks
`
`The start position is applied before the rate and therefore is the position at typical playback
`speed.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi§i!!.llj,i Mh.J,,[5 Topic Contents
`
`i@faii!MM
`
`1653
`
`
`
`CPosPassThru Class
`
`Page 11of26
`
`CPosPassThru::GetDuration
`
`CPosPassThru Class
`
`Retrieves the length of time that the media stream will play.
`
`HRESULT GetDuration(
`LONGLONG* pDuration
`);
`
`Parameters
`
`pDuration
`Returned length of the media stream.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :GetDuration on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeeking: :GetDuration method by calling this
`same method on the upstream filter's output pin.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jlj,M l!i.! 11ij
`
`Topic Contents
`
`l@i§i 11111+
`
`CPosPassThru::get_Duration
`
`CPosPassThru Class
`
`Retrieves the total duration of the media stream.
`
`HRESULT get_Duration(
`REFTIME * plength
`);
`
`Parameters
`
`plength
`Returned length of the media stream.
`
`1654
`
`
`
`CPosPassThru Class
`
`Page 12of26
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :get Duration on the
`connected pin.
`
`Remarks
`
`The duration assumes normal playback speed, and it is therefore unaffected by the rate.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.! 11ij
`
`Topic Contents
`
`l@i§lllMM
`
`CPosPassTh ru: :GetMediaTi me
`
`CPosPassThru Class
`
`Retrieves the starting and ending media times.
`
`virtual HRESULT GetMediaTime(
`LONGLONG* pStartTime,
`LONGLONG* pEndTime
`);
`
`Parameters
`
`pStartTime
`Returned starting media time.
`pEndTime
`Returned ending media time.
`
`Return Values
`
`Returns an HRESULT value (E_FAIL by default).
`
`Remarks
`
`Override this virtual member function to return the current samples' media time. This
`represents the current position in terms of media time (for example, frame 20 of a total 130
`frames).
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jlj,M l!i.! 11ij Topic Contents
`
`l@i§il!MM
`
`1655
`
`
`
`CPosPassThru Class
`
`Page 13of26
`
`CPosPassTh ru: :GetPositions
`
`CPosPassThru Class
`
`Returns the current and stop position settings.
`
`HRESULT GetPositions(
`LONGLONG * pCurrent,
`LONGLONG * pStop
`);
`
`Parameters
`
`pCurrent
`Start time in the current time format.
`pStop
`Stop time in the current time format.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :GetPositions on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :GetPositions method by calling this
`same method on the upstream filter's output pin. It allows the retrieval of several values with
`only one call.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]lj,i '!!·!:.!¥ Topic Contents i@i§ll!¥+
`
`+Qi@[.]+• 111.1,.19 Topic Contents
`
`i@i§i i!fttiM
`
`CPosPassTh ru: :GetPrerol I
`
`CPosPassThru Class
`
`Retrieves the preroll settings.
`
`1656
`
`
`
`CPosPassThru Class
`
`Page 14 of 26
`
`HRESULT GetPreroll(
`LONGLONG * pl/Preroll
`);
`
`Parameters
`
`pl/Preroll
`Returned preroll time.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :GetPreroll on the connected
`pin.
`
`Remarks
`
`This member function implements the IMediaSeeking: :GetPreroll method by calling this same
`method on the upstream filter's output pin.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jlj,M l!i.! 111j Topic Contents
`
`l@IJll!MM
`
`CPosPassThru::get_PrerollTime
`
`CPosPassThru Class
`
`Retrieves the time prior to the start position that devices should start rolling.
`
`HRESULT get_PrerollTime(
`REFTIME* pl/Time
`);
`
`Parameters
`
`pl/Time
`Returned preroll time as a double value in seconds.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :get PrerollTime on the
`connected pin.
`
`1657
`
`
`
`CPosPassThru Class
`
`Page 15of26
`
`Remarks
`
`Preroll time is the time prior to the start position at which nonrandom access devices, such as
`tape players, should start rolling.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jlj,M lll.! 11ij
`
`Topic Contents
`
`l@IJll!MM
`
`CPosPassThru::GetRate
`
`CPosPassThru Class
`
`Retrieves the current rate.
`
`HRESULT GetRate(
`double * pdRate
`);
`
`Parameters
`
`pdRate
`Current rate, where 1 is the normal rate.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeekinq: :GetRate on the connected
`pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :GetRate method by calling this same
`method on the upstream filter's output pin.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`+ Q<M [.] ij,+ 111.Hj Topic Contents •@!§' 1gn+
`
`CPosPassThru::get_Rate
`
`1658
`
`
`
`CPosPassThru Class
`
`CPosPassThru Class
`
`Retrieves the rate of playback relative to normal playback speed.
`
`Page 16of26
`
`HRESULT get_Rate(
`double * pdRate
`);
`
`Parameters
`
`pdRate
`Returned rate.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :get Rate on the connected
`pin.
`
`Remarks
`
`A rate of 1.0 indicates normal playback speed. A rate of 0.5 indicates half speed. A rate of -1.0
`indicates normal speed in reverse.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQi§i[.jjj,M 11!.HS
`
`Topic Contents
`
`lmli§lllMM
`
`CPosPassTh ru: :GetStopPosition
`
`CPosPassThru Class
`
`Retrieves the position at which the media stream stops.
`
`HRESULT GetStopPosition(
`LONGLONG* pStop
`);
`
`Parameters
`
`pStop
`Returned stop time.
`
`Return Values
`
`Return Values
`
`1659
`
`
`
`CPosPassThru Class
`
`Page 17of26
`
`Returns the HRESULT value returned from calling IMediaSeekinq: :GetStopPosition on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :GetStopPosition method by calling this
`same method on the upstream filter's output pin. The stop position is a time between zero and
`the duration of the media at which playback should stop.
`
`The stop position is applied before the rate and therefore is the position at typical playback
`speed.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+QH"·h' 111.q9
`
`Topic Contents 1@1§111¥+
`
`CPosPassTh ru: :get_StopTi me
`
`CPosPassThru Class
`
`Retrieves the time at which the media stream stops.
`
`HRESULT get_StopTime(
`REFTIME* pl/Time
`);
`
`Parameters
`
`pl/Time
`Returned stop time as a double value in seconds.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaPosition: :get StopTime on the
`connected pin.
`
`Remarks
`
`The stop time is a position between zero and the duration of the media at which playback
`should stop.
`
`The stop position is applied before the rate and therefore is the position at typical playback
`speed.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`1660
`
`
`
`CPosPassThru Class
`
`Page 18of26
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`CPosPassTh ru: :GetTi meFormat
`
`CPosPassThru Class
`
`Retrieves the current time format, which determines the format of units used during seeking.
`
`HRESULT GetTimeFormat(
`const GUID * pFormat
`);
`
`Parameters
`
`pFormat
`Media time format currently supported by this interface.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :GetTimeFormat on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeeking: :GetTimeFormat method by calling this
`same method on the upstream filter's output pin.
`
`See the IMediaSeeking: :IsFormatSupported method for a list of time formats.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`+ Q i§i [.] jj,+ +!!·HM Topic Contents Mttfjl§ii!MM
`
`CPosPassTh ru: :lsFormatSu pported
`
`CPosPassThru Class
`
`Determines if a specified time format is supported.
`
`HRESULT IsFormatSupported(
`
`1661
`
`
`
`CPosPassThru Class
`
`Page 19of26
`
`const GUID * pFormat
`);
`
`Parameters
`
`pFormat
`Time format to compare.
`
`Return Values
`
`Return Values
`
`Returns the HRESULT value returned from calling IMediaSeeking: :IsFormatSupported on the
`connected pin.
`
`Remarks
`
`This member function implements the IMediaSeekinq: :IsFormatSupoorted method. See that
`method for a list of valid time formats.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]lj,i '!!·!:.!¥ Topic Contents i@i§ll!¥+
`
`CPosPassTh ru: :lsUsi ngTi mef ormat
`
`CPosPassThru Class
`
`Determines if the time format being used in the call is the same as the one currently in use by
`the interface.
`
`HRESULT IsUsingTimeFormat(
`const GUID * pFormat
`);
`
`Parameters
`
`pFormat
`Time format to check.
`
`Return Values
`
`Returns S_OK if pFormat is the current time format; otherwise returns S_FALSE.
`
`Remarks
`
`This member function implements the IMediaSeekinq:: IsUsinqTimeFormat method by calling
`this same method on the upstream filter's output pin. This can be used in place of
`
`1662
`
`
`
`CPosPassThru Class
`
`Page 20of26
`
`IMediaSeeking: :GetTimeFormat to save copying the GUID.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M Ill.HS Topic Contents lmll§lll¥M
`
`CPosPassThru::NonDelegatingQuerylnterface
`
`CPosPassThru Class
`
`Returns a specified reference-counted interface.
`
`H RESULT Non Delegati ngQueryinterface(
`REFIID riid,
`void **ppv
`);
`
`Parameters
`
`riid
`
`ppv
`
`Reference identifier.
`
`Pointer to the interface.
`
`Return Values
`
`Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or
`E_NOINTERFACE if it is not.
`
`Remarks
`
`Returns pointers to the IMediaPosition, IMediaSeeking, and IUnknown interfaces by default.
`Override this method to publish any additional interfaces implemented by the derived class.
`
`This member function implements the INonDelegatingUnknown: :NonDelegatingOueryinterface
`method.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`8 4'41M+• 1 !1·HM Topic Contents
`
`lfflj[§ill¥M
`
`CPosPassTh ru:: put_ Cu rrentPosition
`
`CPosPassThru Class
`
`1663
`
`
`
`CPosPassThru Class