Ask a questionAsk a question
 

AnswerEC_COMPLETE notification

  • Monday, October 19, 2009 1:32 PMpunkypogo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hello,

    I have written a custom renderer (inherits from CBaseFilter) which writes received samples into shared memory.
    Basically, this filter is connected to a file reader:

    File reader (async) -> Color space converter -> custom filter (renderer)

    My problem is that I never receive any EC_COMPLETE notification from the graph builder, though I can reveive other notifications (EC_ACTIVATE, EC_NEED_RESTART, etc.). I guess something is missing in my implementation. I tried to do like this in the implementation of my input pin (inherits from CBaseInputPin):

    STDMETHODIMP CInputPin::EndOfStream()
    {
    	m_pFilter->NotifyEvent( EC_COMPLETE, 0, (LONG_PTR)m_pFilter );
    	return CBaseInputPin::EndOfStream();
    }
    
    But it doesn't work.

    What am I missing?

    Cheers.

Answers

  • Wednesday, November 04, 2009 10:08 AMpunkypogo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I finally got it!

    I don't know why (I didn't notice it in the documentation), but my filter has to implement the IMediaSeeking interface. So I now receive the EC_COMPLETE notification!
    • Marked As Answer bypunkypogo Wednesday, November 04, 2009 10:08 AM
    •  

All Replies

  • Monday, October 19, 2009 3:26 PMMichel Roujansky - DirectShow TrainerMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    STDMETHODIMP CInputPin::EndOfStream()
    {
        return m_pFilter->NotifyEvent( EC_COMPLETE, 0, (LONG_PTR)(IBaseFilter *)m_pFilter );
    }
    
    
    No need to call the base class, it does nothing.
    Michel Roujansky, http://www.roujansky.com
  • Tuesday, October 20, 2009 8:39 AMpunkypogo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Michel,

    I tried what you said, but it doesn't change anything.
    Does my custom renderer has to do something special?
  • Tuesday, November 03, 2009 3:32 PMpunkypogo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I'm back with this problem, I'm still stuck.
    The NotifyEvent method return S_OK, but my application isn't noticed. Am I missing something ?

    Thanks for your help.
  • Wednesday, November 04, 2009 10:08 AMpunkypogo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I finally got it!

    I don't know why (I didn't notice it in the documentation), but my filter has to implement the IMediaSeeking interface. So I now receive the EC_COMPLETE notification!
    • Marked As Answer bypunkypogo Wednesday, November 04, 2009 10:08 AM
    •