`
`Page 2of11
`
`Description
`Name
`Informs the derived class when the connection is broken.
`BreakConnect
`Informs the derived class when the connection process is starting.
`CheckConnect
`CheckMediaType Determines if the pin can use a specified media type.
`CheckStreaming Verifies conditions for continuing with a streaming operation.
`CompleteConnect Informs the derived class when the connection process has completed.
`SetMediaType
`Informs the derived class when the media type is established for the
`connection.
`
`Implemented IPin Methods
`Name
`Description
`Informs the pin to begin a flush operation.
`BeginFlush
`Informs the pin to end a flush operation and notifies the pin that it can start
`End Flush
`accepting data again.
`EndOfStream Informs the input pin that no additional data is expected until a new run
`command is issued.
`NewSegment Specifies that samples following this call are grouped as a segment with a given
`start time, stop time, and rate.
`Retrieves an identifier for the pin.
`
`Oueryid
`
`Implemented IMeminputPin Methods
`Name Description
`Receive Receives the next block of data from the stream.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jjj,M l!i.! 111j
`
`Topic Contents
`
`l@i§il!MM
`
`MQi§i[.jjj,M 1 !1·Hj
`
`Topic Contents •@m•11mw
`
`CTransformlnputPin::BeginFlush
`
`CTransforminoutPin Class
`
`Informs the pin to begin a flush operation.
`
`HRESULT BeginFlush(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1776
`
`
`
`CTransformlnputPin Class
`
`Page 3of11
`
`This member function implements the I Pin:: BeqinFlush method and overrides the
`CBaselnoutPin:: BeqinFlush member function. It checks to see if the pin is connected, and then
`calls CBaselnputPin::BeginFlush, and finally calls the CTransformFilter:: BeqinFlush member
`function.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`CTransformlnputPin::BreakConnect
`
`CTransformlnputPin Class
`
`Informs the derived class when the connection is broken.
`
`HRESULT BreakConnect( );
`
`Return Values
`
`Returns NOERROR in this implementation.
`
`Remarks
`
`This member function overrides the CBasePin:: BreakConnect member function and calls the
`CTransformFilter:: BreakConnect member function. Override
`CTransformFilter::BreakConnect to undo anything carried out in
`CTransforminputPin: :CheckConnect (such as releasing extra interfaces).
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jlj,M 11!.l:.!9 Topic Contents
`
`i@l§ii!MM
`
`CTransformlnputPin::CheckConnect
`
`CTransforminputPin Class
`
`Informs the derived class when the connection process is starting.
`
`HRESULT CheckConnect(
`IPin *pPin
`);
`
`1777
`
`
`
`CTransformlnputPin Class
`
`Page 4of11
`
`Parameters
`
`pPin
`
`Pointer to the IPin interface of the connecting pin.
`
`Return Values
`
`Returns NOERROR by default.
`
`Remarks
`
`This member function overrides the CBasePin: :CheckConnect member function and calls the
`CTransformFilter: :CheckConnect member function. Override
`CTransformFilter::CheckConnect to add additional interfaces.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M MB.HS Topic Contents
`
`i@faiilMM
`
`CTra nsforml n putPi n: :CheckMediaType
`
`CTransforminoutPin Class
`
`Determines if the pin can use a specified media type.
`
`HRESULT CheckMediaType(
`const CMediaType* mtin
`);
`
`Parameters
`
`mtln
`
`Pointer to a media type object.
`
`Return Values
`
`No return value.
`
`Remarks
`
`This member function calls the pure-virtual CTransformFilter: :ChecklnputType member
`function, which must be overridden when deriving a class from the CTransformFilter class. The
`overridden ChecklnputType member function is responsible for determining which media types
`the input pin supports.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`1778
`
`
`
`CTransformlnputPin Class
`
`Page 5of11
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`CTransformlnputPin::CheckStreaming
`
`CTransforminputPin Class
`
`Verifies conditions for continuing with a streaming operation.
`
`HRESULT CheckStreaming( );
`
`Return Values
`
`Returns one of the following HRESULT values, depending on the state.
`Value
`Meaning
`S_FALSE
`Currently in flushing state.
`S_OK
`Receive or EndOfStream operations can safely proceed.
`VFW E NOT CONNECTED The output pin either does not exist or isn't connected.
`VFW E RUNTIME ERROR A run-time error occurred when processing a previous sample.
`VFW E WRONG STATE The filter is in the State Stopped state.
`
`Remarks
`
`This member function overrides the CBaseinputPin: :CheckStreaming member function and
`calls that base class implementation for most of the condition checks. It determines if the pin
`is connected, if it is in a paused or running state, and if it is not currently flushing data or
`processing a run-time error.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jjj,M 11!.l:.!9 Topic Contents
`
`i@l§ii!MM
`
`+;<§1[.]jj,+ 111.],.[9 Topic Contents Mttfjl§ii!MM
`
`CTransformlnputPin::CompleteConnect
`
`CTransforminputPin Class
`
`Informs the derived class when the connection process has been completed.
`
`HRESULT CompleteConnect(
`
`1779
`
`
`
`CTransformlnputPin Class
`
`Page 6of11
`
`IPin *pReceivePin
`);
`
`Parameters
`
`pReceivePin
`Pointer to the input pin being connected to.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function overrides the CBasePin: :CompleteConnect member function. It calls the
`base class CBasePin::CompleteConnect member function and then calls
`CTransformFilter: :CompleteConnect.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' •11·!:.!¥ Topic Contents
`
`lmli§lllMM
`
`CTransformlnputPin::CTransformlnputPin
`
`CTransforminputPin Class
`
`Constructs a CTransforminputPin object.
`
`CTransforminputPin (
`TCHAR *pObjectName,
`CTra nsfo rm Fi I ter *p TransformFilter,
`HRESULT * phr,
`LPCWSTR pName
`);
`
`Parameters
`
`pObjectName
`Name of the CTransforminputPin object.
`pTransformFilter
`Pointer to the CTransformFilter class.
`
`phr
`
`Pointer to an HRESULT value in which to return resulting information. This should be
`modified only if a failure occurs. If it is a failure code on input, construction can be
`terminated, but in any case the destructor will be called by the creator when the
`HRESULT error is detected.
`pName
`Name of the pin.
`
`1780
`
`
`
`CTransformlnputPin Class
`
`Page 7of11
`
`Return Values
`
`No return value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQij[.jlj,M l!i.! 11ij Topic Contents
`
`l@i§il!MM
`
`MQ<§i[.jlj,M 111.l:.!j Topic Contents
`
`l@fail!MM
`
`CTra nsforml n putPi n: :Cu rrentMed iaType
`
`CTransforminoutPin Class
`
`Retrieves the media type currently assigned to the filter.
`
`CMediaType& CurrentMediaType( );
`
`Return Values
`
`Returns the value of CBasePin:: m mt.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQij[.jlj,M l!i.! 11ij Topic Contents
`
`l@i§il!MM
`
`CTransformlnputPin::EndFlush
`
`CTransforminputPin Class
`
`Informs the pin to end a flush operation and notifies the pin that it can start accepting data
`again.
`
`HRESULT Endflush(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1781
`
`
`
`CTransformlnputPin Class
`
`Page 8of11
`
`This member function implements the I Pin:: End Flush method and overrides the
`CBaselnoutPin:: End Flush member function. It checks to see if the pin is connected, calls the
`CBaselnputPin::EndFlush member function, and finally calls the CTransformFilter:: EndFlush
`member function.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`CTransformlnputPin::EndOfStream
`
`CTransformlnputPin Class
`
`Informs the input pin that no additional data is expected until a new run command is issued.
`
`HRESULT EndOfStream(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the I Pin:: EndOfStream method. It calls
`CTransforminputPin: :CheckStreaming to see that the filter is in a streaming state and then
`calls the CTransformFilter:: EndOfStream member function.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi@[.jij,+ 111.11119 Topic Contents
`
`i@l§ii!MM
`
`CTransformlnputPin::NewSegment
`
`CTransforminputPin Class
`
`Specifies that samples following this call are grouped as a segment with a given start time,
`stop time, and rate.
`
`HRESULT NewSegment(
`REFERENCE_TIME tStart,
`REFERENCE_TIME tStop,
`double dRate
`);
`
`1782
`
`
`
`CTransformlnputPin Class
`
`Page 9of11
`
`Parameters
`
`tStart
`Start time of the segment.
`
`tStop
`
`Stop time of the segment.
`dRate
`Rate of the segment.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the I Pin:: NewSegment method and overrides the
`CBasePin: :NewSegment member function. It calls the base class implementation first
`(CBasePin::NewSegment), and then calls CTransformFilter:: NewSegment to pass the
`notification on to the next filter downstream.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQi§i[.]jj,M '!!·HM
`• QIM [.] +• I !1.],.15
`
`Topic Contents
`
`lmll§I 11$8
`
`Topic Contents
`
`lfflj(§i MUMM
`
`CTransformlnputPin::Queryld
`
`CTransformlnputPin Class
`
`Retrieves an identifier for the pin.
`
`HRESULT Queryld(
`LPWSTR *Id
`);
`
`Parameters
`
`Id
`
`Pin identifier.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1783
`
`
`
`CTransformlnputPin Class
`
`Page 10of11
`
`This member function implements the IPin: :Queryld method and overrides the
`CBasePin: :Queryld member function. It returns the name "In". The caller is responsible for
`freeing the memory by using the Microsoft® Win32® CoTaskMemFree function.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Q'41!.l+' 111.q9
`
`Topic Contents
`
`l@!§il!MM
`
`CTransformlnputPin::Receive
`
`CTransformlnputPin Class
`
`Receives the next block of data from the stream.
`
`HRESULT Receive(
`IMediaSample * pSample
`);
`
`Parameters
`
`pSample
`Pointer to a media sample.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IMemlnoutPin:: Receive method. Add a reference to the
`block of data if access to it is required after the completion of this method. For instance, some
`decoder filters for temporal compression data streams require that the previous sample be
`kept in order to decode the current sample.
`
`This member function calls the CTransformFilter:: Receive member function, which does the
`work of calling the transform function and then passing the sample on.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jlj,M 111.11119 Topic Contents 1@!§111¥+
`
`CTransformlnputPin::SetMediaType
`
`1784
`
`
`
`CTransformlnputPin Class
`
`Page 11of11
`
`CTransformlnoutPin Class
`
`Informs the derived class when the media type is established for the connection.
`
`HRESULT SetMediaType(
`const CMediaType* mt
`);
`
`Parameters
`
`mt
`
`Pointer to an input media type to be used.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function overrides the CBasePin: :SetMediaTyoe member function. It calls the
`base class CBasePin::SetMediaType member function, which returns NOERROR, and then
`calls CTransformFilter: :SetMediaTyoe, which the derived class can override to be informed
`when the media type is set.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1785
`
`
`
`CTransform OutputPin Class
`
`Page 1 of 10
`
`e4140.111,e 1:1.11119 T op1c Contents
`
`i@IQilt§jM
`
`CTransformOutputPin Class
`
`CBaseObject
`
`INonDelegatingUnknown
`
`CUnknown
`
`CBasePin
`
`CBaseOutputPin
`
`CTransformOutputPin
`
`The CTransformOutputPln class implements the output pin of a simple transform filter. It is
`the class assigned to them pOotpirt data member of the CTranstonuFi!ter class. Typically, you
`can create objects of a class derived from CTransformFllter without modifying the
`CTransformOutputPln class. If you want to override this class and derive a class from
`CTransformFllter, use the class and then override the CTransformfilter: :GetPin member
`function to create pins of your derived class.
`
`Protecte<I Data Members
`Name
`Des<:riptlon
`m_pTransformFllter Pointer to the owning CTransformfilter object.
`
`Public Data Members
`Name
`Des<:rlptlon
`m_pPosltlon Pointer to a CPosPassThru object that implements the lMediaPosition interface
`to pass media position commands on to the upstream filter.
`
`Member Functions
`Des<:rlptlon
`Name
`CTransfonu011tp1 rt Pin Constructs a CTransfonu011tp1 rt Pin object.
`CummtMediaTuoe
`Retrieves the media type currently assigned to the filter.
`
`Overrldable Member Functions
`
`1786
`
`
`
`CTransformOutputPin Class
`
`Page 2of10
`
`Description
`Name
`Informs the derived class when the connection is broken.
`BreakConnect
`Informs the derived class when the connection process is starting.
`CheckConnect
`CheckMediaType Determines if the pin can use a specified media type.
`CompleteConnect Informs the derived class when the connection process has completed.
`DecideBufferSize Determines the number and size of buffers required.
`GetMediaType
`Returns the media type that the output pin uses.
`SetMediaType
`Informs the derived class when the media type is established for the
`connection.
`
`Implemented IQualityControl Methods
`Name Description
`Notify Receives a quality-control notification, typically from a downstream filter. This method
`is inherited from the IOualityControl interface through the CBasePin class.
`
`Implemented IPin Methods
`Name Description
`Queryid Retrieves an identifier for the pin.
`
`Implemented INonDelegatingUnknown Methods
`Name
`Description
`NonDelegatingQueryinterface Returns an interface and increments the reference count.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`• Q<M [.] +• I![.],.[. Topic Contents •@M* 1gnw
`MQi§1[.]1!,i 1 !!·HM Topic Contents
`
`i@faii!MM
`
`CTransformOutputPin::BreakConnect
`
`CTra nsformOutputPi n Class
`
`Informs the derived class when the connection is broken.
`
`HRESULT BreakConnect( );
`
`Return Values
`
`Returns NOERROR.
`
`Remarks
`
`This member function overrides the CBaseOutputPin:: BreakConnect member function and calls
`
`1787
`
`
`
`CTransformOutputPin Class
`
`Page 3of10
`
`the CTransformFilter:: BreakConnect member function. It then calls the base class
`implementation in CBaseOutputPin::BreakConnect. Override
`CTransformFilter::BreakConnect to undo anything carried out in the
`CTransformOutputPin : :CheckConnect member function (for example, releasing interfaces
`previously added to the reference count).
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' 111.],.[9 Topic Contents
`
`lmll§lllMM
`
`CTra nsformOutputPi n: :CheckCon nect
`
`CTra nsformOutputPi n Class
`
`Informs the derived class when the connection process is starting.
`
`HRESULT CheckConnect(
`IPin *pPin
`);
`
`Parameters
`
`pPin
`
`Pointer to the IPin interface of the connecting pin.
`
`Return Values
`
`Returns NOERROR by default.
`
`Remarks
`
`This member function overrides the CBasePin: :CheckConnect member function and calls the
`CTransformFilter: :CheckConnect member function. It then calls the base class implementation
`in CBaseOutputPin: :CheckConnect. Override CTransformFilter::CheckConnect to add
`additional interfaces.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' 111.],.[9 Topic Contents
`
`lmll§lllMM
`
`CTra nsformOutputPi n: :CheckMediaType
`
`CTra nsformOutputPi n Class
`
`1788
`
`
`
`CTransformOutputPin Class
`
`Page 4of10
`
`Determines if the input pin supports a specified media type.
`
`HRESULT CheckMediaType(
`const CMediaType* mtln
`);
`
`Parameters
`
`mtln
`
`Pointer to a media type object.
`
`Return Values
`
`No return value.
`
`Remarks
`
`This member function calls the pure-virtual CTransformFilter: :CheckTransform member
`function, which must be overridden when deriving a class from the CTransformFilter class. The
`overridden CTransformFilter::CheckTransform member function determines which media
`types the output pin supports.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jlj,M 11!.l:.!j Topic Contents
`
`l@i§lllMM
`
`CTra nsformOutputPi n: :Com pleteCon nect
`
`CTra nsformOutputPi n Class
`
`Informs the derived class when the connection process has completed.
`
`HRESULT CompleteConnect(
`IPin *pReceivePin
`);
`
`Parameters
`
`pReceivePin
`Pointer to the output pin that is being connected to.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1789
`
`
`
`CTransformOutputPin Class
`
`Page 5of10
`
`This member function overrides the CBaseOutoutPin: :ComoleteConnect member function and
`calls the CTransformFilter: :ComoleteConnect member function, which returns NOERROR by
`default. It then calls the base class implementation in CBaseOutputPin::CompleteConnect.
`Override the CTransformFilter::CompleteConnect member function to retrieve any
`additional interfaces not retrieved by the base class that your output pin might need from the
`connected pin.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]lj,i 111.],.[9 Topic Contents
`
`lfflj(§l 1!1¥1M
`
`CTra n sformO utputPi n:: CTra nsformOutputPi n
`
`CTra nsformOutputPi n Class
`
`Constructs a CTransformOutputPin object.
`
`CTransformOutputPin(
`TCHAR *pObjectName,
`CTransformFilter *pTransformFilter,
`HRESULT * phr,
`LPCWSTR pName
`);
`
`Parameters
`
`pObjectName
`Name of the CTransformOutputPin object.
`pTransformFilter
`Pointer to the CTransformFilter class.
`
`phr
`
`Pointer to an HRESULT value in which to return resulting information. This should be
`modified only if a failure occurs. If it is a failure code on input, construction can be
`aborted, but in any case the destructor will be called by the creator when the HRESULT
`error is detected.
`pName
`Name of the pin.
`
`Return Values
`
`No return value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jlj,M 111.11119 Topic Contents
`
`l@i§il!MM
`
`+;<§1[.]lj,M 111.H9 Topic Contents
`
`l@i§il!MM
`
`1790
`
`
`
`CTransformOutputPin Class
`
`Page 6of10
`
`CTra nsformOutputPi n: :Cu rrentMed iaType
`
`CTra nsformOutputPi n Class
`
`Retrieves the media type currently assigned to the filter.
`
`CMediaType& CurrentMediaType( );
`
`Return Values
`
`Returns the value of CBasePin:: m mt.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQij[.jlj,M l!i.! 111j Topic Contents
`
`l@i§il!MM
`
`CTransformOutputPin::DecideBufferSize
`
`CTra nsformOutputPi n Class
`
`Determines the number and size of buffers required.
`
`HRESULT DecideBufferSize(
`IMemAllocator * pAl/oc,
`ALLOCATOR_PROPE RTIES * ppropinputRequest
`);
`
`Parameters
`
`pAl/oc
`Allocator assigned to the transfer.
`ppropinputRequest
`Requested allocator properties for count, size, and alignment, as specified by the
`ALLOCATOR PROPERTIES structure.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function overrides the CBaseOutputPin:: DecideBufferSize member function and
`calls the pure virtual CTransformFilter:: DecideBufferSize member function, which your derived
`
`1791
`
`
`
`CTransformOutputPin Class
`
`Page 7of10
`
`class must override and implement. This member function is called from the CBaseOutputPin
`class during the connection process.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`• A Mi[.]"'' I![.],.[. Topic Contents
`
`•@M* 1gnw
`
`CTra nsformOutputPi n: :GetMed iaType
`
`CTra nsformOutputPi n Class
`
`Returns the media type for the output pin to use.
`
`HRESULT GetMediaType(
`int iPosition,
`CMediaType *pMediaType
`);
`
`Parameters
`
`iPosition
`Position of the media type in the media type list.
`pMediaType
`Returned media type object.
`
`Return Values
`
`Returns an HRESULT value that depends on the implementation of the pure virtual
`CTransformFilter: :GetMediaType member function. HRESULT can include one of the following
`constants.
`Value
`NO ERROR
`S FALSE
`
`Meaning
`A media type is returned.
`Although the iPosition parameter typically is valid, it does not
`correspond to a media type that is currently valid.
`VFW S NO MORE ITEMS The iPosition parameter is beyond the valid range.
`
`Use other standard error values, such as E_INVALIDARG, for error cases.
`
`Remarks
`
`This member function overrides the CBasePin: :GetMediaType member function and calls the
`pure virtual CTransformFilter: :GetMediaType member function, which must be overridden to
`return media types supported by your filter. This is part of the implementation of
`CBasePin: :EnumMediaTypes.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1792
`
`
`
`CTransformOutputPin Class
`
`Page 8of10
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`MQij[.jjj,M M!i.11119 Topic Contents
`
`i@l§ii!MM
`
`CTransformOutputPin::NonDelegatingQuerylnteri
`
`CTra nsformOutputPi n Class
`
`Returns an interface and increments the reference count.
`
`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. If the query
`is unsuccessful and the requested interface is IMediaPosition or IMediaSeeking, returns an
`HRESULT from a call to CreatePosPassThru. If the query is unsuccessful and the interface is
`not IMediaPosition or IMediaSeeking, returns E_NOINTERFACE.
`
`Remarks
`
`This member function implements the INonDelegatingUnknown: :NonDelegatingQueryinterface
`method. It overrides the CBasePin:: NonDelegatingQueryinterface member function and passes
`references to the IPin, IQualityControl, IMediaPosition, IMediaSeeking, and IUnknown
`interfaces. Override this class to return other interfaces on the object in the derived class.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qij[.jjj,M M!l.l:.19 Topic Contents
`
`i@l§ii!MM
`
`CTransformOutputPin::Notify
`
`1793
`
`
`
`CTransformOutputPin Class
`
`Page 9of10
`
`CTra nsformOutputPi n Class
`
`Notifies the recipient that a quality change is requested.
`
`HRESULT Notify(
`IBaseFilter * pSelf,
`Quality q
`);
`
`Parameters
`
`pSelf
`Pointer to the filter that is sending the quality notification.
`
`q
`
`Quality notification structure.
`
`Return Values
`
`Default base class implementation returns E_FAIL.
`
`Remarks
`
`This member function implements the IQualityControl: :Notify method and overrides the
`CBasePin: :Notify member function. It calls the CTransformFilter: :AlterQuality member function
`to determine if the filter can do something to adjust the quality of the media stream (such as
`discarding samples). If that member function returns S_FALSE, it calls the
`CBasel n D utPi n: : Pass Notify member function, which passes the notification to the upstream
`filter after verifying that it is connected upstream.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQij[.jlj,M l!i.! 111j
`
`Topic Contents
`
`l@i§il!MM
`
`CTra nsformOutputPi n: :Queryld
`
`CTra nsformOutputPi n Class
`
`Retrieves an identifier for the pin.
`
`HRESULT Queryld(
`LPWSTR *Id
`);
`
`Parameters
`
`Id
`
`Pin identifier.
`
`1794
`
`
`
`CTransformOutputPin Class
`
`Page 10of10
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IPin: :Ouervld method and overrides the
`CBasePin: :Oueryld member function. It returns the name "Out". The caller is responsible for
`freeing the memory by using the Microsoft® Win32® CoTaskMemFree function.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1H++ 1 !!·HM Topic Contents
`
`ifflj[§ii!¥M
`
`CTra nsformOutputPi n: :SetMediaType
`
`CTra nsformOutputPi n Class
`
`Sets the media type for the connection to use.
`
`HRESULT SetMediaType(
`const CMediaType* mt
`);
`
`Parameters
`
`mt
`
`Pointer to an output media type to be used.
`
`Return Values
`
`Returns an HRESULT value (NOERROR by default).
`
`Remarks
`
`This member function overrides the CBasePin:: SetMediaTyoe member function and calls the
`CTra nsform Filter: : Set Med iaTyoe member function with the direction set to output. Override
`CTransformFilter::SetMediaType to handle any conditions that you want handled at this
`time in the connection process.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1795
`
`
`
`CTransinPI aceFil ter Class
`
`Page 1of11
`
`e4140.111,e 1:1.11119 T op1c Contents
`
`i@IQilt§jM
`
`CTra nsin PlaceFi lter Cl ass
`
`( CBaseObject
`
`),
`
`I
`
`)i
`
`I INonDelegatingUnknown
`Ll.( CUnknown
`I IAMovieSetup
`I IMediaFilter
`I IBaseFilter
`...__..__.I-{~ CBasefilter
`~ CTransformfilter
`~ CTranslnPlacefilter
`
`I
`
`I
`I
`
`)1
`
`CTtansinPlaceFlltet iS an abstract base class that provides support for a simple transform
`filter with a single input and a single output. It is derived from the C!lnkoowo class, and
`supports the IBaseFilter interface, the IMediaFilter interface, and two pins. Each pin supports
`the !Pin interface and uses the shared memory transport based on the IMeminoutPin interface.
`The filter uses classes derived from the caaseMediafi!ter class to support IBaseFiltet and
`IMedlaFiltet. The input pin is derived from the CBaseinputPin class, and the output pin iS
`derived from the CBaseOutputPin class.
`
`For more information about using this class to create a transform filter, see Creating a
`Transform Filter.
`
`Ptotected Data Members
`Name
`Desctlptlon
`m_ldTranslnPlace Performance-measuring identifier.
`
`Membet Functions
`Name
`Description
`~ Returns a pointer to an identieal copy of a media sample.
`CTransinPlaceFi!ter Constructs a CTransinPlaceFilter object.
`InputPin
`Returns a pointer to the input pin associated with the filter.
`OutputPin
`Returns a pointer to the output pin associated with the filter.
`
`Ovettldable Membe.- Functions
`
`1796
`
`
`
`CTranslnPlaceFilter Class
`
`Page 2of11
`
`Description
`Name
`CheckTransform Verifies that the media type is supported by input and output pins.
`CompleteConnect Reconnects the input or output pin if necessary.
`DecideBufferSize Determines the size of the transport buffer.
`GetMediaType
`Returns the media type to be used by the output pin.
`Returns a pin if an index is specified.
`GetPin
`Receives the sample, calls the derived class's Transform member function,
`Receive
`and then delivers the sample.
`Registers a performance measurement identifier (if PERF is defined).
`Performs transformation operations in place on the I MediaSample interface
`(pure virtual).
`
`RegisterPerfld
`Transform
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' 111.],.[9 Topic Contents
`
`lmll§lllMM
`
`8 4'41M+• 111.q9 Topic Contents
`
`1@!§111$8
`
`CTra n sl n Pia ceFi lter:: C heckTra n sform
`
`CTra nsl n PlaceFi lter Class
`
`Verifies that the media is supported by input and output pins.
`
`HRESULT CheckTransform(
`const CMediaType *mtln,
`const CMediaType *mtOut
`);
`
`Parameters
`
`mtin
`
`Input pin media type.
`mtOut
`Output pin media type.
`
`Return Values
`
`Returns S_OK by default.
`
`Remarks
`
`This member function overrides the CTransformFilter: :CheckTransform member function. The
`base class functions that call this member function are overridden in this class to call the
`CTransformFilter: :ChecklnputType member function that is overridden in the derived class,
`with the assumption that the type does not change. Usually there is no reason for this member
`
`1797
`
`
`
`CTranslnPlaceFilter Class
`
`Page 3of11
`
`function to be called. In debug builds some calls will be made, and returning S_OK ensures
`that these calls do not assert.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`• A Mi[.]"'' I![.],.[. Topic Contents
`
`•@M* 1gnw
`
`CTra n sl n Pia ceFi lter:: Com pleteCon nect
`
`CTra nsI n PlaceFi lter Class
`
`Reconnects the input or output pin if necessary.
`
`HRESULT CompleteConnect(
`PIN_DIRECTION direction,
`IPin *pReceivePin
`);
`
`Parameters
`
`direction
`Pin direction.
`pReceivePin
`Pointer to the output pin to which to connect.
`
`Return Values
`
`Returns NOERROR if successful; otherwise, returns VFW_E_NOT _IN_GRAPH if the filter is not
`part of a graph, or returns an HRESULT that indicates the error. HRESULT can be one of the
`following standard constants, or other values not listed:
`Value
`Meaning
`E_FAIL
`Failure.
`E_POINTER
`Null pointer argument.
`E_INVALIDARG Invalid argument.
`E_NOTIMPL
`Method isn't supported.
`
`Remarks
`
`This member function overrides the CTransformFilter: :CompleteConnect member function. It is
`called by one of the pin classes at the end of a successful connection. Because the input and
`output pins must both use the same allocator, this member function reconnects the opposite
`pin if necessary.
`
`When the input pin is first connected, the output pin has not yet been connected and the
`downstream filter's allocator is unknown, so the allocator for the input pin is chosen to be the
`upstream pin's allocator. When the transform filter's output pin is connected, however, it has
`access to the downstream filter's allocator and should force a reconnect on the input pin and
`
`1798
`
`
`
`CTranslnPlaceFilter Class
`
`Page 4of11
`
`offer that allocator. When the input pin is reconnected, it forces a reconnect on the output pin
`if the allocator chosen for the input pin's connection differs from the output pin's connection.
`This member function supplies the reconnection for either output or input pins.
`
`© 1997 Microsoft Corooratjon . All rights reserved. Terms of Use.
`
`MQl§i[.jjj,M MB.HS
`
`Topic Contents
`
`i@fa11!¥M
`
`MQi§1[.]+• 1 !!·H¥
`
`Topic Contents
`
`i@fai1!¥M
`
`CTranslnPlaceFilter: :Copy
`
`CTra nsI n PlaceFi lter Class
`
`Creates a copy of the specified media sample.
`
`IMediaSample * CTransinPlaceFilter::Copy(
`IMediaSample *pSource
`);
`
`Parameters
`
`pSource
`Pointer to an object that implements the IMediaSample interface.
`
`Return Values
`
`Returns a pointer to the new sample.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`•;<@[.]+• lh.1::1¥ Topic Contents
`
`i@fa11!¥M
`
`CTra n sl n Pia ceFi lter:: CTra n sl n PlaceFi lter
`
`CTra nsI n PlaceFi lter Class
`
`Constructs a CTransinPlaceFilter object.
`
`CTransin Placefilter(
`TCHAR * pObjectName,
`LPUNKNOWN lpUnk,
`REFCLSID clsid,
`
`1799
`
`
`
`CTranslnPlaceFilter Class
`
`Page 5of11
`
`HRESULT * phr
`);
`
`Parameters
`
`pObjectName
`Name given to the CTranslnPlaceFilter object.
`lpUnk
`Pointer to LPUNKNOWN.
`
`els id
`
`phr
`
`Class identifier of the CTranslnPlaceFilter class.
`
`Pointer to the HRESULT value for resulting information.
`
`Return Values
`
`No return value.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1[.]++ 1 !!·HM
`
`Topic Contents
`
`i@l§ii!MM
`
`MQij[.jlj,M M!i.11119
`
`Topic Contents
`
`i@l§ii!MM
`
`CTra nsln PlaceFi lter:: DecideBufferSize
`
`CTra nsl n PlaceFi lter Class
`
`Determines the size of the transport buffer.
`
`HRESULT DecideBufferSize(
`IMemAllocator * pAl/oc,
`ALLOCATOR_PROPERTIES * pProperties
`);
`
`Parameters
`
`pAl/oc
`Pointer to the IMemAllocator object used by the output pin.
`pProperties
`Requested allocator properties for count, size, and alignment, as specified by the
`ALLOCATOR PROPERTIES structure.
`
`Return Values
`
`Returns NOERROR if successful; otherwise, returns an HRESULT value indicating the error.
`HRESULT can be one of the following standard constants, or other values not listed:
`
`1800
`
`
`
`CTranslnPlaceFilter Class
`
`Page 6of11
`
`Meaning
`Value
`Failure.
`E FAIL
`E_ POINTER
`Null pointer argument.
`E_INVALIDARG Invalid argument.
`E_ NOTIMPL
`Method isn't supported.
`
`Remarks
`
`This member function overrides the CTransformFilter: :DecideBufferSize member function. It is
`called when the filter must provide its own allocator. Allocator requirements are obtained from
`the filter's input pin and passed to the output pin.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jjj,M M!i.!111j Topic Contents
`
`l@i§il!MM
`
`MQi§i[.jjj,M 1 !1·Hj Topic Contents
`
`•@m•+imw
`
`CTra n sl n Pia ceFi lter:: Get Med iaType
`
`CTra nsI n PlaceFi lter Class
`
`Returns the media type to be used by the output pin.
`
`HRESULT GetMediaType(
`int iPosition,
`CMediaType *pMediaType
`);
`
`Parameters
`
`iPosition
`Position of the media type in the media type list.
`pMediaType
`Returned media type object.
`
`Return Values
`
`Returns E_UNEXPECTED because it is not expected to be called.
`
`Remarks
`
`In the CTransformFilter class, this member function is called by the associated input or output
`pin class's GetMediaType member function to retrieve the next media type in the list and
`return it to the pin's CBasePin:: EnumMediaTypes member function.
`
`1801
`
`
`
`CTranslnPlaceFilter Class
`
`Page 7of11
`
`However, in