locked
EVR Problem RRS feed

  • Question

  • I made a filter which inherited from CTransformFilter,and In the Transform function I call

    pOut->SetMediaType(&m_pOutput->CurrentMediaType()) on every output media sample.But when this filter connected to EVR,I find the video speed is wrong,and very fast.
    When I remove the pOut->SetMediaType(&m_pOutput->CurrentMediaType()) ,the video played good.But Why?

    Thank you very much.

    Saturday, June 12, 2010 8:35 AM

Answers

  • When I remove the pOut->SetMediaType(&m_pOutput->CurrentMediaType()) ,the video played good.But Why?

    Because documentation says:

    Remarks

    By default, every sample has the same media type as the previous sample. (The pin connection determines the original media type.) Call this method to make limited changes to the media type, such as changing the palette. To make a significant change to the media type, the pins might need to reconnect and renegotiate the media type.

     


    http://alax.info/blog/tag/directshow
    Saturday, June 12, 2010 7:49 PM

All replies

  • Another question, what is the differences about the mediatype between the IMediaSample(CMediaSample) and the outputpin.

    I think the two above should be same.But why dshow make the two mediatype?

    Saturday, June 12, 2010 9:22 AM
  • When I remove the pOut->SetMediaType(&m_pOutput->CurrentMediaType()) ,the video played good.But Why?

    Because documentation says:

    Remarks

    By default, every sample has the same media type as the previous sample. (The pin connection determines the original media type.) Call this method to make limited changes to the media type, such as changing the palette. To make a significant change to the media type, the pins might need to reconnect and renegotiate the media type.

     


    http://alax.info/blog/tag/directshow
    Saturday, June 12, 2010 7:49 PM
  • Another question, what is the differences about the mediatype between the IMediaSample(CMediaSample) and the outputpin.

    I think the two above should be same.But why dshow make the two mediatype?

    The MSDN quote above also answers this question. A sample's media type is an indication of [limited] change.

    http://alax.info/blog/tag/directshow
    Saturday, June 12, 2010 7:50 PM
  • Thanks to the reply.

    what does the limited change mean?

    Sunday, June 13, 2010 1:34 AM
  • It means a change that the other filter is willing to accept without requiring a dynamic reconnection. In the case of the EVR, the limit is pretty much a change in resolution.

    Since you are not changing format, do not set the media type on the sample unless you want to confuse and break the EVR.


    MVP :: DirectShow / MediaFoundation http://www.riseoftheants.com/mmx/faq.htm
    Sunday, June 13, 2010 2:38 AM