DirectShow Animated Header -- CRendererInputPin Class DirectShow Animated Header -- CRendererInputPin Class* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: CRenderedInputPin Class
*Next Topic: CRendererPosPassThru Class

CRendererInputPin Class


CRendererInputPin class hierarchy

This input pin class channels calls to the rendering filter.

Protected Data Members
Name Description
m_pRenderer Pointer to the CBaseRenderer object.

Member Functions
Name Description
Allocator Retrieves a pointer to the default memory allocator.
CRendererInputPin Constructs a CRendererInputPin object.

Overridable Member Functions
Name Description
Active Switches the pin to the active (paused or running) mode.
BeginFlush Informs the pin to begin a flush operation.
BreakConnect Adds customized code upon breaking a connection.
CheckMediaType Determines if the pin can support a specific media type.
CompleteConnect Completes the connection.
EndFlush Informs the pin to end a flush operation.
EndOfStream Informs the pin that no additional data is expected until a new run command is issued.
Inactive Switches the pin to an inactive state and releases the memory of the allocator.
Receive Returns the next block of data from the stream.
SetMediaType Sets the media type of the pin.

Implemented IPin Methods
Name Description
QueryId Retrieves an identifier for the pin.


CRendererInputPin::Active

CRendererInputPin Class

Switches the pin to the active (paused or running) mode.

HRESULT Active( );

Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBasePin::Active and calls the renderer filter's CBaseRenderer::Active member function.


CRendererInputPin::Allocator

CRendererInputPin Class

Retrieves a pointer to the default memory allocator inherited from CBaseInputPin.

IMemAllocator* Allocator( ) const;

Return Values

Returns a pointer to an IMemAllocator interface.

Remarks

The returned pointer is CBaseInputPin::m_pAllocator.


CRendererInputPin::BeginFlush

CRendererInputPin Class

Informs the pin to begin a flush operation.

HRESULT BeginFlush( );

Return Values

Returns an HRESULT value.

Remarks

This member function implements the IPin::BeginFlush method. It overrides CBaseInputPin::BeginFlush and calls the renderer filter's BeginFlush member function before calling the base class implementation.


CRendererInputPin::BreakConnect

CRendererInputPin Class

Override this member function to add customized code upon breaking a connection.

HRESULT BreakConnect( );

Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBasePin::BreakConnect and calls the renderer filter's BreakConnect member function before calling the base class implementation.


CRendererInputPin::CheckMediaType

CRendererInputPin Class

Override this member function to determine if the pin can support this specific media type.

HRESULT CheckMediaType(
  const CMediaType *pmt
  );

Parameters
pmt
Pointer to a media type object that contains the proposed media type.
Return Values

Returns an HRESULT value.

Remarks

This member function is typically called before calling the CRendererInputPin::SetMediaType member function.

This member function overrides CBasePin::CheckMediaType and calls the pure virtual CBaseRenderer::CheckMediaType member function, which must be overridden.


CRendererInputPin::CompleteConnect

CRendererInputPin Class

Override this member function to inform the derived class when the connection process has completed.

HRESULT CompleteConnect(
  IPin *pReceivePin
  );

Parameters
pReceivePin
Pointer to the connected (receiving) pin.
Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBasePin::CompleteConnect and calls the renderer filter's CompleteConnect member function before calling the base class implementation.


CRendererInputPin::CRendererInputPin

CRendererInputPin Class

Constructs a CRendererInputPin object.

CRendererInputPin(
  CBaseRenderer *pRenderer,
  HRESULT *phr,
  LPCWSTR Name
  );

Parameters
pRenderer
Pointer to the rendering filter in the base class.
phr
Pointer to an HRESULT value.
Name
Pin name.
Return Values

No return value.


CRendererInputPin::EndFlush

CRendererInputPin Class

Informs the pin to end a flush operation.

HRESULT EndFlush(void);

Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBaseInputPin::EndFlush and calls the renderer filter's EndFlush member function before calling the base class implementation.

Note that because this is a renderer, it does not pass the flush on downstream.


CRendererInputPin::EndOfStream

CRendererInputPin Class

Informs the 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 IPin::EndOfStream method. It calls CheckStreaming to see that the filter is in a streaming state and then calls the CBaseRenderer::EndOfStream member function.


CRendererInputPin::Inactive

CRendererInputPin Class

Informs the pin that it is going into the inactive state.

HRESULT Inactive(void);

Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBaseInputPin::Inactive. It calls the renderer filter's CBaseRenderer::Inactive member function, which returns NOERROR by default.


CRendererInputPin::QueryId

CRendererInputPin Class

Retrieves an identifier for the pin.

HRESULT QueryId(
  LPWSTR *Id
  );

Parameters
Id
Pin identifier.
Return Values

Returns an HRESULT value.

Remarks

This member function implements the IPin::QueryId method. It overrides the CBasePin::QueryId member function and assigns the string "In" to Id. Note that it uses the Microsoft® Win32® CoTaskMemAlloc function to initialize Id, so the user is responsible for freeing the format block by using CoTaskMemFree.


CRendererInputPin::Receive

CRendererInputPin Class

Returns the next block of data from the stream.

HRESULT Receive(
  IMediaSample *pMediaSample
  );

Parameters
pMediaSample
Media sample.
Return Values

Returns an HRESULT value.

Remarks

This member function implements the IMemInputPin::Receive method, and it overrides the CBaseInputPin::Receive member function, which it calls to verify formats.

This is a blocking synchronous member function. It blocks and waits until it is time for the sample to be rendered. (It calls CBaseRenderer::Receive, which actually does the blocking.) Because only one sample is ever outstanding, this member function checks the media type and calls CRendererInputPin::SetMediaType to change the pin's media type if the sample's type has changed.

Call the IUnknown::AddRef method if you must hold the returned data block beyond the completion of the CRendererInputPin::Receive member function. If you call AddRef, be sure to call the IUnknown::Release method upon completion of AddRef.


CRendererInputPin::SetMediaType

CRendererInputPin Class

Override this member function to set the media type of the pin.

HRESULT SetMediaType(
  const CMediaType *pmt
  );

Parameters
pmt
Pointer to a media type object that was previously agreed upon.
Return Values

Returns an HRESULT value.

Remarks

This member function overrides CBasePin::SetMediaType and calls the renderer filter's SetMediaType member function, which returns NOERROR by default, after calling the base class implementation.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page